diff --git a/src/router/index.js b/src/router/index.js index 07302ad..67e73b5 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -26,149 +26,166 @@ import Layout from '@/layout' // 公共路由 export const constantRoutes = [ - { - path: '/redirect', - component: Layout, - hidden: true, - children: [ - { - path: '/redirect/:path(.*)', - component: () => import('@/views/redirect/index.vue') - } - ] - }, - { - path: '/login', - component: () => import('@/views/login'), - hidden: true - }, - { - path: '/register', - component: () => import('@/views/register'), - hidden: true - }, - { - path: "/:pathMatch(.*)*", - component: () => import('@/views/error/404'), - hidden: true - }, - { - path: '/401', - component: () => import('@/views/error/401'), - hidden: true - }, - { - path: '', - component: Layout, - redirect: '/index', - children: [ - { - path: '/index', - component: () => import('@/views/index'), - name: 'Index', - meta: { title: '首页', icon: 'dashboard', affix: true } - } - ] - }, - { - path: '/user', - component: Layout, - hidden: true, - redirect: 'noredirect', - children: [ - { - path: 'profile/:activeTab?', - component: () => import('@/views/system/user/profile/index'), - name: 'Profile', - meta: { title: '个人中心', icon: 'user' } - } - ] - } + { + path: '/redirect', + component: Layout, + hidden: true, + children: [ + { + path: '/redirect/:path(.*)', + component: () => import('@/views/redirect/index.vue'), + }, + ], + }, + { + path: '/login', + component: () => import('@/views/login'), + hidden: true, + }, + { + path: '/register', + component: () => import('@/views/register'), + hidden: true, + }, + { + path: '/:pathMatch(.*)*', + component: () => import('@/views/error/404'), + hidden: true, + }, + { + path: '/401', + component: () => import('@/views/error/401'), + hidden: true, + }, + { + path: '', + component: Layout, + redirect: '/index', + children: [ + { + path: '/index', + component: () => import('@/views/index'), + name: 'Index', + meta: { title: '首页', icon: 'dashboard', affix: true }, + }, + ], + }, + { + path: '/user', + component: Layout, + hidden: true, + redirect: 'noredirect', + children: [ + { + path: 'profile/:activeTab?', + component: () => import('@/views/system/user/profile/index'), + name: 'Profile', + meta: { title: '个人中心', icon: 'user' }, + }, + ], + }, + + { + path: '/plan/monthlyPlanEdit', + component: Layout, + hidden: true, + children: [ + { + path: 'index', + component: () => import('@/views/planMange/monthlyPlan/edit.vue'), + name: 'MonthlyPlanEdit', + meta: { + title: '月计划填报', + activeMenu: '/plan/monthlyPlan', // 保持左侧高亮在列表菜单 + }, + }, + ], + }, ] // 动态路由,基于用户权限动态去加载 export const dynamicRoutes = [ - { - path: '/system/user-auth', - component: Layout, - hidden: true, - permissions: ['system:user:edit'], - children: [ - { - path: 'role/:userId(\\d+)', - component: () => import('@/views/system/user/authRole'), - name: 'AuthRole', - meta: { title: '分配角色', activeMenu: '/system/user' } - } - ] - }, - { - path: '/system/role-auth', - component: Layout, - hidden: true, - permissions: ['system:role:edit'], - children: [ - { - path: 'user/:roleId(\\d+)', - component: () => import('@/views/system/role/authUser'), - name: 'AuthUser', - meta: { title: '分配用户', activeMenu: '/system/role' } - } - ] - }, - { - path: '/system/dict-data', - component: Layout, - hidden: true, - permissions: ['system:dict:list'], - children: [ - { - path: 'index/:dictId(\\d+)', - component: () => import('@/views/system/dict/data'), - name: 'Data', - meta: { title: '字典数据', activeMenu: '/system/dict' } - } - ] - }, - { - path: '/monitor/job-log', - component: Layout, - hidden: true, - permissions: ['monitor:job:list'], - children: [ - { - path: 'index/:jobId(\\d+)', - component: () => import('@/views/monitor/job/log'), - name: 'JobLog', - meta: { title: '调度日志', activeMenu: '/monitor/job' } - } - ] - }, - { - path: '/tool/gen-edit', - component: Layout, - hidden: true, - permissions: ['tool:gen:edit'], - children: [ - { - path: 'index/:tableId(\\d+)', - component: () => import('@/views/tool/gen/editTable'), - name: 'GenEdit', - meta: { title: '修改生成配置', activeMenu: '/tool/gen' } - } - ] - } + { + path: '/system/user-auth', + component: Layout, + hidden: true, + permissions: ['system:user:edit'], + children: [ + { + path: 'role/:userId(\\d+)', + component: () => import('@/views/system/user/authRole'), + name: 'AuthRole', + meta: { title: '分配角色', activeMenu: '/system/user' }, + }, + ], + }, + { + path: '/system/role-auth', + component: Layout, + hidden: true, + permissions: ['system:role:edit'], + children: [ + { + path: 'user/:roleId(\\d+)', + component: () => import('@/views/system/role/authUser'), + name: 'AuthUser', + meta: { title: '分配用户', activeMenu: '/system/role' }, + }, + ], + }, + { + path: '/system/dict-data', + component: Layout, + hidden: true, + permissions: ['system:dict:list'], + children: [ + { + path: 'index/:dictId(\\d+)', + component: () => import('@/views/system/dict/data'), + name: 'Data', + meta: { title: '字典数据', activeMenu: '/system/dict' }, + }, + ], + }, + { + path: '/monitor/job-log', + component: Layout, + hidden: true, + permissions: ['monitor:job:list'], + children: [ + { + path: 'index/:jobId(\\d+)', + component: () => import('@/views/monitor/job/log'), + name: 'JobLog', + meta: { title: '调度日志', activeMenu: '/monitor/job' }, + }, + ], + }, + { + path: '/tool/gen-edit', + component: Layout, + hidden: true, + permissions: ['tool:gen:edit'], + children: [ + { + path: 'index/:tableId(\\d+)', + component: () => import('@/views/tool/gen/editTable'), + name: 'GenEdit', + meta: { title: '修改生成配置', activeMenu: '/tool/gen' }, + }, + ], + }, ] const router = createRouter({ - history: createWebHistory(), - routes: constantRoutes, - scrollBehavior(to, from, savedPosition) { - if (savedPosition) { - return savedPosition - } - return { top: 0 } - }, + history: createWebHistory(), + routes: constantRoutes, + scrollBehavior(to, from, savedPosition) { + if (savedPosition) { + return savedPosition + } + return { top: 0 } + }, }) export default router diff --git a/src/views/planMange/monthlyPlan/addForm.vue b/src/views/planMange/monthlyPlan/addForm.vue new file mode 100644 index 0000000..4c958b2 --- /dev/null +++ b/src/views/planMange/monthlyPlan/addForm.vue @@ -0,0 +1,145 @@ + + + + + diff --git a/src/views/planMange/monthlyPlan/config.js b/src/views/planMange/monthlyPlan/config.js new file mode 100644 index 0000000..5a4005b --- /dev/null +++ b/src/views/planMange/monthlyPlan/config.js @@ -0,0 +1,80 @@ +import { reactive } from 'vue' + +// 静态选项(可后续替换为接口下拉) +const stationOptions = [ + { label: '昆明运检站', value: 1 }, + { label: '大理运检站', value: 2 }, +] + +const majorOptions = [ + { label: '输电专业', value: 1 }, + { label: '变电专业', value: 2 }, +] + +const businessTypeOptions = [ + { label: '日常巡视', value: 1 }, + { label: '缺陷处理', value: 2 }, +] + +const riskLevelOptions = [ + { label: '低风险', value: 1 }, + { label: '中风险', value: 2 }, + { label: '高风险', value: 3 }, +] + +// 月计划列表搜索表单配置 +export const buildFormColumns = () => [ + { + type: 'month', + prop: 'month', + placeholder: '请选择月份', + }, + { + type: 'select', + prop: 'stationId', + placeholder: '请选择运检站', + options: stationOptions, + }, + { + type: 'input', + prop: 'keyword', + placeholder: '请输入关键字', + }, + { + type: 'select', + prop: 'majorId', + placeholder: '请选择专业', + options: majorOptions, + }, + { + type: 'select', + prop: 'businessTypeId', + placeholder: '请选择业务类型', + options: businessTypeOptions, + }, + { + type: 'select', + prop: 'riskLevel', + placeholder: '请选择风险等级', + options: riskLevelOptions, + }, +] + +// 月计划列表表格列 +export const tableColumns = [ + { prop: 'stationName', label: '运检站' }, + { prop: 'majorName', label: '专业' }, + { prop: 'businessTypeName', label: '业务类型' }, + { prop: 'projectName', label: '项目名称' }, + { prop: 'workTask', label: '工作任务' }, + { prop: 'riskLevelName', label: '风险等级' }, + { prop: 'categoryName', label: '类别' }, + { prop: 'workAmount', label: '工作量' }, + { prop: 'baseCount', label: '基数' }, + { prop: 'planStartDate', label: '计划开始时间' }, +] + +export default { + tableColumns, + buildFormColumns, +} diff --git a/src/views/planMange/monthlyPlan/edit.vue b/src/views/planMange/monthlyPlan/edit.vue new file mode 100644 index 0000000..b0384d6 --- /dev/null +++ b/src/views/planMange/monthlyPlan/edit.vue @@ -0,0 +1,308 @@ + + + + + diff --git a/src/views/planMange/monthlyPlan/index.vue b/src/views/planMange/monthlyPlan/index.vue index ce3c78f..b79a194 100644 --- a/src/views/planMange/monthlyPlan/index.vue +++ b/src/views/planMange/monthlyPlan/index.vue @@ -1,9 +1,92 @@ - + + + diff --git a/src/views/planMange/plan/config.js b/src/views/planMange/plan/config.js index 583fa15..af82254 100644 --- a/src/views/planMange/plan/config.js +++ b/src/views/planMange/plan/config.js @@ -1,6 +1,28 @@ import { reactive } from 'vue' -// 搜索表单配置(计划管理) +// 静态选项(后续可替换为接口下拉) +const stationOptions = [ + { label: '昆明运检站', value: 1 }, + { label: '大理运检站', value: 2 }, +] + +const majorOptions = [ + { label: '输电专业', value: 1 }, + { label: '变电专业', value: 2 }, +] + +const businessTypeOptions = [ + { label: '日常巡视', value: 1 }, + { label: '缺陷处理', value: 2 }, +] + +const riskLevelOptions = [ + { label: '低风险', value: 1 }, + { label: '中风险', value: 2 }, + { label: '高风险', value: 3 }, +] + +// 搜索表单配置(计划管理列表筛选) export const buildFormColumns = () => [ { type: 'month', @@ -8,33 +30,33 @@ export const buildFormColumns = () => [ placeholder: '请选择月份', }, { - type: 'input', - prop: 'projectName', - placeholder: '请输入项目名称', + type: 'select', + prop: 'stationId', + placeholder: '请选择运检站', + options: stationOptions, }, { type: 'input', - prop: 'workContent', - placeholder: '请输入作业内容关键字', + prop: 'keyword', + placeholder: '请输入关键字', }, { type: 'select', - prop: 'deptId', - placeholder: '请选择实施部门', - options: [ - { label: '实施部门一', value: 1 }, - { label: '实施部门二', value: 2 }, - ], + prop: 'majorId', + placeholder: '请选择专业', + options: majorOptions, + }, + { + type: 'select', + prop: 'businessTypeId', + placeholder: '请选择业务类型', + options: businessTypeOptions, }, { type: 'select', prop: 'riskLevel', placeholder: '请选择风险等级', - options: [ - { label: '低风险', value: 1 }, - { label: '中风险', value: 2 }, - { label: '高风险', value: 3 }, - ], + options: riskLevelOptions, }, ] diff --git a/src/views/planMange/plan/index.vue b/src/views/planMange/plan/index.vue index c3cfb04..52a4503 100644 --- a/src/views/planMange/plan/index.vue +++ b/src/views/planMange/plan/index.vue @@ -12,7 +12,7 @@ >