This commit is contained in:
sjl
2025-03-10 19:58:53 +08:00
parent c9857326c6
commit 54e7a91841
5 changed files with 40 additions and 13 deletions

View File

@@ -17,6 +17,19 @@
<!-- <el-button :icon="CirclePlus" type="primary" @click="openDialog('add')">新增</el-button>-->
</div>
<div style="display: flex">
<!-- 通信脚本 -->
<el-tabs type="border-card" v-model="firstName" style="height: 100%" class="hidden-tab">
<el-tab-pane label="通讯脚本" name="first">
<Commun
:activeName="activeName"
:formContent="props.formContent"
:options="props.options"
style="width: 360px"
:disabled="tab.children.length == 0 ? false : true"
ref="communRef"
/>
</el-tab-pane>
</el-tabs>
<!-- 2级tab -->
<el-tabs
type="border-card"
@@ -178,7 +191,7 @@
<script setup lang="ts">
import { type PropType, ref, nextTick, onMounted, watch } from 'vue'
import Tree from './tree.vue'
import Commun from './communication.vue'
import Commun from '@/views/machine/testScript/components//communication.vue'
import {type CascaderOption, ElMessage} from 'element-plus'
import { getTreeData } from '@/api/check/test'
import {CirclePlus, Delete, Check, CopyDocument, View, EditPen, VideoPlay, VideoPause, Loading} from '@element-plus/icons-vue'
@@ -234,7 +247,7 @@ const childActiveName = ref('')
const childActiveIndex = ref(0)
const firstName = 'first'
const viewRowRef = ref()
const communicationList = ref([])
const communicationList = ref<[]>([])
const testProjectPopupRef = ref()
const tableData: any = ref([])
const tabData: any = ref([])
@@ -325,6 +338,7 @@ const setTab = row => {
const copyActiveName = ref('')
// 获取通讯脚本点击
const getCommunication = () => {
console.log('controlSourceDetail',communRef.value[0]?.getData())
communicationList.value = communRef.value[0]?.getData()
}
// 切换大tab控制小tab
@@ -368,13 +382,7 @@ const inquireTable = () => {
}
// 打开 drawer(新增、编辑)
const openDialog = (titleType: string, row: Partial<TestScript.ResTestScript> = {}) => {
showDialog.value = true
setTimeout(() => {
testProjectPopupRef.value?.open(titleType, row)
}, 0)
}
// 查看
const view = (row: Partial<TestScript.ResTestScript> = {}) => {
@@ -395,6 +403,11 @@ const view = (row: Partial<TestScript.ResTestScript> = {}) => {
})
viewDialog.value = true
setTimeout(() => {
console.log('row',row)
console.log('communicationList',communicationList.value)
console.log('parentTabName',parentTabName)
console.log('childrenTabName',parentTabName)
console.log('activeName',activeName.value)
viewRowRef.value?.open(row, communicationList.value, parentTabName, childrenTabName.value)
}, 0)
@@ -589,6 +602,10 @@ defineExpose({
font-size: 30px; /* 增大图标的大小 */
}
.hidden-tab {
display: none;
}
@keyframes rotate {
from {
transform: rotate(0deg);

View File

@@ -172,7 +172,7 @@ const getData = () => {
return tableData.value
}
onMounted(() => {
//console.log('🚀 ~ onMounted ~ props:', props)
console.log('🚀 需要:')
info()
// tableData.value = data.data[0].children || []
})

View File

@@ -308,6 +308,7 @@ const setTab = row => {
const copyActiveName = ref('')
// 获取通讯脚本点击
const getCommunication = () => {
console.log('123123',communRef.value[0]?.getData())
communicationList.value = communRef.value[0]?.getData()
}
// 切换大tab控制小tab
@@ -397,6 +398,7 @@ const copyRow = async (row: any) => {
const view = (row: Partial<TestScript.ResTestScript> = {}) => {
getCommunication()
console.log('communicationList',communicationList.value)
//当前点击的一级tab
const parentTabName = communicationList.value.find(t => t.id === activeName.value)?.name || '未找到对应名称';
//当前点击的二级tab
@@ -451,7 +453,7 @@ const addTab = (row: any) => {
const saveTheNewsletter = () => {}
onMounted(() => {
getTree()
console.log('123',props.options)
console.log('testScriptDetail',props.options)
props.options.forEach((item: any) => {
tabData.value.push({
label: item.label.replace(/准确度|检测/g, ''),

View File

@@ -281,6 +281,7 @@ const tabVisibilityMap: { [key: string]: { harmVIsShow: boolean, harmAIsShow: bo
};
const open = async (row: any,communicationList:any,parentTabName:string,childrenTabName:string) => {
console.log('🚀 ~ open ~ parentTabName:', parentTabName)
//对应表格显示隐藏
const visibilitySettings = tabVisibilityMap[parentTabName] || { harmVIsShow: false, harmAIsShow: false, iHarmVIsShow: false, iHarmAIsShow: false };
harmVIsShow.value = visibilitySettings.harmVIsShow;
@@ -325,6 +326,12 @@ const open = async (row: any,communicationList:any,parentTabName:string,children
let form = handleHarmData(JSON.parse(JSON.stringify(row)))
let retryCompute = isEqual(form, copyRowList)
console.log('🚀 ~ open ~ 1:', form)
console.log('🚀 ~ open ~ 2:', props.formContent?.id)
console.log('🚀 ~ open ~ 3:', props.activeName)
console.log('🚀 ~ open ~ 4:', checkDataList)
console.log('🚀 ~ open ~ 5:', retryCompute)
await scriptDtlsCheckDataList({
...form,
scriptId: props.formContent?.id,
@@ -339,6 +346,7 @@ const open = async (row: any,communicationList:any,parentTabName:string,children
item.show = true
})
setValue_TableData.value = res.data
console.log('🚀 ~ open ~ res.data:', res.data)
})
dialogVisible.value = true

View File

@@ -69,7 +69,7 @@ const filterMethod = (query: string, item: { label?: string }) => {
dialogVisible.value = true
planData.value = data
console.log('123')
//console.log('123')
const pqDevList_Result1 = await getUnboundPqDevList(data);
unboundPqDevList.value = pqDevList_Result1.data as Device.ReqPqDevParams[];
@@ -78,7 +78,7 @@ const filterMethod = (query: string, item: { label?: string }) => {
boundPqDevList.value = pqDevList_Result2.data as Device.ReqPqDevParams[];
value.value = boundPqDevList.value.map((i: { id: { toString: () => any } }) => i.id.toString());
console.log('123',value.value)
//console.log('123',value.value)
}
const close = () => {
dialogVisible.value = false