diff --git a/frontend/src/api/device/device/index.ts b/frontend/src/api/device/device/index.ts index 6a60b52..a25c194 100644 --- a/frontend/src/api/device/device/index.ts +++ b/frontend/src/api/device/device/index.ts @@ -68,3 +68,7 @@ export const getPqDevById = (params: Device.ReqPqDevParams) => { export const getPqDev = () => { return http.get(`/devType/listAll`) } + +export const getSelectOptions = (params:{ pattern: string }) => { + return http.get(`/pqDev/getSelectOptions`, params) +} diff --git a/frontend/src/api/device/interface/device.ts b/frontend/src/api/device/interface/device.ts index 99ce2fa..d5080a7 100644 --- a/frontend/src/api/device/interface/device.ts +++ b/frontend/src/api/device/interface/device.ts @@ -88,9 +88,18 @@ export namespace Device { coefficientTime?: number;//系数校准耗时 formalCheckTime?: number;//正式检测耗时 + boundPlanName?: string; + assign?: number;////是否分配给检测人员 0否 1是 monitorList: Monitor.ResPqMon[] ; } + export interface SelectOption { + label: string; + value: string | number; + } + + + export interface ResDev { id: string; diff --git a/frontend/src/api/device/standardDevice/index.ts b/frontend/src/api/device/standardDevice/index.ts index 230705a..993788f 100644 --- a/frontend/src/api/device/standardDevice/index.ts +++ b/frontend/src/api/device/standardDevice/index.ts @@ -44,3 +44,8 @@ export const downloadTemplate = () => { export const importPqStandardDev = (params: StandardDevice.ReqPqStandardDeviceParams) => { return http.uploadExcel(`/pqStandardDev/import`, params) } + +//获取所有标准设备 +export const getAllPqStandardDev = () => { + return http.get(`/pqStandardDev/getAll`) +} diff --git a/frontend/src/api/interface/index.ts b/frontend/src/api/interface/index.ts index 74389e2..c5e4867 100644 --- a/frontend/src/api/interface/index.ts +++ b/frontend/src/api/interface/index.ts @@ -15,6 +15,7 @@ export interface Result { * 请求响应参数(包含data) */ export interface ResultData extends Result { + map(arg0: (item: any) => { label: any; value: any; }): { label: string; value: string; }[] | { label: string; value: string; }[]; data: T; } diff --git a/frontend/src/api/plan/interface/index.ts b/frontend/src/api/plan/interface/index.ts index d03c4ef..c6f1035 100644 --- a/frontend/src/api/plan/interface/index.ts +++ b/frontend/src/api/plan/interface/index.ts @@ -28,6 +28,10 @@ export namespace Plan { reportTemplateVersion:string; dataRule:string;//数据处理原则 + standardDevIdList:string[]; + standardDevMap:Map;//标准设备 + testItems:string[];//测试项 + Check_By?:string;//计划检测人 progress?: number; // 进度百分比,例如 75 children?: ResPlan[]; } @@ -40,11 +44,13 @@ export namespace Plan { export interface ReqPlan extends ResPlan { datasourceIds:string; - sourceIds: string; + sourceIds: string | null; planId:string; scriptName: string ; errorSysName: string; sourceName: string ; + standardDevNameStr: string; + testItemNameStr:string; devIds: string[]; } diff --git a/frontend/src/api/plan/plan.ts b/frontend/src/api/plan/plan.ts index 727af12..df53569 100644 --- a/frontend/src/api/plan/plan.ts +++ b/frontend/src/api/plan/plan.ts @@ -2,7 +2,7 @@ import type { Plan } from './interface' import http from '@/api' import type { ErrorSystem } from '../device/interface/error' import type { Device } from '../device/interface/device' -import { ReqDevReportParams } from '@/api/device/interface/device' +import { pa } from 'element-plus/es/locale/index.mjs' /** * @name 检测计划管理模块 @@ -23,8 +23,8 @@ export const updatePlan = (params: any) => { } // 删除检测计划 -export const deletePlan = (params: { id: string[] }) => { - return http.post(`/adPlan/delete`, params) +export const deletePlan = (params: { id: string[] ,pattern: string}) => { + return http.post(`/adPlan/delete?pattern=${params.pattern}`, params.id) } // 获取指定模式下所有检测源 @@ -49,7 +49,7 @@ export const getUnboundPqDevList = (params: Plan.ReqPlan) => { //根据检测计划id查询出所有已绑定的设备 export const getBoundPqDevList = (params: any) => { - return http.post(`/pqDev/listByPlanId`, params) + return http.post(`/adPlan/listByPlanId`, params) } //检测计划绑定设备 @@ -90,3 +90,27 @@ export const staticsAnalyse = (params: { id: string[] }) => { return http.download('/adPlan/analyse', params) } +//根据计划id分页查询被检设 +export const getDevListByPlanId = (params:any) => { + return http.post(`/adPlan/listDevByPlanId`, params) +} + +//修改子计划名称 +export const updateSubPlanName = (params:Plan.ReqPlan) => { + return http.get(`/adPlan/updateSubPlanName?planId=${params.id}&name=${params.name}`) +} + +//子计划绑定/解绑被检设备 +export const subPlanBindDev = (params:Plan.ReqPlan) => { + return http.post(`/adPlan/updateBindDev`, params) +} + +//根据父计划ID获取未被子计划绑定的标准设备 +export const getUnboundStandardDevList = (params:Plan.ResPlan) => { + return http.get(`/adPlan/getUnBoundStandardDev?fatherPlanId=${params.fatherPlanId}`) +} + +//根据计划ID获取已绑定的标准设备 +export const getBoundStandardDevList = (params:Plan.ResPlan) => { + return http.get(`/adPlan/getBoundStandardDev?planId=${params.id}`) +} \ No newline at end of file diff --git a/frontend/src/api/user/login/index.ts b/frontend/src/api/user/login/index.ts index a316ef0..1ab485c 100644 --- a/frontend/src/api/user/login/index.ts +++ b/frontend/src/api/user/login/index.ts @@ -1,3 +1,4 @@ +import { pa } from 'element-plus/es/locale/index.mjs'; import type {Login} from '@/api/user/interface/user' import {ADMIN as rePrefix} from '@/api/system/config/serviceName' import http from '@/api' diff --git a/frontend/src/api/user/user/index.ts b/frontend/src/api/user/user/index.ts index 6baa9d6..cb7dc06 100644 --- a/frontend/src/api/user/user/index.ts +++ b/frontend/src/api/user/user/index.ts @@ -37,3 +37,7 @@ export const updatePassWord = (params: User.ResPassWordUser) => { return http.post(`/sysUser/updatePassword`,params) } +// 获取所有用户 +export const getAllUser= () => { + return http.get(`/sysUser/getAll`) +} diff --git a/frontend/src/components/ImportExcel/index.vue b/frontend/src/components/ImportExcel/index.vue index e987133..41bc4dd 100644 --- a/frontend/src/components/ImportExcel/index.vue +++ b/frontend/src/components/ImportExcel/index.vue @@ -48,6 +48,7 @@ export interface ExcelParameterProps { title: string; // 标题 showCover?: boolean; // 是否显示”数据覆盖“选项 patternId?: string; // 模式ID + planId?: string | null ;//计划ID fileSize?: number; // 上传文件的大小 fileType?: File.ExcelMimeType[]; // 上传文件的类型 tempApi?: (params: any) => Promise; // 下载模板的Api @@ -87,6 +88,9 @@ const uploadExcel = async (param: UploadRequestOptions) => { if (parameter.value.patternId) { excelFormData.append('patternId', parameter.value.patternId) } + + excelFormData.append('planId', parameter.value.planId) + isCover.value && excelFormData.append('isCover', isCover.value as unknown as Blob) //await parameter.value.importApi!(excelFormData); await parameter.value.importApi!(excelFormData) diff --git a/frontend/src/components/ProTable/index.vue b/frontend/src/components/ProTable/index.vue index efd38e8..9976dac 100644 --- a/frontend/src/components/ProTable/index.vue +++ b/frontend/src/components/ProTable/index.vue @@ -119,6 +119,7 @@ import TableColumn from './components/TableColumn.vue' import Sortable from 'sortablejs' export interface ProTableProps { + columns: ColumnProps[]; // 列配置项 ==> 必传 data?: any[]; // 静态 table data 数据,若存在则不会使用 requestApi 返回的 data ==> 非必传 requestApi?: (params: any) => Promise; // 请求表格数据的 api ==> 非必传 diff --git a/frontend/src/hooks/useTable.ts b/frontend/src/hooks/useTable.ts index 9e6a497..0c05d95 100644 --- a/frontend/src/hooks/useTable.ts +++ b/frontend/src/hooks/useTable.ts @@ -78,6 +78,7 @@ export const useTable = ( }); dataCallBack && (data = dataCallBack(data)); state.tableData = isPageable ? data.records : data; + //console.log(data); // 解构后台返回的分页数据 (如果有分页更新分页信息) if (isPageable) { state.resPageable.total = data.total; @@ -85,6 +86,7 @@ export const useTable = ( state.resPageable.size = data.size; } } catch (error) { + //console.log('123'); requestError && requestError(error); } }; diff --git a/frontend/src/layouts/components/Menu/SubMenu.vue b/frontend/src/layouts/components/Menu/SubMenu.vue index 26cb765..b687de8 100644 --- a/frontend/src/layouts/components/Menu/SubMenu.vue +++ b/frontend/src/layouts/components/Menu/SubMenu.vue @@ -20,13 +20,17 @@ diff --git a/frontend/src/views/machine/device/components/monitorTab.vue b/frontend/src/views/machine/device/components/monitorTab.vue index 08e4663..4ff1b49 100644 --- a/frontend/src/views/machine/device/components/monitorTab.vue +++ b/frontend/src/views/machine/device/components/monitorTab.vue @@ -34,7 +34,6 @@ import { ref, defineProps, reactive, watch } from 'vue'; import ProTable from '@/components/ProTable/index.vue'; // 假设 ProTable 是自定义组件 import { CirclePlus, Delete, EditPen, MessageBox } from '@element-plus/icons-vue'; - import MonitorPopup from '@/views/machine/device/components/monitorPopup.vue' import { ProTableInstance, type ColumnProps } from '@/components/ProTable/interface' import { type Monitor } from '@/api/device/interface/monitor' @@ -46,7 +45,8 @@ // 定义 props const props = defineProps<{ DevFormContent:Device.ResPqDev, - tableHeight?: number // 接收外部传入的高度 + tableHeight?: number, // 接收外部传入的高度 + selectOptions: Record, }>(); // ProTable 实例 @@ -139,7 +139,7 @@ const getParameter = (data: Monitor.ResPqMon) => { return } title_Type.value = titleType - monitorPopup.value?.open(titleType, row,props.DevFormContent,tableData.value) + monitorPopup.value?.open(titleType, row,props.DevFormContent,tableData.value,props.selectOptions) } diff --git a/frontend/src/views/machine/device/index.vue b/frontend/src/views/machine/device/index.vue index 95318f0..860a400 100644 --- a/frontend/src/views/machine/device/index.vue +++ b/frontend/src/views/machine/device/index.vue @@ -93,11 +93,7 @@ const columns = reactive[]>([ prop: 'devType', label: '设备类型', minWidth: 200, - render: (scope) => { - // 查找设备类型名称 - const name = devTypeOptions.value.find(option => option.id === scope.row.devType) - return {name?.name} - }, + }, { prop: 'createDate', @@ -248,6 +244,7 @@ const importFile = async (pattern: string) => { title: '被检设备', showCover: false, patternId: dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id, + planId: null, tempApi: downloadTemplate, importApi: importPqDev, // importApi: modeStore.currentMode === "比对式"? importContrastPqDev: importCNDev, diff --git a/frontend/src/views/machine/standardDevice/components/standardDevicePopup.vue b/frontend/src/views/machine/standardDevice/components/standardDevicePopup.vue index fcf55ab..e8653bd 100644 --- a/frontend/src/views/machine/standardDevice/components/standardDevicePopup.vue +++ b/frontend/src/views/machine/standardDevice/components/standardDevicePopup.vue @@ -32,16 +32,7 @@ 参数信息 - - - - - + + + + + + @@ -258,7 +259,7 @@ const open = async (sign: string, data: StandardDevice.ResPqStandardDevice,devTy if (typeof formContent.inspectChannel === 'string') { formContent.inspectChannel = formContent.inspectChannel.split(',').filter(Boolean) } - handleDevTypeChange(data.devType) + //handleDevTypeChange(data.devType) } else { resetFormContent() } @@ -279,6 +280,10 @@ const handleDevTypeChange = (value: string) => { label: String(i + 1), })) + //if(titleType.value == 'add') // 默认全选所有通道 + formContent.inspectChannel = pqChannelArray.value.map(channel => channel.value) + + // 过滤掉超出新通道数范围的选项 if (Array.isArray(formContent.inspectChannel)) { formContent.inspectChannel = formContent.inspectChannel.filter( diff --git a/frontend/src/views/machine/standardDevice/index.vue b/frontend/src/views/machine/standardDevice/index.vue index b8241ff..19d7643 100644 --- a/frontend/src/views/machine/standardDevice/index.vue +++ b/frontend/src/views/machine/standardDevice/index.vue @@ -206,7 +206,6 @@ const importFile = async () => { importApi: importPqStandardDev, getTableList: proTable.value?.getTableList, } - console.log(params) deviceImportExcel.value?.acceptParams(params) } diff --git a/frontend/src/views/plan/planList/components/chidrenPlan.vue b/frontend/src/views/plan/planList/components/chidrenPlan.vue deleted file mode 100644 index d0ce52a..0000000 --- a/frontend/src/views/plan/planList/components/chidrenPlan.vue +++ /dev/null @@ -1,330 +0,0 @@ - - - \ No newline at end of file diff --git a/frontend/src/views/plan/planList/components/childrenPlan.vue b/frontend/src/views/plan/planList/components/childrenPlan.vue new file mode 100644 index 0000000..90289d5 --- /dev/null +++ b/frontend/src/views/plan/planList/components/childrenPlan.vue @@ -0,0 +1,436 @@ + + + \ No newline at end of file diff --git a/frontend/src/views/plan/planList/components/devTransfer.vue b/frontend/src/views/plan/planList/components/devTransfer.vue index b65421a..b5c5e78 100644 --- a/frontend/src/views/plan/planList/components/devTransfer.vue +++ b/frontend/src/views/plan/planList/components/devTransfer.vue @@ -29,28 +29,25 @@ \ No newline at end of file diff --git a/frontend/src/views/plan/planList/components/planPopup.vue b/frontend/src/views/plan/planList/components/planPopup.vue index 0c6aab8..485a2bb 100644 --- a/frontend/src/views/plan/planList/components/planPopup.vue +++ b/frontend/src/views/plan/planList/components/planPopup.vue @@ -1,14 +1,34 @@