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,327 @@
1
+ <template>
2
+ <div class="th-table">
3
+ <el-table
4
+ ref="th_table"
5
+ v-loading="loading"
6
+ :height="height"
7
+ :data="data"
8
+ :row-key="rowKey"
9
+ :stripe="stripe"
10
+ :border="border"
11
+ :highlight-current-row="highlightCurrentRow"
12
+ :tree-props="treeProps"
13
+ :span-method="objectSpanMethod"
14
+ @current-change="handleSingleSelect"
15
+ @row-dblclick="dblclick"
16
+ @selection-change="handleSelectionChange"
17
+ >
18
+ <template v-for="(item, index) in widgetList">
19
+ <el-table-column
20
+ v-if="item.type"
21
+ :key="index"
22
+ :type="item.type"
23
+ :label="item.label"
24
+ width="50"
25
+ >
26
+ </el-table-column>
27
+ <el-table-column
28
+ v-else-if="item.children"
29
+ :key="index"
30
+ :prop="item.prop"
31
+ :label="item.label"
32
+ :width="item.width"
33
+ :align="item.align || 'left'"
34
+ :fixed="item.fixed || null"
35
+ :sortable="item.sortable"
36
+ :sort-method="item.sortMethod"
37
+ :show-overflow-tooltip="item.showOverflowTooltip"
38
+ >
39
+ <table-column :options="item.children"></table-column>
40
+ </el-table-column>
41
+ <el-table-column
42
+ v-else
43
+ :key="index"
44
+ :prop="item.prop"
45
+ :label="item.label"
46
+ :width="item.width"
47
+ :align="item.align || 'left'"
48
+ :fixed="item.fixed || null"
49
+ :sortable="item.sortable"
50
+ :sort-method="item.sortMethod"
51
+ :show-overflow-tooltip="item.showOverflowTooltip"
52
+ >
53
+ <template slot-scope="scope">
54
+ <slot
55
+ v-if="item.slot"
56
+ :name="item.slot"
57
+ :scope="scope"
58
+ :option="item"
59
+ />
60
+ <span v-else-if="item.formatTime">
61
+ {{
62
+ handleFormatTime(
63
+ scope.row[item.alias || item.prop],
64
+ item.format
65
+ )
66
+ }}
67
+ </span>
68
+ <span v-else-if="item.format">
69
+ {{ item.format(scope.row) }}
70
+ </span>
71
+ <span v-else-if="item.alias">{{ scope.row[item.alias] }}</span>
72
+ <span v-else>{{ scope.row[item.prop] }}</span>
73
+ </template>
74
+ </el-table-column>
75
+ </template>
76
+ <template #empty>
77
+ <div>
78
+ {{ loading ? loadingText || "加载中" : emptyText || "暂无数据" }}
79
+ </div>
80
+ </template>
81
+ </el-table>
82
+
83
+ <!-- <el-popover placement="top-start" title="标题" width="200" trigger="hover">
84
+ <i class="th-table-more el-icon-s-tools" slot="reference"></i>
85
+ <div>
86
+ <el-checkbox
87
+ v-for="item in options"
88
+ :key="item.prop"
89
+ :label="item.label"
90
+ :checked="!item.hide"
91
+ ></el-checkbox>
92
+ </div>
93
+ </el-popover> -->
94
+
95
+ <div v-if="Object.keys(pageInfo).length > 0 && showPage" class="pagination">
96
+ <el-pagination
97
+ :current-page="pageInfo.currentPage"
98
+ :page-sizes="pageInfo.sizes"
99
+ :page-size="pageInfo.pageSize"
100
+ layout="total, prev, pager, next, sizes"
101
+ :total="pageInfo.total"
102
+ @size-change="handleSizeChange"
103
+ @current-change="handleCurrentChange"
104
+ @prev-click="handlePrevClick"
105
+ @next-click="handleNextClick"
106
+ />
107
+ </div>
108
+ </div>
109
+ </template>
110
+
111
+ <script>
112
+ import TableColumn from "./column.vue";
113
+
114
+ export default {
115
+ name: "ThTable",
116
+ components: {
117
+ TableColumn
118
+ },
119
+ props: {
120
+ data: {
121
+ type: Array,
122
+ default: () => {
123
+ return [];
124
+ }
125
+ },
126
+ options: {
127
+ type: Array,
128
+ default: () => {
129
+ return [];
130
+ }
131
+ },
132
+ // 行双击事件
133
+ dblclick: {
134
+ type: Function,
135
+ default: () => {
136
+ return null;
137
+ }
138
+ },
139
+ stripe: {
140
+ type: Boolean,
141
+ default: () => {
142
+ return false;
143
+ }
144
+ },
145
+ treeProps: {
146
+ type: Object,
147
+ default: function() {
148
+ return {};
149
+ }
150
+ },
151
+ // 对象,不传表示没有分页,包含三个参数,均必填pageSize:每页展示的条数。currentPage:当前页码。pageCount:总页数
152
+ pageInfo: {
153
+ type: Object,
154
+ default: function() {
155
+ return {};
156
+ }
157
+ },
158
+ loading: {
159
+ type: Boolean,
160
+ default: () => {
161
+ return false;
162
+ }
163
+ },
164
+ height: String | Number,
165
+ rowKey: String | Function,
166
+ showPage: {
167
+ type: Boolean,
168
+ default: () => {
169
+ return true;
170
+ }
171
+ },
172
+ emptyText: {
173
+ type: String,
174
+ default: () => {
175
+ return "暂无数据";
176
+ }
177
+ },
178
+ loadingText: {
179
+ type: String,
180
+ default: () => {
181
+ return "加载中";
182
+ }
183
+ },
184
+ border: {
185
+ type: Boolean,
186
+ default: () => {
187
+ return false;
188
+ }
189
+ },
190
+ // 是否要高亮当前行
191
+ highlightCurrentRow: {
192
+ type: Boolean,
193
+ default: () => {
194
+ return false;
195
+ }
196
+ }
197
+ },
198
+ data() {
199
+ return {};
200
+ },
201
+ computed: {
202
+ widgetList() {
203
+ return this.options.filter(item => {
204
+ return !item.hide;
205
+ });
206
+ }
207
+ },
208
+ methods: {
209
+ handleSelectionChange(currentRow) {
210
+ if (currentRow) {
211
+ this.$emit("selection-change", currentRow);
212
+ }
213
+ },
214
+ // 选中行--单选
215
+ handleSingleSelect(currentRow, oldCurrentRow) {
216
+ if (currentRow) {
217
+ this.$emit("current-change", currentRow);
218
+ }
219
+ },
220
+ // 每页展示的条数 改变时
221
+ handleSizeChange(val) {
222
+ this.pageInfo.pageSize = val;
223
+ this.$emit(
224
+ "pagination-change",
225
+ this.pageInfo.currentPage,
226
+ this.pageInfo.pageSize
227
+ );
228
+ },
229
+ // 当前页码 改变时
230
+ handleCurrentChange(val) {
231
+ this.pageInfo.currentPage = val;
232
+ this.$emit(
233
+ "pagination-change",
234
+ this.pageInfo.currentPage,
235
+ this.pageInfo.pageSize
236
+ );
237
+ },
238
+ // 点击上一页
239
+ handlePrevClick() {
240
+ if (this.pageInfo.currentPage === 1) return;
241
+ this.pageInfo.currentPage -= 1;
242
+ this.$emit(
243
+ "pagination-change",
244
+ this.pageInfo.currentPage,
245
+ this.pageInfo.pageSize
246
+ );
247
+ },
248
+ // 点击下一页
249
+ handleNextClick() {
250
+ if (this.pageInfo.currentPage === this.pageInfo.pageCount) return;
251
+ this.pageInfo.currentPage += 1;
252
+ this.$emit(
253
+ "pagination-change",
254
+ this.pageInfo.currentPage,
255
+ this.pageInfo.pageSize
256
+ );
257
+ },
258
+ getTable() {
259
+ return this.$refs["th_table"];
260
+ },
261
+ handleFormatTime(time, cFormat) {
262
+ if (arguments.length === 0) {
263
+ return null;
264
+ }
265
+ const format = cFormat || "yyyy-MM-dd HH:mm:ss";
266
+ let date;
267
+ if (typeof time === "undefined" || time === null || time === "null") {
268
+ return "";
269
+ } else if (typeof time === "object") {
270
+ date = time;
271
+ } else {
272
+ if (typeof time === "string" && /^[0-9]+$/.test(time)) {
273
+ time = parseInt(time);
274
+ }
275
+ if (typeof time === "number" && time.toString().length === 10) {
276
+ time = time * 1000;
277
+ }
278
+ date = new Date(time);
279
+ }
280
+ const formatObj = {
281
+ yyyy: date.getFullYear(),
282
+ MM: date.getMonth() + 1,
283
+ dd: date.getDate(),
284
+ HH: date.getHours(),
285
+ mm: date.getMinutes(),
286
+ ss: date.getSeconds(),
287
+ a: date.getDay()
288
+ };
289
+ const time_str = format.replace(
290
+ /(yyyy|MM|dd|HH|mm|ss|a)/g,
291
+ (result, key) => {
292
+ let value = formatObj[key];
293
+ // Note: getDay() returns 0 on Sunday
294
+ if (key === "a") {
295
+ return ["日", "一", "二", "三", "四", "五", "六"][value];
296
+ }
297
+ if (result.length > 0 && value < 10) {
298
+ value = "0" + value;
299
+ }
300
+ return value || 0;
301
+ }
302
+ );
303
+ return time_str;
304
+ },
305
+ objectSpanMethod(data) {
306
+ this.$emit("span-method", data);
307
+ }
308
+ }
309
+ };
310
+ </script>
311
+
312
+ <style lang="less" scoped>
313
+ .th-table {
314
+ position: relative;
315
+ width: 100%;
316
+ .pagination {
317
+ margin-top: 20px;
318
+ }
319
+ &-more {
320
+ position: absolute;
321
+ top: 13px;
322
+ right: 5px;
323
+ z-index: 999;
324
+ cursor: pointer;
325
+ }
326
+ }
327
+ </style>
@@ -0,0 +1,8 @@
1
+ import TableSearch from "./search.vue";
2
+
3
+ /* istanbul ignore next */
4
+ TableSearch.install = function(Vue) {
5
+ Vue.component(TableSearch.name, TableSearch);
6
+ };
7
+
8
+ export default TableSearch;
@@ -0,0 +1,163 @@
1
+ <template>
2
+ <div class="th-table-search">
3
+ <div
4
+ v-for="(item, index) in options"
5
+ class="th-table-search-item"
6
+ :key="index"
7
+ >
8
+ <span class="th-table-search-item-title">{{ item.options.name }}:</span>
9
+ <el-input
10
+ v-if="item.type === 'input'"
11
+ v-model="params[item.options.prop]"
12
+ :style="{ width: item.options.width + 'px' }"
13
+ :placeholder="item.options.placeholder || '请输入'"
14
+ :disabled="item.options.disabled"
15
+ clearable
16
+ ></el-input>
17
+ <el-date-picker
18
+ v-if="item.type === 'date'"
19
+ v-model="params[item.options.prop]"
20
+ :style="{ width: item.options.width + 'px' }"
21
+ :type="item.options.dateType || 'date'"
22
+ :format="item.options.format"
23
+ :value-format="item.options.valueFormat"
24
+ range-separator="至"
25
+ start-placeholder="开始日期"
26
+ end-placeholder="结束日期"
27
+ clearable
28
+ >
29
+ </el-date-picker>
30
+ <el-select
31
+ v-if="item.type === 'select'"
32
+ v-model="params[item.options.prop]"
33
+ :style="{ width: item.options.width + 'px' }"
34
+ :placeholder="item.options.placeholder || '请选择'"
35
+ :multiple="item.options.multiple"
36
+ :multiple-limit="item.options.multipleLimit"
37
+ :filterable="item.options.filterable"
38
+ :disabled="item.options.disabled"
39
+ clearable
40
+ >
41
+ <template v-if="item.options.remote">
42
+ <el-option
43
+ v-for="option in item.options.options"
44
+ :key="option[item.options.props.value]"
45
+ :label="option[item.options.props.label]"
46
+ :value="option[item.options.props.value]"
47
+ >
48
+ </el-option>
49
+ </template>
50
+ <template v-else>
51
+ <el-option
52
+ v-for="option in item.options.options"
53
+ :key="option.value"
54
+ :label="option.label"
55
+ :value="option.value"
56
+ >
57
+ </el-option>
58
+ </template>
59
+ </el-select>
60
+ </div>
61
+
62
+ <el-button type="primary" icon="el-icon-search" plain @click="doSearch"
63
+ >查询</el-button
64
+ >
65
+ <el-button
66
+ type="primary"
67
+ icon="el-icon-refresh-right"
68
+ plain
69
+ @click="doReset"
70
+ >重置</el-button
71
+ >
72
+ </div>
73
+ </template>
74
+
75
+ <script>
76
+ export default {
77
+ name: "ThTableSearch",
78
+ props: {
79
+ options: {
80
+ type: Array,
81
+ default: () => {
82
+ return [];
83
+ }
84
+ },
85
+ data: {
86
+ type: Object,
87
+ default: () => {
88
+ return {};
89
+ }
90
+ }
91
+ },
92
+ data() {
93
+ return {
94
+ params: this.data,
95
+ datePickerTypes: [
96
+ "year",
97
+ "month",
98
+ "date",
99
+ "dates",
100
+ "week",
101
+ "datetime",
102
+ "datetimerange",
103
+ "daterange",
104
+ "monthrange"
105
+ ]
106
+ };
107
+ },
108
+ watch: {
109
+ options: {
110
+ handler(newVal, oldVal) {
111
+ if (newVal && newVal.length) {
112
+ newVal.map(item => {
113
+ this.$set(
114
+ this.params,
115
+ item.options.prop,
116
+ item.options.defaultValue
117
+ );
118
+ });
119
+ }
120
+ },
121
+ deep: true,
122
+ immediate: true
123
+ },
124
+ data(val) {
125
+ this.params = val;
126
+ },
127
+ params: {
128
+ deep: true,
129
+ handler(val) {
130
+ this.$emit("update:data", val);
131
+ }
132
+ }
133
+ },
134
+ methods: {
135
+ doSearch() {
136
+ this.$emit("on-search", this.params);
137
+ },
138
+ doReset() {
139
+ this.options.map(item => {
140
+ this.$set(this.params, item.prop, item.defaultValue || "");
141
+ });
142
+ this.$emit("on-reset", this.params);
143
+ }
144
+ }
145
+ };
146
+ </script>
147
+
148
+ <style lang="less" scoped>
149
+ .th-table-search {
150
+ margin-bottom: 15px;
151
+ &-item {
152
+ display: inline-block;
153
+ margin-right: 15px;
154
+ margin-bottom: 10px;
155
+ &-title {
156
+ font-size: 14px;
157
+ }
158
+ }
159
+ .th-table-search-item:last-child {
160
+ margin-right: 20px !important;
161
+ }
162
+ }
163
+ </style>
@@ -0,0 +1,8 @@
1
+ import TableTools from "./tools.vue";
2
+
3
+ /* istanbul ignore next */
4
+ TableTools.install = function(Vue) {
5
+ Vue.component(TableTools.name, TableTools);
6
+ };
7
+
8
+ export default TableTools;
@@ -0,0 +1,49 @@
1
+ <template>
2
+ <div class="th-table-tools">
3
+ <el-button
4
+ v-for="(item, index) in options"
5
+ :key="index"
6
+ :style="item.style"
7
+ :type="item.type"
8
+ :icon="item.icon"
9
+ :disabled="item.disabled || disabled[item.act]"
10
+ :loading="item.loading"
11
+ @click="handleClick(item)"
12
+ >{{ item.name }}</el-button
13
+ >
14
+ </div>
15
+ </template>
16
+
17
+ <script>
18
+ export default {
19
+ name: "ThTableTools",
20
+ props: {
21
+ options: {
22
+ type: Array,
23
+ default: () => {
24
+ return [];
25
+ }
26
+ },
27
+ disabled: {
28
+ type: Object,
29
+ default: () => {
30
+ return {};
31
+ }
32
+ }
33
+ },
34
+ data() {
35
+ return {};
36
+ },
37
+ methods: {
38
+ handleClick(item) {
39
+ this.$emit("on-click", item);
40
+ }
41
+ }
42
+ };
43
+ </script>
44
+
45
+ <style lang="less" scoped>
46
+ .th-table-tools {
47
+ margin-bottom: 10px;
48
+ }
49
+ </style>
@@ -0,0 +1,17 @@
1
+ <template>
2
+ <div>
3
+
4
+ </div>
5
+ </template>
6
+
7
+ <script>
8
+ export default {
9
+ data() {
10
+ return {};
11
+ },
12
+ mounted() {},
13
+ methods: {},
14
+ };
15
+ </script>
16
+
17
+ <style lang="scss" scoped></style>
@@ -0,0 +1,15 @@
1
+ <template>
2
+ <div></div>
3
+ </template>
4
+
5
+ <script>
6
+ export default {
7
+ data() {
8
+ return {};
9
+ },
10
+ mounted() {},
11
+ methods: {}
12
+ };
13
+ </script>
14
+
15
+ <style lang="scss" scoped></style>