From d2d4153114d4a3ed9a436327c4c7f515d9aaa61c Mon Sep 17 00:00:00 2001 From: sjl <1716605279@qq.com> Date: Wed, 30 Oct 2024 19:07:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83=E4=B8=8B=E6=8B=89=E6=A1=86?= =?UTF-8?q?=EF=BC=8C=E6=95=B0=E6=8D=AE=E5=BA=93=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/error/errorData.ts | 12 +- frontend/src/api/error/interface/index.ts | 2 +- frontend/src/api/plan/planData.ts | 2 +- frontend/src/api/resource/interface/index.ts | 2 +- frontend/src/api/resource/resourceData.ts | 48 +++---- frontend/src/api/system/dictData.ts | 135 +++++++++++++++++- .../resource/components/ResourceDialog.vue | 12 +- .../src/views/authority/resource/index.vue | 18 +-- frontend/src/views/authority/role/index.vue | 3 +- .../components/ErrorSystemDialog.vue | 14 +- .../src/views/machine/errorSystem/index.vue | 8 +- frontend/src/views/plan/planList/index.vue | 14 +- 12 files changed, 203 insertions(+), 67 deletions(-) diff --git a/frontend/src/api/error/errorData.ts b/frontend/src/api/error/errorData.ts index 2995676..3e97c22 100644 --- a/frontend/src/api/error/errorData.ts +++ b/frontend/src/api/error/errorData.ts @@ -3,8 +3,8 @@ import type {ErrorSystem} from "./interface" const errordata = ref([ { id: '1', - name: 'Q/GDW 1650.2- 2016', - standard_Name:'', + name: 'Q/GDW 1650.2-2016-A', + standard_Name:'Q/GDW 1650.2-2016', standard_Time:'2016', dev_Level:'A级', enable:1, @@ -12,8 +12,8 @@ const errordata = ref([ }, { id: '2', - name: 'Q/GDW 1650.2- 2021', - standard_Name:'', + name: 'Q/GDW 1650.2-2021-A', + standard_Name:'Q/GDW 1650.2-2021', standard_Time:'2021', dev_Level:'A级', enable:1, @@ -21,8 +21,8 @@ const errordata = ref([ }, { id: '3', - name: 'GBT 19862 - 2016', - standard_Name:'', + name: 'GBT 19862-2016-A', + standard_Name:'GBT 19862-2016', standard_Time:'2016', dev_Level:'A级', enable:1, diff --git a/frontend/src/api/error/interface/index.ts b/frontend/src/api/error/interface/index.ts index d6a0d18..b68b6a6 100644 --- a/frontend/src/api/error/interface/index.ts +++ b/frontend/src/api/error/interface/index.ts @@ -7,7 +7,7 @@ export namespace ErrorSystem { standard_Name:string;//参照标准名称 standard_Time:string;//标准推行时间 dev_Level:string;//使用设备等级 - enable:number;//状态:0-不启用 1-启用 + enable?:number;//状态:0-不启用 1-启用 state:number;//0-删除 1-正常 create_By?:string;//创建用户 create_Time?:string;//创建时间 diff --git a/frontend/src/api/plan/planData.ts b/frontend/src/api/plan/planData.ts index 19fd254..57be319 100644 --- a/frontend/src/api/plan/planData.ts +++ b/frontend/src/api/plan/planData.ts @@ -62,7 +62,7 @@ const plandata = ref([ 'error_Sys_Id':'Q/GDW 10650.2 - 2021', 'test_State':'检测完成', 'report_State':'部分生成', - 'result':'符合', + 'result':'不符合', 'state': 1, 'create_By':'', 'create_Time':'', diff --git a/frontend/src/api/resource/interface/index.ts b/frontend/src/api/resource/interface/index.ts index a4988fe..e59c64b 100644 --- a/frontend/src/api/resource/interface/index.ts +++ b/frontend/src/api/resource/interface/index.ts @@ -13,7 +13,7 @@ export namespace Resource { path:string;//路径 icon?:string;//图标 sort:number;//排序 - type:number;//资源类型0-菜单、1-按钮、2-公共资源、3-服务间调用资源 + type?:number;//资源类型0-菜单、1-按钮、2-公共资源、3-服务间调用资源 remark?: string;//权限资源描述 state:number;//权限资源状态 create_By?:string;//创建人 diff --git a/frontend/src/api/resource/resourceData.ts b/frontend/src/api/resource/resourceData.ts index 0b5e367..d3683bc 100644 --- a/frontend/src/api/resource/resourceData.ts +++ b/frontend/src/api/resource/resourceData.ts @@ -7,7 +7,7 @@ const resourcedata = ref([ 'pid':'0', 'pids':'', 'name': '检测计划', - 'code':'', + 'code':'route', 'path':'/plan/planList/index', 'icon':'', 'sort':100, @@ -20,7 +20,7 @@ const resourcedata = ref([ pid:'0', pids:'', name: '台账管理', - code:'', + code:'route', path:'/machine', icon:'', sort:100, @@ -32,11 +32,11 @@ const resourcedata = ref([ pid:'11', pids:'', name: '检测脚本', - code:'', + code:'route', path:'/machine/testScript/index', icon:'', sort:100, - type:0, + type:1, remark: '检测脚本描述', state:1, }, @@ -45,11 +45,11 @@ const resourcedata = ref([ pid:'22', pids:'', name: '被检设备', - code:'', + code:'route', path:'/plan/planList/index', icon:'', sort:100, - type:0, + type:1, remark: '被检设备描述', state:1, }, @@ -58,11 +58,11 @@ const resourcedata = ref([ pid:'23', pids:'', name: '误差体系', - code:'', + code:'route', path:'/plan/planList/index', icon:'', sort:100, - type:0, + type:1, remark: '误差体系描述', state:1, }, @@ -71,11 +71,11 @@ const resourcedata = ref([ pid:'24', pids:'', name: '检测源', - code:'', + code:'route', path:'/plan/planList/index', icon:'', sort:100, - type:0, + type:1, remark: '检测源描述', state:1, }] @@ -85,7 +85,7 @@ const resourcedata = ref([ pid:'0', pids:'', name: '权限管理', - code:'', + code:'route', path:'/plan/planList/index', icon:'', sort:100, @@ -97,7 +97,7 @@ const resourcedata = ref([ pid:'1', pids:'', name: '用户管理', - code:'', + code:'route', path:'/plan/planList/index', icon:'', sort:100, @@ -110,7 +110,7 @@ const resourcedata = ref([ pid:'2', pids:'', name: '角色管理', - code:'', + code:'route', path:'/plan/planList/index', icon:'', sort:100, @@ -123,7 +123,7 @@ const resourcedata = ref([ pid:'3', pids:'', name: '菜单管理', - code:'', + code:'route', path:'/plan/planList/index', icon:'', sort:100, @@ -137,7 +137,7 @@ const resourcedata = ref([ pid:'0', pids:'', name: '系统配置', - code:'', + code:'route', path:'/plan/planList/index', icon:'', sort:100, @@ -149,7 +149,7 @@ const resourcedata = ref([ pid:'1', pids:'', name: '通用配置', - code:'', + code:'route', path:'/plan/planList/index', icon:'', sort:100, @@ -162,7 +162,7 @@ const resourcedata = ref([ pid:'2', pids:'', name: '数据字典', - code:'', + code:'route', path:'/plan/planList/index', icon:'', sort:100, @@ -175,7 +175,7 @@ const resourcedata = ref([ pid:'3', pids:'', name: '报告模版', - code:'', + code:'route', path:'/plan/planList/index', icon:'', sort:100, @@ -188,7 +188,7 @@ const resourcedata = ref([ pid:'4', pids:'', name: '版本注册', - code:'', + code:'route', path:'/plan/planList/index', icon:'', sort:100, @@ -202,7 +202,7 @@ const resourcedata = ref([ pid:'0', pids:'', name: '日志管理', - code:'', + code:'route', path:'/plan/planList/index', icon:'', sort:100, @@ -215,7 +215,7 @@ const resourcedata = ref([ pid:'0', pids:'', name: '统计分析', - code:'', + code:'route', path:'/plan/planList/index', icon:'', sort:100, @@ -228,7 +228,7 @@ const resourcedata = ref([ pid:'0', pids:'', name: '示例', - code:'', + code:'route', path:'/plan/planList/index', icon:'', sort:100, @@ -240,7 +240,7 @@ const resourcedata = ref([ pid:'1', pids:'', name: '普通表格', - code:'', + code:'route', path:'/plan/planList/index', icon:'', sort:100, @@ -253,7 +253,7 @@ const resourcedata = ref([ pid:'1', pids:'', name: '表格树', - code:'', + code:'route', path:'/plan/planList/index', icon:'', sort:100, diff --git a/frontend/src/api/system/dictData.ts b/frontend/src/api/system/dictData.ts index a9d752a..e340856 100644 --- a/frontend/src/api/system/dictData.ts +++ b/frontend/src/api/system/dictData.ts @@ -45,22 +45,27 @@ const dictData: Dict[] = [ }, { id: "3", - code: 'type', + code: 'resourceType', label: '资源类型', children: [ { - id: "1", + id: "0", label: '菜单', + code: 0, + }, + { + id: "1", + label: '按钮', code: 1, }, { id: "2", - label: '按钮', + label: '公共资源', code: 2, }, { id: "3", - label: '公共资源', + label: '服务间调用资源', code: 3, }, ], @@ -87,6 +92,128 @@ const dictData: Dict[] = [ }, ], }, + { + id: "4", + code: 'roleType', + label: '角色类型', + children: [ + { + id: "0", + label: '超级管理员', + code: 0, + }, + { + id: "1", + label: '管理员', + code: 1, + }, + { + id: "2", + label: '普通角色', + code: 2, + }, + ], + }, + { + id: "4", + code: 'roleType', + label: '角色类型', + children: [ + { + id: "0", + label: '超级管理员', + code: 0, + }, + { + id: "1", + label: '管理员', + code: 1, + }, + { + id: "2", + label: '普通角色', + code: 2, + }, + ], + }, + { + id: "5", + code: 'planTestState', + label: '检测状态', + children: [ + { + id: "0", + label: '未检', + code: '未检', + }, + { + id: "1", + label: '检测中', + code: '检测中', + }, + { + id: "2", + label: '检测完成', + code: '检测完成', + }, + ], + }, + { + id: "6", + code: 'errorLevel', + label: '适用设备等级', + children: [ + { + id: "0", + label: 'A级', + code: "A级", + }, + { + id: "1", + label: 'S级', + code: 'S级', + }, + ], + }, + { + id: "7", + code: 'planReportState', + label: '报告生成状态', + children: [ + { + id: "0", + label: '未生成', + code: "未生成", + }, + { + id: "1", + label: '部分生成', + code: '部分生成', + }, + { + id: "2", + label: '全部生成', + code: '全部生成', + }, + ], + }, + { + id: "6", + code: 'planResult', + label: '检测结果', + children: [ + { + id: "0", + label: '符合', + code: "符合", + }, + { + id: "1", + label: '不符合', + code: '不符合', + }, + ], + }, ] diff --git a/frontend/src/views/authority/resource/components/ResourceDialog.vue b/frontend/src/views/authority/resource/components/ResourceDialog.vue index 11308b9..d9a8c6c 100644 --- a/frontend/src/views/authority/resource/components/ResourceDialog.vue +++ b/frontend/src/views/authority/resource/components/ResourceDialog.vue @@ -12,10 +12,12 @@ - - - - + @@ -35,6 +37,8 @@ import { defineProps, defineEmits,watch,ref, type Ref } from 'vue'; import { dialogSmall } from '@/utils/elementBind' import { ElMessage, FormInstance, FormItemRule } from 'element-plus' + import { useDictStore } from '@/stores/modules/dict' + const dictStore = useDictStore() const props = defineProps<{ visible: boolean; dialogTitle: string; diff --git a/frontend/src/views/authority/resource/index.vue b/frontend/src/views/authority/resource/index.vue index dcd01f9..d03cc08 100644 --- a/frontend/src/views/authority/resource/index.vue +++ b/frontend/src/views/authority/resource/index.vue @@ -93,20 +93,9 @@ prop: 'type', label: '类型', width: 150, - search: { - render: ({searchParam}) => { - return ( -
- - - - - - -
- ); - }, - }, + enum: dictStore.getDictData('resourceType'), + search: { el: 'select', props: { filterable: true } }, + fieldNames: { label: 'label', value: 'code' }, }, { prop: 'state', @@ -134,7 +123,6 @@ const openAddDialog = () => { path:'', icon:'', sort:100, - type:0, remark: '', state:1, children: [], diff --git a/frontend/src/views/authority/role/index.vue b/frontend/src/views/authority/role/index.vue index 2808e04..cd78d12 100644 --- a/frontend/src/views/authority/role/index.vue +++ b/frontend/src/views/authority/role/index.vue @@ -197,7 +197,7 @@ const openDrawer = (title: string, row: Partial = {}) => { openType = 'add' else if (title === '编辑角色') openType = 'edit' - + rolePopupVisible.value = true rolePopupTitle.value = title @@ -210,6 +210,7 @@ const openDrawer = (title: string, row: Partial = {}) => { } rolePopupData.value = safeRow + } else if (title === '设置权限') { permissionUnitVisible.value = true permissionUnitTitle.value = title diff --git a/frontend/src/views/machine/errorSystem/components/ErrorSystemDialog.vue b/frontend/src/views/machine/errorSystem/components/ErrorSystemDialog.vue index b17dc3e..297ec8d 100644 --- a/frontend/src/views/machine/errorSystem/components/ErrorSystemDialog.vue +++ b/frontend/src/views/machine/errorSystem/components/ErrorSystemDialog.vue @@ -25,8 +25,12 @@ - - + @@ -34,8 +38,8 @@ - - + + @@ -149,6 +153,8 @@ import { dialogBig,dialogMiddle} from '@/utils/elementBind' //import IndicatorTypeDialog from "@/views/machine/errorSystem/components/IndicatorTypeDialog.vue"; // 导入子组件 import {CirclePlus, Delete, EditPen,FolderOpened,CopyDocument} from '@element-plus/icons-vue' + import { useDictStore } from '@/stores/modules/dict' + const dictStore = useDictStore() const props = defineProps<{ visible: boolean; dialogTitle: string; diff --git a/frontend/src/views/machine/errorSystem/index.vue b/frontend/src/views/machine/errorSystem/index.vue index 7c304e2..6675209 100644 --- a/frontend/src/views/machine/errorSystem/index.vue +++ b/frontend/src/views/machine/errorSystem/index.vue @@ -91,7 +91,7 @@ const columns = ref[]>([ label: '误差体系名称', }, { - prop: 'Standard_Name', + prop: 'standard_Name', label: '参照标准名称', }, { @@ -104,7 +104,9 @@ const columns = ref[]>([ prop: 'dev_Level', label: '适用设备等级', width: 120, + enum: dictStore.getDictData('errorLevel'), search: { el: 'select', props: { filterable: true } }, + fieldNames: { label: 'label', value: 'code' }, }, { prop: 'operation', label: '操作', fixed: 'right' ,width: 300,}, ]) @@ -124,8 +126,8 @@ const openAddDialog = () => { standard_Name:'', standard_Time:'', dev_Level:'', - enable:1, - state:1, + + state:0, }; dialogTitle.value = '新增误差体系'; dialogFormVisible.value = true; // 打开对话框 diff --git a/frontend/src/views/plan/planList/index.vue b/frontend/src/views/plan/planList/index.vue index 13bfab5..cb6021e 100644 --- a/frontend/src/views/plan/planList/index.vue +++ b/frontend/src/views/plan/planList/index.vue @@ -49,6 +49,8 @@ import PlanDialog from "@/views/plan/planList/components/PlanDialog.vue"; // 导 import Open from '@/views/plan/planList/components/PlanOpen.vue' import { useViewSize } from '@/hooks/useViewSize' import { useRouter } from "vue-router"; +import { useDictStore } from '@/stores/modules/dict' +const dictStore = useDictStore() const { popupBaseView, viewWidth, viewHeight } = useViewSize() const openView = ref() const planData = planDataList @@ -100,19 +102,25 @@ const columns = reactive[]>([ prop: 'test_State', label: '检测状态', width: 100, - search: { el: 'select', props: { filterable: true } }, + enum: dictStore.getDictData('planTestState'), + search: { el: 'select', props: { filterable: true } }, + fieldNames: { label: 'label', value: 'code' }, }, { prop: 'report_State', label: '检测报告状态', width: 150, - search: { el: 'select', props: { filterable: true } }, + enum: dictStore.getDictData('planReportState'), + search: { el: 'select', props: { filterable: true } }, + fieldNames: { label: 'label', value: 'code' }, }, { prop: 'result', label: '检测结果', width: 100, - search: { el: 'select', props: { filterable: true } }, + enum: dictStore.getDictData('planResult'), + search: { el: 'select', props: { filterable: true } }, + fieldNames: { label: 'label', value: 'code' }, }, { prop: 'father_Plan_Id',