adtec-core-package 2.3.4 → 2.3.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.3.4",
3
+ "version": "2.3.6",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -10,22 +10,33 @@
10
10
  import { useRoute } from 'vue-router'
11
11
  import type { ISysMenuInfoVo } from '../../interface/ISysMenuInfoVo.ts'
12
12
  import { computed } from 'vue'
13
-
13
+ import { userInfoStore } from '../../stores/userInfoStore.ts'
14
+ const userInfo = userInfoStore()
14
15
  const props = defineProps<{
15
- operCode: string | string[]
16
+ operCode: string | string[],
17
+ menuCode?: string
16
18
  }>()
17
19
 
18
20
  const route = useRoute()
19
-
20
21
  const formatedOperCode = computed(() => {
21
22
  return Array.isArray(props.operCode) ? props.operCode : [props.operCode]
22
23
  })
23
-
24
24
  const isOperationAuth = () => {
25
- const data = route.meta?.sysMenuData as ISysMenuInfoVo
26
- if (!data?.operation) return false
27
- const o = data.operation.find((c) => formatedOperCode.value.includes(c.code))
28
- return !!o
25
+ if(props.menuCode){
26
+ const find = userInfo.getUserInfo.menuList.find((c) => c.code === props.menuCode)
27
+ if (find) {
28
+ if (!find?.operation) return false
29
+ const o = find.operation.find((c) => formatedOperCode.value.includes(c.code))
30
+ return !!o
31
+ }else{
32
+ return false
33
+ }
34
+ }else {
35
+ const data = route.meta?.sysMenuData as ISysMenuInfoVo
36
+ if (!data?.operation) return false
37
+ const o = data.operation.find((c) => formatedOperCode.value.includes(c.code))
38
+ return !!o
39
+ }
29
40
  }
30
41
  </script>
31
42
 
@@ -19,17 +19,18 @@
19
19
  <script setup lang="ts">
20
20
  import type { IParameter } from '../../interface/Message'
21
21
  import { nextTick, onMounted, onUnmounted, ref } from 'vue'
22
- const applicationModule = import.meta.env.VITE_APPLICATION_MODULE
23
22
  import TaskOperation from './TaskOperation.vue'
24
23
  import modules from '../../utils/modules'
25
24
  import { ElMessage } from 'element-plus'
26
25
  import { useEventBus } from '@vueuse/core'
26
+
27
+ const applicationModule = import.meta.env.VITE_APPLICATION_MODULE
27
28
  // const emit = defineEmits(['workflowComplete'])
28
29
  const compInst = ref()
29
30
  const compRef = ref()
30
31
  const showComp = ref(false)
31
32
  const taskId = ref('')
32
- const taskOperationShow=ref(true)
33
+ const taskOperationShow = ref(true)
33
34
  onMounted(() => {
34
35
  //@ts-ignore
35
36
  window.$wujie?.bus.$off(applicationModule + 'WorkflowTodoBus')
@@ -55,7 +56,6 @@ const initTodoDialog = async (params: IParameter[]) => {
55
56
  return
56
57
  }
57
58
  if (linkModelPath) {
58
-
59
59
  if (linkModelPath.indexOf('/') > -1) {
60
60
  //组件
61
61
  showComp.value = true
@@ -72,11 +72,13 @@ const initTodoDialog = async (params: IParameter[]) => {
72
72
  taskId: taskId.value,
73
73
  nodeTag: params?.find((x: IParameter) => x.code === 'nodeTag')?.value,
74
74
  nodeParam: params?.find((x: IParameter) => x.code === 'nodeParam')?.value,
75
+ taskName: params?.find((x: IParameter) => x.code === 'taskName')?.value,
75
76
  }
76
77
  compRef.value?.initByWorkflow(wParam)
77
78
  }
78
79
  })
79
- } else { //菜单
80
+ } else {
81
+ //菜单
80
82
  const menuCode = params?.find((x: IParameter) => x.code === 'menuCode')?.value
81
83
  const bus = useEventBus<IParameter[]>((menuCode ?? linkModelPath) + '_message')
82
84
  bus.emit(params)