From 18c43123b51a1688ab4ae01fe3d171c7d92e619b Mon Sep 17 00:00:00 2001 From: wangting <wangting@vci-tech.com> Date: 星期四, 16 一月 2025 18:19:34 +0800 Subject: [PATCH] 1、调整会话过期提示 2、流程设计器隐藏拓展按钮,隐藏右下角图标 --- Source/plt-web/plt-web-ui/src/views/processTemplate/customDefine/index.vue | 355 +++++++++++++++++++++++++++++++++++++++++------------------ 1 files changed, 246 insertions(+), 109 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 b8a8c09..f749798 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,16 +1,16 @@ <template> <!--娴佺▼妯℃澘瀹氫箟--> - <basic-container> - <div> + <basic-container style="height: calc(100vh - 123px)"> + <div style="margin-bottom: 10px;"> 娴佺▼鍒嗙被锛� <el-select v-model="tempType" :clearable="true" placeholder="璇烽�夋嫨" size="small" style="width: 300px;margin-right: 20px;" @change="tempTypeChange"> <el-option v-for="item in tempTypeData" - :key="item.oid" + :key="item.id" :label="item.name" - :value="item.oid"> + :value="item.id"> </el-option> </el-select> 娴佺▼妯℃澘鍚嶇О锛� @@ -20,87 +20,117 @@ 鏌ヨ </el-button> </div> - <div> - <el-main> - <avue-crud - ref="userCrud" - :data="tableData" - :option="option" - :table-loading="tableLoading" - @on-load="getTableList" - @refresh-change="getTableList" - @selection-change="selectionChange" - @row-click="rowClickHandler" - > - <template slot="menuLeft" slot-scope="scope"> - <el-button v-if="permissionList.addBtn" class="button-custom-icon" plain size="small" type="primary" - @click="addHandler"> - <icon-show :name="permissionList.addBtn.source"></icon-show> - 澧炲姞 - </el-button> - <el-button v-if="permissionList.downloadImportTemplateBtn" class="button-custom-icon" plain size="small" - type="primary" @click="downloadTemplateHandler"> - <icon-show :name="permissionList.downloadImportTemplateBtn.source"></icon-show> - 涓嬭浇瀵煎叆妯℃澘 - </el-button> - <el-button v-if="permissionList.importBtn" class="button-custom-icon" plain size="small" type="primary" - @click="uploadHandler"> - <icon-show :name="permissionList.importBtn.source"></icon-show> - 瀵煎叆 - </el-button> - <el-button v-if="permissionList.exportBtn" class="button-custom-icon" plain size="small" type="primary" - @click="downloadHandler"> - <icon-show :name="permissionList.exportBtn.source"></icon-show> - 瀵煎嚭 - </el-button> - </template> + <el-container style="height: calc(100% - 100px)"> + <el-aside style="width: 40%;min-width: 500px;margin-right: 5px;"> + <avue-crud + ref="crud" + :data="tableData" + :option="option" + :table-loading="tableLoading" + @on-load="getTableList" + @refresh-change="getTableList" + @selection-change="selectionChange" + @row-click="rowClickHandler" + > + <template slot="menuLeft" slot-scope="scope"> + <el-button v-if="permissionList.addBtn" class="button-custom-icon" plain size="small" type="primary" + @click="handlerAdd"> + <icon-show :name="permissionList.addBtn.source"></icon-show> + 澧炲姞 + </el-button> + <el-button v-if="permissionList.downloadImportTemplateBtn" class="button-custom-icon" plain size="small" + type="primary" @click="downloadTemplateHandler"> + <icon-show :name="permissionList.downloadImportTemplateBtn.source"></icon-show> + 涓嬭浇瀵煎叆妯℃澘 + </el-button> + <el-button v-if="permissionList.importBtn" class="button-custom-icon" plain size="small" type="primary" + @click="uploadHandler"> + <icon-show :name="permissionList.importBtn.source"></icon-show> + 瀵煎叆 + </el-button> + <el-button v-if="permissionList.exportBtn" class="button-custom-icon" plain size="small" type="primary" + @click="downloadHandler"> + <icon-show :name="permissionList.exportBtn.source"></icon-show> + 瀵煎嚭 + </el-button> + </template> - <template slot="menu" slot-scope="scope"> - <el-button v-if="permissionList.editBtn" size="small" type="text" - @click="editBtnClick(scope.row)"> - <icon-show :name="permissionList.editBtn.source"></icon-show> - 缂栬緫 - </el-button> - <el-button v-if="permissionList.delBtn" size="small" type="text" - @click="rowDeleteHandler(scope.row)"> - <icon-show :name="permissionList.delBtn.source"></icon-show> - 鍒犻櫎 - </el-button> - <el-button size="small" type="text" @click.stop="stopUserHandler(scope.row)"> + <template slot="menu" slot-scope="scope"> + <el-button v-if="permissionList.editBtn" size="small" type="text" + @click="handleEdit(scope.row)"> + <icon-show :name="permissionList.editBtn.source"></icon-show> + 缂栬緫 + </el-button> + <el-button v-if="permissionList.delBtn" size="small" type="text" + @click="handleDel(scope.row)"> + <icon-show :name="permissionList.delBtn.source"></icon-show> + 鍒犻櫎 + </el-button> + <el-button size="small" type="text" @click.stop="stopHandler(scope.row)"> <span v-if="scope.row.status === 0 && permissionList.stopBtn" style="color: #fa3434;display: flex"> <icon-show :name="permissionList.stopBtn.source"></icon-show> 鍋滅敤 </span> - <span v-if="scope.row.status === 1 && permissionList.actionBtn" style="color: #55b61d;display: flex"> + <span v-if="scope.row.status === 1 && permissionList.actionBtn" style="color: #55b61d;display: flex"> <icon-show :name="permissionList.actionBtn.source"></icon-show> 鍚敤 </span> - </el-button> - </template> - - </avue-crud> - <!-- 鍒涘缓缂栬緫鑷畾涔夊璇濇 --> - <el-dialog - v-dialogDrag - v-loading="dialogLoading" - :title="dialogType === 'add' ? ' 鍒涘缓' : '缂栬緫'" - :visible.sync="dialogVisible" - append-to-body="true" - class="avue-dialog" - width="1000px" - @close="dialogClose" - > + </el-button> + </template> + </avue-crud> + <!-- 鍒涘缓缂栬緫鑷畾涔夊璇濇 --> + <el-dialog + v-dialogDrag + v-loading="dialogLoading" + title="娴佺▼鑷畾涔�" + :visible.sync="dialogVisible" + append-to-body="true" + class="avue-dialog" + :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="rowSaveHandler">纭� 瀹�</el-button> - <el-button size="small" @click="dialogVisible = false">鍙� 娑�</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> - </el-main> + </el-dialog> + <!-- 瀵煎叆 --> + <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="瀵煎叆娴佺▼妯℃澘" + @updata="getTableList"></upload-file> - <el-aside width="35%"> - <div></div> </el-aside> - </div> + + <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 - 195px)"></flow-design> + <div style="position: absolute;top:0;left: 0;height: 100%;width: 100%"></div> + </div> + </el-main> + </el-container> </basic-container> </template> @@ -108,7 +138,7 @@ import {mapGetters} from "vuex"; import basicOption from "@/util/basic-option"; import {getTypeList} from "@/api/processTemplate/type"; -import {getProcessTempList,saveProcessTemp,updateProcessTemp,deleteProcessTemp,downloadTemplate,download} from "@/api/processTemplate/define"; +import {getProcessTempList,detail,saveProcessTemp,updateProcessTemp,deleteProcessTemp,downloadTemplate,download,stopProcessTemp} from "@/api/processTemplate/define"; import func from "@/util/func"; export default { @@ -123,6 +153,26 @@ tableData: [], currentRow:null, selectionList: [], + upFileType: ['xls', 'xlsx'], + fileUrl: 'api/userQueryController/importUser', + tipList:[], + dialogLoading:false, + dialogVisible:false, + dialogType:'add', + processDefinitionId: '', + flowBox: false, + nutflowOption: { + process: {}, + step: 1, + step1: { + toolbar: ['open', 'create', 'fit', 'zoom-in', 'zoom-out', 'undo', 'redo',/*'download-xml',*/ 'import', 'preview'], + }, + step2: { + mode: 'view', + simulation: true, + minimap: true, + } + } } }, computed: { @@ -152,10 +202,13 @@ addBtn:false, editBtn:false, delBtn:false, - calcHeight: -60, + columnBtn:false, + gridBtn:false, + width:500, + calcHeight: -50, align:'left', headerAlign:'center', - menuWidth:160, + menuWidth:190, dialogMenuPosition: 'right', dialogWidth:600, column: [ @@ -164,10 +217,12 @@ prop: 'name' },{ label: '鐗堟湰', - prop: 'desc' + prop: 'desc', + width:50 },{ label: '鐘舵��', - prop: 'status' + prop: 'status', + width:65 }] } } @@ -192,36 +247,93 @@ searchData(){ this.getTableList(); }, - // 鏂板 - saveHandler(row, done, loading) { - saveProcessTemp(row).then(res => { - if (res.data.code === 200) { - this.$message.success(res.data.obj); - this.getTableList(); - done(); + + handlerAdd(){ + this.form={}; + this.dialogVisible=true; + this.dialogType='add' + }, + handleEdit(row,index) { + //detail({id: row.id}).then(res => { + const data = {businessObject:{}}//res.data.data + const {modelEditorXml} = data + data.id='leave'; + this.$set(this.nutflowOption.step1, 'xml', modelEditorXml) + this.$set(this.nutflowOption, 'process', data) + this.dialogVisible = true; + this.dialogType = 'edit' + //}) + }, + //淇濆瓨娴佺▼閰嶇疆 + 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(params).then(res => { + if (res.data.code === 200) { + this.$message.success(res.data.obj); + this.getTableList(); + this.handleNutflowClose() + } + }); + }else{ + updateProcessTemp(params).then(res => { + if (res.data.code === 200) { + this.$message.success(res.data.obj); + this.getTableList(); + this.handleNutflowClose() + } + }) + } + }, + 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, } - }).catch(err => { - loading() - }); + } + 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 + } }, - - handleEdit(row,index){ - this.$refs.crud.rowEdit(row, index); - }, - - // 缂栬緫 - updateHandler(row, index, done, loading) { - updateProcessTemp(row).then(res => { - if (res.data.code === 200) { - this.$message.success(res.data.obj); - this.getTableList(); - done() - } - }).catch(err => { - loading() - }); - }, - // 鍒犻櫎 handleDel(row,index) { let params = { @@ -265,6 +377,9 @@ this.selectionList = [row]; } ); + //鏄剧ず娴佺▼鍥� + this.processDefinitionId = row.id; + this.flowBox = true; }, // 瀵煎嚭 @@ -293,11 +408,33 @@ //瀵煎叆 uploadHandler() { this.$refs.upload.visible = true; - } + }, + // 鍋滅敤鍚敤 + stopHandler(row) { + let params = {}; + params = { + ids: row.oid, + flag: row.status === 0 ? true : false + } + stopProcessTemp(params).then(res => { + this.$message.success(res.data.obj); + this.getTableList(); + }); + }, } } </script> -<style scoped> - +<style lang="scss" scoped> +::v-deep { + .avue-dialog .el-dialog__body{ + margin-bottom: 0 !important; + } +} +</style> +<style> + /**闅愬眰璁捐鍣ㄤ腑鍙充笅瑙掑浘鏍�**/ + a.bjs-powered-by{ + display: none; + } </style> -- Gitblit v1.9.3