add flow switch mode

3.x
smallchill 3 years ago
parent e0ef01bc84
commit 536a69b81c
  1. 5
      src/components/third-register/main.vue
  2. 5
      src/config/website.js
  3. 5
      src/mixins/index.js
  4. 31
      src/views/flow/manager.vue
  5. 41
      src/views/flow/model.vue
  6. 39
      src/views/work/claim.vue
  7. 37
      src/views/work/done.vue
  8. 3
      src/views/work/process/leave/detail.vue
  9. 6
      src/views/work/process/leave/form.vue
  10. 8
      src/views/work/process/leave/handle.vue
  11. 37
      src/views/work/send.vue
  12. 35
      src/views/work/start.vue
  13. 39
      src/views/work/todo.vue

@ -31,12 +31,13 @@
placeholder="请输入确认密码"></el-input> placeholder="请输入确认密码"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" <template #footer>
class="dialog-footer"> <span class="dialog-footer">
<el-button type="primary" <el-button type="primary"
:loading="loading" :loading="loading"
@click="handleRegister"> </el-button> @click="handleRegister"> </el-button>
</span> </span>
</template>
</el-dialog> </el-dialog>
</template> </template>

@ -45,7 +45,10 @@ export default {
href: 'path', href: 'path',
meta: 'meta' meta: 'meta'
}, },
// 流程设计器类型(true->nutflow,false->flowable)
designMode: false,
// 流程设计器地址(flowable模式)
designUrl: 'http://localhost:9999',
// 第三方系统授权地址 // 第三方系统授权地址
authUrl: 'http://localhost/blade-auth/oauth/render', authUrl: 'http://localhost/blade-auth/oauth/render',
// 报表设计器地址(cloud端口为8108,boot端口为80) // 报表设计器地址(cloud端口为8108,boot端口为80)

@ -10,6 +10,8 @@ export default {
}; };
}, },
created () { created () {
//加载工作流路由集
this.loadFlowRoutes();
//实时检测刷新token //实时检测刷新token
this.refreshToken(); this.refreshToken();
}, },
@ -37,6 +39,9 @@ export default {
}); });
} }
}, 1000); }, 1000);
},
loadFlowRoutes() {
this.$store.dispatch("FlowRoutes").then(() => {});
} }
} }
} }

@ -53,9 +53,29 @@
<el-tag>{{row.categoryName}}</el-tag> <el-tag>{{row.categoryName}}</el-tag>
</template> </template>
</avue-crud> </avue-crud>
<flow-design is-dialog <flow-design v-if="this.website.designMode" is-dialog v-model:is-display="flowBox" :process-definition-id="processDefinitionId"></flow-design>
v-model:is-display="flowBox" <el-dialog v-else title="流程图"
:process-definition-id="processDefinitionId"></flow-design> append-to-body
v-model="flowBox"
:fullscreen="true">
<iframe
:src=flowUrl
width="100%"
height="700"
title="流程图"
frameBorder="no"
border="0"
marginWidth="0"
marginHeight="0"
scrolling="no"
allowTransparency="yes">
</iframe>
<template #footer>
<span class="dialog-footer">
<el-button @click="flowBox = false"> </el-button>
</span>
</template>
</el-dialog>
<el-dialog title="流程变更" <el-dialog title="流程变更"
append-to-body append-to-body
v-model="stateBox" v-model="stateBox"
@ -107,6 +127,7 @@ export default {
}, },
processDefinitionId: '', processDefinitionId: '',
flowBox: false, flowBox: false,
flowUrl: '',
stateBox: false, stateBox: false,
flowState: '', flowState: '',
stateOptions: [{ stateOptions: [{
@ -306,7 +327,11 @@ export default {
}) })
}, },
handleImage (row) { handleImage (row) {
if (this.website.designMode) {
this.processDefinitionId = row.id; this.processDefinitionId = row.id;
} else {
this.flowUrl = `/blade-flow/process/resource-view?processDefinitionId=${row.id}`;
}
this.flowBox = true; this.flowBox = true;
}, },
currentChange (currentPage) { currentChange (currentPage) {

@ -56,7 +56,7 @@
<el-tag>v{{ row.version }}</el-tag> <el-tag>v{{ row.version }}</el-tag>
</template> </template>
</avue-crud> </avue-crud>
<el-dialog title="流程配置" <el-dialog v-if="this.website.designMode" title="流程配置"
append-to-body append-to-body
destroy-on-close destroy-on-close
v-model="flowBox" v-model="flowBox"
@ -89,6 +89,29 @@
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
<el-dialog v-else title="流程配置"
append-to-body
v-model="flowBox"
:fullscreen="true">
<iframe
:src=flowUrl
width="100%"
height="700"
title="流程设计器"
frameBorder="no"
border="0"
marginWidth="0"
marginHeight="0"
scrolling="no"
allowTransparency="yes">
</iframe>
<template #footer>
<span class="dialog-footer">
<el-button @click="flowBox = false"> </el-button>
<el-button type="primary" @click="handleRefresh"> </el-button>
</span>
</template>
</el-dialog>
<el-dialog title="流程部署" <el-dialog title="流程部署"
append-to-body append-to-body
v-model="deployBox" v-model="deployBox"
@ -198,6 +221,7 @@ export default {
}, },
deployBox: false, deployBox: false,
flowBox: false, flowBox: false,
flowUrl: '',
option: { option: {
height: 'auto', height: 'auto',
calcHeight: 32, calcHeight: 32,
@ -212,7 +236,7 @@ export default {
viewBtn: false, viewBtn: false,
delBtn: false, delBtn: false,
dialogWidth: 900, dialogWidth: 900,
menuWidth: 200, menuWidth: 220,
dialogClickModal: false, dialogClickModal: false,
size: 'mini', size: 'mini',
searchSize: 'mini', searchSize: 'mini',
@ -408,16 +432,27 @@ export default {
}); });
}, },
handleCreate () { handleCreate () {
if (!this.website.designMode) {
this.flowUrl = `${this.website.designUrl}/index.html`;
}
this.flowBox = true; this.flowBox = true;
}, },
handleRefresh() {
this.flowBox = false;
this.onLoad(this.page);
},
handleUpdate (row) { handleUpdate (row) {
if (this.website.designMode) {
detail({ id: row.id }).then(res => { detail({ id: row.id }).then(res => {
const data = res.data.data const data = res.data.data
const { modelEditorXml } = data const { modelEditorXml } = data
this.$set(this.nutflowOption.step1, 'xml', modelEditorXml) this.$set(this.nutflowOption.step1, 'xml', modelEditorXml)
this.$set(this.nutflowOption, 'process', data) this.$set(this.nutflowOption, 'process', data)
this.flowBox = true;
}) })
} else {
this.flowUrl = `${this.website.designUrl}/index.html#/editor/${row.id}`;
}
this.flowBox = true;
}, },
handleDeploy (row) { handleDeploy (row) {
this.deployBox = true; this.deployBox = true;

@ -21,7 +21,7 @@
</el-button> </el-button>
<el-button type="primary" <el-button type="primary"
text text
icon="el-icon-info" icon="el-icon-view"
v-if="permission.work_claim_detail" v-if="permission.work_claim_detail"
@click.stop="handleDetail(scope.row)">详情 @click.stop="handleDetail(scope.row)">详情
</el-button> </el-button>
@ -36,9 +36,29 @@
<el-tag>v{{row.processDefinitionVersion}}</el-tag> <el-tag>v{{row.processDefinitionVersion}}</el-tag>
</template> </template>
</avue-crud> </avue-crud>
<flow-design is-dialog <flow-design v-if="this.website.designMode" is-dialog v-model:is-display="flowBox" :process-instance-id="processInstanceId"></flow-design>
v-model:is-display="flowBox" <el-dialog v-else title="流程图"
:process-instance-id="processInstanceId"></flow-design> append-to-body
v-model="flowBox"
:fullscreen="true">
<iframe
:src=flowUrl
width="100%"
height="700"
title="流程图"
frameBorder="no"
border="0"
marginWidth="0"
marginHeight="0"
scrolling="no"
allowTransparency="yes">
</iframe>
<template #footer>
<span class="dialog-footer">
<el-button @click="flowBox = false"> </el-button>
</span>
</template>
</el-dialog>
</basic-container> </basic-container>
</template> </template>
@ -62,6 +82,7 @@ export default {
}, },
processInstanceId: '', processInstanceId: '',
flowBox: false, flowBox: false,
flowUrl: '',
workBox: false, workBox: false,
option: { option: {
height: 'auto', height: 'auto',
@ -78,7 +99,7 @@ export default {
viewBtn: false, viewBtn: false,
delBtn: false, delBtn: false,
dialogWidth: 900, dialogWidth: 900,
menuWidth: 200, menuWidth: 250,
dialogClickModal: false, dialogClickModal: false,
column: [ column: [
{ {
@ -95,7 +116,7 @@ export default {
prop: "category", prop: "category",
search: true, search: true,
hide: true, hide: true,
width: 85, width: 100,
}, },
{ {
label: '流程名称', label: '流程名称',
@ -115,7 +136,7 @@ export default {
{ {
label: '申请时间', label: '申请时间',
prop: 'createTime', prop: 'createTime',
width: 165, width: 180,
}, },
] ]
}, },
@ -171,7 +192,11 @@ export default {
this.$router.push({ path: `/work/process/${flowRoute(this.flowRoutes, row.category)}/detail/${row.processInstanceId}/${row.businessId}` }); this.$router.push({ path: `/work/process/${flowRoute(this.flowRoutes, row.category)}/detail/${row.processInstanceId}/${row.businessId}` });
}, },
handleImage (row) { handleImage (row) {
if (this.website.designMode) {
this.processInstanceId = row.processInstanceId; this.processInstanceId = row.processInstanceId;
} else {
this.flowUrl = `/api/blade-flow/process/diagram-view?processInstanceId=${row.processInstanceId}`;
}
this.flowBox = true; this.flowBox = true;
}, },
currentChange (currentPage) { currentChange (currentPage) {

@ -16,7 +16,7 @@
<template #menu="scope"> <template #menu="scope">
<el-button type="primary" <el-button type="primary"
text text
icon="el-icon-info" icon="el-icon-view"
v-if="permission.work_done_detail" v-if="permission.work_done_detail"
@click.stop="handleDetail(scope.row)">详情 @click.stop="handleDetail(scope.row)">详情
</el-button> </el-button>
@ -31,9 +31,29 @@
<el-tag>v{{row.processDefinitionVersion}}</el-tag> <el-tag>v{{row.processDefinitionVersion}}</el-tag>
</template> </template>
</avue-crud> </avue-crud>
<flow-design is-dialog <flow-design v-if="this.website.designMode" is-dialog v-model:is-display="flowBox" :process-instance-id="processInstanceId"></flow-design>
v-model:is-display="flowBox" <el-dialog v-else title="流程图"
:process-instance-id="processInstanceId"></flow-design> append-to-body
v-model="flowBox"
:fullscreen="true">
<iframe
:src=flowUrl
width="100%"
height="700"
title="流程图"
frameBorder="no"
border="0"
marginWidth="0"
marginHeight="0"
scrolling="no"
allowTransparency="yes">
</iframe>
<template #footer>
<span class="dialog-footer">
<el-button @click="flowBox = false"> </el-button>
</span>
</template>
</el-dialog>
</basic-container> </basic-container>
</template> </template>
@ -57,6 +77,7 @@ export default {
}, },
processInstanceId: '', processInstanceId: '',
flowBox: false, flowBox: false,
flowUrl: '',
workBox: false, workBox: false,
option: { option: {
height: 'auto', height: 'auto',
@ -72,7 +93,7 @@ export default {
viewBtn: false, viewBtn: false,
delBtn: false, delBtn: false,
dialogWidth: 900, dialogWidth: 900,
menuWidth: 150, menuWidth: 200,
dialogClickModal: false, dialogClickModal: false,
column: [ column: [
{ {
@ -109,7 +130,7 @@ export default {
{ {
label: '申请时间', label: '申请时间',
prop: 'createTime', prop: 'createTime',
width: 165, width: 180,
}, },
] ]
}, },
@ -148,7 +169,11 @@ export default {
this.$router.push({ path: `/work/process/${flowRoute(this.flowRoutes, row.category)}/detail/${row.processInstanceId}/${row.businessId}` }); this.$router.push({ path: `/work/process/${flowRoute(this.flowRoutes, row.category)}/detail/${row.processInstanceId}/${row.businessId}` });
}, },
handleImage (row) { handleImage (row) {
if (this.website.designMode) {
this.processInstanceId = row.processInstanceId; this.processInstanceId = row.processInstanceId;
} else {
this.flowUrl = `/api/blade-flow/process/diagram-view?processInstanceId=${row.processInstanceId}`;
}
this.flowBox = true; this.flowBox = true;
}, },
currentChange (currentPage) { currentChange (currentPage) {

@ -103,6 +103,9 @@ export default {
}, },
methods: { methods: {
init () { init () {
if (!this.website.designMode) {
this.src = `/blade-flow/process/diagram-view?processInstanceId=${this.$route.params.processInstanceId}&t=${new Date().getTime()}`;
}
this.processInstanceId = this.$route.params.processInstanceId; this.processInstanceId = this.$route.params.processInstanceId;
this.businessId = this.$route.params.businessId; this.businessId = this.$route.params.businessId;
historyFlowList(this.processInstanceId).then(res => { historyFlowList(this.processInstanceId).then(res => {

@ -5,7 +5,7 @@
v-model="form" v-model="form"
@submit="handleSubmit" /> @submit="handleSubmit" />
</basic-container> </basic-container>
<basic-container> <basic-container v-if="this.website.designMode">
<flow-design :is-display="true" <flow-design :is-display="true"
:process-definition-id="processDefinitionId"></flow-design> :process-definition-id="processDefinitionId"></flow-design>
</basic-container> </basic-container>
@ -23,7 +23,7 @@ export default {
option: { option: {
group: [ group: [
{ {
icon: 'el-icon-info', icon: 'el-icon-view',
label: '请假基础信息', label: '请假基础信息',
prop: 'group1', prop: 'group1',
column: [ column: [
@ -91,7 +91,9 @@ export default {
} }
}, },
created () { created () {
if (this.website.designMode) {
this.processDefinitionId = this.$route.params.processDefinitionId; this.processDefinitionId = this.$route.params.processDefinitionId;
}
}, },
methods: { methods: {
handleSubmit () { handleSubmit () {

@ -78,10 +78,13 @@
<span>流程跟踪</span> <span>流程跟踪</span>
</div> </div>
</template> </template>
<el-row class="row-bg"> <el-row v-if="this.website.designMode" class="row-bg">
<flow-design :is-display="true" <flow-design :is-display="true"
:process-instance-id="processInstanceId"></flow-design> :process-instance-id="processInstanceId"></flow-design>
</el-row> </el-row>
<el-row v-else type="flex" class="row-bg">
<img :src="src" alt="design">
</el-row>
</el-card> </el-card>
</el-form> </el-form>
</basic-container> </basic-container>
@ -125,6 +128,9 @@ export default {
}, },
methods: { methods: {
init () { init () {
if (!this.website.designMode) {
this.src = `/blade-flow/process/diagram-view?processInstanceId=${this.$route.params.processInstanceId}&t=${new Date().getTime()}`;
}
this.taskId = this.$route.params.taskId; this.taskId = this.$route.params.taskId;
this.processInstanceId = this.$route.params.processInstanceId; this.processInstanceId = this.$route.params.processInstanceId;
this.businessId = this.$route.params.businessId; this.businessId = this.$route.params.businessId;

@ -16,7 +16,7 @@
<template #menu="scope"> <template #menu="scope">
<el-button type="primary" <el-button type="primary"
text text
icon="el-icon-info" icon="el-icon-view"
v-if="permission.work_send_detail" v-if="permission.work_send_detail"
@click.stop="handleDetail(scope.row)">详情 @click.stop="handleDetail(scope.row)">详情
</el-button> </el-button>
@ -34,9 +34,29 @@
<el-tag>{{row.processIsFinished==='finished' ? '已完成' : '未完成'}}</el-tag> <el-tag>{{row.processIsFinished==='finished' ? '已完成' : '未完成'}}</el-tag>
</template> </template>
</avue-crud> </avue-crud>
<flow-design is-dialog <flow-design v-if="this.website.designMode" is-dialog v-model:is-display="flowBox" :process-instance-id="processInstanceId"></flow-design>
v-model:is-display="flowBox" <el-dialog v-else title="流程图"
:process-instance-id="processInstanceId"></flow-design> append-to-body
v-model="flowBox"
:fullscreen="true">
<iframe
:src=flowUrl
width="100%"
height="700"
title="流程图"
frameBorder="no"
border="0"
marginWidth="0"
marginHeight="0"
scrolling="no"
allowTransparency="yes">
</iframe>
<template #footer>
<span class="dialog-footer">
<el-button @click="flowBox = false"> </el-button>
</span>
</template>
</el-dialog>
</basic-container> </basic-container>
</template> </template>
@ -60,6 +80,7 @@ export default {
}, },
processInstanceId: '', processInstanceId: '',
flowBox: false, flowBox: false,
flowUrl: '',
workBox: false, workBox: false,
option: { option: {
height: 'auto', height: 'auto',
@ -75,7 +96,7 @@ export default {
viewBtn: false, viewBtn: false,
delBtn: false, delBtn: false,
dialogWidth: 900, dialogWidth: 900,
menuWidth: 150, menuWidth: 200,
dialogClickModal: false, dialogClickModal: false,
column: [ column: [
{ {
@ -118,7 +139,7 @@ export default {
{ {
label: '申请时间', label: '申请时间',
prop: 'createTime', prop: 'createTime',
width: 165, width: 180,
}, },
] ]
}, },
@ -157,7 +178,11 @@ export default {
this.$router.push({ path: `/work/process/${flowRoute(this.flowRoutes, row.category)}/detail/${row.processInstanceId}/${row.businessId}` }); this.$router.push({ path: `/work/process/${flowRoute(this.flowRoutes, row.category)}/detail/${row.processInstanceId}/${row.businessId}` });
}, },
handleImage (row) { handleImage (row) {
if (this.website.designMode) {
this.processInstanceId = row.processInstanceId; this.processInstanceId = row.processInstanceId;
} else {
this.flowUrl = `/api/blade-flow/process/diagram-view?processInstanceId=${row.processInstanceId}`;
}
this.flowBox = true; this.flowBox = true;
}, },
currentChange (currentPage) { currentChange (currentPage) {

@ -46,9 +46,29 @@
<el-tag>{{row.categoryName}}</el-tag> <el-tag>{{row.categoryName}}</el-tag>
</template> </template>
</avue-crud> </avue-crud>
<flow-design is-dialog <flow-design v-if="this.website.designMode" is-dialog v-model:is-display="flowBox" :process-definition-id="processDefinitionId"></flow-design>
v-model:is-display="flowBox" <el-dialog v-else title="流程图"
:process-definition-id="processDefinitionId"></flow-design> append-to-body
v-model="flowBox"
:fullscreen="true">
<iframe
:src=flowUrl
width="100%"
height="700"
title="流程图"
frameBorder="no"
border="0"
marginWidth="0"
marginHeight="0"
scrolling="no"
allowTransparency="yes">
</iframe>
<template #footer>
<span class="dialog-footer">
<el-button @click="flowBox = false"> </el-button>
</span>
</template>
</el-dialog>
</basic-container> </basic-container>
</template> </template>
@ -73,6 +93,7 @@ export default {
}, },
processDefinitionId: '', processDefinitionId: '',
flowBox: false, flowBox: false,
flowUrl: '',
workBox: false, workBox: false,
option: { option: {
height: 'auto', height: 'auto',
@ -87,7 +108,7 @@ export default {
addBtn: false, addBtn: false,
viewBtn: false, viewBtn: false,
delBtn: false, delBtn: false,
menuWidth: 150, menuWidth: 200,
dialogWidth: 900, dialogWidth: 900,
dialogClickModal: false, dialogClickModal: false,
column: [ column: [
@ -110,7 +131,7 @@ export default {
slot: true, slot: true,
prop: "category", prop: "category",
search: true, search: true,
width: 85, width: 100,
}, },
{ {
label: '流程标识', label: '流程标识',
@ -180,7 +201,11 @@ export default {
this.$router.push({ path: `/work/process/${flowRoute(this.flowRoutes, row.category)}/form/${row.id}` }); this.$router.push({ path: `/work/process/${flowRoute(this.flowRoutes, row.category)}/form/${row.id}` });
}, },
handleImage (row) { handleImage (row) {
if (this.website.designMode) {
this.processDefinitionId = row.id; this.processDefinitionId = row.id;
} else {
this.flowUrl = `/api/blade-flow/process/resource-view?processDefinitionId=${row.id}`;
}
this.flowBox = true; this.flowBox = true;
}, },
currentChange (currentPage) { currentChange (currentPage) {

@ -15,13 +15,13 @@
<template #menu="scope"> <template #menu="scope">
<el-button type="primary" <el-button type="primary"
text text
icon="el-icon-s-check" icon="el-icon-video-play"
v-if="permission.work_todo_handle" v-if="permission.work_todo_handle"
@click.stop="handleWork(scope.row)">处理 @click.stop="handleWork(scope.row)">处理
</el-button> </el-button>
<el-button type="primary" <el-button type="primary"
text text
icon="el-icon-info" icon="el-icon-view"
v-if="permission.work_todo_detail" v-if="permission.work_todo_detail"
@click.stop="handleDetail(scope.row)">详情 @click.stop="handleDetail(scope.row)">详情
</el-button> </el-button>
@ -36,9 +36,29 @@
<el-tag>v{{row.processDefinitionVersion}}</el-tag> <el-tag>v{{row.processDefinitionVersion}}</el-tag>
</template> </template>
</avue-crud> </avue-crud>
<flow-design is-dialog <flow-design v-if="this.website.designMode" is-dialog v-model:is-display="flowBox" :process-instance-id="processInstanceId"></flow-design>
v-model:is-display="flowBox" <el-dialog v-else title="流程图"
:process-instance-id="processInstanceId"></flow-design> append-to-body
v-model="flowBox"
:fullscreen="true">
<iframe
:src=flowUrl
width="100%"
height="700"
title="流程图"
frameBorder="no"
border="0"
marginWidth="0"
marginHeight="0"
scrolling="no"
allowTransparency="yes">
</iframe>
<template #footer>
<span class="dialog-footer">
<el-button @click="flowBox = false"> </el-button>
</span>
</template>
</el-dialog>
</basic-container> </basic-container>
</template> </template>
@ -62,6 +82,7 @@ export default {
}, },
processInstanceId: '', processInstanceId: '',
flowBox: false, flowBox: false,
flowUrl: '',
workBox: false, workBox: false,
option: { option: {
height: 'auto', height: 'auto',
@ -78,7 +99,7 @@ export default {
viewBtn: false, viewBtn: false,
delBtn: false, delBtn: false,
dialogWidth: 900, dialogWidth: 900,
menuWidth: 200, menuWidth: 250,
dialogClickModal: false, dialogClickModal: false,
column: [ column: [
{ {
@ -115,7 +136,7 @@ export default {
{ {
label: '申请时间', label: '申请时间',
prop: 'createTime', prop: 'createTime',
width: 165, width: 180,
}, },
] ]
}, },
@ -157,7 +178,11 @@ export default {
this.$router.push({ path: `/work/process/${flowRoute(this.flowRoutes, row.category)}/detail/${row.processInstanceId}/${row.businessId}` }); this.$router.push({ path: `/work/process/${flowRoute(this.flowRoutes, row.category)}/detail/${row.processInstanceId}/${row.businessId}` });
}, },
handleImage (row) { handleImage (row) {
if (this.website.designMode) {
this.processInstanceId = row.processInstanceId; this.processInstanceId = row.processInstanceId;
} else {
this.flowUrl = `/api/blade-flow/process/diagram-view?processInstanceId=${row.processInstanceId}`;
}
this.flowBox = true; this.flowBox = true;
}, },
currentChange (currentPage) { currentChange (currentPage) {

Loading…
Cancel
Save