流程绑定表单可以选到历史表单
流程命名规则增加流程变量且流程变量可从表单赋值
This commit is contained in:
@ -133,6 +133,7 @@ export enum OperationType {
|
|||||||
VALUE = 0, //值
|
VALUE = 0, //值
|
||||||
VARIABLE, //变量
|
VARIABLE, //变量
|
||||||
API, //APi
|
API, //APi
|
||||||
|
FORM_DATA, //表单数据
|
||||||
}
|
}
|
||||||
|
|
||||||
// 按钮类型
|
// 按钮类型
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
import { InfoId } from './bpmnConfig';
|
import { InfoId } from './bpmnConfig';
|
||||||
import { FormConfigItem, formInitConfig, FormSettingItem } from './formSetting';
|
import { FormConfigItem, formInitConfig, FormSettingItem } from './formSetting';
|
||||||
import { CountersignConfig, MemberConfig } from './memberSetting';
|
import { CountersignConfig, MemberConfig } from './memberSetting';
|
||||||
import { AssignmentConfig, TimeOutConfig } from './ParamSetting';
|
import {AssignmentConfig, FormAssignmentSourceConfig, TimeOutConfig} from './ParamSetting';
|
||||||
import { ApiConfig } from '/@/components/ApiConfig/src/interface';
|
import { ApiConfig } from '/@/components/ApiConfig/src/interface';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@ -115,6 +115,8 @@ export interface ProcessParameter {
|
|||||||
type: OperationType;
|
type: OperationType;
|
||||||
value: string;
|
value: string;
|
||||||
apiConfig: ApiConfig;
|
apiConfig: ApiConfig;
|
||||||
|
|
||||||
|
formConfig: FormAssignmentSourceConfig; // 如果type === 表单数据 存储表单配置
|
||||||
}
|
}
|
||||||
// 输入参数
|
// 输入参数
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-tree-select
|
<a-tree-select
|
||||||
:value="props.target.key"
|
:value="props.target?.key"
|
||||||
autoExpandParent
|
autoExpandParent
|
||||||
treeDefaultExpandAll
|
treeDefaultExpandAll
|
||||||
:tree-data="props.formSettingTree"
|
:tree-data="props.formSettingTree"
|
||||||
@ -28,7 +28,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
function changeTarget(value, node) {
|
function changeTarget(value, node) {
|
||||||
let target = props.target;
|
let target = props.target||{};
|
||||||
target.formId = node.formId;
|
target.formId = node.formId;
|
||||||
target.key = value;
|
target.key = value;
|
||||||
target.formField = node.formField;
|
target.formField = node.formField;
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
<a-button type="primary" @click="add">{{ t('添加') }}</a-button>
|
<a-button type="primary" @click="add">{{ t('添加') }}</a-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<span>(在流程开始节点开始、用户节点结束、脚本节点结束事件中赋值)</span>
|
||||||
<div class="list">
|
<div class="list">
|
||||||
<div class="row head">
|
<div class="row head">
|
||||||
<span class="source">{{ t('赋值来源') }}</span>
|
<span class="source">{{ t('赋值来源') }}</span>
|
||||||
|
|||||||
@ -57,6 +57,11 @@
|
|||||||
v-model="record.apiConfig"
|
v-model="record.apiConfig"
|
||||||
:need-hide-components="true"
|
:need-hide-components="true"
|
||||||
/>
|
/>
|
||||||
|
<FormTargetItem
|
||||||
|
v-if="record.type == OperationType.FORM_DATA"
|
||||||
|
v-model:target="record.formConfig"
|
||||||
|
:formSettingTree="formTree"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'operation'">
|
<template v-if="column.key === 'operation'">
|
||||||
<a-popconfirm @confirm="deleteItem(index)">
|
<a-popconfirm @confirm="deleteItem(index)">
|
||||||
@ -80,6 +85,7 @@
|
|||||||
import Icon from '/@/components/Icon/index';
|
import Icon from '/@/components/Icon/index';
|
||||||
//import ScriptApiSelect from '/@bpmn/components/arguments/ApiSelect.vue'; //之前是调的这个,现在换成ScriptApiSelect.vue
|
//import ScriptApiSelect from '/@bpmn/components/arguments/ApiSelect.vue'; //之前是调的这个,现在换成ScriptApiSelect.vue
|
||||||
import ScriptApiSelect from '/@bpmn/components/arguments/ScriptApiSelect.vue';
|
import ScriptApiSelect from '/@bpmn/components/arguments/ScriptApiSelect.vue';
|
||||||
|
import FormTargetItem from './FormTargetItem.vue';
|
||||||
import { ProcessArgumentTreeData } from '/@bpmn/config/rules';
|
import { ProcessArgumentTreeData } from '/@bpmn/config/rules';
|
||||||
import { OperationType } from '/@/enums/workflowEnum';
|
import { OperationType } from '/@/enums/workflowEnum';
|
||||||
import { useBpmnStore } from '/@bpmn/store/bpmn';
|
import { useBpmnStore } from '/@bpmn/store/bpmn';
|
||||||
@ -87,7 +93,10 @@
|
|||||||
import { randomNum } from '/@bpmn/util/random';
|
import { randomNum } from '/@bpmn/util/random';
|
||||||
import { updateProcessParameterRelevance } from '/@bpmn/config/useUpdateAllFormInfo';
|
import { updateProcessParameterRelevance } from '/@bpmn/config/useUpdateAllFormInfo';
|
||||||
import { useI18n } from '/@/hooks/web/useI18n';
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
|
import {computed} from "vue";
|
||||||
|
import {getFormSettingTree} from "/@bpmn/config/info";
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const bpmnStore = useBpmnStore();
|
||||||
const configColumns = [
|
const configColumns = [
|
||||||
{
|
{
|
||||||
title: t('参数名称'),
|
title: t('参数名称'),
|
||||||
@ -128,8 +137,25 @@
|
|||||||
id: OperationType.API,
|
id: OperationType.API,
|
||||||
name: 'API',
|
name: 'API',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: OperationType.FORM_DATA,
|
||||||
|
name: '表单数据',
|
||||||
|
},
|
||||||
];
|
];
|
||||||
let variableTree = ProcessArgumentTreeData;
|
let variableTree = ProcessArgumentTreeData;
|
||||||
|
const formTree = computed(() => {
|
||||||
|
const { info } = bpmnStore;
|
||||||
|
let infoId="Event_start_node";//启动流程就需要获取表单数据,因此取开始节点表单
|
||||||
|
if (infoId && info.has(infoId)) {
|
||||||
|
let value = info.get(infoId);
|
||||||
|
if (value?.formConfigs) {
|
||||||
|
return getFormSettingTree(value.formConfigs, infoId, value.name, true);
|
||||||
|
} else {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
});
|
||||||
// 新增
|
// 新增
|
||||||
function add() {
|
function add() {
|
||||||
processInfo.value.processParamConfigs.push({
|
processInfo.value.processParamConfigs.push({
|
||||||
@ -145,6 +171,7 @@
|
|||||||
requestHeaderConfigs: [], //Header
|
requestHeaderConfigs: [], //Header
|
||||||
requestBodyConfigs: [], //Body
|
requestBodyConfigs: [], //Body
|
||||||
},
|
},
|
||||||
|
formConfig: { key: '', formId: '', formField: '' },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//删除
|
//删除
|
||||||
|
|||||||
@ -26,13 +26,14 @@
|
|||||||
</template>
|
</template>
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<NodeHead :node-name="t('命名规则配置面板')" />
|
<NodeHead :node-name="t('命名规则配置面板')" />
|
||||||
|
<div style="font-size: 12px"><div>只在发起流程、重新发起流程、发起外部流程前触发</div><div>其他情况修改流程变量processNameKey</div></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="opr-box" :key="nameRule.renderKey">
|
<div class="opr-box" :key="nameRule.renderKey">
|
||||||
<a-button @click="addRandomNumber('-')">-</a-button>
|
<a-button @click="addRandomNumber('-')">-</a-button>
|
||||||
<a-select
|
<a-select
|
||||||
v-model:value="nameRule.serialRuleValue"
|
v-model:value="nameRule.serialRuleValue"
|
||||||
:placeholder="t('点击选择流水号')"
|
:placeholder="t('点击选择流水号')"
|
||||||
style="width: 240px; margin: 0 4px"
|
style="width: 140px; margin: 0 4px"
|
||||||
:disabled="nameRule.canAddSerialRule ? false : true"
|
:disabled="nameRule.canAddSerialRule ? false : true"
|
||||||
@change="changeSerialRuleValue"
|
@change="changeSerialRuleValue"
|
||||||
>
|
>
|
||||||
@ -60,10 +61,25 @@
|
|||||||
{{ item.title }}
|
{{ item.title }}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
|
<a-select
|
||||||
|
v-model:value="nameRule.processParameter"
|
||||||
|
:placeholder="t('点击选择流程参数')"
|
||||||
|
style="width: 160px"
|
||||||
|
@change="addProcessParameter"
|
||||||
|
>
|
||||||
|
<a-select-option
|
||||||
|
v-for="item in processInfo.processParamConfigs"
|
||||||
|
:key="item.id"
|
||||||
|
:value="item.id"
|
||||||
|
:title="item.name"
|
||||||
|
>
|
||||||
|
{{ item.name }}
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
<div class="input-box">
|
<div class="input-box">
|
||||||
<span>{{ t('自定义文本:') }}</span>
|
<!-- <span>{{ t('自定义文本:') }}</span>-->
|
||||||
<a-input
|
<a-input
|
||||||
:placeholder="t('输入文本后点击确认')"
|
:placeholder="t('输入自定义文本后点击确认')"
|
||||||
v-model:value="nameRule.inputRandomNumber"
|
v-model:value="nameRule.inputRandomNumber"
|
||||||
:maxLength="20"
|
:maxLength="20"
|
||||||
class="input"
|
class="input"
|
||||||
@ -92,7 +108,7 @@
|
|||||||
<EmptyBox
|
<EmptyBox
|
||||||
:msg="
|
:msg="
|
||||||
t(
|
t(
|
||||||
'请先添加变量或自定义文本 格式举例:模板名称-发起人所属组织架构-发起人名称-yyyy-MM-dd-6位流水号 生成名称为:出差申请单-产品部-张三-20221011-000001',
|
'请先添加变量或自定义文本 格式举例:模板名称-发起人所属组织架构-发起人名称-yyyy-MM-dd-6位流水号 生成名称为:出差申请单-产品部-张三-20221011-000001'
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
@ -130,6 +146,7 @@
|
|||||||
inputRandomNumber: string;
|
inputRandomNumber: string;
|
||||||
serialRuleValue: string | undefined;
|
serialRuleValue: string | undefined;
|
||||||
randomNumber: string | undefined;
|
randomNumber: string | undefined;
|
||||||
|
processParameter: string | undefined;
|
||||||
canAddSerialRule: boolean;
|
canAddSerialRule: boolean;
|
||||||
renderKey: number;
|
renderKey: number;
|
||||||
} = reactive({
|
} = reactive({
|
||||||
@ -139,6 +156,7 @@
|
|||||||
inputRandomNumber: '',
|
inputRandomNumber: '',
|
||||||
serialRuleValue: undefined,
|
serialRuleValue: undefined,
|
||||||
randomNumber: undefined,
|
randomNumber: undefined,
|
||||||
|
processParameter: undefined,
|
||||||
canAddSerialRule: true,
|
canAddSerialRule: true,
|
||||||
renderKey: 0,
|
renderKey: 0,
|
||||||
});
|
});
|
||||||
@ -205,6 +223,11 @@
|
|||||||
nameRule.randomNumber = undefined;
|
nameRule.randomNumber = undefined;
|
||||||
nameRule.renderKey++;
|
nameRule.renderKey++;
|
||||||
}
|
}
|
||||||
|
function addProcessParameter(_value, item) {
|
||||||
|
nameRule.list.push({ title: '流程参数'+item.title, key: item.key });
|
||||||
|
nameRule.processParameter = undefined;
|
||||||
|
nameRule.renderKey++;
|
||||||
|
}
|
||||||
function addRandomNumber(str: string) {
|
function addRandomNumber(str: string) {
|
||||||
let item = symbolRuleMap.has(str) ? symbolRuleMap.get(str) : null;
|
let item = symbolRuleMap.has(str) ? symbolRuleMap.get(str) : null;
|
||||||
if (item) nameRule.list.push(item);
|
if (item) nameRule.list.push(item);
|
||||||
@ -242,7 +265,7 @@
|
|||||||
|
|
||||||
.input-box {
|
.input-box {
|
||||||
.input {
|
.input {
|
||||||
width: 180px;
|
width: 200px;
|
||||||
font: 12px;
|
font: 12px;
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user