From 1b171d4b8d4d2642f4e5ba17c4f9386185776137 Mon Sep 17 00:00:00 2001 From: caozehui <2427765068@qq.com> Date: Thu, 5 Dec 2024 13:43:05 +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/views/machine/device/index.vue | 2 +- frontend/src/views/machine/errorSystem/index.vue | 2 +- .../machine/testSource/components/parameterPopup.vue | 5 ++--- .../machine/testSource/components/parameterTable.vue | 8 +++++++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/frontend/src/views/machine/device/index.vue b/frontend/src/views/machine/device/index.vue index f18c3c1..95442a4 100644 --- a/frontend/src/views/machine/device/index.vue +++ b/frontend/src/views/machine/device/index.vue @@ -67,7 +67,7 @@ const columns = reactive[]>([ { type: 'index', fixed: 'left', width: 70, label: '序号' }, { prop: 'name', - label: '设备名称', + label: '名称', search: { el: 'input' }, minWidth: 200, }, diff --git a/frontend/src/views/machine/errorSystem/index.vue b/frontend/src/views/machine/errorSystem/index.vue index fb2b341..fa58719 100644 --- a/frontend/src/views/machine/errorSystem/index.vue +++ b/frontend/src/views/machine/errorSystem/index.vue @@ -48,7 +48,7 @@ const columns = ref[]>([ { type: 'index', fixed: 'left', width: 70, label: '序号' }, { prop: 'name', - label: '误差体系名称', + label: '名称', }, { prop: 'standardName', diff --git a/frontend/src/views/machine/testSource/components/parameterPopup.vue b/frontend/src/views/machine/testSource/components/parameterPopup.vue index 122a97e..f55c923 100644 --- a/frontend/src/views/machine/testSource/components/parameterPopup.vue +++ b/frontend/src/views/machine/testSource/components/parameterPopup.vue @@ -83,8 +83,8 @@ function useMetaInfo() { const formContent = reactive({ id: "", sourceParamType: "", - sourceParamDesc: "", sourceParamValue: "", + sourceParamDesc: "", sort: 100, pId: "0", }) @@ -115,8 +115,8 @@ const resetFormContent = () => { Object.assign(formContent, { id: "", sourceParamType: "", - sourceParamDesc: "", sourceParamValue: "", + sourceParamDesc: "", sort: 100, pId: "0", }) @@ -140,7 +140,6 @@ const save = () => { let newUpdateParameter = toRaw({...formContent}) delete newUpdateParameter.children emit('get-parameter', newUpdateParameter) - ElMessage.success({message: `${dialogTitle.value}成功!`}) close() } }) diff --git a/frontend/src/views/machine/testSource/components/parameterTable.vue b/frontend/src/views/machine/testSource/components/parameterTable.vue index 1cbfa60..f8a34bd 100644 --- a/frontend/src/views/machine/testSource/components/parameterTable.vue +++ b/frontend/src/views/machine/testSource/components/parameterTable.vue @@ -40,6 +40,7 @@ import ParameterPopup from '@/views/machine/testSource/components/parameterPopup import {reactive, ref, watch} from 'vue' import {generateUUID} from "@/styles"; import {defineEmits} from "vue/dist/vue"; +import {ElMessage} from "element-plus"; const parameterPopup = ref() const dictStore = useDictStore() @@ -178,14 +179,20 @@ const copyRow = (row) => { } const getParameter = (data: TestSource.ParameterType) => { + if (originalParameterArr.some(item => item.sourceParamType == data.sourceParamType)) { + ElMessage.error({message: '参数类型已存在!'}) + return; + } let index = originalParameterArr.findIndex(item => item.id === data.id) if (index === -1) { data.id = generateUUID() // 新增 originalParameterArr.push(data) + ElMessage.success({message: '新增成功!'}) } else { // 编辑 originalParameterArr[index] = data + ElMessage.success({message: '编辑成功!'}) } emit('change-parameter', originalParameterArr) tableData.value = getTreeData(originalParameterArr) @@ -193,7 +200,6 @@ const getParameter = (data: TestSource.ParameterType) => { //清空数据 const clearData = () => { - console.log('clearData') originalParameterArr = [] tableData.value = [] }