swordpass-ui 1.0.0

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 (330) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +37 -0
  3. package/lib/demo.html +10 -0
  4. package/lib/img/icon_found_img.c785c1b7.png +0 -0
  5. package/lib/sword-vue-ui.common.js +61402 -0
  6. package/lib/sword-vue-ui.css +1 -0
  7. package/lib/sword-vue-ui.umd.js +61412 -0
  8. package/lib/sword-vue-ui.umd.min.js +6 -0
  9. package/package.json +109 -0
  10. package/packages/AddQueryStrategy/index.js +7 -0
  11. package/packages/AddQueryStrategy/src/main.vue +236 -0
  12. package/packages/Autocomplete/index.js +7 -0
  13. package/packages/Autocomplete/src/main.vue +192 -0
  14. package/packages/Button/index.js +7 -0
  15. package/packages/Button/src/main.vue +90 -0
  16. package/packages/Cascader/index.js +7 -0
  17. package/packages/Cascader/src/main.vue +210 -0
  18. package/packages/Chart/index.js +7 -0
  19. package/packages/Chart/src/Chart.vue +831 -0
  20. package/packages/Checkbox/index.js +7 -0
  21. package/packages/Checkbox/src/main.vue +200 -0
  22. package/packages/Collapse/index.js +7 -0
  23. package/packages/Collapse/src/ClCollapse.vue +67 -0
  24. package/packages/Collapse/src/ClCollapseItem.vue +21 -0
  25. package/packages/CollapseItem/index.js +7 -0
  26. package/packages/CustomDialog/index.js +7 -0
  27. package/packages/CustomDialog/src/customDialog.js +99 -0
  28. package/packages/CustomDialog/src/main.vue +1944 -0
  29. package/packages/DataView/index.js +7 -0
  30. package/packages/DataView/src/DataView.vue +45 -0
  31. package/packages/Date/index.js +7 -0
  32. package/packages/Date/src/main.vue +180 -0
  33. package/packages/DatePicker/index.js +7 -0
  34. package/packages/DatePicker/src/main.vue +155 -0
  35. package/packages/Demension/index.js +7 -0
  36. package/packages/Demension/src/main.vue +379 -0
  37. package/packages/Dialog/index.js +7 -0
  38. package/packages/Dialog/src/main.vue +160 -0
  39. package/packages/Dictionary/index.js +7 -0
  40. package/packages/Dictionary/src/main.vue +204 -0
  41. package/packages/DimensionSelector/index.js +7 -0
  42. package/packages/DimensionSelector/src/main.vue +359 -0
  43. package/packages/DimensionSelectorInput/index.js +7 -0
  44. package/packages/DimensionSelectorInput/src/main.vue +79 -0
  45. package/packages/Divider/index.js +7 -0
  46. package/packages/Divider/src/main.vue +38 -0
  47. package/packages/Duration/index.js +7 -0
  48. package/packages/Duration/src/main.vue +172 -0
  49. package/packages/Editor/index.js +7 -0
  50. package/packages/Editor/src/main.vue +280 -0
  51. package/packages/Explain/index.js +7 -0
  52. package/packages/Explain/src/main.vue +55 -0
  53. package/packages/FieldTail/index.js +7 -0
  54. package/packages/FieldTail/src/main.vue +163 -0
  55. package/packages/File/index.js +7 -0
  56. package/packages/File/src/FileCard.vue +169 -0
  57. package/packages/File/src/FileList.vue +180 -0
  58. package/packages/File/src/FileTable.vue +223 -0
  59. package/packages/File/src/main.vue +467 -0
  60. package/packages/FileUpload/index.js +7 -0
  61. package/packages/FileUpload/src/main.vue +222 -0
  62. package/packages/FlowChart/index.js +7 -0
  63. package/packages/FlowChart/src/main.vue +386 -0
  64. package/packages/FormItem/index.js +7 -0
  65. package/packages/FormItem/src/main.vue +167 -0
  66. package/packages/Global/index.js +12 -0
  67. package/packages/Global/src/GlobalQuery.vue +200 -0
  68. package/packages/Global/src/GlobalValidate.vue +69 -0
  69. package/packages/Icon/index.js +7 -0
  70. package/packages/Icon/src/icons/ad.js +14 -0
  71. package/packages/Icon/src/icons/address-book.js +14 -0
  72. package/packages/Icon/src/icons/arrow.js +14 -0
  73. package/packages/Icon/src/icons/attachment.js +18 -0
  74. package/packages/Icon/src/icons/balance.js +14 -0
  75. package/packages/Icon/src/icons/ban.js +14 -0
  76. package/packages/Icon/src/icons/bell.js +14 -0
  77. package/packages/Icon/src/icons/block.js +26 -0
  78. package/packages/Icon/src/icons/book.js +14 -0
  79. package/packages/Icon/src/icons/bookmark.js +14 -0
  80. package/packages/Icon/src/icons/bug.js +22 -0
  81. package/packages/Icon/src/icons/bullhorn.js +14 -0
  82. package/packages/Icon/src/icons/calc.js +14 -0
  83. package/packages/Icon/src/icons/checkbox.js +14 -0
  84. package/packages/Icon/src/icons/circle.js +14 -0
  85. package/packages/Icon/src/icons/close.js +14 -0
  86. package/packages/Icon/src/icons/cloud-sun.js +14 -0
  87. package/packages/Icon/src/icons/coffee.js +14 -0
  88. package/packages/Icon/src/icons/component.js +14 -0
  89. package/packages/Icon/src/icons/compress.js +14 -0
  90. package/packages/Icon/src/icons/copyright.js +14 -0
  91. package/packages/Icon/src/icons/dialog.js +14 -0
  92. package/packages/Icon/src/icons/download.js +14 -0
  93. package/packages/Icon/src/icons/duration.js +14 -0
  94. package/packages/Icon/src/icons/excel.js +18 -0
  95. package/packages/Icon/src/icons/expand.js +14 -0
  96. package/packages/Icon/src/icons/export.js +21 -0
  97. package/packages/Icon/src/icons/eye-slash.js +14 -0
  98. package/packages/Icon/src/icons/eye.js +14 -0
  99. package/packages/Icon/src/icons/file.js +18 -0
  100. package/packages/Icon/src/icons/form.js +14 -0
  101. package/packages/Icon/src/icons/ganged.js +14 -0
  102. package/packages/Icon/src/icons/gaode.js +27 -0
  103. package/packages/Icon/src/icons/gift.js +14 -0
  104. package/packages/Icon/src/icons/home.js +14 -0
  105. package/packages/Icon/src/icons/image.js +14 -0
  106. package/packages/Icon/src/icons/import.js +18 -0
  107. package/packages/Icon/src/icons/index.js +67 -0
  108. package/packages/Icon/src/icons/info.js +21 -0
  109. package/packages/Icon/src/icons/laptop.js +14 -0
  110. package/packages/Icon/src/icons/line.js +34 -0
  111. package/packages/Icon/src/icons/lock.js +14 -0
  112. package/packages/Icon/src/icons/map.js +18 -0
  113. package/packages/Icon/src/icons/more.js +19 -0
  114. package/packages/Icon/src/icons/move.js +14 -0
  115. package/packages/Icon/src/icons/org.js +18 -0
  116. package/packages/Icon/src/icons/palette.js +14 -0
  117. package/packages/Icon/src/icons/plan.js +17 -0
  118. package/packages/Icon/src/icons/ppt.js +18 -0
  119. package/packages/Icon/src/icons/question.js +18 -0
  120. package/packages/Icon/src/icons/radio.js +14 -0
  121. package/packages/Icon/src/icons/refresh.js +14 -0
  122. package/packages/Icon/src/icons/search.js +14 -0
  123. package/packages/Icon/src/icons/select.js +14 -0
  124. package/packages/Icon/src/icons/setting.js +18 -0
  125. package/packages/Icon/src/icons/simple-collapse.js +18 -0
  126. package/packages/Icon/src/icons/simple-expand.js +14 -0
  127. package/packages/Icon/src/icons/sort.js +22 -0
  128. package/packages/Icon/src/icons/sword.js +26 -0
  129. package/packages/Icon/src/icons/table.js +14 -0
  130. package/packages/Icon/src/icons/time.js +14 -0
  131. package/packages/Icon/src/icons/tree.js +14 -0
  132. package/packages/Icon/src/icons/typography.js +18 -0
  133. package/packages/Icon/src/icons/upload.js +18 -0
  134. package/packages/Icon/src/icons/user.js +14 -0
  135. package/packages/Icon/src/icons/users.js +30 -0
  136. package/packages/Icon/src/icons/video.js +14 -0
  137. package/packages/Icon/src/icons/word.js +18 -0
  138. package/packages/Icon/src/main.vue +432 -0
  139. package/packages/Image/index.js +7 -0
  140. package/packages/Image/src/main.vue +66 -0
  141. package/packages/Input/index.js +7 -0
  142. package/packages/Input/src/main.vue +552 -0
  143. package/packages/JobSelector/index.js +7 -0
  144. package/packages/JobSelector/src/main.vue +339 -0
  145. package/packages/JobSelectorInput/index.js +7 -0
  146. package/packages/JobSelectorInput/src/main.vue +87 -0
  147. package/packages/Map/index.js +7 -0
  148. package/packages/Map/src/Map.vue +427 -0
  149. package/packages/Milepost/index.js +7 -0
  150. package/packages/Milepost/src/main.vue +45 -0
  151. package/packages/OnlineForm/index.js +7 -0
  152. package/packages/OnlineForm/src/Form.vue +359 -0
  153. package/packages/OrgPostDialog/index.js +7 -0
  154. package/packages/OrgPostDialog/src/main.vue +244 -0
  155. package/packages/OrgSelector/index.js +7 -0
  156. package/packages/OrgSelector/src/main.vue +493 -0
  157. package/packages/OrgSelectorInput/index.js +7 -0
  158. package/packages/OrgSelectorInput/src/OrgSelectorInput.vue +216 -0
  159. package/packages/PostSelector/index.js +7 -0
  160. package/packages/PostSelector/src/main.vue +463 -0
  161. package/packages/PostSelectorInput/index.js +7 -0
  162. package/packages/PostSelectorInput/src/PostSelectorInput.vue +200 -0
  163. package/packages/Preview/index.js +7 -0
  164. package/packages/Preview/src/FillPage.vue +311 -0
  165. package/packages/Preview/src/FrameViewer.vue +135 -0
  166. package/packages/Preview/src/Loading.vue +126 -0
  167. package/packages/Preview/src/PdfViewer.vue +125 -0
  168. package/packages/Preview/src/TextViewer.vue +99 -0
  169. package/packages/Preview/src/main.vue +242 -0
  170. package/packages/Preview/src/watermark.js +124 -0
  171. package/packages/ProcessRecord/index.js +7 -0
  172. package/packages/ProcessRecord/src/main.vue +392 -0
  173. package/packages/Qrcode/index.js +7 -0
  174. package/packages/Qrcode/src/Qrcode.vue +105 -0
  175. package/packages/QuerySqlPreview/index.js +7 -0
  176. package/packages/QuerySqlPreview/src/QuerySqlPreview.vue +163 -0
  177. package/packages/Radio/index.js +7 -0
  178. package/packages/Radio/src/main.vue +172 -0
  179. package/packages/Rate/index.js +7 -0
  180. package/packages/Rate/src/main.vue +89 -0
  181. package/packages/ReadonlyInput/index.js +7 -0
  182. package/packages/ReadonlyInput/src/main.vue +92 -0
  183. package/packages/RelevantFlow/index.js +7 -0
  184. package/packages/RelevantFlow/src/main.vue +547 -0
  185. package/packages/RelevantFlow/src/relevantFlow.js +28 -0
  186. package/packages/RoleSelector/index.js +7 -0
  187. package/packages/RoleSelector/src/main.vue +358 -0
  188. package/packages/RoleSelectorInput/index.js +7 -0
  189. package/packages/RoleSelectorInput/src/main.vue +84 -0
  190. package/packages/SaveButton/index.js +7 -0
  191. package/packages/SaveButton/src/main.vue +73 -0
  192. package/packages/Select/index.js +7 -0
  193. package/packages/Select/src/main.vue +330 -0
  194. package/packages/SelectTree/index.js +7 -0
  195. package/packages/SelectTree/src/SelectTree.vue +352 -0
  196. package/packages/Selector/index.js +7 -0
  197. package/packages/Selector/src/main.vue +617 -0
  198. package/packages/SidebarDialog/index.js +7 -0
  199. package/packages/SidebarDialog/src/main.vue +156 -0
  200. package/packages/Slider/index.js +7 -0
  201. package/packages/Slider/src/main.vue +84 -0
  202. package/packages/Step/index.js +7 -0
  203. package/packages/StepLayout/index.js +7 -0
  204. package/packages/Steps/index.js +7 -0
  205. package/packages/Steps/src/Step.vue +122 -0
  206. package/packages/Steps/src/StepLayout.vue +35 -0
  207. package/packages/Steps/src/Steps.vue +65 -0
  208. package/packages/Subtable/index.js +33 -0
  209. package/packages/Subtable/src/SubDialog.vue +1926 -0
  210. package/packages/Subtable/src/SubExportDialog.vue +115 -0
  211. package/packages/Subtable/src/SubImportDialog.vue +316 -0
  212. package/packages/Subtable/src/SubPagination.vue +112 -0
  213. package/packages/Subtable/src/SubtableBackfill.vue +83 -0
  214. package/packages/Subtable/src/dialog.js +42 -0
  215. package/packages/Switch/index.js +7 -0
  216. package/packages/Switch/src/main.vue +83 -0
  217. package/packages/Table/index.js +7 -0
  218. package/packages/Table/src/CustomColumn.vue +351 -0
  219. package/packages/Table/src/Table.vue +979 -0
  220. package/packages/TableColumn/index.js +7 -0
  221. package/packages/TableColumn/src/main.vue +177 -0
  222. package/packages/TableSearchField/index.js +7 -0
  223. package/packages/TableSearchField/src/main.vue +334 -0
  224. package/packages/TableSearchPanel/index.js +7 -0
  225. package/packages/TableSearchPanel/src/main.vue +149 -0
  226. package/packages/Tabs/index.js +7 -0
  227. package/packages/Tabs/src/Tabs.vue +140 -0
  228. package/packages/Tag/index.js +7 -0
  229. package/packages/Tag/src/main.vue +264 -0
  230. package/packages/TemplateBatchUpdate/index.js +7 -0
  231. package/packages/TemplateBatchUpdate/src/TemplateBatchUpdateDialog.vue +174 -0
  232. package/packages/TemplateForm/index.js +7 -0
  233. package/packages/TemplateForm/src/main.vue +645 -0
  234. package/packages/TemplateFormDialog/index.js +7 -0
  235. package/packages/TemplateFormDialog/src/main.vue +61 -0
  236. package/packages/TemplateImportResult/index.js +7 -0
  237. package/packages/TemplateImportResult/src/main.vue +158 -0
  238. package/packages/TemplatePreview/index.js +19 -0
  239. package/packages/TemplatePreview/src/TemplatePreview.vue +169 -0
  240. package/packages/TemplatePreview/src/TemplatePreviewFile.vue +171 -0
  241. package/packages/TemplatePreview/src/TemplatePreviewImage.vue +83 -0
  242. package/packages/TemplateTaskCirculate/index.js +7 -0
  243. package/packages/TemplateTaskCirculate/src/main.vue +238 -0
  244. package/packages/Text/index.js +7 -0
  245. package/packages/Text/src/main.vue +57 -0
  246. package/packages/TimePicker/index.js +7 -0
  247. package/packages/TimePicker/src/main.vue +139 -0
  248. package/packages/TimeSelect/index.js +7 -0
  249. package/packages/TimeSelect/src/main.vue +96 -0
  250. package/packages/Tree/index.js +7 -0
  251. package/packages/Tree/src/main.vue +439 -0
  252. package/packages/TreeDialog/index.js +7 -0
  253. package/packages/TreeDialog/src/main.vue +293 -0
  254. package/packages/TreeListDialog/index.js +7 -0
  255. package/packages/TreeListDialog/src/main.vue +219 -0
  256. package/packages/Typography/index.js +8 -0
  257. package/packages/Typography/src/create-header.js +72 -0
  258. package/packages/UserDialog/index.js +7 -0
  259. package/packages/UserDialog/src/main.vue +250 -0
  260. package/packages/UserSelector/index.js +7 -0
  261. package/packages/UserSelector/src/main.vue +746 -0
  262. package/packages/UserSelectorInput/index.js +7 -0
  263. package/packages/UserSelectorInput/src/main.vue +319 -0
  264. package/packages/picture/index.js +7 -0
  265. package/packages/picture/src/main.vue +530 -0
  266. package/packages/plugins/Echarts.js +30 -0
  267. package/packages/plugins/Map.js +29 -0
  268. package/packages/plugins/Preview.js +49 -0
  269. package/packages/plugins/Qrcode.js +7 -0
  270. package/packages/plugins/XLSX.js +7 -0
  271. package/packages/plugins/wangeditor.js +19 -0
  272. package/src/assets/icon_found_img.png +0 -0
  273. package/src/assets/table-no-data.png +0 -0
  274. package/src/directive/badge.js +53 -0
  275. package/src/directive/copy.js +47 -0
  276. package/src/directive/ellipsis.js +6 -0
  277. package/src/directive/expandClick.js +23 -0
  278. package/src/directive/express.js +86 -0
  279. package/src/directive/form.js +122 -0
  280. package/src/directive/format.js +24 -0
  281. package/src/directive/formulas.js +708 -0
  282. package/src/directive/index.js +42 -0
  283. package/src/directive/permissionLine.js +59 -0
  284. package/src/directive/permissionLineLable.js +56 -0
  285. package/src/directive/permit.js +23 -0
  286. package/src/directive/popconfirm.js +86 -0
  287. package/src/directive/relatedQuery.js +61 -0
  288. package/src/directive/resize.js +18 -0
  289. package/src/directive/subSort.js +18 -0
  290. package/src/directive/tableDrag.js +25 -0
  291. package/src/directive/tooltip.js +37 -0
  292. package/src/filter/computerSize.js +23 -0
  293. package/src/filter/dateFormat.js +10 -0
  294. package/src/filter/index.js +10 -0
  295. package/src/index.js +267 -0
  296. package/src/locale/format.js +44 -0
  297. package/src/locale/index.js +48 -0
  298. package/src/locale/lang/en.js +59 -0
  299. package/src/locale/lang/zh-CN.js +58 -0
  300. package/src/locale/lang/zh-TW.js +57 -0
  301. package/src/locale/validate/dict.js +223 -0
  302. package/src/math.js +270 -0
  303. package/src/mixins/emitter.js +33 -0
  304. package/src/mixins/form.js +25 -0
  305. package/src/mixins/formDataUpdate.js +32 -0
  306. package/src/mixins/ganged.js +126 -0
  307. package/src/mixins/inputName.js +30 -0
  308. package/src/mixins/linkage.js +403 -0
  309. package/src/mixins/locale.js +9 -0
  310. package/src/mixins/mobileMode.js +27 -0
  311. package/src/mixins/onlineHottable.js +105 -0
  312. package/src/mixins/onlineSubtable.js +468 -0
  313. package/src/mixins/permission.js +84 -0
  314. package/src/mixins/querySqlPreview.js +747 -0
  315. package/src/mixins/regionValidator.js +70 -0
  316. package/src/mixins/script.js +35 -0
  317. package/src/mixins/templatePreview.js +3673 -0
  318. package/src/service.js +336 -0
  319. package/src/services/CustomQuery.js +199 -0
  320. package/src/services/SubPagination.js +132 -0
  321. package/src/styles/index.scss +7 -0
  322. package/src/styles/selector.scss +127 -0
  323. package/src/styles/variables.scss +71 -0
  324. package/src/util/base64.js +21 -0
  325. package/src/util/brower.js +15 -0
  326. package/src/util/clone.js +61 -0
  327. package/src/util/path.js +4 -0
  328. package/src/util/request.js +14 -0
  329. package/src/utils.js +1205 -0
  330. package/src/validate.js +184 -0
@@ -0,0 +1,831 @@
1
+ <template>
2
+ <el-tabs
3
+ type="card"
4
+ :style="{ width: charWidth }"
5
+ @tab-click="initClick"
6
+ v-if="permission_sub != 'n'"
7
+ >
8
+ <el-tab-pane label="查看图表">
9
+ <div
10
+ v-if="showTable"
11
+ :id="id"
12
+ :style="{ width: charWidth, height: charHeight }"
13
+ ></div>
14
+ </el-tab-pane>
15
+ <el-tab-pane label="查看数据">
16
+ <cl-table
17
+ v-if="showTable"
18
+ ref="table"
19
+ :data="data"
20
+ :page-result="pageResult"
21
+ :default-querys="defaultQuery"
22
+ :selectable="false"
23
+ :show-export="false"
24
+ :show-custom-column="false"
25
+ :quick-search-props="quickSearchProp"
26
+ :nopagination="true"
27
+ height="500"
28
+ @load="loadData"
29
+ >
30
+ <cl-table-column
31
+ v-for="xaxisField in customChart.xaxisField"
32
+ :key="xaxisField.field"
33
+ :prop="xaxisField.field.toUpperCase()"
34
+ :label="xaxisField.comment"
35
+ ></cl-table-column>
36
+ <cl-table-column
37
+ v-for="displayfield in customChart.displayfield"
38
+ :key="displayfield.field"
39
+ :prop="displayfield.field.toUpperCase()"
40
+ :label="displayfield.comment"
41
+ ></cl-table-column>
42
+ </cl-table>
43
+ </el-tab-pane>
44
+ </el-tabs>
45
+ </template>
46
+
47
+ <script>
48
+ import { decode } from '@/util/base64'
49
+ import utils from '@/utils.js'
50
+ import permission from '@/mixins/permission.js'
51
+ export default {
52
+ name: 'ClChart',
53
+ mixins: [permission],
54
+ props: {
55
+ id: {
56
+ type: [String, Number],
57
+ required: true,
58
+ },
59
+ width: {
60
+ type: String,
61
+ default: '',
62
+ },
63
+ height: {
64
+ type: String,
65
+ default: '',
66
+ },
67
+ selectList: {
68
+ type: String,
69
+ default: '',
70
+ },
71
+ },
72
+ data() {
73
+ return {
74
+ showTable: false,
75
+ customChart: {},
76
+ pageResult: {
77
+ page: 1,
78
+ pageSize: 20,
79
+ total: 0,
80
+ },
81
+ data: [],
82
+ quickSearchProp: '',
83
+ defaultQuery: [],
84
+ queryOpTransObj: {
85
+ EQ: 'EQUAL',
86
+ BETWEEN: 'BETWEEN',
87
+ GE: 'GREAT_EQUAL',
88
+ LE: 'LESS_EQUAL',
89
+ LK: 'LIKE',
90
+ IN: 'IN',
91
+ },
92
+ querrySelectList: [],
93
+ }
94
+ },
95
+ computed: {
96
+ charWidth() {
97
+ if (this.width) {
98
+ return this.width + 'px'
99
+ }
100
+ return '100%'
101
+ },
102
+ charHeight() {
103
+ if (this.height) {
104
+ return this.height + 'px'
105
+ }
106
+ return this.customChart.height + 'px'
107
+ },
108
+ },
109
+ watch: {
110
+ id: function (newV) {
111
+ if (newV) {
112
+ this.customChart = []
113
+ this.data = []
114
+ this.quickSearchProp = ''
115
+ this.defaultQuery = []
116
+ this.showTable = false
117
+ this.initData()
118
+ }
119
+ },
120
+ },
121
+ mounted() {
122
+ this.$nextTick(() => {
123
+ this.initData()
124
+ })
125
+ if (this.selectList) {
126
+ this.querrySelectList = JSON.parse(decode(this.selectList))
127
+ const pInst = utils.getOnlineFormInstance(this)
128
+ this.querrySelectList.forEach((obj) => {
129
+ let path = 'data.' + obj.selectField
130
+ pInst.$watch(path, () => {
131
+ this.customChart = []
132
+ this.data = []
133
+ this.quickSearchProp = ''
134
+ this.defaultQuery = []
135
+ this.showTable = false
136
+ this.$nextTick(() => {
137
+ this.initData()
138
+ })
139
+ })
140
+ })
141
+ }
142
+ },
143
+ methods: {
144
+ initClick(tabVue) {
145
+ if (tabVue.index == '1') {
146
+ this.$refs.table.load()
147
+ }
148
+ },
149
+ loadData(param, cb) {
150
+ if (this.customChart.alias) {
151
+ param.pageBean.pageSize = parseInt(
152
+ this.customChart.conf.maxLength &&
153
+ this.customChart.conf.maxLength != '0'
154
+ ? this.customChart.conf.maxLength
155
+ : 20
156
+ )
157
+ const pInst = utils.getOnlineFormInstance(this)
158
+ let conditions = this.customChart.conditionfield
159
+ let querrySelectList = this.querrySelectList
160
+ let queryFilter = []
161
+ querrySelectList.forEach((item) => {
162
+ let value = utils.getValueByPath(pInst.data, item.selectField)
163
+ let query = conditions.find((obj) => obj.field == item.bindSelectd)
164
+ queryFilter.push({
165
+ property: query.field,
166
+ value: value,
167
+ operation: this.queryOpTransObj[query.condition],
168
+ group: 'main',
169
+ })
170
+ })
171
+ param.querys = queryFilter
172
+ this.$requestConfig
173
+ .getChartListData(this.customChart.alias, param)
174
+ .then((response) => {
175
+ this.data = response.rows
176
+ this.pageResult = {
177
+ page: response.page,
178
+ pageSize: response.pageSize,
179
+ total: response.total,
180
+ }
181
+ this.customChart.rows = this.data
182
+ this.buildChart(this.customChart)
183
+ })
184
+ .finally(() => {
185
+ cb()
186
+ })
187
+ } else {
188
+ cb()
189
+ }
190
+ },
191
+ initData() {
192
+ this.$requestConfig.getChartById(this.id).then((data) => {
193
+ if (data) {
194
+ data.conditionfield = JSON.parse(data.conditionfield)
195
+ data.displayfield = JSON.parse(data.displayfield)
196
+ data.xaxisField = JSON.parse(data.xaxisField)
197
+ data.sortfield = JSON.parse(data.sortfield)
198
+ data.conf = JSON.parse(data.conf)
199
+ this.customChart = data
200
+ this.initCondition()
201
+ this.showTable = true
202
+ }
203
+ })
204
+ },
205
+ initCondition() {
206
+ let conditions = this.customChart.conditionfield
207
+ for (let i = 0; i < conditions.length; i++) {
208
+ if (conditions[i].defaultType === '1') {
209
+ this.quickSearchProp += conditions[i].field.toUpperCase() + ','
210
+ } else {
211
+ this.defaultQuery.push({
212
+ property: conditions[i].field,
213
+ value: conditions[i].defaultValue,
214
+ operation: this.queryOpTransObj[conditions[i].condition],
215
+ group: 'main',
216
+ })
217
+ }
218
+ }
219
+ },
220
+ buildChart(data) {
221
+ let myChart = this.$echarts.init(
222
+ document.getElementById(this.id),
223
+ 'default'
224
+ )
225
+ let grid = this.getGrid()
226
+ data.conf.title.text = data.name
227
+ data.conf.title.top = this.getTitlePosition()
228
+ let option = {
229
+ title: data.conf.title,
230
+ tooltip: {},
231
+ toolbox: { feature: { saveAsImage: {} } },
232
+ legend: {},
233
+ grid: grid,
234
+ series: {},
235
+ }
236
+ switch (data.style) {
237
+ case 1:
238
+ option = this.buildLine(data, option)
239
+ break
240
+ case 3:
241
+ option = this.buildPie(data, option)
242
+ break
243
+ case 4:
244
+ option = this.buildRadar(data, option)
245
+ break
246
+ case 5:
247
+ option = this.buildFunnel(data, option)
248
+ break
249
+ case 6:
250
+ option = this.buildScatter(data, option)
251
+ break
252
+ case 7:
253
+ option = this.buildHeatmap(data, option)
254
+ break
255
+ default:
256
+ break
257
+ }
258
+ this.adjustChatTitle(data, option)
259
+ myChart.setOption(option)
260
+ },
261
+ buildLine(data, option) {
262
+ let displayField = this.customChart.displayfield
263
+ let legendData = []
264
+ let xAxisData = []
265
+ let seriesData = []
266
+ let xAxisField = {}
267
+ let series = this.customChart.conf.series
268
+ if (this.customChart.xaxisField)
269
+ xAxisField = this.customChart.xaxisField[0]
270
+
271
+ for (let i = 0, d; (d = displayField[i++]); ) {
272
+ if (d) {
273
+ let arr = []
274
+ let type = d.type
275
+ legendData.push(d.comment)
276
+ for (let j = 0, res; (res = data.rows[j++]); ) {
277
+ if (i === 1) {
278
+ let value = res[xAxisField.field.toUpperCase()]
279
+ if (
280
+ xAxisField.dbType === 'date' &&
281
+ value &&
282
+ typeof value === 'number'
283
+ ) {
284
+ value = new Date(value).format(this.defaultFormat)
285
+ }
286
+ xAxisData.push(value)
287
+ }
288
+ if (res) {
289
+ let value = res[d.field.toUpperCase()]
290
+ arr.push(value)
291
+ }
292
+ }
293
+ let se = {
294
+ name: d.comment,
295
+ type: d.type,
296
+ data: arr,
297
+ stack: series.stack ? 'one' : null,
298
+ }
299
+ if (!series.doubleYAxis) {
300
+ se.yAxisIndex = d.yAxis === 1 ? 0 : 1
301
+ }
302
+ if (type === 'line') {
303
+ se.smooth = series.smooth
304
+ }
305
+ seriesData.push(se)
306
+ }
307
+ }
308
+ option.series = seriesData
309
+ option.tooltip = {
310
+ trigger: 'axis',
311
+ }
312
+ option.legend.y = 50
313
+ if (series.showType || !series.doubleYAxis) {
314
+ option.xAxis = [{ type: 'category', data: xAxisData }]
315
+ option.yAxis = series.doubleYAxis
316
+ ? [{ type: 'value' }]
317
+ : [{ type: 'value' }, { type: 'value' }]
318
+ } else {
319
+ option.xAxis = [{ type: 'value' }]
320
+ option.yAxis = [{ type: 'category', data: xAxisData }]
321
+ }
322
+
323
+ //柱状图的时候两端留空。避免柱状图挡住y轴。折线图则不留空,
324
+ if (data.style === 2) option.xAxis[0]['boundaryGap'] = true
325
+ if (data.conf) {
326
+ let obj = data.conf
327
+ if (obj.yMin === 2) option.yAxis[0]['min'] = 'dataMin'
328
+ if (obj.xShowAll === 2)
329
+ option.xAxis[0]['axisLabel'] = {
330
+ interval: 0, //横轴信息全部显示
331
+ rotate: 30,
332
+ }
333
+ }
334
+ if (data.rows.length > 20 && !series.dataZoom) {
335
+ option.dataZoom = [
336
+ {
337
+ start: 0,
338
+ end: 10,
339
+ handleIcon:
340
+ 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
341
+ handleSize: '80%',
342
+ handleStyle: {
343
+ color: '#fff',
344
+ shadowBlur: 3,
345
+ shadowColor: 'rgba(0, 0, 0, 0.6)',
346
+ shadowOffsetX: 2,
347
+ shadowOffsetY: 2,
348
+ },
349
+ },
350
+ ]
351
+ option.grid.bottom = 50
352
+ } else {
353
+ delete option.dataZoom
354
+ }
355
+ option.legend = data.conf.legend
356
+ option.legend.data = legendData
357
+ return option
358
+ },
359
+ buildPie(data, option) {
360
+ let displayField = data.displayfield
361
+ let legendData = []
362
+ let seriesData = []
363
+ let xAxisField = data.xaxisField
364
+ let series = data.conf.series
365
+ if (xAxisField) xAxisField = xAxisField[0]
366
+ if (series.showType) {
367
+ let duration = 100 / data.rows.length
368
+ for (let j = 0; j < data.rows.length; j++) {
369
+ let value = []
370
+ for (let i = 0; i < displayField.length; i++) {
371
+ value.push({
372
+ name: displayField[i].comment,
373
+ value: data.rows[j][displayField[i].field.toUpperCase()],
374
+ })
375
+ if (j === 0) {
376
+ legendData.push(displayField[i].comment)
377
+ }
378
+ }
379
+ seriesData.push({
380
+ name: data.rows[j][xAxisField.field.toUpperCase()],
381
+ type: 'pie',
382
+ data: value,
383
+ radius: [series.radius[0] + '%', series.radius[1] + '%'],
384
+ center: [
385
+ Number(series.center[0]) + j * duration + '%',
386
+ series.center[1] + '%',
387
+ ],
388
+ roseType: series.roseType,
389
+ selectedMode: series.selectedMode,
390
+ label: {
391
+ position: series.label.position,
392
+ },
393
+ itemStyle: {
394
+ emphasis: {
395
+ shadowBlur: 10,
396
+ shadowOffsetX: 0,
397
+ shadowColor: 'rgba(0, 0, 0, 0.5)',
398
+ },
399
+ },
400
+ })
401
+ }
402
+ } else {
403
+ let duration = 100 / displayField.length
404
+ for (let i = 0; i < displayField.length; i++) {
405
+ let value = []
406
+ for (let j = 0; j < data.rows.length; j++) {
407
+ value.push({
408
+ name: data.rows[j][xAxisField.field.toUpperCase()],
409
+ value: data.rows[j][displayField[i].field.toUpperCase()],
410
+ })
411
+ if (i === 0) {
412
+ legendData.push(data.rows[j][xAxisField.field.toUpperCase()] + '')
413
+ }
414
+ }
415
+ seriesData.push({
416
+ name: displayField[i].comment,
417
+ type: 'pie',
418
+ data: value,
419
+ radius: [series.radius[0] + '%', series.radius[1] + '%'],
420
+ center: [
421
+ Number(series.center[0]) + i * duration + '%',
422
+ series.center[1] + '%',
423
+ ],
424
+ roseType: series.roseType,
425
+ selectedMode: series.selectedMode,
426
+ label: {
427
+ position: series.label.position,
428
+ },
429
+ itemStyle: {
430
+ emphasis: {
431
+ shadowBlur: 10,
432
+ shadowOffsetX: 0,
433
+ shadowColor: 'rgba(0, 0, 0, 0.5)',
434
+ },
435
+ },
436
+ })
437
+ }
438
+ }
439
+
440
+ option.series = seriesData
441
+ option.tooltip = {
442
+ trigger: 'item',
443
+ formatter: '{a} <br/>{b} : {c} ({d}%)',
444
+ }
445
+ option.legend = data.conf.legend
446
+ option.legend.data = legendData
447
+ return option
448
+ },
449
+ buildRadar(data, option) {
450
+ let displayField = data.displayfield
451
+ let legendData = []
452
+ let xAxisField = data.xaxisField
453
+ let arr = []
454
+ let seriesData = []
455
+ let indicator = []
456
+ let series = data.conf.series
457
+ if (xAxisField) xAxisField = xAxisField[0]
458
+
459
+ if (series.showType) {
460
+ for (let j = 0; j < data.rows.length; j++) {
461
+ let value = []
462
+ for (let i = 0; i < displayField.length; i++) {
463
+ value.push(data.rows[j][displayField[i].field.toUpperCase()])
464
+ if (j === 0) {
465
+ indicator.push({
466
+ name: displayField[i].comment,
467
+ })
468
+ }
469
+ }
470
+ legendData.push(data.rows[j][xAxisField.field.toUpperCase()] + '')
471
+ arr.push({
472
+ name: data.rows[j][xAxisField.field.toUpperCase()],
473
+ value: value,
474
+ areaStyle: {
475
+ opacity: '0',
476
+ },
477
+ })
478
+ }
479
+ seriesData = [
480
+ {
481
+ type: 'radar',
482
+ data: arr,
483
+ itemStyle: {
484
+ emphasis: {
485
+ areaStyle: {
486
+ opacity: series.areaStyle ? '0' : '0.5',
487
+ },
488
+ },
489
+ },
490
+ },
491
+ ]
492
+ } else {
493
+ for (let i = 0; i < displayField.length; i++) {
494
+ let value = []
495
+ for (let j = 0; j < data.rows.length; j++) {
496
+ value.push(data.rows[j][displayField[i].field.toUpperCase()])
497
+ if (i === 0) {
498
+ indicator.push({
499
+ name: data.rows[j][xAxisField.field.toUpperCase()],
500
+ })
501
+ }
502
+ }
503
+ legendData.push(displayField[i].comment)
504
+ arr.push({
505
+ name: displayField[i].comment,
506
+ value: value,
507
+ areaStyle: {
508
+ opacity: '0',
509
+ },
510
+ })
511
+ }
512
+ seriesData = [
513
+ {
514
+ type: 'radar',
515
+ data: arr,
516
+ itemStyle: {
517
+ emphasis: {
518
+ areaStyle: {
519
+ opacity: series.areaStyle ? '0' : '0.5',
520
+ },
521
+ },
522
+ },
523
+ },
524
+ ]
525
+ }
526
+
527
+ option.series = seriesData
528
+ option.radar = {
529
+ center: [series.center[0] + '%', series.center[1] + '%'],
530
+ radius: series.radius,
531
+ indicator: indicator,
532
+ }
533
+ option.legend = data.conf.legend
534
+ option.legend.data = legendData
535
+ return option
536
+ },
537
+ buildFunnel(data, option) {
538
+ let displayField = data.displayfield
539
+ let legendData = []
540
+ let xAxisField = data.xaxisField
541
+ let seriesData = []
542
+ let series = data.conf.series
543
+ if (xAxisField) xAxisField = xAxisField[0]
544
+
545
+ //列数据展示
546
+ if (series.showType) {
547
+ let duration = 100 / data.rows.length
548
+ for (let j = 0; j < data.rows.length; j++) {
549
+ let value = []
550
+ for (let i = 0; i < displayField.length; i++) {
551
+ value.push({
552
+ name: displayField[i].comment,
553
+ value: data.rows[j][displayField[i].field.toUpperCase()],
554
+ })
555
+ if (j === 0) {
556
+ legendData.push(displayField[i].comment)
557
+ }
558
+ }
559
+ seriesData.push({
560
+ name: data.rows[j][xAxisField.field.toUpperCase()],
561
+ type: 'funnel',
562
+ data: value,
563
+ width: duration - 5 + '%',
564
+ left: j * duration + '%',
565
+ funnelAlign: series.funnelAlign,
566
+ sort: series.sort,
567
+ label: {
568
+ position: series.label.position,
569
+ },
570
+ })
571
+ }
572
+ } else {
573
+ //行数据展示
574
+ let duration = 100 / displayField.length
575
+ for (let i = 0; i < displayField.length; i++) {
576
+ let value = []
577
+ for (let j = 0; j < data.rows.length; j++) {
578
+ value.push({
579
+ name: data.rows[j][xAxisField.field.toUpperCase()],
580
+ value: data.rows[j][displayField[i].field.toUpperCase()],
581
+ })
582
+ if (i === 0) {
583
+ legendData.push(data.rows[j][xAxisField.field.toUpperCase()] + '')
584
+ }
585
+ }
586
+ seriesData.push({
587
+ name: displayField[i].comment,
588
+ type: 'funnel',
589
+ data: value,
590
+ width: duration - 5 + '%',
591
+ left: i * duration + '%',
592
+ funnelAlign: series.funnelAlign,
593
+ sort: series.sort,
594
+ label: {
595
+ position: series.label.position,
596
+ },
597
+ })
598
+ }
599
+ }
600
+
601
+ option.series = seriesData
602
+
603
+ option.legend = data.conf.legend
604
+ option.legend.data = legendData
605
+ return option
606
+ },
607
+ buildScatter(data, option) {
608
+ let displayField = data.displayfield
609
+ let legendData = []
610
+ let xAxisData = []
611
+ let xAxisField = data.xaxisField
612
+ let seriesData = []
613
+ let series = data.conf.series
614
+ if (xAxisField) xAxisField = xAxisField[0]
615
+
616
+ if (series.showType) {
617
+ for (let j = 0; j < data.rows.length; j++) {
618
+ let value = []
619
+ for (let i = 0; i < displayField.length; i++) {
620
+ if (j === 0) {
621
+ xAxisData.push(displayField[i].comment)
622
+ }
623
+ value.push([
624
+ displayField[i].comment,
625
+ data.rows[j][displayField[i].field.toUpperCase()],
626
+ ])
627
+ }
628
+ legendData.push(data.rows[j][xAxisField.field.toUpperCase()] + '')
629
+ seriesData.push({
630
+ name: data.rows[j][xAxisField.field.toUpperCase()],
631
+ type: 'scatter',
632
+ data: value,
633
+ })
634
+ }
635
+ } else {
636
+ for (let i = 0; i < displayField.length; i++) {
637
+ let value = []
638
+ for (let j = 0; j < data.rows.length; j++) {
639
+ if (i === 0) {
640
+ xAxisData.push(data.rows[j][xAxisField.field.toLocaleUpperCase()])
641
+ }
642
+ value.push([
643
+ data.rows[j][xAxisField.field.toLocaleUpperCase()],
644
+ data.rows[j][displayField[i].field.toLocaleUpperCase()],
645
+ ])
646
+ }
647
+ legendData.push(displayField[i].comment)
648
+ seriesData.push({
649
+ name: displayField[i].comment,
650
+ type: 'scatter',
651
+ data: value,
652
+ })
653
+ if (
654
+ displayField[i].regression &&
655
+ displayField[i].regression !== 'none'
656
+ ) {
657
+ let myRegression = this.$ecStat.regression(
658
+ displayField[i].regression,
659
+ value
660
+ )
661
+ myRegression.points.sort(function (a, b) {
662
+ return a[0] - b[0]
663
+ })
664
+ seriesData.push({
665
+ name: 'line',
666
+ type: 'line',
667
+ showSymbol: false,
668
+ data: myRegression.points,
669
+ markPoint: {
670
+ itemStyle: {
671
+ color: 'transparent',
672
+ },
673
+ label: {
674
+ show: true,
675
+ position: 'left',
676
+ formatter: myRegression.expression,
677
+ color: '#333',
678
+ fontSize: 14,
679
+ },
680
+ data: [
681
+ {
682
+ coord: myRegression.points[myRegression.points.length - 1],
683
+ },
684
+ ],
685
+ },
686
+ })
687
+ }
688
+ }
689
+ }
690
+
691
+ option.series = seriesData
692
+ option.xAxis = {
693
+ type: data.conf.series.xAxisType,
694
+ }
695
+ if (data.conf.series.xAxisType === 'category') {
696
+ option.xAxis.data = xAxisData
697
+ }
698
+ option.yAxis = {}
699
+
700
+ option.legend = data.conf.legend
701
+ option.legend.data = legendData
702
+ return option
703
+ },
704
+ buildHeatmap(data, option) {
705
+ let displayField = data.displayfield
706
+ let legendData = []
707
+ let rows = []
708
+ let columns = []
709
+ let arr = []
710
+ let max = 0
711
+ let xAxisField = data.xaxisField
712
+ if (xAxisField) xAxisField = xAxisField[0]
713
+
714
+ for (let i = 0; i < data.rows.length; i++) {
715
+ for (let j = 0; j < displayField.length; j++) {
716
+ if (i === 0) {
717
+ columns.push(displayField[j].comment)
718
+ }
719
+ arr.push([i, j, data.rows[i][displayField[j].field.toUpperCase()]])
720
+ if (data.rows[i][displayField[j].field.toUpperCase()] > max) {
721
+ max = data.rows[i][displayField[j].field.toUpperCase()]
722
+ }
723
+ }
724
+ rows.push(data.rows[i][xAxisField.field.toUpperCase()])
725
+ }
726
+ option.series = [
727
+ {
728
+ name: 'sss',
729
+ type: 'heatmap',
730
+ data: arr,
731
+ label: {
732
+ normal: {
733
+ show: true,
734
+ },
735
+ },
736
+ },
737
+ ]
738
+ option.xAxis = {
739
+ type: 'category',
740
+ data: rows,
741
+ splitArea: {
742
+ show: true,
743
+ },
744
+ }
745
+ option.yAxis = {
746
+ type: 'category',
747
+ data: columns,
748
+ splitArea: {
749
+ show: true,
750
+ },
751
+ }
752
+ option.visualMap = {
753
+ min: 0,
754
+ max: max,
755
+ calculable: true,
756
+ orient: 'horizontal',
757
+ left: 'center',
758
+ bottom: '0%',
759
+ }
760
+ option.tooltip = {
761
+ position: 'top',
762
+ }
763
+
764
+ option.legend = data.conf.legend
765
+ option.legend.data = legendData
766
+ return option
767
+ },
768
+ getGrid() {
769
+ let top = 0
770
+ let bottom = 0
771
+ let grid = {}
772
+ if (this.customChart.conf.title.show) {
773
+ if (this.customChart.conf.title.top === 'top') {
774
+ top += 7
775
+ if (this.customChart.conf.title.subtext) {
776
+ top += 5
777
+ }
778
+ } else if (this.customChart.conf.title.top === 'bottom') {
779
+ bottom += 16
780
+ }
781
+ }
782
+ if (this.customChart.conf.legend.show) {
783
+ if (this.customChart.conf.legend.top === 'top') {
784
+ top += 7
785
+ } else if (this.customChart.conf.legend.top === 'bottom') {
786
+ bottom += 10
787
+ }
788
+ }
789
+ if (top !== 0) {
790
+ grid.top = top + '%'
791
+ } else {
792
+ grid.top = '5%'
793
+ }
794
+ if (bottom !== 0) {
795
+ grid.bottom = bottom + '%'
796
+ }
797
+ return grid
798
+ },
799
+ getTitlePosition() {
800
+ if (this.customChart.conf.title.top === 'top') {
801
+ return this.customChart.conf.legend.show &&
802
+ this.customChart.conf.legend.top === 'top'
803
+ ? '20'
804
+ : 'auto'
805
+ } else if (this.customChart.conf.title.top === 'bottom') {
806
+ return this.customChart.conf.legend.show &&
807
+ this.customChart.conf.legend.top === 'bottom'
808
+ ? '84%'
809
+ : '88%'
810
+ } else {
811
+ return this.customChart.conf.title.top
812
+ }
813
+ },
814
+ adjustChatTitle(data, option) {
815
+ option.legend.top = 30
816
+ option.grid.top = 80
817
+ if (data.conf && data.conf.title && data.conf.title.subtext) {
818
+ option.legend.top = 50
819
+ option.grid.top = 100
820
+ }
821
+ },
822
+ },
823
+ }
824
+ </script>
825
+
826
+ <style scoped>
827
+ ::v-deep .el-table--scrollable-y {
828
+ max-height: 100% !important;
829
+ height: 100% !important;
830
+ }
831
+ </style>