tianheng-ui 0.0.80 → 0.0.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tianheng-ui.js +5 -5
- package/package.json +1 -1
- package/packages/FormMaking/GenerateForm.vue +3 -3
- package/packages/FormMaking/GenerateFormItem.vue +10 -15
- package/packages/FormMaking/index.vue +6 -1
- package/packages/Table/search.vue +3 -0
- package/packages/TableMaking/generateTable.vue +113 -44
- package/packages/TableMaking/index.vue +36 -2
- package/packages/TableMaking/util/Log.js +99 -0
- package/packages/TableMaking/util/axios.js +10 -11
- package/packages/TableMaking/util/index.js +341 -90
@@ -61,109 +61,143 @@ const toolsConfig = {
|
|
61
61
|
export const toolsItemConfig = (key, data) => {
|
62
62
|
const config = toolsConfig[key] || {};
|
63
63
|
config.name = data.name;
|
64
|
-
return
|
64
|
+
return JSON.parse(JSON.stringify(config));
|
65
65
|
};
|
66
66
|
|
67
67
|
const formConfig = {
|
68
68
|
"1": {
|
69
69
|
list: [
|
70
70
|
{
|
71
|
-
name: "
|
72
|
-
type: "
|
73
|
-
icon: "icon-
|
74
|
-
|
71
|
+
name: "平台名称",
|
72
|
+
type: "input",
|
73
|
+
icon: "icon-input",
|
74
|
+
options: {
|
75
|
+
width: "100%",
|
76
|
+
labelWidth: 100,
|
77
|
+
isLabelWidth: false,
|
78
|
+
defaultValue: "",
|
79
|
+
dataType: "string",
|
80
|
+
pattern: "",
|
81
|
+
placeholder: "",
|
82
|
+
maxlength: -1,
|
83
|
+
required: true,
|
84
|
+
disabled: false,
|
85
|
+
readonly: false,
|
86
|
+
clearable: false,
|
87
|
+
showWordLimit: false,
|
88
|
+
showPassword: false,
|
89
|
+
prefixIcon: "",
|
90
|
+
suffixIcon: "",
|
91
|
+
prepend: "",
|
92
|
+
append: "",
|
93
|
+
hidden: false,
|
94
|
+
hideLabel: false
|
95
|
+
},
|
96
|
+
events: {
|
97
|
+
onChange: "",
|
98
|
+
onFocus: "",
|
99
|
+
onBlur: ""
|
100
|
+
},
|
101
|
+
rules: [
|
75
102
|
{
|
76
|
-
|
77
|
-
|
78
|
-
{
|
79
|
-
name: "分类名称",
|
80
|
-
type: "input",
|
81
|
-
icon: "icon-input",
|
82
|
-
options: {
|
83
|
-
width: "100%",
|
84
|
-
labelWidth: 100,
|
85
|
-
isLabelWidth: false,
|
86
|
-
defaultValue: "",
|
87
|
-
dataType: "string",
|
88
|
-
pattern: "",
|
89
|
-
placeholder: "",
|
90
|
-
maxlength: -1,
|
91
|
-
required: true,
|
92
|
-
disabled: false,
|
93
|
-
readonly: false,
|
94
|
-
clearable: false,
|
95
|
-
showWordLimit: false,
|
96
|
-
showPassword: false,
|
97
|
-
prefixIcon: "",
|
98
|
-
suffixIcon: "",
|
99
|
-
prepend: "",
|
100
|
-
append: "",
|
101
|
-
hidden: false,
|
102
|
-
hideLabel: false
|
103
|
-
},
|
104
|
-
events: {
|
105
|
-
onChange: "",
|
106
|
-
onFocus: "",
|
107
|
-
onBlur: ""
|
108
|
-
},
|
109
|
-
rules: [
|
110
|
-
{
|
111
|
-
type: "string",
|
112
|
-
message: "分类名称格式不正确"
|
113
|
-
},
|
114
|
-
{
|
115
|
-
required: true,
|
116
|
-
message: "分类名称必须填写"
|
117
|
-
}
|
118
|
-
],
|
119
|
-
key: "1669798313000_73831",
|
120
|
-
model: "name"
|
121
|
-
}
|
122
|
-
]
|
103
|
+
type: "string",
|
104
|
+
message: "平台名称格式不正确"
|
123
105
|
},
|
124
106
|
{
|
125
|
-
|
126
|
-
|
127
|
-
{
|
128
|
-
name: "排序",
|
129
|
-
type: "number",
|
130
|
-
icon: "icon-number",
|
131
|
-
options: {
|
132
|
-
width: "100%",
|
133
|
-
labelWidth: 100,
|
134
|
-
isLabelWidth: false,
|
135
|
-
required: false,
|
136
|
-
defaultValue: 0,
|
137
|
-
min: 0,
|
138
|
-
max: 999,
|
139
|
-
step: 1,
|
140
|
-
disabled: false,
|
141
|
-
controlsPosition: true,
|
142
|
-
precision: 0,
|
143
|
-
hidden: false,
|
144
|
-
hideLabel: false
|
145
|
-
},
|
146
|
-
events: {
|
147
|
-
onChange: "",
|
148
|
-
onFocus: "",
|
149
|
-
onBlur: ""
|
150
|
-
},
|
151
|
-
key: "1669798320000_2131",
|
152
|
-
model: "sort",
|
153
|
-
rules: []
|
154
|
-
}
|
155
|
-
]
|
107
|
+
required: true,
|
108
|
+
message: "平台名称必须填写"
|
156
109
|
}
|
157
110
|
],
|
111
|
+
key: "1669859814000_5209",
|
112
|
+
model: "name"
|
113
|
+
},
|
114
|
+
{
|
115
|
+
name: "平台分类",
|
116
|
+
type: "select",
|
117
|
+
icon: "icon-select",
|
158
118
|
options: {
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
119
|
+
width: "100%",
|
120
|
+
labelWidth: 100,
|
121
|
+
isLabelWidth: false,
|
122
|
+
defaultValue: "",
|
123
|
+
multiple: false,
|
124
|
+
disabled: false,
|
125
|
+
clearable: false,
|
126
|
+
placeholder: "",
|
127
|
+
required: false,
|
128
|
+
showLabel: false,
|
129
|
+
collapseTags: false,
|
130
|
+
allowCreate: false,
|
131
|
+
options: [
|
132
|
+
{
|
133
|
+
value: "Option 1"
|
134
|
+
},
|
135
|
+
{
|
136
|
+
value: "Option 2"
|
137
|
+
},
|
138
|
+
{
|
139
|
+
value: "Option 3"
|
140
|
+
}
|
141
|
+
],
|
142
|
+
remote: true,
|
143
|
+
filterable: false,
|
144
|
+
remoteOptions: [],
|
145
|
+
props: {
|
146
|
+
value: "id",
|
147
|
+
label: "name"
|
148
|
+
},
|
149
|
+
remoteFunc: "getUserList",
|
150
|
+
hidden: false,
|
151
|
+
hideLabel: false
|
152
|
+
},
|
153
|
+
events: {
|
154
|
+
onChange: "",
|
155
|
+
onFocus: "",
|
156
|
+
onBlur: ""
|
163
157
|
},
|
164
|
-
key: "
|
165
|
-
model: "
|
158
|
+
key: "1669859824000_68681",
|
159
|
+
model: "projectTypeId",
|
166
160
|
rules: []
|
161
|
+
},
|
162
|
+
{
|
163
|
+
name: "访问地址",
|
164
|
+
type: "input",
|
165
|
+
icon: "icon-input",
|
166
|
+
options: {
|
167
|
+
width: "100%",
|
168
|
+
labelWidth: 100,
|
169
|
+
isLabelWidth: false,
|
170
|
+
defaultValue: "",
|
171
|
+
dataType: "url",
|
172
|
+
pattern: "",
|
173
|
+
placeholder: "",
|
174
|
+
maxlength: -1,
|
175
|
+
required: false,
|
176
|
+
disabled: false,
|
177
|
+
readonly: false,
|
178
|
+
clearable: false,
|
179
|
+
showWordLimit: false,
|
180
|
+
showPassword: false,
|
181
|
+
prefixIcon: "",
|
182
|
+
suffixIcon: "",
|
183
|
+
prepend: "",
|
184
|
+
append: "",
|
185
|
+
hidden: false,
|
186
|
+
hideLabel: false
|
187
|
+
},
|
188
|
+
events: {
|
189
|
+
onChange: "",
|
190
|
+
onFocus: "",
|
191
|
+
onBlur: ""
|
192
|
+
},
|
193
|
+
rules: [
|
194
|
+
{
|
195
|
+
type: "url",
|
196
|
+
message: "访问地址格式不正确"
|
197
|
+
}
|
198
|
+
],
|
199
|
+
key: "1669859816000_814",
|
200
|
+
model: "targetUrl"
|
167
201
|
}
|
168
202
|
],
|
169
203
|
config: {
|
@@ -194,5 +228,222 @@ const formConfig = {
|
|
194
228
|
|
195
229
|
export const formItemConfig = key => {
|
196
230
|
const config = formConfig[key] || {};
|
197
|
-
return config;
|
231
|
+
return JSON.parse(JSON.stringify(config));
|
232
|
+
};
|
233
|
+
|
234
|
+
const tableConfig = {
|
235
|
+
"1": {
|
236
|
+
search: {
|
237
|
+
show: true,
|
238
|
+
options: [
|
239
|
+
{
|
240
|
+
type: "input",
|
241
|
+
label: "姓名",
|
242
|
+
prop: "name",
|
243
|
+
defaultValue: "",
|
244
|
+
align: "left",
|
245
|
+
width: 0
|
246
|
+
}
|
247
|
+
// {
|
248
|
+
// type: "select",
|
249
|
+
// label: "性别",
|
250
|
+
// prop: "gender",
|
251
|
+
// align: "left",
|
252
|
+
// width: 0,
|
253
|
+
// staticData: [
|
254
|
+
// { label: "男", value: "1" },
|
255
|
+
// { label: "女", value: "0" }
|
256
|
+
// ]
|
257
|
+
// }
|
258
|
+
]
|
259
|
+
},
|
260
|
+
table: {
|
261
|
+
options: [
|
262
|
+
{
|
263
|
+
label: "平台名称",
|
264
|
+
type: "input",
|
265
|
+
prop: "name",
|
266
|
+
align: "left"
|
267
|
+
},
|
268
|
+
{
|
269
|
+
label: "平台分类",
|
270
|
+
type: "select",
|
271
|
+
prop: "projectTypeName",
|
272
|
+
align: "left",
|
273
|
+
width: 0
|
274
|
+
},
|
275
|
+
{
|
276
|
+
label: "访问地址",
|
277
|
+
type: "input",
|
278
|
+
prop: "targetUrl",
|
279
|
+
align: "left",
|
280
|
+
width: 0
|
281
|
+
},
|
282
|
+
{
|
283
|
+
label: "编辑人",
|
284
|
+
type: "input",
|
285
|
+
prop: "user",
|
286
|
+
sortable: true,
|
287
|
+
align: "left",
|
288
|
+
width: 0
|
289
|
+
},
|
290
|
+
{
|
291
|
+
label: "编辑时间",
|
292
|
+
type: "input",
|
293
|
+
prop: "updateTime",
|
294
|
+
align: "left",
|
295
|
+
width: 0
|
296
|
+
}
|
297
|
+
],
|
298
|
+
pageInfo: {
|
299
|
+
show: true,
|
300
|
+
options: {
|
301
|
+
pageCount: 0, // 总页数
|
302
|
+
pageSize: 20, // 每页展示的条数
|
303
|
+
currentPage: 1, // 当前页码
|
304
|
+
total: 0, // 总条数
|
305
|
+
sizes: [10, 20, 30, 50, 100]
|
306
|
+
}
|
307
|
+
},
|
308
|
+
sort: { type: "1", key: "createTime" },
|
309
|
+
loading: { show: false, text: "加载中", image: "" },
|
310
|
+
empty: { show: true, text: "暂无数据", image: "" },
|
311
|
+
sequence: true
|
312
|
+
},
|
313
|
+
tools: {
|
314
|
+
add: { show: true, name: "新增", position: 1, form: { id: "1" } },
|
315
|
+
edit: { show: true, name: "编辑", position: 2, form: { id: "1" } },
|
316
|
+
detail: { show: false, name: "查看", position: 2, form: { id: "1" } },
|
317
|
+
delete: { show: true, name: "删除", position: 2 },
|
318
|
+
batchDelete: { show: true, name: "批量删除", position: 1 },
|
319
|
+
export: { show: true, name: "导出", position: 1 },
|
320
|
+
import: { show: true, name: "导入", position: 1 },
|
321
|
+
key_123456:{}
|
322
|
+
},
|
323
|
+
network: {
|
324
|
+
mounted: {
|
325
|
+
name: "获取列表",
|
326
|
+
api: "tenant/project/list",
|
327
|
+
method: "post"
|
328
|
+
},
|
329
|
+
add: {
|
330
|
+
name: "新增",
|
331
|
+
api: "tenant/project/add",
|
332
|
+
method: "post"
|
333
|
+
},
|
334
|
+
edit: {
|
335
|
+
name: "编辑",
|
336
|
+
api: "tenant/project/edit",
|
337
|
+
method: "post"
|
338
|
+
},
|
339
|
+
delete: {
|
340
|
+
name: "删除",
|
341
|
+
api: "tenant/project/delete",
|
342
|
+
method: "post"
|
343
|
+
},
|
344
|
+
key_123456: {
|
345
|
+
name: "获取列表",
|
346
|
+
url: "https://"
|
347
|
+
}
|
348
|
+
}
|
349
|
+
},
|
350
|
+
"2": {
|
351
|
+
search: {
|
352
|
+
show: false,
|
353
|
+
options: []
|
354
|
+
},
|
355
|
+
table: {
|
356
|
+
options: [
|
357
|
+
{
|
358
|
+
label: "平台名称",
|
359
|
+
type: "input",
|
360
|
+
prop: "name",
|
361
|
+
align: "left"
|
362
|
+
},
|
363
|
+
{
|
364
|
+
label: "平台分类",
|
365
|
+
type: "select",
|
366
|
+
prop: "projectTypeName",
|
367
|
+
align: "left",
|
368
|
+
width: 0
|
369
|
+
},
|
370
|
+
{
|
371
|
+
label: "访问地址",
|
372
|
+
type: "input",
|
373
|
+
prop: "targetUrl",
|
374
|
+
align: "left",
|
375
|
+
width: 0
|
376
|
+
},
|
377
|
+
{
|
378
|
+
label: "编辑人",
|
379
|
+
type: "input",
|
380
|
+
prop: "user",
|
381
|
+
sortable: true,
|
382
|
+
align: "left",
|
383
|
+
width: 0
|
384
|
+
},
|
385
|
+
{
|
386
|
+
label: "编辑时间",
|
387
|
+
type: "input",
|
388
|
+
prop: "updateTime",
|
389
|
+
align: "left",
|
390
|
+
width: 0
|
391
|
+
}
|
392
|
+
],
|
393
|
+
pageInfo: {
|
394
|
+
show: true,
|
395
|
+
options: {
|
396
|
+
pageCount: 0, // 总页数
|
397
|
+
pageSize: 20, // 每页展示的条数
|
398
|
+
currentPage: 1, // 当前页码
|
399
|
+
total: 0, // 总条数
|
400
|
+
sizes: [10, 20, 30, 50, 100]
|
401
|
+
}
|
402
|
+
},
|
403
|
+
sort: { type: "1", key: "createTime" },
|
404
|
+
loading: { show: false, text: "加载中", image: "" },
|
405
|
+
empty: { show: true, text: "暂无数据", image: "" },
|
406
|
+
sequence: true
|
407
|
+
},
|
408
|
+
tools: {
|
409
|
+
add: { show: true, name: "新增", position: 1, form: { id: "1" } },
|
410
|
+
edit: { show: true, name: "编辑", position: 2, form: { id: "1" } },
|
411
|
+
detail: { show: false, name: "查看", position: 2, form: { id: "1" } },
|
412
|
+
delete: { show: true, name: "删除", position: 2 },
|
413
|
+
batchDelete: { show: false, name: "批量删除", position: 1 },
|
414
|
+
export: { show: false, name: "导出", position: 1 },
|
415
|
+
import: { show: false, name: "导入", position: 1 }
|
416
|
+
},
|
417
|
+
network: {
|
418
|
+
mounted: {
|
419
|
+
name: "获取列表",
|
420
|
+
api: "tenant/project/list",
|
421
|
+
method: "post"
|
422
|
+
},
|
423
|
+
add: {
|
424
|
+
name: "新增",
|
425
|
+
api: "tenant/project/add",
|
426
|
+
method: "post"
|
427
|
+
},
|
428
|
+
edit: {
|
429
|
+
name: "编辑",
|
430
|
+
api: "tenant/project/edit",
|
431
|
+
method: "post"
|
432
|
+
},
|
433
|
+
delete: {
|
434
|
+
name: "删除",
|
435
|
+
api: "tenant/project/delete",
|
436
|
+
method: "post"
|
437
|
+
},
|
438
|
+
key_123456: {
|
439
|
+
name: "获取列表",
|
440
|
+
url: "https://"
|
441
|
+
}
|
442
|
+
}
|
443
|
+
}
|
444
|
+
};
|
445
|
+
|
446
|
+
export const tableItemConfig = key => {
|
447
|
+
const config = tableConfig[key] || {};
|
448
|
+
return JSON.parse(JSON.stringify(config));
|
198
449
|
};
|