tianheng-ui 0.1.0 → 0.1.1

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 (254) hide show
  1. package/README.md +9 -18
  2. package/lib/039af9192b9bb277966ceb4e4ce29c41.js +16 -0
  3. package/lib/2d84c80112a372bc149cad3464e90fa3.js +1617 -0
  4. package/lib/5977b934a4c6b480790864ea01303173.js +10834 -0
  5. package/lib/7745f3e776488705a38e62f85adad54d.js +16 -0
  6. package/lib/de8dee841ffdaaede3a2254deef30376.js +15395 -0
  7. package/lib/e78eab250e7f8ccac3d918dfdb06ca10.js +8904 -0
  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/theme-chalk/fonts/iconfont.eot +0 -0
  20. package/lib/theme-chalk/fonts/iconfont.svg +155 -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/fonts/iconfont.woff2 +0 -0
  24. package/lib/theme-chalk/images/notData.png +0 -0
  25. package/lib/theme-chalk/index.scss +31 -0
  26. package/lib/theme-chalk/js/Log.js +99 -0
  27. package/lib/theme-chalk/js/axios.js +86 -0
  28. package/lib/theme-chalk/js/store/getters.js +5 -0
  29. package/lib/theme-chalk/js/store/modules/makingForm.js +21 -0
  30. package/lib/theme-chalk/js/store/store.js +26 -0
  31. package/lib/theme-chalk/styles/button.scss +501 -0
  32. package/lib/theme-chalk/styles/card.scss +29 -0
  33. package/lib/theme-chalk/styles/cell.scss +54 -0
  34. package/lib/theme-chalk/styles/codeEditor.scss +9 -0
  35. package/lib/theme-chalk/styles/col.scss +151 -0
  36. package/lib/theme-chalk/styles/dialog.scss +56 -0
  37. package/lib/theme-chalk/styles/empty.scss +22 -0
  38. package/lib/theme-chalk/styles/feature.scss +46 -0
  39. package/lib/theme-chalk/styles/font.css +7 -0
  40. package/lib/theme-chalk/styles/grid.scss +41 -0
  41. package/lib/theme-chalk/styles/icon.css +1944 -0
  42. package/lib/theme-chalk/styles/imagePreview.scss +113 -0
  43. package/lib/theme-chalk/styles/img.scss +35 -0
  44. package/lib/theme-chalk/styles/reset.scss +17 -0
  45. package/lib/theme-chalk/styles/root.css +64 -0
  46. package/lib/theme-chalk/styles/row.scss +23 -0
  47. package/lib/theme-chalk/styles/upload.scss +744 -0
  48. package/lib/theme-chalk/styles/variable.scss +80 -0
  49. package/lib/tianheng-ui.js +116 -0
  50. package/package.json +86 -48
  51. package/packages/Button/index.js +8 -0
  52. package/packages/Button/index.vue +80 -0
  53. package/packages/Card/index.js +8 -0
  54. package/packages/Card/index.vue +37 -0
  55. package/packages/Cell/index.js +8 -0
  56. package/packages/Cell/index.vue +68 -0
  57. package/packages/CodeEditor/index.js +8 -0
  58. package/packages/CodeEditor/index.vue +177 -0
  59. package/packages/Col/index.js +8 -0
  60. package/packages/Col/index.vue +43 -0
  61. package/packages/Dialog/index.js +8 -0
  62. package/packages/Dialog/index.vue +129 -0
  63. package/packages/Empty/index.js +8 -0
  64. package/packages/Empty/index.vue +35 -0
  65. package/packages/FormMaking/FormConfig.vue +60 -0
  66. package/packages/FormMaking/GenerateForm.vue +308 -0
  67. package/packages/FormMaking/GenerateFormItem.vue +887 -0
  68. package/packages/FormMaking/GenerateFormItemH5.vue +825 -0
  69. package/packages/FormMaking/Upload/index.vue +572 -0
  70. package/packages/FormMaking/WidgetConfig.vue +472 -0
  71. package/packages/FormMaking/WidgetForm.vue +159 -0
  72. package/packages/FormMaking/WidgetFormItem.vue +187 -0
  73. package/packages/FormMaking/custom/config.js +762 -0
  74. package/packages/FormMaking/custom/configs/alliance.vue +0 -0
  75. package/packages/FormMaking/custom/configs/blank.vue +54 -0
  76. package/packages/FormMaking/custom/configs/button.vue +172 -0
  77. package/packages/FormMaking/custom/configs/cascader.vue +175 -0
  78. package/packages/FormMaking/custom/configs/cell.vue +81 -0
  79. package/packages/FormMaking/custom/configs/checkbox.vue +234 -0
  80. package/packages/FormMaking/custom/configs/color.vue +137 -0
  81. package/packages/FormMaking/custom/configs/date.vue +158 -0
  82. package/packages/FormMaking/custom/configs/divider.vue +61 -0
  83. package/packages/FormMaking/custom/configs/editor.vue +71 -0
  84. package/packages/FormMaking/custom/configs/filler.vue +57 -0
  85. package/packages/FormMaking/custom/configs/grid.vue +103 -0
  86. package/packages/FormMaking/custom/configs/image.vue +138 -0
  87. package/packages/FormMaking/custom/configs/input.vue +176 -0
  88. package/packages/FormMaking/custom/configs/number.vue +140 -0
  89. package/packages/FormMaking/custom/configs/radio.vue +211 -0
  90. package/packages/FormMaking/custom/configs/rate.vue +109 -0
  91. package/packages/FormMaking/custom/configs/select.vue +305 -0
  92. package/packages/FormMaking/custom/configs/slider.vue +142 -0
  93. package/packages/FormMaking/custom/configs/switch.vue +130 -0
  94. package/packages/FormMaking/custom/configs/table.vue +105 -0
  95. package/packages/FormMaking/custom/configs/table_h5.vue +102 -0
  96. package/packages/FormMaking/custom/configs/tabs.vue +175 -0
  97. package/packages/FormMaking/custom/configs/text.vue +71 -0
  98. package/packages/FormMaking/custom/configs/textarea.vue +167 -0
  99. package/packages/FormMaking/custom/configs/time.vue +153 -0
  100. package/packages/FormMaking/custom/configs/upload.vue +155 -0
  101. package/packages/FormMaking/custom/index.js +32 -0
  102. package/packages/FormMaking/custom/items/alliance.vue +132 -0
  103. package/packages/FormMaking/custom/items/blank.vue +16 -0
  104. package/packages/FormMaking/custom/items/button.vue +27 -0
  105. package/packages/FormMaking/custom/items/cascader.vue +29 -0
  106. package/packages/FormMaking/custom/items/cell.vue +18 -0
  107. package/packages/FormMaking/custom/items/checkbox.vue +46 -0
  108. package/packages/FormMaking/custom/items/color.vue +19 -0
  109. package/packages/FormMaking/custom/items/date.vue +29 -0
  110. package/packages/FormMaking/custom/items/divider.vue +14 -0
  111. package/packages/FormMaking/custom/items/editor.vue +22 -0
  112. package/packages/FormMaking/custom/items/filler.vue +17 -0
  113. package/packages/FormMaking/custom/items/grid.vue +130 -0
  114. package/packages/FormMaking/custom/items/image.vue +70 -0
  115. package/packages/FormMaking/custom/items/input.vue +33 -0
  116. package/packages/FormMaking/custom/items/login.vue +13 -0
  117. package/packages/FormMaking/custom/items/number.vue +24 -0
  118. package/packages/FormMaking/custom/items/radio.vue +44 -0
  119. package/packages/FormMaking/custom/items/rate.vue +20 -0
  120. package/packages/FormMaking/custom/items/select.vue +32 -0
  121. package/packages/FormMaking/custom/items/slider.vue +34 -0
  122. package/packages/FormMaking/custom/items/switch.vue +22 -0
  123. package/packages/FormMaking/custom/items/table.vue +106 -0
  124. package/packages/FormMaking/custom/items/table_h5.vue +126 -0
  125. package/packages/FormMaking/custom/items/tabs.vue +145 -0
  126. package/packages/FormMaking/custom/items/text.vue +18 -0
  127. package/packages/FormMaking/custom/items/textarea.vue +37 -0
  128. package/packages/FormMaking/custom/items/time.vue +32 -0
  129. package/packages/FormMaking/custom/items/upload.vue +102 -0
  130. package/packages/FormMaking/custom/mixins/index.js +61 -0
  131. package/packages/FormMaking/custom/register.js +18 -0
  132. package/packages/FormMaking/generate.js +5 -0
  133. package/packages/FormMaking/iconfont/demo.css +539 -0
  134. package/packages/FormMaking/iconfont/demo_index.html +1159 -0
  135. package/packages/FormMaking/iconfont/iconfont.css +189 -0
  136. package/packages/FormMaking/iconfont/iconfont.eot +0 -0
  137. package/packages/FormMaking/iconfont/iconfont.js +1 -0
  138. package/packages/FormMaking/iconfont/iconfont.svg +155 -0
  139. package/packages/FormMaking/iconfont/iconfont.ttf +0 -0
  140. package/packages/FormMaking/iconfont/iconfont.woff +0 -0
  141. package/packages/FormMaking/iconfont/iconfont.woff2 +0 -0
  142. package/packages/FormMaking/index.js +33 -0
  143. package/packages/FormMaking/index.vue +807 -0
  144. package/packages/FormMaking/lang/en-US.js +187 -0
  145. package/packages/FormMaking/lang/zh-CN.js +187 -0
  146. package/packages/FormMaking/making.js +9 -0
  147. package/packages/FormMaking/styles/cover.scss +41 -0
  148. package/packages/FormMaking/styles/index.scss +785 -0
  149. package/packages/FormMaking/util/generateCode.js +163 -0
  150. package/packages/FormMaking/util/index.js +33 -0
  151. package/packages/FormMaking/util/request.js +28 -0
  152. package/packages/Grid/index.js +8 -0
  153. package/packages/Grid/index.vue +21 -0
  154. package/packages/GridItem/index.js +8 -0
  155. package/packages/GridItem/index.vue +69 -0
  156. package/packages/Icons/index.js +8 -0
  157. package/packages/Icons/index.vue +377 -0
  158. package/packages/Image/index.js +8 -0
  159. package/packages/Image/index.vue +146 -0
  160. package/packages/ImagePreview/index.js +8 -0
  161. package/packages/ImagePreview/index.vue +386 -0
  162. package/packages/Row/index.js +8 -0
  163. package/packages/Row/index.vue +33 -0
  164. package/packages/Table/action.js +8 -0
  165. package/packages/Table/action.vue +168 -0
  166. package/packages/Table/column.vue +63 -0
  167. package/packages/Table/index.js +8 -0
  168. package/packages/Table/index.vue +327 -0
  169. package/packages/Table/search.js +8 -0
  170. package/packages/Table/search.vue +163 -0
  171. package/packages/Table/tools.js +8 -0
  172. package/packages/Table/tools.vue +49 -0
  173. package/packages/TableMaking/custom/configs/fieldSearch.vue +17 -0
  174. package/packages/TableMaking/custom/configs/fieldTable.vue +15 -0
  175. package/packages/TableMaking/custom/items/search/index.vue +158 -0
  176. package/packages/TableMaking/custom/items/tools/index.vue +49 -0
  177. package/packages/TableMaking/generate.js +5 -0
  178. package/packages/TableMaking/generateTable.vue +560 -0
  179. package/packages/TableMaking/index.vue +234 -0
  180. package/packages/TableMaking/making.js +5 -0
  181. package/packages/TableMaking/util/index.js +433 -0
  182. package/packages/TableMaking/widgetConfig.vue +390 -0
  183. package/packages/TableMaking/widgetTable.vue +305 -0
  184. package/packages/Upload/ajax.js +85 -0
  185. package/packages/Upload/index.js +8 -0
  186. package/packages/Upload/index.vue +325 -0
  187. package/packages/Upload/upload-dragger.vue +70 -0
  188. package/packages/Upload/upload-list.vue +121 -0
  189. package/packages/Upload/upload.vue +193 -0
  190. package/packages/VueEditor/index.js +8 -0
  191. package/packages/VueEditor/index.vue +38 -0
  192. package/packages/Workflow/Log.js +99 -0
  193. package/packages/Workflow/designer/ProcessDesigner.vue +628 -0
  194. package/packages/Workflow/designer/index.js +7 -0
  195. package/packages/Workflow/designer/plugins/content-pad/contentPadProvider.js +390 -0
  196. package/packages/Workflow/designer/plugins/content-pad/index.js +6 -0
  197. package/packages/Workflow/designer/plugins/defaultEmpty.js +24 -0
  198. package/packages/Workflow/designer/plugins/descriptor/activitiDescriptor.json +1071 -0
  199. package/packages/Workflow/designer/plugins/descriptor/camundaDescriptor.json +1087 -0
  200. package/packages/Workflow/designer/plugins/descriptor/flowableDescriptor.json +1215 -0
  201. package/packages/Workflow/designer/plugins/extension-moddle/activiti/activitiExtension.js +74 -0
  202. package/packages/Workflow/designer/plugins/extension-moddle/activiti/index.js +9 -0
  203. package/packages/Workflow/designer/plugins/extension-moddle/camunda/extension.js +148 -0
  204. package/packages/Workflow/designer/plugins/extension-moddle/camunda/index.js +6 -0
  205. package/packages/Workflow/designer/plugins/extension-moddle/flowable/flowableExtension.js +74 -0
  206. package/packages/Workflow/designer/plugins/extension-moddle/flowable/index.js +9 -0
  207. package/packages/Workflow/designer/plugins/palette/CustomPalette.js +156 -0
  208. package/packages/Workflow/designer/plugins/palette/index.js +6 -0
  209. package/packages/Workflow/designer/plugins/palette/paletteProvider.js +160 -0
  210. package/packages/Workflow/designer/plugins/translate/customTranslate.js +41 -0
  211. package/packages/Workflow/designer/plugins/translate/zh.js +238 -0
  212. package/packages/Workflow/highlight/index.js +5 -0
  213. package/packages/Workflow/index.js +34 -0
  214. package/packages/Workflow/index.vue +399 -0
  215. package/packages/Workflow/modules/auto-place/CustomAutoPlace.js +81 -0
  216. package/packages/Workflow/modules/auto-place/index.js +6 -0
  217. package/packages/Workflow/modules/custom-renderer/CustomRenderer.js +17 -0
  218. package/packages/Workflow/modules/custom-renderer/index.js +6 -0
  219. package/packages/Workflow/modules/rules/CustomRules.js +16 -0
  220. package/packages/Workflow/modules/rules/index.js +6 -0
  221. package/packages/Workflow/palette/ProcessPalette.vue +106 -0
  222. package/packages/Workflow/palette/index.js +7 -0
  223. package/packages/Workflow/penal/PropertiesPanel.vue +245 -0
  224. package/packages/Workflow/penal/base/ElementBaseInfo.vue +80 -0
  225. package/packages/Workflow/penal/flow-condition/FlowCondition.vue +142 -0
  226. package/packages/Workflow/penal/form/ElementForm.vue +367 -0
  227. package/packages/Workflow/penal/index.js +7 -0
  228. package/packages/Workflow/penal/listeners/ElementListeners.vue +299 -0
  229. package/packages/Workflow/penal/listeners/UserTaskListeners.vue +322 -0
  230. package/packages/Workflow/penal/listeners/template.js +178 -0
  231. package/packages/Workflow/penal/listeners/utilSelf.js +64 -0
  232. package/packages/Workflow/penal/multi-instance/ElementMultiInstance.vue +200 -0
  233. package/packages/Workflow/penal/other/ElementOtherConfig.vue +59 -0
  234. package/packages/Workflow/penal/properties/ElementProperties.vue +135 -0
  235. package/packages/Workflow/penal/signal-message/SignalAndMessage.vue +104 -0
  236. package/packages/Workflow/penal/task/ElementTask.vue +73 -0
  237. package/packages/Workflow/penal/task/task-components/ReceiveTask.vue +97 -0
  238. package/packages/Workflow/penal/task/task-components/ScriptTask.vue +85 -0
  239. package/packages/Workflow/penal/task/task-components/UserTask.vue +535 -0
  240. package/packages/Workflow/theme/element-variables.scss +70 -0
  241. package/packages/Workflow/theme/index.scss +2 -0
  242. package/packages/Workflow/theme/process-designer.scss +157 -0
  243. package/packages/Workflow/theme/process-panel.scss +107 -0
  244. package/packages/Workflow/translations.js +25 -0
  245. package/packages/Workflow/utils.js +71 -0
  246. package/packages/index.js +160 -0
  247. package/babel.config.js +0 -15
  248. package/index.js +0 -11
  249. package/public/favicon.ico +0 -0
  250. package/public/index.html +0 -17
  251. package/src/App.vue +0 -28
  252. package/src/assets/logo.png +0 -0
  253. package/src/components/HelloWorld.vue +0 -58
  254. package/src/main.js +0 -8
@@ -0,0 +1,132 @@
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">
15
+ <widget-form-item
16
+ v-for="(element, elementIndex) in column.list.filter(item => {
17
+ return item.key;
18
+ })"
19
+ :key="element.key"
20
+ :widget="element"
21
+ :widgetIndex="elementIndex"
22
+ :widgetArray="column"
23
+ :select.sync="selectWidget"
24
+ :config="config"
25
+ ></widget-form-item>
26
+ </transition-group>
27
+ </draggable>
28
+ </div>
29
+ </template>
30
+
31
+ <script>
32
+ import { itemsComponent } from "../mixins/index";
33
+ import Draggable from "vuedraggable";
34
+ import WidgetFormItem from "../../WidgetFormItem.vue";
35
+ export default {
36
+ components: { Draggable, WidgetFormItem },
37
+ mixins: [itemsComponent],
38
+ data() {
39
+ return {
40
+ selectWidget: {}
41
+ };
42
+ },
43
+ watch: {
44
+ select(val) {
45
+ this.selectWidget = val;
46
+ },
47
+ selectWidget: {
48
+ handler(val) {
49
+ this.$emit("update:select", val);
50
+ },
51
+ deep: true
52
+ }
53
+ },
54
+ methods: {
55
+ handleWidgetTabAdd($event, row, colIndex) {
56
+ const newIndex = $event.newIndex;
57
+ const oldIndex = $event.oldIndex;
58
+ const item = $event.item;
59
+
60
+ // 防止布局元素的嵌套拖拽
61
+ if (item.className.indexOf("alliance") >= 0) {
62
+ // 如果是列表中拖拽的元素需要还原到原来位置
63
+ item.tagName === "DIV" &&
64
+ this.widgetArray.list.splice(
65
+ oldIndex,
66
+ 0,
67
+ row.tabs[colIndex].list[newIndex]
68
+ );
69
+
70
+ row.tabs[colIndex].list.splice(newIndex, 1);
71
+
72
+ return false;
73
+ }
74
+
75
+ const key =
76
+ Date.parse(new Date()) + "_" + Math.ceil(Math.random() * 99999);
77
+
78
+ this.$set(row.tabs[colIndex].list, newIndex, {
79
+ ...row.tabs[colIndex].list[newIndex],
80
+ options: {
81
+ ...row.tabs[colIndex].list[newIndex].options
82
+ // remoteFunc: "func_" + key
83
+ },
84
+ key,
85
+ // 绑定键值
86
+ model: row.tabs[colIndex].list[newIndex].type + "_" + key,
87
+ rules: []
88
+ });
89
+
90
+ if (
91
+ row.tabs[colIndex].list[newIndex].type === "radio" ||
92
+ row.tabs[colIndex].list[newIndex].type === "checkbox" ||
93
+ row.tabs[colIndex].list[newIndex].type === "select"
94
+ ) {
95
+ this.$set(row.tabs[colIndex].list, newIndex, {
96
+ ...row.tabs[colIndex].list[newIndex],
97
+ options: {
98
+ ...row.tabs[colIndex].list[newIndex].options,
99
+ options: row.tabs[colIndex].list[newIndex].options.options.map(
100
+ item => ({
101
+ ...item
102
+ })
103
+ )
104
+ }
105
+ });
106
+ }
107
+
108
+ if (row.tabs[colIndex].list[newIndex].type === "grid") {
109
+ this.$set(
110
+ row.tabs[colIndex].list,
111
+ newIndex,
112
+ JSON.parse(JSON.stringify(row.tabs[colIndex].list[newIndex]))
113
+ );
114
+ }
115
+
116
+ if (row.tabs[colIndex].list[newIndex].type === "table") {
117
+ this.$set(row.tabs[colIndex].list, newIndex, {
118
+ ...row.tabs[colIndex].list[newIndex],
119
+ list: row.tabs[colIndex].list[newIndex].list.map(item => ({
120
+ ...item
121
+ }))
122
+ });
123
+ }
124
+
125
+ this.selectWidget = row.tabs[colIndex].list[newIndex];
126
+ }
127
+ }
128
+ };
129
+ </script>
130
+
131
+ <style lang="scss" scoped>
132
+ </style>
@@ -0,0 +1,16 @@
1
+ <template>
2
+ <div
3
+ style="height: 50px;color: #999;background: #eee;line-height:50px;text-align:center;"
4
+ >
5
+ 自定义区域
6
+ </div>
7
+ </template>
8
+
9
+ <script>
10
+ import { itemsComponent } from "../mixins/index";
11
+ export default {
12
+ mixins: [itemsComponent]
13
+ };
14
+ </script>
15
+
16
+ <style></style>
@@ -0,0 +1,27 @@
1
+ <template>
2
+ <th-button
3
+ :style="{
4
+ width: widget.options.width,
5
+ height: widget.options.height
6
+ }"
7
+ :size="widget.options.buttonSize"
8
+ :type="widget.options.buttonType"
9
+ :plain="widget.options.buttonPlain"
10
+ :round="widget.options.buttonRound"
11
+ :circle="widget.options.buttonCircle"
12
+ :loading="widget.options.loading"
13
+ :disabled="widget.options.disabled"
14
+ :icon="widget.options.buttonIcon"
15
+ >
16
+ {{ widget.options.defaultValue }}
17
+ </th-button>
18
+ </template>
19
+
20
+ <script>
21
+ import { itemsComponent } from "../mixins/index";
22
+ export default {
23
+ mixins: [itemsComponent]
24
+ };
25
+ </script>
26
+
27
+ <style></style>
@@ -0,0 +1,29 @@
1
+ <template>
2
+ <el-cascader
3
+ v-model="widget.options.defaultValue"
4
+ :disabled="widget.options.disabled"
5
+ :clearable="widget.options.clearable"
6
+ :placeholder="widget.options.placeholder"
7
+ :style="{ width: widget.options.width }"
8
+ :options="widget.options.remoteOptions"
9
+ :props="widget.options.props"
10
+ :show-all-levels="widget.options.showAllLevels ? false : true"
11
+ :collapse-tags="widget.options.collapseTags"
12
+ @change="handleEventAction(widget.events.onChange)"
13
+ >
14
+ <template slot-scope="{ data }">
15
+ <span v-html="widget.options.prepend"></span>
16
+ <span>{{ data.label }}</span>
17
+ <span v-html="widget.options.append"></span>
18
+ </template>
19
+ </el-cascader>
20
+ </template>
21
+
22
+ <script>
23
+ import { itemsComponent } from "../mixins/index";
24
+ export default {
25
+ mixins: [itemsComponent]
26
+ };
27
+ </script>
28
+
29
+ <style></style>
@@ -0,0 +1,18 @@
1
+ <template>
2
+ <th-cell
3
+ :title="widget.options.title"
4
+ :value="widget.options.value"
5
+ :label="widget.options.label"
6
+ ></th-cell>
7
+ </template>
8
+
9
+ <script>
10
+ import { itemsComponent } from "../mixins/index";
11
+ import ThCell from "ui/Cell/index.vue";
12
+ export default {
13
+ components: { ThCell },
14
+ mixins: [itemsComponent]
15
+ };
16
+ </script>
17
+
18
+ <style></style>
@@ -0,0 +1,46 @@
1
+ <template>
2
+ <el-checkbox-group
3
+ v-model="widget.options.defaultValue"
4
+ :style="{ width: widget.options.width }"
5
+ :disabled="widget.options.disabled"
6
+ :min="widget.options.min"
7
+ :max="widget.options.max"
8
+ @change="handleEventAction(widget.events.onChange)"
9
+ >
10
+ <template v-if="widget.options.buttonType">
11
+ <el-checkbox-button
12
+ :style="{
13
+ display: widget.options.inline ? 'inline-block' : 'block'
14
+ }"
15
+ :label="item.value"
16
+ :border="widget.options.border"
17
+ v-for="(item, index) in widget.options.options"
18
+ :key="`checkbox_${index}_${item.value}`"
19
+ >
20
+ {{ widget.options.showLabel ? item.label : item.value }}
21
+ </el-checkbox-button>
22
+ </template>
23
+ <template v-else>
24
+ <el-checkbox
25
+ :style="{
26
+ display: widget.options.inline ? 'inline-block' : 'block'
27
+ }"
28
+ :label="item.value"
29
+ :border="widget.options.border"
30
+ v-for="(item, index) in widget.options.options"
31
+ :key="`checkbox_${index}_${item.value}`"
32
+ >
33
+ {{ widget.options.showLabel ? item.label : item.value }}
34
+ </el-checkbox>
35
+ </template>
36
+ </el-checkbox-group>
37
+ </template>
38
+
39
+ <script>
40
+ import { itemsComponent } from "../mixins/index";
41
+ export default {
42
+ mixins: [itemsComponent]
43
+ };
44
+ </script>
45
+
46
+ <style></style>
@@ -0,0 +1,19 @@
1
+ <template>
2
+ <el-color-picker
3
+ v-model="widget.options.defaultValue"
4
+ :disabled="widget.options.disabled"
5
+ :show-alpha="widget.options.showAlpha"
6
+ :color-format="widget.options.showAlpha ? 'rgb' : 'hex'"
7
+ :predefine="widget.options.predefine"
8
+ @change="handleEventAction(widget.events.onChange)"
9
+ ></el-color-picker>
10
+ </template>
11
+
12
+ <script>
13
+ import { itemsComponent } from "../mixins/index";
14
+ export default {
15
+ mixins: [itemsComponent]
16
+ };
17
+ </script>
18
+
19
+ <style></style>
@@ -0,0 +1,29 @@
1
+ <template>
2
+ <el-date-picker
3
+ v-model="widget.options.defaultValue"
4
+ :style="{ width: widget.options.width }"
5
+ :type="widget.options.type"
6
+ :is-range="widget.options.isRange"
7
+ :placeholder="widget.options.placeholder"
8
+ :start-placeholder="widget.options.startPlaceholder"
9
+ :end-placeholder="widget.options.endPlaceholder"
10
+ :readonly="widget.options.readonly"
11
+ :disabled="widget.options.disabled"
12
+ :editable="widget.options.editable"
13
+ :clearable="widget.options.clearable"
14
+ :value-format="widget.options.format"
15
+ @change="handleEventAction(widget.events.onChange)"
16
+ @focus="handleEventAction(widget.events.onFocus)"
17
+ @blur="handleEventAction(widget.events.onBlur)"
18
+ >
19
+ </el-date-picker>
20
+ </template>
21
+
22
+ <script>
23
+ import { itemsComponent } from "../mixins/index";
24
+ export default {
25
+ mixins: [itemsComponent]
26
+ };
27
+ </script>
28
+
29
+ <style></style>
@@ -0,0 +1,14 @@
1
+ <template>
2
+ <el-divider :content-position="widget.options.contentPosition">
3
+ {{ widget.options.defaultValue }}
4
+ </el-divider>
5
+ </template>
6
+
7
+ <script>
8
+ import { itemsComponent } from "../mixins/index";
9
+ export default {
10
+ mixins: [itemsComponent]
11
+ };
12
+ </script>
13
+
14
+ <style></style>
@@ -0,0 +1,22 @@
1
+ <template>
2
+ <vue-editor
3
+ v-model="widget.options.defaultValue"
4
+ :style="{
5
+ width: widget.options.width,
6
+ height: widget.options.height
7
+ }"
8
+ :disabled="widget.options.disabled"
9
+ >
10
+ </vue-editor>
11
+ </template>
12
+
13
+ <script>
14
+ import { itemsComponent } from "../mixins/index";
15
+ import { VueEditor } from "vue2-editor";
16
+ export default {
17
+ components: { VueEditor },
18
+ mixins: [itemsComponent]
19
+ };
20
+ </script>
21
+
22
+ <style></style>
@@ -0,0 +1,17 @@
1
+ <template>
2
+ <div
3
+ :style="{
4
+ width: widget.options.width,
5
+ height: widget.options.height
6
+ }"
7
+ ></div>
8
+ </template>
9
+
10
+ <script>
11
+ import { itemsComponent } from "../mixins/index";
12
+ export default {
13
+ mixins: [itemsComponent]
14
+ };
15
+ </script>
16
+
17
+ <style></style>
@@ -0,0 +1,130 @@
1
+ <template>
2
+ <!-- widget.key -->
3
+ <th-row
4
+ :class="{ active: selectWidget.model == widget.model }"
5
+ :gutter="widget.options.gutter ? widget.options.gutter : 0"
6
+ :justify="widget.options.justify"
7
+ :align="widget.options.align"
8
+ >
9
+ <th-col
10
+ v-for="(column, columnIndex) in widget.columns"
11
+ :key="`grid_${columnIndex}`"
12
+ :span="column.span ? column.span : 0"
13
+ >
14
+ <draggable
15
+ v-model="column.list"
16
+ :no-transition-on-drag="true"
17
+ v-bind="{
18
+ group: 'people',
19
+ ghostClass: 'ghost',
20
+ animation: 200,
21
+ handle: '.drag-widget'
22
+ }"
23
+ @add="handleWidgetColAdd($event, widget, columnIndex)"
24
+ >
25
+ <transition-group name="fade" tag="div" class="widget-col-list">
26
+ <widget-form-item
27
+ v-for="(element, elementIndex) in column.list.filter(item => {
28
+ return item.key;
29
+ })"
30
+ :key="element.key"
31
+ :widget="element"
32
+ :widgetIndex="elementIndex"
33
+ :widgetArray="column"
34
+ :select.sync="selectWidget"
35
+ :config="config"
36
+ >
37
+ </widget-form-item>
38
+ </transition-group>
39
+ </draggable>
40
+ </th-col>
41
+ </th-row>
42
+ </template>
43
+
44
+ <script>
45
+ import { itemsComponent } from "../mixins/index";
46
+ import Draggable from "vuedraggable";
47
+ import WidgetFormItem from "../../WidgetFormItem.vue";
48
+ import ThRow from "ui/Row/index.vue";
49
+ import ThCol from "ui/Col/index.vue";
50
+ export default {
51
+ components: { Draggable, WidgetFormItem, ThRow, ThCol },
52
+ mixins: [itemsComponent],
53
+ data() {
54
+ return {
55
+ selectWidget: {}
56
+ };
57
+ },
58
+ watch: {
59
+ select(val) {
60
+ this.selectWidget = val;
61
+ },
62
+ selectWidget: {
63
+ handler(val) {
64
+ this.$emit("update:select", val);
65
+ },
66
+ deep: true
67
+ }
68
+ },
69
+ methods: {
70
+ handleWidgetColAdd($event, row, colIndex) {
71
+ const newIndex = $event.newIndex;
72
+ const oldIndex = $event.oldIndex;
73
+ const item = $event.item;
74
+
75
+ // 防止布局元素的嵌套拖拽
76
+ if (item.className.indexOf("data-grid") >= 0) {
77
+ // 如果是列表中拖拽的元素需要还原到原来位置
78
+ item.tagName === "DIV" &&
79
+ this.widgetArray.list.splice(
80
+ oldIndex,
81
+ 0,
82
+ row.columns[colIndex].list[newIndex]
83
+ );
84
+
85
+ row.columns[colIndex].list.splice(newIndex, 1);
86
+
87
+ return false;
88
+ }
89
+
90
+ const key =
91
+ Date.parse(new Date()) + "_" + Math.ceil(Math.random() * 99999);
92
+
93
+ this.$set(row.columns[colIndex].list, newIndex, {
94
+ ...row.columns[colIndex].list[newIndex],
95
+ options: {
96
+ ...row.columns[colIndex].list[newIndex].options
97
+ // remoteFunc: "func_" + key
98
+ },
99
+ key,
100
+ // 绑定键值
101
+ model: row.columns[colIndex].list[newIndex].type + "_" + key,
102
+ rules: []
103
+ });
104
+
105
+ if (
106
+ row.columns[colIndex].list[newIndex].type === "radio" ||
107
+ row.columns[colIndex].list[newIndex].type === "checkbox" ||
108
+ row.columns[colIndex].list[newIndex].type === "select"
109
+ ) {
110
+ this.$set(row.columns[colIndex].list, newIndex, {
111
+ ...row.columns[colIndex].list[newIndex],
112
+ options: {
113
+ ...row.columns[colIndex].list[newIndex].options,
114
+ options: row.columns[colIndex].list[newIndex].options.options.map(
115
+ item => ({
116
+ ...item
117
+ })
118
+ )
119
+ }
120
+ });
121
+ }
122
+
123
+ // this.$emit("update:select", row.columns[colIndex].list[newIndex]);
124
+ this.selectWidget = row.columns[colIndex].list[newIndex];
125
+ }
126
+ }
127
+ };
128
+ </script>
129
+
130
+ <style></style>
@@ -0,0 +1,70 @@
1
+ <template>
2
+ <!-- <div>
3
+ <th-image
4
+ v-if="!widget.options.remote"
5
+ :src="widget.options.defaultValue"
6
+ :height="widget.options.height"
7
+ :width="widget.options.width"
8
+ :fit="widget.options.fit"
9
+ :border-radius="widget.options.borderRadius"
10
+ :display-style="widget.options.displayStyle"
11
+ :error-src="widget.options.errorSrc"
12
+ :is-loding="widget.options.isLoding"
13
+ ></th-image>
14
+ <div v-for="item in widget.options.defaultValueArr" :key="item.url">
15
+ <th-image
16
+ v-if="widget.options.remote"
17
+ :src="item"
18
+ src-key="url"
19
+ :height="widget.options.height"
20
+ :width="widget.options.width"
21
+ :fit="widget.options.fit"
22
+ :border-radius="widget.options.borderRadius"
23
+ :preview-list="widget.options.defaultValueArr"
24
+ :display-style="widget.options.displayStyle"
25
+ :error-src="widget.options.errorSrc"
26
+ :is-loding="widget.options.isLoding"
27
+ ></th-image>
28
+ </div>
29
+ </div> -->
30
+ <div>
31
+ <el-image
32
+ v-for="(item, index) in widget.options.defaultValue"
33
+ :key="index"
34
+ :style="selfStyle"
35
+ :src="item.url"
36
+ :fit="widget.options.fit"
37
+ :preview-src-list="imagePreviewList"
38
+ :lazy="widget.options.isLazy"
39
+ ></el-image>
40
+ </div>
41
+ </template>
42
+
43
+ <script>
44
+ import { itemsComponent } from "../mixins/index";
45
+ import ThImage from "ui/Image/index.vue";
46
+
47
+ export default {
48
+ components: { ThImage },
49
+ mixins: [itemsComponent],
50
+ computed: {
51
+ selfStyle() {
52
+ const style = { display: "inline-block" };
53
+ style.width = this.widget.options.width;
54
+ style.height = this.widget.options.height;
55
+ style.borderRadius = `${this.widget.options.borderRadius || 0}`;
56
+ style.verticalAlign = "middle";
57
+ return style;
58
+ },
59
+ imagePreviewList() {
60
+ const list = [];
61
+ this.widget.options.defaultValue.forEach(item => {
62
+ list.push(item.url);
63
+ });
64
+ return list;
65
+ }
66
+ }
67
+ };
68
+ </script>
69
+
70
+ <style></style>
@@ -0,0 +1,33 @@
1
+ <template>
2
+ <el-input
3
+ v-model="widget.options.defaultValue"
4
+ :style="{ width: widget.options.width }"
5
+ :placeholder="widget.options.placeholder"
6
+ :disabled="widget.options.disabled"
7
+ :maxlength="widget.options.maxlength"
8
+ :show-word-limit="widget.options.showWordLimit"
9
+ :show-password="widget.options.showPassword"
10
+ :clearable="widget.options.clearable"
11
+ :suffix-icon="widget.options.suffixIcon"
12
+ :prefix-icon="widget.options.prefixIcon"
13
+ @input="handleEventAction(widget.events.onChange)"
14
+ @focus="handleEventAction(widget.events.onFocus)"
15
+ @blur="handleEventAction(widget.events.onBlur)"
16
+ >
17
+ <template v-if="widget.options.prepend" slot="prepend">
18
+ <span v-html="widget.options.prepend"></span>
19
+ </template>
20
+ <template v-if="widget.options.append" slot="append">
21
+ <span v-html="widget.options.append"></span>
22
+ </template>
23
+ </el-input>
24
+ </template>
25
+
26
+ <script>
27
+ import { itemsComponent } from "../mixins/index";
28
+ export default {
29
+ mixins: [itemsComponent]
30
+ };
31
+ </script>
32
+
33
+ <style></style>
@@ -0,0 +1,13 @@
1
+ <template>
2
+ <div></div>
3
+ </template>
4
+
5
+ <script>
6
+ export default {
7
+
8
+ }
9
+ </script>
10
+
11
+ <style>
12
+
13
+ </style>
@@ -0,0 +1,24 @@
1
+ <template>
2
+ <el-input-number
3
+ v-model="widget.options.defaultValue"
4
+ :disabled="widget.options.disabled"
5
+ :controls-position="widget.options.controlsPosition ? 'right' : ''"
6
+ :style="{ width: widget.options.width }"
7
+ :min="widget.options.min"
8
+ :max="widget.options.max"
9
+ :step="widget.options.step"
10
+ :precision="widget.options.precision"
11
+ @change="handleEventAction(widget.events.onChange)"
12
+ @focus="handleEventAction(widget.events.onFocus)"
13
+ @blur="handleEventAction(widget.events.onBlur)"
14
+ ></el-input-number>
15
+ </template>
16
+
17
+ <script>
18
+ import { itemsComponent } from "../mixins/index";
19
+ export default {
20
+ mixins: [itemsComponent]
21
+ };
22
+ </script>
23
+
24
+ <style></style>