联调 新增检测脚本
This commit is contained in:
@@ -26,3 +26,7 @@ export const updatePqScript = (params: TestScript.ResTestScript) => {
|
||||
export const deletePqScript = (params: string[]) => {
|
||||
return http.post(`/pqScript/delete`, params)
|
||||
}
|
||||
//添加检测脚本
|
||||
export const addScriptDtls = (params: any) => {
|
||||
return http.post(`/pqScript/addScriptDtls`, params)
|
||||
}
|
||||
|
||||
BIN
frontend/src/assets/images/transient.png
Normal file
BIN
frontend/src/assets/images/transient.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 62 KiB |
@@ -58,7 +58,14 @@ const props = defineProps({
|
||||
})
|
||||
const tableData = ref<any[]>([])
|
||||
onMounted(async () => {
|
||||
let data = await getDictTreeByCode({ code: 'Script_Error' })
|
||||
let data = await getDictTreeByCode({
|
||||
name: '',
|
||||
id: '',
|
||||
pid: '',
|
||||
pids: '',
|
||||
code: 'Script_Error',
|
||||
sort: 0
|
||||
})
|
||||
|
||||
data.data[0].children.forEach((item: any, i: number) => {
|
||||
tableData.value.push({
|
||||
|
||||
196
frontend/src/views/machine/testScript/components/scriptForm.ts
Normal file
196
frontend/src/views/machine/testScript/components/scriptForm.ts
Normal file
@@ -0,0 +1,196 @@
|
||||
let scriptForm = {
|
||||
value: '',
|
||||
label: '',
|
||||
subType: '', //tabcode
|
||||
fFreq: 50.01, //频率
|
||||
channelList: [
|
||||
{
|
||||
channelFlag: false, //通道使能
|
||||
harmFlag: false, //谐波使能
|
||||
inHarmFlag: false, //间谐波使能
|
||||
flickerFlag: false, //闪变使能
|
||||
dipFlag: false, //暂态使能
|
||||
fAmp: 0, //幅值
|
||||
fPhase: 0, //相角
|
||||
harmList: [
|
||||
// {
|
||||
// harm: 2, //谐波次数
|
||||
// fAmp: 0, //谐波含有率
|
||||
// fPhase: 0 // 谐波相角
|
||||
// },
|
||||
], //谐波
|
||||
inHarmList: [
|
||||
{
|
||||
inharm: 0, //间谐波次数
|
||||
fAmp: 0, //间谐波含有率
|
||||
fPhase: 0 // 间谐波相角
|
||||
}
|
||||
], //间谐波
|
||||
flickerData: {
|
||||
fChagValue: 0, //电压变动幅度
|
||||
fChagFre: 0, //波动频度
|
||||
waveFluType: 0, //波动类型
|
||||
waveType: 0, //波类型
|
||||
fDutyCycle: 0 //占空比
|
||||
}, //闪变
|
||||
dipData: {
|
||||
fTransValue: 0, // 暂态幅值
|
||||
fRetainTime: 0 // 暂态持续时间
|
||||
} //暂态
|
||||
},
|
||||
{
|
||||
channelFlag: false, //通道使能
|
||||
harmFlag: false, //谐波使能
|
||||
inHarmFlag: false, //间谐波使能
|
||||
flickerFlag: false, //闪变使能
|
||||
dipFlag: false, //暂态使能
|
||||
fAmp: 0, //幅值
|
||||
fPhase: 0, //相角
|
||||
harmList: [], //谐波
|
||||
inHarmList: [
|
||||
{
|
||||
inharm: 1, //间谐波次数
|
||||
fAmp: 0, //间谐波含有率
|
||||
fPhase: 0 // 间谐波相角
|
||||
}
|
||||
], //间谐波
|
||||
flickerData: {
|
||||
fChagValue: 0, //电压变动幅度
|
||||
fChagFre: 0, //波动频度
|
||||
waveFluType: 0, //波动类型
|
||||
waveType: 0, //波类型
|
||||
fDutyCycle: 0 //占空比
|
||||
}, //闪变
|
||||
dipData: {
|
||||
fTransValue: 0, // 暂态幅值
|
||||
fRetainTime: 0 // 暂态持续时间
|
||||
} //暂态
|
||||
},
|
||||
{
|
||||
channelFlag: false, //通道使能
|
||||
harmFlag: false, //谐波使能
|
||||
inHarmFlag: false, //间谐波使能
|
||||
flickerFlag: false, //闪变使能
|
||||
dipFlag: false, //暂态使能
|
||||
fAmp: 0, //幅值
|
||||
fPhase: 0, //相角
|
||||
harmList: [], //谐波
|
||||
inHarmList: [
|
||||
{
|
||||
inharm: 1, //间谐波次数
|
||||
fAmp: 0, //间谐波含有率
|
||||
fPhase: 0 // 间谐波相角
|
||||
}
|
||||
], //间谐波
|
||||
flickerData: {
|
||||
fChagValue: 0, //电压变动幅度
|
||||
fChagFre: 0, //波动频度
|
||||
waveFluType: 0, //波动类型
|
||||
waveType: 0, //波类型
|
||||
fDutyCycle: 0 //占空比
|
||||
}, //闪变
|
||||
dipData: {
|
||||
fTransValue: 0, // 暂态幅值
|
||||
fRetainTime: 0 // 暂态持续时间
|
||||
} //暂态
|
||||
},
|
||||
{
|
||||
channelFlag: false, //通道使能
|
||||
harmFlag: false, //谐波使能
|
||||
inHarmFlag: false, //间谐波使能
|
||||
flickerFlag: false, //闪变使能
|
||||
dipFlag: false, //暂态使能
|
||||
fAmp: 0, //幅值
|
||||
fPhase: 0, //相角
|
||||
harmList: [], //谐波
|
||||
inHarmList: [
|
||||
{
|
||||
inharm: 1, //间谐波次数
|
||||
fAmp: 0, //间谐波含有率
|
||||
fPhase: 0 // 间谐波相角
|
||||
}
|
||||
], //间谐波
|
||||
flickerData: {
|
||||
fChagValue: 0, //电压变动幅度
|
||||
fChagFre: 0, //波动频度
|
||||
waveFluType: 0, //波动类型
|
||||
waveType: 0, //波类型
|
||||
fDutyCycle: 0 //占空比
|
||||
}, //闪变
|
||||
dipData: {
|
||||
fTransValue: 0, // 暂态幅值
|
||||
fRetainTime: 0 // 暂态持续时间
|
||||
} //暂态
|
||||
},
|
||||
{
|
||||
channelFlag: false, //通道使能
|
||||
harmFlag: false, //谐波使能
|
||||
inHarmFlag: false, //间谐波使能
|
||||
flickerFlag: false, //闪变使能
|
||||
dipFlag: false, //暂态使能
|
||||
fAmp: 0, //幅值
|
||||
fPhase: 0, //相角
|
||||
harmList: [], //谐波
|
||||
inHarmList: [
|
||||
{
|
||||
inharm: 1, //间谐波次数
|
||||
fAmp: 0, //间谐波含有率
|
||||
fPhase: 0 // 间谐波相角
|
||||
}
|
||||
], //间谐波
|
||||
flickerData: {
|
||||
fChagValue: 0, //电压变动幅度
|
||||
fChagFre: 0, //波动频度
|
||||
waveFluType: 0, //波动类型
|
||||
waveType: 0, //波类型
|
||||
fDutyCycle: 0 //占空比
|
||||
}, //闪变
|
||||
dipData: {
|
||||
fTransValue: 0, // 暂态幅值
|
||||
fRetainTime: 0 // 暂态持续时间
|
||||
} //暂态
|
||||
},
|
||||
{
|
||||
channelFlag: false, //通道使能
|
||||
harmFlag: false, //谐波使能
|
||||
inHarmFlag: false, //间谐波使能
|
||||
flickerFlag: false, //闪变使能
|
||||
dipFlag: false, //暂态使能
|
||||
fAmp: 0, //幅值
|
||||
fPhase: 0, //相角
|
||||
harmList: [], //谐波
|
||||
inHarmList: [
|
||||
{
|
||||
inharm: 1, //间谐波次数
|
||||
fAmp: 0, //间谐波含有率
|
||||
fPhase: 0 // 间谐波相角
|
||||
}
|
||||
], //间谐波
|
||||
flickerData: {
|
||||
fChagValue: 0, //电压变动幅度
|
||||
fChagFre: 0, //波动频度
|
||||
waveFluType: 0, //波动类型
|
||||
waveType: 0, //波类型
|
||||
fDutyCycle: 0 //占空比
|
||||
}, //闪变
|
||||
dipData: {
|
||||
fTransValue: 0, // 暂态幅值
|
||||
fRetainTime: 0 // 暂态持续时间
|
||||
} //暂态
|
||||
}
|
||||
]
|
||||
}
|
||||
// 追加谐波
|
||||
function getScriptForm() {
|
||||
for (let i = 2; i < 51; i++) {
|
||||
scriptForm.channelList.forEach(item => {
|
||||
item.harmList.push({
|
||||
harm: i, //谐波次数
|
||||
fAmp: 0, //谐波含有率
|
||||
fPhase: 0 // 谐波相角
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
getScriptForm()
|
||||
export default scriptForm
|
||||
@@ -5,12 +5,12 @@
|
||||
<el-tab-pane label="检测">
|
||||
<!-- 全局设置菜单内容 -->
|
||||
<div style="height: 295px">
|
||||
<el-radio-group v-model="radio">
|
||||
<el-radio-group v-model="subType">
|
||||
<el-radio
|
||||
v-for="item in tabChildren"
|
||||
:key="item"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
:value="item.code"
|
||||
border
|
||||
style="margin: 0 0 10px 10px"
|
||||
/>
|
||||
@@ -37,23 +37,45 @@
|
||||
<el-table-column prop="L1" label="值" width="180" align="center">
|
||||
<template #default="{ row, $index }">
|
||||
<span>
|
||||
{{ row.frequency === 'V' ? '电压' : '电流' }}{{ form.children[$index].fAmp
|
||||
}}{{ row.frequency === 'V' ? 'V' : 'A' }} 相角{{ form.children[$index].fPhase }}°
|
||||
{{ row.frequency === 'V' ? '电压' : '电流' }}{{ form.channelList[$index].fAmp
|
||||
}}{{ valueCode == 'Absolute' ? (row.frequency === 'V' ? 'V' : 'A') : '%' }} 相角{{
|
||||
form.channelList[$index].fPhase
|
||||
}}°
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="85">
|
||||
<template #default="{}">
|
||||
<el-button type="primary" link :icon="Bottom">复制</el-button>
|
||||
<template #default="{ row, $index }">
|
||||
<el-button type="primary" v-if="$index != 4" link :icon="CopyDocument">复制</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="{ row, $index }">
|
||||
<el-checkbox-group v-model="form.children[$index].checkboxGroup">
|
||||
<el-checkbox-button v-for="item in GroupList" :key="item.value" :value="item.value">
|
||||
{{ item.label }}
|
||||
</el-checkbox-button>
|
||||
</el-checkbox-group>
|
||||
<el-checkbox-button
|
||||
v-model="form.channelList[$index].channelFlag"
|
||||
label="通道使能"
|
||||
size="small"
|
||||
/>
|
||||
<el-checkbox-button
|
||||
v-model="form.channelList[$index].harmFlag"
|
||||
label="谐波使能"
|
||||
size="small"
|
||||
/>
|
||||
<el-checkbox-button
|
||||
v-model="form.channelList[$index].inHarmFlag"
|
||||
label="间谐波使能"
|
||||
size="small"
|
||||
/>
|
||||
<el-checkbox-button
|
||||
v-model="form.channelList[$index].flickerFlag"
|
||||
label="闪变使能"
|
||||
size="small"
|
||||
/>
|
||||
<el-checkbox-button
|
||||
v-model="form.channelList[$index].dipFlag"
|
||||
label="暂态使能"
|
||||
size="small"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -66,7 +88,7 @@
|
||||
<div class="form-item-container">
|
||||
<el-form-item label="频率:" prop="name">
|
||||
<div class="input-label-container">
|
||||
<el-input 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>
|
||||
@@ -81,19 +103,19 @@
|
||||
</div>
|
||||
<div style="margin-top: 10px">
|
||||
<el-tabs type="border-card" class="custom-tabs">
|
||||
<el-tab-pane label="电压/电流编辑">
|
||||
<el-tab-pane label="电压/电流编辑" v-if="childForm[0].channelFlag || childForm[1].channelFlag">
|
||||
<TestScriptVolCurTab :childForm="childForm" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="谐波编辑">
|
||||
<el-tab-pane label="谐波编辑" v-if="childForm[0].harmFlag || childForm[1].harmFlag">
|
||||
<TestScriptHarmTab :childForm="childForm" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="间谐波编辑">
|
||||
<el-tab-pane label="间谐波编辑" v-if="childForm[0].inHarmFlag || childForm[1].inHarmFlag">
|
||||
<TestScriptInHarmTab :childForm="childForm" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="闪变编辑">
|
||||
<el-tab-pane label="闪变编辑" v-if="childForm[0].flickerFlag || childForm[1].flickerFlag">
|
||||
<TestScriptFlickerTab :childForm="childForm" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="暂态编辑">
|
||||
<el-tab-pane label="暂态编辑" v-if="childForm[0].dipFlag || childForm[1].dipFlag">
|
||||
<TestScriptDipTab :childForm="childForm" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
@@ -121,116 +143,34 @@ import TestScriptHarmTab from '@/views/machine/testScript/components/testScriptH
|
||||
import TestScriptInHarmTab from '@/views/machine/testScript/components/testScriptInHarmTab.vue'
|
||||
import TestScriptFlickerTab from '@/views/machine/testScript/components/testScriptFlickerTab.vue'
|
||||
import TestScriptDipTab from '@/views/machine/testScript/components/testScriptDipTab.vue'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
import { addScriptDtls } from '@/api/device/testScript'
|
||||
import scriptForm from './scriptForm'
|
||||
|
||||
const emit = defineEmits(['addTab'])
|
||||
interface TabOption {
|
||||
label: string
|
||||
name: string
|
||||
value: string
|
||||
children?: TabOption[]
|
||||
}
|
||||
|
||||
const dictStore = useDictStore()
|
||||
const props = defineProps({
|
||||
options: {
|
||||
type: Array as PropType<TabOption[]>,
|
||||
type: [Array, Object],
|
||||
required: true
|
||||
},
|
||||
activeName: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
formContent: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
const GroupList = [
|
||||
{
|
||||
label: '通道使能',
|
||||
value: 'channelFlag'
|
||||
},
|
||||
{
|
||||
label: '谐波使能',
|
||||
value: 'harmFlag'
|
||||
},
|
||||
{
|
||||
label: '间谐波使能',
|
||||
value: 'inHarmFlag'
|
||||
},
|
||||
{
|
||||
label: '闪变使能',
|
||||
value: 'flickerFlag'
|
||||
},
|
||||
{
|
||||
label: '暂态使能',
|
||||
value: 'dipFlag'
|
||||
}
|
||||
]
|
||||
const form: any = ref({
|
||||
value: '',
|
||||
label: '',
|
||||
fFreq: 50,
|
||||
children: [
|
||||
{
|
||||
checkboxGroup: ['channelFlag','harmFlag'],//通道选择
|
||||
fAmp: 0, //幅值
|
||||
fPhase: 0, //相角
|
||||
harmList: [
|
||||
{
|
||||
harm: 1, //谐波次数
|
||||
fAmp: 0, //谐波含有率
|
||||
fPhase: 0 // 谐波相角
|
||||
}
|
||||
], //谐波
|
||||
inHarmList: [
|
||||
{
|
||||
inharm: 1, //间谐波次数
|
||||
fAmp: 0, //间谐波含有率
|
||||
fPhase: 0 // 间谐波相角
|
||||
}
|
||||
], //间谐波
|
||||
flickerData: {
|
||||
fChagValue: 0,//电压变动幅度
|
||||
fChagFre: 0, //波动频度
|
||||
waveFluType: 0, //波动类型
|
||||
waveType: 0, //波类型
|
||||
fDutyCycle: 0, //占空比
|
||||
|
||||
}, //闪变
|
||||
dipData: {
|
||||
fTransValue: 0, // 暂态幅值
|
||||
fRetainTime: 0 // 暂态持续时间
|
||||
} //暂态
|
||||
},
|
||||
{
|
||||
checkboxGroup: [],
|
||||
fAmp: 0,
|
||||
fPhase: 0
|
||||
},
|
||||
{
|
||||
checkboxGroup: [],
|
||||
fAmp: 0,
|
||||
fPhase: 0
|
||||
},
|
||||
{
|
||||
checkboxGroup: [],
|
||||
fAmp: 0,
|
||||
fPhase: 0
|
||||
},
|
||||
{
|
||||
checkboxGroup: [],
|
||||
fAmp: 0,
|
||||
fPhase: 0
|
||||
},
|
||||
{
|
||||
checkboxGroup: [],
|
||||
fAmp: 0,
|
||||
fPhase: 0
|
||||
}
|
||||
]
|
||||
})
|
||||
console.log(`123`, props.formContent)
|
||||
// let valueType
|
||||
const form: any = ref(scriptForm)
|
||||
const childForm: any = ref([])
|
||||
|
||||
const ScriptValueType = ref('')
|
||||
const dialogVisible = ref(false)
|
||||
const dialogTitle = ref()
|
||||
const setValueTable = ref()
|
||||
const buttonTypeOptions = ['default', 'text', 'success', 'warning', 'info', 'primary', 'danger'] as const
|
||||
const valueCode = ref() //Absolute绝对值
|
||||
|
||||
const tableData = [
|
||||
{ name: 'L1', frequency: 'V', electricity: 0, fPhase: 0, sort: 0 },
|
||||
@@ -240,7 +180,7 @@ const tableData = [
|
||||
{ name: 'L3', frequency: 'V', electricity: 0, fPhase: 0, sort: 2 },
|
||||
{ name: 'L3', frequency: 'I', electricity: 0, fPhase: 0, sort: 2 }
|
||||
]
|
||||
const radio = ref('')
|
||||
const subType = ref('')
|
||||
const tabChildren: any = ref([])
|
||||
// 定义 span-method 逻辑
|
||||
const arraySpanMethod = ({ rowIndex, columnIndex }: { rowIndex: number; columnIndex: number }) => {
|
||||
@@ -271,8 +211,8 @@ const handleRowClick = async (row: any, column: any) => {
|
||||
if (column.label == '相别') {
|
||||
childForm.value = []
|
||||
selectedRow.value = row.name
|
||||
childForm.value.push(form.value.children[row.sort * 2])
|
||||
childForm.value.push(form.value.children[row.sort * 2 + 1])
|
||||
childForm.value.push(form.value.channelList[row.sort * 2])
|
||||
childForm.value.push(form.value.channelList[row.sort * 2 + 1])
|
||||
console.log('🚀 ~ handleRowClick ~ childForm.value:', childForm.value)
|
||||
}
|
||||
|
||||
@@ -286,10 +226,20 @@ const close = () => {
|
||||
|
||||
// 保存数据
|
||||
const save = () => {
|
||||
dialogVisible.value = false
|
||||
form.value.value = radio.value
|
||||
form.value.label = tabChildren.value.filter(item => item.value == radio.value)[0].label
|
||||
emit('addTab', form.value)
|
||||
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)
|
||||
})
|
||||
|
||||
addScriptDtls({ ...copyForm, id: props.formContent.id }).then(res => {})
|
||||
// emit('addTab', form.value)
|
||||
}
|
||||
|
||||
// 打开弹窗,可能是新增,也可能是编辑
|
||||
@@ -298,8 +248,12 @@ const open = (sign: string, row: any) => {
|
||||
dialogTitle.value = sign === 'add' ? '新增检测项目信息' : '编辑检测项目信息'
|
||||
// 添加选择检测项目
|
||||
tabChildren.value = props.options.filter(item => item.value == props.activeName)[0].children || []
|
||||
radio.value = tabChildren.value[0].value || ''
|
||||
subType.value = tabChildren.value[0].code || ''
|
||||
handleRowClick({ name: 'L1', sort: 0 }, { label: '相别' })
|
||||
dictStore.getDictData('Script_Value_Type')
|
||||
valueCode.value = dictStore
|
||||
.getDictData('Script_Value_Type')
|
||||
.filter(item => item.id == props.formContent.valueType)[0].code
|
||||
}
|
||||
|
||||
// 打开 drawer(新增、编辑)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
</div>
|
||||
<div class="data-check-content">
|
||||
<div class="content-tree">
|
||||
<Tree :scriptId="props.scriptId" />
|
||||
<Tree :formContent="props.formContent" />
|
||||
</div>
|
||||
<div class="content-tree" style="width: 400px">
|
||||
<Commun :options="props.options" />
|
||||
@@ -91,7 +91,13 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<TestProjectPopup ref="testProjectPopup" :options="props.options" :activeName="activeName" @addTab="addTab" />
|
||||
<TestProjectPopup
|
||||
ref="testProjectPopupRef"
|
||||
:options="props.options"
|
||||
:activeName="activeName"
|
||||
@addTab="addTab"
|
||||
:formContent="props.formContent"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -104,9 +110,10 @@ import type { TestScript } from '@/api/device/interface/testScript'
|
||||
import TestProjectPopup from '@/views/machine/testScript/components/testProjectPopup.vue'
|
||||
|
||||
interface TabOption {
|
||||
label: string
|
||||
name: string
|
||||
value: string
|
||||
label?: string
|
||||
name?: string
|
||||
value?: string
|
||||
code?: string
|
||||
children?: TabOption[]
|
||||
}
|
||||
|
||||
@@ -115,13 +122,13 @@ const props = defineProps({
|
||||
type: Array as PropType<TabOption[]>,
|
||||
required: true
|
||||
},
|
||||
scriptId: {
|
||||
type: String,
|
||||
formContent: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
const activeName = ref('')
|
||||
const testProjectPopup = 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°' },
|
||||
@@ -136,38 +143,41 @@ const tabData: any = ref([])
|
||||
const openDialog = (titleType: string, row: Partial<TestScript.ResTestScript> = {}) => {
|
||||
if (titleType == 'add') {
|
||||
}
|
||||
testProjectPopup.value?.open(titleType, row)
|
||||
testProjectPopupRef.value?.open(titleType, row)
|
||||
}
|
||||
// 新增保存
|
||||
const addTab = (row: any) => {
|
||||
let data = JSON.parse(JSON.stringify(row))
|
||||
let flag = true
|
||||
let list: any = {}
|
||||
let childrenList = {}
|
||||
tabData.value.forEach(item => {
|
||||
if (item.value == activeName.value) {
|
||||
// item.children.push(JSON.parse(JSON.stringify(row)))
|
||||
list = item
|
||||
item.children.forEach(k => {
|
||||
if (k.value == row.value) {
|
||||
flag = false
|
||||
childrenList = k
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
if (flag) {
|
||||
list.children.push(data)
|
||||
} else {
|
||||
childrenList.children.push(data)
|
||||
}
|
||||
console.log('🚀 ~ addTab ~ tabData.value:', tabData.value)
|
||||
|
||||
// let data = JSON.parse(JSON.stringify(row))
|
||||
// let flag = true
|
||||
// let list: any = {}
|
||||
// let childrenList: any = {}
|
||||
// tabData.value.forEach(item => {
|
||||
// if (item.value == activeName.value) {
|
||||
// // item.children.push(JSON.parse(JSON.stringify(row)))
|
||||
// list = item
|
||||
// item.children.forEach(k => {
|
||||
// if (k.value == row.value) {
|
||||
// flag = false
|
||||
// childrenList = k
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// if (flag) {
|
||||
// list.children.push(data)
|
||||
// } else {
|
||||
// childrenList.children.push(data)
|
||||
// }
|
||||
}
|
||||
onMounted(() => {
|
||||
console.log('🚀 ~ onMounted ~ props.options:', props.options)
|
||||
|
||||
props.options.forEach(item => {
|
||||
tabData.value.push({
|
||||
label: item.label.replace(/准确度|检测/g, ''),
|
||||
value: item.value,
|
||||
code: item.code,
|
||||
children: []
|
||||
})
|
||||
})
|
||||
|
||||
@@ -3,25 +3,56 @@
|
||||
<div class="left-editor">
|
||||
<!-- 左侧编辑区域内容 -->
|
||||
|
||||
<img src="@/assets/images/transient.png" />
|
||||
<div class="inputTop">
|
||||
<el-input v-model="form[0].dipData.fValue" style="width: 150px; left: 4%" :disabled="!form[0].dipFlag">
|
||||
<template #append>S</template>
|
||||
</el-input>
|
||||
<el-input v-model="form[0].dipData.fValue" style="width: 150px; left: 22%" :disabled="!form[0].dipFlag">
|
||||
<template #append>S</template>
|
||||
</el-input>
|
||||
<el-input v-model="form[0].dipData.fValue" style="width: 150px; left: 40%" :disabled="!form[0].dipFlag">
|
||||
<template #append>S</template>
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="inputBottom">
|
||||
<el-input v-model="form[0].dipData.fValue" style="width: 150px; left: 21%" :disabled="!form[0].dipFlag">
|
||||
<template #append>S</template>
|
||||
</el-input>
|
||||
<el-input v-model="form[0].dipData.fValue" style="width: 150px; left: 40%" :disabled="!form[0].dipFlag">
|
||||
<template #append>S</template>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right-editor">
|
||||
<!-- 右侧编辑区域内容 -->
|
||||
<el-form-item label-width="120px" label="设定幅度(%)">
|
||||
<el-input v-model="input1" style="width: 150px;" />
|
||||
<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="input2" style="width: 150px;"/>
|
||||
<el-input v-model="form[0].dipData.fRetainTime" style="width: 150px" :disabled="!form[0].dipFlag"/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const input1 = ref('')
|
||||
const input2 = ref('')
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
const props = defineProps({
|
||||
childForm: {
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
const form: any = computed({
|
||||
get() {
|
||||
return props.childForm
|
||||
},
|
||||
set(value) {}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
<style lang="scss" scoped>
|
||||
canvas {
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
@@ -29,16 +60,31 @@ canvas {
|
||||
.editor-container {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
.left-editor {
|
||||
flex: 3; /* 左侧区域占据 3/4 的宽度 */
|
||||
margin-left: 150px; /* 可选:添加间距 */
|
||||
flex: 1; /* 左侧区域占据 3/4 的宽度 */
|
||||
position: relative;
|
||||
img {
|
||||
width: 90%;
|
||||
height: 150px;
|
||||
margin: 0 10px 20px;
|
||||
}
|
||||
.inputTop {
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
width: 100%;
|
||||
}
|
||||
.inputBottom {
|
||||
position: absolute;
|
||||
bottom: -5px;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.right-editor {
|
||||
flex: 1; /* 右侧区域占据 1/4 的宽度 */
|
||||
margin-right: 250px; /* 向左侧移动一点 */
|
||||
width: 400px;
|
||||
/* margin-right: 250px; 向左侧移动一点 */
|
||||
}
|
||||
</style>
|
||||
@@ -1,19 +1,24 @@
|
||||
<template>
|
||||
<div class="tabs-container">
|
||||
<el-tabs type="border-card" class="fixed-width-tabs" style="height: 100%;">
|
||||
<el-tabs type="border-card" class="fixed-width-tabs" style="height: 100%">
|
||||
<el-tab-pane label="Modulation">
|
||||
<!-- 全局设置菜单内容 -->
|
||||
<div>
|
||||
<el-form-item label="电压变动幅度(%)" label-width="140px" prop='name'>
|
||||
<el-input style="width: 150px;"/>
|
||||
<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-form-item>
|
||||
</div>
|
||||
<div class="form-container">
|
||||
<el-form-item label="波动频度(/min/Hz)" label-width="140px" prop='name'>
|
||||
<el-input style="width: 150px;"/>
|
||||
<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-form-item>
|
||||
<el-form-item label="波动类型" prop='name'>
|
||||
<el-select placeholder="请选择波动类型" style="width: 150px;">
|
||||
<el-form-item label="波动类型" prop="name">
|
||||
<el-select
|
||||
placeholder="请选择波动类型"
|
||||
style="width: 150px"
|
||||
v-model="form[0].flickerData.waveFluType"
|
||||
:disabled="!form[0].flickerFlag"
|
||||
>
|
||||
<el-option label="Hz" :value="1"></el-option>
|
||||
<el-option label="CPM" :value="0"></el-option>
|
||||
</el-select>
|
||||
@@ -21,12 +26,17 @@
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<el-tabs type="border-card" class="fixed-width-tabs" style="height: 100%;">
|
||||
<el-tabs type="border-card" class="fixed-width-tabs" style="height: 100%">
|
||||
<el-tab-pane label="WaveForm">
|
||||
<!-- 全局设置菜单内容 -->
|
||||
<div>
|
||||
<el-form-item label="波类型" label-width="100px" prop='name'>
|
||||
<el-select placeholder="请选择波类型" style="width: 150px;">
|
||||
<el-form-item label="波类型" label-width="100px" prop="name">
|
||||
<el-select
|
||||
placeholder="请选择波类型"
|
||||
style="width: 150px"
|
||||
v-model="form[0].flickerData.waveType"
|
||||
:disabled="!form[0].flickerFlag"
|
||||
>
|
||||
<el-option label="RECT" :value="2"></el-option>
|
||||
<el-option label="SIN" :value="1"></el-option>
|
||||
<el-option label="SQU" :value="0"></el-option>
|
||||
@@ -34,8 +44,8 @@
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div>
|
||||
<el-form-item label="占空比(%)" label-width="100px" prop='name'>
|
||||
<el-input style="width: 150px;"/>
|
||||
<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-form-item>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
@@ -44,7 +54,19 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
const props = defineProps({
|
||||
childForm: {
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
const form: any = computed({
|
||||
get() {
|
||||
return props.childForm
|
||||
},
|
||||
set(value) {}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@@ -63,7 +85,6 @@
|
||||
}
|
||||
|
||||
.fixed-width-tabs {
|
||||
|
||||
margin-right: 100px; /* 可选:添加右侧间距 */
|
||||
}
|
||||
|
||||
|
||||
@@ -7,17 +7,17 @@
|
||||
<el-table :data="tableData1" border size="small" class="half-width-table">
|
||||
<el-table-column prop="date" align="center" label="次数" width="60" />
|
||||
<el-table-column prop="date" align="center" label="谐波含有率" width="120">
|
||||
<template #default="scope">
|
||||
<template #default="{ row, $index }">
|
||||
<div class="input-label-container">
|
||||
<el-input size="small" />
|
||||
<el-input type="number" size="small" v-model="form[0].harmList[$index].fAmp" :disabled="!form[0].harmFlag"/>
|
||||
<label>%</label>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="谐波相角" align="center" width="120">
|
||||
<template #default="scope">
|
||||
<template #default="{ row, $index }">
|
||||
<div class="input-label-container">
|
||||
<el-input size="small" />
|
||||
<el-input type="number" size="small" v-model="form[0].harmList[$index].fPhase" :disabled="!form[0].harmFlag"/>
|
||||
<label>°</label>
|
||||
</div>
|
||||
</template>
|
||||
@@ -26,17 +26,17 @@
|
||||
<el-table :data="tableData2" border size="small" class="half-width-table">
|
||||
<el-table-column prop="date" label="次数" align="center" width="60" />
|
||||
<el-table-column prop="date" label="谐波含有率" align="center" width="120">
|
||||
<template #default="scope">
|
||||
<template #default="{ row, $index }">
|
||||
<div class="input-label-container">
|
||||
<el-input size="small" />
|
||||
<el-input type="number" size="small" v-model="form[0].harmList[$index + 24].fAmp" :disabled="!form[0].harmFlag"/>
|
||||
<label>%</label>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="谐波相角" align="center" width="120">
|
||||
<template #default="scope">
|
||||
<template #default="{ row, $index }">
|
||||
<div class="input-label-container">
|
||||
<el-input size="small" />
|
||||
<el-input type="number" size="small" v-model="form[0].harmList[$index+24].fPhase" :disabled="!form[0].harmFlag"/>
|
||||
<label>°</label>
|
||||
</div>
|
||||
</template>
|
||||
@@ -52,17 +52,17 @@
|
||||
<el-table :data="tableData1" border size="small" class="half-width-table">
|
||||
<el-table-column prop="date" label="次数" align="center" width="60" />
|
||||
<el-table-column prop="date" label="谐波含有率" align="center" width="120">
|
||||
<template #default="scope">
|
||||
<template #default="{ row, $index }">
|
||||
<div class="input-label-container">
|
||||
<el-input size="small" />
|
||||
<el-input type="number" size="small" v-model="form[1].harmList[$index].fAmp" :disabled="!form[1].harmFlag"/>
|
||||
<label>%</label>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" align="center" label="谐波相角" width="120">
|
||||
<template #default="scope">
|
||||
<template #default="{ row, $index }">
|
||||
<div class="input-label-container">
|
||||
<el-input size="small" />
|
||||
<el-input type="number" size="small" v-model="form[1].harmList[$index].fPhase" :disabled="!form[1].harmFlag"/>
|
||||
<label>°</label>
|
||||
</div>
|
||||
</template>
|
||||
@@ -71,17 +71,17 @@
|
||||
<el-table :data="tableData2" border size="small" class="half-width-table">
|
||||
<el-table-column prop="date" label="次数" align="center" width="60" />
|
||||
<el-table-column prop="date" label="谐波含有率" align="center" width="120">
|
||||
<template #default="scope">
|
||||
<template #default="{ row, $index }">
|
||||
<div class="input-label-container">
|
||||
<el-input size="small" />
|
||||
<el-input type="number" size="small" v-model="form[1].harmList[$index + 24].fAmp" :disabled="!form[1].harmFlag"/>
|
||||
<label>%</label>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="谐波相角" align="center" width="120">
|
||||
<template #default="scope">
|
||||
<template #default="{ row, $index }">
|
||||
<div class="input-label-container">
|
||||
<el-input size="small" />
|
||||
<el-input type="number" size="small" v-model="form[1].harmList[$index+24].fPhase" :disabled="!form[1].harmFlag"/>
|
||||
<label>°</label>
|
||||
</div>
|
||||
</template>
|
||||
@@ -95,6 +95,19 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
const props = defineProps({
|
||||
childForm: {
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
|
||||
const form:any = computed({
|
||||
get() {
|
||||
return props.childForm
|
||||
},
|
||||
set(value) {}
|
||||
})
|
||||
|
||||
// 定义表格数据项的类型
|
||||
interface TableItem {
|
||||
@@ -108,7 +121,7 @@ interface TableItem {
|
||||
const tableData1 = ref<TableItem[]>([])
|
||||
const tableData2 = ref<TableItem[]>([])
|
||||
|
||||
for (let i = 1; i <= 25; i++) {
|
||||
for (let i = 2; i <= 25; i++) {
|
||||
tableData1.value.push({
|
||||
date: i.toString(),
|
||||
harmonicRate: `谐波含有率${i}`,
|
||||
|
||||
@@ -1,54 +1,77 @@
|
||||
<template>
|
||||
<div class="tabs-container">
|
||||
<el-tabs type="border-card" class="fixed-width-tabs" style="height: 100%;">
|
||||
<el-tab-pane label="间谐波A">
|
||||
<!-- 全局设置菜单内容 -->
|
||||
<div>
|
||||
<el-form-item label="含有率(%)" prop='name'>
|
||||
<el-input />
|
||||
<div class="container">
|
||||
<el-form-item label="频率" label-width="80px">
|
||||
<el-input v-model="form[0].inHarmList[0].inharm" :disabled="!form[0].inHarmFlag" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="含有率(%)" label-width="80px">
|
||||
<el-input v-model="form[0].inHarmList[0].fAmp" :disabled="!form[0].inHarmFlag" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="相角(°)" label-width="80px">
|
||||
<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>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div>
|
||||
<el-form-item label="间谐波次数" prop='name'>
|
||||
<el-input />
|
||||
<div class="container" v-for="item in num" :key="item">
|
||||
<el-form-item label="频率" label-width="80px">
|
||||
<el-input v-model="form[0].inHarmList[item].inharm" :disabled="!form[0].inHarmFlag" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="含有率(%)" label-width="80px">
|
||||
<el-input v-model="form[0].inHarmList[item].fAmp" :disabled="!form[0].inHarmFlag" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="相角(°)" label-width="80px">
|
||||
<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>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<el-tabs type="border-card" class="fixed-width-tabs" style="height: 100%;">
|
||||
<el-tab-pane label="间谐波B">
|
||||
<!-- 全局设置菜单内容 -->
|
||||
<div>
|
||||
<el-form-item label="含有率(%)" prop='name'>
|
||||
<el-input />
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div>
|
||||
<el-form-item label="间谐波次数" prop='name'>
|
||||
<el-input />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
const props = defineProps({
|
||||
childForm: {
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
|
||||
const form: any = computed({
|
||||
get() {
|
||||
return props.childForm
|
||||
},
|
||||
set(value) {}
|
||||
})
|
||||
const num = ref(0)
|
||||
|
||||
// 添加间谐波
|
||||
const inHarmFlagAdd = () => {
|
||||
props.childForm[0].inHarmList.push({ inharm: '0', fAmp: '0', fPhase: '0' })
|
||||
num.value += 1
|
||||
}
|
||||
// 删除
|
||||
const inHarmFlagDelete = (number: number) => {
|
||||
props.childForm[0].inHarmList.splice(number, 1)
|
||||
num.value -= 1
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.tabs-container {
|
||||
<style lang="scss" scoped>
|
||||
.container {
|
||||
display: flex;
|
||||
justify-content: center; /* 使两个 el-tabs 居中对齐 */
|
||||
align-items: stretch; /* 使两个 el-tabs 高度拉伸 */
|
||||
height: 100%;
|
||||
padding: 0 20px; /* 可选:添加左右间距 */
|
||||
}
|
||||
|
||||
.fixed-width-tabs {
|
||||
width: 400px; /* 设置固定的宽度 */
|
||||
margin-right: 100px; /* 可选:添加右侧间距 */
|
||||
align-items: center;
|
||||
border-bottom: 1px solid #ccc;
|
||||
width: 100%;
|
||||
margin-top: 10px;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.fixed-width-tabs:last-child {
|
||||
@@ -63,4 +86,7 @@
|
||||
.el-form-item {
|
||||
margin-bottom: 20px; /* 可选:添加表单项之间的间距 */
|
||||
}
|
||||
:deep(.el-form-item) {
|
||||
margin-bottom: 10px !important;
|
||||
}
|
||||
</style>
|
||||
@@ -31,7 +31,13 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="检测脚本值类型" prop="valueType">
|
||||
<el-select v-model="formContent.valueType" filterable clearable placeholder="请选择值类型">
|
||||
<el-select
|
||||
v-model="formContent.valueType"
|
||||
:disabled="titleType == '编辑检测脚本'"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择值类型"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dictStore.getDictData('Script_Value_Type')"
|
||||
:key="item.id"
|
||||
@@ -49,7 +55,7 @@
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card v-if="show">
|
||||
<TestScriptDetail :options="secondLevelOptions" :scriptId="scriptId" />
|
||||
<TestScriptDetail :options="secondLevelOptions" :formContent="formContent" />
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -67,7 +73,7 @@ import { useRouter } from 'vue-router'
|
||||
const modeId = ref()
|
||||
const show = ref(false)
|
||||
const router = useRouter()
|
||||
const scriptId = ref('46296b72528f805376e362df594fc669')
|
||||
|
||||
const secondLevelOptions: any[] = []
|
||||
// 定义弹出组件元信息
|
||||
const dialogFormRef = ref()
|
||||
@@ -81,8 +87,7 @@ function useMetaInfo() {
|
||||
pattern: modeId.value,
|
||||
standardName: '',
|
||||
standardTime: '',
|
||||
state: 1,
|
||||
valueType: ''
|
||||
state: 1
|
||||
})
|
||||
return { titleType, formContent }
|
||||
}
|
||||
@@ -126,7 +131,7 @@ const closeInformation = () => {}
|
||||
// 保存数据
|
||||
const save = () => {
|
||||
// dialogFormRef
|
||||
dialogFormRef.value.validate(valid => {
|
||||
dialogFormRef.value.validate((valid: boolean) => {
|
||||
if (valid) {
|
||||
if (titleType.value == '新增检测脚本') {
|
||||
formContent.value.pattern = modeId.value
|
||||
@@ -134,7 +139,7 @@ const save = () => {
|
||||
if (res.code === 'A0000') {
|
||||
ElMessage.success({ message: res.message })
|
||||
// scriptId.value = res.data
|
||||
scriptId.value = '46296b72528f805376e362df594fc669'
|
||||
formContent.value.id = '46296b72528f805376e362df594fc669'
|
||||
show.value = true
|
||||
}
|
||||
})
|
||||
@@ -157,7 +162,6 @@ const open = async (title: string, row: any) => {
|
||||
} else {
|
||||
let list = JSON.parse(row)
|
||||
formContent.value = list
|
||||
scriptId.value = list.id
|
||||
show.value = true
|
||||
}
|
||||
|
||||
@@ -166,7 +170,15 @@ const open = async (title: string, row: any) => {
|
||||
}
|
||||
// 获取树字典
|
||||
const treeInfo = async (currentMode: string) => {
|
||||
const result = await getDictTreeByCode({ code: 'Script_Indicator_Items' })
|
||||
const data: Dict.ResDictTree = {
|
||||
name: '',
|
||||
id: '',
|
||||
pid: '',
|
||||
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 || []))
|
||||
modeId.value = dictStore.getDictData('Pattern').find(item => item.name === currentMode)?.id
|
||||
@@ -186,6 +198,7 @@ onMounted(() => {
|
||||
const convertToOptions = (dictTree: Dict.ResDictTree[]): CascaderOption[] => {
|
||||
return dictTree.map(item => ({
|
||||
value: item.id,
|
||||
code: item.code,
|
||||
label: item.name,
|
||||
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-item label="电压有效值(V)">
|
||||
<el-input-number v-model="form[0].fAmp" />
|
||||
<el-input type="number" v-model="form[0].fAmp" :disabled="!form[0].channelFlag"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="电流有效值(A)">
|
||||
<el-input-number v-model="form[0].fPhase" />
|
||||
<el-input type="number"v-model="form[0].fPhase" :disabled="!form[1].channelFlag"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="电压相角(°)">
|
||||
<el-input-number v-model="form[1].fAmp" />
|
||||
<el-input type="number"v-model="form[1].fAmp" :disabled="!form[0].channelFlag"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="电流相角(°)">
|
||||
<el-input-number v-model="form[1].fPhase" />
|
||||
<el-input type="number"v-model="form[1].fPhase" :disabled="!form[1].channelFlag"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
@@ -39,7 +39,7 @@ const props = defineProps({
|
||||
const lineRef: any = ref()
|
||||
const chartsData = ref({})
|
||||
// 解构并创建响应式变量
|
||||
const form = computed({
|
||||
const form:any = computed({
|
||||
get() {
|
||||
return props.childForm
|
||||
},
|
||||
|
||||
@@ -14,8 +14,8 @@ import { ref, reactive } from 'vue'
|
||||
import { getTreeData } from '@/api/check/test'
|
||||
import { CheckData } from '@/api/check/interface'
|
||||
const props = defineProps({
|
||||
scriptId: {
|
||||
type: String,
|
||||
formContent: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
@@ -27,7 +27,7 @@ const defaultProps = {
|
||||
}
|
||||
const open = () => {
|
||||
getTreeData({
|
||||
scriptId: props.scriptId
|
||||
scriptId: props.formContent.id
|
||||
}).then(res => {
|
||||
dataTree.value = res.data
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user