tianheng-ui 0.1.10 → 0.1.11
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/theme-chalk/styles/reset.scss +0 -2
- package/lib/tianheng-ui.js +14 -14
- package/package.json +1 -1
- package/packages/FormMaking/GenerateForm.vue +10 -10
- package/packages/FormMaking/GenerateFormItem.vue +66 -578
- package/packages/FormMaking/GenerateFormItemH5.vue +5 -5
- package/packages/FormMaking/Upload/index.vue +0 -1
- package/packages/FormMaking/WidgetConfig.vue +66 -30
- package/packages/FormMaking/WidgetForm.vue +7 -48
- package/packages/FormMaking/WidgetFormItem.vue +41 -65
- package/packages/FormMaking/WidgetSelect.vue +160 -0
- package/packages/FormMaking/custom/config.js +98 -63
- package/packages/FormMaking/custom/configs/grid.vue +4 -4
- package/packages/FormMaking/custom/configs/input.vue +135 -28
- package/packages/FormMaking/custom/configs/number.vue +2 -2
- package/packages/FormMaking/custom/configs/table.vue +2 -2
- package/packages/FormMaking/custom/configs/{table_h5.vue → tableH5.vue} +2 -2
- package/packages/FormMaking/custom/configs/tabs.vue +6 -6
- package/packages/FormMaking/custom/configs/textarea.vue +121 -19
- package/packages/FormMaking/custom/index.js +2 -4
- package/packages/FormMaking/custom/items/alliance.vue +30 -29
- package/packages/FormMaking/custom/items/blank_pro.vue +14 -0
- package/packages/FormMaking/custom/items/button.vue +1 -0
- package/packages/FormMaking/custom/items/cascader.vue +6 -2
- package/packages/FormMaking/custom/items/cell.vue +0 -2
- package/packages/FormMaking/custom/items/checkbox.vue +17 -7
- package/packages/FormMaking/custom/items/color.vue +1 -1
- package/packages/FormMaking/custom/items/date.vue +1 -1
- package/packages/FormMaking/custom/items/editor.vue +1 -1
- package/packages/FormMaking/custom/items/{grid.vue → grid_dev.vue} +16 -47
- package/packages/FormMaking/custom/items/grid_pro.vue +45 -0
- package/packages/FormMaking/custom/items/image.vue +0 -28
- package/packages/FormMaking/custom/items/input.vue +15 -9
- package/packages/FormMaking/custom/items/number.vue +4 -4
- package/packages/FormMaking/custom/items/radio.vue +17 -7
- package/packages/FormMaking/custom/items/rate.vue +1 -1
- package/packages/FormMaking/custom/items/select.vue +12 -6
- package/packages/FormMaking/custom/items/slider.vue +1 -1
- package/packages/FormMaking/custom/items/switch.vue +1 -1
- package/packages/FormMaking/custom/items/{table_h5.vue → tableH5_dev.vue} +44 -49
- package/packages/FormMaking/custom/items/tableH5_pro.vue +113 -0
- package/packages/FormMaking/custom/items/{table.vue → table_dev.vue} +21 -41
- package/packages/FormMaking/custom/items/table_pro.vue +114 -0
- package/packages/FormMaking/custom/items/tabs_dev.vue +101 -0
- package/packages/FormMaking/custom/items/tabs_pro.vue +50 -0
- package/packages/FormMaking/custom/items/text.vue +1 -1
- package/packages/FormMaking/custom/items/textarea.vue +4 -13
- package/packages/FormMaking/custom/items/time.vue +3 -3
- package/packages/FormMaking/custom/items/upload.vue +15 -14
- package/packages/FormMaking/custom/mixins/index.js +23 -1
- package/packages/FormMaking/custom/register.js +22 -11
- package/packages/FormMaking/index.vue +11 -7
- package/packages/FormMaking/styles/index.scss +235 -221
- package/packages/FormMaking/util/generateCode.js +3 -3
- package/packages/FormMaking/util/index.js +33 -23
- package/packages/FormMaking/custom/items/tabs.vue +0 -145
- /package/packages/FormMaking/custom/items/{blank.vue → blank_dev.vue} +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
$primary-color: #409eff;
|
2
2
|
$primary-background-color: #ecf5ff;
|
3
3
|
|
4
|
-
.
|
4
|
+
.formMaking {
|
5
5
|
height: 100%;
|
6
6
|
|
7
7
|
*,
|
@@ -32,7 +32,7 @@ $primary-background-color: #ecf5ff;
|
|
32
32
|
vertical-align: middle;
|
33
33
|
}
|
34
34
|
|
35
|
-
.
|
35
|
+
.isHideFormLabel {
|
36
36
|
.el-form-item__label {
|
37
37
|
display: none;
|
38
38
|
}
|
@@ -160,17 +160,24 @@ $primary-background-color: #ecf5ff;
|
|
160
160
|
margin: 1%;
|
161
161
|
color: #333;
|
162
162
|
border: 1px solid #f4f6fc;
|
163
|
+
transition: 0.25s;
|
163
164
|
|
164
165
|
&:hover {
|
165
|
-
color: $primary-color;
|
166
|
+
color: $primary-color !important;
|
166
167
|
border: 1px dashed $primary-color;
|
168
|
+
|
169
|
+
a {
|
170
|
+
color: $primary-color !important;
|
171
|
+
}
|
167
172
|
}
|
168
173
|
|
169
174
|
& > a {
|
175
|
+
color: #333;
|
170
176
|
display: block;
|
171
177
|
cursor: move;
|
172
178
|
background: #f4f6fc;
|
173
179
|
border: 1px solid #f4f6fc;
|
180
|
+
transition: 0.25s;
|
174
181
|
|
175
182
|
.icon {
|
176
183
|
margin-right: 6px;
|
@@ -209,12 +216,18 @@ $primary-background-color: #ecf5ff;
|
|
209
216
|
}
|
210
217
|
}
|
211
218
|
|
212
|
-
.
|
213
|
-
|
219
|
+
.draggable {
|
220
|
+
height: 100%;
|
221
|
+
}
|
222
|
+
.draggable-list {
|
214
223
|
min-height: 100%;
|
215
224
|
background: #fff;
|
216
225
|
border: 1px dashed #999;
|
217
226
|
|
227
|
+
.widget-form-list-item {
|
228
|
+
position: relative;
|
229
|
+
}
|
230
|
+
|
218
231
|
.widget-col-list {
|
219
232
|
min-height: 50px;
|
220
233
|
border: 1px dashed #ccc;
|
@@ -260,7 +273,7 @@ $primary-background-color: #ecf5ff;
|
|
260
273
|
}
|
261
274
|
}
|
262
275
|
|
263
|
-
.
|
276
|
+
.widgetFormItem {
|
264
277
|
padding-bottom: 18px;
|
265
278
|
position: relative;
|
266
279
|
border: 1px dashed rgba(170, 170, 170, 0.7);
|
@@ -271,7 +284,7 @@ $primary-background-color: #ecf5ff;
|
|
271
284
|
position: unset;
|
272
285
|
}
|
273
286
|
|
274
|
-
&.
|
287
|
+
&.isRequired {
|
275
288
|
.el-form-item__label::before {
|
276
289
|
content: "*";
|
277
290
|
color: #f56c6c;
|
@@ -309,7 +322,7 @@ $primary-background-color: #ecf5ff;
|
|
309
322
|
}
|
310
323
|
}
|
311
324
|
|
312
|
-
.
|
325
|
+
.isLayout {
|
313
326
|
padding-bottom: 0;
|
314
327
|
padding: 5px;
|
315
328
|
margin-left: 2px !important;
|
@@ -333,10 +346,6 @@ $primary-background-color: #ecf5ff;
|
|
333
346
|
}
|
334
347
|
}
|
335
348
|
|
336
|
-
.el-col {
|
337
|
-
// min-height: 50px;
|
338
|
-
}
|
339
|
-
|
340
349
|
&.ghost {
|
341
350
|
background: #f56c6c;
|
342
351
|
border: 2px solid #f56c6c;
|
@@ -354,215 +363,215 @@ $primary-background-color: #ecf5ff;
|
|
354
363
|
}
|
355
364
|
}
|
356
365
|
|
357
|
-
.widget-table {
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
}
|
366
|
+
// .widget-table {
|
367
|
+
// padding-bottom: 0;
|
368
|
+
// padding: 5px;
|
369
|
+
// background-color: rgba(253, 246, 236, 0.3);
|
370
|
+
|
371
|
+
// .widget-table-wrapper {
|
372
|
+
// min-height: 50px;
|
373
|
+
// background: #fff;
|
374
|
+
// display: flex;
|
375
|
+
// justify-content: flex-start;
|
376
|
+
|
377
|
+
// .widget-table-row {
|
378
|
+
// td {
|
379
|
+
// border-bottom: 0;
|
380
|
+
// }
|
381
|
+
// }
|
382
|
+
|
383
|
+
// .widget-table-left {
|
384
|
+
// width: 51px;
|
385
|
+
// border-left: 1px solid #ebeef5;
|
386
|
+
// border-right: 1px solid #ebeef5;
|
387
|
+
// border-top: 1px solid #ebeef5;
|
388
|
+
// flex: none;
|
389
|
+
// }
|
390
|
+
|
391
|
+
// .widget-table-view {
|
392
|
+
// border: 1px solid #ebeef5;
|
393
|
+
// width: 200px;
|
394
|
+
// float: left;
|
395
|
+
// height: 100%;
|
396
|
+
// position: relative;
|
397
|
+
// display: block;
|
398
|
+
|
399
|
+
// .el-table {
|
400
|
+
// height: 100%;
|
401
|
+
// }
|
402
|
+
|
403
|
+
// &.is_req {
|
404
|
+
// .el-form-item__label::before {
|
405
|
+
// content: "*";
|
406
|
+
// color: #f56c6c;
|
407
|
+
// margin-right: 4px;
|
408
|
+
// }
|
409
|
+
// }
|
410
|
+
|
411
|
+
// &::after {
|
412
|
+
// position: absolute;
|
413
|
+
// left: 0;
|
414
|
+
// right: 0;
|
415
|
+
// top: 0;
|
416
|
+
// bottom: 0;
|
417
|
+
// display: block;
|
418
|
+
// content: "";
|
419
|
+
// }
|
420
|
+
|
421
|
+
// &::before {
|
422
|
+
// display: none;
|
423
|
+
// }
|
424
|
+
|
425
|
+
// &:hover {
|
426
|
+
// background: $primary-background-color;
|
427
|
+
// outline: 1px solid $primary-color;
|
428
|
+
// outline-offset: -1px;
|
429
|
+
|
430
|
+
// &.active {
|
431
|
+
// // outline: 1px solid $primary-color;
|
432
|
+
// border: 1px solid $primary-color;
|
433
|
+
// outline: 1px solid $primary-color;
|
434
|
+
// outline-offset: -1px;
|
435
|
+
// }
|
436
|
+
|
437
|
+
// .widget-view-drag {
|
438
|
+
// display: block;
|
439
|
+
// }
|
440
|
+
// }
|
441
|
+
|
442
|
+
// &.active {
|
443
|
+
// outline: 1px solid $primary-color;
|
444
|
+
// border: 1px solid $primary-color;
|
445
|
+
// outline-offset: -1px;
|
446
|
+
// }
|
447
|
+
|
448
|
+
// &.ghost {
|
449
|
+
// background: #f56c6c;
|
450
|
+
// outline-width: 0;
|
451
|
+
// width: 5px !important;
|
452
|
+
// box-sizing: border-box;
|
453
|
+
// font-size: 0;
|
454
|
+
// content: "";
|
455
|
+
// overflow: hidden;
|
456
|
+
// padding: 0;
|
457
|
+
// position: relative;
|
458
|
+
// outline: none !important;
|
459
|
+
// border: 0 !important;
|
460
|
+
|
461
|
+
// &::after {
|
462
|
+
// background: #f56c6c;
|
463
|
+
// position: absolute;
|
464
|
+
// top: 0;
|
465
|
+
// left: 0;
|
466
|
+
// bottom: 0;
|
467
|
+
// right: 0;
|
468
|
+
// z-index: 9999;
|
469
|
+
// content: "";
|
470
|
+
// outline: none;
|
471
|
+
// }
|
472
|
+
// }
|
473
|
+
// }
|
474
|
+
|
475
|
+
// .widget-table-content {
|
476
|
+
// width: 100%;
|
477
|
+
// // border: 1px dashed #ccc;
|
478
|
+
// outline: 1px dashed #ccc;
|
479
|
+
// background: #fff;
|
480
|
+
// flex: 1;
|
481
|
+
// margin: 0 1px;
|
482
|
+
// overflow: auto;
|
483
|
+
|
484
|
+
// & > div {
|
485
|
+
// height: 100%;
|
486
|
+
// }
|
487
|
+
|
488
|
+
// .widget-table-col {
|
489
|
+
// height: 100%;
|
490
|
+
|
491
|
+
// .ghost {
|
492
|
+
// background: #f56c6c;
|
493
|
+
// // border: 2px solid #F56C6C;
|
494
|
+
// position: relative;
|
495
|
+
// content: "";
|
496
|
+
// float: left;
|
497
|
+
// height: 100%;
|
498
|
+
// width: 5px !important;
|
499
|
+
// list-style: none;
|
500
|
+
// font-size: 0;
|
501
|
+
// overflow: hidden;
|
502
|
+
// outline: none;
|
503
|
+
|
504
|
+
// &::after {
|
505
|
+
// background: #f56c6c;
|
506
|
+
// position: absolute;
|
507
|
+
// top: 0;
|
508
|
+
// left: 0;
|
509
|
+
// bottom: 0;
|
510
|
+
// right: 0;
|
511
|
+
// z-index: 9999;
|
512
|
+
// content: "";
|
513
|
+
// outline: none;
|
514
|
+
// }
|
515
|
+
// }
|
516
|
+
// }
|
517
|
+
// }
|
518
|
+
// }
|
519
|
+
|
520
|
+
// &.active {
|
521
|
+
// outline: 2px solid #e6a23c;
|
522
|
+
// border: 1px solid #e6a23c;
|
523
|
+
// }
|
524
|
+
|
525
|
+
// &:hover {
|
526
|
+
// background: #fdf6ec;
|
527
|
+
// outline: 1px solid #e6a23c;
|
528
|
+
// outline-offset: 0px;
|
529
|
+
|
530
|
+
// &.active {
|
531
|
+
// outline: 2px solid #e6a23c;
|
532
|
+
// border: 1px solid #e6a23c;
|
533
|
+
// outline-offset: 0;
|
534
|
+
// }
|
535
|
+
// }
|
536
|
+
|
537
|
+
// .widget-view-action.widget-col-action {
|
538
|
+
// background: #e6a23c;
|
539
|
+
// }
|
540
|
+
|
541
|
+
// .widget-view-drag.widget-col-drag {
|
542
|
+
// background: #e6a23c;
|
543
|
+
// }
|
544
|
+
|
545
|
+
// &::after {
|
546
|
+
// display: none;
|
547
|
+
// }
|
548
|
+
|
549
|
+
// &.ghost {
|
550
|
+
// background: #f56c6c;
|
551
|
+
// outline-width: 0;
|
552
|
+
// height: 5px;
|
553
|
+
// box-sizing: border-box;
|
554
|
+
// font-size: 0;
|
555
|
+
// content: "";
|
556
|
+
// overflow: hidden;
|
557
|
+
// padding: 0;
|
558
|
+
// position: relative;
|
559
|
+
// outline: none;
|
560
|
+
// border: 0;
|
561
|
+
|
562
|
+
// &::after {
|
563
|
+
// background: #f56c6c;
|
564
|
+
// position: absolute;
|
565
|
+
// top: 0;
|
566
|
+
// left: 0;
|
567
|
+
// right: 0;
|
568
|
+
// bottom: 0;
|
569
|
+
// content: "";
|
570
|
+
// display: block;
|
571
|
+
// z-index: 999;
|
572
|
+
// }
|
573
|
+
// }
|
574
|
+
// }
|
566
575
|
|
567
576
|
.ghost {
|
568
577
|
background: #f56c6c;
|
@@ -734,6 +743,11 @@ $primary-background-color: #ecf5ff;
|
|
734
743
|
.el-form-item__label {
|
735
744
|
width: 100%;
|
736
745
|
}
|
746
|
+
|
747
|
+
.flexView {
|
748
|
+
display: flex;
|
749
|
+
margin-bottom: 5px;
|
750
|
+
}
|
737
751
|
}
|
738
752
|
|
739
753
|
.widget-actions {
|
@@ -1,15 +1,15 @@
|
|
1
1
|
function findRemoteFunc(list, funcList, tokenFuncList, blankList) {
|
2
2
|
for (let i = 0; i < list.length; i++) {
|
3
3
|
if (list[i].type == "grid") {
|
4
|
-
list[i].columns.forEach(item => {
|
4
|
+
list[i].options.columns.forEach(item => {
|
5
5
|
findRemoteFunc(item.list, funcList, tokenFuncList, blankList);
|
6
6
|
});
|
7
7
|
} else if (list[i].type == "tabs") {
|
8
|
-
list[i].
|
8
|
+
list[i].options.columns.forEach(item => {
|
9
9
|
findRemoteFunc(item.list, funcList, tokenFuncList, blankList);
|
10
10
|
});
|
11
11
|
} else if (list[i].type == "table") {
|
12
|
-
// list[i].
|
12
|
+
// list[i].options.columns.forEach(item => {
|
13
13
|
findRemoteFunc(list[i].list, funcList, tokenFuncList, blankList);
|
14
14
|
// })
|
15
15
|
} else {
|
@@ -1,33 +1,43 @@
|
|
1
|
-
export const loadJs =
|
1
|
+
export const loadJs = url => {
|
2
2
|
return new Promise((resolve, reject) => {
|
3
|
-
const script = document.createElement(
|
4
|
-
script.src = url
|
5
|
-
script.type =
|
6
|
-
document.body.appendChild(script)
|
3
|
+
const script = document.createElement("script");
|
4
|
+
script.src = url;
|
5
|
+
script.type = "text/javascript";
|
6
|
+
document.body.appendChild(script);
|
7
7
|
script.onload = () => {
|
8
|
-
resolve()
|
9
|
-
}
|
10
|
-
})
|
11
|
-
}
|
8
|
+
resolve();
|
9
|
+
};
|
10
|
+
});
|
11
|
+
};
|
12
12
|
|
13
|
-
export const loadCss =
|
13
|
+
export const loadCss = url => {
|
14
14
|
return new Promise((resolve, reject) => {
|
15
|
-
const link = document.createElement(
|
16
|
-
link.rel =
|
17
|
-
link.href = url
|
18
|
-
document.head.appendChild(link)
|
15
|
+
const link = document.createElement("link");
|
16
|
+
link.rel = "stylesheet";
|
17
|
+
link.href = url;
|
18
|
+
document.head.appendChild(link);
|
19
19
|
link.onload = () => {
|
20
|
-
resolve()
|
21
|
-
}
|
22
|
-
})
|
23
|
-
}
|
20
|
+
resolve();
|
21
|
+
};
|
22
|
+
});
|
23
|
+
};
|
24
24
|
|
25
25
|
export const generateUUID = () => {
|
26
26
|
var d = new Date().getTime();
|
27
|
-
var uuid =
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
var uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(
|
28
|
+
c
|
29
|
+
) {
|
30
|
+
var r = (d + Math.random() * 16) % 16 | 0;
|
31
|
+
d = Math.floor(d / 16);
|
32
|
+
return (c == "x" ? r : (r & 0x7) | 0x8).toString(16);
|
31
33
|
});
|
32
34
|
return uuid;
|
33
|
-
}
|
35
|
+
};
|
36
|
+
|
37
|
+
export const inputTypeDict = val => {
|
38
|
+
const dict = {
|
39
|
+
email: "email",
|
40
|
+
url: "url"
|
41
|
+
};
|
42
|
+
return dict[val] || "text";
|
43
|
+
};
|