Pre Merge pull request !885 from Jason/master-bpm-bug-fix
commit
7ca86f6c7e
|
|
@ -36,7 +36,11 @@
|
||||||
@mouseleave="stopDrag"
|
@mouseleave="stopDrag"
|
||||||
@mouseenter="setGrabCursor"
|
@mouseenter="setGrabCursor"
|
||||||
>
|
>
|
||||||
<ProcessNodeTree v-if="processNodeTree" v-model:flow-node="processNodeTree" />
|
<ProcessNodeTree
|
||||||
|
v-if="processNodeTree"
|
||||||
|
:key="importKey"
|
||||||
|
v-model:flow-node="processNodeTree"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Dialog v-model="errorDialogVisible" title="保存失败" width="400" :fullscreen="false">
|
<Dialog v-model="errorDialogVisible" title="保存失败" width="400" :fullscreen="false">
|
||||||
|
|
@ -222,16 +226,26 @@ const exportJson = () => {
|
||||||
|
|
||||||
/** 导入 JSON */
|
/** 导入 JSON */
|
||||||
const refFile = ref()
|
const refFile = ref()
|
||||||
|
/** 导入后自增,作为 ProcessNodeTree 的 key,强制重新挂载以保证画布刷新 */
|
||||||
|
const importKey = ref(0)
|
||||||
const importJson = () => {
|
const importJson = () => {
|
||||||
refFile.value.click()
|
refFile.value.click()
|
||||||
}
|
}
|
||||||
const importLocalFile = () => {
|
const importLocalFile = () => {
|
||||||
const file = refFile.value.files[0]
|
const file = refFile.value.files[0]
|
||||||
|
// 清空 input 的 value,否则再次选择同一个文件时 change 事件不会触发
|
||||||
|
refFile.value.value = ''
|
||||||
|
if (!file) {
|
||||||
|
return
|
||||||
|
}
|
||||||
const reader = new FileReader()
|
const reader = new FileReader()
|
||||||
reader.readAsText(file)
|
reader.readAsText(file)
|
||||||
reader.onload = function () {
|
reader.onload = function () {
|
||||||
if (isString(this.result)) {
|
if (isString(this.result)) {
|
||||||
processNodeTree.value = JSON.parse(this.result)
|
processNodeTree.value = JSON.parse(this.result)
|
||||||
|
// 改变 key,强制 ProcessNodeTree 重新挂载,
|
||||||
|
// 规避 watch(() => props.flowNode) 在组件复用场景下同步失效导致画布不刷新的问题
|
||||||
|
importKey.value++
|
||||||
emits('save', processNodeTree.value)
|
emits('save', processNodeTree.value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -546,7 +546,7 @@ const showChildProcessNodeConfig = (node: SimpleFlowNode) => {
|
||||||
// 固定时长
|
// 固定时长
|
||||||
if (configForm.value.timeoutType === DelayTypeEnum.FIXED_TIME_DURATION) {
|
if (configForm.value.timeoutType === DelayTypeEnum.FIXED_TIME_DURATION) {
|
||||||
const strTimeDuration = node.childProcessSetting.timeoutSetting.timeExpression ?? ''
|
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)
|
let parseTimeUnit = strTimeDuration.slice(strTimeDuration.length - 1)
|
||||||
configForm.value.timeDuration = parseInt(parseTime)
|
configForm.value.timeDuration = parseInt(parseTime)
|
||||||
configForm.value.timeUnit = convertTimeUnit(parseTimeUnit)
|
configForm.value.timeUnit = convertTimeUnit(parseTimeUnit)
|
||||||
|
|
@ -603,12 +603,12 @@ const loadFormInfo = async () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const getIsoTimeDuration = () => {
|
const getIsoTimeDuration = () => {
|
||||||
let strTimeDuration = 'PT'
|
let strTimeDuration = 'P'
|
||||||
if (configForm.value.timeUnit === TimeUnitType.MINUTE) {
|
if (configForm.value.timeUnit === TimeUnitType.MINUTE) {
|
||||||
strTimeDuration += configForm.value.timeDuration + 'M'
|
strTimeDuration += 'T' + configForm.value.timeDuration + 'M'
|
||||||
}
|
}
|
||||||
if (configForm.value.timeUnit === TimeUnitType.HOUR) {
|
if (configForm.value.timeUnit === TimeUnitType.HOUR) {
|
||||||
strTimeDuration += configForm.value.timeDuration + 'H'
|
strTimeDuration += 'T' + configForm.value.timeDuration + 'H'
|
||||||
}
|
}
|
||||||
if (configForm.value.timeUnit === TimeUnitType.DAY) {
|
if (configForm.value.timeUnit === TimeUnitType.DAY) {
|
||||||
strTimeDuration += configForm.value.timeDuration + 'D'
|
strTimeDuration += configForm.value.timeDuration + 'D'
|
||||||
|
|
|
||||||
|
|
@ -152,12 +152,12 @@ const getShowText = (): string => {
|
||||||
return showText
|
return showText
|
||||||
}
|
}
|
||||||
const getIsoTimeDuration = () => {
|
const getIsoTimeDuration = () => {
|
||||||
let strTimeDuration = 'PT'
|
let strTimeDuration = 'P'
|
||||||
if (configForm.value.timeUnit === TimeUnitType.MINUTE) {
|
if (configForm.value.timeUnit === TimeUnitType.MINUTE) {
|
||||||
strTimeDuration += configForm.value.timeDuration + 'M'
|
strTimeDuration += 'T' + configForm.value.timeDuration + 'M'
|
||||||
}
|
}
|
||||||
if (configForm.value.timeUnit === TimeUnitType.HOUR) {
|
if (configForm.value.timeUnit === TimeUnitType.HOUR) {
|
||||||
strTimeDuration += configForm.value.timeDuration + 'H'
|
strTimeDuration += 'T' + configForm.value.timeDuration + 'H'
|
||||||
}
|
}
|
||||||
if (configForm.value.timeUnit === TimeUnitType.DAY) {
|
if (configForm.value.timeUnit === TimeUnitType.DAY) {
|
||||||
strTimeDuration += configForm.value.timeDuration + 'D'
|
strTimeDuration += configForm.value.timeDuration + 'D'
|
||||||
|
|
@ -172,7 +172,7 @@ const showDelayTimerNodeConfig = (node: SimpleFlowNode) => {
|
||||||
// 固定时长
|
// 固定时长
|
||||||
if (configForm.value.delayType === DelayTypeEnum.FIXED_TIME_DURATION) {
|
if (configForm.value.delayType === DelayTypeEnum.FIXED_TIME_DURATION) {
|
||||||
const strTimeDuration = node.delaySetting.delayTime
|
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)
|
let parseTimeUnit = strTimeDuration.slice(strTimeDuration.length - 1)
|
||||||
configForm.value.timeDuration = parseInt(parseTime)
|
configForm.value.timeDuration = parseInt(parseTime)
|
||||||
configForm.value.timeUnit = convertTimeUnit(parseTimeUnit)
|
configForm.value.timeUnit = convertTimeUnit(parseTimeUnit)
|
||||||
|
|
|
||||||
|
|
@ -816,7 +816,7 @@ const showUserTaskNodeConfig = (node: SimpleFlowNode) => {
|
||||||
configForm.value.timeoutHandlerEnable = node.timeoutHandler?.enable
|
configForm.value.timeoutHandlerEnable = node.timeoutHandler?.enable
|
||||||
if (node.timeoutHandler?.enable && node.timeoutHandler?.timeDuration) {
|
if (node.timeoutHandler?.enable && node.timeoutHandler?.timeDuration) {
|
||||||
const strTimeDuration = 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)
|
let parseTimeUnit = strTimeDuration.slice(strTimeDuration.length - 1)
|
||||||
configForm.value.timeDuration = parseInt(parseTime)
|
configForm.value.timeDuration = parseInt(parseTime)
|
||||||
timeUnit.value = convertTimeUnit(parseTimeUnit)
|
timeUnit.value = convertTimeUnit(parseTimeUnit)
|
||||||
|
|
@ -938,12 +938,12 @@ function useTimeoutHandler() {
|
||||||
if (!configForm.value.timeoutHandlerEnable) {
|
if (!configForm.value.timeoutHandlerEnable) {
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
let strTimeDuration = 'PT'
|
let strTimeDuration = 'P'
|
||||||
if (timeUnit.value === TimeUnitType.MINUTE) {
|
if (timeUnit.value === TimeUnitType.MINUTE) {
|
||||||
strTimeDuration += configForm.value.timeDuration + 'M'
|
strTimeDuration += 'T' + configForm.value.timeDuration + 'M'
|
||||||
}
|
}
|
||||||
if (timeUnit.value === TimeUnitType.HOUR) {
|
if (timeUnit.value === TimeUnitType.HOUR) {
|
||||||
strTimeDuration += configForm.value.timeDuration + 'H'
|
strTimeDuration += 'T' + configForm.value.timeDuration + 'H'
|
||||||
}
|
}
|
||||||
if (timeUnit.value === TimeUnitType.DAY) {
|
if (timeUnit.value === TimeUnitType.DAY) {
|
||||||
strTimeDuration += configForm.value.timeDuration + 'D'
|
strTimeDuration += configForm.value.timeDuration + 'D'
|
||||||
|
|
|
||||||
|
|
@ -816,7 +816,8 @@ const initNextAssigneesFormField = async () => {
|
||||||
isEmpty(node.candidateUsers) &&
|
isEmpty(node.candidateUsers) &&
|
||||||
CandidateStrategy.START_USER_SELECT === node.candidateStrategy) ||
|
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)
|
nextAssigneesActivityNode.value.push(node)
|
||||||
}
|
}
|
||||||
|
|
@ -849,7 +850,7 @@ const validateNextAssignees = () => {
|
||||||
}
|
}
|
||||||
// 如果需要自选审批人,则校验每个节点是否都已配置审批人
|
// 如果需要自选审批人,则校验每个节点是否都已配置审批人
|
||||||
for (const item of nextAssigneesActivityNode.value) {
|
for (const item of nextAssigneesActivityNode.value) {
|
||||||
if (isEmpty(approveReasonForm.nextAssignees[item.id])) {
|
if (isEmpty(item.candidateUsers) && isEmpty(approveReasonForm.nextAssignees[item.id])) {
|
||||||
message.warning('下一个节点的审批人不能为空!')
|
message.warning('下一个节点的审批人不能为空!')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue