This commit is contained in:
sjl
2025-03-07 14:00:20 +08:00
parent f68da773ab
commit d3a74e830f
4 changed files with 62 additions and 10 deletions

View File

@@ -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)
}
// 获取左边树数据
// 新增保存