Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client
This commit is contained in:
@@ -35,6 +35,7 @@ export namespace Plan {
|
||||
progress?: number; // 进度百分比,例如 75
|
||||
children?: ResPlan[];
|
||||
testConfig?: PlanTestConfig;
|
||||
importFlag?: number; // 导入标识,0-否,1-是
|
||||
}
|
||||
|
||||
// 检测计划 + 分页
|
||||
|
||||
@@ -136,8 +136,8 @@ export const importSubPlan = (params: Plan.ResPlan) => {
|
||||
|
||||
|
||||
// 导出计划检测结果数据
|
||||
export const exportPlanCheckData = (params: Plan.ResPlan) => {
|
||||
return http.download(`/adPlan/exportPlanCheckData?planId=${params.id}&report=1`)
|
||||
export const exportPlanCheckData = (params: any) => {
|
||||
return http.download(`/adPlan/exportPlanCheckData?planId=${params.id}&devIds=${params.devIds}&report=${params.report}`)
|
||||
}
|
||||
|
||||
// 导入子检测计划检测结果数据
|
||||
|
||||
@@ -57,9 +57,10 @@
|
||||
type="primary"
|
||||
icon="Download"
|
||||
v-auth.plan="'import_subplan'"
|
||||
@click="exportPlanCheckResultData"
|
||||
@click="exportPlanCheckResultData(scope.selectedListIds)"
|
||||
:disabled="!scope.isSelected"
|
||||
>
|
||||
导出检测结果
|
||||
数据下载
|
||||
</el-button>
|
||||
<el-button
|
||||
v-auth.plan="'add_subplan'"
|
||||
@@ -626,12 +627,16 @@ const exportPlan = async () => {
|
||||
useDownload(exportSubPlan, `${subPlanFormContent.name}_子计划元信息`, params, false, '.zip')
|
||||
)
|
||||
}
|
||||
const exportPlanCheckResultData = async () => {
|
||||
const exportPlanCheckResultData = async (selectedListIds: string[]) => {
|
||||
const params = {
|
||||
id: planFormContent.value.id
|
||||
id: planFormContent.value.id,
|
||||
report: 1,
|
||||
devIds: selectedListIds.join(',')
|
||||
}
|
||||
ElMessageBox.confirm(`确认导出${planFormContent.value.name}计划检测结果?`, '温馨提示', { type: 'warning' }).then(
|
||||
() => useDownload(exportPlanCheckData, `${planFormContent.value.name}_计划检测结果`, params, false, '.zip')
|
||||
ElMessageBox.confirm(`确认下载【${planFormContent.value.name}】勾选的被检设备等信息?`, '温馨提示', {
|
||||
type: 'warning'
|
||||
}).then(() =>
|
||||
useDownload(exportPlanCheckData, `${planFormContent.value.name}_检测计划检测数据包`, params, false, '.zip')
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<el-form-item v-if="selectByMode" :label-width="110" label="标准设备" prop="standardDevIds">
|
||||
<el-select
|
||||
v-model="formContent.standardDevIds"
|
||||
:disabled="planType == 2"
|
||||
:disabled="planType == 2 || allDisabled"
|
||||
:max-collapse-tags="2"
|
||||
clearable
|
||||
collapse-tags
|
||||
@@ -43,7 +43,7 @@
|
||||
<el-form-item v-if="selectByMode" :label-width="110" label="测试项" prop="testItems">
|
||||
<el-select
|
||||
v-model="formContent.testItems"
|
||||
:disabled="planType != 0"
|
||||
:disabled="planType != 0 || allDisabled"
|
||||
:max-collapse-tags="3"
|
||||
clearable
|
||||
collapse-tags
|
||||
@@ -63,6 +63,7 @@
|
||||
<el-select
|
||||
v-model="formContent.sourceIds"
|
||||
:multiple="selectByMode"
|
||||
:disabled="allDisabled"
|
||||
clearable
|
||||
collapse-tags
|
||||
filterable
|
||||
@@ -79,7 +80,7 @@
|
||||
<el-form-item :label-width="110" label="数据源" prop="datasourceIds">
|
||||
<el-select
|
||||
v-model="formContent.datasourceIds"
|
||||
:disabled="planType != 0"
|
||||
:disabled="planType != 0 || allDisabled"
|
||||
:max-collapse-tags="2"
|
||||
:multiple="selectByMode"
|
||||
autocomplete="off"
|
||||
@@ -100,7 +101,7 @@
|
||||
<el-form-item v-if="!selectByMode" :label-width="110" label="检测脚本" prop="scriptId">
|
||||
<el-select
|
||||
v-model="formContent.scriptId"
|
||||
:disabled="isSelectDisabled"
|
||||
:disabled="isSelectDisabled || allDisabled"
|
||||
autocomplete="off"
|
||||
clearable
|
||||
placeholder="请选择检测脚本"
|
||||
@@ -116,7 +117,7 @@
|
||||
<el-form-item :label-width="110" label="误差体系" prop="errorSysId">
|
||||
<el-select
|
||||
v-model="formContent.errorSysId"
|
||||
:disabled="isSelectDisabled"
|
||||
:disabled="isSelectDisabled || allDisabled"
|
||||
autocomplete="off"
|
||||
clearable
|
||||
filterable
|
||||
@@ -133,7 +134,7 @@
|
||||
<el-form-item :label-width="110" label="数据处理原则" prop="dataRule">
|
||||
<el-select
|
||||
v-model="formContent.dataRule"
|
||||
:disabled="isSelectDisabled"
|
||||
:disabled="isSelectDisabled || allDisabled"
|
||||
autocomplete="off"
|
||||
clearable
|
||||
placeholder="请选择数据处理原则"
|
||||
@@ -147,7 +148,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label-width="110" label="守时检测" prop="timeCheck">
|
||||
<el-radio-group v-model="formContent.timeCheck" :disabled="planType != 0">
|
||||
<el-radio-group v-model="formContent.timeCheck" :disabled="planType != 0 || allDisabled">
|
||||
<el-radio :value="1">是</el-radio>
|
||||
<el-radio :value="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
@@ -166,7 +167,7 @@
|
||||
>
|
||||
<el-select
|
||||
v-model="formContent.reportTemplateName"
|
||||
:disabled="planType != 0"
|
||||
:disabled="planType != 0 || allDisabled"
|
||||
autocomplete="off"
|
||||
placeholder="请选择报告模版"
|
||||
>
|
||||
@@ -220,7 +221,7 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template v-if="planType === 0" #left-footer>
|
||||
<template v-if="planType === 0 && !allDisabled" #left-footer>
|
||||
<el-button
|
||||
v-if="modeStore.currentMode !== '比对式'"
|
||||
v-auth.plan="'import'"
|
||||
@@ -244,7 +245,7 @@
|
||||
导入被检设备
|
||||
</el-button>
|
||||
</template>
|
||||
<template v-if="planType === 0" #right-footer>
|
||||
<template v-if="planType === 0 && !allDisabled" #right-footer>
|
||||
<el-text></el-text>
|
||||
</template>
|
||||
<template #left-empty>
|
||||
@@ -270,7 +271,7 @@
|
||||
prop="testConfig.maxTime"
|
||||
>
|
||||
<el-input-number
|
||||
:disabled="isSelectDisabled"
|
||||
:disabled="isSelectDisabled || allDisabled"
|
||||
style="width: 240px"
|
||||
v-model="formContent.testConfig.maxTime"
|
||||
:precision="0"
|
||||
@@ -288,7 +289,7 @@
|
||||
prop="testConfig.waveRecord"
|
||||
>
|
||||
<el-input-number
|
||||
:disabled="isSelectDisabled"
|
||||
:disabled="isSelectDisabled || allDisabled"
|
||||
style="width: 240px"
|
||||
v-model="formContent.testConfig.waveRecord"
|
||||
:precision="0"
|
||||
@@ -306,7 +307,7 @@
|
||||
prop="testConfig.realTime"
|
||||
>
|
||||
<el-input-number
|
||||
:disabled="isSelectDisabled"
|
||||
:disabled="isSelectDisabled || allDisabled"
|
||||
style="width: 240px"
|
||||
v-model="formContent.testConfig.realTime"
|
||||
:precision="0"
|
||||
@@ -324,7 +325,7 @@
|
||||
prop="testConfig.statistics"
|
||||
>
|
||||
<el-input-number
|
||||
:disabled="isSelectDisabled"
|
||||
:disabled="isSelectDisabled || allDisabled"
|
||||
style="width: 240px"
|
||||
v-model="formContent.testConfig.statistics"
|
||||
:precision="0"
|
||||
@@ -342,7 +343,7 @@
|
||||
prop="testConfig.flicker"
|
||||
>
|
||||
<el-input-number
|
||||
:disabled="isSelectDisabled"
|
||||
:disabled="isSelectDisabled || allDisabled"
|
||||
style="width: 240px"
|
||||
v-model="formContent.testConfig.flicker"
|
||||
:precision="0"
|
||||
@@ -369,10 +370,10 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {CascaderOption, ElMessage, type FormItemRule} from 'element-plus'
|
||||
import {computed, defineProps, reactive, ref} from 'vue'
|
||||
import {dialogBig} from '@/utils/elementBind'
|
||||
import {type Plan} from '@/api/plan/interface'
|
||||
import { CascaderOption, ElMessage, type FormItemRule } from 'element-plus'
|
||||
import { computed, defineProps, reactive, ref } from 'vue'
|
||||
import { dialogBig } from '@/utils/elementBind'
|
||||
import { type Plan } from '@/api/plan/interface'
|
||||
import {
|
||||
addPlan,
|
||||
getBoundPqDevList,
|
||||
@@ -383,23 +384,23 @@ import {
|
||||
getUnboundPqDevList,
|
||||
updatePlan
|
||||
} from '@/api/plan/plan.ts'
|
||||
import {useDictStore} from '@/stores/modules/dict'
|
||||
import {type TestSource} from '@/api/device/interface/testSource'
|
||||
import {type TestScript} from '@/api/device/interface/testScript'
|
||||
import {type ErrorSystem} from '@/api/device/interface/error'
|
||||
import {type Device} from '@/api/device/interface/device'
|
||||
import {getPqReportAllName} from '@/api/device/report/index.ts'
|
||||
import {useAppSceneStore, useModeStore} from '@/stores/modules/mode'
|
||||
import {Download} from '@element-plus/icons-vue'
|
||||
import {getAllPqStandardDev} from '@/api/device/standardDevice/index.ts'
|
||||
import {StandardDevice} from '@/api/device/interface/standardDevice'
|
||||
import {Dict} from '@/api/system/dictionary/interface'
|
||||
import {getDictTreeByCode} from '@/api/system/dictionary/dictTree'
|
||||
import {getAllUser} from '@/api/user/user'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
import { type TestSource } from '@/api/device/interface/testSource'
|
||||
import { type TestScript } from '@/api/device/interface/testScript'
|
||||
import { type ErrorSystem } from '@/api/device/interface/error'
|
||||
import { type Device } from '@/api/device/interface/device'
|
||||
import { getPqReportAllName } from '@/api/device/report/index.ts'
|
||||
import { useAppSceneStore, useModeStore } from '@/stores/modules/mode'
|
||||
import { Download } from '@element-plus/icons-vue'
|
||||
import { getAllPqStandardDev } from '@/api/device/standardDevice/index.ts'
|
||||
import { StandardDevice } from '@/api/device/interface/standardDevice'
|
||||
import { Dict } from '@/api/system/dictionary/interface'
|
||||
import { getDictTreeByCode } from '@/api/system/dictionary/dictTree'
|
||||
import { getAllUser } from '@/api/user/user'
|
||||
import ImportExcel from '@/components/ImportExcel/index.vue'
|
||||
import {downloadTemplate, importPqDev} from '@/api/device/device/index'
|
||||
import {getTestConfig} from '@/api/system/base'
|
||||
import {getRegRes} from '@/api/system/versionRegister'
|
||||
import { downloadTemplate, importPqDev } from '@/api/device/device/index'
|
||||
import { getTestConfig } from '@/api/system/base'
|
||||
import { getRegRes } from '@/api/system/versionRegister'
|
||||
|
||||
const modeStore = useModeStore()
|
||||
const AppSceneStore = useAppSceneStore()
|
||||
@@ -432,7 +433,7 @@ const isSelectDisabled = ref(false)
|
||||
const planType = ref<number>(0)
|
||||
const subPlanBindStandardDev = ref<any>([]) //哪些标准设备已经被子计划绑定
|
||||
const activeNames = ref(['1'])
|
||||
|
||||
const allDisabled = ref(false)
|
||||
const generateData = () => {
|
||||
const manufacturerDict = dictStore.getDictData('Dev_Manufacturers')
|
||||
unboundPqDevList.value.forEach(i => {
|
||||
@@ -447,8 +448,8 @@ const generateData = () => {
|
||||
|
||||
const unboundData = unboundPqDevList.value.map((i: Device.ResPqDev) => ({
|
||||
key: i.id,
|
||||
label: JSON.stringify(i)
|
||||
//tips: i.description
|
||||
label: JSON.stringify(i),
|
||||
disabled: allDisabled.value
|
||||
}))
|
||||
boundPqDevList.value.forEach(i => {
|
||||
// 确保字段不为空且字典存在再进行查找
|
||||
@@ -463,7 +464,7 @@ const generateData = () => {
|
||||
key: i.id,
|
||||
label: JSON.stringify(i),
|
||||
//tips: i.description
|
||||
disabled: i.checkState != 0 || i.assign == 1
|
||||
disabled: i.checkState != 0 || i.assign == 1 || allDisabled.value
|
||||
}))
|
||||
allData.value = [...unboundData, ...boundData]
|
||||
}
|
||||
@@ -522,7 +523,8 @@ function useMetaInfo() {
|
||||
statistics: 0,
|
||||
flicker: 0,
|
||||
maxTime: 3
|
||||
}
|
||||
},
|
||||
importFlag: 0
|
||||
})
|
||||
return { dialogVisible, titleType, formContent }
|
||||
}
|
||||
@@ -569,7 +571,8 @@ const resetFormContent = () => {
|
||||
statistics: 0,
|
||||
flicker: 0,
|
||||
maxTime: 3
|
||||
}
|
||||
},
|
||||
importFlag: 0
|
||||
})
|
||||
}
|
||||
|
||||
@@ -736,7 +739,7 @@ const open = async (sign: string, data: Plan.ReqPlan, currentMode: string, plan:
|
||||
|
||||
if (sign == 'add') {
|
||||
resetFormContent()
|
||||
|
||||
allDisabled.value = false
|
||||
let pqSource_Result,
|
||||
PqScript_Result,
|
||||
PqErrSys_Result,
|
||||
@@ -818,6 +821,9 @@ const open = async (sign: string, data: Plan.ReqPlan, currentMode: string, plan:
|
||||
} else {
|
||||
isSelectDisabled.value = true
|
||||
}
|
||||
if (data.importFlag === 1) {
|
||||
allDisabled.value = true
|
||||
}
|
||||
}
|
||||
|
||||
Object.assign(formContent, { ...data })
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
type="primary"
|
||||
v-auth.plan="'edit'"
|
||||
link
|
||||
:icon="EditPen"
|
||||
icon="EditPen"
|
||||
@click="openDialog('edit', scope.row)"
|
||||
>
|
||||
编辑
|
||||
@@ -89,12 +89,12 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
icon="View"
|
||||
icon="Cpu"
|
||||
@click="openChildrenPlan(scope.row)"
|
||||
v-if="modeStore.currentMode == '比对式' && scope.row.fatherPlanId == 0"
|
||||
v-if="modeStore.currentMode == '比对式' && scope.row.importFlag == 1"
|
||||
v-auth.plan="'import_subplan'"
|
||||
>
|
||||
查看
|
||||
被检设备
|
||||
</el-button>
|
||||
<!-- <el-button type='primary' link :icon='List' @click='showDeviceOpen(scope.row)'>设备绑定</el-button> -->
|
||||
<el-button
|
||||
@@ -146,7 +146,7 @@
|
||||
<script setup lang="tsx" name="useProTable">
|
||||
import ProTable from '@/components/ProTable/index.vue'
|
||||
import type { ColumnProps, ProTableInstance } from '@/components/ProTable/interface'
|
||||
import { CirclePlus, Delete, Download, EditPen, List, Upload } from '@element-plus/icons-vue'
|
||||
import { CirclePlus, Delete, Download, List, Upload } from '@element-plus/icons-vue'
|
||||
import {
|
||||
deletePlan,
|
||||
downloadTemplate,
|
||||
|
||||
Reference in New Issue
Block a user