22
schangxiang@126.com
2025-05-21 40c6e31e722088fb5577552271eb0af7f695131e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// @ts-ignore
import sdk from 'sdk'
import BaseDialog from '../../components/BaseDialog/index.vue'
 
const {
  utils: { userInfo },
  models: {
    Language: { _t },
  },
} = sdk
 
const permissionCodes: any = ref([])
 
let permissions =
  process.env.NODE_ENV === 'development'
    ? []
    : //@ts-ignore
      window.app.current.project?.current.page?.permissions
const permission = {
  id: node?.id,
  name: node?.name,
  subs: [
    // {
    //   id: 'PersonnelQualification',
    //   name: '人员资质',
    // },
    {
      id: 'personnelQualification',
      name: '人员资质-打印',
    },
  ],
}
 
permissions.push(permission)
 
// mock data
if (process.env.NODE_ENV === 'development') {
  userInfo.permissions = {
    all: false,
    widgets: ['labelManagement-print'],
  }
}
 
if (userInfo.permissions.all) {
  permissionCodes.value = permission.subs.map((item) => item.id)
} else {
  permissionCodes.value = userInfo.permissions.widgets
}