联调检测脚本页面
This commit is contained in:
@@ -30,3 +30,7 @@ export const deletePqScript = (params: string[]) => {
|
|||||||
export const addScriptDtls = (params: any) => {
|
export const addScriptDtls = (params: any) => {
|
||||||
return http.post(`/pqScript/addScriptDtls`, params)
|
return http.post(`/pqScript/addScriptDtls`, params)
|
||||||
}
|
}
|
||||||
|
//根据脚本id查询检测脚本详情
|
||||||
|
export const dlsDetails = (params: any) => {
|
||||||
|
return http.post(`/pqScript/dlsDetails`, params)
|
||||||
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ interface TabOption {
|
|||||||
}
|
}
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
options: {
|
options: {
|
||||||
type: Array as PropType<TabOption[]>,
|
type: Array ,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,181 +1,187 @@
|
|||||||
let scriptForm = {
|
let scriptForm: any = {
|
||||||
value: '',
|
// value: '',
|
||||||
label: '',
|
label: '',
|
||||||
subType: '', //tabcode
|
subType: '', //tabcode
|
||||||
fFreq: 50.01, //频率
|
ffreq: 50, //频率
|
||||||
channelList: [
|
channelList: [
|
||||||
{
|
{
|
||||||
|
channelType: 'Ua',
|
||||||
channelFlag: false, //通道使能
|
channelFlag: false, //通道使能
|
||||||
harmFlag: false, //谐波使能
|
harmFlag: false, //谐波使能
|
||||||
inHarmFlag: false, //间谐波使能
|
inHarmFlag: false, //间谐波使能
|
||||||
flickerFlag: false, //闪变使能
|
flickerFlag: false, //闪变使能
|
||||||
dipFlag: false, //暂态使能
|
dipFlag: false, //暂态使能
|
||||||
fAmp: 0, //幅值
|
famp: 0, //幅值
|
||||||
fPhase: 0, //相角
|
fphase: 0, //相角
|
||||||
harmList: [
|
harmList: [
|
||||||
// {
|
// {
|
||||||
// harm: 2, //谐波次数
|
// harm: 2, //谐波次数
|
||||||
// fAmp: 0, //谐波含有率
|
// famp: 0, //谐波含有率
|
||||||
// fPhase: 0 // 谐波相角
|
// fphase: 0 // 谐波相角
|
||||||
// },
|
// },
|
||||||
], //谐波
|
], //谐波
|
||||||
inHarmList: [
|
inHarmList: [
|
||||||
{
|
{
|
||||||
inharm: 0, //间谐波次数
|
inharm: 0, //间谐波次数
|
||||||
fAmp: 0, //间谐波含有率
|
famp: 0, //间谐波含有率
|
||||||
fPhase: 0 // 间谐波相角
|
fphase: 0 // 间谐波相角
|
||||||
}
|
}
|
||||||
], //间谐波
|
], //间谐波
|
||||||
flickerData: {
|
flickerData: {
|
||||||
fChagValue: 0, //电压变动幅度
|
fchagValue: 0, //电压变动幅度
|
||||||
fChagFre: 0, //波动频度
|
fchagFre: 0, //波动频度
|
||||||
waveFluType: 0, //波动类型
|
waveFluType: 0, //波动类型
|
||||||
waveType: 0, //波类型
|
waveType: 0, //波类型
|
||||||
fDutyCycle: 0 //占空比
|
fdutyCycle: 0 //占空比
|
||||||
}, //闪变
|
}, //闪变
|
||||||
dipData: {
|
dipData: {
|
||||||
fTransValue: 0, // 暂态幅值
|
ftransValue: 0, // 暂态幅值
|
||||||
fRetainTime: 0 // 暂态持续时间
|
fretainTime: 0 // 暂态持续时间
|
||||||
} //暂态
|
} //暂态
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
channelType: 'Ia',
|
||||||
channelFlag: false, //通道使能
|
channelFlag: false, //通道使能
|
||||||
harmFlag: false, //谐波使能
|
harmFlag: false, //谐波使能
|
||||||
inHarmFlag: false, //间谐波使能
|
inHarmFlag: false, //间谐波使能
|
||||||
flickerFlag: false, //闪变使能
|
flickerFlag: false, //闪变使能
|
||||||
dipFlag: false, //暂态使能
|
dipFlag: false, //暂态使能
|
||||||
fAmp: 0, //幅值
|
famp: 0, //幅值
|
||||||
fPhase: 0, //相角
|
fphase: 0, //相角
|
||||||
harmList: [], //谐波
|
harmList: [], //谐波
|
||||||
inHarmList: [
|
inHarmList: [
|
||||||
{
|
{
|
||||||
inharm: 1, //间谐波次数
|
inharm: 1, //间谐波次数
|
||||||
fAmp: 0, //间谐波含有率
|
famp: 0, //间谐波含有率
|
||||||
fPhase: 0 // 间谐波相角
|
fphase: 0 // 间谐波相角
|
||||||
}
|
}
|
||||||
], //间谐波
|
], //间谐波
|
||||||
flickerData: {
|
flickerData: {
|
||||||
fChagValue: 0, //电压变动幅度
|
fchagValue: 0, //电压变动幅度
|
||||||
fChagFre: 0, //波动频度
|
fchagFre: 0, //波动频度
|
||||||
waveFluType: 0, //波动类型
|
waveFluType: 0, //波动类型
|
||||||
waveType: 0, //波类型
|
waveType: 0, //波类型
|
||||||
fDutyCycle: 0 //占空比
|
fdutyCycle: 0 //占空比
|
||||||
}, //闪变
|
}, //闪变
|
||||||
dipData: {
|
dipData: {
|
||||||
fTransValue: 0, // 暂态幅值
|
ftransValue: 0, // 暂态幅值
|
||||||
fRetainTime: 0 // 暂态持续时间
|
fretainTime: 0 // 暂态持续时间
|
||||||
} //暂态
|
} //暂态
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
channelType: 'Ub',
|
||||||
channelFlag: false, //通道使能
|
channelFlag: false, //通道使能
|
||||||
harmFlag: false, //谐波使能
|
harmFlag: false, //谐波使能
|
||||||
inHarmFlag: false, //间谐波使能
|
inHarmFlag: false, //间谐波使能
|
||||||
flickerFlag: false, //闪变使能
|
flickerFlag: false, //闪变使能
|
||||||
dipFlag: false, //暂态使能
|
dipFlag: false, //暂态使能
|
||||||
fAmp: 0, //幅值
|
famp: 0, //幅值
|
||||||
fPhase: 0, //相角
|
fphase: 0, //相角
|
||||||
harmList: [], //谐波
|
harmList: [], //谐波
|
||||||
inHarmList: [
|
inHarmList: [
|
||||||
{
|
{
|
||||||
inharm: 1, //间谐波次数
|
inharm: 1, //间谐波次数
|
||||||
fAmp: 0, //间谐波含有率
|
famp: 0, //间谐波含有率
|
||||||
fPhase: 0 // 间谐波相角
|
fphase: 0 // 间谐波相角
|
||||||
}
|
}
|
||||||
], //间谐波
|
], //间谐波
|
||||||
flickerData: {
|
flickerData: {
|
||||||
fChagValue: 0, //电压变动幅度
|
fchagValue: 0, //电压变动幅度
|
||||||
fChagFre: 0, //波动频度
|
fchagFre: 0, //波动频度
|
||||||
waveFluType: 0, //波动类型
|
waveFluType: 0, //波动类型
|
||||||
waveType: 0, //波类型
|
waveType: 0, //波类型
|
||||||
fDutyCycle: 0 //占空比
|
fdutyCycle: 0 //占空比
|
||||||
}, //闪变
|
}, //闪变
|
||||||
dipData: {
|
dipData: {
|
||||||
fTransValue: 0, // 暂态幅值
|
ftransValue: 0, // 暂态幅值
|
||||||
fRetainTime: 0 // 暂态持续时间
|
fretainTime: 0 // 暂态持续时间
|
||||||
} //暂态
|
} //暂态
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
channelType: 'Ib',
|
||||||
channelFlag: false, //通道使能
|
channelFlag: false, //通道使能
|
||||||
harmFlag: false, //谐波使能
|
harmFlag: false, //谐波使能
|
||||||
inHarmFlag: false, //间谐波使能
|
inHarmFlag: false, //间谐波使能
|
||||||
flickerFlag: false, //闪变使能
|
flickerFlag: false, //闪变使能
|
||||||
dipFlag: false, //暂态使能
|
dipFlag: false, //暂态使能
|
||||||
fAmp: 0, //幅值
|
famp: 0, //幅值
|
||||||
fPhase: 0, //相角
|
fphase: 0, //相角
|
||||||
harmList: [], //谐波
|
harmList: [], //谐波
|
||||||
inHarmList: [
|
inHarmList: [
|
||||||
{
|
{
|
||||||
inharm: 1, //间谐波次数
|
inharm: 1, //间谐波次数
|
||||||
fAmp: 0, //间谐波含有率
|
famp: 0, //间谐波含有率
|
||||||
fPhase: 0 // 间谐波相角
|
fphase: 0 // 间谐波相角
|
||||||
}
|
}
|
||||||
], //间谐波
|
], //间谐波
|
||||||
flickerData: {
|
flickerData: {
|
||||||
fChagValue: 0, //电压变动幅度
|
fchagValue: 0, //电压变动幅度
|
||||||
fChagFre: 0, //波动频度
|
fchagFre: 0, //波动频度
|
||||||
waveFluType: 0, //波动类型
|
waveFluType: 0, //波动类型
|
||||||
waveType: 0, //波类型
|
waveType: 0, //波类型
|
||||||
fDutyCycle: 0 //占空比
|
fdutyCycle: 0 //占空比
|
||||||
}, //闪变
|
}, //闪变
|
||||||
dipData: {
|
dipData: {
|
||||||
fTransValue: 0, // 暂态幅值
|
ftransValue: 0, // 暂态幅值
|
||||||
fRetainTime: 0 // 暂态持续时间
|
fretainTime: 0 // 暂态持续时间
|
||||||
} //暂态
|
} //暂态
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
channelType: 'Uc',
|
||||||
channelFlag: false, //通道使能
|
channelFlag: false, //通道使能
|
||||||
harmFlag: false, //谐波使能
|
harmFlag: false, //谐波使能
|
||||||
inHarmFlag: false, //间谐波使能
|
inHarmFlag: false, //间谐波使能
|
||||||
flickerFlag: false, //闪变使能
|
flickerFlag: false, //闪变使能
|
||||||
dipFlag: false, //暂态使能
|
dipFlag: false, //暂态使能
|
||||||
fAmp: 0, //幅值
|
famp: 0, //幅值
|
||||||
fPhase: 0, //相角
|
fphase: 0, //相角
|
||||||
harmList: [], //谐波
|
harmList: [], //谐波
|
||||||
inHarmList: [
|
inHarmList: [
|
||||||
{
|
{
|
||||||
inharm: 1, //间谐波次数
|
inharm: 1, //间谐波次数
|
||||||
fAmp: 0, //间谐波含有率
|
famp: 0, //间谐波含有率
|
||||||
fPhase: 0 // 间谐波相角
|
fphase: 0 // 间谐波相角
|
||||||
}
|
}
|
||||||
], //间谐波
|
], //间谐波
|
||||||
flickerData: {
|
flickerData: {
|
||||||
fChagValue: 0, //电压变动幅度
|
fchagValue: 0, //电压变动幅度
|
||||||
fChagFre: 0, //波动频度
|
fchagFre: 0, //波动频度
|
||||||
waveFluType: 0, //波动类型
|
waveFluType: 0, //波动类型
|
||||||
waveType: 0, //波类型
|
waveType: 0, //波类型
|
||||||
fDutyCycle: 0 //占空比
|
fdutyCycle: 0 //占空比
|
||||||
}, //闪变
|
}, //闪变
|
||||||
dipData: {
|
dipData: {
|
||||||
fTransValue: 0, // 暂态幅值
|
ftransValue: 0, // 暂态幅值
|
||||||
fRetainTime: 0 // 暂态持续时间
|
fretainTime: 0 // 暂态持续时间
|
||||||
} //暂态
|
} //暂态
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
channelType: 'Ic',
|
||||||
channelFlag: false, //通道使能
|
channelFlag: false, //通道使能
|
||||||
harmFlag: false, //谐波使能
|
harmFlag: false, //谐波使能
|
||||||
inHarmFlag: false, //间谐波使能
|
inHarmFlag: false, //间谐波使能
|
||||||
flickerFlag: false, //闪变使能
|
flickerFlag: false, //闪变使能
|
||||||
dipFlag: false, //暂态使能
|
dipFlag: false, //暂态使能
|
||||||
fAmp: 0, //幅值
|
famp: 0, //幅值
|
||||||
fPhase: 0, //相角
|
fphase: 0, //相角
|
||||||
harmList: [], //谐波
|
harmList: [], //谐波
|
||||||
inHarmList: [
|
inHarmList: [
|
||||||
{
|
{
|
||||||
inharm: 1, //间谐波次数
|
inharm: 1, //间谐波次数
|
||||||
fAmp: 0, //间谐波含有率
|
famp: 0, //间谐波含有率
|
||||||
fPhase: 0 // 间谐波相角
|
fphase: 0 // 间谐波相角
|
||||||
}
|
}
|
||||||
], //间谐波
|
], //间谐波
|
||||||
flickerData: {
|
flickerData: {
|
||||||
fChagValue: 0, //电压变动幅度
|
fchagValue: 0, //电压变动幅度
|
||||||
fChagFre: 0, //波动频度
|
fchagFre: 0, //波动频度
|
||||||
waveFluType: 0, //波动类型
|
waveFluType: 0, //波动类型
|
||||||
waveType: 0, //波类型
|
waveType: 0, //波类型
|
||||||
fDutyCycle: 0 //占空比
|
fdutyCycle: 0 //占空比
|
||||||
}, //闪变
|
}, //闪变
|
||||||
dipData: {
|
dipData: {
|
||||||
fTransValue: 0, // 暂态幅值
|
ftransValue: 0, // 暂态幅值
|
||||||
fRetainTime: 0 // 暂态持续时间
|
fretainTime: 0 // 暂态持续时间
|
||||||
} //暂态
|
} //暂态
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -186,8 +192,8 @@ function getScriptForm() {
|
|||||||
scriptForm.channelList.forEach(item => {
|
scriptForm.channelList.forEach(item => {
|
||||||
item.harmList.push({
|
item.harmList.push({
|
||||||
harm: i, //谐波次数
|
harm: i, //谐波次数
|
||||||
fAmp: 0, //谐波含有率
|
famp: 0, //谐波含有率
|
||||||
fPhase: 0 // 谐波相角
|
fphase: 0 // 谐波相角
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,22 +31,31 @@
|
|||||||
:cell-style="tableStyle.cellStyle"
|
:cell-style="tableStyle.cellStyle"
|
||||||
:header-cell-style="{ textAlign: 'center', backgroundColor: '#003078', color: '#fff' }"
|
:header-cell-style="{ textAlign: 'center', backgroundColor: '#003078', color: '#fff' }"
|
||||||
@cell-click="handleRowClick"
|
@cell-click="handleRowClick"
|
||||||
|
:key="key"
|
||||||
>
|
>
|
||||||
<el-table-column prop="name" label="相别" width="60" align="center" />
|
<el-table-column prop="name" label="相别" width="60" align="center" />
|
||||||
<el-table-column prop="frequency" label="电压/电流" align="center" width="60" />
|
<el-table-column prop="frequency" label="电压/电流" align="center" width="60" />
|
||||||
<el-table-column prop="L1" label="值" width="180" align="center">
|
<el-table-column prop="L1" label="值" width="180" align="center">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<span>
|
<span>
|
||||||
{{ row.frequency === 'V' ? '电压' : '电流' }}{{ form.channelList[$index].fAmp
|
{{ row.type === 'V' ? '电压' : '电流' }}{{ form.channelList[$index].famp
|
||||||
}}{{ valueCode == 'Absolute' ? (row.frequency === 'V' ? 'V' : 'A') : '%' }} 相角{{
|
}}{{ valueCode == 'Absolute' ? (row.type === 'V' ? 'V' : 'A') : '%' }} 相角{{
|
||||||
form.channelList[$index].fPhase
|
form.channelList[$index].fphase
|
||||||
}}°
|
}}°
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="85">
|
<el-table-column label="操作" width="85">
|
||||||
<template #default="{ row, $index }">
|
<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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center">
|
<el-table-column label="操作" align="center">
|
||||||
@@ -88,7 +97,7 @@
|
|||||||
<div class="form-item-container">
|
<div class="form-item-container">
|
||||||
<el-form-item label="频率:" prop="name">
|
<el-form-item label="频率:" prop="name">
|
||||||
<div class="input-label-container">
|
<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>
|
<label>Hz</label>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -121,12 +130,12 @@
|
|||||||
</el-tabs>
|
</el-tabs>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<SetValueTable ref="setValueTable" />
|
<SetValueTable ref="setValueTableRef" />
|
||||||
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div>
|
<div>
|
||||||
<el-button @click="close()">取 消</el-button>
|
<el-button @click="close()">取 消</el-button>
|
||||||
<el-button type="primary" @click="save()">保存</el-button>
|
<el-button type="primary" @click="save">保存</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@@ -159,26 +168,27 @@ const props = defineProps({
|
|||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
formContent: {
|
formContent: {
|
||||||
type: Object,
|
type: [Object, Array],
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log(`123`, props.formContent)
|
const key = ref(0)
|
||||||
// let valueType
|
// let valueType
|
||||||
const form: any = ref(scriptForm)
|
const form: any = ref(scriptForm)
|
||||||
const childForm: any = ref([])
|
const childForm: any = ref([])
|
||||||
const ScriptValueType = ref('')
|
const ScriptValueType = ref('')
|
||||||
|
const setValueTableRef = ref()
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
const dialogTitle = ref()
|
const dialogTitle = ref()
|
||||||
const valueCode = ref() //Absolute绝对值
|
const valueCode = ref('') //Absolute绝对值
|
||||||
|
|
||||||
const tableData = [
|
const tableData = [
|
||||||
{ name: 'L1', frequency: 'V', electricity: 0, fPhase: 0, sort: 0 },
|
{ name: 'L1', frequency: 'Ua', type: 'V', electricity: 0, fphase: 0, sort: 0 },
|
||||||
{ name: 'L1', frequency: 'I', electricity: 0, fPhase: 0, sort: 0 },
|
{ name: 'L1', frequency: 'Ia', type: 'I', electricity: 0, fphase: 0, sort: 0 },
|
||||||
{ name: 'L2', frequency: 'V', electricity: 0, fPhase: 0, sort: 1 },
|
{ name: 'L2', frequency: 'Ub', type: 'V', electricity: 0, fphase: 0, sort: 1 },
|
||||||
{ name: 'L2', frequency: 'I', electricity: 0, fPhase: 0, sort: 1 },
|
{ name: 'L2', frequency: 'Ib', type: 'I', electricity: 0, fphase: 0, sort: 1 },
|
||||||
{ name: 'L3', frequency: 'V', electricity: 0, fPhase: 0, sort: 2 },
|
{ name: 'L3', frequency: 'Uc', type: 'V', electricity: 0, fphase: 0, sort: 2 },
|
||||||
{ name: 'L3', frequency: 'I', electricity: 0, fPhase: 0, sort: 2 }
|
{ name: 'L3', frequency: 'Ic', type: 'I', electricity: 0, fphase: 0, sort: 2 }
|
||||||
]
|
]
|
||||||
const subType = ref('')
|
const subType = ref('')
|
||||||
const tabChildren: any = ref([])
|
const tabChildren: any = ref([])
|
||||||
@@ -226,19 +236,26 @@ const close = () => {
|
|||||||
|
|
||||||
// 保存数据
|
// 保存数据
|
||||||
const save = () => {
|
const save = () => {
|
||||||
console.log('🚀 ~ save ~ form.value:', form.value)
|
|
||||||
|
|
||||||
// dialogVisible.value = false
|
// dialogVisible.value = false
|
||||||
form.value.subType = subType.value
|
form.value.subType = subType.value
|
||||||
form.value.label = tabChildren.value.filter((item: any) => item.code == subType.value)[0].label
|
form.value.label = tabChildren.value.filter((item: any) => item.code == subType.value)[0].label
|
||||||
let copyForm = JSON.parse(JSON.stringify(form.value))
|
let copyForm = JSON.parse(JSON.stringify(form.value))
|
||||||
|
|
||||||
copyForm.channelList.forEach((channel: any) => {
|
copyForm.channelList.forEach((channel: any) => {
|
||||||
// 筛选出 fAmp 和 fPhase 不同时为 0 的对象
|
// 筛选出 famp 和 fphase 不同时为 0 的对象
|
||||||
channel.harmList = channel.harmList.filter((item: any) => item.fAmp !== 0 || item.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)
|
// emit('addTab', form.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -255,10 +272,22 @@ const open = (sign: string, row: any) => {
|
|||||||
.getDictData('Script_Value_Type')
|
.getDictData('Script_Value_Type')
|
||||||
.filter(item => item.id == props.formContent.valueType)[0].code
|
.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(新增、编辑)
|
// 打开 drawer(新增、编辑)
|
||||||
const openDialog = () => {
|
const openDialog = () => {
|
||||||
setValueTable.value?.open()
|
setValueTableRef.value?.open()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 对外映射
|
// 对外映射
|
||||||
|
|||||||
@@ -1,103 +1,266 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="divider-container">
|
<div>
|
||||||
<el-divider style="width: 300px" content-position="left">检测脚本信息</el-divider>
|
<div class="divider-container">
|
||||||
<el-divider style="width: 400px" content-position="left">通讯脚本</el-divider>
|
<el-divider style="width: 300px" content-position="left">检测脚本信息</el-divider>
|
||||||
<el-divider style="flex: 1" content-position="left">检测项目概要信息</el-divider>
|
<el-divider style="width: 400px" content-position="left">通讯脚本</el-divider>
|
||||||
</div>
|
<el-divider style="flex: 1" content-position="left">检测项目概要信息</el-divider>
|
||||||
<div class="data-check-content">
|
|
||||||
<div class="content-tree">
|
|
||||||
<Tree :formContent="props.formContent" />
|
|
||||||
</div>
|
</div>
|
||||||
<div class="content-tree" style="width: 400px">
|
<div class="data-check-content">
|
||||||
<Commun :options="props.options" />
|
<div class="content-tree">
|
||||||
|
<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" @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> -->
|
||||||
|
</div>
|
||||||
|
<!-- 频率tab -->
|
||||||
|
<!-- {{ tab.children }} -->
|
||||||
|
<el-tabs type="border-card" v-model="childActiveName" @tab-change="inquireTable">
|
||||||
|
<el-tab-pane
|
||||||
|
v-for="subTab in tab.children || []"
|
||||||
|
:key="subTab.value"
|
||||||
|
:label="subTab.label"
|
||||||
|
:name="subTab.value"
|
||||||
|
>
|
||||||
|
<div class="table-container">
|
||||||
|
<el-table
|
||||||
|
:data="tableData"
|
||||||
|
:header-cell-style="{
|
||||||
|
textAlign: 'center',
|
||||||
|
backgroundColor: '#003078',
|
||||||
|
color: '#fff'
|
||||||
|
}"
|
||||||
|
stripe
|
||||||
|
:cell-style="{ textAlign: 'center' }"
|
||||||
|
height="calc(100vh - 515px)"
|
||||||
|
>
|
||||||
|
<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 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="{ 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
|
||||||
|
type="primary"
|
||||||
|
link
|
||||||
|
:icon="CopyDocument"
|
||||||
|
@click="openAddDialog('edit', row)"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary" link :icon="Delete" @click="deleteRow(row)">
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="content-right-Tabs" style="height: calc(100vh - 335px); width: 100px">
|
<TestProjectPopup
|
||||||
<el-tabs type="border-card" style="height: 100%" v-model="activeName">
|
ref="testProjectPopupRef"
|
||||||
<el-tab-pane v-for="tab in tabData" :key="tab.value" :label="tab.label" :name="tab.value">
|
:options="props.options"
|
||||||
<div class="dialog-footer">
|
:activeName="activeName"
|
||||||
<el-button :icon="CirclePlus" type="primary" @click="openDialog('add')">新增</el-button>
|
@addTab="addTab"
|
||||||
<el-button :icon="CirclePlus" type="primary" @click="openAddDialog()">保存测试项</el-button>
|
:formContent="props.formContent"
|
||||||
</div>
|
/>
|
||||||
<!-- 频率tab -->
|
|
||||||
<el-tabs type="border-card">
|
|
||||||
<el-tab-pane
|
|
||||||
v-for="subTab in tab.children || []"
|
|
||||||
:key="subTab.name"
|
|
||||||
:label="subTab.label"
|
|
||||||
:name="subTab.name"
|
|
||||||
>
|
|
||||||
<div class="table-container">
|
|
||||||
<el-table
|
|
||||||
:data="tableData"
|
|
||||||
:header-cell-style="{
|
|
||||||
textAlign: 'center',
|
|
||||||
backgroundColor: '#003078',
|
|
||||||
color: '#fff'
|
|
||||||
}"
|
|
||||||
: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>
|
|
||||||
</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>
|
|
||||||
</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)">
|
|
||||||
复制
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
link
|
|
||||||
:icon="CopyDocument"
|
|
||||||
@click="openAddDialog('edit', row)"
|
|
||||||
>
|
|
||||||
编辑
|
|
||||||
</el-button>
|
|
||||||
<el-button type="primary" link :icon="Delete" @click="deleteRow(row)">
|
|
||||||
删除
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</div>
|
|
||||||
</el-tab-pane>
|
|
||||||
</el-tabs>
|
|
||||||
</el-tab-pane>
|
|
||||||
</el-tabs>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<TestProjectPopup
|
|
||||||
ref="testProjectPopupRef"
|
|
||||||
:options="props.options"
|
|
||||||
:activeName="activeName"
|
|
||||||
@addTab="addTab"
|
|
||||||
:formContent="props.formContent"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@@ -105,10 +268,13 @@ import { type PropType, ref, nextTick } from 'vue'
|
|||||||
import Tree from './tree.vue'
|
import Tree from './tree.vue'
|
||||||
import Commun from './communication.vue'
|
import Commun from './communication.vue'
|
||||||
import type { CascaderOption } from 'element-plus'
|
import type { CascaderOption } from 'element-plus'
|
||||||
|
import { getTreeData } from '@/api/check/test'
|
||||||
import { CirclePlus, Delete, EditPen, CopyDocument } from '@element-plus/icons-vue'
|
import { CirclePlus, Delete, EditPen, CopyDocument } from '@element-plus/icons-vue'
|
||||||
import type { TestScript } from '@/api/device/interface/testScript'
|
import type { TestScript } from '@/api/device/interface/testScript'
|
||||||
import TestProjectPopup from '@/views/machine/testScript/components/testProjectPopup.vue'
|
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 {
|
interface TabOption {
|
||||||
label?: string
|
label?: string
|
||||||
name?: string
|
name?: string
|
||||||
@@ -116,7 +282,8 @@ interface TabOption {
|
|||||||
code?: string
|
code?: string
|
||||||
children?: TabOption[]
|
children?: TabOption[]
|
||||||
}
|
}
|
||||||
|
const treeData = ref<CheckData.TreeItem[]>([])
|
||||||
|
const valueCode = ref('') //Absolute绝对值
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
options: {
|
options: {
|
||||||
type: Array as PropType<TabOption[]>,
|
type: Array as PropType<TabOption[]>,
|
||||||
@@ -127,27 +294,109 @@ const props = defineProps({
|
|||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
const dictStore = useDictStore()
|
||||||
const activeName = ref('')
|
const activeName = ref('')
|
||||||
|
const childActiveName = ref('')
|
||||||
const testProjectPopupRef = ref()
|
const testProjectPopupRef = ref()
|
||||||
const tableData = [
|
const tableData: any = ref([])
|
||||||
{ 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 tabData: 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(新增、编辑)
|
// 打开 drawer(新增、编辑)
|
||||||
const openDialog = (titleType: string, row: Partial<TestScript.ResTestScript> = {}) => {
|
const openDialog = (titleType: string, row: Partial<TestScript.ResTestScript> = {}) => {
|
||||||
if (titleType == 'add') {
|
if (titleType == 'add') {
|
||||||
}
|
}
|
||||||
testProjectPopupRef.value?.open(titleType, row)
|
testProjectPopupRef.value?.open(titleType, row)
|
||||||
}
|
}
|
||||||
|
// 获取左边树数据
|
||||||
// 新增保存
|
// 新增保存
|
||||||
const addTab = (row: any) => {
|
const addTab = (row: any) => {
|
||||||
|
getTree()
|
||||||
// let data = JSON.parse(JSON.stringify(row))
|
// let data = JSON.parse(JSON.stringify(row))
|
||||||
// let flag = true
|
// let flag = true
|
||||||
// let list: any = {}
|
// let list: any = {}
|
||||||
@@ -172,8 +421,8 @@ const addTab = (row: any) => {
|
|||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
console.log('🚀 ~ onMounted ~ props.options:', props.options)
|
console.log('🚀 ~ onMounted ~ props.options:', props.options)
|
||||||
|
getTree()
|
||||||
props.options.forEach(item => {
|
props.options.forEach((item: any) => {
|
||||||
tabData.value.push({
|
tabData.value.push({
|
||||||
label: item.label.replace(/准确度|检测/g, ''),
|
label: item.label.replace(/准确度|检测/g, ''),
|
||||||
value: item.value,
|
value: item.value,
|
||||||
@@ -182,9 +431,12 @@ onMounted(() => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
activeName.value = tabData.value[0].value
|
activeName.value = tabData.value[0].value
|
||||||
|
valueCode.value = dictStore
|
||||||
|
.getDictData('Script_Value_Type')
|
||||||
|
.filter(item => item.id == props.formContent.valueType)[0].code
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style lang="scss" scoped>
|
||||||
.data-check-content {
|
.data-check-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
@@ -225,4 +477,22 @@ onMounted(() => {
|
|||||||
:deep(.el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell) {
|
:deep(.el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell) {
|
||||||
padding: 3px 11px;
|
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>
|
</style>
|
||||||
|
|||||||
@@ -27,10 +27,10 @@
|
|||||||
<div class="right-editor">
|
<div class="right-editor">
|
||||||
<!-- 右侧编辑区域内容 -->
|
<!-- 右侧编辑区域内容 -->
|
||||||
<el-form-item label-width="120px" label="设定幅度(%)">
|
<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>
|
||||||
<el-form-item label-width="120px" label="持续时间(周波)">
|
<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>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,12 +5,12 @@
|
|||||||
<!-- 全局设置菜单内容 -->
|
<!-- 全局设置菜单内容 -->
|
||||||
<div>
|
<div>
|
||||||
<el-form-item label="电压变动幅度(%)" label-width="140px" prop="name">
|
<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>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-container">
|
<div class="form-container">
|
||||||
<el-form-item label="波动频度(/min/Hz)" label-width="140px" prop="name">
|
<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>
|
||||||
<el-form-item label="波动类型" prop="name">
|
<el-form-item label="波动类型" prop="name">
|
||||||
<el-select
|
<el-select
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-form-item label="占空比(%)" label-width="100px" prop="name">
|
<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>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<el-table-column prop="date" align="center" label="谐波含有率" width="120">
|
<el-table-column prop="date" align="center" label="谐波含有率" width="120">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<div class="input-label-container">
|
<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>
|
<label>%</label>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
<el-table-column prop="name" label="谐波相角" align="center" width="120">
|
<el-table-column prop="name" label="谐波相角" align="center" width="120">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<div class="input-label-container">
|
<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>
|
<label>°</label>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
<el-table-column prop="date" label="谐波含有率" align="center" width="120">
|
<el-table-column prop="date" label="谐波含有率" align="center" width="120">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<div class="input-label-container">
|
<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>
|
<label>%</label>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
<el-table-column prop="name" label="谐波相角" align="center" width="120">
|
<el-table-column prop="name" label="谐波相角" align="center" width="120">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<div class="input-label-container">
|
<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>
|
<label>°</label>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
<el-table-column prop="date" label="谐波含有率" align="center" width="120">
|
<el-table-column prop="date" label="谐波含有率" align="center" width="120">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<div class="input-label-container">
|
<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>
|
<label>%</label>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
<el-table-column prop="name" align="center" label="谐波相角" width="120">
|
<el-table-column prop="name" align="center" label="谐波相角" width="120">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<div class="input-label-container">
|
<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>
|
<label>°</label>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
<el-table-column prop="date" label="谐波含有率" align="center" width="120">
|
<el-table-column prop="date" label="谐波含有率" align="center" width="120">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<div class="input-label-container">
|
<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>
|
<label>%</label>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -81,7 +81,7 @@
|
|||||||
<el-table-column prop="name" label="谐波相角" align="center" width="120">
|
<el-table-column prop="name" label="谐波相角" align="center" width="120">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<div class="input-label-container">
|
<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>
|
<label>°</label>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="相角(°)" label-width="80px">
|
<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>
|
||||||
<el-form-item label-width="80px">
|
<el-form-item label-width="80px">
|
||||||
<el-button type="primary" @click="inHarmFlagAdd">添加</el-button>
|
<el-button type="primary" @click="inHarmFlagAdd">添加</el-button>
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="相角(°)" label-width="80px">
|
<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>
|
||||||
<el-form-item label-width="80px">
|
<el-form-item label-width="80px">
|
||||||
<el-button type="primary" @click="inHarmFlagDelete(item)">删除</el-button>
|
<el-button type="primary" @click="inHarmFlagDelete(item)">删除</el-button>
|
||||||
@@ -54,7 +54,7 @@ const num = ref(0)
|
|||||||
|
|
||||||
// 添加间谐波
|
// 添加间谐波
|
||||||
const inHarmFlagAdd = () => {
|
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
|
num.value += 1
|
||||||
}
|
}
|
||||||
// 删除
|
// 删除
|
||||||
|
|||||||
@@ -138,8 +138,8 @@ const save = () => {
|
|||||||
pqScriptAdd(formContent.value).then(res => {
|
pqScriptAdd(formContent.value).then(res => {
|
||||||
if (res.code === 'A0000') {
|
if (res.code === 'A0000') {
|
||||||
ElMessage.success({ message: res.message })
|
ElMessage.success({ message: res.message })
|
||||||
// scriptId.value = res.data
|
formContent.value.id = JSON.stringify(res.data)
|
||||||
formContent.value.id = '46296b72528f805376e362df594fc669'
|
titleType.value == '编辑检测脚本'
|
||||||
show.value = true
|
show.value = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -171,13 +171,13 @@ const open = async (title: string, row: any) => {
|
|||||||
// 获取树字典
|
// 获取树字典
|
||||||
const treeInfo = async (currentMode: string) => {
|
const treeInfo = async (currentMode: string) => {
|
||||||
const data: Dict.ResDictTree = {
|
const data: Dict.ResDictTree = {
|
||||||
name: '',
|
name: '',
|
||||||
id: '',
|
id: '',
|
||||||
pid: '',
|
pid: '',
|
||||||
pids: '',
|
pids: '',
|
||||||
code: 'Script_Indicator_Items',
|
code: 'Script_Indicator_Items',
|
||||||
sort: 0
|
sort: 0
|
||||||
};
|
}
|
||||||
const result = await getDictTreeByCode(data)
|
const result = await getDictTreeByCode(data)
|
||||||
const allOptions = convertToOptions(result.data as Dict.ResDictTree[])
|
const allOptions = convertToOptions(result.data as Dict.ResDictTree[])
|
||||||
secondLevelOptions.push(...(allOptions[0]?.children || []))
|
secondLevelOptions.push(...(allOptions[0]?.children || []))
|
||||||
@@ -198,7 +198,7 @@ onMounted(() => {
|
|||||||
const convertToOptions = (dictTree: Dict.ResDictTree[]): CascaderOption[] => {
|
const convertToOptions = (dictTree: Dict.ResDictTree[]): CascaderOption[] => {
|
||||||
return dictTree.map(item => ({
|
return dictTree.map(item => ({
|
||||||
value: item.id,
|
value: item.id,
|
||||||
code: item.code,
|
code: item.code.split('-')[1] || item.code.split('-')[0],
|
||||||
label: item.name,
|
label: item.name,
|
||||||
children: item.children ? convertToOptions(item.children) : undefined
|
children: item.children ? convertToOptions(item.children) : undefined
|
||||||
}))
|
}))
|
||||||
|
|||||||
@@ -9,16 +9,16 @@
|
|||||||
<!-- 右侧编辑区域内容 -->
|
<!-- 右侧编辑区域内容 -->
|
||||||
<el-form :inline="true" label-width="auto" :model="form" class="form-two">
|
<el-form :inline="true" label-width="auto" :model="form" class="form-two">
|
||||||
<el-form-item label="电压有效值(V)">
|
<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>
|
||||||
<el-form-item label="电流有效值(A)">
|
<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>
|
||||||
<el-form-item label="电压相角(°)">
|
<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>
|
||||||
<el-form-item label="电流相角(°)">
|
<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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<template>
|
<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 }">
|
<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">
|
<div class="custom-tree-node">
|
||||||
{{ data.scriptTypeName }}
|
{{ data.scriptTypeName || data.sourceDesc }}
|
||||||
</div>
|
</div>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
@@ -11,11 +11,11 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive } from 'vue'
|
import { ref, reactive } from 'vue'
|
||||||
import { getTreeData } from '@/api/check/test'
|
|
||||||
import { CheckData } from '@/api/check/interface'
|
import { CheckData } from '@/api/check/interface'
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
formContent: {
|
treeData: {
|
||||||
type: Object,
|
type: Array,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -25,16 +25,10 @@ const defaultProps = {
|
|||||||
label: 'scriptTypeName',
|
label: 'scriptTypeName',
|
||||||
pid: 'pid'
|
pid: 'pid'
|
||||||
}
|
}
|
||||||
const open = () => {
|
|
||||||
getTreeData({
|
onMounted(() => {})
|
||||||
scriptId: props.formContent.id
|
// // 对外映射
|
||||||
}).then(res => {
|
// defineExpose({ init })
|
||||||
dataTree.value = res.data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
onMounted(() => {
|
|
||||||
open()
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.custom-tree-node {
|
.custom-tree-node {
|
||||||
|
|||||||
Reference in New Issue
Block a user