tianheng-ui 0.1.10 → 0.1.12

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 (72) hide show
  1. package/lib/theme-chalk/styles/reset.scss +0 -2
  2. package/lib/tianheng-ui.js +13 -14
  3. package/package.json +1 -1
  4. package/packages/FormMaking/GenerateForm.vue +16 -11
  5. package/packages/FormMaking/GenerateFormItem.vue +73 -581
  6. package/packages/FormMaking/GenerateFormItemH5.vue +6 -6
  7. package/packages/FormMaking/Upload/index.vue +0 -1
  8. package/packages/FormMaking/WidgetConfig.vue +100 -77
  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/WidgetTools.vue +538 -0
  13. package/packages/FormMaking/config/index.js +6 -0
  14. package/packages/FormMaking/custom/config.js +119 -87
  15. package/packages/FormMaking/custom/configs/button.vue +24 -25
  16. package/packages/FormMaking/custom/configs/cascader.vue +7 -7
  17. package/packages/FormMaking/custom/configs/checkbox.vue +23 -22
  18. package/packages/FormMaking/custom/configs/color.vue +3 -3
  19. package/packages/FormMaking/custom/configs/date.vue +3 -3
  20. package/packages/FormMaking/custom/configs/grid.vue +4 -4
  21. package/packages/FormMaking/custom/configs/input.vue +138 -31
  22. package/packages/FormMaking/custom/configs/number.vue +5 -5
  23. package/packages/FormMaking/custom/configs/radio.vue +23 -19
  24. package/packages/FormMaking/custom/configs/rate.vue +3 -3
  25. package/packages/FormMaking/custom/configs/select.vue +25 -20
  26. package/packages/FormMaking/custom/configs/slider.vue +3 -3
  27. package/packages/FormMaking/custom/configs/switch.vue +3 -3
  28. package/packages/FormMaking/custom/configs/table.vue +2 -2
  29. package/packages/FormMaking/custom/configs/{table_h5.vue → tableH5.vue} +2 -2
  30. package/packages/FormMaking/custom/configs/tabs.vue +18 -23
  31. package/packages/FormMaking/custom/configs/textarea.vue +124 -22
  32. package/packages/FormMaking/custom/configs/time.vue +3 -3
  33. package/packages/FormMaking/custom/configs/upload.vue +5 -5
  34. package/packages/FormMaking/custom/index.js +2 -4
  35. package/packages/FormMaking/custom/items/alliance.vue +30 -29
  36. package/packages/FormMaking/custom/items/blank_pro.vue +14 -0
  37. package/packages/FormMaking/custom/items/button.vue +36 -1
  38. package/packages/FormMaking/custom/items/cascader.vue +6 -2
  39. package/packages/FormMaking/custom/items/cell.vue +0 -2
  40. package/packages/FormMaking/custom/items/checkbox.vue +18 -8
  41. package/packages/FormMaking/custom/items/color.vue +1 -1
  42. package/packages/FormMaking/custom/items/date.vue +1 -1
  43. package/packages/FormMaking/custom/items/editor.vue +1 -1
  44. package/packages/FormMaking/custom/items/{grid.vue → grid_dev.vue} +16 -47
  45. package/packages/FormMaking/custom/items/grid_pro.vue +45 -0
  46. package/packages/FormMaking/custom/items/image.vue +0 -28
  47. package/packages/FormMaking/custom/items/input.vue +15 -9
  48. package/packages/FormMaking/custom/items/number.vue +4 -4
  49. package/packages/FormMaking/custom/items/radio.vue +17 -7
  50. package/packages/FormMaking/custom/items/rate.vue +1 -1
  51. package/packages/FormMaking/custom/items/select.vue +12 -6
  52. package/packages/FormMaking/custom/items/slider.vue +1 -1
  53. package/packages/FormMaking/custom/items/switch.vue +1 -1
  54. package/packages/FormMaking/custom/items/{table_h5.vue → tableH5_dev.vue} +44 -49
  55. package/packages/FormMaking/custom/items/tableH5_pro.vue +113 -0
  56. package/packages/FormMaking/custom/items/{table.vue → table_dev.vue} +21 -41
  57. package/packages/FormMaking/custom/items/table_pro.vue +114 -0
  58. package/packages/FormMaking/custom/items/tabs_dev.vue +101 -0
  59. package/packages/FormMaking/custom/items/tabs_pro.vue +50 -0
  60. package/packages/FormMaking/custom/items/text.vue +1 -1
  61. package/packages/FormMaking/custom/items/textarea.vue +4 -13
  62. package/packages/FormMaking/custom/items/time.vue +3 -3
  63. package/packages/FormMaking/custom/items/upload.vue +15 -14
  64. package/packages/FormMaking/custom/mixins/index.js +28 -6
  65. package/packages/FormMaking/custom/register.js +22 -11
  66. package/packages/FormMaking/index.vue +95 -468
  67. package/packages/FormMaking/styles/index.scss +235 -242
  68. package/packages/FormMaking/util/generateCode.js +3 -3
  69. package/packages/FormMaking/util/index.js +33 -23
  70. package/packages/FormMaking/util/request.js +9 -12
  71. package/packages/FormMaking/custom/items/tabs.vue +0 -145
  72. /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
  }
@@ -100,32 +100,11 @@ $primary-background-color: #ecf5ff;
100
100
  border-left: 1px solid #e0e0e0;
101
101
  border-right: 1px solid #e0e0e0;
102
102
 
103
- .el-header {
104
- display: flex;
105
- align-items: center;
106
- height: 45px !important;
107
- line-height: 45px !important;
108
- // font-size: 18px;
109
- border-bottom: solid 2px #e4e7ed;
110
- text-align: right;
111
- }
112
-
113
103
  .el-main {
114
104
  padding: 0;
115
105
  position: relative;
116
106
  background: #fafafa;
117
107
  }
118
-
119
- .client {
120
- flex: 1;
121
- text-align: left;
122
- .el-button {
123
- color: #333;
124
- }
125
- .active {
126
- color: #409eff;
127
- }
128
- }
129
108
  }
130
109
 
131
110
  // 左侧字段区
@@ -160,17 +139,24 @@ $primary-background-color: #ecf5ff;
160
139
  margin: 1%;
161
140
  color: #333;
162
141
  border: 1px solid #f4f6fc;
142
+ transition: 0.25s;
163
143
 
164
144
  &:hover {
165
- color: $primary-color;
145
+ color: $primary-color !important;
166
146
  border: 1px dashed $primary-color;
147
+
148
+ a {
149
+ color: $primary-color !important;
150
+ }
167
151
  }
168
152
 
169
153
  & > a {
154
+ color: #333;
170
155
  display: block;
171
156
  cursor: move;
172
157
  background: #f4f6fc;
173
158
  border: 1px solid #f4f6fc;
159
+ transition: 0.25s;
174
160
 
175
161
  .icon {
176
162
  margin-right: 6px;
@@ -209,12 +195,18 @@ $primary-background-color: #ecf5ff;
209
195
  }
210
196
  }
211
197
 
212
- .widget-form-list {
213
- // margin: 10px;
198
+ .draggable {
199
+ height: 100%;
200
+ }
201
+ .draggable-list {
214
202
  min-height: 100%;
215
203
  background: #fff;
216
204
  border: 1px dashed #999;
217
205
 
206
+ .widget-form-list-item {
207
+ position: relative;
208
+ }
209
+
218
210
  .widget-col-list {
219
211
  min-height: 50px;
220
212
  border: 1px dashed #ccc;
@@ -260,7 +252,7 @@ $primary-background-color: #ecf5ff;
260
252
  }
261
253
  }
262
254
 
263
- .widget-view {
255
+ .widgetFormItem {
264
256
  padding-bottom: 18px;
265
257
  position: relative;
266
258
  border: 1px dashed rgba(170, 170, 170, 0.7);
@@ -271,7 +263,7 @@ $primary-background-color: #ecf5ff;
271
263
  position: unset;
272
264
  }
273
265
 
274
- &.is_req {
266
+ &.isRequired {
275
267
  .el-form-item__label::before {
276
268
  content: "*";
277
269
  color: #f56c6c;
@@ -309,7 +301,7 @@ $primary-background-color: #ecf5ff;
309
301
  }
310
302
  }
311
303
 
312
- .widget-col {
304
+ .isLayout {
313
305
  padding-bottom: 0;
314
306
  padding: 5px;
315
307
  margin-left: 2px !important;
@@ -333,10 +325,6 @@ $primary-background-color: #ecf5ff;
333
325
  }
334
326
  }
335
327
 
336
- .el-col {
337
- // min-height: 50px;
338
- }
339
-
340
328
  &.ghost {
341
329
  background: #f56c6c;
342
330
  border: 2px solid #f56c6c;
@@ -354,215 +342,215 @@ $primary-background-color: #ecf5ff;
354
342
  }
355
343
  }
356
344
 
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
- }
345
+ // .widget-table {
346
+ // padding-bottom: 0;
347
+ // padding: 5px;
348
+ // background-color: rgba(253, 246, 236, 0.3);
349
+
350
+ // .widget-table-wrapper {
351
+ // min-height: 50px;
352
+ // background: #fff;
353
+ // display: flex;
354
+ // justify-content: flex-start;
355
+
356
+ // .widget-table-row {
357
+ // td {
358
+ // border-bottom: 0;
359
+ // }
360
+ // }
361
+
362
+ // .widget-table-left {
363
+ // width: 51px;
364
+ // border-left: 1px solid #ebeef5;
365
+ // border-right: 1px solid #ebeef5;
366
+ // border-top: 1px solid #ebeef5;
367
+ // flex: none;
368
+ // }
369
+
370
+ // .widget-table-view {
371
+ // border: 1px solid #ebeef5;
372
+ // width: 200px;
373
+ // float: left;
374
+ // height: 100%;
375
+ // position: relative;
376
+ // display: block;
377
+
378
+ // .el-table {
379
+ // height: 100%;
380
+ // }
381
+
382
+ // &.is_req {
383
+ // .el-form-item__label::before {
384
+ // content: "*";
385
+ // color: #f56c6c;
386
+ // margin-right: 4px;
387
+ // }
388
+ // }
389
+
390
+ // &::after {
391
+ // position: absolute;
392
+ // left: 0;
393
+ // right: 0;
394
+ // top: 0;
395
+ // bottom: 0;
396
+ // display: block;
397
+ // content: "";
398
+ // }
399
+
400
+ // &::before {
401
+ // display: none;
402
+ // }
403
+
404
+ // &:hover {
405
+ // background: $primary-background-color;
406
+ // outline: 1px solid $primary-color;
407
+ // outline-offset: -1px;
408
+
409
+ // &.active {
410
+ // // outline: 1px solid $primary-color;
411
+ // border: 1px solid $primary-color;
412
+ // outline: 1px solid $primary-color;
413
+ // outline-offset: -1px;
414
+ // }
415
+
416
+ // .widget-view-drag {
417
+ // display: block;
418
+ // }
419
+ // }
420
+
421
+ // &.active {
422
+ // outline: 1px solid $primary-color;
423
+ // border: 1px solid $primary-color;
424
+ // outline-offset: -1px;
425
+ // }
426
+
427
+ // &.ghost {
428
+ // background: #f56c6c;
429
+ // outline-width: 0;
430
+ // width: 5px !important;
431
+ // box-sizing: border-box;
432
+ // font-size: 0;
433
+ // content: "";
434
+ // overflow: hidden;
435
+ // padding: 0;
436
+ // position: relative;
437
+ // outline: none !important;
438
+ // border: 0 !important;
439
+
440
+ // &::after {
441
+ // background: #f56c6c;
442
+ // position: absolute;
443
+ // top: 0;
444
+ // left: 0;
445
+ // bottom: 0;
446
+ // right: 0;
447
+ // z-index: 9999;
448
+ // content: "";
449
+ // outline: none;
450
+ // }
451
+ // }
452
+ // }
453
+
454
+ // .widget-table-content {
455
+ // width: 100%;
456
+ // // border: 1px dashed #ccc;
457
+ // outline: 1px dashed #ccc;
458
+ // background: #fff;
459
+ // flex: 1;
460
+ // margin: 0 1px;
461
+ // overflow: auto;
462
+
463
+ // & > div {
464
+ // height: 100%;
465
+ // }
466
+
467
+ // .widget-table-col {
468
+ // height: 100%;
469
+
470
+ // .ghost {
471
+ // background: #f56c6c;
472
+ // // border: 2px solid #F56C6C;
473
+ // position: relative;
474
+ // content: "";
475
+ // float: left;
476
+ // height: 100%;
477
+ // width: 5px !important;
478
+ // list-style: none;
479
+ // font-size: 0;
480
+ // overflow: hidden;
481
+ // outline: none;
482
+
483
+ // &::after {
484
+ // background: #f56c6c;
485
+ // position: absolute;
486
+ // top: 0;
487
+ // left: 0;
488
+ // bottom: 0;
489
+ // right: 0;
490
+ // z-index: 9999;
491
+ // content: "";
492
+ // outline: none;
493
+ // }
494
+ // }
495
+ // }
496
+ // }
497
+ // }
498
+
499
+ // &.active {
500
+ // outline: 2px solid #e6a23c;
501
+ // border: 1px solid #e6a23c;
502
+ // }
503
+
504
+ // &:hover {
505
+ // background: #fdf6ec;
506
+ // outline: 1px solid #e6a23c;
507
+ // outline-offset: 0px;
508
+
509
+ // &.active {
510
+ // outline: 2px solid #e6a23c;
511
+ // border: 1px solid #e6a23c;
512
+ // outline-offset: 0;
513
+ // }
514
+ // }
515
+
516
+ // .widget-view-action.widget-col-action {
517
+ // background: #e6a23c;
518
+ // }
519
+
520
+ // .widget-view-drag.widget-col-drag {
521
+ // background: #e6a23c;
522
+ // }
523
+
524
+ // &::after {
525
+ // display: none;
526
+ // }
527
+
528
+ // &.ghost {
529
+ // background: #f56c6c;
530
+ // outline-width: 0;
531
+ // height: 5px;
532
+ // box-sizing: border-box;
533
+ // font-size: 0;
534
+ // content: "";
535
+ // overflow: hidden;
536
+ // padding: 0;
537
+ // position: relative;
538
+ // outline: none;
539
+ // border: 0;
540
+
541
+ // &::after {
542
+ // background: #f56c6c;
543
+ // position: absolute;
544
+ // top: 0;
545
+ // left: 0;
546
+ // right: 0;
547
+ // bottom: 0;
548
+ // content: "";
549
+ // display: block;
550
+ // z-index: 999;
551
+ // }
552
+ // }
553
+ // }
566
554
 
567
555
  .ghost {
568
556
  background: #f56c6c;
@@ -734,6 +722,11 @@ $primary-background-color: #ecf5ff;
734
722
  .el-form-item__label {
735
723
  width: 100%;
736
724
  }
725
+
726
+ .flexView {
727
+ display: flex;
728
+ margin-bottom: 5px;
729
+ }
737
730
  }
738
731
 
739
732
  .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
+ };