From 643355f110f017a0b9181eb139e10c2df03c9442 Mon Sep 17 00:00:00 2001 From: bob Date: Tue, 3 Jan 2023 11:05:39 +0800 Subject: [PATCH] feat(oa-project-flow) add oa-project-flow --- ruoyi-ui/src/api/flowable/definition.js | 8 ++++ ruoyi-ui/src/api/system/project.js | 6 +++ .../src/views/flowable/definition/index.vue | 2 +- .../src/views/flowable/oa-project-flow.vue | 32 +++++++++++++-- ruoyi-ui/src/views/index.vue | 14 ------- ruoyi-ui/src/views/system/project/index.vue | 41 ++++++++++--------- 6 files changed, 64 insertions(+), 39 deletions(-) diff --git a/ruoyi-ui/src/api/flowable/definition.js b/ruoyi-ui/src/api/flowable/definition.js index d2243df..e9e6c5a 100644 --- a/ruoyi-ui/src/api/flowable/definition.js +++ b/ruoyi-ui/src/api/flowable/definition.js @@ -86,6 +86,14 @@ export function saveXml(data) { }) } +// 获取最新流程id +export function getLatestIdByKey(procKey) { + return request({ + url: '/flowable/definition/getLatestIdByKey/' + procKey, + method: 'get' + }); +} + // 新增流程定义 export function addDeployment(data) { return request({ diff --git a/ruoyi-ui/src/api/system/project.js b/ruoyi-ui/src/api/system/project.js index 3573d28..2198236 100644 --- a/ruoyi-ui/src/api/system/project.js +++ b/ruoyi-ui/src/api/system/project.js @@ -8,6 +8,12 @@ export function listProject(query) { params: query }) } +export function optionProject() { + return request({ + url: '/system/project/option', + method: 'get' + }) +} // 查询项目详细 export function getProject(projectId) { diff --git a/ruoyi-ui/src/views/flowable/definition/index.vue b/ruoyi-ui/src/views/flowable/definition/index.vue index 55c2d6c..a64459c 100644 --- a/ruoyi-ui/src/views/flowable/definition/index.vue +++ b/ruoyi-ui/src/views/flowable/definition/index.vue @@ -404,7 +404,7 @@ export default { }) }, /** 启动流程 */ - handleDefinitionStart(row){ + handleDefinitionStart(){ definitionStart(row.id).then(res =>{ this.msgSuccess(res.msg); }) diff --git a/ruoyi-ui/src/views/flowable/oa-project-flow.vue b/ruoyi-ui/src/views/flowable/oa-project-flow.vue index 6af294c..dd66e16 100644 --- a/ruoyi-ui/src/views/flowable/oa-project-flow.vue +++ b/ruoyi-ui/src/views/flowable/oa-project-flow.vue @@ -12,8 +12,8 @@ + :label="item.label" + :value="item.value"> @@ -52,7 +52,7 @@ @@ -64,6 +64,8 @@ import {listForm, getForm, delForm, addForm, updateForm, exportForm} from "@/api/flowable/form"; import Editor from '@/components/Editor'; import Parser from '@/components/parser/Parser' +import {optionProject} from "@/api/system/project"; +import {definitionStart, getLatestIdByKey} from "@/api/flowable/definition"; export default { name: "Form", @@ -110,11 +112,12 @@ export default { }], // 表单参数 form: { - projectId: 0, + projectId: undefined, workRecord: '', issue: '', solution: '', }, + oaProjectFlowId: '', projectList: [], // 表单校验 rules: {} @@ -123,7 +126,28 @@ export default { methods: { init() { this.open = true + this.optionList() + this.getLatestIdByKey() }, + /** 启动流程 */ + startFlow(){ + definitionStart(this.oaProjectFlowId).then(res =>{ + this.msgSuccess(res.msg); + }) + }, /** 获取最新流程id */ + getLatestIdByKey(){ + getLatestIdByKey("oa_project_flow").then(res => { + this.oaProjectFlowId = res.data; + }); + }, + /** 查询项目列表 */ + optionList() { + this.loading = true; + optionProject().then(response => { + this.projectList = response.data; + this.loading = false; + }); + }, /** 查询流程表单列表 */ getList() { this.loading = true; diff --git a/ruoyi-ui/src/views/index.vue b/ruoyi-ui/src/views/index.vue index fc76bed..6ef18ca 100644 --- a/ruoyi-ui/src/views/index.vue +++ b/ruoyi-ui/src/views/index.vue @@ -14,25 +14,11 @@ -
-

人活着就是为了樱岛麻衣 (≧▽≦)

- -
-
- 更新日志 -
- - -
    -
  1. 单流程完善
  2. -
-
-
diff --git a/ruoyi-ui/src/views/system/project/index.vue b/ruoyi-ui/src/views/system/project/index.vue index 0dc82a6..91e21bf 100644 --- a/ruoyi-ui/src/views/system/project/index.vue +++ b/ruoyi-ui/src/views/system/project/index.vue @@ -1,6 +1,6 @@