imatrix-ui 2.9.10-dw → 2.9.11-boe2

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 (181) hide show
  1. package/lib/super-ui.css +1 -1
  2. package/lib/super-ui.umd.min.js +5 -35
  3. package/package.json +2 -2
  4. package/src/api/sso-service.js +19 -1
  5. package/src/i18n/i18n.js +1 -1
  6. package/src/i18n/langs/cn.js +14 -4
  7. package/src/i18n/langs/en.js +16 -5
  8. package/src/permission.js +1 -1
  9. package/src/plugins.js +3 -3
  10. package/src/router/index.js +10 -0
  11. package/src/store/modules/tab-content.js +6 -0
  12. package/src/store/modules/user.js +19 -0
  13. package/src/styles/index.scss +74 -4
  14. package/src/styles/theme/black/font-style.scss +70 -0
  15. package/src/styles/theme/black/index.scss +6 -30
  16. package/src/styles/theme/blue/font-style.scss +37 -0
  17. package/src/styles/theme/blue/index.scss +2 -18
  18. package/src/styles/theme/blue2/font-style.scss +70 -0
  19. package/src/styles/theme/blue2/index.scss +3 -13
  20. package/src/styles/theme/dark-blue/index.scss +27 -5
  21. package/src/styles/theme/dark-blue/message.scss +8 -0
  22. package/src/styles/theme/dark-blue/sidebar.scss +7 -37
  23. package/src/styles/theme/dark-blue/table.scss +1 -1
  24. package/src/styles/theme/gray/card-style.scss +13 -1
  25. package/src/styles/theme/gray/font-style.scss +38 -0
  26. package/src/styles/theme/gray/index.scss +13 -25
  27. package/src/styles/theme/gray/scrollbar-style.scss +32 -0
  28. package/src/styles/theme/gray/sidebar.scss +7 -14
  29. package/src/utils/auth-api.js +45 -1
  30. package/src/utils/common-util.js +21 -81
  31. package/src/utils/range-selector.js +185 -0
  32. package/src/utils/request.js +6 -3
  33. package/src/utils/util.js +12 -10
  34. package/src/views/dsc-component/Sidebar/Item.vue +7 -5
  35. package/src/views/dsc-component/Sidebar/SidebarItem.vue +2 -3
  36. package/src/views/dsc-component/Sidebar/index.vue +12 -20
  37. package/src/views/dsc-component/tabs/tab-content.vue +1 -5
  38. package/src/views/layout/NewLayout.vue +6 -65
  39. package/src/views/layout/components/Menubar/Item.vue +23 -7
  40. package/src/views/layout/components/Menubar/Link.vue +11 -2
  41. package/src/views/layout/components/Menubar/SidebarItem.vue +50 -7
  42. package/src/views/layout/components/Menubar/index.vue +51 -16
  43. package/src/views/layout/components/tabs/tab-content.vue +160 -0
  44. package/src/views/layout/tab-content-iframe-index.vue +31 -0
  45. package/src/views/layout/tab-content-index.vue +85 -0
  46. package/src/views/login/index.vue +1 -1
  47. package/packages/breadcrumb/index.js +0 -6
  48. package/packages/breadcrumb/src/breadcrumb.vue +0 -71
  49. package/packages/department-tree/index.js +0 -6
  50. package/packages/department-tree/src/department-tree.vue +0 -108
  51. package/packages/department-tree-inline/index.js +0 -6
  52. package/packages/department-tree-inline/src/department-multi-tree-inline.vue +0 -402
  53. package/packages/department-tree-inline/src/department-single-tree-inline.vue +0 -284
  54. package/packages/department-tree-inline/src/department-tree-inline.vue +0 -86
  55. package/packages/department-tree-inline/src/department-tree-service.js +0 -245
  56. package/packages/department-tree-inline/src/search-result.vue +0 -176
  57. package/packages/department-user-tree/index.js +0 -6
  58. package/packages/department-user-tree/src/department-user-multiple-tree.vue +0 -116
  59. package/packages/department-user-tree/src/department-user-single-tree.vue +0 -76
  60. package/packages/department-user-tree/src/department-user-tree.vue +0 -101
  61. package/packages/department-user-tree-inline/index.js +0 -6
  62. package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +0 -626
  63. package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +0 -269
  64. package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +0 -79
  65. package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +0 -230
  66. package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +0 -122
  67. package/packages/department-user-tree-inline/src/search-result.vue +0 -197
  68. package/packages/directives/prevent-reclick.js +0 -19
  69. package/packages/dynamic-source-select/index.js +0 -6
  70. package/packages/dynamic-source-select/src/dynamic-source-select-service.js +0 -70
  71. package/packages/dynamic-source-select/src/dynamic-source-select.vue +0 -440
  72. package/packages/dynamic-source-select/src/events.js +0 -55
  73. package/packages/fs-preview/index.js +0 -6
  74. package/packages/fs-preview/src/fs-preview.vue +0 -226
  75. package/packages/fs-upload/index.js +0 -6
  76. package/packages/fs-upload/src/fs-upload-multi.vue +0 -420
  77. package/packages/fs-upload/src/fs-upload-single.vue +0 -312
  78. package/packages/fs-upload/src/fs-upload.vue +0 -189
  79. package/packages/fs-upload/src/see-big-picture.vue +0 -55
  80. package/packages/fs-upload-list/index.js +0 -6
  81. package/packages/fs-upload-list/src/fs-upload-list.vue +0 -287
  82. package/packages/hamburger/index.js +0 -6
  83. package/packages/hamburger/src/hamburger.vue +0 -38
  84. package/packages/index.js +0 -121
  85. package/packages/multipart-upload/index.js +0 -6
  86. package/packages/multipart-upload/src/index.vue +0 -73
  87. package/packages/multipart-upload/src/multipart-upload-form.vue +0 -297
  88. package/packages/multipart-upload/src/multipart-upload-list.vue +0 -378
  89. package/packages/organization-input/index.js +0 -6
  90. package/packages/organization-input/src/organization-input.vue +0 -542
  91. package/packages/plugins/export-data-new.js +0 -453
  92. package/packages/plugins/export-data.js +0 -361
  93. package/packages/plugins/index.js +0 -15
  94. package/packages/plugins/public-method.js +0 -43
  95. package/packages/remove-department/index.js +0 -6
  96. package/packages/remove-department/src/remove-department.vue +0 -172
  97. package/packages/remove-department/src/remove-dept-service.js +0 -20
  98. package/packages/remove-user/index.js +0 -6
  99. package/packages/remove-user/src/remove-user-service.js +0 -20
  100. package/packages/remove-user/src/remove-user.vue +0 -195
  101. package/packages/remove-workgroup/index.js +0 -6
  102. package/packages/remove-workgroup/src/remove-workgroup-service.js +0 -20
  103. package/packages/remove-workgroup/src/remove-workgroup.vue +0 -159
  104. package/packages/rich-editor/index.js +0 -7
  105. package/packages/rich-editor/index.vue +0 -278
  106. package/packages/rich-editor/langs/zh-Hans.js +0 -1
  107. package/packages/rich-editor/viewer.vue +0 -103
  108. package/packages/scan-code-input/index.js +0 -6
  109. package/packages/scan-code-input/src/events.js +0 -33
  110. package/packages/scan-code-input/src/scan-code-input-colse.vue +0 -131
  111. package/packages/scan-code-input/src/scan-code-input.vue +0 -116
  112. package/packages/secret-info/index.js +0 -7
  113. package/packages/secret-info/index.vue +0 -90
  114. package/packages/super-grid/index.js +0 -7
  115. package/packages/super-grid/src/apis.js +0 -778
  116. package/packages/super-grid/src/columns-config.vue +0 -335
  117. package/packages/super-grid/src/custom-formatter.js +0 -250
  118. package/packages/super-grid/src/dynamic-input.vue +0 -1279
  119. package/packages/super-grid/src/eventBus.js +0 -2
  120. package/packages/super-grid/src/events.js +0 -55
  121. package/packages/super-grid/src/formValidatorUtil.js +0 -226
  122. package/packages/super-grid/src/formatter.js +0 -181
  123. package/packages/super-grid/src/group-column.vue +0 -100
  124. package/packages/super-grid/src/header-context-menu.vue +0 -87
  125. package/packages/super-grid/src/index-column.vue +0 -51
  126. package/packages/super-grid/src/normal-column.vue +0 -769
  127. package/packages/super-grid/src/public-methods.js +0 -31
  128. package/packages/super-grid/src/row-operation.vue +0 -161
  129. package/packages/super-grid/src/search-button.vue +0 -66
  130. package/packages/super-grid/src/search-condition-input.vue +0 -61
  131. package/packages/super-grid/src/search-condition-list.vue +0 -59
  132. package/packages/super-grid/src/search-form-advancedQuery.vue +0 -653
  133. package/packages/super-grid/src/search-form-dialog.vue +0 -79
  134. package/packages/super-grid/src/search-form-item.vue +0 -386
  135. package/packages/super-grid/src/search-form-number.vue +0 -38
  136. package/packages/super-grid/src/search-form-open.vue +0 -162
  137. package/packages/super-grid/src/search-form-ordinarySearch.vue +0 -188
  138. package/packages/super-grid/src/search-form.vue +0 -634
  139. package/packages/super-grid/src/search-methods.js +0 -387
  140. package/packages/super-grid/src/selection-column.vue +0 -43
  141. package/packages/super-grid/src/store.js +0 -3
  142. package/packages/super-grid/src/super-grid-service.js +0 -561
  143. package/packages/super-grid/src/super-grid.vue +0 -2829
  144. package/packages/super-grid/src/utils.js +0 -763
  145. package/packages/super-grid/src/view-image-dialog.vue +0 -130
  146. package/packages/super-nine-grid/index.js +0 -7
  147. package/packages/super-nine-grid/src/apis.js +0 -103
  148. package/packages/super-nine-grid/src/custom-formatter.js +0 -66
  149. package/packages/super-nine-grid/src/formatter.js +0 -132
  150. package/packages/super-nine-grid/src/search-form-number.vue +0 -38
  151. package/packages/super-nine-grid/src/search-form.vue +0 -430
  152. package/packages/super-nine-grid/src/search-methods.js +0 -134
  153. package/packages/super-nine-grid/src/store.js +0 -3
  154. package/packages/super-nine-grid/src/super-grid-service.js +0 -91
  155. package/packages/super-nine-grid/src/super-nine-grid.vue +0 -872
  156. package/packages/super-nine-grid/src/utils.js +0 -261
  157. package/packages/svg-icon/index.js +0 -6
  158. package/packages/svg-icon/src/svg-icon.vue +0 -43
  159. package/packages/utils/utils.js +0 -152
  160. package/packages/utils/value-set.js +0 -86
  161. package/packages/valid-code/index.js +0 -7
  162. package/packages/valid-code/src/valid-code.vue +0 -95
  163. package/packages/workflow-button/index.js +0 -6
  164. package/packages/workflow-button/src/workflow-button.vue +0 -325
  165. package/packages/workflow-history-list/index.js +0 -6
  166. package/packages/workflow-history-list/src/api.js +0 -7
  167. package/packages/workflow-history-list/src/workflow-history-list.vue +0 -185
  168. package/packages/workgroup-tree/index.js +0 -6
  169. package/packages/workgroup-tree/src/workgroup-tree.vue +0 -76
  170. package/packages/workgroup-tree-inline/index.js +0 -6
  171. package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +0 -317
  172. package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +0 -43
  173. package/packages/workgroup-user-tree/index.js +0 -6
  174. package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +0 -100
  175. package/packages/workgroup-user-tree-inline/index.js +0 -6
  176. package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +0 -163
  177. package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +0 -436
  178. package/packages/year-range-picker/index.js +0 -6
  179. package/packages/year-range-picker/src/year-range-picker.vue +0 -51
  180. package/src/index.js +0 -93
  181. package/src/styles/theme/gray/form-style.scss +0 -41
@@ -1,335 +0,0 @@
1
- <template>
2
- <el-dialog
3
- :title="$t('superGrid.columnConfig')"
4
- width="50%"
5
- top="5vh"
6
- append-to-body
7
- :close-on-click-modal="false"
8
- :visible="true"
9
- :show-close="true"
10
- @open="$emit('open')"
11
- @opend="$emit('opend')"
12
- @close="$emit('close')"
13
- @closed="$emit('closed')"
14
- >
15
- <div
16
- class="operation-area"
17
- >
18
- <el-button type="primary" size="small" @click="saveConfig">
19
- {{ $t('imatrixUIPublicModel.sure') }}
20
- </el-button>
21
- <el-button size="small" @click="resetConfig">
22
- {{ $t('imatrixUIPublicModel.reset') }}
23
- </el-button>
24
- <el-button size="small" @click="$emit('close')">
25
- {{ $t('imatrixUIPublicModel.cancel') }}
26
- </el-button>
27
- <span v-if="isDragColumn" style="padding-left:10px;color:red">({{ $t('superGrid.dragColumnOrderMessage') }})</span>
28
- </div>
29
- <el-table v-if="hasLoaded" :data="columns" max-height="450" class="custom-config-elTable">
30
- <el-table-column property="label" :label="$t('superGrid.label')" width="220">
31
- <template slot-scope="scope">
32
- <span class="ellipsis cell--span" :title="scope.row.label">{{ scope.row.label }}</span>
33
- </template>
34
- </el-table-column>
35
- <el-table-column property="showType" :label="$t('superGrid.isShow')" width="120">
36
- <template slot-scope="scope">
37
- <el-select v-model="scope.row.showType" :disabled="isDisabledShow(scope.row)" @change="changeShow(scope.row, $event)">
38
- <el-option
39
- :label="isDisabledShow(scope.row)?$t('superGrid.default'):$t('superGrid.show')"
40
- value="default"
41
- />
42
- <el-option
43
- :label="$t('superGrid.hidden')"
44
- value="false"
45
- />
46
- </el-select>
47
- </template>
48
- </el-table-column>
49
- <el-table-column property="exportType" :label="$t('superGrid.isExportable')" width="120">
50
- <template slot-scope="scope">
51
- <el-select v-model="scope.row.exportType" :disabled="isDisabledExport(scope.row)" @change="changeExport(scope.row, $event)">
52
- <el-option
53
- :label="isDisabledExport(scope.row)?$t('superGrid.default'):$t('superGrid.export')"
54
- value="default"
55
- />
56
- <el-option
57
- :label="$t('superGrid.unExport')"
58
- value="false"
59
- />
60
- </el-select>
61
- </template>
62
- </el-table-column>
63
- <el-table-column v-if="isDragColumn" property="displayOrderType" :label="$t('superGrid.displayOrder')" width="120">
64
- <template slot-scope="scope">
65
- <el-input v-if="scope.row.displayOrderType && scope.row.displayOrderType === 'custom'" v-model="scope.row.displayOrder" clearable size="mini" @clear="clearDisplayOrder(scope.row)" />
66
- <el-select v-else v-model="scope.row.displayOrderType">
67
- <el-option
68
- :label="$t('superGrid.default')"
69
- value="default"
70
- />
71
- <el-option
72
- :label="$t('superGrid.custom')"
73
- value="custom"
74
- />
75
- </el-select>
76
- </template>
77
- </el-table-column>
78
- <el-table-column property="widthType" :label="$t('superGrid.width')" width="120">
79
- <template slot-scope="scope">
80
- <el-input v-if="scope.row.widthType && scope.row.widthType === 'custom'" v-model="scope.row.width" size="mini" clearable @clear="clearWidth(scope.row)" />
81
- <el-select v-else v-model="scope.row.widthType">
82
- <el-option
83
- :label="$t('superGrid.default')"
84
- value="default"
85
- />
86
- <el-option
87
- :label="$t('superGrid.custom')"
88
- value="custom"
89
- />
90
- </el-select>
91
- </template>
92
- </el-table-column>
93
- </el-table>
94
- </el-dialog>
95
- </template>
96
- <script>
97
- import Vue from 'vue'
98
- import store from './store'
99
- import Sortable from 'sortablejs'
100
- export default {
101
- name: 'ColumnsConfig',
102
- props: {
103
- listCode: {
104
- type: String,
105
- default: ''
106
- }
107
- },
108
- data() {
109
- return {
110
- columns: [],
111
- hasLoaded: false
112
- }
113
- },
114
- created() {
115
-
116
- },
117
- mounted() {
118
- this.listAllColumns().then((columns) => {
119
- this.columns = columns
120
- this.hasLoaded = true
121
- this.$nextTick(() => {
122
- this.dragColumnDisplayOrder()
123
- })
124
- })
125
- },
126
- methods: {
127
- isDisabledShow(row) {
128
- // 序号、复选框列不可以配置是否显示;占位符列不可以设置是否显示;当不是自定义的显示状态为false时,不可配置是否显示
129
- return (row.prop && (row.prop === '$index' || row.prop === '$selection')) ||
130
- row.custom === true || (row.showType && row.showType !== 'false' && row.show === false)
131
- },
132
- isDisabledExport(row) {
133
- // 序号、复选框列不可以配置是否导出;占位符列不可以设置是否导出;当不是自定义的导出状态为false时,不可配置是否导出
134
- return (row.prop && (row.prop === '$index' || row.prop === '$selection')) ||
135
- row.custom === true || (row.exportType && row.exportType !== 'false' && row.exportable === false)
136
- },
137
- changeShow(row, value) {
138
- if (value !== undefined && value === 'false') {
139
- row.show = false
140
- } else {
141
- row.show = true
142
- }
143
- },
144
- changeExport(row, value) {
145
- if (value !== undefined && value === 'false') {
146
- row.exportable = false
147
- } else {
148
- row.exportable = true
149
- }
150
- },
151
- saveConfig() {
152
- const params = {
153
- 'settingColumns': this.columns,
154
- 'listCode': this.listCode
155
- }
156
- this.$http.post(Vue.prototype.baseAPI + '/component/super-grids/setting-columns', params).then(data => {
157
- this.$message({
158
- type: 'success',
159
- message: this.$t('imatrixUIMessage.saveSuccessfully'),
160
- showClose: true
161
- })
162
- this.$emit('close', true)
163
- })
164
- },
165
- resetConfig() {
166
- this.$confirm(this.$t('superGrid.whetherToConfirmReset'), this.$t('imatrixUIMessage.tips'), {
167
- confirmButtonText: this.$t('imatrixUIPublicModel.sure'),
168
- cancelButtonText: this.$t('imatrixUIPublicModel.cancel'),
169
- type: 'warning'
170
- }).then(() => {
171
- const url = Vue.prototype.baseAPI + '/component/super-grids/reset-columns/' + this.listCode
172
- this.$http.delete(url).then(() => {
173
- this.$message({
174
- type: 'success',
175
- message: this.$t('superGrid.resetSuccessful'),
176
- showClose: true
177
- })
178
- this.listAllColumns().then((columns) => {
179
- this.columns = columns
180
- this.$emit('reset', true)
181
- })
182
- })
183
- })
184
- },
185
- listAllColumns() {
186
- return new Promise((resolve, reject) => {
187
- const url = Vue.prototype.baseAPI + '/component/super-grids/all-list-columns/' + this.listCode
188
- const gridParams = store.get(this.listCode)
189
- const params = {}
190
- const isSql = gridParams.isSql
191
- this.isDragColumn = gridParams.colSetting.isDragColumn
192
- if (typeof (isSql) !== 'undefined') {
193
- params.isSql = isSql + ''
194
- }
195
- this.$http.post(url, params).then(columns => {
196
- resolve(columns)
197
- }).catch(error => {
198
- reject(error)
199
- })
200
- })
201
- },
202
- clearDisplayOrder(row) {
203
- row.displayOrderType = 'default'
204
- },
205
- clearWidth(row) {
206
- row.widthType = 'default'
207
- },
208
- // 移动完成后的displayOrder设置
209
- indexAfterTheChangeUpdateDisplayOrder(dataList, oldIndex, newIndex, prop) {
210
- if (dataList && dataList.length > 0) {
211
- if (oldIndex != null && oldIndex !== undefined && oldIndex !== -1) {
212
- if (newIndex !== null && newIndex !== undefined && newIndex !== -1) {
213
- if (prop && prop !== '') {
214
- const selectCol = dataList[newIndex]
215
- selectCol.displayOrderType = 'custom'
216
- if (newIndex > oldIndex) {
217
- // 表示向后移动
218
- // 位置已经移动,所以参数要赋值给原始位置的下一个
219
- const afProp = dataList[newIndex - 1][prop]
220
- const arr = dataList.slice(oldIndex, newIndex)
221
- if (arr && arr.length > 0) {
222
- for (let i = arr.length - 1; i > -1; i--) {
223
- const col = arr[i]
224
- col.displayOrderType = 'custom'
225
- if (i === 0) {
226
- // 紧靠原始位置的上一个
227
- col[prop] = selectCol[prop]
228
- } else {
229
- col[prop] = arr[i - 1][prop]
230
- }
231
- }
232
- }
233
- selectCol[prop] = afProp
234
- } else {
235
- const befProp = dataList[newIndex + 1][prop]
236
- // 表示向前移动
237
- // 位置已经移动,所以参数要赋值给原始位置的上一个
238
- const arr = dataList.slice(newIndex + 1, oldIndex + 1)
239
- if (arr && arr.length > 0) {
240
- for (let i = 0; i < arr.length; i++) {
241
- const col = arr[i]
242
- col.displayOrderType = 'custom'
243
- if (i === arr.length - 1) {
244
- // 紧靠原始位置的上一个
245
- col[prop] = selectCol[prop]
246
- } else {
247
- col[prop] = arr[i + 1][prop]
248
- }
249
- }
250
- }
251
- selectCol[prop] = befProp
252
- }
253
- }
254
- }
255
- }
256
- }
257
- },
258
- // 拖动列顺序
259
- dragColumnDisplayOrder() {
260
- if (!this.isDragColumn) {
261
- return
262
- }
263
- return new Promise((resolve, reject) => {
264
- const tbody = document.querySelector('.custom-config-elTable .el-table__body-wrapper tbody')
265
- if (tbody != null) {
266
- const vm = this
267
- Sortable.create(tbody, {
268
- onEnd({ newIndex, oldIndex }) {
269
- if (oldIndex !== null && oldIndex !== undefined && oldIndex !== -1 && newIndex !== null && newIndex !== undefined && newIndex !== -1) {
270
- if (oldIndex > newIndex) {
271
- // 从后往前
272
- if (vm.columns && vm.columns.length > 0) {
273
- const item = vm.columns[oldIndex]
274
- for (var i = oldIndex - 1; i >= newIndex; i--) {
275
- const col = vm.columns[i]
276
- col.displayOrderType = 'custom'
277
- vm.columns[i + 1] = col
278
- }
279
- vm.columns[newIndex] = item
280
- }
281
- } else {
282
- // 从前往后
283
- if (vm.columns && vm.columns.length > 0) {
284
- const item = vm.columns[oldIndex]
285
- for (var k = oldIndex + 1; k <= newIndex; k++) {
286
- const col = vm.columns[k]
287
- col.displayOrderType = 'custom'
288
- vm.columns[k - 1] = col
289
- }
290
- vm.columns[newIndex] = item
291
- }
292
- }
293
- }
294
- console.log('config拖动字段', vm.columns)
295
- console.log('config拖动字段oldIndex', oldIndex)
296
- console.log('config拖动字段newIndex', newIndex)
297
- vm.hasLoaded = false
298
- setTimeout(function() {
299
- vm.hasLoaded = true
300
- vm.$nextTick(() => {
301
- vm.indexAfterTheChangeUpdateDisplayOrder(vm.columns, oldIndex, newIndex, 'displayOrder')
302
- vm.dragColumnDisplayOrder()
303
- })
304
- }, 100)
305
-
306
- // vm.hasLoaded = false
307
- // // 添加setTimeout是解决拖动顺序后数组columns值改变了,但是列表没有重新渲染问题
308
- // setTimeout(function() {
309
- // vm.hasLoaded = true
310
- // vm.$nextTick(() => {
311
- // vm.dragColumnDisplayOrder()
312
- // })
313
- // const currentColumn = vm.columns[oldIndex]
314
- // const targetColumn = vm.columns[newIndex]
315
- // const currentDisplayOrder = currentColumn.displayOrder
316
- // const targetDisplayOrder = targetColumn.displayOrder
317
- // vm.columns.splice(oldIndex, 1)
318
- // vm.columns.splice(newIndex, 0, currentColumn)
319
- // vm.$set(currentColumn, 'displayOrder', targetDisplayOrder)
320
- // vm.$set(currentColumn, 'displayOrderType', 'custom')
321
- // vm.$set(targetColumn, 'displayOrder', currentDisplayOrder)
322
- // vm.$set(targetColumn, 'displayOrderType', 'custom')
323
- // vm.hasLoaded = true
324
- // vm.$nextTick(() => {
325
- // vm.dragColumnDisplayOrder()
326
- // })
327
- // }, 100)
328
- }
329
- })
330
- }
331
- })
332
- }
333
- }
334
- }
335
- </script>
@@ -1,250 +0,0 @@
1
- import Vue from 'vue'
2
- import {
3
- doFormat
4
- } from './formatter'
5
- import store from './store'
6
- import {
7
- initialization,
8
- jumpToPage
9
- } from '../../../src/utils/jump-page-utils'
10
- import {
11
- analysisFileSetObj, otherFilesToStandard
12
- } from './utils'
13
- const customFormatter = {
14
- /**
15
- * 自定义格式化值
16
- * @param {prop} 属性名
17
- * @param {formatValue} 格式化后的值
18
- * @param {format} 格式化方法
19
- * @param {componentName} 组件名
20
- */
21
- customFormatValue(row, prop, format, rowIndex) {
22
- // const start = new Date().getTime()
23
- // console.log('---super-grid--customFormatValue--')
24
- if (this.customFormat) {
25
- let originalValue = row[prop]
26
- if (this.isObjectProp(prop)) {
27
- originalValue = this.objectPropOriginalValue(row, prop)
28
- }
29
- const formatValue = doFormat(this.column, originalValue)
30
- const component = format.call(this, originalValue, formatValue, row, this.column, rowIndex)
31
- if (typeof (component) === 'undefined') {
32
- return false
33
- } else {
34
- Vue.component(prop + rowIndex, component)
35
- }
36
-
37
- // const end = new Date().getTime()
38
- // console.log('---super-grid--customFormatValue--time1=', (end - start))
39
- return true
40
- } else {
41
- // const end = new Date().getTime()
42
- // console.log('---super-grid--customFormatValue--time2=', (end - start))
43
- return false
44
- }
45
- },
46
-
47
- isObjectProp(prop) {
48
- // const start = new Date().getTime()
49
- // console.log('---super-grid--isObjectProp--')
50
- if (prop && prop.indexOf('.') > 0) {
51
- // const end = new Date().getTime()
52
- // console.log('---super-grid--isObjectProp--time1=', (end - start))
53
- return true
54
- } else {
55
- // const end = new Date().getTime()
56
- // console.log('---super-grid--isObjectProp--time2=', (end - start))
57
- return false
58
- }
59
- },
60
-
61
- objectPropOriginalValue(row, prop) {
62
- try {
63
- // console.log('---super-grid--objectPropOriginalValue--')
64
- let objValue = row
65
- if (prop && prop.indexOf('.') > 0) {
66
- const props = prop.split('.')
67
- props.forEach(subProp => {
68
- if (objValue) {
69
- objValue = objValue[subProp]
70
- } else {
71
- objValue = ''
72
- throw objValue
73
- }
74
- })
75
- return objValue
76
- } else {
77
- return row[prop]
78
- }
79
- } catch (e) {
80
- // console.log(e)
81
- return ''
82
- }
83
- },
84
-
85
- objectPropValue(row, prop) {
86
- return this.formatter(row, prop, this.column)
87
- },
88
- // 获取显示的值
89
- // 附件类型,显示值与实际值不相同。如果时子表多选,需要单独判断
90
- objectPropValueTwo(row, column) {
91
- if (column.componentType === 'annex' || column.componentType === 'multipartUpload') {
92
- // 判断是否是对象集合(子表存储)
93
- const fileSetObj = JSON.parse(column.fileSet)
94
- if (fileSetObj.childAnnexDataTableCode) {
95
- // 获取存好的json并解析
96
- const keyValueParam = analysisFileSetObj(fileSetObj, this.isSql)
97
- // 子表存储。返回最后一个对象的展示名称
98
- const fileArr = this.objectPropValue(row, column.prop)
99
- if (fileArr && fileArr.length > 0) {
100
- const fileList = otherFilesToStandard(fileSetObj, keyValueParam, fileArr, null)
101
- return fileList[fileList.length - 1].showName
102
- }
103
- } else {
104
- return this.objectPropValue(row, column.prop)
105
- }
106
- } else if (column.formatter && column.formatter.type === 'files') {
107
- // 判断是否是对象集合(子表存储)
108
- const fileSetObj = JSON.parse(column.formatter.options.fileSet)
109
- if (fileSetObj.childAnnexDataTableCode) {
110
- // 获取存好的json并解析
111
- const keyValueParam = analysisFileSetObj(fileSetObj, this.isSql)
112
- // 子表存储。返回最后一个对象的展示名称
113
- const fileArr = this.objectPropValue(row, column.prop)
114
- if (fileArr && fileArr.length > 0) {
115
- const fileList = otherFilesToStandard(fileSetObj, keyValueParam, fileArr, null)
116
- return fileList[fileList.length - 1].showName
117
- }
118
- } else {
119
- return this.objectPropValue(row, column.prop)
120
- }
121
- } else {
122
- return this.objectPropValue(row, column.prop)
123
- }
124
- },
125
- formatter(row, prop, column) {
126
- const cellValue = this.objectPropOriginalValue(row, prop)
127
- if (this.columnFormatter !== undefined && this.columnFormatter.type === 'custom') {
128
- // 自定义事件
129
- let funName
130
- if (this.columnFormatter.options && this.columnFormatter.options.format) {
131
- funName = this.columnFormatter.options.format
132
- }
133
- if (funName && funName !== null && funName !== '') {
134
- const gridParams = store.get(this.listCode)
135
- if (gridParams.options && gridParams.options['eventCallBack'] &&
136
- gridParams.options['eventCallBack'][funName] && typeof (gridParams.options['eventCallBack'][funName]) === 'function') {
137
- const param = {
138
- value: cellValue,
139
- row: row,
140
- column: this.column,
141
- prop: prop
142
- }
143
- return gridParams.options['eventCallBack'][funName].call(this, param)
144
- } else {
145
- return doFormat(column, cellValue)
146
- }
147
- } else {
148
- return doFormat(column, cellValue)
149
- }
150
- } else {
151
- return doFormat(column, cellValue)
152
- }
153
- },
154
- getColumnValue(row, column) {
155
- const prop = column.prop
156
- let originalValue = row[prop]
157
- if (this.isObjectProp(prop)) {
158
- originalValue = this.objectPropOriginalValue(row, prop)
159
- }
160
- const formatValue = doFormat(column, originalValue)
161
- return {
162
- originalValue,
163
- formatValue
164
- }
165
- },
166
- onClickFun(row, column, onClick, rowIndex) {
167
- const values = this.getColumnValue(row, column)
168
- onClick.call(this, values.originalValue, values.formatValue, row, column, rowIndex)
169
- },
170
- isShowButtonFun(row, column, isShowFun, rowIndex) {
171
- if (isShowFun === undefined) {
172
- return true
173
- }
174
- if (typeof (isShowFun) === 'function') {
175
- const values = this.getColumnValue(row, column)
176
- let isShow = isShowFun.call(this, values.originalValue, values.formatValue, row, column, rowIndex)
177
- if (isShow === undefined) {
178
- isShow = true
179
- }
180
- return isShow
181
- } else {
182
- return isShowFun
183
- }
184
- },
185
- // 超链接解析
186
- getHyperLinkSetting(column, row, isSql, additionalParamerter, contextParameter, tableName, listCode) {
187
- const gridParams = store.get(listCode)
188
- let parentFormData = null
189
- if (gridParams.options.extraParam && gridParams.options.extraParam.entityMap) {
190
- parentFormData = gridParams.options.extraParam.entityMap
191
- }
192
- let hyperLinkResult = {}
193
- let jumpPageJson
194
- if (column && column.formatter && column.formatter.options && column.formatter.options.format) {
195
- jumpPageJson = column.formatter.options.format
196
- }
197
- if (jumpPageJson && jumpPageJson !== '') {
198
- // 解析是否需要显示该超链接
199
- const result = initialization(JSON.parse(jumpPageJson), row, isSql, additionalParamerter, contextParameter, tableName, parentFormData)
200
- // console.log('getHyperLinkSetting--resut=', result)
201
- if (result && result.label && result.label !== '') {
202
- console.log('label存在')
203
- } else {
204
- result.label = this.objectPropValueTwo(row, column)
205
- }
206
- if (result && result.title && result.title !== '') {
207
- console.log('title存在')
208
- } else {
209
- result.title = result.label
210
- }
211
- hyperLinkResult = result
212
- } else {
213
- // 表示显示超链接
214
- hyperLinkResult.visible = true
215
- hyperLinkResult.label = this.objectPropValueTwo(row, column)
216
- hyperLinkResult.title = hyperLinkResult.label
217
- }
218
- return hyperLinkResult
219
- },
220
- // 点击超链接
221
- clickHyperLink(column, row, listCode, rowIndex) {
222
- let jumpPageJson
223
- if (column && column.formatter && column.formatter.options && column.formatter.options.format) {
224
- jumpPageJson = column.formatter.options.format
225
- }
226
- if (jumpPageJson && jumpPageJson !== '') {
227
- // 解析是否需要显示该超链接
228
- const gridParams = store.get(listCode)
229
- let parentFormData = null
230
- if (gridParams.options.extraParam && gridParams.options.extraParam.entityMap) {
231
- parentFormData = gridParams.options.extraParam.entityMap
232
- }
233
- console.log('ridParams.options.extraParam.entityMap', gridParams.options.extraParam)
234
- jumpToPage(JSON.parse(jumpPageJson), gridParams.system, row.id ? row.id : row.ID, row, gridParams.additionalParamMap, null, null, parentFormData).then((openPageParams) => {
235
- console.log('clickHyperLink--openPageParams===', openPageParams)
236
- if (openPageParams) {
237
- // 点击列表组件中某元素弹出的页面
238
- openPageParams._position = 'list'
239
- openPageParams._listCode = listCode
240
- openPageParams._rowIndex = rowIndex
241
- // 行编辑的记录
242
- openPageParams.row = row
243
- // 通知父页面弹出页面
244
- this.$emit('open-page', openPageParams)
245
- }
246
- })
247
- }
248
- }
249
- }
250
- export default customFormatter