This commit is contained in:
sjl
2025-03-11 18:58:26 +08:00
parent 9af98b034f
commit 059864d193
4 changed files with 29 additions and 18 deletions

View File

@@ -155,7 +155,7 @@
type="primary"
size="large"
@click="startLoading"
:disabled="startDisabeld"
>启动</el-button>
<el-button :icon="VideoPause"
type="primary"
@@ -286,7 +286,7 @@ const second = ref(0)
const emit = defineEmits(['update:activeName','update:activeIndex','update:startDisabeld','update:pauseDisabled'])
watch(()=>props.formControl.scriptId,()=>{
console.log("切换脚本",props.formControl.scriptId);
//console.log("切换脚本",props.formControl.scriptId);
if(props.formControl.scriptId!=''){
getTree()
}
@@ -304,13 +304,14 @@ const getTree = () => {
}).then(res => {
if (res.code === 'A0000') {
treeData.value = res.data
//console.log('tree',res.data)
// 为 treeData 及其子节点添加 id
let idCounter = 0;
const addIdToTree = (nodes: any[]) => {
nodes.forEach(node => {
node.id = idCounter++; // 为每个节点添加唯一的 id
if (node.children && node.children.length > 0) {
node.disabled = true
addIdToTree(node.children); // 递归为子节点添加 id
}
});
@@ -348,6 +349,9 @@ const getTree = () => {
}
})
})
//console.log('2222',treeData.value)
tabChange()
}
})
@@ -368,7 +372,7 @@ const setTab = row => {
const copyActiveName = ref('')
// 获取通讯脚本点击
const getCommunication = () => {
console.log('controlSourceDetail',communRef.value[0]?.getData())
//console.log('controlSourceDetail',communRef.value[0]?.getData())
communicationList.value = communRef.value[0]?.getData()
}
// 切换大tab控制小tab
@@ -410,7 +414,7 @@ const inquireTable = () => {
}
})
console.log('treeData',treeData.value)
//console.log('treeData',treeData.value)
}