diff --git a/frontend/src/api/plan/interface/index.ts b/frontend/src/api/plan/interface/index.ts index 57f1703..a5b5f9d 100644 --- a/frontend/src/api/plan/interface/index.ts +++ b/frontend/src/api/plan/interface/index.ts @@ -25,7 +25,8 @@ export namespace Plan { associateReport:number;//是否关联报告模板 0否 1是 reportTemplateName:string; - reportTemplateVersion:string + reportTemplateVersion:string; + dataRule:string //数据处理原则 } // 检测计划 + 分页 diff --git a/frontend/src/api/system/base/interface/index.ts b/frontend/src/api/system/base/interface/index.ts index cdb96cf..865b131 100644 --- a/frontend/src/api/system/base/interface/index.ts +++ b/frontend/src/api/system/base/interface/index.ts @@ -8,7 +8,6 @@ export namespace Base { id: string; //系统配置表Id autoGenerate:number;//检测报告是否自动生成0 否;1是 maxTime:number;//最大复检次数,默认3次 - dataRule:string;//数据处理原则,关联字典(所有值、部分值、cp95值、平均值、任意值),默认任意值 state: number; //状态 createBy?: string| null; //创建用户 createTime?: string| null; //创建时间 diff --git a/frontend/src/views/plan/planList/components/planPopup.vue b/frontend/src/views/plan/planList/components/planPopup.vue index bee6e7a..e017b35 100644 --- a/frontend/src/views/plan/planList/components/planPopup.vue +++ b/frontend/src/views/plan/planList/components/planPopup.vue @@ -47,6 +47,16 @@ :value="option.value" /> + + + + + @@ -181,6 +191,7 @@ const filterMethod = (query: string, item: { label?: string }) => { associateReport:0, reportTemplateName:'', reportTemplateVersion:'', + dataRule:'', }) return { dialogVisible, titleType, formContent } } @@ -214,6 +225,7 @@ const filterMethod = (query: string, item: { label?: string }) => { associateReport:0, reportTemplateName:'', reportTemplateVersion:'', + dataRule:'', } ) @@ -233,6 +245,7 @@ const baseRules: Record> = { datasourceIds: [{ required: true, message: '数据源必选!', trigger: 'change' }], scriptId: [{ required: true, message: '检测脚本必选!', trigger: 'change' }], errorSysId: [{ required: true, message: '误差体系必选!', trigger: 'change' }], + dataRule: [{ required: true, message: '数据处理原则必选!', trigger: 'change' }], }; // 使用计算属性根据 scene 动态生成规则 @@ -278,12 +291,19 @@ const rules = computed(() => { if (formContent.id) { + // 把数据处理原则转成字典ID + const patternItem = dictStore.getDictData('Data_Rule').find(item => item.name === formContent.dataRule); + if (patternItem) { + formContent.dataRule = patternItem.id; + } + if( mode.value === '比对式'){ await updatePlan(formContent) }else{ await updatePlan({...formContent,'sourceIds':[formContent.sourceIds],'datasourceIds':[formContent.datasourceIds]}); } + ElMessage.success({ message: `${dialogTitle.value}成功!` }) } else { @@ -292,6 +312,11 @@ const rules = computed(() => { if (patternItem) { formContent.pattern = patternItem.id; } + // 把数据处理原则转成字典ID + const patternItem2 = dictStore.getDictData('Data_Rule').find(item => item.name === formContent.dataRule); + if (patternItem2) { + formContent.dataRule = patternItem2.id; + } if( mode.value === '比对式'){ await addPlan(formContent); }else{ diff --git a/frontend/src/views/plan/planList/index.vue b/frontend/src/views/plan/planList/index.vue index a1f986d..1706aa9 100644 --- a/frontend/src/views/plan/planList/index.vue +++ b/frontend/src/views/plan/planList/index.vue @@ -120,18 +120,18 @@ const dataSourceType = computed(() => { // 表格配置项 const columns = reactive[]>([ - { type: 'selection', fixed: 'left', width: 70 }, - { type: 'index', fixed: 'left', width: 70, label: '序号' }, + { type: 'selection', fixed: 'left', minWidth: 70 }, + { type: 'index', fixed: 'left', minWidth: 70, label: '序号' }, { prop: 'name', label: '名称', - width: 220, + minWidth: 220, search: { el: 'input' }, }, { prop: 'testState', label: '检测状态', - width: 120, + minWidth: 120, enum:dictTestState, search: { el:'select',props: { filterable: true }}, fieldNames: { label: 'label', value: 'id' }, @@ -144,7 +144,7 @@ const columns = reactive[]>([ { prop: 'reportState', label: '检测报告状态', - width: 120, + minWidth: 120, enum:dictReportState, search: { el: 'select', props: { filterable: true } }, fieldNames: { label: 'label', value: 'id' }, @@ -157,7 +157,7 @@ const columns = reactive[]>([ { prop: 'result', label: '检测结果', - width: 120, + minWidth: 120, enum:dictResult, search: { el: 'select', props: { filterable: true } }, fieldNames: { label: 'label', value: 'id' }, @@ -171,7 +171,7 @@ const columns = reactive[]>([ { prop: 'createTime', label: '创建时间', - width: 200, + minWidth: 200, render: scope => { if (scope.row.createTime) { const date = new Date(scope.row.createTime); @@ -217,7 +217,7 @@ const columns = reactive[]>([ { prop: 'scriptId', label: '检测脚本', - width: 360, + minWidth: 360, render: scope => { return ( {scope.row.scriptName} @@ -227,7 +227,7 @@ const columns = reactive[]>([ { prop: 'errorSysId', label: '误差体系', - width: 240, + minWidth: 240, render: scope => { return ( showData(scope.row)}> @@ -266,8 +266,15 @@ const columns = reactive[]>([ return dictItem ? dictItem.name : '/' // 如果找到匹配的项,返回对应的 name }, }, + { + prop: 'dataRule', + label: '数据处理原则', + enum: dictStore.getDictData('Data_Rule'), + fieldNames: { label: 'name', value: 'id' }, + minWidth: 120, + }, - { prop: 'operation', label: '操作', fixed: 'right', width: 300 }, + { prop: 'operation', label: '操作', fixed: 'right', minWidth: 300 }, ]) diff --git a/frontend/src/views/system/base/index.vue b/frontend/src/views/system/base/index.vue index e2c6459..54b255c 100644 --- a/frontend/src/views/system/base/index.vue +++ b/frontend/src/views/system/base/index.vue @@ -20,18 +20,18 @@ - - - - - - - + + + + + + + + + + + + @@ -228,7 +228,6 @@ const TestConfigForm = ref({ id: '', autoGenerate: 0, maxTime: 3, - dataRule: '', state: 1, //状态 })