修改测试问题

This commit is contained in:
fks-xuxinyue
2024-08-22 15:27:55 +08:00
parent 0009360d9f
commit ca74de5b37
15 changed files with 559 additions and 287 deletions

View File

@@ -20,7 +20,9 @@
:footer-style="{ textAlign: 'right' }"
destroyOnClose
@close="onClose">
<div class="ns-form-title"><div class="title">{{text}}</div></div>
<div class="ns-form-title"
><div class="title">{{ text }}</div></div
>
<a-form
ref="formRef"
:model="formState"
@@ -28,13 +30,21 @@
:label-col="labelCol"
:wrapper-col="wrapperCol">
<a-form-item ref="name" label="报告名称" name="reportName">
<a-input v-model:value="formState.reportName" placeholder="请输入报告名称" />
<a-input
v-model:value="formState.reportName"
:maxlength="15"
@keydown="handleKeyDown"
placeholder="请输入报告名称" />
</a-form-item>
<a-form-item ref="name" label="报告年度" name="reportYear">
<a-date-picker v-model:value="formState.reportYear" picker="year" valueFormat="YYYY" />
</a-form-item>
<a-form-item ref="name" label="适用标准" name="genericStandard">
<a-input v-model:value="formState.genericStandard" placeholder="请输入适用标准" />
<a-input
v-model:value="formState.genericStandard"
:maxlength="20"
@keydown="handleKeyDown"
placeholder="请输入适用标准" />
</a-form-item>
<a-form-item label="报告周期" name="reportPeriod">
<a-select
@@ -81,7 +91,7 @@
const formRef = ref();
const labelCol = { span: 4 };
const wrapperCol = { span: 20 };
const text = ref('新增报告')
const text = ref('新增报告');
const disabledDate = (current: moment.Moment | null) => {
if (formState.value.reportPeriod === '2') {
const year = current.year();
@@ -105,6 +115,12 @@
formState.value = {};
formRef.value.resetFields();
};
const handleKeyDown = (event: KeyboardEvent) => {
// Check if the pressed key is a space
if (event.code === 'Space') {
event.preventDefault();
}
};
// 点击确定提交
const onSubmit = () => {
formRef.value
@@ -142,7 +158,7 @@
name: 'userAdd',
type: 'primary',
handle: () => {
text.value = '新增报告'
text.value = '新增报告';
visible.value = true;
},
},
@@ -186,7 +202,7 @@
label: '编辑',
name: 'userEdit',
handle: (record: any) => {
text.value = '编辑报告'
text.value = '编辑报告';
visible.value = true;
fetch(carbonInventoryCheck.findById, { id: record.id }).then((res) => {
formState.value = res.data;
@@ -252,7 +268,7 @@
component: 'NsInput',
componentProps: {
placeholder: '请输入报告名称',
maxLength: 30,
maxLength: 20,
},
},
{