福禄克专用脚本添加、监测计划表单控制

This commit is contained in:
caozehui
2025-11-17 10:33:26 +08:00
parent d99064c82e
commit 6e8851f415
3 changed files with 43 additions and 7 deletions

View File

@@ -79,6 +79,7 @@
collapse-tags
filterable
placeholder="请选择检测源"
@change="handleSourceChange"
>
<el-option
v-for="(option, index) in pqSourceArray"
@@ -125,6 +126,7 @@
:key="index"
:label="option.label"
:value="option.value"
:disabled="option.fluke!=1&&pqSourceArray?.find(item=>formContent.sourceIds==item.value)?.label.includes('FLUKE')"
/>
</el-select>
</el-form-item>
@@ -472,7 +474,7 @@ const pqStandardDevList = ref<StandardDevice.ResPqStandardDevice[]>([]) //获取
const pqReportName = ref<{ name: string }[]>([])
const pqSourceArray = ref<{ label: string; value: string }[]>()
const pqScriptArray = ref<{ label: string; value: string }[]>()
const pqScriptArray = ref<{ label: string; value: string,fluke?:number|boolean}[]>()
const pqErrorArray = ref<{ label: string; value: string }[]>()
const pqStandardDevArray = ref<{ label: string; value: string }[]>()
const secondLevelOptions: any[] = []
@@ -529,6 +531,8 @@ const generateData = () => {
})
}
function useMetaInfo() {
const dialogVisible = ref(false)
const titleType = ref('add')
@@ -598,6 +602,18 @@ watch(
}
)
const handleSourceChange = () => {
let pqSource = pqSourceArray.value?.find(item => item.value === formContent.sourceIds)
if (pqSource?.label.includes('FLUKE')) {
let pqScript = pqScriptArray.value?.find(item => item.value === formContent.scriptId)
if (pqScript?.fluke!=1) {
formContent.scriptId = ''
ElMessage.warning('专用检测脚本只能使用福禄克检测源!')
}
}
}
// 清空formContent
const resetFormContent = () => {
Object.assign(formContent, {
@@ -1199,7 +1215,8 @@ function pqToArray() {
const sourceArray2 = Array.isArray(pqScriptList.value) ? pqScriptList.value : []
pqScriptArray.value = sourceArray2.map(item => ({
label: item.name || '',
value: item.id || ''
value: item.id || '',
fluke:item.fluke
}))
const sourceArray3 = Array.isArray(pqErrSysList.value) ? pqErrSysList.value : []