|
|
@ -62,7 +62,7 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
import { h, ref, defineAsyncComponent, nextTick } from 'vue'; |
|
|
|
import { useRouter } from 'vue-router'; |
|
|
|
import { $t, axios, Environment, ComponentManager, Tools, NotifyManager, QuasarTools } from '@/platform'; |
|
|
|
import { $t, axios, Environment, ComponentManager, Tools, NotifyManager, DialogManager, QuasarTools } from '@/platform'; |
|
|
|
import { onMounted } from 'vue'; |
|
|
|
|
|
|
|
const props = defineProps({ taskId: { type: String, default: null } }); |
|
|
@ -101,6 +101,25 @@ const refresh = () => { |
|
|
|
emit('afterRefresh'); |
|
|
|
}; |
|
|
|
|
|
|
|
const afterTaskClosed = () => { |
|
|
|
refresh(); |
|
|
|
}; |
|
|
|
|
|
|
|
const afterTaskCompleted = () => { |
|
|
|
refresh(); |
|
|
|
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 }), () => { |
|
|
|
handle(nextTask); |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
const handle = async (item: any) => { |
|
|
|
if (item.taskHandFrontendModelName && item.taskHandFrontendComponentName) { |
|
|
|
//删除已有组件 |
|
|
@ -117,7 +136,8 @@ const handle = async (item: any) => { |
|
|
|
action: 'process', |
|
|
|
task: item, |
|
|
|
properties: Tools.json2Object(item.taskHandFrontendComponentProperties), |
|
|
|
onClose: refresh, |
|
|
|
onClose: afterTaskClosed, |
|
|
|
onAfterTaskCompleted: afterTaskCompleted, |
|
|
|
}); |
|
|
|
}); |
|
|
|
} else if (item.taskHandFrontendRouteName) { |
|
|
|