From 31f4cb4c98684b3324399b5468d955919fc8de88 Mon Sep 17 00:00:00 2001 From: wangting <wangting@vci-tech.com> Date: 星期四, 16 一月 2025 10:41:03 +0800 Subject: [PATCH] 调整样式,修改流程模板定义 --- Source/plt-web/plt-web-ui/src/views/processTemplate/customDefine/index.vue | 123 ++++++++++++++++++++++++++++++++++------ 1 files changed, 104 insertions(+), 19 deletions(-) diff --git a/Source/plt-web/plt-web-ui/src/views/processTemplate/customDefine/index.vue b/Source/plt-web/plt-web-ui/src/views/processTemplate/customDefine/index.vue index 5e25bd7..35701d4 100644 --- a/Source/plt-web/plt-web-ui/src/views/processTemplate/customDefine/index.vue +++ b/Source/plt-web/plt-web-ui/src/views/processTemplate/customDefine/index.vue @@ -1,7 +1,7 @@ <template> <!--娴佺▼妯℃澘瀹氫箟--> <basic-container style="height: calc(100vh - 123px)"> - <div style="margin-bottom: 5px;"> + <div style="margin-bottom: 10px;"> 娴佺▼鍒嗙被锛� <el-select v-model="tempType" :clearable="true" placeholder="璇烽�夋嫨" size="small" style="width: 300px;margin-right: 20px;" @@ -77,22 +77,45 @@ </span> </el-button> </template> - </avue-crud> <!-- 鍒涘缓缂栬緫鑷畾涔夊璇濇 --> <el-dialog v-dialogDrag v-loading="dialogLoading" - :title="dialogType === 'add' ? ' 鍒涘缓' : '缂栬緫'" + title="娴佺▼鑷畾涔�" :visible.sync="dialogVisible" append-to-body="true" class="avue-dialog" - width="1000px" - @close="dialogClose" + :close-on-press-escape="false" + :fullscreen="true" + :before-close="handleNutflowClose" + custom-class="wf-dialog" > + <wf-design-base v-if="nutflowOption.step === 1" + class="animated fadeIn" + style="height: calc(100vh - 178px);" + ref="wf-design" + :options="nutflowOption.step1"></wf-design-base> + <wf-design-base v-if="nutflowOption.step === 2" + class="animated fadeIn" + style="height: calc(100vh - 178px);" + ref="wf-design-view" + :options="nutflowOption.step2"></wf-design-base> <span slot="footer" class="dialog-footer"> - <el-button size="small" type="primary" @click="saveHandler">纭� 瀹�</el-button> - <el-button size="small" @click="dialogClose">鍙� 娑�</el-button> + <el-button v-if="nutflowOption.step === 1" + size="small" + type="success" + @click="handleStep(1)">涓� 涓� 姝�</el-button> + <el-button v-if="nutflowOption.step === 2" + size="small" + type="success" + @click="handleStep(-1)">涓� 涓� 姝�</el-button> + <el-button v-if="nutflowOption.step === 2" + size="small" + type="primary" + @click="handleSubmitModel">纭� 瀹�</el-button> + <el-button size="small" + @click="handleNutflowClose(() => {}, true)">鍙� 娑�</el-button> </span> </el-dialog> <!-- 瀵煎叆 --> @@ -103,7 +126,7 @@ <el-main width="60%"> <div style="height: 100%;position: relative;"> - <flow-design style="padding-top: 5px" :is-display.sync="flowBox" :process-definition-id="processDefinitionId" height="calc(100vh - 190px)"></flow-design> + <flow-design style="padding-top: 5px" :is-display.sync="flowBox" :process-definition-id="processDefinitionId" height="calc(100vh - 195px)"></flow-design> <div style="position: absolute;top:0;left: 0;height: 100%;width: 100%"></div> </div> </el-main> @@ -138,6 +161,18 @@ dialogType:'add', processDefinitionId: '', flowBox: false, + nutflowOption: { + process: {}, + step: 1, + step1: { + toolbar: ['open', 'create', 'fit', 'zoom-in', 'zoom-out', 'undo', 'redo', 'import', 'preview'], + }, + step2: { + mode: 'view', + simulation: true, + minimap: true, + } + } } }, computed: { @@ -225,29 +260,75 @@ this.dialogVisible = true; this.dialogType = 'edit' }, - // 缂栬緫淇濆瓨 - saveHandler() { + //淇濆瓨娴佺▼閰嶇疆 + handleSubmitModel() { + const registry = this.$refs['wf-design-view'].getElementRegistry().getAll() + const {businessObject} = registry[0] + const {id, name, documentation} = businessObject + const description = (documentation && documentation.length > 0) ? documentation[0].text : null + const params = { + ...this.nutflowOption.process, + modelKey: id, + name, + description, + modelEditorXml: this.nutflowOption.process.xml + } if(this.dialogType=='add'){ - saveProcessTemp(this.form).then(res => { + saveProcessTemp(params).then(res => { if (res.data.code === 200) { this.$message.success(res.data.obj); this.getTableList(); + this.handleNutflowClose() } }); }else{ - updateProcessTemp(this.form).then(res => { + updateProcessTemp(params).then(res => { if (res.data.code === 200) { this.$message.success(res.data.obj); this.getTableList(); + this.handleNutflowClose() } }) } - }, - dialogClose(){ - this.form={}; - this.dialogLoading=false; - this.dialogVisible=false; + handleStep(step) { + if (step === 1) { // 涓嬩竴姝� + this.$refs['wf-design'].getData('xml').then(data => { + this.$set(this.nutflowOption.step1, 'xml', data) + this.$set(this.nutflowOption.step2, 'xml', data) + this.$set(this.nutflowOption.process, 'xml', data) + this.$set(this.nutflowOption, 'step', 2) + }) + } else { + this.$set(this.nutflowOption, 'step', 1) + } + }, + handleNutflowClose(done, flag) { + const initOption = { + process: {}, + step: 1, + step1: { + toolbar: ['open', 'create', 'fit', 'zoom-in', 'zoom-out', 'undo', 'redo', 'import', 'preview'], + }, + step2: { + mode: 'view', + simulation: true, + minimap: true, + } + } + if (done || flag) { + this.$confirm('纭畾瑕佸叧闂悧锛熷叧闂湭淇濆瓨鐨勪慨鏀归兘浼氫涪澶便��', '璀﹀憡', { + type: 'warning' + }).then(() => { + this.$set(this, 'nutflowOption', initOption) + if (typeof done == 'function') done() + this.dialogVisible = false + }).catch(() => { + }) + } else { + this.$set(this, 'nutflowOption', initOption) + this.dialogVisible = false + } }, // 鍒犻櫎 handleDel(row,index) { @@ -340,6 +421,10 @@ } </script> -<style scoped> - +<style lang="scss" scoped> +::v-deep { + .avue-dialog .el-dialog__body{ + margin-bottom: 0 !important; + } +} </style> -- Gitblit v1.9.3