|
|
@ -274,6 +274,7 @@ import { |
|
|
|
AuthenticationManager, |
|
|
|
ComponentManager, |
|
|
|
NotifyManager, |
|
|
|
DialogManager, |
|
|
|
Tools, |
|
|
|
} from '@/platform'; |
|
|
|
import LoginDialog from '@/platform/views/LoginDialog'; |
|
|
@ -433,7 +434,7 @@ const doLogout = () => { |
|
|
|
}; |
|
|
|
|
|
|
|
const findUnCompletedTasks = () => { |
|
|
|
axios.get(Environment.apiContextPath('/api/flowable/process/query/myTask?page=1&size=10&pageable=true')).then((response) => { |
|
|
|
axios.get(Environment.apiContextPath('/api/flowable/process/query/myTask?page=1&size=10&pageable=true&sortBy=-startTime')).then((response) => { |
|
|
|
unCompletedTasksRef.value = response.data.content || []; |
|
|
|
unCompletedTasksTotalCountRef.value = response.data.totalElements; |
|
|
|
}); |
|
|
@ -470,18 +471,39 @@ const findUnReadedAnnouncements = () => { |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
const handleTask = (item) => { |
|
|
|
const afterTaskCompleted = () => { |
|
|
|
findUnReadedAnnouncements(); |
|
|
|
if (Environment.getConfigure().setting.workbenchAutoHandleNextTask) { |
|
|
|
axios.get(Environment.apiContextPath('/api/flowable/process/query/myTask?page=1&size=10&pageable=true&sortBy=-startTime')).then((response) => { |
|
|
|
const content = response?.data?.content; |
|
|
|
if (Tools.isArray(content) && content.length > 0) { |
|
|
|
const nextTask = content[0]; |
|
|
|
DialogManager.confirm(t('home.card.myTask.action.process.tip.nextTask', { businessType: nextTask.businessType }), () => { |
|
|
|
handleTask(nextTask); |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
const handleTask = (item: any) => { |
|
|
|
if (item.taskHandFrontendModelName && item.taskHandFrontendComponentName) { |
|
|
|
//删除已有组件 |
|
|
|
componentRef.value = null; |
|
|
|
//重新加载组件 |
|
|
|
nextTick(() => { |
|
|
|
const component = defineAsyncComponent(ComponentManager.getRemoteComponent(item.taskHandFrontendModelName, item.taskHandFrontendComponentName)); |
|
|
|
const component = defineAsyncComponent({ |
|
|
|
loader: ComponentManager.getRemoteComponent(item.taskHandFrontendModelName, item.taskHandFrontendComponentName), |
|
|
|
onError: (error, retry, fail, attempts) => { |
|
|
|
NotifyManager.error(t('home.card.task.tip.remoteComponentLoadError')); |
|
|
|
}, |
|
|
|
}); |
|
|
|
componentRef.value = h(component, { |
|
|
|
action: 'process', |
|
|
|
task: item, |
|
|
|
properties: Tools.json2Object(item.taskHandFrontendComponentProperties), |
|
|
|
onClose: findUnCompletedTasks, |
|
|
|
onAfterTaskCompleted: afterTaskCompleted, |
|
|
|
}); |
|
|
|
}); |
|
|
|
} else if (item.taskHandFrontendRouteName) { |
|
|
|