!885 Merge remote-tracking branch 'origin/master' into master-bpm-bug-fix

Merge pull request !885 from Jason/master-bpm-bug-fix
master
芋道源码 2026-06-20 17:44:33 +00:00 committed by Gitee
commit e566d9f60a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 30 additions and 15 deletions

View File

@ -36,7 +36,11 @@
@mouseleave="stopDrag"
@mouseenter="setGrabCursor"
>
<ProcessNodeTree v-if="processNodeTree" v-model:flow-node="processNodeTree" />
<ProcessNodeTree
v-if="processNodeTree"
:key="importKey"
v-model:flow-node="processNodeTree"
/>
</div>
</div>
<Dialog v-model="errorDialogVisible" title="保存失败" width="400" :fullscreen="false">
@ -222,16 +226,26 @@ const exportJson = () => {
/** 导入 JSON */
const refFile = ref()
/** 导入后自增,作为 ProcessNodeTree 的 key强制重新挂载以保证画布刷新 */
const importKey = ref(0)
const importJson = () => {
refFile.value.click()
}
const importLocalFile = () => {
const file = refFile.value.files[0]
// input value change
refFile.value.value = ''
if (!file) {
return
}
const reader = new FileReader()
reader.readAsText(file)
reader.onload = function () {
if (isString(this.result)) {
processNodeTree.value = JSON.parse(this.result)
// key ProcessNodeTree
// watch(() => props.flowNode)
importKey.value++
emits('save', processNodeTree.value)
}
}

View File

@ -546,7 +546,7 @@ const showChildProcessNodeConfig = (node: SimpleFlowNode) => {
//
if (configForm.value.timeoutType === DelayTypeEnum.FIXED_TIME_DURATION) {
const strTimeDuration = node.childProcessSetting.timeoutSetting.timeExpression ?? ''
let parseTime = strTimeDuration.slice(2, strTimeDuration.length - 1)
let parseTime = strTimeDuration.match(/\d+/)?.[0] ?? ''
let parseTimeUnit = strTimeDuration.slice(strTimeDuration.length - 1)
configForm.value.timeDuration = parseInt(parseTime)
configForm.value.timeUnit = convertTimeUnit(parseTimeUnit)
@ -603,12 +603,12 @@ const loadFormInfo = async () => {
}
}
const getIsoTimeDuration = () => {
let strTimeDuration = 'PT'
let strTimeDuration = 'P'
if (configForm.value.timeUnit === TimeUnitType.MINUTE) {
strTimeDuration += configForm.value.timeDuration + 'M'
strTimeDuration += 'T' + configForm.value.timeDuration + 'M'
}
if (configForm.value.timeUnit === TimeUnitType.HOUR) {
strTimeDuration += configForm.value.timeDuration + 'H'
strTimeDuration += 'T' + configForm.value.timeDuration + 'H'
}
if (configForm.value.timeUnit === TimeUnitType.DAY) {
strTimeDuration += configForm.value.timeDuration + 'D'

View File

@ -152,12 +152,12 @@ const getShowText = (): string => {
return showText
}
const getIsoTimeDuration = () => {
let strTimeDuration = 'PT'
let strTimeDuration = 'P'
if (configForm.value.timeUnit === TimeUnitType.MINUTE) {
strTimeDuration += configForm.value.timeDuration + 'M'
strTimeDuration += 'T' + configForm.value.timeDuration + 'M'
}
if (configForm.value.timeUnit === TimeUnitType.HOUR) {
strTimeDuration += configForm.value.timeDuration + 'H'
strTimeDuration += 'T' + configForm.value.timeDuration + 'H'
}
if (configForm.value.timeUnit === TimeUnitType.DAY) {
strTimeDuration += configForm.value.timeDuration + 'D'
@ -172,7 +172,7 @@ const showDelayTimerNodeConfig = (node: SimpleFlowNode) => {
//
if (configForm.value.delayType === DelayTypeEnum.FIXED_TIME_DURATION) {
const strTimeDuration = node.delaySetting.delayTime
let parseTime = strTimeDuration.slice(2, strTimeDuration.length - 1)
let parseTime = strTimeDuration.match(/\d+/)?.[0] ?? ''
let parseTimeUnit = strTimeDuration.slice(strTimeDuration.length - 1)
configForm.value.timeDuration = parseInt(parseTime)
configForm.value.timeUnit = convertTimeUnit(parseTimeUnit)

View File

@ -816,7 +816,7 @@ const showUserTaskNodeConfig = (node: SimpleFlowNode) => {
configForm.value.timeoutHandlerEnable = node.timeoutHandler?.enable
if (node.timeoutHandler?.enable && node.timeoutHandler?.timeDuration) {
const strTimeDuration = node.timeoutHandler.timeDuration
let parseTime = strTimeDuration.slice(2, strTimeDuration.length - 1)
let parseTime = strTimeDuration.match(/\d+/)?.[0] ?? ''
let parseTimeUnit = strTimeDuration.slice(strTimeDuration.length - 1)
configForm.value.timeDuration = parseInt(parseTime)
timeUnit.value = convertTimeUnit(parseTimeUnit)
@ -938,12 +938,12 @@ function useTimeoutHandler() {
if (!configForm.value.timeoutHandlerEnable) {
return undefined
}
let strTimeDuration = 'PT'
let strTimeDuration = 'P'
if (timeUnit.value === TimeUnitType.MINUTE) {
strTimeDuration += configForm.value.timeDuration + 'M'
strTimeDuration += 'T' + configForm.value.timeDuration + 'M'
}
if (timeUnit.value === TimeUnitType.HOUR) {
strTimeDuration += configForm.value.timeDuration + 'H'
strTimeDuration += 'T' + configForm.value.timeDuration + 'H'
}
if (timeUnit.value === TimeUnitType.DAY) {
strTimeDuration += configForm.value.timeDuration + 'D'

View File

@ -816,7 +816,8 @@ const initNextAssigneesFormField = async () => {
isEmpty(node.candidateUsers) &&
CandidateStrategy.START_USER_SELECT === node.candidateStrategy) ||
//
CandidateStrategy.APPROVE_USER_SELECT === node.candidateStrategy
(isEmpty(node.candidateUsers) &&
CandidateStrategy.APPROVE_USER_SELECT === node.candidateStrategy)
) {
nextAssigneesActivityNode.value.push(node)
}
@ -849,7 +850,7 @@ const validateNextAssignees = () => {
}
//
for (const item of nextAssigneesActivityNode.value) {
if (isEmpty(approveReasonForm.nextAssignees[item.id])) {
if (isEmpty(item.candidateUsers) && isEmpty(approveReasonForm.nextAssignees[item.id])) {
message.warning('下一个节点的审批人不能为空!')
return false
}