tianheng-ui 0.0.78 → 0.0.81

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.
@@ -0,0 +1,448 @@
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
+ const config = toolsConfig[key] || {};
63
+ config.name = data.name;
64
+ return JSON.parse(JSON.stringify(config));
65
+ };
66
+
67
+ const formConfig = {
68
+ "1": {
69
+ list: [
70
+ {
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: [
102
+ {
103
+ type: "string",
104
+ message: "平台名称格式不正确"
105
+ },
106
+ {
107
+ required: true,
108
+ message: "平台名称必须填写"
109
+ }
110
+ ],
111
+ key: "1669859814000_5209",
112
+ model: "name"
113
+ },
114
+ {
115
+ name: "平台分类",
116
+ type: "select",
117
+ icon: "icon-select",
118
+ options: {
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: ""
157
+ },
158
+ key: "1669859824000_68681",
159
+ model: "projectTypeId",
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"
201
+ }
202
+ ],
203
+ config: {
204
+ ui: "element",
205
+ title: "",
206
+ width: "",
207
+ labelWidth: 100,
208
+ labelPosition: "right",
209
+ labelSuffix: ":",
210
+ size: "small",
211
+ disabled: false,
212
+ hideLabel: false,
213
+ eventScript: [
214
+ {
215
+ key: "mounted",
216
+ name: "mounted",
217
+ func: ""
218
+ },
219
+ {
220
+ key: "refresh",
221
+ name: "refresh",
222
+ func: ""
223
+ }
224
+ ]
225
+ }
226
+ }
227
+ };
228
+
229
+ export const formItemConfig = key => {
230
+ const config = formConfig[key] || {};
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
+ },
322
+ network: {
323
+ mounted: {
324
+ name: "获取列表",
325
+ api: "tenant/project/list",
326
+ method: "post"
327
+ },
328
+ add: {
329
+ name: "新增",
330
+ api: "tenant/project/add",
331
+ method: "post"
332
+ },
333
+ edit: {
334
+ name: "编辑",
335
+ api: "tenant/project/edit",
336
+ method: "post"
337
+ },
338
+ delete: {
339
+ name: "删除",
340
+ api: "tenant/project/delete",
341
+ method: "post"
342
+ },
343
+ key_123456: {
344
+ name: "获取列表",
345
+ url: "https://"
346
+ }
347
+ }
348
+ },
349
+ "2": {
350
+ search: {
351
+ show: false,
352
+ options: []
353
+ },
354
+ table: {
355
+ options: [
356
+ {
357
+ label: "平台名称",
358
+ type: "input",
359
+ prop: "name",
360
+ align: "left"
361
+ },
362
+ {
363
+ label: "平台分类",
364
+ type: "select",
365
+ prop: "projectTypeName",
366
+ align: "left",
367
+ width: 0
368
+ },
369
+ {
370
+ label: "访问地址",
371
+ type: "input",
372
+ prop: "targetUrl",
373
+ align: "left",
374
+ width: 0
375
+ },
376
+ {
377
+ label: "编辑人",
378
+ type: "input",
379
+ prop: "user",
380
+ sortable: true,
381
+ align: "left",
382
+ width: 0
383
+ },
384
+ {
385
+ label: "编辑时间",
386
+ type: "input",
387
+ prop: "updateTime",
388
+ align: "left",
389
+ width: 0
390
+ }
391
+ ],
392
+ pageInfo: {
393
+ show: true,
394
+ options: {
395
+ pageCount: 0, // 总页数
396
+ pageSize: 20, // 每页展示的条数
397
+ currentPage: 1, // 当前页码
398
+ total: 0, // 总条数
399
+ sizes: [10, 20, 30, 50, 100]
400
+ }
401
+ },
402
+ sort: { type: "1", key: "createTime" },
403
+ loading: { show: false, text: "加载中", image: "" },
404
+ empty: { show: true, text: "暂无数据", image: "" },
405
+ sequence: true
406
+ },
407
+ tools: {
408
+ add: { show: true, name: "新增", position: 1, form: { id: "1" } },
409
+ edit: { show: true, name: "编辑", position: 2, form: { id: "1" } },
410
+ detail: { show: false, name: "查看", position: 2, form: { id: "1" } },
411
+ delete: { show: true, name: "删除", position: 2 },
412
+ batchDelete: { show: false, name: "批量删除", position: 1 },
413
+ export: { show: false, name: "导出", position: 1 },
414
+ import: { show: false, name: "导入", position: 1 }
415
+ },
416
+ network: {
417
+ mounted: {
418
+ name: "获取列表",
419
+ api: "tenant/project/list",
420
+ method: "post"
421
+ },
422
+ add: {
423
+ name: "新增",
424
+ api: "tenant/project/add",
425
+ method: "post"
426
+ },
427
+ edit: {
428
+ name: "编辑",
429
+ api: "tenant/project/edit",
430
+ method: "post"
431
+ },
432
+ delete: {
433
+ name: "删除",
434
+ api: "tenant/project/delete",
435
+ method: "post"
436
+ },
437
+ key_123456: {
438
+ name: "获取列表",
439
+ url: "https://"
440
+ }
441
+ }
442
+ }
443
+ };
444
+
445
+ export const tableItemConfig = key => {
446
+ const config = tableConfig[key] || {};
447
+ return JSON.parse(JSON.stringify(config));
448
+ };
@@ -86,7 +86,9 @@
86
86
  v-if="tableConfig.table.pageInfo.show"
87
87
  label="分页条数"
88
88
  >
89
- <el-radio-group v-model="tableConfig.table.pageInfo.pageSize">
89
+ <el-radio-group
90
+ v-model="tableConfig.table.pageInfo.options.pageSize"
91
+ >
90
92
  <el-radio-button :label="20">20条</el-radio-button>
91
93
  <el-radio-button :label="50">50条</el-radio-button>
92
94
  <el-radio-button :label="100">100条</el-radio-button>
@@ -221,24 +223,29 @@ export default {
221
223
  },
222
224
  table: {
223
225
  options: [],
224
- sort: {
225
- type: "1",
226
- key: "createTime"
227
- },
228
226
  pageInfo: {
229
227
  show: true,
230
- pageSize: 20
228
+ options: {
229
+ pageCount: 0, // 总页数
230
+ pageSize: 20, // 每页展示的条数
231
+ currentPage: 1, // 当前页码
232
+ total: 0, // 总条数
233
+ sizes: [10, 20, 30, 50, 100]
234
+ }
231
235
  },
232
- sequence: false //序号
236
+ sort: { type: "1", key: "createTime" },
237
+ loading: { show: false, text: "加载中", image: "" },
238
+ empty: { show: true, text: "暂无数据", image: "" },
239
+ sequence: true //是否显示序号
233
240
  },
234
241
  tools: {
235
- add: { show: true, name: "新增" },
236
- edit: { show: true, name: "编辑" },
237
- detail: { show: false, name: "查看" },
238
- delete: { show: true, name: "删除" },
239
- batchDelete: { show: false, name: "批量删除" },
240
- export: { show: false, name: "导出" },
241
- import: { show: false, name: "导入" }
242
+ add: { show: true, name: "新增", position: 1 },
243
+ edit: { show: true, name: "编辑", position: 2 },
244
+ detail: { show: true, name: "查看", position: 2 },
245
+ delete: { show: true, name: "删除", position: 2 },
246
+ batchDelete: { show: true, name: "批量删除", position: 1 },
247
+ export: { show: true, name: "导出", position: 1 },
248
+ import: { show: true, name: "导入", position: 1 }
242
249
  }
243
250
  },
244
251
  sortFieldOptions: [{ label: "创建时间", value: "createTime" }]
@@ -118,6 +118,7 @@
118
118
  <th-dialog
119
119
  v-model="dialog.visible"
120
120
  :title="dialog.title"
121
+ :modal-append-to-body="false"
121
122
  @on-affirm="handleDialogAffirm"
122
123
  >
123
124
  <th-code-editor v-model="codeEditorValue"></th-code-editor>
package/packages/index.js CHANGED
@@ -42,6 +42,7 @@ import Upload from "./Upload/index.js";
42
42
  import FormMaking from "./FormMaking/making.js";
43
43
  import FormGenerate from "./FormMaking/generate.js";
44
44
  import TableMaking from "./TableMaking/making.js";
45
+ import TableGenerate from "./TableMaking/generate.js";
45
46
  import Workflow from "../packages/Workflow/index.js";
46
47
 
47
48
  const components = [
@@ -67,6 +68,7 @@ const components = [
67
68
  FormMaking,
68
69
  FormGenerate,
69
70
  TableMaking,
71
+ TableGenerate,
70
72
  Workflow
71
73
  ];
72
74
 
@@ -111,6 +113,7 @@ export default {
111
113
  FormMaking,
112
114
  FormGenerate,
113
115
  TableMaking,
116
+ TableGenerate,
114
117
  Workflow
115
118
  };
116
119
 
@@ -138,5 +141,6 @@ export {
138
141
  FormMaking,
139
142
  FormGenerate,
140
143
  TableMaking,
144
+ TableGenerate,
141
145
  Workflow
142
146
  };