tianheng-ui 0.0.56 → 0.0.57

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 (238) hide show
  1. package/lib/039af9192b9bb277966ceb4e4ce29c41.js +16 -0
  2. package/lib/{c755e7fc08446566ee8dd3a8aa8fe43f.js → 2d84c80112a372bc149cad3464e90fa3.js} +404 -502
  3. package/lib/5977b934a4c6b480790864ea01303173.js +10834 -0
  4. package/lib/7745f3e776488705a38e62f85adad54d.js +16 -0
  5. package/lib/de8dee841ffdaaede3a2254deef30376.js +15395 -0
  6. package/lib/e78eab250e7f8ccac3d918dfdb06ca10.js +8904 -0
  7. package/lib/index.js +4 -2
  8. package/lib/theme-chalk/fonts/PingFang.ttf +0 -0
  9. package/lib/theme-chalk/fonts/bpmn.eot +0 -0
  10. package/lib/theme-chalk/fonts/bpmn.svg +224 -0
  11. package/lib/theme-chalk/fonts/bpmn.ttf +0 -0
  12. package/lib/theme-chalk/fonts/bpmn.woff +0 -0
  13. package/lib/theme-chalk/fonts/bpmn.woff2 +0 -0
  14. package/lib/theme-chalk/fonts/fontawesome-webfont.eot +0 -0
  15. package/lib/theme-chalk/fonts/fontawesome-webfont.svg +2671 -0
  16. package/lib/theme-chalk/fonts/fontawesome-webfont.ttf +0 -0
  17. package/lib/theme-chalk/fonts/fontawesome-webfont.woff +0 -0
  18. package/lib/theme-chalk/fonts/fontawesome-webfont.woff2 +0 -0
  19. package/lib/{iconfont.eot → theme-chalk/fonts/iconfont.eot} +0 -0
  20. package/lib/{iconfont.svg → theme-chalk/fonts/iconfont.svg} +0 -0
  21. package/lib/theme-chalk/fonts/iconfont.ttf +0 -0
  22. package/lib/theme-chalk/fonts/iconfont.woff +0 -0
  23. package/lib/theme-chalk/images/notData.png +0 -0
  24. package/lib/theme-chalk/index.scss +29 -0
  25. package/lib/theme-chalk/styles/button.scss +501 -0
  26. package/lib/theme-chalk/styles/card.scss +29 -0
  27. package/lib/theme-chalk/styles/cell.scss +54 -0
  28. package/lib/theme-chalk/styles/codeEditor.scss +9 -0
  29. package/lib/theme-chalk/styles/col.scss +151 -0
  30. package/lib/theme-chalk/styles/dialog.scss +59 -0
  31. package/lib/theme-chalk/styles/empty.scss +22 -0
  32. package/lib/theme-chalk/styles/feature.scss +42 -0
  33. package/lib/theme-chalk/styles/font.css +7 -0
  34. package/lib/theme-chalk/{icon.css → styles/icon.css} +3 -3
  35. package/lib/theme-chalk/styles/imagePreview.scss +113 -0
  36. package/lib/theme-chalk/styles/img.scss +35 -0
  37. package/lib/theme-chalk/styles/reset.scss +8 -0
  38. package/lib/theme-chalk/{root.css → styles/root.css} +2 -35
  39. package/lib/theme-chalk/styles/row.scss +23 -0
  40. package/lib/theme-chalk/styles/variable.scss +80 -0
  41. package/lib/tianheng-ui.js +71 -9
  42. package/package.json +24 -4
  43. package/packages/Button/index.js +8 -0
  44. package/packages/Button/index.vue +80 -0
  45. package/packages/Card/index.js +8 -0
  46. package/packages/Card/index.vue +37 -0
  47. package/packages/{cell → Cell}/index.js +0 -0
  48. package/packages/Cell/index.vue +68 -0
  49. package/packages/{codeEditor → CodeEditor}/index.js +0 -0
  50. package/packages/{codeEditor → CodeEditor}/index.vue +73 -108
  51. package/packages/Col/index.js +8 -0
  52. package/packages/Col/index.vue +41 -0
  53. package/packages/{dialog → Dialog}/index.js +0 -0
  54. package/packages/{dialog → Dialog}/index.vue +19 -10
  55. package/packages/Empty/images/notData.png +0 -0
  56. package/packages/{empty → Empty}/index.js +0 -0
  57. package/packages/Empty/index.vue +35 -0
  58. package/packages/FormMaking/Container.vue +1907 -0
  59. package/packages/{formMaking → FormMaking}/FormConfig.vue +22 -6
  60. package/packages/FormMaking/GenerateForm.vue +246 -0
  61. package/packages/{formMaking → FormMaking}/GenerateFormItem.vue +340 -172
  62. package/packages/FormMaking/GenerateFormItemH5.vue +828 -0
  63. package/packages/{formMaking → FormMaking}/Upload/index.vue +0 -0
  64. package/packages/FormMaking/WidgetConfig.vue +473 -0
  65. package/packages/{formMaking → FormMaking}/WidgetForm.vue +49 -31
  66. package/packages/FormMaking/WidgetFormItem.vue +157 -0
  67. package/packages/{formMaking/componentsConfig.js → FormMaking/custom/config.js} +379 -163
  68. package/packages/FormMaking/custom/configs/alliance.vue +0 -0
  69. package/packages/FormMaking/custom/configs/blank.vue +54 -0
  70. package/packages/FormMaking/custom/configs/button.vue +144 -0
  71. package/packages/FormMaking/custom/configs/cascader.vue +182 -0
  72. package/packages/FormMaking/custom/configs/cell.vue +81 -0
  73. package/packages/FormMaking/custom/configs/checkbox.vue +237 -0
  74. package/packages/FormMaking/custom/configs/color.vue +137 -0
  75. package/packages/FormMaking/custom/configs/date.vue +158 -0
  76. package/packages/FormMaking/custom/configs/divider.vue +61 -0
  77. package/packages/FormMaking/custom/configs/editor.vue +71 -0
  78. package/packages/FormMaking/custom/configs/filler.vue +52 -0
  79. package/packages/FormMaking/custom/configs/grid.vue +103 -0
  80. package/packages/FormMaking/custom/configs/image.vue +148 -0
  81. package/packages/FormMaking/custom/configs/input.vue +176 -0
  82. package/packages/FormMaking/custom/configs/number.vue +140 -0
  83. package/packages/FormMaking/custom/configs/radio.vue +215 -0
  84. package/packages/FormMaking/custom/configs/rate.vue +109 -0
  85. package/packages/FormMaking/custom/configs/select.vue +308 -0
  86. package/packages/FormMaking/custom/configs/slider.vue +142 -0
  87. package/packages/FormMaking/custom/configs/switch.vue +130 -0
  88. package/packages/FormMaking/custom/configs/table.vue +105 -0
  89. package/packages/FormMaking/custom/configs/table_h5.vue +102 -0
  90. package/packages/FormMaking/custom/configs/tabs.vue +175 -0
  91. package/packages/FormMaking/custom/configs/text.vue +71 -0
  92. package/packages/FormMaking/custom/configs/textarea.vue +167 -0
  93. package/packages/FormMaking/custom/configs/time.vue +153 -0
  94. package/packages/FormMaking/custom/configs/upload.vue +150 -0
  95. package/packages/FormMaking/custom/index.js +33 -0
  96. package/packages/FormMaking/custom/items/alliance.vue +132 -0
  97. package/packages/FormMaking/custom/items/blank.vue +16 -0
  98. package/packages/FormMaking/custom/items/button.vue +27 -0
  99. package/packages/FormMaking/custom/items/cascader.vue +29 -0
  100. package/packages/FormMaking/custom/items/cell.vue +18 -0
  101. package/packages/FormMaking/custom/items/checkbox.vue +46 -0
  102. package/packages/FormMaking/custom/items/color.vue +19 -0
  103. package/packages/FormMaking/custom/items/date.vue +29 -0
  104. package/packages/FormMaking/custom/items/divider.vue +14 -0
  105. package/packages/FormMaking/custom/items/editor.vue +22 -0
  106. package/packages/FormMaking/custom/items/filler.vue +17 -0
  107. package/packages/FormMaking/custom/items/grid.vue +129 -0
  108. package/packages/FormMaking/custom/items/image.vue +42 -0
  109. package/packages/FormMaking/custom/items/input.vue +36 -0
  110. package/packages/FormMaking/custom/items/login.vue +13 -0
  111. package/packages/FormMaking/custom/items/number.vue +24 -0
  112. package/packages/FormMaking/custom/items/radio.vue +44 -0
  113. package/packages/FormMaking/custom/items/rate.vue +20 -0
  114. package/packages/FormMaking/custom/items/select.vue +32 -0
  115. package/packages/FormMaking/custom/items/slider.vue +34 -0
  116. package/packages/FormMaking/custom/items/switch.vue +22 -0
  117. package/packages/FormMaking/custom/items/table.vue +106 -0
  118. package/packages/FormMaking/custom/items/table_h5.vue +126 -0
  119. package/packages/FormMaking/custom/items/tabs.vue +145 -0
  120. package/packages/FormMaking/custom/items/text.vue +18 -0
  121. package/packages/FormMaking/custom/items/textarea.vue +37 -0
  122. package/packages/FormMaking/custom/items/time.vue +32 -0
  123. package/packages/FormMaking/custom/items/upload.vue +83 -0
  124. package/packages/FormMaking/custom/mixins/index.js +61 -0
  125. package/packages/FormMaking/custom/register.js +18 -0
  126. package/packages/{formMaking → FormMaking}/iconfont/demo.css +0 -0
  127. package/packages/{formMaking → FormMaking}/iconfont/demo_index.html +0 -0
  128. package/packages/{formMaking → FormMaking}/iconfont/iconfont.css +0 -0
  129. package/packages/{formMaking → FormMaking}/iconfont/iconfont.eot +0 -0
  130. package/packages/{formMaking → FormMaking}/iconfont/iconfont.js +0 -0
  131. package/packages/{formMaking → FormMaking}/iconfont/iconfont.svg +0 -0
  132. package/{lib → packages/FormMaking/iconfont}/iconfont.ttf +0 -0
  133. package/{lib → packages/FormMaking/iconfont}/iconfont.woff +0 -0
  134. package/packages/{formMaking → FormMaking}/iconfont/iconfont.woff2 +0 -0
  135. package/packages/FormMaking/index.js +35 -0
  136. package/packages/{formMaking → FormMaking}/lang/en-US.js +1 -1
  137. package/packages/{formMaking → FormMaking}/lang/zh-CN.js +1 -1
  138. package/packages/{formMaking → FormMaking}/styles/cover.scss +1 -1
  139. package/packages/{formMaking → FormMaking}/styles/index.scss +445 -429
  140. package/packages/{formMaking → FormMaking/util}/generateCode.js +5 -5
  141. package/packages/{formMaking → FormMaking}/util/index.js +0 -0
  142. package/packages/{formMaking → FormMaking}/util/request.js +0 -0
  143. package/packages/{icons → Icons}/index.js +0 -0
  144. package/packages/{icons → Icons}/index.vue +26 -9
  145. package/packages/Image/index.js +8 -0
  146. package/packages/Image/index.vue +146 -0
  147. package/packages/ImagePreview/index.js +8 -0
  148. package/packages/ImagePreview/index.vue +386 -0
  149. package/packages/Row/index.js +8 -0
  150. package/packages/Row/index.vue +35 -0
  151. package/packages/{table → Table}/action.js +0 -0
  152. package/packages/{table → Table}/action.vue +1 -1
  153. package/packages/Table/column.vue +63 -0
  154. package/packages/{table → Table}/index.js +0 -0
  155. package/packages/{table → Table}/index.vue +25 -23
  156. package/packages/{table → Table}/search.js +0 -0
  157. package/packages/{table → Table}/search.vue +2 -2
  158. package/packages/{table → Table}/tools.js +0 -0
  159. package/packages/{table → Table}/tools.vue +0 -0
  160. package/packages/Workflow/Log.js +99 -0
  161. package/packages/Workflow/designer/ProcessDesigner.vue +628 -0
  162. package/packages/Workflow/designer/index.js +7 -0
  163. package/packages/Workflow/designer/plugins/content-pad/contentPadProvider.js +390 -0
  164. package/packages/Workflow/designer/plugins/content-pad/index.js +6 -0
  165. package/packages/Workflow/designer/plugins/defaultEmpty.js +24 -0
  166. package/packages/Workflow/designer/plugins/descriptor/activitiDescriptor.json +1071 -0
  167. package/packages/Workflow/designer/plugins/descriptor/camundaDescriptor.json +1087 -0
  168. package/packages/Workflow/designer/plugins/descriptor/flowableDescriptor.json +1215 -0
  169. package/packages/Workflow/designer/plugins/extension-moddle/activiti/activitiExtension.js +74 -0
  170. package/packages/Workflow/designer/plugins/extension-moddle/activiti/index.js +9 -0
  171. package/packages/Workflow/designer/plugins/extension-moddle/camunda/extension.js +148 -0
  172. package/packages/Workflow/designer/plugins/extension-moddle/camunda/index.js +6 -0
  173. package/packages/Workflow/designer/plugins/extension-moddle/flowable/flowableExtension.js +74 -0
  174. package/packages/Workflow/designer/plugins/extension-moddle/flowable/index.js +9 -0
  175. package/packages/Workflow/designer/plugins/palette/CustomPalette.js +156 -0
  176. package/packages/Workflow/designer/plugins/palette/index.js +6 -0
  177. package/packages/Workflow/designer/plugins/palette/paletteProvider.js +160 -0
  178. package/packages/Workflow/designer/plugins/translate/customTranslate.js +41 -0
  179. package/packages/Workflow/designer/plugins/translate/zh.js +238 -0
  180. package/packages/Workflow/highlight/index.js +5 -0
  181. package/packages/Workflow/index.js +26 -0
  182. package/packages/Workflow/index.vue +394 -0
  183. package/packages/Workflow/modules/auto-place/CustomAutoPlace.js +81 -0
  184. package/packages/Workflow/modules/auto-place/index.js +6 -0
  185. package/packages/Workflow/modules/custom-renderer/CustomRenderer.js +17 -0
  186. package/packages/Workflow/modules/custom-renderer/index.js +6 -0
  187. package/packages/Workflow/modules/rules/CustomRules.js +16 -0
  188. package/packages/Workflow/modules/rules/index.js +6 -0
  189. package/packages/Workflow/palette/ProcessPalette.vue +106 -0
  190. package/packages/Workflow/palette/index.js +7 -0
  191. package/packages/Workflow/penal/PropertiesPanel.vue +247 -0
  192. package/packages/Workflow/penal/base/ElementBaseInfo.vue +80 -0
  193. package/packages/Workflow/penal/flow-condition/FlowCondition.vue +142 -0
  194. package/packages/Workflow/penal/form/ElementForm.vue +367 -0
  195. package/packages/Workflow/penal/index.js +7 -0
  196. package/packages/Workflow/penal/listeners/ElementListeners.vue +299 -0
  197. package/packages/Workflow/penal/listeners/UserTaskListeners.vue +322 -0
  198. package/packages/Workflow/penal/listeners/template.js +178 -0
  199. package/packages/Workflow/penal/listeners/utilSelf.js +62 -0
  200. package/packages/Workflow/penal/multi-instance/ElementMultiInstance.vue +200 -0
  201. package/packages/Workflow/penal/other/ElementOtherConfig.vue +59 -0
  202. package/packages/Workflow/penal/properties/ElementProperties.vue +135 -0
  203. package/packages/Workflow/penal/signal-message/SignalAndMessage.vue +104 -0
  204. package/packages/Workflow/penal/task/ElementTask.vue +73 -0
  205. package/packages/Workflow/penal/task/task-components/ReceiveTask.vue +97 -0
  206. package/packages/Workflow/penal/task/task-components/ScriptTask.vue +85 -0
  207. package/packages/Workflow/penal/task/task-components/UserTask.vue +535 -0
  208. package/packages/Workflow/theme/element-variables.scss +70 -0
  209. package/packages/Workflow/theme/index.scss +2 -0
  210. package/packages/Workflow/theme/process-designer.scss +157 -0
  211. package/packages/Workflow/theme/process-panel.scss +107 -0
  212. package/packages/Workflow/translations.js +25 -0
  213. package/packages/Workflow/utils.js +71 -0
  214. package/packages/upload/ajax.js +85 -0
  215. package/packages/upload/index.js +8 -0
  216. package/packages/upload/index.vue +325 -0
  217. package/packages/upload/locale.js +9 -0
  218. package/packages/upload/upload-dragger.vue +70 -0
  219. package/packages/upload/upload-list.vue +101 -0
  220. package/packages/upload/upload.vue +211 -0
  221. package/lib/03250ed25fc1b305e9980cf7cf0dfb09.js +0 -1
  222. package/lib/theme-chalk/cell.css +0 -53
  223. package/lib/theme-chalk/dialog.css +0 -41
  224. package/lib/theme-chalk/empty.css +0 -27
  225. package/lib/theme-chalk/index.css +0 -6
  226. package/lib/theme-chalk/reset.css +0 -4
  227. package/lib/tianheng-ui.js.map +0 -1
  228. package/packages/cell/index.vue +0 -116
  229. package/packages/empty/index.vue +0 -33
  230. package/packages/formMaking/Container.vue +0 -591
  231. package/packages/formMaking/CusDialog.vue +0 -134
  232. package/packages/formMaking/GenerateForm.vue +0 -174
  233. package/packages/formMaking/WidgetConfig.vue +0 -1539
  234. package/packages/formMaking/WidgetFormItem.vue +0 -817
  235. package/packages/formMaking/iconfont/iconfont.ttf +0 -0
  236. package/packages/formMaking/iconfont/iconfont.woff +0 -0
  237. package/packages/formMaking/index.js +0 -77
  238. package/packages/table/column.vue +0 -111
@@ -0,0 +1,20 @@
1
+ <template>
2
+ <el-rate
3
+ v-model="widget.options.defaultValue"
4
+ :max="widget.options.max"
5
+ :disabled="widget.options.disabled"
6
+ :allow-half="widget.options.allowHalf"
7
+ :show-text="widget.options.showText"
8
+ :texts="widget.options.auxiliaryValue"
9
+ @change="handleEventAction(widget.events.onChange)"
10
+ ></el-rate>
11
+ </template>
12
+
13
+ <script>
14
+ import { itemsComponent } from "../mixins/index";
15
+ export default {
16
+ mixins: [itemsComponent]
17
+ };
18
+ </script>
19
+
20
+ <style></style>
@@ -0,0 +1,32 @@
1
+ <template>
2
+ <el-select
3
+ v-model="widget.options.defaultValue"
4
+ :style="{ width: widget.options.width }"
5
+ :disabled="widget.options.disabled"
6
+ :multiple="widget.options.multiple"
7
+ :collapseTags="widget.options.collapseTags"
8
+ :allowCreate="widget.options.allowCreate"
9
+ :clearable="widget.options.clearable"
10
+ :placeholder="widget.options.placeholder"
11
+ :filterable="widget.options.allowCreate ? true : widget.options.filterable"
12
+ @change="handleEventAction(widget.events.onChange)"
13
+ @focus="handleEventAction(widget.events.onFocus)"
14
+ @blur="handleEventAction(widget.events.onBlur)"
15
+ >
16
+ <el-option
17
+ v-for="(item, index) in widget.options.options"
18
+ :key="`select_${index}_${item.value}`"
19
+ :value="item.value"
20
+ :label="widget.options.showLabel ? item.label : item.value"
21
+ ></el-option>
22
+ </el-select>
23
+ </template>
24
+
25
+ <script>
26
+ import { itemsComponent } from "../mixins/index";
27
+ export default {
28
+ mixins: [itemsComponent]
29
+ };
30
+ </script>
31
+
32
+ <style></style>
@@ -0,0 +1,34 @@
1
+ <template>
2
+ <el-slider
3
+ v-model="widget.options.defaultValue"
4
+ :min="widget.options.min"
5
+ :max="widget.options.max"
6
+ :disabled="widget.options.disabled"
7
+ :step="widget.options.step"
8
+ :show-input="widget.options.showInput"
9
+ :range="widget.options.range"
10
+ :style="{
11
+ width: widget.options.width,
12
+ height: widget.options.height
13
+ }"
14
+ :show-tooltip="widget.options.showTooltip"
15
+ :format-tooltip="val => formatTooltip(val, widget.options.formatTooltip)"
16
+ :show-stops="widget.options.showStops"
17
+ :vertical="widget.options.vertical"
18
+ @change="handleEventAction(widget.events.onChange)"
19
+ ></el-slider>
20
+ </template>
21
+
22
+ <script>
23
+ import { itemsComponent } from "../mixins/index";
24
+ export default {
25
+ mixins: [itemsComponent],
26
+ methods: {
27
+ formatTooltip(val, num) {
28
+ return val / num;
29
+ }
30
+ }
31
+ };
32
+ </script>
33
+
34
+ <style></style>
@@ -0,0 +1,22 @@
1
+ <template>
2
+ <el-switch
3
+ v-model="widget.options.defaultValue"
4
+ :width="widget.options.width - 20"
5
+ :disabled="widget.options.disabled"
6
+ :inactive-text="widget.options.switchInactiveText"
7
+ :active-text="widget.options.switchActiveText"
8
+ :inactive-color="widget.options.switchInactiveColor"
9
+ :active-color="widget.options.switchActiveColor"
10
+ @change="handleEventAction(widget.events.onChange)"
11
+ >
12
+ </el-switch>
13
+ </template>
14
+
15
+ <script>
16
+ import { itemsComponent } from "../mixins/index";
17
+ export default {
18
+ mixins: [itemsComponent]
19
+ };
20
+ </script>
21
+
22
+ <style></style>
@@ -0,0 +1,106 @@
1
+ <template>
2
+ <draggable
3
+ v-model="widget.list"
4
+ :no-transition-on-drag="true"
5
+ v-bind="{
6
+ group: 'people',
7
+ ghostClass: 'ghost',
8
+ animation: 200,
9
+ handle: '.drag-widget'
10
+ }"
11
+ @add="handleWidgetTableAdd($event, widget)"
12
+ >
13
+ <transition-group name="fade" tag="div" class="widget-table-list">
14
+ <widget-form-item
15
+ v-for="(element, elementIndex) in widget.list.filter(item => {
16
+ return item.key;
17
+ })"
18
+ :key="element.key"
19
+ :widget="element"
20
+ :widgetIndex="elementIndex"
21
+ :widgetArray="widget"
22
+ :select.sync="selectWidget"
23
+ :config="config"
24
+ >
25
+ </widget-form-item>
26
+ </transition-group>
27
+ </draggable>
28
+ </template>
29
+
30
+ <script>
31
+ import { itemsComponent } from "../mixins/index";
32
+ import Draggable from "vuedraggable";
33
+ import WidgetFormItem from "../../WidgetFormItem.vue";
34
+ export default {
35
+ components: { Draggable, WidgetFormItem },
36
+ mixins: [itemsComponent],
37
+ data() {
38
+ return {
39
+ selectWidget: {}
40
+ };
41
+ },
42
+ watch: {
43
+ select(val) {
44
+ this.selectWidget = val;
45
+ },
46
+ selectWidget: {
47
+ handler(val) {
48
+ this.$emit("update:select", val);
49
+ },
50
+ deep: true
51
+ }
52
+ },
53
+ methods:{
54
+ handleWidgetTableAdd($event, row) {
55
+ const newIndex = $event.newIndex;
56
+ const oldIndex = $event.oldIndex;
57
+ const item = $event.item;
58
+ // 防止布局元素的嵌套拖拽
59
+ if (item.className.indexOf("no-put") >= 0) {
60
+ // 如果是列表中拖拽的元素需要还原到原来位置
61
+ item.tagName === "DIV" &&
62
+ this.widgetArray.list.splice(oldIndex, 0, row.list[newIndex]);
63
+
64
+ row.list.splice(newIndex, 1);
65
+
66
+ return false;
67
+ }
68
+
69
+ const key =
70
+ Date.parse(new Date()) + "_" + Math.ceil(Math.random() * 99999);
71
+
72
+ this.$set(row.list, newIndex, {
73
+ ...row.list[newIndex],
74
+ options: {
75
+ ...row.list[newIndex].options
76
+ // remoteFunc: "func_" + key
77
+ },
78
+ key,
79
+ // 绑定键值
80
+ model: row.list[newIndex].type + "_" + key,
81
+ rules: []
82
+ });
83
+
84
+ if (
85
+ row.list[newIndex].type === "radio" ||
86
+ row.list[newIndex].type === "checkbox" ||
87
+ row.list[newIndex].type === "select"
88
+ ) {
89
+ this.$set(row.list, newIndex, {
90
+ ...row.list[newIndex],
91
+ options: {
92
+ ...row.list[newIndex].options,
93
+ options: row.list[newIndex].options.options.map(item => ({
94
+ ...item
95
+ }))
96
+ }
97
+ });
98
+ }
99
+
100
+ this.selectWidget = row.list[newIndex];
101
+ },
102
+ }
103
+ };
104
+ </script>
105
+
106
+ <style></style>
@@ -0,0 +1,126 @@
1
+ <template>
2
+ <div>
3
+ <draggable
4
+ v-model="widget.list"
5
+ :no-transition-on-drag="true"
6
+ v-bind="{
7
+ group: 'people',
8
+ ghostClass: 'ghost',
9
+ animation: 200,
10
+ handle: '.drag-widget'
11
+ }"
12
+ @add="handleWidgetTableAdd($event, widget)"
13
+ >
14
+ <transition-group name="fade" tag="div" class="tableH5">
15
+ <div
16
+ class="tableH5-item"
17
+ v-for="(element, elementIndex) in widget.list.filter(item => {
18
+ return item.key;
19
+ })"
20
+ :key="element.key"
21
+ >
22
+ <widget-form-item
23
+ class="tableH5-item-widget"
24
+ :widget="element"
25
+ :widgetIndex="elementIndex"
26
+ :widgetArray="widget"
27
+ :select.sync="selectWidget"
28
+ :config="config"
29
+ >
30
+ </widget-form-item>
31
+ <div
32
+ v-if="widget.options.isDelete && elementIndex === 0"
33
+ class="actions"
34
+ >
35
+ <el-button type="danger">{{
36
+ widget.options.deleteButtonText
37
+ }}</el-button>
38
+ </div>
39
+ </div>
40
+ </transition-group>
41
+ </draggable>
42
+ <div v-if="widget.options.isAdd" style="text-align: center;">
43
+ <el-button type="text" :disabled="widget.options.disabled">{{
44
+ widget.options.addButtonText
45
+ }}</el-button>
46
+ </div>
47
+ </div>
48
+ </template>
49
+
50
+ <script>
51
+ import { itemsComponent } from "../mixins/index";
52
+ import Draggable from "vuedraggable";
53
+ import WidgetFormItem from "../../WidgetFormItem.vue";
54
+ export default {
55
+ components: { Draggable, WidgetFormItem },
56
+ mixins: [itemsComponent],
57
+ data() {
58
+ return {
59
+ selectWidget: {}
60
+ };
61
+ },
62
+ watch: {
63
+ select(val) {
64
+ this.selectWidget = val;
65
+ },
66
+ selectWidget: {
67
+ handler(val) {
68
+ this.$emit("update:select", val);
69
+ },
70
+ deep: true
71
+ }
72
+ },
73
+ methods: {
74
+ handleWidgetTableAdd($event, row) {
75
+ const newIndex = $event.newIndex;
76
+ const oldIndex = $event.oldIndex;
77
+ const item = $event.item;
78
+ // 防止布局元素的嵌套拖拽
79
+ if (item.className.indexOf("no-put") >= 0) {
80
+ // 如果是列表中拖拽的元素需要还原到原来位置
81
+ item.tagName === "DIV" &&
82
+ this.widgetArray.list.splice(oldIndex, 0, row.list[newIndex]);
83
+
84
+ row.list.splice(newIndex, 1);
85
+
86
+ return false;
87
+ }
88
+
89
+ const key =
90
+ Date.parse(new Date()) + "_" + Math.ceil(Math.random() * 99999);
91
+
92
+ this.$set(row.list, newIndex, {
93
+ ...row.list[newIndex],
94
+ options: {
95
+ ...row.list[newIndex].options
96
+ // remoteFunc: "func_" + key
97
+ },
98
+ key,
99
+ // 绑定键值
100
+ model: row.list[newIndex].type + "_" + key,
101
+ rules: []
102
+ });
103
+
104
+ if (
105
+ row.list[newIndex].type === "radio" ||
106
+ row.list[newIndex].type === "checkbox" ||
107
+ row.list[newIndex].type === "select"
108
+ ) {
109
+ this.$set(row.list, newIndex, {
110
+ ...row.list[newIndex],
111
+ options: {
112
+ ...row.list[newIndex].options,
113
+ options: row.list[newIndex].options.options.map(item => ({
114
+ ...item
115
+ }))
116
+ }
117
+ });
118
+ }
119
+
120
+ this.selectWidget = row.list[newIndex];
121
+ }
122
+ }
123
+ };
124
+ </script>
125
+
126
+ <style></style>
@@ -0,0 +1,145 @@
1
+ <template>
2
+ <el-tabs
3
+ v-model="widget.options.defaultValue"
4
+ :type="widget.options.type"
5
+ :tab-position="widget.options.tabPosition"
6
+ >
7
+ <el-tab-pane
8
+ v-for="(column, columnIndex) in widget.tabs"
9
+ :key="`tabs_${column.value}`"
10
+ :label="column.label"
11
+ :name="column.value"
12
+ >
13
+ <draggable
14
+ v-model="column.list"
15
+ :no-transition-on-drag="true"
16
+ v-bind="{
17
+ group: 'people',
18
+ ghostClass: 'ghost',
19
+ animation: 200,
20
+ handle: '.drag-widget'
21
+ }"
22
+ @add="handleWidgetTabAdd($event, widget, columnIndex)"
23
+ >
24
+ <transition-group name="fade" tag="div" class="widget-col-list">
25
+ <widget-form-item
26
+ v-for="(element, elementIndex) in column.list.filter(item => {
27
+ return item.key;
28
+ })"
29
+ :key="element.key"
30
+ :widget="element"
31
+ :widgetIndex="elementIndex"
32
+ :widgetArray="column"
33
+ :select.sync="selectWidget"
34
+ :config="config"
35
+ ></widget-form-item>
36
+ </transition-group>
37
+ </draggable>
38
+ </el-tab-pane>
39
+ </el-tabs>
40
+ </template>
41
+
42
+ <script>
43
+ import { itemsComponent } from "../mixins/index";
44
+ import Draggable from "vuedraggable";
45
+ import WidgetFormItem from "../../WidgetFormItem.vue";
46
+ export default {
47
+ components: { Draggable, WidgetFormItem },
48
+ mixins: [itemsComponent],
49
+ data() {
50
+ return {
51
+ selectWidget: {}
52
+ };
53
+ },
54
+ watch: {
55
+ select(val) {
56
+ this.selectWidget = val;
57
+ },
58
+ selectWidget: {
59
+ handler(val) {
60
+ this.$emit("update:select", val);
61
+ },
62
+ deep: true
63
+ }
64
+ },
65
+ methods: {
66
+ handleWidgetTabAdd($event, row, colIndex) {
67
+ const newIndex = $event.newIndex;
68
+ const oldIndex = $event.oldIndex;
69
+ const item = $event.item;
70
+
71
+ // 防止布局元素的嵌套拖拽
72
+ if (
73
+ item.className.indexOf("tabs") !== -1 ||
74
+ item.className.indexOf("alliance") !== -1
75
+ ) {
76
+ // 如果是列表中拖拽的元素需要还原到原来位置
77
+ item.tagName === "DIV" &&
78
+ this.widgetArray.list.splice(
79
+ oldIndex,
80
+ 0,
81
+ row.tabs[colIndex].list[newIndex]
82
+ );
83
+
84
+ row.tabs[colIndex].list.splice(newIndex, 1);
85
+
86
+ return false;
87
+ }
88
+
89
+ const key =
90
+ Date.parse(new Date()) + "_" + Math.ceil(Math.random() * 99999);
91
+
92
+ this.$set(row.tabs[colIndex].list, newIndex, {
93
+ ...row.tabs[colIndex].list[newIndex],
94
+ options: {
95
+ ...row.tabs[colIndex].list[newIndex].options
96
+ // remoteFunc: "func_" + key
97
+ },
98
+ key,
99
+ // 绑定键值
100
+ model: row.tabs[colIndex].list[newIndex].type + "_" + key,
101
+ rules: []
102
+ });
103
+
104
+ if (
105
+ row.tabs[colIndex].list[newIndex].type === "radio" ||
106
+ row.tabs[colIndex].list[newIndex].type === "checkbox" ||
107
+ row.tabs[colIndex].list[newIndex].type === "select"
108
+ ) {
109
+ this.$set(row.tabs[colIndex].list, newIndex, {
110
+ ...row.tabs[colIndex].list[newIndex],
111
+ options: {
112
+ ...row.tabs[colIndex].list[newIndex].options,
113
+ options: row.tabs[colIndex].list[newIndex].options.options.map(
114
+ item => ({
115
+ ...item
116
+ })
117
+ )
118
+ }
119
+ });
120
+ }
121
+
122
+ if (row.tabs[colIndex].list[newIndex].type === "grid") {
123
+ this.$set(
124
+ row.tabs[colIndex].list,
125
+ newIndex,
126
+ JSON.parse(JSON.stringify(row.tabs[colIndex].list[newIndex]))
127
+ );
128
+ }
129
+
130
+ if (row.tabs[colIndex].list[newIndex].type === "table") {
131
+ this.$set(row.tabs[colIndex].list, newIndex, {
132
+ ...row.tabs[colIndex].list[newIndex],
133
+ list: row.tabs[colIndex].list[newIndex].list.map(item => ({
134
+ ...item
135
+ }))
136
+ });
137
+ }
138
+
139
+ this.selectWidget = row.tabs[colIndex].list[newIndex];
140
+ }
141
+ }
142
+ };
143
+ </script>
144
+
145
+ <style></style>
@@ -0,0 +1,18 @@
1
+ <template>
2
+ <div
3
+ :style="{
4
+ height: widget.options.height,
5
+ textAlign: widget.options.textAlign
6
+ }"
7
+ v-html="widget.options.defaultValue"
8
+ ></div>
9
+ </template>
10
+
11
+ <script>
12
+ import { itemsComponent } from "../mixins/index";
13
+ export default {
14
+ mixins: [itemsComponent]
15
+ };
16
+ </script>
17
+
18
+ <style></style>
@@ -0,0 +1,37 @@
1
+ <template>
2
+ <el-input
3
+ type="textarea"
4
+ v-model="widget.options.defaultValue"
5
+ :style="{ width: widget.options.width }"
6
+ :disabled="widget.options.disabled"
7
+ :placeholder="widget.options.placeholder"
8
+ :maxlength="widget.options.maxlength"
9
+ :show-word-limit="widget.options.showWordLimit"
10
+ :clearable="widget.options.clearable"
11
+ :suffix-icon="widget.options.suffixIcon"
12
+ :prefix-icon="widget.options.prefixIcon"
13
+ :autosize="{
14
+ minRows: widget.options.minRows,
15
+ maxRows: widget.options.maxRows
16
+ }"
17
+ @input="handleEventAction(widget.events.onChange)"
18
+ @focus="handleEventAction(widget.events.onFocus)"
19
+ @blur="handleEventAction(widget.events.onBlur)"
20
+ >
21
+ <template v-if="widget.options.prepend" slot="prepend">
22
+ <span v-html="widget.options.prepend"></span>
23
+ </template>
24
+ <template v-if="widget.options.append" slot="append">
25
+ <span v-html="widget.options.append"></span>
26
+ </template>
27
+ </el-input>
28
+ </template>
29
+
30
+ <script>
31
+ import { itemsComponent } from "../mixins/index";
32
+ export default {
33
+ mixins: [itemsComponent]
34
+ };
35
+ </script>
36
+
37
+ <style></style>
@@ -0,0 +1,32 @@
1
+ <template>
2
+ <el-time-picker
3
+ v-model="widget.options.defaultValue"
4
+ :style="{ width: widget.options.width }"
5
+ :is-range="widget.options.isRange"
6
+ :placeholder="widget.options.placeholder"
7
+ :start-placeholder="widget.options.startPlaceholder"
8
+ :end-placeholder="widget.options.endPlaceholder"
9
+ :readonly="widget.options.readonly"
10
+ :disabled="widget.options.disabled"
11
+ :editable="widget.options.editable"
12
+ :clearable="widget.options.clearable"
13
+ :arrow-control="widget.options.arrowControl"
14
+ :picker-options="{
15
+ selectableRange: `${widget.options.pickerOptions.selectableRange[0]} - ${widget.options.pickerOptions.selectableRange[1]}`
16
+ }"
17
+ :value-format="widget.options.format"
18
+ @change="handleEventAction(widget.events.onChange)"
19
+ @focus="handleEventAction(widget.events.onFocus)"
20
+ @blur="handleEventAction(widget.events.onBlur)"
21
+ >
22
+ </el-time-picker>
23
+ </template>
24
+
25
+ <script>
26
+ import { itemsComponent } from "../mixins/index";
27
+ export default {
28
+ mixins: [itemsComponent]
29
+ };
30
+ </script>
31
+
32
+ <style></style>
@@ -0,0 +1,83 @@
1
+ <template>
2
+ <div>
3
+ <el-upload
4
+ :action="widget.options.remoteFunc"
5
+ :on-preview="
6
+ file => handlePictureCardPreview(file, widget.options.listType)
7
+ "
8
+ :on-remove="handleRemove"
9
+ :multiple="widget.options.multiple"
10
+ :limit="widget.options.length"
11
+ :list-type="widget.options.listType"
12
+ :file-list="widget.options.defaultValue"
13
+ :drag="widget.options.drag"
14
+ :on-change="handleAvatar"
15
+ :on-error="handleAvatarError"
16
+ :disabled="widget.options.disabled"
17
+ >
18
+ <el-button
19
+ v-if="
20
+ ['default', 'picture'].includes(widget.options.listType) &&
21
+ !widget.options.drag
22
+ "
23
+ size="small"
24
+ type="primary"
25
+ :disabled="widget.options.disabled"
26
+ >点击上传</el-button
27
+ >
28
+ <i
29
+ v-if="
30
+ widget.options.listType === 'picture-card' && !widget.options.drag
31
+ "
32
+ slot="default"
33
+ class="el-icon-plus"
34
+ ></i>
35
+ <template v-if="widget.options.drag">
36
+ <i class="el-icon-upload"></i>
37
+ <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
38
+ </template>
39
+
40
+ <div
41
+ slot="tip"
42
+ class="el-upload__tip"
43
+ v-html="widget.options.elUploadTip"
44
+ ></div>
45
+ </el-upload>
46
+
47
+ <el-dialog :visible.sync="dialogVisible">
48
+ <img width="100%" :src="dialogImageUrl" alt="" />
49
+ </el-dialog>
50
+ </div>
51
+ </template>
52
+
53
+ <script>
54
+ import { itemsComponent } from "../mixins/index";
55
+ export default {
56
+ mixins: [itemsComponent],
57
+ data() {
58
+ return {
59
+ dialogVisible: false,
60
+ dialogImageUrl: ""
61
+ };
62
+ },
63
+ methods: {
64
+ handlePictureCardPreview(file, listType) {
65
+ if (listType === "picture-card") {
66
+ this.dialogImageUrl = file.url;
67
+ this.dialogVisible = true;
68
+ }
69
+ },
70
+ handleRemove(file, fileList) {
71
+ this.widgetArray.options.defaultValue = fileList;
72
+ },
73
+ handleAvatar(res, file) {
74
+ this.widgetArray.options.defaultValue = file;
75
+ },
76
+ handleAvatarError() {
77
+ console.log("上传失败!");
78
+ }
79
+ }
80
+ };
81
+ </script>
82
+
83
+ <style></style>