This commit is contained in:
sjl
2025-03-05 11:19:16 +08:00
parent be2f40715a
commit 2377916f29
4 changed files with 25 additions and 17 deletions

View File

@@ -184,6 +184,7 @@ import TestScriptDipTab from '@/views/machine/testScript/components/testScriptDi
import { useDictStore } from '@/stores/modules/dict'
import { addScriptDtls } from '@/api/device/testScript'
import scriptForm from './scriptForm'
import { on } from 'events'
const emit = defineEmits(['addTab', 'close', 'getCommunication'])
const dictStore = useDictStore()
@@ -578,7 +579,7 @@ const open = (sign: string, row: any) => {
handleRowClick({ name: 'L1', sort: 0 }, { label: '相别' })
dictStore.getDictData('Script_Value_Type')
console.log('🚀 ~ open ~ tabChildren.value:', tabChildren.value)
//console.log('🚀 ~ open ~ tabChildren.value:', tabChildren.value)
}
// 判断后台没有谐波,简谐波值 用于回显
@@ -609,6 +610,7 @@ const copyRow = (num: number, index: number) => {
})
}
// 打开 drawer(新增、编辑)
const openDialog = () => {}

View File

@@ -187,9 +187,11 @@
v-if="showDialog"
/>
<!-- 查看 -->
<viewRow ref="viewRowRef"
<ViewRow ref="viewRowRef"
:activeName="activeName"
:formContent="props.formContent"
@close="viewDialog = false"
v-if="viewDialog"
/>
</div>
</template>
@@ -208,7 +210,7 @@ import { dlsDetails, deleteDtls, updateDtls, addScriptDtls, checkDataList } from
import { useDictStore } from '@/stores/modules/dict'
import { useHandleData } from '@/hooks/useHandleData'
import { scriptDtlsCheckDataList } from '@/api/device/testScript/index'
import viewRow from './viewRow.vue'
import ViewRow from '@/views/machine/testScript/components/viewRow.vue'
interface TabOption {
label?: string
name?: string
@@ -230,6 +232,7 @@ const props = defineProps({
}
})
const showDialog = ref(false)
const viewDialog = ref(false)
const dictStore = useDictStore()
const activeName = ref('')
const childActiveName = ref('')
@@ -397,8 +400,11 @@ const view = (row: Partial<TestScript.ResTestScript> = {}) => {
})
}
})
console.log(tabData.value)
viewRowRef.value?.open(row,communicationList.value,parentTabName,childrenTabName.value)
viewDialog.value = true
setTimeout(() => {
viewRowRef.value?.open(row, communicationList.value, parentTabName, childrenTabName.value)
}, 0)
}
// 删除
const deleteRow = async (row: any) => {

View File

@@ -8,8 +8,8 @@
<el-descriptions-item label="值类型">相对值</el-descriptions-item>
</el-descriptions> -->
<!-- tableData?.channelList -->
<el-tabs type="border-card" >
<el-tab-pane :label="`L${item}`" v-for="item in 3" :key="item">
<el-tabs type="border-card">
<el-tab-pane :label="`L${item}`" v-for="item in 3" :key="item" >
<div class="tabPane">
<el-descriptions :column="4" border>
<el-descriptions-item label-align="right" label="电压有效值(%)">
@@ -172,7 +172,7 @@
</div>
</el-tab-pane>
<el-tab-pane label="参考设定值列表">
<el-tab-pane label="参考设定值列表" >
<div class="tabPane">
<el-table
:data="setValue_TableData"
@@ -219,11 +219,12 @@
</el-dialog>
</template>
<script setup lang="ts">
import { ref, reactive } from 'vue'
import { ref, reactive, onMounted } from 'vue'
import { dialogBig } from '@/utils/elementBind'
import { getDictTreeByCode } from '@/api/system/dictionary/dictTree'
import { scriptDtlsCheckDataList } from '@/api/device/testScript/index'
import { Dictionary } from 'lodash'
import { on } from 'events'
const dialogVisible = ref(false)
const titleType = ref('')
const tableData: any = ref({})
@@ -233,8 +234,9 @@ const harmVIsShow = ref(false)
const harmAIsShow = ref(false)
const iHarmVIsShow = ref(false)
const iHarmAIsShow = ref(false)
const activeTab = ref<string | number>('L1') // 设置默认激活的标签页
const emit = defineEmits(['close'])
const props = defineProps({
activeName: {
type: String,
required: true
@@ -278,8 +280,7 @@ const tabVisibilityMap: { [key: string]: { harmVIsShow: boolean, harmAIsShow: bo
'谐波有功功率': { harmVIsShow: true, harmAIsShow: true, iHarmVIsShow: false, iHarmAIsShow: false },
};
const open = async (row: any,communicationList:any,parentTabName:string,childrenTabName:string) => {
//重置标签页
activeTab.value = 'L1' // 设置默认激活的标签页
//对应表格显示隐藏
const visibilitySettings = tabVisibilityMap[parentTabName] || { harmVIsShow: false, harmAIsShow: false, iHarmVIsShow: false, iHarmAIsShow: false };
harmVIsShow.value = visibilitySettings.harmVIsShow;
@@ -339,16 +340,14 @@ const open = async (row: any,communicationList:any,parentTabName:string,children
})
setValue_TableData.value = res.data
})
dialogVisible.value = true
}
// 关闭弹窗
const close = () => {
dialogVisible.value = false
emit('close')
}
// 处理多余数据
@@ -385,7 +384,6 @@ const isEqual = (obj1: any, obj2: any) => {
return true
}
defineExpose({ open })
</script>
<style lang="scss" scoped>

View File

@@ -157,6 +157,8 @@ const open = async (sign: string, data: TestSource.ResTestSource, currentMode: s
dialogFormRef.value?.resetFields()
}
const changeParameter = (parameterArr: any) => {
formContent.value.parameter = JSON.stringify(parameterArr)
}