From 1ec486a42d7a66468f32a7ba3c0443c4f8fe2644 Mon Sep 17 00:00:00 2001 From: GYYM <704080176@qq.com> Date: Thu, 7 Nov 2024 13:22:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A3=80=E6=B5=8B=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/plan/interface/index.ts | 71 +-- frontend/src/api/plan/plan.ts | 27 ++ frontend/src/api/plan/planData.ts | 428 +++++++++++++----- .../components/{PlanOpen.vue => devPopup.vue} | 45 +- .../planList/components/devSelectPopup.vue | 142 ++++++ .../{PlanDialog.vue => planPopup.vue} | 63 +-- .../plan/planList/components/sourcePopup.vue | 107 +++++ .../planList/components/sourceSelectPopup.vue | 126 ++++++ frontend/src/views/plan/planList/index.vue | 144 ++++-- 9 files changed, 939 insertions(+), 214 deletions(-) create mode 100644 frontend/src/api/plan/plan.ts rename frontend/src/views/plan/planList/components/{PlanOpen.vue => devPopup.vue} (62%) create mode 100644 frontend/src/views/plan/planList/components/devSelectPopup.vue rename frontend/src/views/plan/planList/components/{PlanDialog.vue => planPopup.vue} (66%) create mode 100644 frontend/src/views/plan/planList/components/sourcePopup.vue create mode 100644 frontend/src/views/plan/planList/components/sourceSelectPopup.vue diff --git a/frontend/src/api/plan/interface/index.ts b/frontend/src/api/plan/interface/index.ts index 3dee979..0eaf987 100644 --- a/frontend/src/api/plan/interface/index.ts +++ b/frontend/src/api/plan/interface/index.ts @@ -4,41 +4,60 @@ import type { DatetimeFormatProps } from 'vue-i18n'; // 检测计划模块 export namespace Plan { - // 检测计划列表 - export interface PlanList { - id: string; //检测计划ID + // 检测计划接口 + export interface PlanBO { + id?: string; //检测计划ID name: string; //检测计划名称 pattern: string; //模式,字典表(数字、模拟、比对) - father_Plan_Id: string; //父计划ID + 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,PlanBO { + + } + // // 检测计划列表 + // 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; //更新时间 - } + // // 被检设备参数 + // 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 new file mode 100644 index 0000000..b02ccb4 --- /dev/null +++ b/frontend/src/api/plan/plan.ts @@ -0,0 +1,27 @@ +import { ResPage } from '@/api/interface' +import { Plan } from './interface' +import { ADMIN as rePrefix } from '@/api/config/serviceName' +import http from '@/api' + +/** + * @name 检测计划管理模块 + */ +// 获取检测计划列表 +export const getPlanList = (params: Plan.ReqPlanParams) => { + return http.post>(`/plan/list`, params) +} + +// 新增检测计划 +export const addPlan = (params: Plan.PlanBO) => { + return http.post(`/role/add`, params) +} + +// 编辑检测计划 +export const editPlan = (params: Plan.PlanBO) => { + return http.post(`/role/edit`, params) +} + +// 删除检测计划 +export const deletePlan = (params: { id: string[] }) => { + return http.post(`/role/del`, params) +} diff --git a/frontend/src/api/plan/planData.ts b/frontend/src/api/plan/planData.ts index 57be319..e0c8a81 100644 --- a/frontend/src/api/plan/planData.ts +++ b/frontend/src/api/plan/planData.ts @@ -1,125 +1,313 @@ import type {Plan} from "./interface" -const plandata = ref([ +/** + * Dict 字典属性 + * id: 唯一标识 + * label: 名称 + */ +interface Dict { + id: string; + label: string; +} + +const dictPattern: Dict[] = [ + { + id: "0", + label: '数字', + }, + { + id: "1", + label: '模拟', + }, + { + id: "2", + label: '比对', + }, +] + +const dictTestState: Dict[] = [ + { + id: "0", + label: '未检', + }, + { + id: "1", + label: '检测中', + }, + { + id: "2", + label: '检测完成', + }, +] + +const dictReportState: Dict[] = [ + { + id: "0", + label: '未生成', + }, + { + id: "1", + label: '部分生成', + }, + { + id: "2", + label: '全部生成', + }, +] + +const dictResult: Dict[] = [ + { + id: "0", + label: '符合', + }, + { + id: "1", + label: '不符合', + }, +] + +//全部检测计划名称与ID +const testPlanDataList: Dict[] = [ + { + id: "1", + label: '模拟检测计划1', + }, + { + id: "2", + label: '模拟检测计划2', + }, + { + id: "3", + label: '模拟检测计划3', + }, +] + +//全部数据源名称与ID +const testSoureDataList: Dict[] = [ + { + id: "1", + label: '实时数据', + }, + { + id: "2", + label: '分钟统计数据最大值', + }, + { + id: "3", + label: '分钟统计数据最小值', + }, + { + id: "4", + label: '分钟统计数据平均值', + }, + { + id: "5", + label: '分钟统计数据CP95值', + }, + { + id: "6", + label: '录波数据', + }, +] + +//全部检测脚本名称与ID +const testScriptDataList: Dict[] = [ + { + id: "1", + label: '国网入网检测脚本(单影响量-模拟式)', + }, + { + id: "2", + label: '国网入网检测脚本(Q/GDW 10650.4 - 2021) 模拟式', + }, + { + id: "3", + label: '国网入网检测脚本(Q/GDW 1650.4 - 2016) 模拟式', + }, + { + id: "4", + label: 'GBT 19862 - 2016 模拟式', + }, + { + id: "5", + label: '北京比对检测脚本', + }, +] + +//全部误差体系名称与ID +const testErrSystDataList: Dict[] = [ + { + id: "1", + label: 'Q/GDW 1650.2- 2016', + }, + { + id: "2", + label: 'Q/GDW 10650.2 - 2021', + }, + { + id: "3", + label: 'GBT 19862 - 2016', + }, +] + +const planData = ref([ + { + 'id': '1', + 'name': '检测计划1', + 'pattern':'1', + 'dataSource_Id':'1', + 'script_Id':'1', + 'error_Sys_Id':'1', + 'test_State':'1', + 'report_State':'1', + 'result':'1', + }, { - 'id': '1', - 'name': '检测计划1', - 'pattern':'模拟式', - 'father_Plan_Id':'/', - 'dataSource_Id':'分钟统计数据最大值', - 'script_Id':'国网入网检测脚本(单影响量-模拟式)', - 'error_Sys_Id':'Q/GDW 1650.2- 2016', - 'test_State':'未检', - 'report_State':'未生成', - 'result':'符合', - 'state': 1, - 'create_By':'', - 'create_Time':'', - 'update_By':'', - 'update_Time':'', - }, - { - 'id': '2', - 'name': '检测子计划1-1', - 'pattern':'模拟式', - 'father_Plan_Id':'检测计划1', - 'dataSource_Id':'分钟统计数据最大值', - 'script_Id':'国网入网检测脚本(单影响量-模拟式)', - 'error_Sys_Id':'Q/GDW 1650.2- 2016', - 'test_State':'未检', - 'report_State':'未生成', - 'result':'符合', - 'state': 1, - 'create_By':'', - 'create_Time':'', - 'update_By':'', - 'update_Time':'', - }, - { - 'id': '3', - 'name': '检测子计划1-2', - 'pattern':'模拟式', - 'father_Plan_Id':'检测计划1', - 'dataSource_Id':'分钟统计数据最大值', - 'script_Id':'国网入网检测脚本(单影响量-模拟式)', - 'error_Sys_Id':'Q/GDW 1650.2- 2016', - 'test_State':'未检', - 'report_State':'未生成', - 'result':'符合', - 'state': 1, - 'create_By':'', - 'create_Time':'', - 'update_By':'', - 'update_Time':'', - }, - { - 'id': '4', - 'name': '检测计划2', - 'pattern':'模拟式', - 'father_Plan_Id':'/', - 'dataSource_Id':'分钟统计数据最小值', - 'script_Id':'国网入网检测脚本(单影响量-模拟式)', - 'error_Sys_Id':'Q/GDW 10650.2 - 2021', - 'test_State':'检测完成', - 'report_State':'部分生成', - 'result':'不符合', - 'state': 1, - 'create_By':'', - 'create_Time':'', - 'update_By':'', - 'update_Time':'', - }, - { - 'id': '5', - 'name': '检测计划3', - 'pattern':'模拟式', - 'father_Plan_Id':'/', - 'dataSource_Id':'分钟统计数据最大值', - 'script_Id':'/', - 'error_Sys_Id':'/', - 'test_State':'未检', - 'report_State':'未生成', - 'result':'符合', - 'state': 1, - 'create_By':'', - 'create_Time':'', - 'update_By':'', - 'update_Time':'', - }, - { - 'id': '6', - 'name': '检测子计划4', - 'pattern':'模拟式', - 'father_Plan_Id':'/', - 'dataSource_Id':'分钟统计数据CP95值', - 'script_Id':'国网入网检测脚本(单影响量-模拟式)', - 'error_Sys_Id':'Q/GDW 1650.2- 2016', - 'test_State':'未检', - 'report_State':'未生成', - 'result':'符合', - 'state': 1, - 'create_By':'', - 'create_Time':'', - 'update_By':'', - 'update_Time':'', - }, - { - 'id': '7', - 'name': '检测子计划4-1', - 'pattern':'模拟式', - 'father_Plan_Id':'检测计划4', - 'dataSource_Id':'分钟统计数据CP95值', - 'script_Id':'国网入网检测脚本(单影响量-模拟式)', - 'error_Sys_Id':'Q/GDW 1650.2- 2016', - 'test_State':'未检', - 'report_State':'未生成', - 'result':'符合', - 'state': 1, - 'create_By':'', - 'create_Time':'', - 'update_By':'', - 'update_Time':'', - }, + 'id': '2', + 'name': '检测子计划2', + 'pattern':'1', + 'father_Plan_Id':'1', + 'dataSource_Id':'2', + 'script_Id':'2', + 'error_Sys_Id':'2', + 'test_State':'2', + 'report_State':'2', + 'result':'2', + }, + { + 'id': '3', + 'name': '检测子计划1-2', + 'pattern':'1', + 'father_Plan_Id':'1', + 'dataSource_Id':'3', + 'script_Id':'3', + 'error_Sys_Id':'3', + 'test_State':'3', + 'report_State':'3', + 'result':'3', + }, ]) -export default plandata \ No newline at end of file +// const plandata = ref([ +// { +// 'id': '1', +// 'name': '检测计划1', +// 'pattern':'模拟式', +// 'father_Plan_Id':'/', +// 'dataSource_Id':'分钟统计数据最大值', +// 'script_Id':'国网入网检测脚本(单影响量-模拟式)', +// 'error_Sys_Id':'Q/GDW 1650.2- 2016', +// 'test_State':'未检', +// 'report_State':'未生成', +// 'result':'符合', +// 'state': 1, +// 'create_By':'', +// 'create_Time':'', +// 'update_By':'', +// 'update_Time':'', +// }, +// { +// 'id': '2', +// 'name': '检测子计划1-1', +// 'pattern':'模拟式', +// 'father_Plan_Id':'检测计划1', +// 'dataSource_Id':'分钟统计数据最大值', +// 'script_Id':'国网入网检测脚本(单影响量-模拟式)', +// 'error_Sys_Id':'Q/GDW 1650.2- 2016', +// 'test_State':'未检', +// 'report_State':'未生成', +// 'result':'符合', +// 'state': 1, +// 'create_By':'', +// 'create_Time':'', +// 'update_By':'', +// 'update_Time':'', +// }, +// { +// 'id': '3', +// 'name': '检测子计划1-2', +// 'pattern':'模拟式', +// 'father_Plan_Id':'检测计划1', +// 'dataSource_Id':'分钟统计数据最大值', +// 'script_Id':'国网入网检测脚本(单影响量-模拟式)', +// 'error_Sys_Id':'Q/GDW 1650.2- 2016', +// 'test_State':'未检', +// 'report_State':'未生成', +// 'result':'符合', +// 'state': 1, +// 'create_By':'', +// 'create_Time':'', +// 'update_By':'', +// 'update_Time':'', +// }, +// { +// 'id': '4', +// 'name': '检测计划2', +// 'pattern':'模拟式', +// 'father_Plan_Id':'/', +// 'dataSource_Id':'分钟统计数据最小值', +// 'script_Id':'国网入网检测脚本(单影响量-模拟式)', +// 'error_Sys_Id':'Q/GDW 10650.2 - 2021', +// 'test_State':'检测完成', +// 'report_State':'部分生成', +// 'result':'不符合', +// 'state': 1, +// 'create_By':'', +// 'create_Time':'', +// 'update_By':'', +// 'update_Time':'', +// }, +// { +// 'id': '5', +// 'name': '检测计划3', +// 'pattern':'模拟式', +// 'father_Plan_Id':'/', +// 'dataSource_Id':'分钟统计数据最大值', +// 'script_Id':'/', +// 'error_Sys_Id':'/', +// 'test_State':'未检', +// 'report_State':'未生成', +// 'result':'符合', +// 'state': 1, +// 'create_By':'', +// 'create_Time':'', +// 'update_By':'', +// 'update_Time':'', +// }, +// { +// 'id': '6', +// 'name': '检测子计划4', +// 'pattern':'模拟式', +// 'father_Plan_Id':'/', +// 'dataSource_Id':'分钟统计数据CP95值', +// 'script_Id':'国网入网检测脚本(单影响量-模拟式)', +// 'error_Sys_Id':'Q/GDW 1650.2- 2016', +// 'test_State':'未检', +// 'report_State':'未生成', +// 'result':'符合', +// 'state': 1, +// 'create_By':'', +// 'create_Time':'', +// 'update_By':'', +// 'update_Time':'', +// }, +// { +// 'id': '7', +// 'name': '检测子计划4-1', +// 'pattern':'模拟式', +// 'father_Plan_Id':'检测计划4', +// 'dataSource_Id':'分钟统计数据CP95值', +// 'script_Id':'国网入网检测脚本(单影响量-模拟式)', +// 'error_Sys_Id':'Q/GDW 1650.2- 2016', +// 'test_State':'未检', +// 'report_State':'未生成', +// 'result':'符合', +// 'state': 1, +// 'create_By':'', +// 'create_Time':'', +// 'update_By':'', +// 'update_Time':'', +// }, +// ]) + +export {planData,dictPattern,dictTestState,dictReportState,dictResult,testPlanDataList,testSoureDataList,testScriptDataList,testErrSystDataList} \ No newline at end of file diff --git a/frontend/src/views/plan/planList/components/PlanOpen.vue b/frontend/src/views/plan/planList/components/devPopup.vue similarity index 62% rename from frontend/src/views/plan/planList/components/PlanOpen.vue rename to frontend/src/views/plan/planList/components/devPopup.vue index b84b19c..814c1a8 100644 --- a/frontend/src/views/plan/planList/components/PlanOpen.vue +++ b/frontend/src/views/plan/planList/components/devPopup.vue @@ -7,7 +7,7 @@ :title='title' :width='width' :modal='false'> -
+
-