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.
Files changed (57) hide show
  1. package/lib/theme-chalk/styles/reset.scss +0 -2
  2. package/lib/tianheng-ui.js +14 -14
  3. package/package.json +1 -1
  4. package/packages/FormMaking/GenerateForm.vue +10 -10
  5. package/packages/FormMaking/GenerateFormItem.vue +66 -578
  6. package/packages/FormMaking/GenerateFormItemH5.vue +5 -5
  7. package/packages/FormMaking/Upload/index.vue +0 -1
  8. package/packages/FormMaking/WidgetConfig.vue +66 -30
  9. package/packages/FormMaking/WidgetForm.vue +7 -48
  10. package/packages/FormMaking/WidgetFormItem.vue +41 -65
  11. package/packages/FormMaking/WidgetSelect.vue +160 -0
  12. package/packages/FormMaking/custom/config.js +98 -63
  13. package/packages/FormMaking/custom/configs/grid.vue +4 -4
  14. package/packages/FormMaking/custom/configs/input.vue +135 -28
  15. package/packages/FormMaking/custom/configs/number.vue +2 -2
  16. package/packages/FormMaking/custom/configs/table.vue +2 -2
  17. package/packages/FormMaking/custom/configs/{table_h5.vue → tableH5.vue} +2 -2
  18. package/packages/FormMaking/custom/configs/tabs.vue +6 -6
  19. package/packages/FormMaking/custom/configs/textarea.vue +121 -19
  20. package/packages/FormMaking/custom/index.js +2 -4
  21. package/packages/FormMaking/custom/items/alliance.vue +30 -29
  22. package/packages/FormMaking/custom/items/blank_pro.vue +14 -0
  23. package/packages/FormMaking/custom/items/button.vue +1 -0
  24. package/packages/FormMaking/custom/items/cascader.vue +6 -2
  25. package/packages/FormMaking/custom/items/cell.vue +0 -2
  26. package/packages/FormMaking/custom/items/checkbox.vue +17 -7
  27. package/packages/FormMaking/custom/items/color.vue +1 -1
  28. package/packages/FormMaking/custom/items/date.vue +1 -1
  29. package/packages/FormMaking/custom/items/editor.vue +1 -1
  30. package/packages/FormMaking/custom/items/{grid.vue → grid_dev.vue} +16 -47
  31. package/packages/FormMaking/custom/items/grid_pro.vue +45 -0
  32. package/packages/FormMaking/custom/items/image.vue +0 -28
  33. package/packages/FormMaking/custom/items/input.vue +15 -9
  34. package/packages/FormMaking/custom/items/number.vue +4 -4
  35. package/packages/FormMaking/custom/items/radio.vue +17 -7
  36. package/packages/FormMaking/custom/items/rate.vue +1 -1
  37. package/packages/FormMaking/custom/items/select.vue +12 -6
  38. package/packages/FormMaking/custom/items/slider.vue +1 -1
  39. package/packages/FormMaking/custom/items/switch.vue +1 -1
  40. package/packages/FormMaking/custom/items/{table_h5.vue → tableH5_dev.vue} +44 -49
  41. package/packages/FormMaking/custom/items/tableH5_pro.vue +113 -0
  42. package/packages/FormMaking/custom/items/{table.vue → table_dev.vue} +21 -41
  43. package/packages/FormMaking/custom/items/table_pro.vue +114 -0
  44. package/packages/FormMaking/custom/items/tabs_dev.vue +101 -0
  45. package/packages/FormMaking/custom/items/tabs_pro.vue +50 -0
  46. package/packages/FormMaking/custom/items/text.vue +1 -1
  47. package/packages/FormMaking/custom/items/textarea.vue +4 -13
  48. package/packages/FormMaking/custom/items/time.vue +3 -3
  49. package/packages/FormMaking/custom/items/upload.vue +15 -14
  50. package/packages/FormMaking/custom/mixins/index.js +23 -1
  51. package/packages/FormMaking/custom/register.js +22 -11
  52. package/packages/FormMaking/index.vue +11 -7
  53. package/packages/FormMaking/styles/index.scss +235 -221
  54. package/packages/FormMaking/util/generateCode.js +3 -3
  55. package/packages/FormMaking/util/index.js +33 -23
  56. package/packages/FormMaking/custom/items/tabs.vue +0 -145
  57. /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
- .fm-container {
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
- .form-hideLabel {
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
- .widget-form-list {
213
- // margin: 10px;
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
- .widget-view {
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
- &.is_req {
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
- .widget-col {
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
- padding-bottom: 0;
359
- padding: 5px;
360
- background-color: rgba(253, 246, 236, 0.3);
361
-
362
- .widget-table-wrapper {
363
- min-height: 50px;
364
- background: #fff;
365
- display: flex;
366
- justify-content: flex-start;
367
-
368
- .widget-table-row {
369
- td {
370
- border-bottom: 0;
371
- }
372
- }
373
-
374
- .widget-table-left {
375
- width: 51px;
376
- border-left: 1px solid #ebeef5;
377
- border-right: 1px solid #ebeef5;
378
- border-top: 1px solid #ebeef5;
379
- flex: none;
380
- }
381
-
382
- .widget-table-view {
383
- border: 1px solid #ebeef5;
384
- width: 200px;
385
- float: left;
386
- height: 100%;
387
- position: relative;
388
- display: block;
389
-
390
- .el-table {
391
- height: 100%;
392
- }
393
-
394
- &.is_req {
395
- .el-form-item__label::before {
396
- content: "*";
397
- color: #f56c6c;
398
- margin-right: 4px;
399
- }
400
- }
401
-
402
- &::after {
403
- position: absolute;
404
- left: 0;
405
- right: 0;
406
- top: 0;
407
- bottom: 0;
408
- display: block;
409
- content: "";
410
- }
411
-
412
- &::before {
413
- display: none;
414
- }
415
-
416
- &:hover {
417
- background: $primary-background-color;
418
- outline: 1px solid $primary-color;
419
- outline-offset: -1px;
420
-
421
- &.active {
422
- // outline: 1px solid $primary-color;
423
- border: 1px solid $primary-color;
424
- outline: 1px solid $primary-color;
425
- outline-offset: -1px;
426
- }
427
-
428
- .widget-view-drag {
429
- display: block;
430
- }
431
- }
432
-
433
- &.active {
434
- outline: 1px solid $primary-color;
435
- border: 1px solid $primary-color;
436
- outline-offset: -1px;
437
- }
438
-
439
- &.ghost {
440
- background: #f56c6c;
441
- outline-width: 0;
442
- width: 5px !important;
443
- box-sizing: border-box;
444
- font-size: 0;
445
- content: "";
446
- overflow: hidden;
447
- padding: 0;
448
- position: relative;
449
- outline: none !important;
450
- border: 0 !important;
451
-
452
- &::after {
453
- background: #f56c6c;
454
- position: absolute;
455
- top: 0;
456
- left: 0;
457
- bottom: 0;
458
- right: 0;
459
- z-index: 9999;
460
- content: "";
461
- outline: none;
462
- }
463
- }
464
- }
465
-
466
- .widget-table-content {
467
- width: 100%;
468
- // border: 1px dashed #ccc;
469
- outline: 1px dashed #ccc;
470
- background: #fff;
471
- flex: 1;
472
- margin: 0 1px;
473
- overflow: auto;
474
-
475
- & > div {
476
- height: 100%;
477
- }
478
-
479
- .widget-table-col {
480
- height: 100%;
481
-
482
- .ghost {
483
- background: #f56c6c;
484
- // border: 2px solid #F56C6C;
485
- position: relative;
486
- content: "";
487
- float: left;
488
- height: 100%;
489
- width: 5px !important;
490
- list-style: none;
491
- font-size: 0;
492
- overflow: hidden;
493
- outline: none;
494
-
495
- &::after {
496
- background: #f56c6c;
497
- position: absolute;
498
- top: 0;
499
- left: 0;
500
- bottom: 0;
501
- right: 0;
502
- z-index: 9999;
503
- content: "";
504
- outline: none;
505
- }
506
- }
507
- }
508
- }
509
- }
510
-
511
- &.active {
512
- outline: 2px solid #e6a23c;
513
- border: 1px solid #e6a23c;
514
- }
515
-
516
- &:hover {
517
- background: #fdf6ec;
518
- outline: 1px solid #e6a23c;
519
- outline-offset: 0px;
520
-
521
- &.active {
522
- outline: 2px solid #e6a23c;
523
- border: 1px solid #e6a23c;
524
- outline-offset: 0;
525
- }
526
- }
527
-
528
- .widget-view-action.widget-col-action {
529
- background: #e6a23c;
530
- }
531
-
532
- .widget-view-drag.widget-col-drag {
533
- background: #e6a23c;
534
- }
535
-
536
- &::after {
537
- display: none;
538
- }
539
-
540
- &.ghost {
541
- background: #f56c6c;
542
- outline-width: 0;
543
- height: 5px;
544
- box-sizing: border-box;
545
- font-size: 0;
546
- content: "";
547
- overflow: hidden;
548
- padding: 0;
549
- position: relative;
550
- outline: none;
551
- border: 0;
552
-
553
- &::after {
554
- background: #f56c6c;
555
- position: absolute;
556
- top: 0;
557
- left: 0;
558
- right: 0;
559
- bottom: 0;
560
- content: "";
561
- display: block;
562
- z-index: 999;
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].tabs.forEach(item => {
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].tabs.forEach(item => {
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 = (url) => {
1
+ export const loadJs = url => {
2
2
  return new Promise((resolve, reject) => {
3
- const script = document.createElement('script')
4
- script.src = url
5
- script.type = 'text/javascript'
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 = (url) => {
13
+ export const loadCss = url => {
14
14
  return new Promise((resolve, reject) => {
15
- const link = document.createElement('link')
16
- link.rel = 'stylesheet'
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 = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
28
- var r = (d + Math.random()*16)%16 | 0;
29
- d = Math.floor(d/16);
30
- return (c=='x' ? r : (r&0x7|0x8)).toString(16);
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
+ };