king
2024-04-29 50b49c1b760489c3430fc382656d57c5fbbab07c
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
import MenuUtils from '@/utils/utils-custom.js'
/**
 * @description Wrap表单配置信息
 */
export default function (wrap, uuid) {
  let roleList = sessionStorage.getItem('sysRoles')
  let appType = sessionStorage.getItem('appType')
 
  if (roleList) {
    try {
      roleList = JSON.parse(roleList)
    } catch (e) {
      roleList = []
    }
  } else {
    roleList = []
  }
 
  let menu = window.GLOB.customMenu
  let modules = MenuUtils.getSupModules(menu.components, uuid, menu.interfaces)
 
  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: 'advanceType',
      label: '高级搜索',
      initval: wrap.advanceType || 'modal',
      required: false,
      options: [
        {value: 'modal', label: '弹窗'},
        {value: 'drawer', label: '抽屉'},
        {value: 'pulldown', label: '下拉'}
      ],
      controlFields: [
        {field: 'advanceWidth', values: ['modal', 'drawer']},
        {field: 'drawerPlacement', values: ['drawer']}
      ]
    },
    {
      type: 'radio',
      field: 'drawerPlacement',
      label: '弹出方向',
      initval: wrap.drawerPlacement || 'right',
      required: false,
      options: [
        {value: 'right', label: '右侧'},
        {value: 'left', label: '左侧'},
        {value: 'top', label: '上侧'},
        {value: 'bottom', label: '下侧'}
      ]
    },
    {
      type: 'number',
      field: 'advanceWidth',
      label: '弹窗宽度',
      initval: wrap.advanceWidth || 1000,
      tooltip: '高级搜索弹窗的宽度,注:当宽度值小于100时表示占窗口的百分比,大于100时表示宽度的绝对值。当使用上下显示的抽屉时代表抽屉高度。',
      min: 10,
      max: 3000,
      precision: 0,
      required: false
    },
    {
      type: 'number',
      field: 'searchRatio',
      label: '按钮比例',
      initval: wrap.searchRatio || 6,
      tooltip: '搜索及重置按钮所占比例。栅格布局,每行等分为24列。',
      min: 1,
      max: 24,
      precision: 0,
      required: true
    },
    {
      type: 'number',
      field: 'searchLwidth',
      label: '按钮偏移',
      initval: wrap.searchLwidth !== undefined ? wrap.searchLwidth : 33.3,
      tooltip: '搜索按钮距左侧的百分比,参照搜索条件的名称宽度。',
      min: 0,
      max: 100,
      precision: 1,
      required: true
    },
    {
      type: 'radio',
      field: 'float',
      label: '对齐',
      initval: wrap.float || 'left',
      required: false,
      options: [
        {value: 'left', label: '左对齐'},
        {value: 'right', label: '右对齐'},
      ]
    },
    {
      type: 'radio',
      field: 'show',
      label: '搜索按钮',
      initval: wrap.show || 'true',
      required: false,
      options: [
        {value: 'true', label: '显示'},
        {value: 'false', label: '隐藏'},
      ],
      controlFields: [
        {field: 'borderRadius', values: ['true']},
        {field: 'resetContrl', values: ['true']}
      ]
    },
    {
      type: 'number',
      field: 'borderRadius',
      label: '按钮圆角',
      initval: wrap.borderRadius || '',
      tooltip: '搜索和重置按钮的圆角。',
      required: false
    },
    {
      type: 'radio',
      field: 'resetContrl',
      label: '重置时',
      initval: wrap.resetContrl || 'init',
      required: false,
      options: [
        {value: 'init', label: '恢复初始值'},
        {value: 'clear', label: '清空'},
      ],
    },
    {
      type: 'radio',
      field: 'permission',
      label: '权限验证',
      initval: wrap.permission || 'false',
      required: false,
      options: [
        {value: 'true', label: '启用'},
        {value: 'false', label: '禁用'},
      ],
      forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview'
    },
    {
      type: 'radio',
      field: 'cacheSearch',
      label: '搜索缓存',
      initval: wrap.cacheSearch || 'false',
      tooltip: '启用搜索条件缓存后,在菜单刷新时搜索条件不变。',
      required: false,
      options: [
        {value: 'true', label: '启用'},
        {value: 'false', label: '禁用'},
      ],
      forbid: !!appType
    },
    {
      type: 'cascader',
      field: 'supModule',
      label: '上级组件',
      initval: wrap.supModule || [],
      required: false,
      options: modules,
      forbid: sessionStorage.getItem('editMenuType') === 'popview'
    },
    {
      type: 'multiselect',
      field: 'blacklist',
      label: '黑名单',
      initval: wrap.blacklist || [],
      required: false,
      options: roleList,
      forbid: !!appType
    },
  ]
 
  return wrapForm