微调
This commit is contained in:
@@ -179,6 +179,8 @@ import { useDictStore } from '@/stores/modules/dict'
|
||||
import { useHandleData } from '@/hooks/useHandleData'
|
||||
import { scriptDtlsCheckDataList } from '@/api/device/testScript/index'
|
||||
import ViewRow from '@/views/machine/testScript/components/viewRow.vue'
|
||||
import { startSimulateTest,closeSimulateTest } from '@/api/device/controlSource/index.ts'
|
||||
import { controlSource } from '@/api/device/interface/controlSource'
|
||||
interface TabOption {
|
||||
label?: string
|
||||
name?: string
|
||||
@@ -197,6 +199,10 @@ const props = defineProps({
|
||||
formContent: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
formControl: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
const showDialog = ref(false)
|
||||
@@ -204,6 +210,7 @@ const viewDialog = ref(false)
|
||||
const dictStore = useDictStore()
|
||||
const activeName = ref('')
|
||||
const childActiveName = ref('')
|
||||
const childActiveIndex = ref(0)
|
||||
const firstName = 'first'
|
||||
const viewRowRef = ref()
|
||||
const communicationList = ref([])
|
||||
@@ -226,6 +233,14 @@ const column = ref([
|
||||
num: 4
|
||||
}
|
||||
])
|
||||
|
||||
const emit = defineEmits(['update:activeName','update:activeIndex'])
|
||||
const controlContent = ref<controlSource.ResControl>({
|
||||
userPageId: '',
|
||||
scriptId: '',
|
||||
scriptIndex: 0,
|
||||
sourceId: '',
|
||||
})
|
||||
// 获取树
|
||||
const getTree = () => {
|
||||
getTreeData({
|
||||
@@ -273,7 +288,10 @@ const getTree = () => {
|
||||
const setTab = row => {
|
||||
activeName.value = row.activeName
|
||||
childActiveName.value = row.childActiveName
|
||||
childActiveIndex.value = row.activeIndex
|
||||
getTree()
|
||||
emit('update:activeName', activeName.value) // 触发事件并传递 activeName.value
|
||||
emit('update:activeIndex', row.activeIndex) // 触发事件并传递 activeName.value
|
||||
}
|
||||
const copyActiveName = ref('')
|
||||
// 获取通讯脚本点击
|
||||
@@ -353,6 +371,25 @@ const view = (row: Partial<TestScript.ResTestScript> = {}) => {
|
||||
|
||||
}
|
||||
|
||||
// 定义 startLoading 方法
|
||||
const startLoading = async () => {
|
||||
// 启动加载逻辑
|
||||
controlContent.value.userPageId = 'cdf'
|
||||
controlContent.value.scriptId = '9ff96807cf8c7524587982ed8baa8b57'
|
||||
controlContent.value.scriptIndex = props.formControl.scriptIndex
|
||||
controlContent.value.sourceId = props.formControl.sourceId
|
||||
await startSimulateTest(controlContent.value)
|
||||
}
|
||||
|
||||
// 定义 startLoading 方法
|
||||
const stopLoading = async () => {
|
||||
// 启动加载逻辑
|
||||
controlContent.value.userPageId = 'cdf'
|
||||
controlContent.value.scriptId = '9ff96807cf8c7524587982ed8baa8b57'
|
||||
controlContent.value.scriptIndex = childActiveIndex.value
|
||||
controlContent.value.sourceId = props.formControl.sourceId
|
||||
await closeSimulateTest(controlContent.value)
|
||||
}
|
||||
|
||||
// 获取左边树数据
|
||||
// 新增保存
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
:highlight-current="true"
|
||||
@node-click="handleNodeClick"
|
||||
show-checkbox
|
||||
@check-change="handleCheckChange"
|
||||
@check-change="handleCheckChange"
|
||||
>
|
||||
<template #default="{ node, data }">
|
||||
<el-tooltip effect="dark" :content="data.sourceDesc || data.scriptTypeName" placement="top" :hide-after="0">
|
||||
@@ -39,8 +39,9 @@ const defaultProps = {
|
||||
}
|
||||
const activeName = ref('')
|
||||
const childActiveName = ref('')
|
||||
const activeIndex = ref()
|
||||
const handleNodeClick = (data, node) => {
|
||||
console.log('handleNodeClick', data, node)
|
||||
console.log('handleNodeClick', props.treeData)
|
||||
let code = ['Base', 'VOL', 'Freq', 'Harm', 'Base_0_10', 'Base_20_85', 'Base_110_200']
|
||||
const parents = getParentNodes(node, [])
|
||||
parents.pop()
|
||||
@@ -54,7 +55,8 @@ const handleNodeClick = (data, node) => {
|
||||
childActiveName.value = childActive
|
||||
emit('setTab', {
|
||||
activeName: active,
|
||||
childActiveName: childActive
|
||||
childActiveName: childActive,
|
||||
activeIndex:data.index
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -98,6 +100,7 @@ function findTargetCodes(data: any[], targetCodes: string[]) {
|
||||
function handleCheckChange(data, checked) {
|
||||
if (checked) {
|
||||
// Uncheck all other nodes
|
||||
console.log('handleCheckChange', data.id)
|
||||
props.treeData.forEach((node) => {
|
||||
if (node.id !== data.id) {
|
||||
node.checked = false;
|
||||
|
||||
Reference in New Issue
Block a user