表单验证

This commit is contained in:
sjl
2024-10-30 15:19:47 +08:00
parent f9bb15ad24
commit 0c2f59a0a7
21 changed files with 736 additions and 603 deletions

View File

@@ -50,32 +50,36 @@ import { reactive,ref } from 'vue'
import type { ErrorSystem } from '@/api/error/interface'
import ErrorSystemDialog from "@/views/machine/errorSystem/components/ErrorSystemDialog.vue"; // 导入子组件
import ErrorStandardDialog from "@/views/machine/errorSystem/components/ErrorStandardDialog.vue"; // 导入子组件
import { useDictStore } from '@/stores/modules/dict'
const dictStore = useDictStore()
let multipleSelection = ref<string[]>([])
const errorData = errorDataList.errordata
const dialogFormVisible = ref(false)
const dialogTitle = ref('新增误差体系')
const dialogForm = ref<ErrorSystem.ErrorSystemList>({
id: '',
name: '',
publishTime: '',
year:'',
level:'',
state: '',
id: '',
name: '',
standard_Name:'',
standard_Time:'',
dev_Level:'',
enable:1,
state:1,
});
const detail_dialogFormVisible = ref(false)
const detail_dialogTitle = ref('Q/GDW 10650.2-2021 误差体系')
const detail_dialogForm = ref<ErrorSystem.ErrorSystemDetail>({
const detail_dialogForm = ref<ErrorSystem.Error_detail>({
measured: '',//被测量
deviceLevel: '',//检测装置级别
measurementType:'',
condition: '',//测量条件
maxErrorValue: '',//最大误差
});
// 表格配置项
const columns = reactive<ColumnProps<ErrorSystem.ErrorSystemList>[]>([
const columns = ref<ColumnProps<ErrorSystem.ErrorSystemList>[]>([
{ type: 'selection', fixed: 'left', width: 70 },
{
prop: 'id',
@@ -85,28 +89,29 @@ const columns = reactive<ColumnProps<ErrorSystem.ErrorSystemList>[]>([
{
prop: 'name',
label: '误差体系名称',
},
{
prop: 'year',
prop: 'Standard_Name',
label: '参照标准名称',
},
{
prop: 'standard_Time',
label: '标准实施年份',
width: 200,
search: { el: 'input' },
},
{
prop: 'level',
prop: 'dev_Level',
label: '适用设备等级',
width: 200,
width: 120,
search: { el: 'select', props: { filterable: true } },
},
{ prop: 'operation', label: '操作', fixed: 'right' ,width: 400, },
{ prop: 'operation', label: '操作', fixed: 'right' ,width: 300,},
])
// 打开编辑对话框
const openEditDialog = (errorSystem: ErrorSystem.ErrorSystemList) => {
errorSystem.publishTime ='2024'
errorSystem.state = '启用';
errorSystem.standard_Time ='2024'
dialogForm.value = {...errorSystem};
dialogTitle.value = '编辑误差体系';
dialogFormVisible.value = true; // 打开对话框
@@ -114,12 +119,13 @@ const openEditDialog = (errorSystem: ErrorSystem.ErrorSystemList) => {
const openAddDialog = () => {
dialogForm.value = {
id: '',
name: '',
publishTime: '',
year: '',
level: '',
state: '',
id: '',
name: '',
standard_Name:'',
standard_Time:'',
dev_Level:'',
enable:1,
state:1,
};
dialogTitle.value = '新增误差体系';
dialogFormVisible.value = true; // 打开对话框