king
2023-03-01 c2580fb8de3bdaabb4179b0ce0fcd2fbac802441
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/**
 * @description Wrap表单配置信息
 */
export default function (wrap) {
  let menulist = sessionStorage.getItem('fstMenuList')
  if (menulist) {
    try {
      menulist = JSON.parse(menulist)
    } catch (e) {
      menulist = []
    }
  } else {
    menulist = []
  }
 
  const wrapForm = [
    {
      type: 'text',
      field: 'name',
      label: '组件名称',
      initval: wrap.name || '',
      tooltip: '用于组件间的区分。',
      required: true
    },
    {
      type: 'number',
      field: 'width',
      label: '宽度',
      initval: wrap.width || 24,
      tooltip: '栅格布局,每行等分为24列。',
      min: 1,
      max: 24,
      precision: 0,
      required: true
    },
    {
      type: 'radio',
      field: 'readonly',
      label: '只读',
      initval: wrap.readonly || 'false',
      required: true,
      options: [
        {value: 'false', label: '否'},
        {value: 'true', label: '是'},
      ],
      controlFields: [
        {field: 'addable', values: ['false']},
      ]
    },
    {
      type: 'radio',
      field: 'addable',
      label: '可新增',
      initval: wrap.addable || 'false',
      required: true,
      options: [
        {value: 'false', label: '否'},
        {value: 'true', label: '是'},
      ],
      controlFields: [
        {field: 'linkmenu', values: ['true']},
      ],
    },
    {
      type: 'cascader',
      field: 'linkmenu',
      label: '关联菜单',
      initVal: wrap.linkmenu || [],
      required: true,
      options: menulist
    },
  ]
 
  return wrapForm