From 1c9e53869cafc68b079af7d2bb3b150d2c041901 Mon Sep 17 00:00:00 2001 From: zhujiyan <17812234322@163.com> Date: Thu, 26 Sep 2024 13:42:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B9=E6=A1=88=E6=95=B0=E6=8D=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E5=88=97=E8=A1=A8=E7=82=B9=E5=87=BB=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E9=A1=B9=EF=BC=8C=E6=95=B0=E6=8D=AE=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E4=BF=AE=E6=94=B9=E8=AE=BE=E5=A4=87=E7=BB=91=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device/planData/components/popup.vue | 32 +++++++++++++++---- .../device/planData/components/schemeTree.vue | 4 +-- src/views/govern/device/planData/index.vue | 11 +++---- 3 files changed, 32 insertions(+), 15 deletions(-) diff --git a/src/views/govern/device/planData/components/popup.vue b/src/views/govern/device/planData/components/popup.vue index d0e0f94..9e4d160 100644 --- a/src/views/govern/device/planData/components/popup.vue +++ b/src/views/govern/device/planData/components/popup.vue @@ -23,7 +23,7 @@ - + - + @@ -386,9 +386,19 @@ const title: any = ref('') const popupType: any = ref(null) //方案/测试项id const planId: any = ref('') +//打开的类型 +const openType = ref('') +const detailsType = (val: any) => { + openType.value = val + if (val == 'tree') { + activeName.value = 0 + } + if (val == 'table') { + activeName.value = 1 + } +} //回显方案、测试项操作 const details = (val: any) => { - console.log(val, '回显方案测试项操作66666') if (val.records && val.records.length != 0) { form.value = { describe: val.describe, @@ -425,7 +435,6 @@ const open = async (val: any, id: any) => { title.value = val == 0 ? '新增方案' : val == 1 ? '修改方案' : val == 2 ? '新增测试项' : '修改测试项' dialogVisible.value = true planId.value = id - console.log(11111, val, '==============>>>>>>>>') //新增方案或者测试项数据 if (val == 0 || val == 2) { initForm() @@ -444,7 +453,7 @@ const open = async (val: any, id: any) => { getDeviceList({ id: id, isTrueFlag: 1 }).then(res => { bindList.value = res.data }) - activeName.value = 0 + // activeName.value = 0 } } //获取选择的绑定的数据 @@ -558,6 +567,17 @@ const submit = () => { } //修改测试项 if (popupType.value == 3) { + let subForm = JSON.parse(JSON.stringify(form1.value)) + subForm.list = checkedIdList.value + updateRecord(subForm).then((res: any) => { + if (res.code == 'A0000') { + ElMessage.success('修改测试项成功') + initForm() + emit('onSubmit') + close() + } + }) + return ruleFormRef2.value.validate((valid: any) => { if (valid) { let subForm = JSON.parse(JSON.stringify(form1.value)) @@ -576,7 +596,7 @@ const submit = () => { }) } } -defineExpose({ open, details }) +defineExpose({ open, details, detailsType })