diff --git a/.vscode/settings.json b/.vscode/settings.json index 4a23960..f592307 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,6 +2,7 @@ "cSpell.words": [ "Chns", "Combox", + "Datasource", "daterange", "devicedata", "errordata", diff --git a/frontend/src/api/device/interface/device.ts b/frontend/src/api/device/interface/device.ts index 60ee9e4..dc92f4a 100644 --- a/frontend/src/api/device/interface/device.ts +++ b/frontend/src/api/device/interface/device.ts @@ -8,8 +8,10 @@ export namespace Device { */ export interface ReqPqDevParams extends ReqPage{ id: string; // 装置序号id 必填 + name: string; //设备名称 devType?: string; // 设备名称 createTime?:string; //创建时间 + pattern:string; } /** @@ -46,6 +48,10 @@ export namespace Device { reportPath?: string| null; //报告路径 qRCode?: string| null; //设备关键信息二维码 reCheckNum: number; //复检次数 + planId?:string;//检测计划Id + TimeCheckResult?:number;//守时检测结果(0:不符合1:符合) + FactorFlag?:number;//是否支持系数校准(0:不支持,1:支持) + FactorCheckResult?: number;//系数校准结果(0:不符合1:符合) state: number; //状态 createBy?: string| null; //创建用户 createTime?: string| null; //创建时间 diff --git a/frontend/src/api/device/interface/testScript.ts b/frontend/src/api/device/interface/testScript.ts index 2356bfc..1bf5434 100644 --- a/frontend/src/api/device/interface/testScript.ts +++ b/frontend/src/api/device/interface/testScript.ts @@ -11,13 +11,14 @@ export namespace TestScript { id: string; // 装置序号id 必填 name: string; type: string; + pattern:string; } // 检测脚本接口 export interface ResTestScript { id?: string; //检测脚本ID name: string; //检测脚本名称 - type: string; //检测脚本类型(字典表Code字段,脚本还是模板) + type: string; //设定0为脚本,1为模板 pattern: string;//检测脚本模式(字典表Code字段,数字、模拟、比对) valueType?: string;//脚本值类型(字典表Code字段,相对值脚本、绝对值脚本、无) standardName: string;//参照标准名称 diff --git a/frontend/src/api/plan/interface/index.ts b/frontend/src/api/plan/interface/index.ts index a8ae026..15ccc84 100644 --- a/frontend/src/api/plan/interface/index.ts +++ b/frontend/src/api/plan/interface/index.ts @@ -1,72 +1,44 @@ import type { ReqPage } from '@/api/interface' -import type { DatetimeFormatProps } from 'vue-i18n'; // 检测计划模块 export namespace Plan { // 检测计划接口 - export interface PlanBO { - id?: string; //检测计划ID + export interface ResPlan { + id: string; //检测计划ID name: string; //检测计划名称 pattern: string; //模式,字典表(数字、模拟、比对) - father_Plan_Id?: string; //父计划ID - dataSource_Id: string[]; //数据源ID - script_Id: string; //检测脚本ID - error_Sys_Id: string;//误差体系ID - test_State: string; //检测状态 - report_State: string; //报告生成状态 - result: string;//检测结果 - create_Time?: string;//创建时间 + fatherPlanId?: string; //父计划ID + dataSourceId: string; //数据源ID + scriptId: string; //检测脚本ID + errorSysId: string;//误差体系ID + timeCheck:number;//守时检测:0否,1。是 + testState: number; //检测状态:0:未检、1:检测中、2:检测完成,默认为 0 + reportState: number; //报告生成状态:0:未生成、1:部分生成、2:全部生成,默认为 0 + result: number;//检测结果:0:不符合、1:符合、2:/,默认为 2 + code:number; //自动生成,用于生成数据表后缀 + state: number;//;状态:0-删除 1-正常 + createBy?:string; //创建用户 + createTime?:string; //创建时间 + updateBy?:string; //更新用户 + updateTime?:string; //更新时间 } // 检测计划 + 分页 - export interface ReqPlanParams extends ReqPage,PlanBO { - + export interface ReqPlanParams extends ReqPage,ResPlan { + } - // 检测计划 + 检测源 - export interface PlanAndSourceBO extends PlanBO { - testSourceName: string;//计划所属检测源 - source_Id: string[]; - device_Id?: string[]; - testSourceList?: string[];//临时测试 - dataSource_Ids:string; + + export interface ReqPlan extends ResPlan { + datasourceIds:string; + sourceIds: string[]; + planId:string; + scriptName: string ; + errorSysName: string; + sourceName: string ; + devIds:string[]; } - // // 检测计划列表 - // export interface PlanList { - // id: string; //检测计划ID - // name: string; //检测计划名称 - // pattern: string; //模式,字典表(数字、模拟、比对) - // father_Plan_Id: string; //父计划ID - // dataSource_Id: string; //数据源ID - // script_Id: string; //检测脚本ID - // error_Sys_Id: string;//误差体系ID - // test_State: string; //检测状态 - // report_State: string; //报告生成状态 - // result: string;//检测结果 - // state: number; //状态 - // create_By?: string; //创建用户 - // create_Time?: string;//创建时间 - // update_By?: string; //更新用户 - // update_Time?: string; //更新时间 - // } + - // // 被检设备参数 - // export interface ReqPlanParams extends ReqPage { - // id: string; //检测计划ID - // name: string; //检测计划名称 - // pattern: string; //模式,字典表(数字、模拟、比对) - // father_Plan_Id: string; //父计划ID - // dataSource_Id: string; //数据源ID - // script_Id: string; //检测脚本ID - // error_Sys_Id: string;//误差体系ID - // test_State: string; //检测状态 - // report_State: string; //报告生成状态 - // result: string;//检测结果 - // state: number; //状态 - // create_By?: string; //创建用户 - // create_Time?: string;//创建时间 - // update_By?: string; //更新用户 - // update_Time?: string; //更新时间 - // } } \ No newline at end of file diff --git a/frontend/src/api/plan/plan.ts b/frontend/src/api/plan/plan.ts index b02ccb4..753b706 100644 --- a/frontend/src/api/plan/plan.ts +++ b/frontend/src/api/plan/plan.ts @@ -1,27 +1,60 @@ -import { ResPage } from '@/api/interface' -import { Plan } from './interface' -import { ADMIN as rePrefix } from '@/api/config/serviceName' +import type { ResPage } from '@/api/interface' +import type { Plan } from './interface' import http from '@/api' +import type { TestSource } from '../device/interface/testSource' +import type { TestScript } from '../device/interface/testScript' +import type { ErrorSystem } from '../device/interface/error' +import type { Device } from '../device/interface/device' /** * @name 检测计划管理模块 */ // 获取检测计划列表 export const getPlanList = (params: Plan.ReqPlanParams) => { - return http.post>(`/plan/list`, params) + return http.post(`/adPlan/list`, params) } // 新增检测计划 -export const addPlan = (params: Plan.PlanBO) => { - return http.post(`/role/add`, params) +export const addPlan = (params: Plan.ResPlan) => { + return http.post(`/adPlan/add`, params) } // 编辑检测计划 -export const editPlan = (params: Plan.PlanBO) => { - return http.post(`/role/edit`, params) +export const updatePlan = (params: Plan.ResPlan) => { + return http.post(`/adPlan/update`, params) } // 删除检测计划 export const deletePlan = (params: { id: string[] }) => { - return http.post(`/role/del`, params) + return http.post(`/adPlan/delete`, params) } + +// 获取指定模式下所有检测源 +export const getTestSourceList = (params: Plan.ReqPlan) => { + return http.get(`/pqSource/getAll?patternId=${params.pattern}`) +} + +// 获取指定模式下所有检测脚本 +export const getPqScriptList = (params: Plan.ReqPlan) => { + return http.get(`/pqScript/getAll?patternId=${params.pattern}`) +} + +//获取所有误差体系 +export const getPqErrSysList = () => { + return http.get(`/pqErrSys/getAll`) +} + +//获取指定模式下所有未绑定的设备 +export const getUnboundPqDevList = (params: Plan.ReqPlan) => { + return http.get(`/pqDev/listUnbound?pattern=${params.pattern}`) +} + +//根据检测计划id查询出所有已绑定的设备 +export const getBoundPqDevList = (params: any) => { + return http.post(`/pqDev/listBoundByPlanId`,params) +} + +//检测计划绑定设备 +export const BindPqDevList = (params: any) => { + return http.post(`/adPlan/bindDev`,params) +} \ No newline at end of file diff --git a/frontend/src/views/home/components/table.vue b/frontend/src/views/home/components/table.vue index faff8d1..4a5f832 100644 --- a/frontend/src/views/home/components/table.vue +++ b/frontend/src/views/home/components/table.vue @@ -806,7 +806,7 @@ function tableHeaderInit(val: number) { tableKey.value += 1; break; } -console.log("test",columns); +//console.log("test",columns); } diff --git a/frontend/src/views/home/tabs/dashboard.vue b/frontend/src/views/home/tabs/dashboard.vue index becaf49..7f48e8a 100644 --- a/frontend/src/views/home/tabs/dashboard.vue +++ b/frontend/src/views/home/tabs/dashboard.vue @@ -351,7 +351,7 @@ const handleCheckFunction = (val: any) => { const resizeObserver = new ResizeObserver(entries => { for (let entry of entries) { chartsWidth.value = entry.contentRect.width; - console.log('Charts Info Width:', chartsWidth.value); + //console.log('Charts Info Width:', chartsWidth.value); pieRef1.value.reSize(chartsWidth.value * 0.95,180,true); pieRef2.value.reSize(chartsWidth.value * 0.95,180,true); diff --git a/frontend/src/views/machine/device/index.vue b/frontend/src/views/machine/device/index.vue index c6d9775..c7a1379 100644 --- a/frontend/src/views/machine/device/index.vue +++ b/frontend/src/views/machine/device/index.vue @@ -142,14 +142,16 @@ const openDialog = (titleType: string, row: Partial = {}) => { // 批量删除设备 const batchDelete = async (id: string[]) => { - await useHandleData(deletePqDev, id, '删除所选设备') + const patternId = dictStore.getDictData('Pattern').find(item=>item.name=== modeStore.currentMode)?.id ?? ''//获取数据字典中对应的id + await useHandleData(deletePqDev, {'ids':id,'pattern': patternId} , '删除所选设备') proTable.value?.clearSelection() proTable.value?.getTableList() } // 删除设备 const handleDelete = async (params: Device.ResPqDev) => { - await useHandleData(deletePqDev, [params.id], `删除【${params.name}】设备`) + const patternId = dictStore.getDictData('Pattern').find(item=>item.name=== modeStore.currentMode)?.id//获取数据字典中对应的id + await useHandleData(deletePqDev, {'ids': [params.id] ,'pattern': patternId}, `删除【${params.name}】设备`) proTable.value?.getTableList() } diff --git a/frontend/src/views/plan/planList/components/devSelectPopup.vue b/frontend/src/views/plan/planList/components/devSelectPopup.vue index d1ab99e..9bfc2f1 100644 --- a/frontend/src/views/plan/planList/components/devSelectPopup.vue +++ b/frontend/src/views/plan/planList/components/devSelectPopup.vue @@ -25,7 +25,7 @@ \ No newline at end of file diff --git a/frontend/src/views/plan/planList/components/moreButtons.vue b/frontend/src/views/plan/planList/components/moreButtons.vue index 851c6ab..7d89494 100644 --- a/frontend/src/views/plan/planList/components/moreButtons.vue +++ b/frontend/src/views/plan/planList/components/moreButtons.vue @@ -1,57 +1,32 @@