发起流程改成弹框

menu_style
zhangdi 3 months ago
parent 629df82efe
commit 19615cc3cf
  1. 20
      src/views/plugin/workflow/pages/external/zdtest/start.vue
  2. 89
      src/views/plugin/workflow/pages/process/start.vue

@ -75,11 +75,31 @@ export default {
NfExamineForm, NfExamineForm,
}, },
mixins: [exForm, draft], mixins: [exForm, draft],
props:{
processId:{
type:String,
default:''
}
},
watch: { watch: {
processId:{
handler(val) {
if (val) {
console.log(8888,val)
// const param = JSON.parse(window.atob(val));
// console.log('',param)
// const { val, processDefKey, params } = param;
if (val) this.getForm(val, '');
this.params = {processId:val};
}
},
immediate: true,
},
'$route.query.p': { '$route.query.p': {
handler(val) { handler(val) {
if (val) { if (val) {
const param = JSON.parse(window.atob(val)); const param = JSON.parse(window.atob(val));
console.log('解析数据',param)
const { processId, processDefKey, params } = param; const { processId, processDefKey, params } = param;
if (processId || processDefKey) this.getForm(processId, processDefKey); if (processId || processDefKey) this.getForm(processId, processDefKey);
if (params) this.params = params; if (params) this.params = params;

@ -1,22 +1,10 @@
<template> <template>
<nf-container v-if="moduleLoadInit"> <nf-container v-if="moduleLoadInit">
<nf-crud <nf-crud :option="option" :table-loading="loading" :data="data" v-model:page="page" :permission="permissionList"
:option="option" v-model="form" @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
:table-loading="loading" @current-change="currentChange" @size-change="sizeChange" @refresh-change="onLoad(page, query)"
:data="data" @tree-node-click="nodeClick" @tree-node-load="findObject(option.column, 'category').dicData = $event"
v-model:page="page" @on-load="onLoad">
:permission="permissionList"
v-model="form"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="onLoad(page, query)"
@tree-node-click="nodeClick"
@tree-node-load="findObject(option.column, 'category').dicData = $event"
@on-load="onLoad"
>
<template #menu-left v-if="isDev"> <template #menu-left v-if="isDev">
<el-tag type="warning" effect="dark" size="default"> <el-tag type="warning" effect="dark" size="default">
<i class="el-icon-warning"></i> <i class="el-icon-warning"></i>
@ -47,23 +35,12 @@
</template> </template>
</nf-crud> </nf-crud>
<!-- 发起弹框 --> <!-- 发起弹框 -->
<el-dialog <el-dialog v-model="sendvisble" v-if="sendvisble" append-to-body destroy-on-close title="发起" width="70%"
v-model="sendvisble" class="nf-dialog">
append-to-body <nf-form-start ref="form-start" :props="startProps" />
destroy-on-close <component :is="currentComponent" v-bind="currentProps"></component>
title="发起" </el-dialog>
width="70%" <el-dialog v-model="bpmnVisible" append-to-body destroy-on-close title="流程图" width="70%" class="nf-dialog">
class="nf-dialog"
>
</el-dialog>
<el-dialog
v-model="bpmnVisible"
append-to-body
destroy-on-close
title="流程图"
width="70%"
class="nf-dialog"
>
<nf-design ref="bpmn" style="height: 60vh" :options="bpmnOption"></nf-design> <nf-design ref="bpmn" style="height: 60vh" :options="bpmnOption"></nf-design>
</el-dialog> </el-dialog>
</nf-container> </nf-container>
@ -71,11 +48,13 @@
<script> <script>
import { processList as getList, getXmlByProcessDefId } from '../../api/process/process'; import { processList as getList, getXmlByProcessDefId } from '../../api/process/process';
import NfFormStart from '../../components/nf-form-start/index.vue';
import exForm from '../../mixins/ex-form'; import exForm from '../../mixins/ex-form';
import { fromBase64 } from 'js-base64';
export default { export default {
mixins: [exForm], mixins: [exForm],
components: { NfFormStart },
data() { data() {
return { return {
form: {}, form: {},
@ -86,6 +65,11 @@ export default {
currentPage: 1, currentPage: 1,
total: 0, total: 0,
}, },
startProps: {
processDefId: '',
processDefKey: '',
params: {},
},
selectionList: [], selectionList: [],
option: { option: {
treeOption: { treeOption: {
@ -163,7 +147,8 @@ export default {
data: [], data: [],
bpmnVisible: false, bpmnVisible: false,
bpmnOption: {}, bpmnOption: {},
sendvisble:false,// sendvisble: false,//
currentComponent: null,
}; };
}, },
computed: { computed: {
@ -187,6 +172,38 @@ export default {
}, },
}, },
methods: { methods: {
dynamicDialog(row) {
this.sendvisble = true
console.log(8888, row)
if (row.name == '内置') {
this.startProps = {
processDefId: row.id,
processDefKey: row.key,
processId: row.id,
}
this.$nextTick(() => {
this.$refs['form-start'].show();
})
} else {
let url = row.formKey.substring(6)
import(`../external/${url}/start.vue`).then(module => {
this.currentComponent = module.default
this.currentProps = {
processDefId: row.id,
processDefKey: row.key,
processId: row.id,
}
// 使module.default
// this.$mount(module.default); // DOM
});
}
},
handleFlow(row) { handleFlow(row) {
getXmlByProcessDefId({ processDefId: row.id }).then(res => { getXmlByProcessDefId({ processDefId: row.id }).then(res => {
const xml = res.data.data; const xml = res.data.data;

Loading…
Cancel
Save