From 316a0618a98e424f166bd10cbe853ae4256e98f5 Mon Sep 17 00:00:00 2001 From: jzq <1391797124@qq.com> Date: Tue, 30 Jul 2024 16:46:28 +0800 Subject: [PATCH] update handbook plan project --- .../scientific/project_application_plan.js | 26 +- ruoyi-ui/src/router/index.js | 55 +- .../src/views/scientific/handbook/detail.vue | 476 ++++++++++++++++++ .../scientific/handbook/handbookApply.vue | 163 ++++++ .../src/views/scientific/handbook/index.vue | 90 ++-- .../src/views/scientific/project/index.vue | 5 + .../views/scientific/project/projectApply.vue | 70 ++- .../project_application_plan/index.vue | 94 ++-- .../project_application_plan/planApply.vue | 77 +-- .../controller/HandbookController.java | 108 ---- .../controller/ProjectHandbookController.java | 48 +- .../controller/ProjectPlanController.java | 106 ++++ .../com/ruoyi/scientific/domain/Handbook.java | 65 --- .../scientific/domain/ProjectApplication.java | 10 +- .../scientific/domain/ProjectHandbook.java | 96 +--- .../ruoyi/scientific/domain/ProjectPlan.java | 105 ++++ .../scientific/domain/bo/HandbookBo.java | 81 --- .../domain/bo/ProjectApplicationBo.java | 8 +- .../domain/bo/ProjectHandbookBo.java | 79 +-- .../scientific/domain/bo/ProjectPlanBo.java | 116 +++++ .../scientific/domain/vo/HandbookVo.java | 81 --- .../domain/vo/ProjectApplicationVo.java | 18 + .../domain/vo/ProjectHandbookVo.java | 99 ++-- .../scientific/domain/vo/ProjectPlanVo.java | 113 +++++ .../listener/HandbookUpdateListener.java | 41 +- .../listener/PlanUpdateListener.java | 76 +++ .../scientific/mapper/HandbookMapper.java | 15 - .../mapper/ProjectHandbookMapper.java | 6 +- .../scientific/mapper/ProjectPlanMapper.java | 15 + .../scientific/service/IHandbookService.java | 49 -- .../service/IProjectHandbookService.java | 21 +- .../service/IProjectPlanService.java | 53 ++ .../service/impl/HandbookServiceImpl.java | 117 ----- .../impl/ProjectApplicationServiceImpl.java | 2 +- .../impl/ProjectHandbookServiceImpl.java | 41 +- .../service/impl/ProjectPlanServiceImpl.java | 131 +++++ .../scientific/ProjectHandbookMapper.xml | 14 +- ...ndbookMapper.xml => ProjectPlanMapper.xml} | 16 +- 38 files changed, 1792 insertions(+), 994 deletions(-) create mode 100644 ruoyi-ui/src/views/scientific/handbook/detail.vue create mode 100644 ruoyi-ui/src/views/scientific/handbook/handbookApply.vue delete mode 100644 scientific/src/main/java/com/ruoyi/scientific/controller/HandbookController.java create mode 100644 scientific/src/main/java/com/ruoyi/scientific/controller/ProjectPlanController.java delete mode 100644 scientific/src/main/java/com/ruoyi/scientific/domain/Handbook.java create mode 100644 scientific/src/main/java/com/ruoyi/scientific/domain/ProjectPlan.java delete mode 100644 scientific/src/main/java/com/ruoyi/scientific/domain/bo/HandbookBo.java create mode 100644 scientific/src/main/java/com/ruoyi/scientific/domain/bo/ProjectPlanBo.java delete mode 100644 scientific/src/main/java/com/ruoyi/scientific/domain/vo/HandbookVo.java create mode 100644 scientific/src/main/java/com/ruoyi/scientific/domain/vo/ProjectPlanVo.java create mode 100644 scientific/src/main/java/com/ruoyi/scientific/listener/PlanUpdateListener.java delete mode 100644 scientific/src/main/java/com/ruoyi/scientific/mapper/HandbookMapper.java create mode 100644 scientific/src/main/java/com/ruoyi/scientific/mapper/ProjectPlanMapper.java delete mode 100644 scientific/src/main/java/com/ruoyi/scientific/service/IHandbookService.java create mode 100644 scientific/src/main/java/com/ruoyi/scientific/service/IProjectPlanService.java delete mode 100644 scientific/src/main/java/com/ruoyi/scientific/service/impl/HandbookServiceImpl.java create mode 100644 scientific/src/main/java/com/ruoyi/scientific/service/impl/ProjectPlanServiceImpl.java rename scientific/src/main/resources/mapper/scientific/{HandbookMapper.xml => ProjectPlanMapper.xml} (55%) diff --git a/ruoyi-ui/src/api/scientific/project_application_plan.js b/ruoyi-ui/src/api/scientific/project_application_plan.js index 3479dd8..94de37d 100644 --- a/ruoyi-ui/src/api/scientific/project_application_plan.js +++ b/ruoyi-ui/src/api/scientific/project_application_plan.js @@ -35,10 +35,30 @@ export function updatePlan(data) { }) } -// 删除项目申报v2 -export function delPlan(handbookId) { +// 删除项目申报计划 +export function delPlan(planId) { return request({ - url: '/scientific/plan/' + handbookId, + url: '/scientific/plan/' + planId, method: 'delete' }) } + +// 封装寻找最新 表单 的函数,返回 Promise +export function findLatestDeploymentTimeIndex(response) { + return new Promise((resolve, reject) => { + let latestIndex = 0; + let latestTime = new Date(response.rows[0].deploymentTime); + + response.rows.forEach((row, index) => { + const currentTime = new Date(row.deploymentTime); + + if (currentTime > latestTime) { + latestTime = currentTime; + latestIndex = index; + } + }); + + // 返回最新的索引 + resolve(latestIndex); + }); +} diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js index 2785ad7..d7e3e8f 100644 --- a/ruoyi-ui/src/router/index.js +++ b/ruoyi-ui/src/router/index.js @@ -215,7 +215,7 @@ export const dynamicRoutes = [ path: '/scientific/project_application_plan', component: Layout, hidden: true, - permissions: ['scientific:project_application_plan'], + permissions: ['scientific:plan'], children: [ // zqjia:这个路由是菜单管理里的起作用 // { @@ -230,13 +230,12 @@ export const dynamicRoutes = [ name: 'planDetail', meta: { title: '申报计划详情' } }, - // zqjia:这个路由是菜单管理里的起作用 - // { - // path: 'planApply', - // component: () => import('@/views/scientific/project_application_plan/planApply'), - // name: 'planApply', - // meta: { title: '项目申报', icon: '' } - // }, + { + path: 'planApply', + component: () => import('@/views/scientific/project_application_plan/planApply'), + name: 'planApply', + meta: { title: '项目申报', icon: '' } + }, ] }, // 项目路由 @@ -268,13 +267,49 @@ export const dynamicRoutes = [ meta: { title: '已申报项目' } }, { - path: 'projectApply/:deployId([\\w|\\-]+)', - component: () => import('@/views/scientific/project/projectApply.vue'), + path: 'projectApply', + component: () => import('@/views/scientific/project/projectApply'), name: 'ProjectApply', meta: { title: '项目申报', icon: '' } }, ] }, + // 指南路由 + { + path: '/scientific/handbook', + component: Layout, + hidden: true, + permissions: ['scientific:handbook'], + children: [ + // zqjia:这个路由是菜单管理里的起作用 + // { + // path: 'list', + // component: () => import('@/views/scientific/project/index'), + // name: 'projectList', + // meta: { title: '项目', icon: '' } + // }, + // zqjia:项目详情还没写 + { + path: 'detail/:planProcId([\\w|\\-]+)', + component: () => import('@/views/scientific/handbook/detail'), + name: 'handbookDetail', + meta: { title: '申报计划详情' } + }, + // { + // path: 'planProjectQuery/:planId([\\w|\\-]+)', + // // permissions: ['scientific:application:list'], + // component: () => import('@/views/scientific/project/index'), + // name: 'planProjectQuery', + // meta: { title: '已申报项目' } + // }, + // { + // path: 'projectApply/:deployId([\\w|\\-]+)', + // component: () => import('@/views/scientific/project/projectApply.vue'), + // name: 'ProjectApply', + // meta: { title: '项目申报', icon: '' } + // }, + ] + }, ] // 防止连续点击多次路由报错 diff --git a/ruoyi-ui/src/views/scientific/handbook/detail.vue b/ruoyi-ui/src/views/scientific/handbook/detail.vue new file mode 100644 index 0000000..11dbb21 --- /dev/null +++ b/ruoyi-ui/src/views/scientific/handbook/detail.vue @@ -0,0 +1,476 @@ + + + + + + + + + + + 指南详情 + + + + + + + + + + + + + + + + + diff --git a/ruoyi-ui/src/views/scientific/handbook/handbookApply.vue b/ruoyi-ui/src/views/scientific/handbook/handbookApply.vue new file mode 100644 index 0000000..191cbdf --- /dev/null +++ b/ruoyi-ui/src/views/scientific/handbook/handbookApply.vue @@ -0,0 +1,163 @@ + + + + + {{ processName }} + + + + + + + + + + + + + + diff --git a/ruoyi-ui/src/views/scientific/handbook/index.vue b/ruoyi-ui/src/views/scientific/handbook/index.vue index 7a60481..537f519 100644 --- a/ruoyi-ui/src/views/scientific/handbook/index.vue +++ b/ruoyi-ui/src/views/scientific/handbook/index.vue @@ -1,14 +1,6 @@ - - - - + @@ -41,22 +33,7 @@ placeholder="请选择发布时间"> - - - - - - + 搜索 重置 @@ -111,35 +88,48 @@ - + - + {{ parseTime(scope.row.handbookDate, '{y}-{m}-{d}') }} - - - - + + + + + + + + + + + + + + + + + 修改 + >详情 删除 + >发布计划 @@ -192,9 +182,16 @@ diff --git a/ruoyi-ui/src/views/scientific/project/index.vue b/ruoyi-ui/src/views/scientific/project/index.vue index 9e2cd4f..329d8ae 100644 --- a/ruoyi-ui/src/views/scientific/project/index.vue +++ b/ruoyi-ui/src/views/scientific/project/index.vue @@ -324,6 +324,11 @@ export default { /** 查询项目申报列表 */ getList() { this.loading = true; + const queryParams = this.$route.params && this.$route.params.queryParams; + if (queryParams !== undefined) { + this.queryParams = queryParams; + } + listApplication(this.queryParams).then(response => { this.applicationList = response.rows; this.total = response.total; diff --git a/ruoyi-ui/src/views/scientific/project/projectApply.vue b/ruoyi-ui/src/views/scientific/project/projectApply.vue index 056388a..526c889 100644 --- a/ruoyi-ui/src/views/scientific/project/projectApply.vue +++ b/ruoyi-ui/src/views/scientific/project/projectApply.vue @@ -2,7 +2,7 @@ - {{ this.handbook.handbookName }} + {{ this.plan.planName }} @@ -15,9 +15,9 @@