|
@@ -1,19 +1,59 @@
|
|
|
<template>
|
|
|
<el-collapse-item name="element-async-continuations">
|
|
|
<template #title>
|
|
|
- <collapse-title title="异步属性">
|
|
|
+ <collapse-title title="异步任务">
|
|
|
<lucide-icon name="Shuffle" />
|
|
|
</collapse-title>
|
|
|
</template>
|
|
|
- <edit-item label="执行前" :label-width="120">
|
|
|
- <el-switch v-model="acBefore" @change="updateElementACBefore" />
|
|
|
+ <edit-item label="执行时机" :label-width="100">
|
|
|
+ <el-switch
|
|
|
+ v-model="acBefore"
|
|
|
+ active-text="节点前"
|
|
|
+ inactive-text="节点后"
|
|
|
+ @change="updateElementACBefore"
|
|
|
+ />
|
|
|
</edit-item>
|
|
|
- <edit-item label="执行后" :label-width="120">
|
|
|
- <el-switch v-model="acAfter" @change="updateElementACAfter" />
|
|
|
+ <edit-item label="任务行业" :label-width="100">
|
|
|
+ <el-select
|
|
|
+ v-model="asyncIndustryType"
|
|
|
+ value-key="value"
|
|
|
+ placeholder="请选择行业类型"
|
|
|
+ filterable
|
|
|
+ @change="updateAsyncIndustryType"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="{ label, value } in dict.type.industry_type"
|
|
|
+ :label="label"
|
|
|
+ :value="value"
|
|
|
+ :key="value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</edit-item>
|
|
|
- <edit-item v-if="showExclusive" label="可跳过" :label-width="120">
|
|
|
- <el-switch v-model="acExclusive" @change="updateElementACExclusive" />
|
|
|
+ <edit-item label="选择任务" :label-width="100">
|
|
|
+ <el-select
|
|
|
+ v-model="asyncScriptKey"
|
|
|
+ :disabled="!asyncIndustryType"
|
|
|
+ value-key="value"
|
|
|
+ placeholder="请选择执行任务"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ @change="updateAsyncScriptKey"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="{ value, label } in scriptList"
|
|
|
+ :key="value"
|
|
|
+ :label="label"
|
|
|
+ :value="value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</edit-item>
|
|
|
+ <!-- <edit-item label="执行后" :label-width="120">
|
|
|
+ <el-switch v-model="acAfter" @change="updateElementACAfter" />
|
|
|
+ </edit-item> -->
|
|
|
+ <!-- <edit-item v-if="showExclusive" label="可跳过" :label-width="120">
|
|
|
+ <el-switch v-model="acExclusive" @change="updateElementACExclusive" />
|
|
|
+ </edit-item> -->
|
|
|
</el-collapse-item>
|
|
|
</template>
|
|
|
|
|
@@ -25,17 +65,27 @@ import {
|
|
|
setACAfter,
|
|
|
setACBefore,
|
|
|
setACExclusive,
|
|
|
+ getAsyncScriptKey,
|
|
|
+ setAsyncScriptKey,
|
|
|
+ getAsyncIndustryType,
|
|
|
+ setAsyncIndustryType,
|
|
|
} from "@packages/bo-utils/asynchronousContinuationsUtil";
|
|
|
import EventEmitter from "@utils/EventEmitter";
|
|
|
import { getActive } from "@packages/bpmn-utils/BpmnDesignerUtils";
|
|
|
+import { listScript } from "@/api/bpmprocess/process";
|
|
|
|
|
|
export default {
|
|
|
name: "ElementAsyncContinuations",
|
|
|
+ dicts: ["industry_type"],
|
|
|
data() {
|
|
|
return {
|
|
|
- acBefore: false,
|
|
|
+ acBefore: true,
|
|
|
acAfter: false,
|
|
|
acExclusive: false,
|
|
|
+ scriptList: [],
|
|
|
+ asyncIndustryType: "",
|
|
|
+ asyncScriptKey: "",
|
|
|
+ scriptTriggerType: "2",
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -50,8 +100,16 @@ export default {
|
|
|
methods: {
|
|
|
reloadACStatus() {
|
|
|
this.acBefore = getACBefore(getActive());
|
|
|
- this.acAfter = getACAfter(getActive());
|
|
|
- this.acExclusive = getACExclusive(getActive());
|
|
|
+ // this.acAfter = getACAfter(getActive());
|
|
|
+ // this.acExclusive = getACExclusive(getActive());
|
|
|
+ // 脚本数据
|
|
|
+ if (!getAsyncIndustryType(getActive())) {
|
|
|
+ this.updateAsyncIndustryType(this.dict.type.industry_type[0]?.value);
|
|
|
+ } else {
|
|
|
+ this.getScriptList(getAsyncIndustryType(getActive()));
|
|
|
+ }
|
|
|
+ this.asyncIndustryType = getAsyncIndustryType(getActive());
|
|
|
+ this.asyncScriptKey = getAsyncScriptKey(getActive());
|
|
|
},
|
|
|
updateElementACBefore(value) {
|
|
|
setACBefore(getActive(), value);
|
|
@@ -65,11 +123,29 @@ export default {
|
|
|
setACExclusive(getActive(), value);
|
|
|
this.reloadACStatus();
|
|
|
},
|
|
|
+ updateAsyncScriptKey(value) {
|
|
|
+ setAsyncScriptKey(getActive(), value);
|
|
|
+ },
|
|
|
+ updateAsyncIndustryType(value) {
|
|
|
+ setAsyncIndustryType(getActive(), value);
|
|
|
+ this.getScriptList(value);
|
|
|
+ this.asyncScriptKey = "";
|
|
|
+ },
|
|
|
+ async getScriptList(industryType) {
|
|
|
+ let res = await listScript({
|
|
|
+ isEnablePaging: false,
|
|
|
+ industryType,
|
|
|
+ });
|
|
|
+ this.scriptList = res.rows.map((item) => ({
|
|
|
+ value: item.scriptKey,
|
|
|
+ label: item.scriptName,
|
|
|
+ }));
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
<style scoped lang="scss">
|
|
|
-::v-deep .edit-item_label{
|
|
|
+::v-deep .edit-item_label {
|
|
|
width: 70px !important;
|
|
|
}
|
|
|
</style>
|