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 })