king
2022-10-22 03a22ec6f9ad7303d10b4c65bb5bc6fa5cbd448a
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
49
50
51
52
53
54
55
56
/**
 * @description tab表单配置信息
 */
export function getTabForm(tab) {
  let roleList = sessionStorage.getItem('sysRoles')
 
  if (roleList) {
    try {
      roleList = JSON.parse(roleList)
    } catch (e) {
      roleList = []
    }
  } else {
    roleList = []
  }
 
  const tabForm = [
    {
      type: 'text',
      field: 'label',
      label: '名称',
      initval: tab.label || '',
      required: true,
      focus: true
    },
    {
      type: 'mkicon',
      field: 'icon',
      label: '图标',
      initval: tab.icon || '',
      required: false,
      allowClear: true
    },
    {
      type: 'radio',
      field: 'hide',
      label: '隐藏',
      initval: tab.hide || 'false',
      required: false,
      options: [
        {value: 'false', label: '否'},
        {value: 'true', label: '是'},
      ],
    },
    {
      type: 'multiselect',
      field: 'blacklist',
      label: '黑名单',
      initval: tab.blacklist || [],
      required: false,
      options: roleList
    },
  ]
 
  return tabForm
}