tianheng-ui 0.1.66 → 0.1.68

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,437 +1,3 @@
1
- const toolsConfig = {
2
- add: {
3
- act: "add",
4
- name: "",
5
- type: "primary",
6
- icon: "el-icon-plus",
7
- disabled: false,
8
- loading: false
9
- },
10
- edit: {
11
- act: "edit",
12
- name: "",
13
- type: "text",
14
- icon: "el-icon-edit",
15
- disabled: false,
16
- loading: false
17
- },
18
- detail: {
19
- act: "detail",
20
- name: "",
21
- type: "text",
22
- icon: "el-icon-view",
23
- disabled: false,
24
- loading: false
25
- },
26
- delete: {
27
- act: "delete",
28
- name: "",
29
- type: "text",
30
- icon: "el-icon-delete",
31
- style: "color:#ff4949;",
32
- disabled: false,
33
- loading: false
34
- },
35
- batchDelete: {
36
- act: "batchDelete",
37
- name: "",
38
- type: "danger",
39
- icon: "el-icon-delete",
40
- disabled: false,
41
- loading: false
42
- },
43
- export: {
44
- act: "export",
45
- name: "",
46
- type: "primary",
47
- icon: "el-icon-download",
48
- disabled: false,
49
- loading: false
50
- },
51
- import: {
52
- act: "import",
53
- name: "",
54
- type: "primary",
55
- icon: "el-icon-upload2",
56
- disabled: false,
57
- loading: false
58
- }
59
- };
60
-
61
- export const toolsItemConfig = (key, data) => {
62
- let config = toolsConfig[key] || {};
63
- config = JSON.parse(JSON.stringify(config));
64
- config.name = data.name;
65
- return config;
66
- };
67
-
68
- const formConfig = {
69
- "1": {
70
- list: [
71
- {
72
- name: "平台名称",
73
- type: "input",
74
- icon: "icon-input",
75
- options: {
76
- width: "100%",
77
- labelWidth: 100,
78
- isLabelWidth: false,
79
- defaultValue: "",
80
- dataType: "string",
81
- pattern: "",
82
- placeholder: "",
83
- maxlength: -1,
84
- required: true,
85
- disabled: false,
86
- readonly: false,
87
- clearable: false,
88
- showWordLimit: false,
89
- showPassword: false,
90
- prefixIcon: "",
91
- suffixIcon: "",
92
- prepend: "",
93
- append: "",
94
- hidden: false,
95
- hideLabel: false
96
- },
97
- events: {
98
- onChange: "",
99
- onFocus: "",
100
- onBlur: ""
101
- },
102
- rules: [
103
- {
104
- type: "string",
105
- message: "平台名称格式不正确"
106
- },
107
- {
108
- required: true,
109
- message: "平台名称必须填写"
110
- }
111
- ],
112
- key: "1669859814000_5209",
113
- model: "name"
114
- },
115
- {
116
- name: "平台分类",
117
- type: "select",
118
- icon: "icon-select",
119
- options: {
120
- width: "100%",
121
- labelWidth: 100,
122
- isLabelWidth: false,
123
- defaultValue: "",
124
- multiple: false,
125
- disabled: false,
126
- clearable: false,
127
- placeholder: "",
128
- required: false,
129
- showLabel: false,
130
- collapseTags: false,
131
- allowCreate: false,
132
- options: [
133
- {
134
- value: "Option 1"
135
- },
136
- {
137
- value: "Option 2"
138
- },
139
- {
140
- value: "Option 3"
141
- }
142
- ],
143
- remote: true,
144
- filterable: false,
145
- remoteOptions: [],
146
- props: {
147
- value: "id",
148
- label: "name"
149
- },
150
- remoteFunc: "getUserList",
151
- hidden: false,
152
- hideLabel: false
153
- },
154
- events: {
155
- onChange: "",
156
- onFocus: "",
157
- onBlur: ""
158
- },
159
- key: "1669859824000_68681",
160
- model: "projectTypeId",
161
- rules: []
162
- },
163
- {
164
- name: "访问地址",
165
- type: "input",
166
- icon: "icon-input",
167
- options: {
168
- width: "100%",
169
- labelWidth: 100,
170
- isLabelWidth: false,
171
- defaultValue: "",
172
- dataType: "url",
173
- pattern: "",
174
- placeholder: "",
175
- maxlength: -1,
176
- required: false,
177
- disabled: false,
178
- readonly: false,
179
- clearable: false,
180
- showWordLimit: false,
181
- showPassword: false,
182
- prefixIcon: "",
183
- suffixIcon: "",
184
- prepend: "",
185
- append: "",
186
- hidden: false,
187
- hideLabel: false
188
- },
189
- events: {
190
- onChange: "",
191
- onFocus: "",
192
- onBlur: ""
193
- },
194
- rules: [
195
- {
196
- type: "url",
197
- message: "访问地址格式不正确"
198
- }
199
- ],
200
- key: "1669859816000_814",
201
- model: "targetUrl"
202
- }
203
- ],
204
- config: {
205
- ui: "element",
206
- title: "",
207
- width: "",
208
- labelWidth: 100,
209
- labelPosition: "right",
210
- labelSuffix: ":",
211
- size: "small",
212
- disabled: false,
213
- hideLabel: false,
214
- eventScript: [
215
- {
216
- key: "mounted",
217
- name: "mounted",
218
- func: ""
219
- },
220
- {
221
- key: "refresh",
222
- name: "refresh",
223
- func: ""
224
- }
225
- ]
226
- }
227
- },
228
- "2": {}
229
- };
230
-
231
- export const formItemConfig = key => {
232
- const config = formConfig[key] || {};
233
- return JSON.parse(JSON.stringify(config));
234
- };
235
-
236
- const tableConfig = {
237
- "1": {
238
- search: {
239
- show: true,
240
- options: [
241
- {
242
- type: "input",
243
- label: "平台名称",
244
- prop: "name",
245
- defaultValue: "",
246
- align: "left",
247
- width: 0
248
- }
249
- ]
250
- },
251
- table: {
252
- options: [
253
- {
254
- label: "平台名称",
255
- type: "input",
256
- prop: "name",
257
- align: "left"
258
- },
259
- {
260
- label: "平台分类",
261
- type: "select",
262
- prop: "projectTypeName",
263
- align: "left",
264
- width: 0
265
- },
266
- {
267
- label: "访问地址",
268
- type: "input",
269
- prop: "targetUrl",
270
- align: "left",
271
- width: 0
272
- },
273
- {
274
- label: "编辑人",
275
- type: "input",
276
- prop: "user",
277
- sortable: true,
278
- align: "left",
279
- width: 0
280
- }
281
- ],
282
- pageInfo: {
283
- show: false,
284
- options: {
285
- pageCount: 0, // 总页数
286
- pageSize: 20, // 每页展示的条数
287
- currentPage: 1, // 当前页码
288
- total: 0, // 总条数
289
- sizes: [10, 20, 30, 50, 100]
290
- }
291
- },
292
- sort: { type: "1", key: "createTime" },
293
- loading: { show: false, text: "加载中", image: "" },
294
- empty: { show: true, text: "暂无数据", image: "" },
295
- sequence: true
296
- },
297
- tools: {
298
- add: { show: true, name: "新增", position: 1, form: { id: "1" } },
299
- edit: { show: true, name: "编辑", position: 2, form: { id: "1" } },
300
- detail: { show: false, name: "查看", position: 2, form: { id: "1" } },
301
- delete: { show: true, name: "删除", position: 2 },
302
- batchDelete: { show: true, name: "批量删除", position: 1 },
303
- export: { show: true, name: "导出", position: 1 },
304
- import: { show: true, name: "导入", position: 1 },
305
- key_123456: {}
306
- },
307
- network: {
308
- mounted: {
309
- name: "获取列表",
310
- api: "tenant/project/list",
311
- method: "post"
312
- },
313
- add: {
314
- name: "新增",
315
- api: "tenant/project/add",
316
- method: "post"
317
- },
318
- edit: {
319
- name: "编辑",
320
- api: "tenant/project/edit",
321
- method: "post"
322
- },
323
- delete: {
324
- name: "删除",
325
- api: "tenant/project/delete",
326
- method: "post"
327
- },
328
- key_123456: {
329
- name: "获取列表",
330
- url: "https://"
331
- }
332
- }
333
- },
334
- "2": {
335
- search: {
336
- show: false,
337
- options: []
338
- },
339
- table: {
340
- options: [
341
- {
342
- label: "平台名称",
343
- type: "input",
344
- prop: "name",
345
- align: "left"
346
- },
347
- {
348
- label: "平台分类",
349
- type: "select",
350
- prop: "projectTypeName",
351
- align: "left",
352
- width: 0
353
- },
354
- {
355
- label: "访问地址",
356
- type: "input",
357
- prop: "targetUrl",
358
- align: "left",
359
- width: 0
360
- },
361
- {
362
- label: "编辑人",
363
- type: "input",
364
- prop: "user",
365
- sortable: true,
366
- align: "left",
367
- width: 0
368
- },
369
- {
370
- label: "编辑时间",
371
- type: "input",
372
- prop: "updateTime",
373
- align: "left",
374
- width: 0
375
- }
376
- ],
377
- pageInfo: {
378
- show: true,
379
- options: {
380
- pageCount: 0, // 总页数
381
- pageSize: 20, // 每页展示的条数
382
- currentPage: 1, // 当前页码
383
- total: 0, // 总条数
384
- sizes: [10, 20, 30, 50, 100]
385
- }
386
- },
387
- sort: { type: "1", key: "createTime" },
388
- loading: { show: false, text: "加载中", image: "" },
389
- empty: { show: true, text: "暂无数据", image: "" },
390
- sequence: true
391
- },
392
- tools: {
393
- add: { show: true, name: "新增", position: 1, form: { id: "1" } },
394
- edit: { show: true, name: "编辑", position: 2, form: { id: "1" } },
395
- detail: { show: false, name: "查看", position: 2, form: { id: "1" } },
396
- delete: { show: true, name: "删除", position: 2 },
397
- batchDelete: { show: false, name: "批量删除", position: 1 },
398
- export: { show: false, name: "导出", position: 1 },
399
- import: { show: false, name: "导入", position: 1 }
400
- },
401
- network: {
402
- mounted: {
403
- name: "获取列表",
404
- api: "tenant/project/list",
405
- method: "post"
406
- },
407
- add: {
408
- name: "新增",
409
- api: "tenant/project/add",
410
- method: "post"
411
- },
412
- edit: {
413
- name: "编辑",
414
- api: "tenant/project/edit",
415
- method: "post"
416
- },
417
- delete: {
418
- name: "删除",
419
- api: "tenant/project/delete",
420
- method: "post"
421
- },
422
- key_123456: {
423
- name: "获取列表",
424
- url: "https://"
425
- }
426
- }
427
- }
428
- };
429
-
430
- export const tableItemConfig = key => {
431
- const config = tableConfig[key] || null;
432
- return JSON.parse(JSON.stringify(config));
433
- };
434
-
435
1
  export const deepClone = (obj, clone) => {
436
2
  //判断拷贝的要进行深拷贝的是数组还是对象,是数组的话进行数组拷贝,对象的话进行对象拷贝
437
3
  const toString = Object.prototype.toString;
@@ -514,4 +80,4 @@ export const setProperty = (obj = {}, str = "", value = "", isClone) => {
514
80
  }
515
81
  }
516
82
  return dic;
517
- };
83
+ };