adtec-core-package 2.0.6 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/hooks/workflowTodo.ts +85 -0
package/package.json
CHANGED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { Ref } from 'vue'
|
|
2
|
+
import WujieVue from 'wujie-vue3'
|
|
3
|
+
import { ElMessage } from 'element-plus'
|
|
4
|
+
import { useEventBus } from '@vueuse/core'
|
|
5
|
+
import type { IParameter } from '../../src/interface/Message'
|
|
6
|
+
import { type IWfTaskVo } from '../../src/interface/workflow/IWfTaskVo'
|
|
7
|
+
import { userInfoStore } from '../../src/stores/userInfoStore'
|
|
8
|
+
import { useRouter } from 'vue-router'
|
|
9
|
+
import { permissionStore } from '../../src/stores/permissionStore'
|
|
10
|
+
import frameworkUtil from '../../src/utils/FrameworkUtils'
|
|
11
|
+
/**
|
|
12
|
+
* 创建人:xux
|
|
13
|
+
* 说明:
|
|
14
|
+
* 创建时间: 2025/1/23 下午3:16
|
|
15
|
+
* 修改时间: 2025/1/23 下午3:16
|
|
16
|
+
*/
|
|
17
|
+
export async function showTodoDialog(
|
|
18
|
+
// todoRef: Ref<typeof TodoDialog>,
|
|
19
|
+
taskVo: Ref<IWfTaskVo>,
|
|
20
|
+
permissionHooks: any,
|
|
21
|
+
params: any,
|
|
22
|
+
comptShow: Ref<boolean>,
|
|
23
|
+
) {
|
|
24
|
+
if (taskVo.value && taskVo.value.nodeTag) {
|
|
25
|
+
const nodeTag =
|
|
26
|
+
taskVo.value.nodeTag.indexOf(':') > -1
|
|
27
|
+
? taskVo.value.nodeTag.split(':')[1]
|
|
28
|
+
: taskVo.value.nodeTag
|
|
29
|
+
const ps = [
|
|
30
|
+
{ code: 'businessId', value: taskVo.value?.businessId },
|
|
31
|
+
{ code: 'taskId', value: taskVo.value?.taskId },
|
|
32
|
+
{
|
|
33
|
+
code: 'nodeTag',
|
|
34
|
+
value: taskVo.value.nodeTag,
|
|
35
|
+
},
|
|
36
|
+
]
|
|
37
|
+
params.value = ps
|
|
38
|
+
if (taskVo.value?.nodeParam) {
|
|
39
|
+
ps.push({ code: 'nodeParam', value: taskVo.value?.nodeParam })
|
|
40
|
+
}
|
|
41
|
+
if (taskVo.value.nodeTag.indexOf(':') > -1) {
|
|
42
|
+
//子应用
|
|
43
|
+
//表单页面
|
|
44
|
+
if (taskVo.value.nodeTag.indexOf('/') > -1) {
|
|
45
|
+
//给子应用组件发送bus事件
|
|
46
|
+
WujieVue.bus.$emit(taskVo.value.nodeTag.split(':')[0] + 'WorkflowTodoBus', ps)
|
|
47
|
+
} else {
|
|
48
|
+
//菜单页面
|
|
49
|
+
const find = userInfoStore().getUserInfo.menuList.find((c) => c.code === nodeTag)
|
|
50
|
+
if (find) {
|
|
51
|
+
const key = nodeTag + (Math.random() * 100000).toFixed(0)
|
|
52
|
+
localStorage.setItem(key + '_message', JSON.stringify(taskVo.value))
|
|
53
|
+
setTimeout(() => {
|
|
54
|
+
localStorage.removeItem(key + '_message')
|
|
55
|
+
}, 1000 * 10)
|
|
56
|
+
let menu = frameworkUtil
|
|
57
|
+
.getOpenMenuInfoWujie()
|
|
58
|
+
.find((item: any) => item.id === taskVo.value.taskId)
|
|
59
|
+
if (!menu) {
|
|
60
|
+
menu = JSON.parse(JSON.stringify(find))
|
|
61
|
+
if (menu) {
|
|
62
|
+
menu.code = key
|
|
63
|
+
menu.name = taskVo.value.taskName ? taskVo.value.taskName : menu.name
|
|
64
|
+
menu.id = taskVo.value.taskId
|
|
65
|
+
ps.push({ code: 'menuCode', value: menu.code })
|
|
66
|
+
await permissionHooks.openMenuByFramework(menu, ps)
|
|
67
|
+
}
|
|
68
|
+
} else {
|
|
69
|
+
await permissionHooks.openMenuByFramework(menu)
|
|
70
|
+
}
|
|
71
|
+
//给子应用组件发送bus事件
|
|
72
|
+
setTimeout(() => {
|
|
73
|
+
WujieVue.bus.$emit(taskVo.value?.nodeTag?.split(':')[0] + 'WorkflowTodoBus', ps)
|
|
74
|
+
}, 1000)
|
|
75
|
+
// await permissionHooks.openMenu(find)
|
|
76
|
+
// WujieVue.bus.$emit(taskVo.value.nodeTag.split(':')[0] + 'WorkflowTodoBus', ps)
|
|
77
|
+
} else {
|
|
78
|
+
ElMessage.error('未找到该菜单')
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
} else {
|
|
83
|
+
ElMessage.error('未设置待办处理界面!')
|
|
84
|
+
}
|
|
85
|
+
}
|