adtec-core-package 2.6.4 → 2.6.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adtec-core-package",
3
- "version": "2.6.4",
3
+ "version": "2.6.6",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -6,73 +6,78 @@
6
6
  <div ref="taskFlexRef">
7
7
  <el-flex align="center" justify="flex-end">
8
8
  <slot name="left"></slot>
9
- <el-button :loading="butLoading || taskLoading" v-if="params?.cancelBtnText !== ''"
10
- @click="params?.cancelFunction">{{
11
- params?.cancelBtnText ?? '取消'
12
- }}
9
+ <el-button
10
+ :loading="butLoading || taskLoading"
11
+ v-if="params?.cancelBtnText !== ''"
12
+ @click="params?.cancelFunction"
13
+ >{{ params?.cancelBtnText ?? '取消' }}
13
14
  </el-button>
14
- <el-button v-if="showProcessBtn && task?.procInsId" type="info" :loading="butLoading || taskLoading"
15
- @click="processShow = true">
15
+ <el-button
16
+ v-if="showProcessBtn && task?.procInsId"
17
+ type="info"
18
+ :loading="butLoading || taskLoading"
19
+ @click="processShow = true"
20
+ >
16
21
  流程详情
17
22
  </el-button>
18
23
  <template v-if="isAssignee">
19
- <el-button type="primary" :loading="butLoading || taskLoading" @click="openDialog('assignee')">指定执行人
24
+ <el-button
25
+ type="primary"
26
+ :loading="butLoading || taskLoading"
27
+ @click="openDialog('assignee')"
28
+ >指定执行人
20
29
  </el-button>
21
30
  </template>
22
31
  <template v-if="!isAssignee && task?.taskId && task?.operations && showOperationsBtn">
23
- <el-button :loading="butLoading || taskLoading" v-if="params?.saveBtnText" type="primary"
24
- @click="params?.saveFunction">{{
25
- params?.saveBtnText
26
- }}
32
+ <el-button
33
+ :loading="butLoading || taskLoading"
34
+ v-if="params?.saveBtnText"
35
+ type="primary"
36
+ @click="params?.saveFunction"
37
+ >{{ params?.saveBtnText }}
27
38
  </el-button>
28
39
  <el-button
29
40
  v-if="task?.operations.indexOf('addMulti') > -1"
30
41
  type="warning"
31
42
  :loading="butLoading || taskLoading"
32
43
  @click="openDialog('addMulti')"
33
- >加签
34
- </el-button
35
- >
44
+ >加签
45
+ </el-button>
36
46
  <el-button
37
47
  v-if="task?.operations.indexOf('minusMulti') > -1"
38
48
  type="danger"
39
49
  :loading="butLoading || taskLoading"
40
50
  @click="openDialog('minusMulti')"
41
- >减签
42
- </el-button
43
- >
51
+ >减签
52
+ </el-button>
44
53
  <el-button
45
54
  :loading="butLoading || taskLoading"
46
55
  v-if="task?.operations.indexOf('refuse') > -1 && params?.refuseBtnText !== ''"
47
56
  type="danger"
48
57
  @click="openDialog('refuse')"
49
- >{{ params?.refuseBtnText ?? '终止' }}
50
- </el-button
51
- >
58
+ >{{ params?.refuseBtnText ?? '终止' }}
59
+ </el-button>
52
60
  <el-button
53
61
  :loading="butLoading || taskLoading"
54
62
  v-if="task?.operations.indexOf('transfer') > -1 && params?.transferBtnText !== ''"
55
63
  type="warning"
56
64
  @click="openDialog('transfer')"
57
- >{{ params?.transferBtnText ?? '转办' }}
58
- </el-button
59
- >
65
+ >{{ params?.transferBtnText ?? '转办' }}
66
+ </el-button>
60
67
  <el-button
61
68
  :loading="butLoading || taskLoading"
62
69
  v-if="task?.operations.indexOf('back') > -1 && params?.backBtnText !== ''"
63
70
  type="danger"
64
71
  @click="openDialog('back')"
65
- >{{ params?.backBtnText ?? '退回' }}
66
- </el-button
67
- >
72
+ >{{ params?.backBtnText ?? '退回' }}
73
+ </el-button>
68
74
  <el-button
69
75
  :loading="butLoading || taskLoading"
70
76
  v-if="task?.operations.indexOf('complete') > -1 && params?.completeBtnText !== ''"
71
77
  type="primary"
72
78
  @click="openDialog('complete')"
73
- >{{ params?.completeBtnText ?? '同意' }}
74
- </el-button
75
- >
79
+ >{{ params?.completeBtnText ?? '同意' }}
80
+ </el-button>
76
81
  </template>
77
82
  <slot name="right"></slot>
78
83
  <select-assignee-dialog
@@ -89,9 +94,7 @@
89
94
  @success="operSuccess"
90
95
  ></check-dialog>
91
96
  <add-or-minus-multi-dialog ref="addOrMinusMultiRef"></add-or-minus-multi-dialog>
92
- <Teleport to="body">
93
- <process-detail-dialog v-model="processShow" :task="task"></process-detail-dialog>
94
- </Teleport>
97
+ <process-detail-dialog v-model="processShow" :task="task"></process-detail-dialog>
95
98
  </el-flex>
96
99
  </div>
97
100
  </template>
@@ -162,7 +165,7 @@ const openDialog = async (type: string) => {
162
165
  userId: userInfoStore().getUserInfo.id,
163
166
  comment: '同意。',
164
167
  procInsId: task.value.procInsId,
165
- procDefKey: task.value.procDefKey
168
+ procDefKey: task.value.procDefKey,
166
169
  })
167
170
  if (res === false) return
168
171
  if (res?.readonly) {
@@ -203,7 +206,7 @@ const operSuccess = (taskVo: IWfTaskVo) => {
203
206
  // 向上定义递归查找函数
204
207
  const findParentWithClass = (
205
208
  element: HTMLElement | null,
206
- targetClass: string
209
+ targetClass: string,
207
210
  ): HTMLElement | null => {
208
211
  if (!element) {
209
212
  return null
@@ -79,7 +79,7 @@ import frameworkUtils from '../../../utils/FrameworkUtils.ts'
79
79
  const props = withDefaults(
80
80
  defineProps<{
81
81
  modelValue: boolean
82
- businessId: string
82
+ businessId?: string
83
83
  task: IWfTaskVo
84
84
  }>(),
85
85
  {
@@ -5,69 +5,65 @@ import { type IWfTaskVo } from '../../src/interface/workflow/IWfTaskVo'
5
5
  import { userInfoStore } from '../../src/stores/userInfoStore'
6
6
  import frameworkUtil from '../../src/utils/FrameworkUtils'
7
7
 
8
- /**
9
- * 创建人:xux
10
- * 说明:
11
- * 创建时间: 2025/1/23 下午3:16
12
- * 修改时间: 2025/1/23 下午3:16
13
- */
14
- export async function showTodoDialog(taskVo: Ref<IWfTaskVo>, params: any) {
8
+ export async function showTodoDialog(
9
+ taskVo: Ref<IWfTaskVo>,
10
+ params: any
11
+ ) {
15
12
  if (taskVo.value && taskVo.value.nodeTag) {
16
13
  const nodeTag =
17
14
  taskVo.value.nodeTag.indexOf(':') > -1
18
- ? taskVo.value.nodeTag.split(':')[1]
15
+ ? taskVo.value.nodeTag.split(':')[1] || ''
19
16
  : taskVo.value.nodeTag
20
- const ps = [
21
- { code: 'businessId', value: taskVo.value?.businessId },
22
- { code: 'taskId', value: taskVo.value?.taskId },
23
- {
24
- code: 'nodeTag',
25
- value: taskVo.value.nodeTag,
26
- },
27
- ]
28
- params.value = ps
29
- if (taskVo.value?.nodeParam) {
30
- ps.push({ code: 'nodeParam', value: taskVo.value?.nodeParam })
17
+ const propertyList: Array<{ code: string, value: any }> = Object.entries(taskVo.value).map(([code, value]) => ({
18
+ code,
19
+ value
20
+ }))
21
+
22
+ if (params && params.value && Array.isArray(params.value) && params.value.length > 0) {
23
+ for (let param of params.value) {
24
+ if (param && typeof param === 'object') {
25
+ for (let valueKey in param) {
26
+ propertyList.push({ code: valueKey, value: param[valueKey] || '' })
27
+ }
28
+ }
29
+ }
31
30
  }
32
- if (taskVo.value.nodeTag.indexOf(':') > -1) {
33
- //子应用
34
- //表单页面
35
- if (taskVo.value.nodeTag.indexOf('/') > -1) {
36
- //给子应用组件发送bus事件
37
- WujieVue.bus.$emit(taskVo.value.nodeTag.split(':')[0] + 'WorkflowTodoBus', ps)
38
- } else {
39
- //菜单页面
40
- const find = userInfoStore().getUserInfo.menuList.find((c) => c.code === nodeTag)
41
- if (find) {
42
- const key = nodeTag + (Math.random() * 100000).toFixed(0)
43
- localStorage.setItem(key + '_message', JSON.stringify(taskVo.value))
44
- setTimeout(() => {
45
- localStorage.removeItem(key + '_message')
46
- }, 1000 * 10)
47
- let menu = frameworkUtil
48
- .getOpenMenuInfoWujie()
49
- .find((item: any) => item.id === taskVo.value.taskId)
50
- if (!menu) {
51
- menu = JSON.parse(JSON.stringify(find))
52
- if (menu) {
53
- menu.code = key
54
- menu.name = taskVo.value.taskName ? taskVo.value.taskName : menu.name
55
- menu.id = taskVo.value.taskId
56
- ps.push({ code: 'menuCode', value: menu.code })
57
- await WujieVue.bus.$emit('openMenu', menu, params)
58
- }
59
- } else {
60
- await WujieVue.bus.$emit('openMenu', menu)
31
+ //表单页面
32
+ if (taskVo.value.nodeTag.indexOf('/') > -1) {
33
+ //给子应用组件发送bus事件
34
+ WujieVue.bus.$emit(taskVo.value.nodeTag.split(':')[0] + 'WorkflowTodoBus', propertyList)
35
+ } else {
36
+ //菜单页面
37
+ const find = userInfoStore().getUserInfo.menuList.find((c) => c.code === nodeTag)
38
+ if (find) {
39
+ const key = nodeTag + (Math.random() * 100000).toFixed(0)
40
+ localStorage.setItem(key + '_message', JSON.stringify(taskVo.value))
41
+ setTimeout(() => {
42
+ localStorage.removeItem(key + '_message')
43
+ }, 1000 * 10)
44
+ let menu = frameworkUtil
45
+ .getOpenMenuInfoWujie()
46
+ .find((item: any) => item.id === taskVo.value.taskId)
47
+ if (!menu) {
48
+ menu = JSON.parse(JSON.stringify(find))
49
+ if (menu) {
50
+ menu.code = key
51
+ menu.name = taskVo.value.taskName ? taskVo.value.taskName : menu.name
52
+ menu.id = taskVo.value.taskId
53
+ propertyList.push({ code: 'menuCode', value: menu.code })
54
+ await WujieVue.bus.$emit('openMenu', menu, propertyList)
61
55
  }
62
- //给子应用组件发送bus事件
63
- setTimeout(() => {
64
- WujieVue.bus.$emit(taskVo.value?.nodeTag?.split(':')[0] + 'WorkflowTodoBus', ps)
65
- }, 1000)
66
- // await permissionHooks.openMenu(find)
67
- // WujieVue.bus.$emit(taskVo.value.nodeTag.split(':')[0] + 'WorkflowTodoBus', ps)
68
56
  } else {
69
- ElMessage.error('未找到该菜单')
57
+ await WujieVue.bus.$emit('openMenu', menu)
70
58
  }
59
+ //给子应用组件发送bus事件
60
+ setTimeout(() => {
61
+ WujieVue.bus.$emit(taskVo.value?.nodeTag?.split(':')[0] + 'WorkflowTodoBus', propertyList)
62
+ }, 1000)
63
+ // await permissionHooks.openMenu(find)
64
+ // WujieVue.bus.$emit(taskVo.value.nodeTag.split(':')[0] + 'WorkflowTodoBus', ps)
65
+ } else {
66
+ ElMessage.error('未找到该菜单')
71
67
  }
72
68
  }
73
69
  } else {