king
2023-03-11 34e7681fd12b1c4e4994d3bea1a553870e10bc50
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
/**
 * @description Wrap表单配置信息
 */
export default function (wrap) {
  let appType = sessionStorage.getItem('appType')
  let menulist = sessionStorage.getItem('appMenus')
  if (menulist) {
    try {
      menulist = JSON.parse(menulist)
    } catch (e) {
      menulist = []
    }
  } else {
    menulist = []
  }
 
  let msgTemps = sessionStorage.getItem('msgTemplate')
 
  if (msgTemps) {
    try {
      msgTemps = JSON.parse(msgTemps)
      msgTemps = msgTemps.map(item => {
        item.value = item.ID
        item.label = item.SignName + ' - ' + item.TemplateCode
        return item
      })
    } catch (e) {
      msgTemps = []
    }
  } else {
    msgTemps = []
  }
 
  const wrapForm = [
    {
      type: 'text',
      field: 'name',
      label: '组件名称',
      initval: wrap.name || '',
      tooltip: '用于组件间的区分。',
      required: true
    },
    {
      type: 'select',
      field: 'linkmenu',
      label: '关联菜单',
      initval: wrap.linkmenu || '',
      required: true,
      options: menulist
    },
    {
      type: 'number',
      field: 'width',
      label: '宽度',
      initval: wrap.width || 24,
      tooltip: '栅格布局,每行等分为24列。',
      min: 1,
      max: 24,
      precision: 0,
      required: true
    },
    // {
    //   type: 'number',
    //   field: 'maxWidth',
    //   label: '最大宽度',
    //   initval: wrap.maxWidth || '',
    //   tooltip: '登录框的最大宽度值。',
    //   min: 100,
    //   max: 2000,
    //   precision: 0,
    //   required: false
    // },
    // {
    //   type: 'styleInput',
    //   field: 'height',
    //   label: '最小高度',
    //   initval: wrap.height || '',
    //   tooltip: '组件占用的最小高度,用于页面布局。',
    //   required: false,
    //   options: ['px', 'vh', 'vw', '%']
    // },
    // {
    //   type: 'styleInput',
    //   field: 'maxWidth',
    //   label: '最大宽度',
    //   initval: wrap.maxWidth || '',
    //   tooltip: '组件占用的最大宽度,用于页面布局。',
    //   required: false,
    //   options: ['px', 'vh', 'vw', '%']
    // },
    {
      type: 'radio',
      field: 'topTip',
      label: '顶部提示',
      initval: wrap.topTip || 'show',
      tooltip: '登录或注册方式提示信息。',
      required: false,
      options: [
        {value: 'show', label: '显示'},
        {value: 'hidden', label: '隐藏'}
      ]
    },
    {
      type: 'styleInput',
      field: 'borderRadius',
      label: '圆角',
      initval: wrap.borderRadius || '',
      tooltip: '登录或注册时,确定按钮的圆角。',
      required: false,
      options: ['px', 'vh', 'vw', '%']
    },
    {
      type: 'radio',
      field: 'classify',
      label: '组件类型',
      initval: wrap.classify || 'login',
      tooltip: '注册登录都存在时,在公众号与小程序中优先显示注册,APP与H5中优先显示登录。',
      required: true,
      options: [
        { label: '登录', value: 'login' },
        { label: '注册', value: 'signin' },
        { label: '注册/登录', value: 'all' },
      ],
      controlFields: [
        {field: 'loginWays', values: ['login', 'all']},
        {field: 'logintip', values: ['login', 'all']},
        {field: 'signWays', values: ['signin', 'all']},
        {field: 'protocol', values: ['signin', 'all']},
        {field: 'signtip', values: ['signin', 'all']},
      ]
    },
    {
      type: 'hint',
      field: 'logintip',
      label: '登录配置'
    },
    {
      type: 'checkbox',
      field: 'loginWays',
      label: '登录方式',
      initval: wrap.loginWays || [],
      required: true,
      options: [
        { label: '账号', value: 'uname_pwd' },
        { label: '短信', value: 'sms_vcode' },
        { label: '扫码', value: 'app_scan', disabled: appType === 'mob' },
      ],
      controlFields: [
        {field: 'tempId', values: ['sms_vcode']},
        {field: 'shortcut', values: ['uname_pwd']},
      ]
    },
    {
      type: 'select', // $验证码$  $mob$  $send_type$
      field: 'tempId',
      label: '短信模板',
      initval: wrap.tempId || '',
      tooltip: '短信模板可在 云系统->应用服务->开发者中心->短信模板 处添加。',
      required: true,
      dropdown: 'false',
      options: msgTemps
    },
    {
      type: 'radio',
      field: 'shortcut',
      label: '快捷方式',
      initval: wrap.shortcut || 'remember',
      tooltip: '账号密码登录时的快捷方式。',
      required: false,
      options: [
        {value: 'none', label: '无'},
        {value: 'remember', label: '记住密码'},
        {value: 'autologon', label: '自动登录'},
      ]
    },
    {
      type: 'hint',
      field: 'signtip',
      label: '注册配置'
    },
    {
      type: 'checkbox',
      field: 'signWays',
      label: '注册方式',
      initval: wrap.signWays || [],
      tooltip: '微信授权只在小程序中有效。',
      required: true,
      options: [
        { label: '账号', value: 'uname_pwd' },
        { label: '短信', value: 'sms_vcode' },
        { label: '微信', value: 'weixin', disabled: appType !== 'mob' },
      ],
      controlFields: [
        {field: 'signTempId', values: ['sms_vcode']}
      ]
    },
    {
      type: 'select', // $验证码$  $mob$  $send_type$
      field: 'signTempId',
      label: '短信模板',
      initval: wrap.signTempId || '',
      tooltip: '短信模板可在 云系统->应用服务->开发者中心->短信模板 处添加。',
      required: true,
      dropdown: 'false',
      options: msgTemps
    },
    {
      type: 'radio',
      field: 'protocol',
      label: '协议',
      initval: wrap.protocol || 'false',
      required: false,
      options: [
        {value: 'false', label: '无'},
        {value: 'true', label: '有'},
      ],
      controlFields: [
        {field: 'tip', values: ['true']},
        {field: 'groups', values: ['true']},
      ]
    },
    {
      type: 'text',
      field: 'tip',
      label: '提示文字',
      initval: wrap.tip || '我已阅读并同意',
      required: true
    },
    {
      type: 'table',
      field: 'groups',
      label: '协议组',
      initval: wrap.groups || [],
      required: true,
      span: 24,
      columns: [
        {
          title: '文本',
          dataIndex: 'label',
          inputType: 'input',
          editable: true,
          unique: true,
          required: true,
          width: '35%'
        },
        {
          title: '链接',
          dataIndex: 'link',
          inputType: 'input',
          editable: true,
          unique: true,
          required: true,
          width: '40%'
        },
      ]
    }
  ]
 
  return wrapForm