UPDATE: 1、优化

This commit is contained in:
贾同学
2025-10-22 15:02:49 +08:00
parent 5ec688a659
commit d5a2db5cd0
2 changed files with 27 additions and 21 deletions

View File

@@ -684,9 +684,11 @@ const exportPlan = async () => {
const params = {
id: subPlanFormContent.id
}
ElMessageBox.confirm(`确认导出${subPlanFormContent.name}子计划元信息?`, '温馨提示', { type: 'warning' }).then(() =>
useDownload(exportSubPlan, `${subPlanFormContent.name}_子计划元信息`, params, false, '.zip')
)
ElMessageBox.confirm(`确认导出${subPlanFormContent.name}子计划元信息?`, '温馨提示', {
type: 'warning',
confirmButtonText: '确定',
cancelButtonText: '取消'
}).then(() => useDownload(exportSubPlan, `${subPlanFormContent.name}_子计划元信息`, params, false, '.zip'))
}
const exportPlanCheckResultData = async (selectedListIds: string[]) => {

View File

@@ -7,7 +7,6 @@
align-center
v-bind="dialogBig"
@close="close"
>
<el-form ref="dialogFormRef" :model="formContent" :rules="rules">
<el-row :gutter="24">
@@ -366,7 +365,6 @@
/>
</el-form-item>
</el-col>
</el-row>
</el-collapse-item>
</el-collapse>
@@ -672,15 +670,24 @@ const save = () => {
if (planType.value == 1) {
formContent.fatherPlanId = formContent.id
formContent.id = ''
formContent.memberIds = formContent.memberIds ? [formContent.memberIds?.toString()] : []
formContent.memberIds =
formContent.memberIds && formContent.memberIds.length > 0
? typeof formContent.memberIds === 'string'
? [formContent.memberIds]
: formContent.memberIds.map(id => id.toString())
: []
await addPlan(formContent)
emit('update:tab')
// 编辑子计划
} else if (planType.value == 2) {
formContent.memberIds = formContent.memberIds ? [formContent.memberIds?.toString()] : []
formContent.memberIds =
formContent.memberIds && formContent.memberIds.length > 0
? typeof formContent.memberIds === 'string'
? [formContent.memberIds]
: formContent.memberIds.map(id => id.toString())
: []
await updatePlan(formContent)
emit('update:tab')
} else {
formContent.sourceIds = null
await updatePlan(formContent)
@@ -754,7 +761,7 @@ const open = async (sign: string, data: Plan.ReqPlan, currentMode: string, plan:
user_Result: any
if (mode.value === '比对式') {
[
;[
PqErrSys_Result,
pqDevList_Result,
pqReportName_Result,
@@ -794,7 +801,7 @@ const open = async (sign: string, data: Plan.ReqPlan, currentMode: string, plan:
}
}
} else {
[pqSource_Result, PqScript_Result, PqErrSys_Result, pqDevList_Result, pqReportName_Result] =
;[pqSource_Result, PqScript_Result, PqErrSys_Result, pqDevList_Result, pqReportName_Result] =
await Promise.all([
getTestSourceList(data),
getPqScriptList(data),
@@ -829,8 +836,8 @@ const open = async (sign: string, data: Plan.ReqPlan, currentMode: string, plan:
const datasourceDicts = dictStore.getDictData('Datasource')
formContent.datasourceIds = datasourceDicts
.filter(item => ['real', 'wave_data'].includes(item.code))
.map(item => item.code)
.filter(item => ['real', 'wave_data'].includes(item.code))
.map(item => item.code)
} else {
//编辑时先给表单赋值(这会没接收被检设备),需要手动再给被检设备复制后整体表单赋值
@@ -907,7 +914,7 @@ const open = async (sign: string, data: Plan.ReqPlan, currentMode: string, plan:
}
}
} else {
[
;[
pqSource_Result,
PqScript_Result,
PqErrSys_Result,
@@ -1058,8 +1065,8 @@ const handleErrorSysChange = async (value: string) => {
})
}
formContent.testItems = secondLevelOptions
.filter(option => option.label !== '闪变')
.map(option => option.value)
.filter(option => option.label !== '闪变')
.map(option => option.value)
} catch (error) {
formContent.testItems = []
console.error('获取检测项失败:', error)
@@ -1090,9 +1097,9 @@ const loadTestItemsForErrorSys = async (errorSysId: string) => {
label: (res.data as Record<string, string>)[key]
})
})
formContent.testItems = secondLevelOptions
.filter(option => option.label !== '闪变')
.map(option => option.value)
formContent.testItems = secondLevelOptions
.filter(option => option.label !== '闪变')
.map(option => option.value)
}
} catch (error) {
console.error('获取检测项失败:', error)
@@ -1235,7 +1242,6 @@ const props = defineProps<{
</script>
<style lang="scss" scoped>
// :deep(.dialog-small .el-dialog__body){
// max-height: 330px !important;
// }
@@ -1254,6 +1260,4 @@ const props = defineProps<{
justify-content: center;
align-items: center;
}
</style>