imatrix-ui 2.9.18-dw → 2.9.19-boe01

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 (199) hide show
  1. package/lib/super-ui.css +1 -1
  2. package/lib/super-ui.umd.min.js +5 -35
  3. package/package.json +4 -3
  4. package/src/api/sso-service.js +19 -1
  5. package/src/assets/nonemessage.png +0 -0
  6. package/src/i18n/i18n.js +1 -1
  7. package/src/i18n/langs/cn.js +25 -6
  8. package/src/i18n/langs/en.js +27 -7
  9. package/src/permission.js +2 -2
  10. package/src/plugins.js +3 -3
  11. package/src/router/index.js +10 -0
  12. package/src/store/modules/tab-content.js +6 -0
  13. package/src/store/modules/user.js +32 -2
  14. package/src/styles/display-layout.scss +1 -1
  15. package/src/styles/index.scss +74 -4
  16. package/src/styles/theme/black/font-style.scss +70 -0
  17. package/src/styles/theme/black/index.scss +6 -30
  18. package/src/styles/theme/blue/font-style.scss +37 -0
  19. package/src/styles/theme/blue/index.scss +2 -18
  20. package/src/styles/theme/blue2/font-style.scss +70 -0
  21. package/src/styles/theme/blue2/index.scss +3 -13
  22. package/src/styles/theme/dark-blue/card.scss +4 -6
  23. package/src/styles/theme/dark-blue/form.scss +7 -4
  24. package/src/styles/theme/dark-blue/index.scss +30 -5
  25. package/src/styles/theme/dark-blue/input.scss +4 -1
  26. package/src/styles/theme/dark-blue/message.scss +8 -0
  27. package/src/styles/theme/dark-blue/radio.scss +13 -0
  28. package/src/styles/theme/dark-blue/scrollbar-style.scss +8 -3
  29. package/src/styles/theme/dark-blue/sidebar.scss +7 -37
  30. package/src/styles/theme/dark-blue/tab.scss +4 -1
  31. package/src/styles/theme/dark-blue/table.scss +2 -2
  32. package/src/styles/theme/dark-blue/tree.scss +35 -10
  33. package/src/styles/theme/gray/card-style.scss +13 -1
  34. package/src/styles/theme/gray/font-style.scss +38 -0
  35. package/src/styles/theme/gray/index.scss +13 -25
  36. package/src/styles/theme/gray/scrollbar-style.scss +37 -0
  37. package/src/styles/theme/gray/sidebar.scss +7 -14
  38. package/src/utils/auth-api.js +47 -1
  39. package/src/utils/calculator/calculator-util.js +14 -0
  40. package/src/utils/common-util.js +22 -81
  41. package/src/utils/jump-page-utils.js +12 -9
  42. package/src/utils/preview-util.js +32 -0
  43. package/src/utils/range-selector.js +185 -0
  44. package/src/utils/request.js +20 -12
  45. package/src/utils/util.js +13 -11
  46. package/src/utils/workflow-util.js +3 -0
  47. package/src/views/dsc-component/Sidebar/Item.vue +7 -5
  48. package/src/views/dsc-component/Sidebar/SidebarItem.vue +2 -3
  49. package/src/views/dsc-component/Sidebar/index.vue +14 -22
  50. package/src/views/dsc-component/tabs/tab-content.vue +8 -9
  51. package/src/views/layout/EmptyLayout.vue +4 -1
  52. package/src/views/layout/NewLayout.vue +6 -65
  53. package/src/views/layout/components/AppMain.vue +2 -1
  54. package/src/views/layout/components/Breadcrumb/index.vue +1 -1
  55. package/src/views/layout/components/Menubar/Item.vue +23 -7
  56. package/src/views/layout/components/Menubar/Link.vue +11 -2
  57. package/src/views/layout/components/Menubar/SidebarItem.vue +50 -7
  58. package/src/views/layout/components/Menubar/index.vue +51 -16
  59. package/src/views/layout/components/Sidebar/index.vue +2 -2
  60. package/src/views/layout/components/tabs/tab-content.vue +162 -0
  61. package/src/views/layout/tab-content-iframe-index.vue +31 -0
  62. package/src/views/layout/tab-content-index.vue +84 -0
  63. package/src/views/login/index.vue +1 -1
  64. package/packages/breadcrumb/index.js +0 -6
  65. package/packages/breadcrumb/src/breadcrumb.vue +0 -71
  66. package/packages/department-tree/index.js +0 -6
  67. package/packages/department-tree/src/department-tree.vue +0 -108
  68. package/packages/department-tree-inline/index.js +0 -6
  69. package/packages/department-tree-inline/src/department-multi-tree-inline.vue +0 -411
  70. package/packages/department-tree-inline/src/department-single-tree-inline.vue +0 -293
  71. package/packages/department-tree-inline/src/department-tree-inline.vue +0 -86
  72. package/packages/department-tree-inline/src/department-tree-service.js +0 -275
  73. package/packages/department-tree-inline/src/search-result.vue +0 -176
  74. package/packages/department-user-tree/index.js +0 -6
  75. package/packages/department-user-tree/src/department-user-multiple-tree.vue +0 -116
  76. package/packages/department-user-tree/src/department-user-single-tree.vue +0 -76
  77. package/packages/department-user-tree/src/department-user-tree.vue +0 -101
  78. package/packages/department-user-tree-inline/index.js +0 -6
  79. package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +0 -639
  80. package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +0 -274
  81. package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +0 -79
  82. package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +0 -248
  83. package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +0 -142
  84. package/packages/department-user-tree-inline/src/search-result.vue +0 -197
  85. package/packages/directives/prevent-reclick.js +0 -19
  86. package/packages/dynamic-source-select/index.js +0 -6
  87. package/packages/dynamic-source-select/src/dynamic-source-select-service.js +0 -70
  88. package/packages/dynamic-source-select/src/dynamic-source-select.vue +0 -440
  89. package/packages/dynamic-source-select/src/events.js +0 -55
  90. package/packages/fs-preview/index.js +0 -6
  91. package/packages/fs-preview/src/fs-preview.vue +0 -226
  92. package/packages/fs-upload/index.js +0 -6
  93. package/packages/fs-upload/src/fs-upload-multi.vue +0 -420
  94. package/packages/fs-upload/src/fs-upload-single.vue +0 -312
  95. package/packages/fs-upload/src/fs-upload.vue +0 -189
  96. package/packages/fs-upload/src/see-big-picture.vue +0 -55
  97. package/packages/fs-upload-list/index.js +0 -6
  98. package/packages/fs-upload-list/src/fs-upload-list.vue +0 -287
  99. package/packages/hamburger/index.js +0 -6
  100. package/packages/hamburger/src/hamburger.vue +0 -38
  101. package/packages/index.js +0 -121
  102. package/packages/multipart-upload/index.js +0 -6
  103. package/packages/multipart-upload/src/index.vue +0 -73
  104. package/packages/multipart-upload/src/multipart-upload-form.vue +0 -297
  105. package/packages/multipart-upload/src/multipart-upload-list.vue +0 -378
  106. package/packages/organization-input/index.js +0 -6
  107. package/packages/organization-input/src/organization-input.vue +0 -542
  108. package/packages/plugins/export-data-new.js +0 -466
  109. package/packages/plugins/export-data.js +0 -361
  110. package/packages/plugins/index.js +0 -15
  111. package/packages/plugins/public-method.js +0 -43
  112. package/packages/remove-department/index.js +0 -6
  113. package/packages/remove-department/src/remove-department.vue +0 -172
  114. package/packages/remove-department/src/remove-dept-service.js +0 -20
  115. package/packages/remove-user/index.js +0 -6
  116. package/packages/remove-user/src/remove-user-service.js +0 -20
  117. package/packages/remove-user/src/remove-user.vue +0 -195
  118. package/packages/remove-workgroup/index.js +0 -6
  119. package/packages/remove-workgroup/src/remove-workgroup-service.js +0 -20
  120. package/packages/remove-workgroup/src/remove-workgroup.vue +0 -159
  121. package/packages/rich-editor/index.js +0 -7
  122. package/packages/rich-editor/index.vue +0 -278
  123. package/packages/rich-editor/langs/zh-Hans.js +0 -1
  124. package/packages/rich-editor/viewer.vue +0 -103
  125. package/packages/scan-code-input/index.js +0 -6
  126. package/packages/scan-code-input/src/events.js +0 -33
  127. package/packages/scan-code-input/src/scan-code-input-colse.vue +0 -131
  128. package/packages/scan-code-input/src/scan-code-input.vue +0 -116
  129. package/packages/secret-info/index.js +0 -7
  130. package/packages/secret-info/index.vue +0 -90
  131. package/packages/super-grid/index.js +0 -7
  132. package/packages/super-grid/src/apis.js +0 -820
  133. package/packages/super-grid/src/columns-config.vue +0 -335
  134. package/packages/super-grid/src/custom-formatter.js +0 -278
  135. package/packages/super-grid/src/dynamic-input.vue +0 -1279
  136. package/packages/super-grid/src/eventBus.js +0 -2
  137. package/packages/super-grid/src/events.js +0 -55
  138. package/packages/super-grid/src/formValidatorUtil.js +0 -226
  139. package/packages/super-grid/src/formatter.js +0 -181
  140. package/packages/super-grid/src/group-column.vue +0 -100
  141. package/packages/super-grid/src/header-context-menu.vue +0 -87
  142. package/packages/super-grid/src/index-column.vue +0 -51
  143. package/packages/super-grid/src/normal-column.vue +0 -775
  144. package/packages/super-grid/src/public-methods.js +0 -31
  145. package/packages/super-grid/src/row-operation.vue +0 -161
  146. package/packages/super-grid/src/search-button.vue +0 -66
  147. package/packages/super-grid/src/search-condition-input.vue +0 -61
  148. package/packages/super-grid/src/search-condition-list.vue +0 -59
  149. package/packages/super-grid/src/search-form-advancedQuery.vue +0 -654
  150. package/packages/super-grid/src/search-form-dialog.vue +0 -79
  151. package/packages/super-grid/src/search-form-item.vue +0 -405
  152. package/packages/super-grid/src/search-form-number.vue +0 -38
  153. package/packages/super-grid/src/search-form-open.vue +0 -170
  154. package/packages/super-grid/src/search-form-ordinarySearch.vue +0 -196
  155. package/packages/super-grid/src/search-form.vue +0 -642
  156. package/packages/super-grid/src/search-methods.js +0 -448
  157. package/packages/super-grid/src/selection-column.vue +0 -43
  158. package/packages/super-grid/src/store.js +0 -3
  159. package/packages/super-grid/src/super-grid-service.js +0 -593
  160. package/packages/super-grid/src/super-grid.vue +0 -2873
  161. package/packages/super-grid/src/utils.js +0 -772
  162. package/packages/super-grid/src/view-image-dialog.vue +0 -130
  163. package/packages/super-nine-grid/index.js +0 -7
  164. package/packages/super-nine-grid/src/apis.js +0 -103
  165. package/packages/super-nine-grid/src/custom-formatter.js +0 -66
  166. package/packages/super-nine-grid/src/formatter.js +0 -132
  167. package/packages/super-nine-grid/src/search-form-number.vue +0 -38
  168. package/packages/super-nine-grid/src/search-form.vue +0 -430
  169. package/packages/super-nine-grid/src/search-methods.js +0 -134
  170. package/packages/super-nine-grid/src/store.js +0 -3
  171. package/packages/super-nine-grid/src/super-grid-service.js +0 -91
  172. package/packages/super-nine-grid/src/super-nine-grid.vue +0 -872
  173. package/packages/super-nine-grid/src/utils.js +0 -261
  174. package/packages/svg-icon/index.js +0 -6
  175. package/packages/svg-icon/src/svg-icon.vue +0 -43
  176. package/packages/utils/memory-cache-utils.js +0 -90
  177. package/packages/utils/utils.js +0 -152
  178. package/packages/utils/value-set.js +0 -86
  179. package/packages/valid-code/index.js +0 -7
  180. package/packages/valid-code/src/valid-code.vue +0 -95
  181. package/packages/workflow-button/index.js +0 -6
  182. package/packages/workflow-button/src/workflow-button.vue +0 -325
  183. package/packages/workflow-history-list/index.js +0 -6
  184. package/packages/workflow-history-list/src/api.js +0 -7
  185. package/packages/workflow-history-list/src/workflow-history-list.vue +0 -185
  186. package/packages/workgroup-tree/index.js +0 -6
  187. package/packages/workgroup-tree/src/workgroup-tree.vue +0 -76
  188. package/packages/workgroup-tree-inline/index.js +0 -6
  189. package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +0 -317
  190. package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +0 -43
  191. package/packages/workgroup-user-tree/index.js +0 -6
  192. package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +0 -100
  193. package/packages/workgroup-user-tree-inline/index.js +0 -6
  194. package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +0 -163
  195. package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +0 -436
  196. package/packages/year-range-picker/index.js +0 -6
  197. package/packages/year-range-picker/src/year-range-picker.vue +0 -51
  198. package/src/index.js +0 -93
  199. package/src/styles/theme/gray/form-style.scss +0 -41
@@ -1,2 +0,0 @@
1
- import Vue from 'vue'
2
- export default new Vue()
@@ -1,55 +0,0 @@
1
- const events = {
2
- select: function(selection, row) {
3
- this.$emit('select', selection, row)
4
- },
5
- selectAll: function(selection) {
6
- this.$emit('select-all', selection)
7
- },
8
- selectionChange: function(selection) {
9
- this.$emit('selection-change', selection)
10
- },
11
- cellMouseEnter: function(row, column, cell, event) {
12
- this.$emit('cell-mouse-enter', row, column, cell, event)
13
- },
14
- cellMouseLeave: function(row, column, cell, event) {
15
- this.$emit('cell-mouse-leave', row, column, cell, event)
16
- },
17
- cellClick: function(row, column, cell, event) {
18
- this.$emit('cell-click', row, column, cell, event)
19
- },
20
- cellDblClick: function(row, column, cell, event) {
21
- this.$emit('cell-dblclick', row, column, cell, event)
22
- },
23
- rowClick: function(row, column, event) {
24
- this.$emit('row-click', row, column, event)
25
- },
26
- rowContextMenu: function(row, column, event) {
27
- this.$emit('row-contextmenu', row, column, event)
28
- },
29
- rowDblClick: function(row, column, event) {
30
- this.$emit('row-dblclick', row, column, event)
31
- },
32
- headerClick: function(column, event) {
33
- this.$emit('header-click', column, event)
34
- },
35
- headerContextMenu: function(column, event) {
36
- this.$emit('header-contextmenu', column, event)
37
- },
38
- // super-grid.vue中已经做了处理
39
- // sortChange: function({ column, prop, order }) {
40
- // this.$emit('sort-change', { column, prop, order })
41
- // },
42
- filterChange: function(filters) {
43
- this.$emit('filter-change', filters)
44
- },
45
- currentChange: function(currentRow, oldCurrentRow) {
46
- this.$emit('current-change', currentRow, oldCurrentRow)
47
- },
48
- headerDragEnd: function(newWidth, oldWidth, column, event) {
49
- this.$emit('header-dragend', newWidth, oldWidth, column, event)
50
- },
51
- expandChange: function(row, expandedRows) {
52
- this.$emit('expand-change', row, expandedRows)
53
- }
54
- }
55
- export default events
@@ -1,226 +0,0 @@
1
- import Validator from 'async-validator'
2
- import store from './store'
3
- import Vue from 'vue'
4
- import {
5
- isDisableEdit
6
- } from './utils'
7
- import {
8
- getI18n
9
- } from '../../../src/utils/util'
10
-
11
- function setObjectPropRule(editField, rules, leafRule) {
12
- const rule = {}
13
- const prop = editField.prop
14
- if (!rules) {
15
- rules = {}
16
- }
17
- let num = 0
18
- const props = prop.split('.')
19
- props.forEach(subProp => {
20
- let objectRule
21
- if (num === props.length - 1) {
22
- // 说明是最后一个
23
- objectRule = getEndObjectRule(rule, props, subProp)
24
- objectRule.fields[subProp] = leafRule
25
- } else {
26
- let lastObjectRule
27
- if (num === 0) {
28
- objectRule = rules
29
- } else {
30
- lastObjectRule = getLastObjectRule(rule, props, props[num - 1])
31
- objectRule = lastObjectRule.fields
32
- }
33
- if (!objectRule[subProp]) {
34
- objectRule[subProp] = {
35
- type: 'object',
36
- required: true,
37
- fields: {}
38
- }
39
- }
40
- if (num === 0) {
41
- rule[subProp] = objectRule[subProp]
42
- } else {
43
- lastObjectRule.fields[subProp] = objectRule[subProp]
44
- }
45
- }
46
- num++
47
- })
48
- return rule
49
- }
50
-
51
- function getLastObjectRule(rule, props, currentProp) {
52
- let lastObjectdRule
53
- for (let i = 0; i < props.length; i++) {
54
- const subProp = props[i]
55
- if (i === 0) {
56
- lastObjectdRule = rule[subProp]
57
- } else {
58
- lastObjectdRule = lastObjectdRule.fields[props[i]]
59
- }
60
- if (subProp === currentProp) {
61
- break
62
- }
63
- }
64
- return lastObjectdRule
65
- }
66
-
67
- function getEndObjectRule(rule, props, currentProp) {
68
- let lastObjectdRule
69
- for (let i = 0; i < props.length; i++) {
70
- if (i === 0) {
71
- lastObjectdRule = rule[props[i]]
72
- } else {
73
- lastObjectdRule = lastObjectdRule.fields[props[i]]
74
- }
75
- if (i !== props.length - 1) {
76
- const leafSubProp = props[i + 1]
77
- if (leafSubProp === currentProp) {
78
- break
79
- }
80
- }
81
- }
82
- return lastObjectdRule
83
- }
84
-
85
- /**
86
- * @param {editFieldInfos} Array 编辑字段信息集合
87
- */
88
- function getValidator(listCode) {
89
- if (!listCode) {
90
- listCode = store.get('_list_code')
91
- }
92
- const gridParams = store.get(listCode)
93
- const editFieldInfos = gridParams.columns
94
- const rules = {}
95
- if (editFieldInfos) {
96
- editFieldInfos.forEach(editField => {
97
- const prop = editField.prop
98
- if (prop && editField.validations && !isDisableEdit(prop, listCode)) {
99
- const validations = JSON.parse(editField.validations)
100
- validations.forEach(item => {
101
- if (item.pattern) {
102
- // 后台传递的是正则字符串,不能直接使用
103
- item.pattern = new RegExp(item.pattern)
104
- }
105
- })
106
- if (prop.indexOf('.') > 0) {
107
- setObjectPropRule(editField, rules, validations)
108
- } else {
109
- if (validations && validations.length > 0) {
110
- rules[prop] = [...validations]
111
- }
112
- }
113
- }
114
- })
115
- }
116
- // console.log('rules', rules)
117
- return rules
118
- }
119
- /**
120
- * 验证实体
121
- * @param {*} entity 实体记录
122
- * @param {*} listCode 列表编码
123
- * @param {*} $index 当前行下标
124
- * @param {*} rules 验证规则
125
- * @param {*} isSubTableShowPage 表单子表是否显示分页区域
126
- * @param {*} pageNum 当前记录在子表中的第几页
127
- * @returns void
128
- */
129
-
130
- function validator(entity, listCode, $index, rules, isSubTableShowPage, pageNum, pageRowIndex) {
131
- return validatorEntity(entity, listCode, $index, rules, true, isSubTableShowPage, pageNum, pageRowIndex)
132
- }
133
-
134
- function validatorEntity(entity, listCode, $index, rules, isShouldRepeateValdate, isSubTableShowPage, pageNum, pageRowIndex) {
135
- let result = false
136
- let validateRules
137
- if (rules) {
138
- validateRules = rules
139
- } else {
140
- validateRules = getValidator(listCode)
141
- }
142
- const validator = new Validator(validateRules)
143
- if (!listCode) {
144
- listCode = store.get('_list_code')
145
- }
146
-
147
- const gridParams = store.get(listCode)
148
- validator.validate(entity, {
149
- first: true
150
- },
151
- (errors, fields) => {
152
- let fieldName
153
- if (errors) {
154
- const message = errors[0]['message']
155
- fieldName = errors[0]['field']
156
- if ($index !== null && $index !== undefined && gridParams.gridData.length > $index) {
157
- Vue.set(gridParams.gridData[$index], 'validateErrorField', errors[0]['field'])
158
- if (isSubTableShowPage !== undefined && isSubTableShowPage && pageNum !== undefined && pageRowIndex !== undefined) {
159
- // 表示表单子表验证时
160
- result = getI18n().t('superGrid.pageRecordLine', {
161
- pageNum: pageNum,
162
- row: pageRowIndex
163
- }) + ',' + message
164
- } else {
165
- // 表示列表记录验证时
166
- result = getI18n().t('superGrid.recordLine', {
167
- row: ($index + 1)
168
- }) + ',' + message
169
- }
170
- } else if (gridParams.$rowIndex !== null && gridParams.$rowIndex !== undefined && gridParams.gridData.length > gridParams.$rowIndex) {
171
- Vue.set(gridParams.gridData[gridParams.$rowIndex], 'validateErrorField', errors[0]['field'])
172
- result = getI18n().t('superGrid.recordLine', {
173
- row: (gridParams.$rowIndex + 1)
174
- }) + ',' + message
175
- }
176
- } else {
177
- // 验证成功后,将最后验证失败的字段置空
178
- if ($index !== null && $index !== undefined && gridParams.gridData.length > $index) {
179
- if (isSubTableShowPage !== undefined && isSubTableShowPage) {
180
- Vue.set(gridParams.subTableData[$index], 'validateErrorField', '')
181
- } else {
182
- Vue.set(gridParams.gridData[$index], 'validateErrorField', '')
183
- }
184
- } else if (gridParams.$rowIndex !== null && gridParams.$rowIndex !== undefined && gridParams.gridData.length > gridParams.$rowIndex) {
185
- Vue.set(gridParams.gridData[gridParams.$rowIndex], 'validateErrorField', '')
186
- } else if ($index !== null && $index !== undefined && isSubTableShowPage !== undefined && isSubTableShowPage && gridParams.gridData.length <= $index) {
187
- // 表示可能是子表分页时,清空子表的
188
- Vue.set(gridParams.subTableData[$index], 'validateErrorField', '')
189
- }
190
-
191
- result = true
192
- }
193
- if (fieldName && isShouldRepeateValdate === true) {
194
- // 将实体中字段名改为大写,然后再验证一次该字段是否已填值。因为mysql中jdbc获得实体记录字段名是小写的,但是验证规则中字段名是大写的,所以会导致字段验证失败
195
- const reg1 = /[A-Z]+/ // 大写字母
196
- if ((result !== undefined && result + '' !== 'true' && result + '' !== 'false') && (gridParams.isSql !== undefined && gridParams.isSql === true && reg1.test(fieldName) && entity[fieldName.toLowerCase()] !== undefined)) {
197
- // 表示验证失败,需要重新验证一次
198
- const copyEntity = JSON.parse(JSON.stringify(entity))
199
- copyEntity[fieldName.toUpperCase()] = entity[fieldName.toLowerCase()]
200
- delete copyEntity[fieldName.toLowerCase()]
201
- result = validatorEntity(copyEntity, listCode, $index, rules, false)
202
- }
203
- if (result !== undefined && result + '' !== 'true' && result + '' !== 'false') {
204
- // 表示验证失败
205
- if (gridParams.showValidateError) {
206
- gridParams.showValidateError = false
207
- Vue.prototype.$message({
208
- showClose: true,
209
- message: result,
210
- type: 'warning',
211
- onClose: (messageEle) => {
212
- gridParams.showValidateError = true
213
- }
214
- })
215
- }
216
- }
217
- }
218
- })
219
-
220
- return result
221
- }
222
-
223
- export default {
224
- validator,
225
- getValidator
226
- }
@@ -1,181 +0,0 @@
1
- import { isDynamicDataSourceSource } from './utils'
2
- const formatter = {
3
- number: function(inputValue, options) {
4
- // 小数位数
5
- const precision = options.precision
6
- // 数字符号
7
- const sign = options.sign
8
- // 是否显示千分位
9
- const isDelimiter = options.delimiter
10
- // 是否显示科学计数法
11
- const scientific = options.scientific
12
- // 几位开始计算
13
- let scientificNum = options.scientificNum
14
- if (inputValue !== undefined && inputValue != null) {
15
- if (precision > 0) {
16
- // 表示有小数
17
- inputValue = parseFloat(inputValue)
18
- inputValue = inputValue.toFixed(precision)
19
- }
20
- if (isDelimiter) {
21
- const inputValueStr = inputValue + ''
22
- const value = inputValueStr.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
23
- if (sign) {
24
- return value + sign
25
- } else {
26
- return value
27
- }
28
- } else if (scientific != null) {
29
- let isScientific = false
30
- if (scientificNum) {
31
- scientificNum = parseInt(scientificNum)
32
- } else {
33
- scientificNum = 11
34
- }
35
- if (inputValue.length >= scientificNum) {
36
- isScientific = true
37
- }
38
- if (isScientific) {
39
- inputValue = '' + inputValue
40
- inputValue = parseFloat(inputValue)
41
- inputValue = inputValue.toExponential() // 转换为标准的科学计数法形式(字符串)
42
- // const tmpArray = eformat.match(/\d(?:\.(\d*))?e([+-]\d+)/) // 分离出小数值和指数值
43
- // inputValue = inputValue.toFixed(Math.max(0, (tmpArray[1] || '').length - tmpArray[2]))
44
- }
45
- } else {
46
- if (sign) {
47
- return inputValue + sign
48
- } else {
49
- return inputValue
50
- }
51
- }
52
- }
53
-
54
- return inputValue
55
- },
56
- currency: function(value, options) {
57
- // 单位:$ 或 ¥
58
- const sign = options.sign
59
- return sign + this.number(value, options)
60
- },
61
- date: function(value, options) {
62
- // format格式,例如:yyyy-m-d,yyyy-m-d hh:mm:ss等等
63
- const format = options.format
64
- if (value != null) {
65
- const date = new Date(value)
66
- var y = date.getFullYear()
67
- var m = date.getMonth() + 1
68
- var d = date.getDate()
69
- var h = date.getHours()
70
- var min = date.getMinutes()
71
- var s = date.getSeconds()
72
- if (m < 10) {
73
- m = '0' + m
74
- }
75
- if (d < 10) {
76
- d = '0' + d
77
- }
78
- if (h < 10) {
79
- h = '0' + h
80
- }
81
- if (min < 10) {
82
- min = '0' + min
83
- }
84
- if (s < 10) {
85
- s = '0' + s
86
- }
87
- const newValue = format.replace('yyyy', y)
88
- .replace('mm', min)
89
- .replace('M', m)
90
- .replace('m', m)
91
- .replace('d', d)
92
- .replace('hh', h)
93
- .replace('ss', s)
94
- // 判断格式化的值是否包含NaN,如果包含NaN取数据库的值
95
- if (newValue.indexOf('NaN') === -1) {
96
- return newValue
97
- }
98
- return value
99
- }
100
- return value
101
- },
102
- time: function(value, options) {
103
- return this.date(value, options)
104
- },
105
- percent: function(value, options) {
106
- if (value || value >= 0) {
107
- return this.number(value, options) + '%'
108
- }
109
- return value
110
- }
111
- }
112
-
113
- export function doFormat(column, value) {
114
- value = doFormatWithValueSet(column, value)
115
- if (value === undefined || value === null) {
116
- return
117
- }
118
- // 获得默认的格式设置
119
- if (column.formatter === undefined) {
120
- if (column.dataType === 'DATE') {
121
- // 默认的“DATE”类型的格式设置
122
- column.formatter = {
123
- type: 'date',
124
- options: {
125
- format: 'yyyy-m-d'
126
- }
127
- }
128
- } else if (column.dataType === 'TIME') {
129
- // 默认的“TIME”类型的格式设置
130
- column.formatter = {
131
- type: 'time',
132
- options: {
133
- format: 'yyyy-m-d hh:mm:ss'
134
- }
135
- }
136
- }
137
- }
138
- const columnFormatter = column.formatter
139
- if (columnFormatter !== undefined && formatter[columnFormatter.type] !== undefined) {
140
- return formatter[columnFormatter.type](value, columnFormatter.options)
141
- } else {
142
- return value
143
- }
144
- }
145
-
146
- export function doFormatWithValueSet(column, value) {
147
- if (value === undefined || value === null) {
148
- return value
149
- }
150
- const valueSet = column.valueSet
151
- // 先处理值设置再处理格式化设置:即会对值设置的结果进行格式化设置
152
- if (valueSet !== undefined) {
153
- if (column.componentType === 'multiselect' && !isDynamicDataSourceSource(column)) {
154
- if (typeof (value) === 'number') {
155
- // 当value是0时, value instanceof Number 为false
156
- value += ''
157
- }
158
- const beforeLabel = (value + '').split(',')
159
- const label = []
160
- beforeLabel.forEach(element => {
161
- const item = valueSet.filter(item => {
162
- return item.value === element + ''
163
- })
164
- if (item.length > 0) {
165
- label.push(item[0].label)
166
- }
167
- })
168
- value = label.join(',')
169
- } else {
170
- const item = valueSet.filter(item => {
171
- return item.value === value + ''
172
- })
173
- if (item.length > 0) {
174
- // 数据库的原始值要显示成label值,后续对这个label进行格式化(不是处理原始值)
175
- value = item[0].label
176
- }
177
- }
178
- }
179
- return value
180
- }
181
-
@@ -1,100 +0,0 @@
1
-
2
- <template>
3
- <el-table-column
4
- width="150"
5
- :align="column.groupHeader?'center':''"
6
- >
7
- <template v-slot:header>
8
- <span class="cell--span" :title="label" v-html="label" />
9
- </template>
10
- <template v-if="customFormat">
11
- <component
12
- :is="child.prop?'NormalColumn':'GroupColumn'"
13
- v-for="(child, index) in visibleChildren"
14
- :key="child.label + index"
15
- :column="child"
16
- :is-sql="isSql"
17
- :custom-format="child.prop ?customFormat[child.prop] : customFormat"
18
- :list-code="listCode"
19
- @findIndex="findIndex(scope.$index)"
20
- @refresData="refresData"
21
- @refresPortData="refresPortData"
22
- @refresPortsData="refresPortsData"
23
- @refresMainTableFields="refresMainTableFields"
24
- />
25
- </template>
26
- <template v-else>
27
- <component
28
- :is="child.prop?'NormalColumn':'GroupColumn'"
29
- v-for="(child, index) in visibleChildren"
30
- :key="child.label + index"
31
- :is-sql="isSql"
32
- :column="child"
33
- :list-code="listCode"
34
- />
35
- </template>
36
- </el-table-column>
37
- </template>
38
- <script>
39
- import NormalColumn from './normal-column'
40
- import GroupColumn from './group-column'
41
- import { doFormatWithValueSet } from './formatter'
42
- export default {
43
- name: 'GroupColumn',
44
- components: {
45
- NormalColumn,
46
- GroupColumn
47
- },
48
- props: {
49
- column: {
50
- type: Object,
51
- default: null
52
- },
53
- // 操作列、占位符列内容显示的函数,格式为:{'属性名':方法},例如:{'name':viewUser,'operation':showOperation}
54
- customFormat: {
55
- type: Object,
56
- default: null
57
- },
58
- listCode: {
59
- type: String,
60
- default: null
61
- },
62
- isSql: {
63
- type: Boolean,
64
- default: false
65
- }
66
- },
67
- data() {
68
- return {
69
- label: null // 标题
70
- }
71
- },
72
- computed: {
73
- visibleChildren() {
74
- if (this.column.children) {
75
- return this.column.children.filter(column => {
76
- return column.show === undefined || column.show
77
- })
78
- } else {
79
- return []
80
- }
81
- }
82
- },
83
- created() {
84
- this.label = this.getHeader()
85
- },
86
- methods: {
87
- getHeader() {
88
- if (!this.column.titleValueSet) {
89
- return this.column.label.replace(/\\n/g, '</br>')
90
- } else {
91
- return this.formatHeader()
92
- }
93
- },
94
- formatHeader() {
95
- return doFormatWithValueSet(this.column.titleValueSetValue, this.column.label)
96
- }
97
- }
98
- }
99
- </script>
100
-
@@ -1,87 +0,0 @@
1
- <template>
2
- <ul class="context-menu">
3
- <li v-for="menu in buttomArr" :key="menu.name">
4
- <i :class="menu.icon" /><span @click="buttonClick(menu.event, menu)">{{ menu.label }}</span>
5
- </li>
6
- </ul>
7
- </template>
8
- <script>
9
- // import Vue from 'vue'
10
-
11
- export default {
12
- name: 'HeaderContextMenu',
13
- components: {
14
- },
15
- filters: {
16
- },
17
- props: {
18
- buttomArr: {
19
- type: Array,
20
- default: null
21
- },
22
- column: {
23
- type: Object,
24
- default: null
25
- }
26
- },
27
- data() {
28
- return {
29
-
30
- }
31
- },
32
- computed: {
33
-
34
- },
35
- watch: {
36
-
37
- },
38
- created() {
39
- console.log('12345', this.buttomArr)
40
- },
41
- methods: {
42
- // 操作按钮的点击事件
43
- buttonClick(event, data) {
44
- if (event) {
45
- if (typeof (event) === 'function') {
46
- event.call(this, data, this.column)
47
- } else {
48
- this.$emit(event, data, this.column)
49
- }
50
- this.$emit('clearHeaderContextmenu')
51
- }
52
- }
53
- }
54
- }
55
- </script>
56
- <style lang="scss" scoped>
57
- li {
58
- color: #333;
59
- }
60
- .context-menu {
61
- position: fixed;
62
- background: #fff;
63
- z-index: 999;
64
- padding:5px;
65
- margin:0;
66
- margin-top: 30px
67
- }
68
- .context-menu li {
69
- min-width: 75px;
70
- height: 28px;
71
- line-height: 28px;
72
- text-align: left;
73
- color: #1a1a1a;
74
- }
75
- .context-menu li:hover {
76
- background: #42b983;
77
- color: #fff;
78
- }
79
- .context-menu {
80
- border: 1px solid #eee;
81
- box-shadow: 0 0.5em 1em 0 rgba(0,0,0,.1);
82
- border-radius: 5px;
83
- }
84
- li {
85
- list-style-type:none;
86
- }
87
- </style>
@@ -1,51 +0,0 @@
1
-
2
- <template>
3
- <el-table-column
4
- align="center"
5
- :fixed="fixed"
6
- :width="column.width?column.width:'80'"
7
- >
8
- <template v-slot:header>
9
- <span class="cell--span">{{ $t('superGrid.index') }}</span>
10
- </template>
11
- <template slot-scope="scope">
12
- <span class="cell--span">
13
- {{ scope.$index + 1 }}
14
- </span>
15
- </template>
16
- </el-table-column>
17
- </template>
18
- <script>
19
- /**
20
- * 序号列
21
- */
22
- export default {
23
- name: 'IndexColumn',
24
- components: {
25
- },
26
- props: {
27
- column: {
28
- type: Object,
29
- default: null
30
- },
31
- isLineEdit: {
32
- type: Boolean,
33
- default: false
34
- }
35
-
36
- },
37
- computed: {
38
- fixed() {
39
- if (this.column.fixed && (this.column.fixed === 'false' || this.column.fixed === '')) {
40
- return false
41
- }
42
- // 序号只支持左固定
43
- if (this.column.fixed && (this.column.fixed === 'right')) {
44
- return 'left'
45
- }
46
- return this.column.fixed
47
- }
48
- }
49
- }
50
- </script>
51
-