imatrix-ui 2.9.15-dw-tmp2 → 2.9.16-boe10

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 (194) 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/assets/nonemessage.png +0 -0
  6. package/src/i18n/i18n.js +1 -1
  7. package/src/i18n/langs/cn.js +18 -6
  8. package/src/i18n/langs/en.js +20 -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/message.scss +8 -0
  26. package/src/styles/theme/dark-blue/radio.scss +13 -0
  27. package/src/styles/theme/dark-blue/sidebar.scss +7 -37
  28. package/src/styles/theme/dark-blue/tab.scss +4 -1
  29. package/src/styles/theme/dark-blue/table.scss +1 -1
  30. package/src/styles/theme/dark-blue/tree.scss +35 -10
  31. package/src/styles/theme/gray/card-style.scss +13 -1
  32. package/src/styles/theme/gray/font-style.scss +38 -0
  33. package/src/styles/theme/gray/index.scss +13 -25
  34. package/src/styles/theme/gray/scrollbar-style.scss +32 -0
  35. package/src/styles/theme/gray/sidebar.scss +7 -14
  36. package/src/utils/auth-api.js +47 -1
  37. package/src/utils/common-util.js +22 -81
  38. package/src/utils/jump-page-utils.js +8 -10
  39. package/src/utils/range-selector.js +185 -0
  40. package/src/utils/request.js +6 -3
  41. package/src/utils/util.js +13 -11
  42. package/src/utils/workflow-util.js +3 -0
  43. package/src/views/dsc-component/Sidebar/Item.vue +7 -5
  44. package/src/views/dsc-component/Sidebar/SidebarItem.vue +2 -3
  45. package/src/views/dsc-component/Sidebar/index.vue +12 -20
  46. package/src/views/dsc-component/tabs/tab-content.vue +8 -9
  47. package/src/views/layout/EmptyLayout.vue +4 -1
  48. package/src/views/layout/NewLayout.vue +6 -65
  49. package/src/views/layout/components/AppMain.vue +2 -1
  50. package/src/views/layout/components/Menubar/Item.vue +23 -7
  51. package/src/views/layout/components/Menubar/Link.vue +11 -2
  52. package/src/views/layout/components/Menubar/SidebarItem.vue +50 -7
  53. package/src/views/layout/components/Menubar/index.vue +51 -16
  54. package/src/views/layout/components/tabs/tab-content.vue +162 -0
  55. package/src/views/layout/tab-content-iframe-index.vue +31 -0
  56. package/src/views/layout/tab-content-index.vue +85 -0
  57. package/src/views/login/index.vue +1 -1
  58. package/packages/breadcrumb/index.js +0 -6
  59. package/packages/breadcrumb/src/breadcrumb.vue +0 -71
  60. package/packages/department-tree/index.js +0 -6
  61. package/packages/department-tree/src/department-tree.vue +0 -108
  62. package/packages/department-tree-inline/index.js +0 -6
  63. package/packages/department-tree-inline/src/department-multi-tree-inline.vue +0 -408
  64. package/packages/department-tree-inline/src/department-single-tree-inline.vue +0 -290
  65. package/packages/department-tree-inline/src/department-tree-inline.vue +0 -86
  66. package/packages/department-tree-inline/src/department-tree-service.js +0 -273
  67. package/packages/department-tree-inline/src/search-result.vue +0 -176
  68. package/packages/department-user-tree/index.js +0 -6
  69. package/packages/department-user-tree/src/department-user-multiple-tree.vue +0 -116
  70. package/packages/department-user-tree/src/department-user-single-tree.vue +0 -76
  71. package/packages/department-user-tree/src/department-user-tree.vue +0 -101
  72. package/packages/department-user-tree-inline/index.js +0 -6
  73. package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +0 -636
  74. package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +0 -271
  75. package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +0 -79
  76. package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +0 -248
  77. package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +0 -142
  78. package/packages/department-user-tree-inline/src/search-result.vue +0 -197
  79. package/packages/directives/prevent-reclick.js +0 -19
  80. package/packages/dynamic-source-select/index.js +0 -6
  81. package/packages/dynamic-source-select/src/dynamic-source-select-service.js +0 -70
  82. package/packages/dynamic-source-select/src/dynamic-source-select.vue +0 -440
  83. package/packages/dynamic-source-select/src/events.js +0 -55
  84. package/packages/fs-preview/index.js +0 -6
  85. package/packages/fs-preview/src/fs-preview.vue +0 -226
  86. package/packages/fs-upload/index.js +0 -6
  87. package/packages/fs-upload/src/fs-upload-multi.vue +0 -420
  88. package/packages/fs-upload/src/fs-upload-single.vue +0 -312
  89. package/packages/fs-upload/src/fs-upload.vue +0 -189
  90. package/packages/fs-upload/src/see-big-picture.vue +0 -55
  91. package/packages/fs-upload-list/index.js +0 -6
  92. package/packages/fs-upload-list/src/fs-upload-list.vue +0 -287
  93. package/packages/hamburger/index.js +0 -6
  94. package/packages/hamburger/src/hamburger.vue +0 -38
  95. package/packages/index.js +0 -121
  96. package/packages/multipart-upload/index.js +0 -6
  97. package/packages/multipart-upload/src/index.vue +0 -73
  98. package/packages/multipart-upload/src/multipart-upload-form.vue +0 -297
  99. package/packages/multipart-upload/src/multipart-upload-list.vue +0 -378
  100. package/packages/organization-input/index.js +0 -6
  101. package/packages/organization-input/src/organization-input.vue +0 -542
  102. package/packages/plugins/export-data-new.js +0 -466
  103. package/packages/plugins/export-data.js +0 -361
  104. package/packages/plugins/index.js +0 -15
  105. package/packages/plugins/public-method.js +0 -43
  106. package/packages/remove-department/index.js +0 -6
  107. package/packages/remove-department/src/remove-department.vue +0 -172
  108. package/packages/remove-department/src/remove-dept-service.js +0 -20
  109. package/packages/remove-user/index.js +0 -6
  110. package/packages/remove-user/src/remove-user-service.js +0 -20
  111. package/packages/remove-user/src/remove-user.vue +0 -195
  112. package/packages/remove-workgroup/index.js +0 -6
  113. package/packages/remove-workgroup/src/remove-workgroup-service.js +0 -20
  114. package/packages/remove-workgroup/src/remove-workgroup.vue +0 -159
  115. package/packages/rich-editor/index.js +0 -7
  116. package/packages/rich-editor/index.vue +0 -278
  117. package/packages/rich-editor/langs/zh-Hans.js +0 -1
  118. package/packages/rich-editor/viewer.vue +0 -103
  119. package/packages/scan-code-input/index.js +0 -6
  120. package/packages/scan-code-input/src/events.js +0 -33
  121. package/packages/scan-code-input/src/scan-code-input-colse.vue +0 -131
  122. package/packages/scan-code-input/src/scan-code-input.vue +0 -116
  123. package/packages/secret-info/index.js +0 -7
  124. package/packages/secret-info/index.vue +0 -90
  125. package/packages/super-grid/index.js +0 -7
  126. package/packages/super-grid/src/apis.js +0 -820
  127. package/packages/super-grid/src/columns-config.vue +0 -335
  128. package/packages/super-grid/src/custom-formatter.js +0 -278
  129. package/packages/super-grid/src/dynamic-input.vue +0 -1279
  130. package/packages/super-grid/src/eventBus.js +0 -2
  131. package/packages/super-grid/src/events.js +0 -55
  132. package/packages/super-grid/src/formValidatorUtil.js +0 -226
  133. package/packages/super-grid/src/formatter.js +0 -181
  134. package/packages/super-grid/src/group-column.vue +0 -100
  135. package/packages/super-grid/src/header-context-menu.vue +0 -87
  136. package/packages/super-grid/src/index-column.vue +0 -51
  137. package/packages/super-grid/src/normal-column.vue +0 -771
  138. package/packages/super-grid/src/public-methods.js +0 -31
  139. package/packages/super-grid/src/row-operation.vue +0 -161
  140. package/packages/super-grid/src/search-button.vue +0 -66
  141. package/packages/super-grid/src/search-condition-input.vue +0 -61
  142. package/packages/super-grid/src/search-condition-list.vue +0 -59
  143. package/packages/super-grid/src/search-form-advancedQuery.vue +0 -653
  144. package/packages/super-grid/src/search-form-dialog.vue +0 -79
  145. package/packages/super-grid/src/search-form-item.vue +0 -404
  146. package/packages/super-grid/src/search-form-number.vue +0 -38
  147. package/packages/super-grid/src/search-form-open.vue +0 -170
  148. package/packages/super-grid/src/search-form-ordinarySearch.vue +0 -196
  149. package/packages/super-grid/src/search-form.vue +0 -642
  150. package/packages/super-grid/src/search-methods.js +0 -448
  151. package/packages/super-grid/src/selection-column.vue +0 -43
  152. package/packages/super-grid/src/store.js +0 -3
  153. package/packages/super-grid/src/super-grid-service.js +0 -593
  154. package/packages/super-grid/src/super-grid.vue +0 -2882
  155. package/packages/super-grid/src/utils.js +0 -762
  156. package/packages/super-grid/src/view-image-dialog.vue +0 -130
  157. package/packages/super-nine-grid/index.js +0 -7
  158. package/packages/super-nine-grid/src/apis.js +0 -103
  159. package/packages/super-nine-grid/src/custom-formatter.js +0 -66
  160. package/packages/super-nine-grid/src/formatter.js +0 -132
  161. package/packages/super-nine-grid/src/search-form-number.vue +0 -38
  162. package/packages/super-nine-grid/src/search-form.vue +0 -430
  163. package/packages/super-nine-grid/src/search-methods.js +0 -134
  164. package/packages/super-nine-grid/src/store.js +0 -3
  165. package/packages/super-nine-grid/src/super-grid-service.js +0 -91
  166. package/packages/super-nine-grid/src/super-nine-grid.vue +0 -872
  167. package/packages/super-nine-grid/src/utils.js +0 -261
  168. package/packages/svg-icon/index.js +0 -6
  169. package/packages/svg-icon/src/svg-icon.vue +0 -43
  170. package/packages/utils/memory-cache-utils.js +0 -90
  171. package/packages/utils/utils.js +0 -152
  172. package/packages/utils/value-set.js +0 -86
  173. package/packages/valid-code/index.js +0 -7
  174. package/packages/valid-code/src/valid-code.vue +0 -95
  175. package/packages/workflow-button/index.js +0 -6
  176. package/packages/workflow-button/src/workflow-button.vue +0 -325
  177. package/packages/workflow-history-list/index.js +0 -6
  178. package/packages/workflow-history-list/src/api.js +0 -7
  179. package/packages/workflow-history-list/src/workflow-history-list.vue +0 -185
  180. package/packages/workgroup-tree/index.js +0 -6
  181. package/packages/workgroup-tree/src/workgroup-tree.vue +0 -76
  182. package/packages/workgroup-tree-inline/index.js +0 -6
  183. package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +0 -317
  184. package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +0 -43
  185. package/packages/workgroup-user-tree/index.js +0 -6
  186. package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +0 -100
  187. package/packages/workgroup-user-tree-inline/index.js +0 -6
  188. package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +0 -163
  189. package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +0 -436
  190. package/packages/year-range-picker/index.js +0 -6
  191. package/packages/year-range-picker/src/year-range-picker.vue +0 -51
  192. package/report.20190716.140129.216348.001.json +0 -354
  193. package/src/index.js +0 -93
  194. 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,278 +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
- import { isPromise } from '../../../src/utils/common-util'
14
- const customFormatter = {
15
- /**
16
- * 自定义格式化值
17
- * @param {prop} 属性名
18
- * @param {formatValue} 格式化后的值
19
- * @param {format} 格式化方法
20
- * @param {componentName} 组件名
21
- */
22
- customFormatValue(row, prop, format, rowIndex) {
23
- // const start = new Date().getTime()
24
- // console.log('---super-grid--customFormatValue--')
25
- if (this.customFormat) {
26
- let originalValue = row[prop]
27
- if (this.isObjectProp(prop)) {
28
- originalValue = this.objectPropOriginalValue(row, prop)
29
- }
30
- const formatValue = doFormat(this.column, originalValue)
31
- const component = format.call(this, originalValue, formatValue, row, this.column, rowIndex)
32
- if (typeof (component) === 'undefined') {
33
- return false
34
- } else {
35
- Vue.component(prop + rowIndex, component)
36
- }
37
-
38
- // const end = new Date().getTime()
39
- // console.log('---super-grid--customFormatValue--time1=', (end - start))
40
- return true
41
- } else {
42
- // const end = new Date().getTime()
43
- // console.log('---super-grid--customFormatValue--time2=', (end - start))
44
- return false
45
- }
46
- },
47
-
48
- isObjectProp(prop) {
49
- // const start = new Date().getTime()
50
- // console.log('---super-grid--isObjectProp--')
51
- if (prop && prop.indexOf('.') > 0) {
52
- // const end = new Date().getTime()
53
- // console.log('---super-grid--isObjectProp--time1=', (end - start))
54
- return true
55
- } else {
56
- // const end = new Date().getTime()
57
- // console.log('---super-grid--isObjectProp--time2=', (end - start))
58
- return false
59
- }
60
- },
61
-
62
- objectPropOriginalValue(row, prop) {
63
- try {
64
- // console.log('---super-grid--objectPropOriginalValue--')
65
- let objValue = row
66
- if (prop && prop.indexOf('.') > 0) {
67
- const props = prop.split('.')
68
- props.forEach(subProp => {
69
- if (objValue) {
70
- objValue = objValue[subProp]
71
- } else {
72
- objValue = ''
73
- throw objValue
74
- }
75
- })
76
- return objValue
77
- } else {
78
- return row[prop]
79
- }
80
- } catch (e) {
81
- // console.log(e)
82
- return ''
83
- }
84
- },
85
-
86
- objectPropValue(row, prop) {
87
- return this.formatter(row, prop, this.column)
88
- },
89
- // 获取显示的值
90
- // 附件类型,显示值与实际值不相同。如果时子表多选,需要单独判断
91
- objectPropValueTwo(row, column) {
92
- if (column.componentType === 'annex' || column.componentType === 'multipartUpload') {
93
- // 判断是否是对象集合(子表存储)
94
- const fileSetObj = JSON.parse(column.fileSet)
95
- if (fileSetObj.childAnnexDataTableCode) {
96
- // 获取存好的json并解析
97
- const keyValueParam = analysisFileSetObj(fileSetObj, this.isSql)
98
- // 子表存储。返回最后一个对象的展示名称
99
- const fileArr = this.objectPropValue(row, column.prop)
100
- if (fileArr && fileArr.length > 0) {
101
- const fileList = otherFilesToStandard(fileSetObj, keyValueParam, fileArr, null)
102
- return fileList[fileList.length - 1].showName
103
- }
104
- } else {
105
- return this.objectPropValue(row, column.prop)
106
- }
107
- } else if (column.formatter && column.formatter.type === 'files') {
108
- // 判断是否是对象集合(子表存储)
109
- const fileSetObj = JSON.parse(column.formatter.options.fileSet)
110
- if (fileSetObj.childAnnexDataTableCode) {
111
- // 获取存好的json并解析
112
- const keyValueParam = analysisFileSetObj(fileSetObj, this.isSql)
113
- // 子表存储。返回最后一个对象的展示名称
114
- const fileArr = this.objectPropValue(row, column.prop)
115
- if (fileArr && fileArr.length > 0) {
116
- const fileList = otherFilesToStandard(fileSetObj, keyValueParam, fileArr, null)
117
- return fileList[fileList.length - 1].showName
118
- }
119
- } else {
120
- return this.objectPropValue(row, column.prop)
121
- }
122
- } else {
123
- return this.objectPropValue(row, column.prop)
124
- }
125
- },
126
- formatter(row, prop, column) {
127
- const cellValue = this.objectPropOriginalValue(row, prop)
128
- if (this.columnFormatter !== undefined && this.columnFormatter.type === 'custom') {
129
- // 自定义事件
130
- let funName
131
- if (this.columnFormatter.options && this.columnFormatter.options.format) {
132
- funName = this.columnFormatter.options.format
133
- }
134
- if (funName && funName !== null && funName !== '') {
135
- const gridParams = store.get(this.listCode)
136
- if (gridParams.options && gridParams.options['eventCallBack'] &&
137
- gridParams.options['eventCallBack'][funName] && typeof (gridParams.options['eventCallBack'][funName]) === 'function') {
138
- const param = {
139
- value: cellValue,
140
- row: row,
141
- column: this.column,
142
- prop: prop
143
- }
144
- return gridParams.options['eventCallBack'][funName].call(this, param)
145
- } else {
146
- return doFormat(column, cellValue)
147
- }
148
- } else {
149
- return doFormat(column, cellValue)
150
- }
151
- } else {
152
- return doFormat(column, cellValue)
153
- }
154
- },
155
- getColumnValue(row, column) {
156
- const prop = column.prop
157
- let originalValue = row[prop]
158
- if (this.isObjectProp(prop)) {
159
- originalValue = this.objectPropOriginalValue(row, prop)
160
- }
161
- const formatValue = doFormat(column, originalValue)
162
- return {
163
- originalValue,
164
- formatValue
165
- }
166
- },
167
- onClickFun(row, column, onClick, rowIndex) {
168
- const values = this.getColumnValue(row, column)
169
- onClick.call(this, values.originalValue, values.formatValue, row, column, rowIndex)
170
- },
171
- isShowButtonFun(row, column, isShowFun, rowIndex) {
172
- if (isShowFun === undefined) {
173
- return true
174
- }
175
- if (typeof (isShowFun) === 'function') {
176
- const values = this.getColumnValue(row, column)
177
- let isShow = isShowFun.call(this, values.originalValue, values.formatValue, row, column, rowIndex)
178
- if (isShow === undefined) {
179
- isShow = true
180
- }
181
- return isShow
182
- } else {
183
- return isShowFun
184
- }
185
- },
186
- // 超链接解析
187
- getHyperLinkSetting(column, row, isSql, additionalParamerter, contextParameter, tableName, listCode) {
188
- const gridParams = store.get(listCode)
189
- let parentFormData = null
190
- if (gridParams.options.extraParam && gridParams.options.extraParam.entityMap) {
191
- parentFormData = gridParams.options.extraParam.entityMap
192
- }
193
- let hyperLinkResult = {}
194
- let jumpPageJson
195
- if (column && column.formatter && column.formatter.options && column.formatter.options.format) {
196
- jumpPageJson = column.formatter.options.format
197
- }
198
- if (jumpPageJson && jumpPageJson !== '') {
199
- // 解析是否需要显示该超链接
200
- const result = initialization(JSON.parse(jumpPageJson), row, isSql, additionalParamerter, contextParameter, tableName, parentFormData)
201
- // console.log('getHyperLinkSetting--resut=', result)
202
- if (result && result.label && result.label !== '') {
203
- console.log('label存在')
204
- } else {
205
- result.label = this.objectPropValueTwo(row, column)
206
- }
207
- if (result && result.title && result.title !== '') {
208
- console.log('title存在')
209
- } else {
210
- result.title = result.label
211
- }
212
- hyperLinkResult = result
213
- } else {
214
- // 表示显示超链接
215
- hyperLinkResult.visible = true
216
- hyperLinkResult.label = this.objectPropValueTwo(row, column)
217
- hyperLinkResult.title = hyperLinkResult.label
218
- }
219
- return hyperLinkResult
220
- },
221
- // 点击超链接
222
- clickHyperLink(column, row, listCode, rowIndex) {
223
- let jumpPageJson
224
- if (column && column.formatter && column.formatter.options && column.formatter.options.format) {
225
- jumpPageJson = column.formatter.options.format
226
- }
227
- if (jumpPageJson && jumpPageJson !== '') {
228
- // 解析是否需要显示该超链接
229
- let canClick = true
230
- const gridParams = store.get(listCode)
231
- const jumpPageSetting = JSON.parse(jumpPageJson)
232
- console.log('gupre-grid---clickHyperLink--jumpPageSetting=', jumpPageSetting)
233
- if (jumpPageSetting.beforeClick) {
234
- const funName = jumpPageSetting.beforeClick
235
- console.log('gupre-grid---clickHyperLink--jumpPageSetting.beforeClick=', funName)
236
- console.log('gupre-grid---clickHyperLink--gridParams.options[eventCallBack]=', gridParams.options['eventCallBack'])
237
- if (gridParams.options && gridParams.options['eventCallBack'] &&
238
- gridParams.options['eventCallBack'][funName] && typeof (gridParams.options['eventCallBack'][funName]) === 'function') {
239
- const param = {
240
- row: row,
241
- column: column,
242
- rowIndex: rowIndex,
243
- listCode
244
- }
245
- canClick = gridParams.options['eventCallBack'][funName].call(this, param)
246
- }
247
- }
248
- if (isPromise(canClick)) {
249
- canClick.then((result) => {
250
- this.doClickHyperLink(row, listCode, rowIndex, jumpPageSetting, gridParams)
251
- })
252
- } else {
253
- this.doClickHyperLink(row, listCode, rowIndex, jumpPageSetting, gridParams)
254
- }
255
- }
256
- },
257
- doClickHyperLink(row, listCode, rowIndex, jumpPageSetting, gridParams) {
258
- let parentFormData = null
259
- if (gridParams.options.extraParam && gridParams.options.extraParam.entityMap) {
260
- parentFormData = gridParams.options.extraParam.entityMap
261
- }
262
- console.log('ridParams.options.extraParam.entityMap', gridParams.options.extraParam)
263
- jumpToPage(jumpPageSetting, gridParams.system, row.id ? row.id : row.ID, row, gridParams.additionalParamMap, null, null, parentFormData).then((openPageParams) => {
264
- console.log('clickHyperLink--openPageParams===', openPageParams)
265
- if (openPageParams) {
266
- // 点击列表组件中某元素弹出的页面
267
- openPageParams._position = 'list'
268
- openPageParams._listCode = listCode
269
- openPageParams._rowIndex = rowIndex
270
- // 行编辑的记录
271
- openPageParams.row = row
272
- // 通知父页面弹出页面
273
- this.$emit('open-page', openPageParams)
274
- }
275
- })
276
- }
277
- }
278
- export default customFormatter