From 5a98e5f9ce50bb5de56a54cae14e5ea49fbe2c07 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期一, 17 三月 2025 16:19:29 +0800 Subject: [PATCH] 更新流程实现 --- src/components/Process/index.vue | 40 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 40 insertions(+), 0 deletions(-) diff --git a/src/components/Process/index.vue b/src/components/Process/index.vue index 56e62f3..290cb9b 100644 --- a/src/components/Process/index.vue +++ b/src/components/Process/index.vue @@ -39,6 +39,7 @@ <el-button size="mini" icon="el-icon-download" @click="saveXML(true)">涓嬭浇xml</el-button> <el-button size="mini" icon="el-icon-picture" @click="saveImg('svg', true)">涓嬭浇svg</el-button> <el-button size="mini" type="primary" @click="save">淇濆瓨妯″瀷</el-button> + <el-button size="mini" type="warning" @click="update">鏇存柊妯″瀷</el-button> <el-button size="mini" type="danger" @click="goBack">鍏抽棴</el-button> </el-button-group> </div> @@ -68,6 +69,7 @@ // 寮曞叆flowable鐨勮妭鐐规枃浠� import FlowableModule from './flowable/flowable.json' import customControlsModule from './customPanel' +import {taskWait} from "@/api/projectProcess/projectProcess"; export default { name: "BpmnModel", components: {Designer}, @@ -256,6 +258,39 @@ this.goBack(); }, + update() { + this.$prompt('鏇存柊娴佺▼涓嶄細浜х敓鏂扮増鏈紝閲嶈鐨勬槸浣犱笉鑳戒慨鏀规祦绋嬫帹杩涗腑宸茬粡鎵ц杩囩殑浠诲姟鑺傜偣锛屽惁鍒欎細寮曡捣鏁版嵁闂锛侊紒锛�<span style="color: red">璇峰湪涓嬫柟杈撳叆锛氭垜宸茬煡鏅�</span>', '鏇存柊娴佺▼', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning', + customClass: 'updateC', + dangerouslyUseHTMLString: true, + inputType: 'textarea', + inputValidator: (value) => { + if (!value || value.trim() === '') { + return "璇疯緭鍏ワ細鎴戝凡鐭ユ檽" + } + if (value !== "鎴戝凡鐭ユ檽") { + return "杈撳叆閿欒锛岃杈撳叆锛氭垜宸茬煡鏅�" + } + return true + }, + inputErrorMessage: '璇疯緭鍏ワ細鎴戝凡鐭ユ檽' + }).then(async ({value}) => { + const process = this.getProcess() + const xml = await this.saveXML() + const svg = await this.saveImg() + const result = {process, xml, svg} + this.$emit('update', result) + window.parent.postMessage(result, '*') + }).catch(() => { + this.$message({ + type: 'info', + message: '宸插彇娑堟搷浣�' + }); + }); + }, + // 鎵撳紑娴佺▼鏂囦欢 openBpmn(file) { const reader = new FileReader() @@ -348,5 +383,10 @@ width: 100%; margin: 0 0 5px; } + +} + +.updateC { + width: 500px; } </style> -- Gitblit v1.8.0