Commit 82ee62cb by Lesan

feat: 审批意见

parent 506d87ec
...@@ -1463,6 +1463,20 @@ ...@@ -1463,6 +1463,20 @@
"type": "String" "type": "String"
} }
] ]
},
{
"name": "ReasonRequire",
"superClass": ["Element"],
"meta": {
"allowedIn": ["bpmn:UserTask"]
},
"properties": [
{
"name": "value",
"type": "Boolean",
"isBody": true
}
]
} }
], ],
"emumerations": [] "emumerations": []
......
...@@ -167,6 +167,11 @@ ...@@ -167,6 +167,11 @@
<el-form-item prop="signEnable"> <el-form-item prop="signEnable">
<el-switch v-model="signEnable.value" active-text="是" inactive-text="否" /> <el-switch v-model="signEnable.value" active-text="是" inactive-text="否" />
</el-form-item> </el-form-item>
<el-divider content-position="left">审批意见</el-divider>
<el-form-item prop="reasonRequire">
<el-switch v-model="reasonRequire.value" active-text="必填" inactive-text="非必填" />
</el-form-item>
</div> </div>
</template> </template>
...@@ -227,6 +232,9 @@ const approveType = ref({ value: ApproveType.USER }) ...@@ -227,6 +232,9 @@ const approveType = ref({ value: ApproveType.USER })
// 是否需要签名 // 是否需要签名
const signEnable = ref({ value: false }) const signEnable = ref({ value: false })
// 审批意见
const reasonRequire = ref({ value: false })
const elExtensionElements = ref() const elExtensionElements = ref()
const otherExtensions = ref() const otherExtensions = ref()
const bpmnElement = ref() const bpmnElement = ref()
...@@ -320,6 +328,16 @@ const resetCustomConfigList = () => { ...@@ -320,6 +328,16 @@ const resetCustomConfigList = () => {
}) })
} }
// 是否需要签名
signEnable.value =
elExtensionElements.value.values?.filter((ex) => ex.$type === `${prefix}:SignEnable`)?.[0] ||
bpmnInstances().moddle.create(`${prefix}:SignEnable`, { value: false })
// 审批意见
reasonRequire.value =
elExtensionElements.value.values?.filter((ex) => ex.$type === `${prefix}:ReasonRequire`)?.[0] ||
bpmnInstances().moddle.create(`${prefix}:ReasonRequire`, { value: false })
// 保留剩余扩展元素,便于后面更新该元素对应属性 // 保留剩余扩展元素,便于后面更新该元素对应属性
otherExtensions.value = otherExtensions.value =
elExtensionElements.value.values?.filter( elExtensionElements.value.values?.filter(
...@@ -331,14 +349,11 @@ const resetCustomConfigList = () => { ...@@ -331,14 +349,11 @@ const resetCustomConfigList = () => {
ex.$type !== `${prefix}:AssignEmptyUserIds` && ex.$type !== `${prefix}:AssignEmptyUserIds` &&
ex.$type !== `${prefix}:ButtonsSetting` && ex.$type !== `${prefix}:ButtonsSetting` &&
ex.$type !== `${prefix}:FieldsPermission` && ex.$type !== `${prefix}:FieldsPermission` &&
ex.$type !== `${prefix}:ApproveType` ex.$type !== `${prefix}:ApproveType` &&
ex.$type !== `${prefix}:SignEnable` &&
ex.$type !== `${prefix}:ReasonRequire`
) ?? [] ) ?? []
// 是否需要签名
signEnable.value =
elExtensionElements.value.values?.filter((ex) => ex.$type === `${prefix}:SignEnable`)?.[0] ||
bpmnInstances().moddle.create(`${prefix}:SignEnable`, { value: false })
// 更新元素扩展属性,避免后续报错 // 更新元素扩展属性,避免后续报错
updateElementExtensions() updateElementExtensions()
} }
...@@ -388,7 +403,8 @@ const updateElementExtensions = () => { ...@@ -388,7 +403,8 @@ const updateElementExtensions = () => {
approveType.value, approveType.value,
...buttonsSettingEl.value, ...buttonsSettingEl.value,
...fieldsPermissionEl.value, ...fieldsPermissionEl.value,
signEnable.value signEnable.value,
reasonRequire.value
] ]
}) })
bpmnInstances().modeling.updateProperties(toRaw(bpmnElement.value), { bpmnInstances().modeling.updateProperties(toRaw(bpmnElement.value), {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment