方案测试项bug修改

This commit is contained in:
zhujiyan
2024-09-26 11:20:12 +08:00
parent a385f360ba
commit e34fb26a4c
3 changed files with 45 additions and 21 deletions

View File

@@ -22,7 +22,6 @@
</el-form-item>
</el-form>
<!-- 测试项信息&数据绑定页面 -->
{{ popupType }}
<el-tabs type="border-card" v-model="activeName" v-if="popupType != 0 && popupType != 1">
<el-tab-pane label="测试项信息" :name="0">
<el-form
@@ -193,7 +192,7 @@ const emit = defineEmits(['onSubmit'])
//表单数据
const form = ref({})
//测试项数据
const form1 = ref({})
const form1: any = ref({})
//折叠面板初始值
const activeTab = ref(0)
//tab初始值
@@ -223,9 +222,6 @@ const initForm = () => {
form.value = {
itemName: '', //方案名称
describe: '' //方案描述
//测试项数据
// records: [
// ]
}
//测试项数据
form1.value = {
@@ -392,6 +388,17 @@ const popupType: any = ref(null)
const planId: any = ref('')
//回显方案、测试项操作
const details = (val: any) => {
console.log(val, '回显方案测试项操作66666')
if (val.records && val.records.length != 0) {
form.value = {
describe: val.describe,
itemName: val.itemName
}
} else {
form1.value = val
}
return
//修改方案回显
if (popupType.value == 1) {
form.value = JSON.parse(JSON.stringify(val))
@@ -491,7 +498,7 @@ const close = () => {
const submit = () => {
//新增方案
if (popupType.value == 0) {
ruleFormRef1.value.validate(valid => {
ruleFormRef1.value.validate((valid: any) => {
if (valid) {
const subForm = {
itemName: form.value.itemName,

View File

@@ -81,7 +81,7 @@
<script lang="ts" setup>
import { ref, nextTick, watch, defineProps, defineEmits, inject, onMounted } from 'vue'
import { getSchemeTree } from '@/api/cs-device-boot/planData'
import { getSchemeTree, getTestRecordInfo } from '@/api/cs-device-boot/planData'
import { useConfig } from '@/stores/config'
import useCurrentInstance from '@/utils/useCurrentInstance'
import { ElTree } from 'element-plus'
@@ -188,16 +188,24 @@ const add = (node: any, data: any) => {
}
/** 编辑树节点 */
const edit = async (node: Node, data: any) => {
console.log(data, '????????????')
planId.value = data.id
//修改方案
if (data.children) {
await handleOpen(1, planId.value)
}
//修改测试项
else {
monitorId.value = data.id
await handleOpen(3, planId.value)
}
await getTestRecordInfo(planId.value)
.then(res => {
console.log(res, '++++++++++++++++++++195========>')
//修改方案
if (data.children) {
dialogRef.value.details(res.data)
handleOpen(1, planId.value)
}
//修改测试项
else {
monitorId.value = data.id
dialogRef.value.details(res.data.records[0])
handleOpen(3, planId.value)
}
})
.catch(e => {})
}
/** 删除树节点 */
const del = (node: Node, data: any) => {