¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <el-form ref="formRef" :model="formData" :rules="formRules" label-width="90px"> |
| | | <el-collapse v-model="currentCollapseItem"> |
| | | <el-collapse-item name="1"> |
| | | <template #title> |
| | | <div class="collapse__title"> |
| | | <el-icon> |
| | | <InfoFilled /> |
| | | </el-icon> |
| | | å¸¸è§ |
| | | </div> |
| | | </template> |
| | | <div> |
| | | <el-form-item prop="id" label="èç¹ ID"> |
| | | <el-input v-model="formData.id" @change="idChange"> </el-input> |
| | | </el-form-item> |
| | | <el-form-item prop="name" label="èç¹åç§°"> |
| | | <el-input v-model="formData.name" @change="nameChange"> </el-input> |
| | | </el-form-item> |
| | | </div> |
| | | </el-collapse-item> |
| | | |
| | | <el-collapse-item name="2"> |
| | | <template #title> |
| | | <div class="collapse__title"> |
| | | <el-icon> |
| | | <BellFilled /> |
| | | </el-icon> |
| | | æ§è¡çå¬å¨ |
| | | </div> |
| | | </template> |
| | | <div> |
| | | <ExecutionListener :element="element"></ExecutionListener> |
| | | </div> |
| | | </el-collapse-item> |
| | | <el-collapse-item name="3"> |
| | | <template #title> |
| | | <div class="collapse__title"> |
| | | <el-icon> |
| | | <HelpFilled /> |
| | | </el-icon> |
| | | å¤å®ä¾ |
| | | </div> |
| | | </template> |
| | | <div> |
| | | <el-form-item label="å¤å®ä¾ç±»å"> |
| | | <el-select v-model="formData.multiInstanceType" @change="multiInstanceTypeChange"> |
| | | <el-option v-for="item in constant.MultiInstanceType" :key="item.id" :value="item.value" :label="item.label"> </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <div v-if="formData.multiInstanceType !== MultiInstanceTypeEnum.NONE"> |
| | | <el-form-item label="éå"> |
| | | <template #label> |
| | | <span> |
| | | éå |
| | | <el-tooltip placement="top"> |
| | | <el-icon><QuestionFilled /></el-icon> |
| | | <template #content> |
| | | 屿§ä¼ä½ä¸ºè¡¨è¾¾å¼è¿è¡è§£æãå¦æè¡¨è¾¾å¼è§£æä¸ºå符串è䏿¯ä¸ä¸ªéåï¼<br /> |
| | | ä¸è®ºæ¯å 为æ¬èº«é
ç½®çå°±æ¯éæå符串å¼ï¼è¿æ¯è¡¨è¾¾å¼è®¡ç®ç»æä¸ºå符串ï¼<br /> |
| | | è¿ä¸ªå符串é½ä¼è¢«å½ååéåï¼å¹¶ä»æµç¨åéä¸ç¨äºè·åå®é
çéåã |
| | | </template> |
| | | </el-tooltip> |
| | | </span> |
| | | </template> |
| | | <el-input v-model="formData.collection" @change="collectionChange"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="å
ç´ åé"> |
| | | <template #label> |
| | | <span> |
| | | å
ç´ åé |
| | | <el-tooltip placement="top"> |
| | | <el-icon><QuestionFilled /></el-icon> |
| | | <template #content> |
| | | æ¯å建ä¸ä¸ªç¨æ·ä»»å¡åï¼å
以该å
ç´ åé为labelï¼éåä¸çä¸é¡¹ä¸ºvalueï¼<br /> |
| | | å建ï¼å±é¨ï¼æµç¨åéï¼è¯¥å±é¨æµç¨åé被ç¨äºææ´¾ç¨æ·ä»»å¡ã<br /> |
| | | ä¸è¬æ¥è¯´ï¼è¯¥å符串åºä¸æå®äººååéç¸åã |
| | | </template> |
| | | </el-tooltip> |
| | | </span> |
| | | </template> |
| | | <el-input v-model="formData.elementVariable" @change="elementVariableChange"> </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="宿æ¡ä»¶"> |
| | | <template #label> |
| | | <span> |
| | | 宿æ¡ä»¶ |
| | | <el-tooltip placement="top"> |
| | | <el-icon><QuestionFilled /></el-icon> |
| | | <template #content> |
| | | å¤å®ä¾æ´»å¨å¨ææå®ä¾é½å®ææ¶ç»æï¼ç¶èä¹å¯ä»¥æå®ä¸ä¸ªè¡¨è¾¾å¼ï¼å¨æ¯ä¸ªå®ä¾<br /> |
| | | ç»ææ¶è¿è¡è®¡ç®ãå½è¡¨è¾¾å¼è®¡ç®ä¸ºtrueæ¶ï¼å°éæ¯ææå©ä½çå®ä¾ï¼å¹¶ç»æå¤å®ä¾<br /> |
| | | æ´»å¨ï¼ç»§ç»æ§è¡æµç¨ãä¾å¦ ${nrOfCompletedInstances/nrOfInstances >= 0.6 }ï¼<br /> |
| | | 表示å½ä»»å¡å®æ60%æ¶ï¼è¯¥èç¹å°±ç®å®æ |
| | | </template> |
| | | </el-tooltip> |
| | | </span> |
| | | </template> |
| | | <el-input v-model="formData.completionCondition" @change="completionConditionChange"> </el-input> |
| | | </el-form-item> |
| | | </div> |
| | | </div> |
| | | </el-collapse-item> |
| | | </el-collapse> |
| | | </el-form> |
| | | </div> |
| | | </template> |
| | | <script setup lang="ts"> |
| | | import ExecutionListener from './property/ExecutionListener.vue'; |
| | | import useParseElement from '../hooks/useParseElement'; |
| | | import usePanel from '../hooks/usePanel'; |
| | | import type { ModdleElement } from 'bpmn'; |
| | | import type { SubProcessPanel } from 'bpmnDesign'; |
| | | import { MultiInstanceTypeEnum } from '@/enums/bpmn/IndexEnums'; |
| | | |
| | | interface PropType { |
| | | element: ModdleElement; |
| | | } |
| | | const props = withDefaults(defineProps<PropType>(), {}); |
| | | const { nameChange, idChange, updateProperties, createModdleElement, constant } = usePanel({ |
| | | element: toRaw(props.element) |
| | | }); |
| | | const { parseData } = useParseElement({ |
| | | element: toRaw(props.element) |
| | | }); |
| | | |
| | | const formData = ref(parseData<SubProcessPanel>()); |
| | | const currentCollapseItem = ref(['1', '2', '3']); |
| | | |
| | | const multiInstanceTypeChange = (newVal) => { |
| | | if (newVal !== MultiInstanceTypeEnum.NONE) { |
| | | let loopCharacteristics = props.element.businessObject.get('loopCharacteristics'); |
| | | if (!loopCharacteristics) { |
| | | loopCharacteristics = createModdleElement('bpmn:MultiInstanceLoopCharacteristics', {}, props.element.businessObject); |
| | | } |
| | | loopCharacteristics.isSequential = newVal === MultiInstanceTypeEnum.SERIAL; |
| | | updateProperties({ loopCharacteristics: loopCharacteristics }); |
| | | } else { |
| | | updateProperties({ loopCharacteristics: undefined }); |
| | | } |
| | | }; |
| | | const collectionChange = (newVal) => { |
| | | let loopCharacteristics = props.element.businessObject.get('loopCharacteristics'); |
| | | if (!loopCharacteristics) { |
| | | loopCharacteristics = createModdleElement('bpmn:MultiInstanceLoopCharacteristics', {}, props.element.businessObject); |
| | | } |
| | | loopCharacteristics.collection = newVal && newVal.length > 0 ? newVal : undefined; |
| | | updateProperties({ loopCharacteristics: loopCharacteristics }); |
| | | }; |
| | | const elementVariableChange = (newVal) => { |
| | | let loopCharacteristics = props.element.businessObject.get('loopCharacteristics'); |
| | | if (!loopCharacteristics) { |
| | | loopCharacteristics = createModdleElement('bpmn:MultiInstanceLoopCharacteristics', {}, props.element.businessObject); |
| | | } |
| | | loopCharacteristics.elementVariable = newVal && newVal.length > 0 ? newVal : undefined; |
| | | updateProperties({ loopCharacteristics: loopCharacteristics }); |
| | | }; |
| | | const completionConditionChange = (newVal) => { |
| | | let loopCharacteristics = props.element.businessObject.get<ModdleElement>('loopCharacteristics'); |
| | | if (!loopCharacteristics) { |
| | | loopCharacteristics = createModdleElement('bpmn:MultiInstanceLoopCharacteristics', {}, props.element.businessObject); |
| | | } |
| | | if (newVal && newVal.length > 0) { |
| | | if (!loopCharacteristics.completionCondition) { |
| | | loopCharacteristics.completionCondition = createModdleElement('bpmn:Expression', { body: newVal }, loopCharacteristics); |
| | | } else { |
| | | loopCharacteristics.completionCondition.body = newVal; |
| | | } |
| | | } else { |
| | | loopCharacteristics.completionCondition = undefined; |
| | | } |
| | | updateProperties({ loopCharacteristics: loopCharacteristics }); |
| | | }; |
| | | |
| | | onBeforeMount(() => { |
| | | if (formData.value.loopCharacteristics) { |
| | | const loopCharacteristics = formData.value.loopCharacteristics; |
| | | formData.value.collection = loopCharacteristics.collection || ''; |
| | | formData.value.elementVariable = loopCharacteristics.elementVariable || ''; |
| | | formData.value.completionCondition = loopCharacteristics.completionCondition?.body || ''; |
| | | formData.value.multiInstanceType = loopCharacteristics.isSequential ? MultiInstanceTypeEnum.SERIAL : MultiInstanceTypeEnum.PARALLEL; |
| | | } |
| | | }); |
| | | |
| | | const formRules = ref<ElFormRules>({ |
| | | id: [{ required: true, message: '请è¾å
¥', trigger: 'blur' }], |
| | | name: [{ required: true, message: '请è¾å
¥', trigger: 'blur' }] |
| | | }); |
| | | </script> |
| | | |
| | | <style lang="scss" scoped></style> |