Browse Source

feat: 子流程预览 100%

luoyali 1 year ago
parent
commit
86ac0400eb
1 changed files with 12 additions and 1 deletions
  1. 12 1
      src/components/scWorkflow/nodes/subProcess.vue

+ 12 - 1
src/components/scWorkflow/nodes/subProcess.vue

@@ -64,7 +64,7 @@
 								<el-option v-for="item in options" :key="item.id" :label="item.processName" :value="item.id" />
 							</el-select>
 
-							<el-link :underline="false"
+							<el-link :underline="false" @click="openViewEv"
 								><el-icon class="el-icon--right"><View /></el-icon> 预览子流程</el-link
 							>
 						</div>
@@ -225,6 +225,17 @@ export default {
 		async getProcessDetail(id) {
 			const { processId, processName } = await process.processDetailApi(id)
 			this.options = [{ id: processId, processName }]
+		},
+		openViewEv() {
+			const id = this.form.subProcessValue
+			if (!id) {
+				ElMessage.error('您还没有选择需要预览的子流程')
+				return false
+			}
+			const { origin, hash } = window.location
+			const hashFlag = hash.indexOf('#') !== -1 // 路由是hash模式
+			const jumpRouterUrl = `${origin}/${hashFlag ? '#' : ''}/flow_create/child?id=${id}`
+			window.open(jumpRouterUrl)
 		}
 	},
 	computed: {