From d0c3e1d9bd7335b4fec750a5f3ce94f0cdcaf826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=BE=E5=90=8C=E5=AD=A6?= Date: Tue, 16 Sep 2025 14:37:17 +0800 Subject: [PATCH] =?UTF-8?q?UPDATE:=20=E4=BF=AE=E6=94=B9=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=BA=90=E9=80=89=E6=8B=A9=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/home/components/table.vue | 5 +- .../plan/planList/components/planPopup.vue | 62 +++++++++---------- 2 files changed, 31 insertions(+), 36 deletions(-) diff --git a/frontend/src/views/home/components/table.vue b/frontend/src/views/home/components/table.vue index 0b1308c..7573bb5 100644 --- a/frontend/src/views/home/components/table.vue +++ b/frontend/src/views/home/components/table.vue @@ -141,7 +141,7 @@ link icon="Postcard" @click="openDrawer('报告生成', scope.row)" - v-if="form.activeTabs === 3" + v-if="form.activeTabs === 3 && modeStore.currentMode == '比对式'" > 报告生成 @@ -204,7 +204,8 @@ import { onBeforeMount, onMounted, type PropType, reactive, ref, watch } from 'v import { type Action, ElMessage, ElMessageBox } from 'element-plus' import TestPopup from './testPopup.vue' import dataCheckPopup from './dataCheckSingleChannelSingleTestPopup.vue' -import CompareDataCheckSingleChannelSingleTestPopup from '@/views/home/components/compareDataCheckSingleChannelSingleTestPopup.vue' +import CompareDataCheckSingleChannelSingleTestPopup + from '@/views/home/components/compareDataCheckSingleChannelSingleTestPopup.vue' import ProTable from '@/components/ProTable/index.vue' import SelectTestItemPopup from '@/views/home/components/selectTestItemPopup.vue' import WriteTHPopup from '@/views/home/components/writeTHPopup.vue' diff --git a/frontend/src/views/plan/planList/components/planPopup.vue b/frontend/src/views/plan/planList/components/planPopup.vue index 3cc64cc..74f7b4e 100644 --- a/frontend/src/views/plan/planList/components/planPopup.vue +++ b/frontend/src/views/plan/planList/components/planPopup.vue @@ -87,9 +87,9 @@ collapse-tags-tooltip :multiple="selectByMode" autocomplete="off" - :clearable="planType != 0" + clearable collapse-tags - :filterable="planType != 0" + filterable placeholder="请选择数据源" @change="handleDataSourceChange" > @@ -98,7 +98,7 @@ :key="item.id" :label="item.name" :value="item.code || ''" - :disabled="(selectByMode && planType == 0) || allDisabled" + :disabled="allDisabled" > @@ -817,13 +817,7 @@ const open = async (sign: string, data: Plan.ReqPlan, currentMode: string, plan: formContent.errorSysId = pqErrSysList.value[0]?.id ?? '' formContent.sourceIds = pqSourceList.value[0]?.id ?? '' const datasourceDicts = dictStore.getDictData('Datasource') - if (plan == 0 && mode.value === '比对式') { - formContent.datasourceIds = datasourceDicts.map(item => item.code) - } else { - formContent.datasourceIds = dictStore.getDictData('Datasource')[0]?.code ?? '' - } - - formContent.dataRule = dictStore.getDictData('Data_Rule')[0]?.id ?? '' + formContent.datasourceIds = datasourceDicts[0]?.code ?? '' } else { //编辑时先给表单赋值(这会没接收被检设备),需要手动再给被检设备复制后整体表单赋值 @@ -990,7 +984,9 @@ const open = async (sign: string, data: Plan.ReqPlan, currentMode: string, plan: if (plan == 1) { //新增子计划名称清空 formContent.name = '' - formContent.datasourceIds = [] + // 新建子计划允许选择数据源 + const datasourceDicts = dictStore.getDictData('Datasource') + formContent.datasourceIds = datasourceDicts[0]?.code ?? '' formContent.memberIds = [] } generateData() @@ -1126,38 +1122,36 @@ const dataSourceType = computed(() => { const handleDataSourceChange = () => { if (mode.value != '比对式') return - if (planType.value == 1 || planType.value == 2) { - // 获取当前选中的 datasourceIds,并确保为数组 - const values = Array.isArray(formContent.datasourceIds) - ? formContent.datasourceIds - : [formContent.datasourceIds].filter(Boolean) // 转为数组并过滤空值 + // 获取当前选中的 datasourceIds,并确保为数组 + const values = Array.isArray(formContent.datasourceIds) + ? formContent.datasourceIds + : [formContent.datasourceIds].filter(Boolean) // 转为数组并过滤空值 - const selectedLabels = values.map(value => { - const matched = dictStore.getDictData(dataSourceType.value).find(item => item.code === value) - return matched ? matched.name : '' - }) + const selectedLabels = values.map(value => { + const matched = dictStore.getDictData(dataSourceType.value).find(item => item.code === value) + return matched ? matched.name : '' + }) - // 判断是否同时包含 '3s' 和 '分钟' - const hasThreeSeconds = selectedLabels.some(label => label.includes('3s')) - const hasMinuteStats = selectedLabels.some(label => label.includes('分钟')) + // 判断是否同时包含 '3s' 和 '分钟' + const hasThreeSeconds = selectedLabels.some(label => label.includes('3s')) + const hasMinuteStats = selectedLabels.some(label => label.includes('分钟')) - if (hasThreeSeconds && hasMinuteStats) { - ElMessage.warning('3s实时数据与分钟统计数据不能同时选择') - formContent.datasourceIds = '' - } - // 判断是否选择了多个“分钟统计数据”项 - const minuteStatLabels = selectedLabels.filter(label => label.includes('分钟')) - if (minuteStatLabels.length > 1) { - ElMessage.warning('分钟统计数据不能多选') - formContent.datasourceIds = '' - } + if (hasThreeSeconds && hasMinuteStats) { + ElMessage.warning('3s实时数据与分钟统计数据不能同时选择') + formContent.datasourceIds = '' + } + // 判断是否选择了多个“分钟统计数据”项 + const minuteStatLabels = selectedLabels.filter(label => label.includes('分钟')) + if (minuteStatLabels.length > 1) { + ElMessage.warning('分钟统计数据不能多选') + formContent.datasourceIds = '' } } //导入设备 const deviceImportExcel = ref | null>(null) -const importFile = async (pattern: string) => { +const importFile = async () => { const params = { title: '被检设备', showCover: false,