From a91367a16e887ec10ea1d95296f4aadbf78d49fd Mon Sep 17 00:00:00 2001 From: sjl <1716605279@qq.com> Date: Tue, 3 Dec 2024 09:50:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/utils/elementBind.ts | 2 +- .../components/errorStandardPopup.vue | 124 +++++++++--------- .../components/errorSystemDetailTable.vue | 4 +- .../src/views/machine/errorSystem/index.vue | 10 +- .../testSource/components/parameterPopup.vue | 22 ++-- .../testSource/components/testSourcePopup.vue | 14 +- .../src/views/machine/testSource/index.vue | 2 +- frontend/src/views/system/base/index.vue | 2 +- 8 files changed, 97 insertions(+), 83 deletions(-) diff --git a/frontend/src/utils/elementBind.ts b/frontend/src/utils/elementBind.ts index 4b4d3c3..2591fef 100644 --- a/frontend/src/utils/elementBind.ts +++ b/frontend/src/utils/elementBind.ts @@ -14,5 +14,5 @@ export const dialogBig = { width:'1200px', closeOnClickModal:false, draggable:true, - class:'dialog-big' + class:'dialog-big', } \ No newline at end of file diff --git a/frontend/src/views/machine/errorSystem/components/errorStandardPopup.vue b/frontend/src/views/machine/errorSystem/components/errorStandardPopup.vue index ec2962d..af49122 100644 --- a/frontend/src/views/machine/errorSystem/components/errorStandardPopup.vue +++ b/frontend/src/views/machine/errorSystem/components/errorStandardPopup.vue @@ -1,12 +1,26 @@ @@ -17,37 +31,30 @@ import type { ErrorSystem } from '@/api/device/interface/error' import errorDataList from '@/api/device/error/errorData' import type { TableColumnCtx } from 'element-plus' +import { da } from 'element-plus/es/locale'; const errorData = errorDataList.errordetail + const dialogTitle = ref() - // 表格配置项 -const columns = reactive[]>([ - { - prop: 'measured', - label: '被测量', - }, - { - prop: 'deviceLevel', - label: '检测装置级别', - }, - { - prop: 'condition', - label: '测量条件', - }, - { - prop: 'measurementType', - label: '测量类型', - }, - { - prop: 'maxErrorValue', - label: '最大误差', - }, -]) - + function useMetaInfo() { + const dialogVisible = ref(false) + const formContent = ref({ + id: '', + name: '', + standardName:'', + standardTime:'', + devLevel:'', + enable:1, + state:1, + }) + return { dialogVisible, formContent } + } + + const { dialogVisible, formContent } = useMetaInfo() interface SpanMethodProps { - row: ErrorSystem.Error_detail - column: TableColumnCtx + row: ErrorSystem.ErrorSystemDetail + column: TableColumnCtx rowIndex: number columnIndex: number } @@ -110,41 +117,38 @@ const spanMethod = ({ }; + // 关闭弹窗 + const close = () => { + dialogVisible.value = false + } - const props = defineProps<{ - visible: boolean; - dialogTitle: string; - - formData: { - measured: string, - deviceLevel: string, - condition: string, - maxErrorValue: string - }; - }>(); - + // 打开弹窗,可能是新增,也可能是编辑 +const open = async (sign: string, data: ErrorSystem.ErrorSystemList) => { + dialogTitle.value = sign + ' 误差体系' + dialogVisible.value = true + if (data.id) { + formContent.value = data as ErrorSystem.ErrorSystemList; + } +} - const emit = defineEmits<{ - (e: 'update:visible', value: boolean): void; - (e: 'submit', data: any): void; - }>(); - - const handleCancel = () => { - emit('update:visible', false); // 关闭对话框 - }; - - // 当 props.visible 改变时,更新 formData - watch(() => props.visible, (newVal) => { - if (!newVal) { - // 这里可以重置表单数据,如果需要的话 - - } - }); - - - - + // 对外映射 +defineExpose({ open }) +const props = defineProps<{ + refreshTable: (() => Promise) | undefined; +}>() diff --git a/frontend/src/views/machine/errorSystem/components/errorSystemDetailTable.vue b/frontend/src/views/machine/errorSystem/components/errorSystemDetailTable.vue index 5bca65c..70730f6 100644 --- a/frontend/src/views/machine/errorSystem/components/errorSystemDetailTable.vue +++ b/frontend/src/views/machine/errorSystem/components/errorSystemDetailTable.vue @@ -101,10 +101,10 @@ import { type ErrorSystem } from '@/api/device/interface/error'; import { useDictStore, } from '@/stores/modules/dict' import {CirclePlus, Delete, EditPen,CopyDocument} from '@element-plus/icons-vue' -import { FormItemRule } from 'element-plus'; + import { FormItemRule } from 'element-plus'; import { onMounted, type PropType, Ref, ref, watch } from 'vue'; import { defineEmits } from 'vue'; -import ProTable from '@/components/ProTable/index.vue' + import ProTable from '@/components/ProTable/index.vue' const emit = defineEmits(['updateTableData']); const multipleSelection = ref([]) const dictStore = useDictStore() diff --git a/frontend/src/views/machine/errorSystem/index.vue b/frontend/src/views/machine/errorSystem/index.vue index c8ff00a..e641f35 100644 --- a/frontend/src/views/machine/errorSystem/index.vue +++ b/frontend/src/views/machine/errorSystem/index.vue @@ -15,7 +15,7 @@ @@ -73,7 +73,13 @@ const columns = ref[]>([ // 打开 drawer(新增、编辑) const openDialog = (titleType: string, row: Partial = {}) => { - errorSystemPopup.value?.open(titleType, row) + if(titleType == 'view'){ + errorStandardPopup.value?.open(row.name, row) + }else{ + errorSystemPopup.value?.open(titleType, row) + } + + } diff --git a/frontend/src/views/machine/testSource/components/parameterPopup.vue b/frontend/src/views/machine/testSource/components/parameterPopup.vue index e78761b..122a97e 100644 --- a/frontend/src/views/machine/testSource/components/parameterPopup.vue +++ b/frontend/src/views/machine/testSource/components/parameterPopup.vue @@ -21,7 +21,7 @@ - @@ -42,7 +42,7 @@