联调检测脚本页面

This commit is contained in:
GGJ
2025-02-19 16:54:54 +08:00
parent d28669e6b0
commit 8caf856d2d
12 changed files with 543 additions and 240 deletions

View File

@@ -30,3 +30,7 @@ export const deletePqScript = (params: string[]) => {
export const addScriptDtls = (params: any) => {
return http.post(`/pqScript/addScriptDtls`, params)
}
//根据脚本id查询检测脚本详情
export const dlsDetails = (params: any) => {
return http.post(`/pqScript/dlsDetails`, params)
}

View File

@@ -52,7 +52,7 @@ interface TabOption {
}
const props = defineProps({
options: {
type: Array as PropType<TabOption[]>,
type: Array ,
required: true
}
})

View File

@@ -1,181 +1,187 @@
let scriptForm = {
value: '',
let scriptForm: any = {
// value: '',
label: '',
subType: '', //tabcode
fFreq: 50.01, //频率
ffreq: 50, //频率
channelList: [
{
channelType: 'Ua',
channelFlag: false, //通道使能
harmFlag: false, //谐波使能
inHarmFlag: false, //间谐波使能
flickerFlag: false, //闪变使能
dipFlag: false, //暂态使能
fAmp: 0, //幅值
fPhase: 0, //相角
famp: 0, //幅值
fphase: 0, //相角
harmList: [
// {
// harm: 2, //谐波次数
// fAmp: 0, //谐波含有率
// fPhase: 0 // 谐波相角
// famp: 0, //谐波含有率
// fphase: 0 // 谐波相角
// },
], //谐波
inHarmList: [
{
inharm: 0, //间谐波次数
fAmp: 0, //间谐波含有率
fPhase: 0 // 间谐波相角
famp: 0, //间谐波含有率
fphase: 0 // 间谐波相角
}
], //间谐波
flickerData: {
fChagValue: 0, //电压变动幅度
fChagFre: 0, //波动频度
fchagValue: 0, //电压变动幅度
fchagFre: 0, //波动频度
waveFluType: 0, //波动类型
waveType: 0, //波类型
fDutyCycle: 0 //占空比
fdutyCycle: 0 //占空比
}, //闪变
dipData: {
fTransValue: 0, // 暂态幅值
fRetainTime: 0 // 暂态持续时间
ftransValue: 0, // 暂态幅值
fretainTime: 0 // 暂态持续时间
} //暂态
},
{
channelType: 'Ia',
channelFlag: false, //通道使能
harmFlag: false, //谐波使能
inHarmFlag: false, //间谐波使能
flickerFlag: false, //闪变使能
dipFlag: false, //暂态使能
fAmp: 0, //幅值
fPhase: 0, //相角
famp: 0, //幅值
fphase: 0, //相角
harmList: [], //谐波
inHarmList: [
{
inharm: 1, //间谐波次数
fAmp: 0, //间谐波含有率
fPhase: 0 // 间谐波相角
famp: 0, //间谐波含有率
fphase: 0 // 间谐波相角
}
], //间谐波
flickerData: {
fChagValue: 0, //电压变动幅度
fChagFre: 0, //波动频度
fchagValue: 0, //电压变动幅度
fchagFre: 0, //波动频度
waveFluType: 0, //波动类型
waveType: 0, //波类型
fDutyCycle: 0 //占空比
fdutyCycle: 0 //占空比
}, //闪变
dipData: {
fTransValue: 0, // 暂态幅值
fRetainTime: 0 // 暂态持续时间
ftransValue: 0, // 暂态幅值
fretainTime: 0 // 暂态持续时间
} //暂态
},
{
channelType: 'Ub',
channelFlag: false, //通道使能
harmFlag: false, //谐波使能
inHarmFlag: false, //间谐波使能
flickerFlag: false, //闪变使能
dipFlag: false, //暂态使能
fAmp: 0, //幅值
fPhase: 0, //相角
famp: 0, //幅值
fphase: 0, //相角
harmList: [], //谐波
inHarmList: [
{
inharm: 1, //间谐波次数
fAmp: 0, //间谐波含有率
fPhase: 0 // 间谐波相角
famp: 0, //间谐波含有率
fphase: 0 // 间谐波相角
}
], //间谐波
flickerData: {
fChagValue: 0, //电压变动幅度
fChagFre: 0, //波动频度
fchagValue: 0, //电压变动幅度
fchagFre: 0, //波动频度
waveFluType: 0, //波动类型
waveType: 0, //波类型
fDutyCycle: 0 //占空比
fdutyCycle: 0 //占空比
}, //闪变
dipData: {
fTransValue: 0, // 暂态幅值
fRetainTime: 0 // 暂态持续时间
ftransValue: 0, // 暂态幅值
fretainTime: 0 // 暂态持续时间
} //暂态
},
{
channelType: 'Ib',
channelFlag: false, //通道使能
harmFlag: false, //谐波使能
inHarmFlag: false, //间谐波使能
flickerFlag: false, //闪变使能
dipFlag: false, //暂态使能
fAmp: 0, //幅值
fPhase: 0, //相角
famp: 0, //幅值
fphase: 0, //相角
harmList: [], //谐波
inHarmList: [
{
inharm: 1, //间谐波次数
fAmp: 0, //间谐波含有率
fPhase: 0 // 间谐波相角
famp: 0, //间谐波含有率
fphase: 0 // 间谐波相角
}
], //间谐波
flickerData: {
fChagValue: 0, //电压变动幅度
fChagFre: 0, //波动频度
fchagValue: 0, //电压变动幅度
fchagFre: 0, //波动频度
waveFluType: 0, //波动类型
waveType: 0, //波类型
fDutyCycle: 0 //占空比
fdutyCycle: 0 //占空比
}, //闪变
dipData: {
fTransValue: 0, // 暂态幅值
fRetainTime: 0 // 暂态持续时间
ftransValue: 0, // 暂态幅值
fretainTime: 0 // 暂态持续时间
} //暂态
},
{
channelType: 'Uc',
channelFlag: false, //通道使能
harmFlag: false, //谐波使能
inHarmFlag: false, //间谐波使能
flickerFlag: false, //闪变使能
dipFlag: false, //暂态使能
fAmp: 0, //幅值
fPhase: 0, //相角
famp: 0, //幅值
fphase: 0, //相角
harmList: [], //谐波
inHarmList: [
{
inharm: 1, //间谐波次数
fAmp: 0, //间谐波含有率
fPhase: 0 // 间谐波相角
famp: 0, //间谐波含有率
fphase: 0 // 间谐波相角
}
], //间谐波
flickerData: {
fChagValue: 0, //电压变动幅度
fChagFre: 0, //波动频度
fchagValue: 0, //电压变动幅度
fchagFre: 0, //波动频度
waveFluType: 0, //波动类型
waveType: 0, //波类型
fDutyCycle: 0 //占空比
fdutyCycle: 0 //占空比
}, //闪变
dipData: {
fTransValue: 0, // 暂态幅值
fRetainTime: 0 // 暂态持续时间
ftransValue: 0, // 暂态幅值
fretainTime: 0 // 暂态持续时间
} //暂态
},
{
channelType: 'Ic',
channelFlag: false, //通道使能
harmFlag: false, //谐波使能
inHarmFlag: false, //间谐波使能
flickerFlag: false, //闪变使能
dipFlag: false, //暂态使能
fAmp: 0, //幅值
fPhase: 0, //相角
famp: 0, //幅值
fphase: 0, //相角
harmList: [], //谐波
inHarmList: [
{
inharm: 1, //间谐波次数
fAmp: 0, //间谐波含有率
fPhase: 0 // 间谐波相角
famp: 0, //间谐波含有率
fphase: 0 // 间谐波相角
}
], //间谐波
flickerData: {
fChagValue: 0, //电压变动幅度
fChagFre: 0, //波动频度
fchagValue: 0, //电压变动幅度
fchagFre: 0, //波动频度
waveFluType: 0, //波动类型
waveType: 0, //波类型
fDutyCycle: 0 //占空比
fdutyCycle: 0 //占空比
}, //闪变
dipData: {
fTransValue: 0, // 暂态幅值
fRetainTime: 0 // 暂态持续时间
ftransValue: 0, // 暂态幅值
fretainTime: 0 // 暂态持续时间
} //暂态
}
]
@@ -186,8 +192,8 @@ function getScriptForm() {
scriptForm.channelList.forEach(item => {
item.harmList.push({
harm: i, //谐波次数
fAmp: 0, //谐波含有率
fPhase: 0 // 谐波相角
famp: 0, //谐波含有率
fphase: 0 // 谐波相角
})
})
}

View File

@@ -31,22 +31,31 @@
:cell-style="tableStyle.cellStyle"
:header-cell-style="{ textAlign: 'center', backgroundColor: '#003078', color: '#fff' }"
@cell-click="handleRowClick"
:key="key"
>
<el-table-column prop="name" label="相别" width="60" align="center" />
<el-table-column prop="frequency" label="电压/电流" align="center" width="60" />
<el-table-column prop="L1" label="值" width="180" align="center">
<template #default="{ row, $index }">
<span>
{{ row.frequency === 'V' ? '电压' : '电流' }}{{ form.channelList[$index].fAmp
}}{{ valueCode == 'Absolute' ? (row.frequency === 'V' ? 'V' : 'A') : '%' }} 相角{{
form.channelList[$index].fPhase
{{ row.type === 'V' ? '电压' : '电流' }}{{ form.channelList[$index].famp
}}{{ valueCode == 'Absolute' ? (row.type === 'V' ? 'V' : 'A') : '%' }} 相角{{
form.channelList[$index].fphase
}}°
</span>
</template>
</el-table-column>
<el-table-column label="操作" width="85">
<template #default="{ row, $index }">
<el-button type="primary" v-if="$index != 4" link :icon="CopyDocument">复制</el-button>
<el-button
type="primary"
v-if="$index != 4"
link
:icon="CopyDocument"
@click="copyRow($index)"
>
复制
</el-button>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
@@ -88,7 +97,7 @@
<div class="form-item-container">
<el-form-item label="频率:" prop="name">
<div class="input-label-container">
<el-input type="number" style="width: 100px" v-model="form.fFreq" />
<el-input type="number" style="width: 100px" v-model="form.ffreq" />
<label>Hz</label>
</div>
</el-form-item>
@@ -121,12 +130,12 @@
</el-tabs>
</div>
<SetValueTable ref="setValueTable" />
<SetValueTable ref="setValueTableRef" />
<template #footer>
<div>
<el-button @click="close()"> </el-button>
<el-button type="primary" @click="save()">保存</el-button>
<el-button type="primary" @click="save">保存</el-button>
</div>
</template>
</el-dialog>
@@ -159,26 +168,27 @@ const props = defineProps({
required: true
},
formContent: {
type: Object,
type: [Object, Array],
required: true
}
})
console.log(`123`, props.formContent)
const key = ref(0)
// let valueType
const form: any = ref(scriptForm)
const childForm: any = ref([])
const ScriptValueType = ref('')
const setValueTableRef = ref()
const dialogVisible = ref(false)
const dialogTitle = ref()
const valueCode = ref() //Absolute绝对值
const valueCode = ref('') //Absolute绝对值
const tableData = [
{ name: 'L1', frequency: 'V', electricity: 0, fPhase: 0, sort: 0 },
{ name: 'L1', frequency: 'I', electricity: 0, fPhase: 0, sort: 0 },
{ name: 'L2', frequency: 'V', electricity: 0, fPhase: 0, sort: 1 },
{ name: 'L2', frequency: 'I', electricity: 0, fPhase: 0, sort: 1 },
{ name: 'L3', frequency: 'V', electricity: 0, fPhase: 0, sort: 2 },
{ name: 'L3', frequency: 'I', electricity: 0, fPhase: 0, sort: 2 }
{ name: 'L1', frequency: 'Ua', type: 'V', electricity: 0, fphase: 0, sort: 0 },
{ name: 'L1', frequency: 'Ia', type: 'I', electricity: 0, fphase: 0, sort: 0 },
{ name: 'L2', frequency: 'Ub', type: 'V', electricity: 0, fphase: 0, sort: 1 },
{ name: 'L2', frequency: 'Ib', type: 'I', electricity: 0, fphase: 0, sort: 1 },
{ name: 'L3', frequency: 'Uc', type: 'V', electricity: 0, fphase: 0, sort: 2 },
{ name: 'L3', frequency: 'Ic', type: 'I', electricity: 0, fphase: 0, sort: 2 }
]
const subType = ref('')
const tabChildren: any = ref([])
@@ -226,19 +236,26 @@ const close = () => {
// 保存数据
const save = () => {
console.log('🚀 ~ save ~ form.value:', form.value)
// dialogVisible.value = false
form.value.subType = subType.value
form.value.label = tabChildren.value.filter((item: any) => item.code == subType.value)[0].label
let copyForm = JSON.parse(JSON.stringify(form.value))
copyForm.channelList.forEach((channel: any) => {
// 筛选出 fAmp 和 fPhase 不同时为 0 的对象
channel.harmList = channel.harmList.filter((item: any) => item.fAmp !== 0 || item.fPhase !== 0)
// 筛选出 famp 和 fphase 不同时为 0 的对象
channel.harmList = channel.harmList.filter((item: any) => item.famp !== 0 || item.fphase !== 0)
channel.inHarmList = channel.inHarmList.filter(
(item: any) => item.inharm !== 0 || item.famp !== 0 || item.fphase !== 0
)
})
console.log('🚀 ~ save ~ form.value:', copyForm)
addScriptDtls({ ...copyForm, scriptId: props.formContent.id, scriptType: props.activeName }).then(res => {
if (res.code === 'A0000') {
ElMessage.success({ message: res.message })
dialogVisible.value = false
emit('addTab', form.value)
}
})
addScriptDtls({ ...copyForm, id: props.formContent.id }).then(res => {})
// emit('addTab', form.value)
}
@@ -255,10 +272,22 @@ const open = (sign: string, row: any) => {
.getDictData('Script_Value_Type')
.filter(item => item.id == props.formContent.valueType)[0].code
}
// 复制
const copyRow = (index: number) => {
scriptForm.channelList[index + 2] = JSON.parse(JSON.stringify(scriptForm.channelList[index]))
scriptForm.channelList[index + 3] = JSON.parse(JSON.stringify(scriptForm.channelList[index + 1]))
scriptForm.channelList[index].channelType == 'Ua'
? (scriptForm.channelList[index + 2].channelType = 'Ub')
: (scriptForm.channelList[index + 2].channelType = 'Uc')
scriptForm.channelList[index + 1].channelType == 'Ia'
? (scriptForm.channelList[index + 3].channelType = 'Ib')
: (scriptForm.channelList[index + 3].channelType = 'Ic')
key.value += 1
}
// 打开 drawer(新增、编辑)
const openDialog = () => {
setValueTable.value?.open()
setValueTableRef.value?.open()
}
// 对外映射

View File

@@ -1,4 +1,5 @@
<template>
<div>
<div class="divider-container">
<el-divider style="width: 300px" content-position="left">检测脚本信息</el-divider>
<el-divider style="width: 400px" content-position="left">通讯脚本</el-divider>
@@ -6,26 +7,27 @@
</div>
<div class="data-check-content">
<div class="content-tree">
<Tree :formContent="props.formContent" />
<Tree :treeData="treeData" />
</div>
<div class="content-tree" style="width: 400px">
<Commun :options="props.options" />
</div>
<div class="content-right-Tabs" style="height: calc(100vh - 335px); width: 100px">
<el-tabs type="border-card" style="height: 100%" v-model="activeName">
<el-tabs type="border-card" style="height: 100%" v-model="activeName" @tab-change="tabChange">
<el-tab-pane v-for="tab in tabData" :key="tab.value" :label="tab.label" :name="tab.value">
<div class="dialog-footer">
<el-button :icon="CirclePlus" type="primary" @click="openDialog('add')">新增</el-button>
<el-button :icon="CirclePlus" type="primary" @click="openAddDialog()">保存测试项</el-button>
<!-- <el-button :icon="CirclePlus" type="primary" @click="openAddDialog()">保存测试项</el-button> -->
</div>
<!-- 频率tab -->
<el-tabs type="border-card">
<!-- {{ tab.children }} -->
<el-tabs type="border-card" v-model="childActiveName" @tab-change="inquireTable">
<el-tab-pane
v-for="subTab in tab.children || []"
:key="subTab.name"
:key="subTab.value"
:label="subTab.label"
:name="subTab.name"
:name="subTab.value"
>
<div class="table-container">
<el-table
@@ -35,38 +37,198 @@
backgroundColor: '#003078',
color: '#fff'
}"
stripe
:cell-style="{ textAlign: 'center' }"
height="calc(100vh - 515px)"
>
<el-table-column prop="sort" label="组次" width="60" />
<el-table-column prop="frequency" label="频率(Hz)" width="100" />
<el-table-column prop="L1" label="L1">
<template #default="scope">
<el-descriptions border :column="1" size="small">
<el-descriptions-item label="V">0.000V   0.000°</el-descriptions-item>
<el-descriptions-item label=" I">0.000A   0.000°</el-descriptions-item>
</el-descriptions>
<el-table-column type="index" label="组次" width="60" />
<el-table-column prop="ffreq" label="频率(Hz)" width="100" />
<el-table-column :label="item.label" v-for="item in column" :key="item.label">
<template #default="{ row }">
<table class="tableL">
<tr>
<td class="theFirst">V</td>
<td>
{{
row.channelList[item.num]?.famp
? '电压=' +
row.channelList[item.num]?.famp +
(valueCode == 'Absolute' ? 'V' : '%')
: '/'
}}
</td>
<td>
{{
row.channelList[item.num]?.fphase
? '电流=' + row.channelList[item.num]?.fphase + '°'
: '/'
}}
</td>
</tr>
<tr>
<td class="theFirst">I</td>
<td>
{{
row.channelList[item.num + 1]?.famp
? '电压=' +
row.channelList[item.num + 1]?.famp +
(valueCode == 'Absolute' ? 'V' : '%')
: '/'
}}
</td>
<td>
{{
row.channelList[item.num + 1]?.fphase
? '电流=' +
row.channelList[item.num + 1]?.fphase +
'°'
: '/'
}}
</td>
</tr>
</table>
</template>
</el-table-column>
<el-table-column prop="L2" label="L2">
<template #default="scope">
<el-descriptions border :column="1" size="small">
<el-descriptions-item label="V">0.000V   0.000°</el-descriptions-item>
<el-descriptions-item label=" I">0.000A   0.000°</el-descriptions-item>
</el-descriptions>
<!-- <el-table-column label="L1">
<template #default="{ row }">
<table class="tableL">
<tr>
<td class="theFirst">V</td>
<td>
{{
row.channelList[0]?.famp
? '电压=' +
row.channelList[0]?.famp +
(valueCode == 'Absolute' ? 'V' : '%')
: '/'
}}
</td>
<td>
{{
row.channelList[0]?.fphase
? '电流=' + row.channelList[0]?.fphase + '°'
: '/'
}}
</td>
</tr>
<tr>
<td class="theFirst">I</td>
<td>
{{
row.channelList[1]?.famp
? '电压=' +
row.channelList[1]?.famp +
(valueCode == 'Absolute' ? 'V' : '%')
: '/'
}}
</td>
<td>
{{
row.channelList[1]?.fphase
? '电流=' + row.channelList[1]?.fphase + '°'
: '/'
}}
</td>
</tr>
</table>
</template>
</el-table-column>
<el-table-column label="L2">
<template #default="{ row }">
<table class="tableL">
<tr>
<td class="theFirst">V</td>
<td>
{{
row.channelList[2]?.famp
? '电压=' +
row.channelList[2]?.famp +
(valueCode == 'Absolute' ? 'V' : '%')
: '/'
}}
</td>
<td>
{{
row.channelList[2]?.fphase
? '电流=' + row.channelList[2]?.fphase + '°'
: '/'
}}
</td>
</tr>
<tr>
<td class="theFirst">I</td>
<td>
{{
row.channelList[3]?.famp
? '电压=' +
row.channelList[3]?.famp +
(valueCode == 'Absolute' ? 'V' : '%')
: '/'
}}
</td>
<td>
{{
row.channelList[3]?.fphase
? '电流=' + row.channelList[3]?.fphase + '°'
: '/'
}}
</td>
</tr>
</table>
</template>
</el-table-column>
<el-table-column prop="L3" label="L3">
<template #default="scope">
<el-descriptions border :column="1" size="small">
<el-descriptions-item label="V">0.000V  0.000°</el-descriptions-item>
<el-descriptions-item label=" I">0.000A   0.000°</el-descriptions-item>
</el-descriptions>
</template>
</el-table-column>
<el-table-column label="操作" min-width="100">
<template #default="{ row }">
<el-button type="primary" link :icon="CopyDocument" @click="copyRow(row)">
<table class="tableL">
<tr>
<td class="theFirst">V</td>
<td>
{{
row.channelList[4]?.famp
? '电压=' +
row.channelList[4]?.famp +
(valueCode == 'Absolute' ? 'V' : '%')
: '/'
}}
</td>
<td>
{{
row.channelList[4]?.fphase
? '电流=' + row.channelList[4]?.fphase + '°'
: '/'
}}
</td>
</tr>
<tr>
<td class="theFirst">I</td>
<td>
{{
row.channelList[5]?.famp
? '电压=' +
row.channelList[5]?.famp +
(valueCode == 'Absolute' ? 'V' : '%')
: '/'
}}
</td>
<td>
{{
row.channelList[5]?.fphase
? '电流=' + row.channelList[5]?.fphase + '°'
: '/'
}}
</td>
</tr>
</table>
</template>
</el-table-column> -->
<el-table-column label="操作" width="210">
<template #default="{ row }">
<el-button
type="primary"
link
:icon="CopyDocument"
@click="copyRow(row)"
>
复制
</el-button>
<el-button
@@ -98,6 +260,7 @@
@addTab="addTab"
:formContent="props.formContent"
/>
</div>
</template>
<script setup lang="ts">
@@ -105,10 +268,13 @@ import { type PropType, ref, nextTick } from 'vue'
import Tree from './tree.vue'
import Commun from './communication.vue'
import type { CascaderOption } from 'element-plus'
import { getTreeData } from '@/api/check/test'
import { CirclePlus, Delete, EditPen, CopyDocument } from '@element-plus/icons-vue'
import type { TestScript } from '@/api/device/interface/testScript'
import TestProjectPopup from '@/views/machine/testScript/components/testProjectPopup.vue'
import { CheckData } from '@/api/check/interface'
import { dlsDetails } from '@/api/device/testScript'
import { useDictStore } from '@/stores/modules/dict'
interface TabOption {
label?: string
name?: string
@@ -116,7 +282,8 @@ interface TabOption {
code?: string
children?: TabOption[]
}
const treeData = ref<CheckData.TreeItem[]>([])
const valueCode = ref('') //Absolute绝对值
const props = defineProps({
options: {
type: Array as PropType<TabOption[]>,
@@ -127,27 +294,109 @@ const props = defineProps({
required: true
}
})
const dictStore = useDictStore()
const activeName = ref('')
const childActiveName = ref('')
const testProjectPopupRef = ref()
const tableData = [
{ sort: 1, frequency: 42.5, L1: '电压:57.75V 相角:0°', L2: '电压:57.75V 相角:120°', L3: '电压:57.75V 相角:-120°' },
{ sort: 2, frequency: 50, L1: '电压:57.75V 相角:0°', L2: '电压:57.75V 相角:120°', L3: '电压:57.75V 相角:-120°' },
{ sort: 3, frequency: 50.05, L1: '电压:57.75V 相角:0°', L2: '电压:57.75V 相角:120°', L3: '电压:57.75V 相角:-120°' },
{ sort: 4, frequency: 57.5, L1: '电压:57.75V 相角:0°', L2: '电压:57.75V 相角:120°', L3: '电压:57.75V 相角:-120°' },
{ sort: 5, frequency: 57.5, L1: '电压:57.75V 相角:0°', L2: '电压:57.75V 相角:120°', L3: '电压:57.75V 相角:-120°' },
{ sort: 6, frequency: 57.5, L1: '电压:57.75V 相角:0°', L2: '电压:57.75V 相角:120°', L3: '电压:57.75V 相角:-120°' }
]
const tableData: any = ref([])
const tabData: any = ref([])
const column = ref([
{
label: 'L1',
num: 0
},
{
label: 'L2',
num: 2
},
{
label: 'L3',
num: 4
}
])
// 获取树
const getTree = () => {
getTreeData({
scriptId: props.formContent.id
}).then(res => {
if (res.code === 'A0000') {
treeData.value = res.data
// 添加tab子项
props.options.forEach((k: any, i: number) => {
tabData.value[i].children = []
treeData.value.forEach((item: any) => {
if (k.value == item.scriptTypeCode) {
item.children.forEach((s: any) => {
k.children.forEach((P: any) => {
if (P.code == s.scriptTypeCode) {
tabData.value[i].children.push({
label: P.label,
value: P.code,
children: []
})
} else {
s.children.forEach((j: any) => {
if (j.scriptTypeCode == P.code) {
tabData.value[i].children.push({
label: P.label,
value: P.code,
children: []
})
}
})
}
})
})
}
})
})
tabChange()
}
})
}
const copyActiveName = ref('')
// 切换大tab控制小tab
const tabChange = () => {
if (copyActiveName.value != activeName.value) {
copyActiveName.value == activeName.value
childActiveName.value = ''
childActiveName.value =
tabData.value.filter(item => item.value == activeName.value)[0]?.children[0]?.value || ''
}
inquireTable()
}
//根据脚本id查询检测脚本详情
const inquireTable = () => {
const sortOrder = ['Ua', 'Ia', 'Ub', 'Ib', 'Uc', 'Ic']
dlsDetails({
scriptId: props.formContent.id,
scriptType: activeName.value,
scriptSubType: childActiveName.value
}).then((res: any) => {
if (res.code === 'A0000') {
res.data.forEach((item: any) => {
item.channelList = item.channelList.sort((a, b) => {
const indexA = sortOrder.indexOf(a.channelType)
const indexB = sortOrder.indexOf(b.channelType)
return indexA - indexB
})
})
tableData.value = res.data
}
})
}
// 打开 drawer(新增、编辑)
const openDialog = (titleType: string, row: Partial<TestScript.ResTestScript> = {}) => {
if (titleType == 'add') {
}
testProjectPopupRef.value?.open(titleType, row)
}
// 获取左边树数据
// 新增保存
const addTab = (row: any) => {
getTree()
// let data = JSON.parse(JSON.stringify(row))
// let flag = true
// let list: any = {}
@@ -172,8 +421,8 @@ const addTab = (row: any) => {
}
onMounted(() => {
console.log('🚀 ~ onMounted ~ props.options:', props.options)
props.options.forEach(item => {
getTree()
props.options.forEach((item: any) => {
tabData.value.push({
label: item.label.replace(/准确度|检测/g, ''),
value: item.value,
@@ -182,9 +431,12 @@ onMounted(() => {
})
})
activeName.value = tabData.value[0].value
valueCode.value = dictStore
.getDictData('Script_Value_Type')
.filter(item => item.id == props.formContent.valueType)[0].code
})
</script>
<style scoped>
<style lang="scss" scoped>
.data-check-content {
display: flex;
gap: 10px;
@@ -225,4 +477,22 @@ onMounted(() => {
:deep(.el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell) {
padding: 3px 11px;
}
:deep(.el-loading-mask) {
z-index: 3000;
}
.tableL {
border-collapse: collapse;
width: 100%;
td {
border: 1px solid #ccc;
padding: 5px;
width: 45%;
}
.theFirst {
background-color: #003078;
color: #fff;
width: 20px !important;
}
}
</style>

View File

@@ -27,10 +27,10 @@
<div class="right-editor">
<!-- 右侧编辑区域内容 -->
<el-form-item label-width="120px" label="设定幅度(%)">
<el-input v-model="form[0].dipData.fTransValue" style="width: 150px" :disabled="!form[0].dipFlag"/>
<el-input v-model="form[0].dipData.ftransValue" style="width: 150px" :disabled="!form[0].dipFlag"/>
</el-form-item>
<el-form-item label-width="120px" label="持续时间(周波)">
<el-input v-model="form[0].dipData.fRetainTime" style="width: 150px" :disabled="!form[0].dipFlag"/>
<el-input v-model="form[0].dipData.fretainTime" style="width: 150px" :disabled="!form[0].dipFlag"/>
</el-form-item>
</div>
</div>

View File

@@ -5,12 +5,12 @@
<!-- 全局设置菜单内容 -->
<div>
<el-form-item label="电压变动幅度(%)" label-width="140px" prop="name">
<el-input style="width: 150px" v-model="form[0].flickerData.fChagValue" :disabled="!form[0].flickerFlag"/>
<el-input style="width: 150px" v-model="form[0].flickerData.fchagValue" :disabled="!form[0].flickerFlag"/>
</el-form-item>
</div>
<div class="form-container">
<el-form-item label="波动频度(/min/Hz)" label-width="140px" prop="name">
<el-input style="width: 150px" v-model="form[0].flickerData.fChagFre" :disabled="!form[0].flickerFlag"/>
<el-input style="width: 150px" v-model="form[0].flickerData.fchagFre" :disabled="!form[0].flickerFlag"/>
</el-form-item>
<el-form-item label="波动类型" prop="name">
<el-select
@@ -45,7 +45,7 @@
</div>
<div>
<el-form-item label="占空比(%)" label-width="100px" prop="name">
<el-input style="width: 150px" v-model="form[0].flickerData.fDutyCycle" :disabled="!form[0].flickerFlag"/>
<el-input style="width: 150px" v-model="form[0].flickerData.fdutyCycle" :disabled="!form[0].flickerFlag"/>
</el-form-item>
</div>
</el-tab-pane>

View File

@@ -9,7 +9,7 @@
<el-table-column prop="date" align="center" label="谐波含有率" width="120">
<template #default="{ row, $index }">
<div class="input-label-container">
<el-input type="number" size="small" v-model="form[0].harmList[$index].fAmp" :disabled="!form[0].harmFlag"/>
<el-input type="number" size="small" v-model="form[0].harmList[$index].famp" :disabled="!form[0].harmFlag"/>
<label>%</label>
</div>
</template>
@@ -17,7 +17,7 @@
<el-table-column prop="name" label="谐波相角" align="center" width="120">
<template #default="{ row, $index }">
<div class="input-label-container">
<el-input type="number" size="small" v-model="form[0].harmList[$index].fPhase" :disabled="!form[0].harmFlag"/>
<el-input type="number" size="small" v-model="form[0].harmList[$index].fphase" :disabled="!form[0].harmFlag"/>
<label>°</label>
</div>
</template>
@@ -28,7 +28,7 @@
<el-table-column prop="date" label="谐波含有率" align="center" width="120">
<template #default="{ row, $index }">
<div class="input-label-container">
<el-input type="number" size="small" v-model="form[0].harmList[$index + 24].fAmp" :disabled="!form[0].harmFlag"/>
<el-input type="number" size="small" v-model="form[0].harmList[$index + 24].famp" :disabled="!form[0].harmFlag"/>
<label>%</label>
</div>
</template>
@@ -36,7 +36,7 @@
<el-table-column prop="name" label="谐波相角" align="center" width="120">
<template #default="{ row, $index }">
<div class="input-label-container">
<el-input type="number" size="small" v-model="form[0].harmList[$index+24].fPhase" :disabled="!form[0].harmFlag"/>
<el-input type="number" size="small" v-model="form[0].harmList[$index+24].fphase" :disabled="!form[0].harmFlag"/>
<label>°</label>
</div>
</template>
@@ -54,7 +54,7 @@
<el-table-column prop="date" label="谐波含有率" align="center" width="120">
<template #default="{ row, $index }">
<div class="input-label-container">
<el-input type="number" size="small" v-model="form[1].harmList[$index].fAmp" :disabled="!form[1].harmFlag"/>
<el-input type="number" size="small" v-model="form[1].harmList[$index].famp" :disabled="!form[1].harmFlag"/>
<label>%</label>
</div>
</template>
@@ -62,7 +62,7 @@
<el-table-column prop="name" align="center" label="谐波相角" width="120">
<template #default="{ row, $index }">
<div class="input-label-container">
<el-input type="number" size="small" v-model="form[1].harmList[$index].fPhase" :disabled="!form[1].harmFlag"/>
<el-input type="number" size="small" v-model="form[1].harmList[$index].fphase" :disabled="!form[1].harmFlag"/>
<label>°</label>
</div>
</template>
@@ -73,7 +73,7 @@
<el-table-column prop="date" label="谐波含有率" align="center" width="120">
<template #default="{ row, $index }">
<div class="input-label-container">
<el-input type="number" size="small" v-model="form[1].harmList[$index + 24].fAmp" :disabled="!form[1].harmFlag"/>
<el-input type="number" size="small" v-model="form[1].harmList[$index + 24].famp" :disabled="!form[1].harmFlag"/>
<label>%</label>
</div>
</template>
@@ -81,7 +81,7 @@
<el-table-column prop="name" label="谐波相角" align="center" width="120">
<template #default="{ row, $index }">
<div class="input-label-container">
<el-input type="number" size="small" v-model="form[1].harmList[$index+24].fPhase" :disabled="!form[1].harmFlag"/>
<el-input type="number" size="small" v-model="form[1].harmList[$index+24].fphase" :disabled="!form[1].harmFlag"/>
<label>°</label>
</div>
</template>

View File

@@ -10,7 +10,7 @@
</el-form-item>
<el-form-item label="相角(°)" label-width="80px">
<el-input v-model="form[0].inHarmList[0].fPhase" :disabled="!form[0].inHarmFlag" />
<el-input v-model="form[0].inHarmList[0].fphase" :disabled="!form[0].inHarmFlag" />
</el-form-item>
<el-form-item label-width="80px">
<el-button type="primary" @click="inHarmFlagAdd">添加</el-button>
@@ -26,7 +26,7 @@
</el-form-item>
<el-form-item label="相角(°)" label-width="80px">
<el-input v-model="form[0].inHarmList[item].fPhase" :disabled="!form[0].inHarmFlag" />
<el-input v-model="form[0].inHarmList[item].fphase" :disabled="!form[0].inHarmFlag" />
</el-form-item>
<el-form-item label-width="80px">
<el-button type="primary" @click="inHarmFlagDelete(item)">删除</el-button>
@@ -54,7 +54,7 @@ const num = ref(0)
// 添加间谐波
const inHarmFlagAdd = () => {
props.childForm[0].inHarmList.push({ inharm: '0', fAmp: '0', fPhase: '0' })
props.childForm[0].inHarmList.push({ inharm: '0', fAmp: '0', fphase: '0' })
num.value += 1
}
// 删除

View File

@@ -138,8 +138,8 @@ const save = () => {
pqScriptAdd(formContent.value).then(res => {
if (res.code === 'A0000') {
ElMessage.success({ message: res.message })
// scriptId.value = res.data
formContent.value.id = '46296b72528f805376e362df594fc669'
formContent.value.id = JSON.stringify(res.data)
titleType.value == '编辑检测脚本'
show.value = true
}
})
@@ -177,7 +177,7 @@ const treeInfo = async (currentMode: string) => {
pids: '',
code: 'Script_Indicator_Items',
sort: 0
};
}
const result = await getDictTreeByCode(data)
const allOptions = convertToOptions(result.data as Dict.ResDictTree[])
secondLevelOptions.push(...(allOptions[0]?.children || []))
@@ -198,7 +198,7 @@ onMounted(() => {
const convertToOptions = (dictTree: Dict.ResDictTree[]): CascaderOption[] => {
return dictTree.map(item => ({
value: item.id,
code: item.code,
code: item.code.split('-')[1] || item.code.split('-')[0],
label: item.name,
children: item.children ? convertToOptions(item.children) : undefined
}))

View File

@@ -9,16 +9,16 @@
<!-- 右侧编辑区域内容 -->
<el-form :inline="true" label-width="auto" :model="form" class="form-two">
<el-form-item label="电压有效值(V)">
<el-input type="number" v-model="form[0].fAmp" :disabled="!form[0].channelFlag"/>
<el-input type="number" v-model="form[0].famp" :disabled="!form[0].channelFlag"/>
</el-form-item>
<el-form-item label="电流有效值(A)">
<el-input type="number"v-model="form[0].fPhase" :disabled="!form[1].channelFlag"/>
<el-input type="number"v-model="form[0].fphase" :disabled="!form[1].channelFlag"/>
</el-form-item>
<el-form-item label="电压相角(°)">
<el-input type="number"v-model="form[1].fAmp" :disabled="!form[0].channelFlag"/>
<el-input type="number"v-model="form[1].famp" :disabled="!form[0].channelFlag"/>
</el-form-item>
<el-form-item label="电流相角(°)">
<el-input type="number"v-model="form[1].fPhase" :disabled="!form[1].channelFlag"/>
<el-input type="number"v-model="form[1].fphase" :disabled="!form[1].channelFlag"/>
</el-form-item>
</el-form>
</div>

View File

@@ -1,9 +1,9 @@
<template>
<el-tree node-key="id" default-expand-all :data="dataTree" :props="defaultProps" style="width: 100%">
<el-tree node-key="id" default-expand-all :data="props.treeData" :props="defaultProps" style="width: 100%">
<template #default="{ node, data }">
<el-tooltip effect="dark" :content="data.scriptTypeName" placement="top" :hide-after="0">
<el-tooltip effect="dark" :content="data.scriptTypeName || data.sourceDesc" placement="top" :hide-after="0">
<div class="custom-tree-node">
{{ data.scriptTypeName }}
{{ data.scriptTypeName || data.sourceDesc }}
</div>
</el-tooltip>
</template>
@@ -11,11 +11,11 @@
</template>
<script setup lang="ts">
import { ref, reactive } from 'vue'
import { getTreeData } from '@/api/check/test'
import { CheckData } from '@/api/check/interface'
const props = defineProps({
formContent: {
type: Object,
treeData: {
type: Array,
required: true
}
})
@@ -25,16 +25,10 @@ const defaultProps = {
label: 'scriptTypeName',
pid: 'pid'
}
const open = () => {
getTreeData({
scriptId: props.formContent.id
}).then(res => {
dataTree.value = res.data
})
}
onMounted(() => {
open()
})
onMounted(() => {})
// // 对外映射
// defineExpose({ init })
</script>
<style lang="scss" scoped>
.custom-tree-node {