imatrix-ui 2.8.21 → 2.8.22-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 (176) hide show
  1. package/lib/super-ui.css +1 -1
  2. package/lib/super-ui.umd.min.js +5 -5
  3. package/package.json +2 -2
  4. package/src/api/sso-service.js +19 -1
  5. package/src/i18n/langs/cn.js +13 -3
  6. package/src/i18n/langs/en.js +15 -4
  7. package/src/router/index.js +10 -0
  8. package/src/store/modules/tab-content.js +6 -0
  9. package/src/store/modules/user.js +19 -0
  10. package/src/styles/index.scss +72 -2
  11. package/src/styles/theme/black/font-style.scss +70 -0
  12. package/src/styles/theme/black/index.scss +6 -30
  13. package/src/styles/theme/blue/font-style.scss +37 -0
  14. package/src/styles/theme/blue/index.scss +2 -18
  15. package/src/styles/theme/blue2/font-style.scss +70 -0
  16. package/src/styles/theme/blue2/index.scss +3 -13
  17. package/src/styles/theme/dark-blue/index.scss +26 -5
  18. package/src/styles/theme/dark-blue/sidebar.scss +7 -37
  19. package/src/styles/theme/dark-blue/table.scss +1 -1
  20. package/src/styles/theme/gray/card-style.scss +13 -1
  21. package/src/styles/theme/gray/font-style.scss +38 -0
  22. package/src/styles/theme/gray/index.scss +13 -25
  23. package/src/styles/theme/gray/scrollbar-style.scss +32 -0
  24. package/src/styles/theme/gray/sidebar.scss +5 -0
  25. package/src/utils/auth-api.js +45 -1
  26. package/src/utils/common-util.js +11 -0
  27. package/src/utils/range-selector.js +185 -0
  28. package/src/utils/request.js +5 -2
  29. package/src/utils/util.js +7 -5
  30. package/src/views/dsc-component/Sidebar/Item.vue +4 -2
  31. package/src/views/dsc-component/Sidebar/SidebarItem.vue +1 -2
  32. package/src/views/dsc-component/Sidebar/index.vue +12 -20
  33. package/src/views/dsc-component/tabs/tab-content.vue +1 -5
  34. package/src/views/layout/NewLayout.vue +6 -65
  35. package/src/views/layout/components/Menubar/Item.vue +23 -7
  36. package/src/views/layout/components/Menubar/Link.vue +11 -2
  37. package/src/views/layout/components/Menubar/SidebarItem.vue +50 -7
  38. package/src/views/layout/components/Menubar/index.vue +51 -16
  39. package/src/views/layout/components/tabs/tab-content.vue +160 -0
  40. package/src/views/layout/tab-content-iframe-index.vue +31 -0
  41. package/src/views/layout/tab-content-index.vue +85 -0
  42. package/packages/breadcrumb/index.js +0 -6
  43. package/packages/breadcrumb/src/breadcrumb.vue +0 -71
  44. package/packages/department-tree/index.js +0 -6
  45. package/packages/department-tree/src/department-tree.vue +0 -108
  46. package/packages/department-tree-inline/index.js +0 -6
  47. package/packages/department-tree-inline/src/department-multi-tree-inline.vue +0 -402
  48. package/packages/department-tree-inline/src/department-single-tree-inline.vue +0 -284
  49. package/packages/department-tree-inline/src/department-tree-inline.vue +0 -86
  50. package/packages/department-tree-inline/src/department-tree-service.js +0 -245
  51. package/packages/department-tree-inline/src/search-result.vue +0 -176
  52. package/packages/department-user-tree/index.js +0 -6
  53. package/packages/department-user-tree/src/department-user-multiple-tree.vue +0 -116
  54. package/packages/department-user-tree/src/department-user-single-tree.vue +0 -76
  55. package/packages/department-user-tree/src/department-user-tree.vue +0 -101
  56. package/packages/department-user-tree-inline/index.js +0 -6
  57. package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +0 -626
  58. package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +0 -269
  59. package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +0 -79
  60. package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +0 -230
  61. package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +0 -122
  62. package/packages/department-user-tree-inline/src/search-result.vue +0 -197
  63. package/packages/directives/prevent-reclick.js +0 -19
  64. package/packages/dynamic-source-select/index.js +0 -6
  65. package/packages/dynamic-source-select/src/dynamic-source-select-service.js +0 -70
  66. package/packages/dynamic-source-select/src/dynamic-source-select.vue +0 -440
  67. package/packages/dynamic-source-select/src/events.js +0 -55
  68. package/packages/fs-preview/index.js +0 -6
  69. package/packages/fs-preview/src/fs-preview.vue +0 -226
  70. package/packages/fs-upload/index.js +0 -6
  71. package/packages/fs-upload/src/fs-upload-multi.vue +0 -420
  72. package/packages/fs-upload/src/fs-upload-single.vue +0 -312
  73. package/packages/fs-upload/src/fs-upload.vue +0 -189
  74. package/packages/fs-upload/src/see-big-picture.vue +0 -55
  75. package/packages/fs-upload-list/index.js +0 -6
  76. package/packages/fs-upload-list/src/fs-upload-list.vue +0 -287
  77. package/packages/hamburger/index.js +0 -6
  78. package/packages/hamburger/src/hamburger.vue +0 -38
  79. package/packages/index.js +0 -121
  80. package/packages/multipart-upload/index.js +0 -6
  81. package/packages/multipart-upload/src/index.vue +0 -73
  82. package/packages/multipart-upload/src/multipart-upload-form.vue +0 -297
  83. package/packages/multipart-upload/src/multipart-upload-list.vue +0 -378
  84. package/packages/organization-input/index.js +0 -6
  85. package/packages/organization-input/src/organization-input.vue +0 -542
  86. package/packages/plugins/export-data-new.js +0 -453
  87. package/packages/plugins/export-data.js +0 -361
  88. package/packages/plugins/index.js +0 -15
  89. package/packages/plugins/public-method.js +0 -43
  90. package/packages/remove-department/index.js +0 -6
  91. package/packages/remove-department/src/remove-department.vue +0 -172
  92. package/packages/remove-department/src/remove-dept-service.js +0 -20
  93. package/packages/remove-user/index.js +0 -6
  94. package/packages/remove-user/src/remove-user-service.js +0 -20
  95. package/packages/remove-user/src/remove-user.vue +0 -195
  96. package/packages/remove-workgroup/index.js +0 -6
  97. package/packages/remove-workgroup/src/remove-workgroup-service.js +0 -20
  98. package/packages/remove-workgroup/src/remove-workgroup.vue +0 -159
  99. package/packages/rich-editor/index.js +0 -7
  100. package/packages/rich-editor/index.vue +0 -278
  101. package/packages/rich-editor/langs/zh-Hans.js +0 -1
  102. package/packages/rich-editor/viewer.vue +0 -103
  103. package/packages/scan-code-input/index.js +0 -6
  104. package/packages/scan-code-input/src/events.js +0 -33
  105. package/packages/scan-code-input/src/scan-code-input-colse.vue +0 -131
  106. package/packages/scan-code-input/src/scan-code-input.vue +0 -116
  107. package/packages/secret-info/index.js +0 -7
  108. package/packages/secret-info/index.vue +0 -90
  109. package/packages/super-grid/index.js +0 -7
  110. package/packages/super-grid/src/apis.js +0 -763
  111. package/packages/super-grid/src/columns-config.vue +0 -335
  112. package/packages/super-grid/src/custom-formatter.js +0 -250
  113. package/packages/super-grid/src/dynamic-input.vue +0 -1279
  114. package/packages/super-grid/src/eventBus.js +0 -2
  115. package/packages/super-grid/src/events.js +0 -55
  116. package/packages/super-grid/src/formValidatorUtil.js +0 -226
  117. package/packages/super-grid/src/formatter.js +0 -181
  118. package/packages/super-grid/src/group-column.vue +0 -100
  119. package/packages/super-grid/src/header-context-menu.vue +0 -87
  120. package/packages/super-grid/src/index-column.vue +0 -51
  121. package/packages/super-grid/src/normal-column.vue +0 -769
  122. package/packages/super-grid/src/public-methods.js +0 -31
  123. package/packages/super-grid/src/row-operation.vue +0 -161
  124. package/packages/super-grid/src/search-button.vue +0 -66
  125. package/packages/super-grid/src/search-condition-input.vue +0 -61
  126. package/packages/super-grid/src/search-condition-list.vue +0 -59
  127. package/packages/super-grid/src/search-form-advancedQuery.vue +0 -653
  128. package/packages/super-grid/src/search-form-dialog.vue +0 -79
  129. package/packages/super-grid/src/search-form-item.vue +0 -386
  130. package/packages/super-grid/src/search-form-number.vue +0 -38
  131. package/packages/super-grid/src/search-form-open.vue +0 -162
  132. package/packages/super-grid/src/search-form-ordinarySearch.vue +0 -188
  133. package/packages/super-grid/src/search-form.vue +0 -634
  134. package/packages/super-grid/src/search-methods.js +0 -387
  135. package/packages/super-grid/src/selection-column.vue +0 -43
  136. package/packages/super-grid/src/store.js +0 -3
  137. package/packages/super-grid/src/super-grid-service.js +0 -561
  138. package/packages/super-grid/src/super-grid.vue +0 -2793
  139. package/packages/super-grid/src/utils.js +0 -763
  140. package/packages/super-grid/src/view-image-dialog.vue +0 -130
  141. package/packages/super-nine-grid/index.js +0 -7
  142. package/packages/super-nine-grid/src/apis.js +0 -103
  143. package/packages/super-nine-grid/src/custom-formatter.js +0 -66
  144. package/packages/super-nine-grid/src/formatter.js +0 -132
  145. package/packages/super-nine-grid/src/search-form-number.vue +0 -38
  146. package/packages/super-nine-grid/src/search-form.vue +0 -430
  147. package/packages/super-nine-grid/src/search-methods.js +0 -134
  148. package/packages/super-nine-grid/src/store.js +0 -3
  149. package/packages/super-nine-grid/src/super-grid-service.js +0 -91
  150. package/packages/super-nine-grid/src/super-nine-grid.vue +0 -872
  151. package/packages/super-nine-grid/src/utils.js +0 -261
  152. package/packages/svg-icon/index.js +0 -6
  153. package/packages/svg-icon/src/svg-icon.vue +0 -43
  154. package/packages/utils/utils.js +0 -152
  155. package/packages/utils/value-set.js +0 -86
  156. package/packages/valid-code/index.js +0 -7
  157. package/packages/valid-code/src/valid-code.vue +0 -95
  158. package/packages/workflow-button/index.js +0 -6
  159. package/packages/workflow-button/src/workflow-button.vue +0 -325
  160. package/packages/workflow-history-list/index.js +0 -6
  161. package/packages/workflow-history-list/src/api.js +0 -7
  162. package/packages/workflow-history-list/src/workflow-history-list.vue +0 -185
  163. package/packages/workgroup-tree/index.js +0 -6
  164. package/packages/workgroup-tree/src/workgroup-tree.vue +0 -76
  165. package/packages/workgroup-tree-inline/index.js +0 -6
  166. package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +0 -317
  167. package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +0 -43
  168. package/packages/workgroup-user-tree/index.js +0 -6
  169. package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +0 -100
  170. package/packages/workgroup-user-tree-inline/index.js +0 -6
  171. package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +0 -163
  172. package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +0 -436
  173. package/packages/year-range-picker/index.js +0 -6
  174. package/packages/year-range-picker/src/year-range-picker.vue +0 -51
  175. package/src/index.js +0 -93
  176. package/src/styles/theme/gray/form-style.scss +0 -41
@@ -1,361 +0,0 @@
1
- import Vue from 'vue'
2
- import store from '../super-grid/src/store'
3
- import {
4
- getExtraParam
5
- } from '../super-grid/src/utils'
6
- import nineGridStore from '../super-nine-grid/src/store'
7
- import {
8
- Message
9
- } from 'element-ui'
10
- import {
11
- packageEnumAndBeanColumnValueSets
12
- } from '../utils/value-set'
13
- import {
14
- getI18n
15
- } from '../../src/utils/util'
16
- /**
17
- *
18
- * @param {*} dataParam
19
- * @param {*} excelName
20
- * @param {*} listCode 如果是九宫格组件导出时,如果页面中有多个九宫格时,该属性需要传“listCode~gridId”,例如:
21
- * @param {*} exportOptions
22
- */
23
- function exportData(dataParam, excelName, listCode, exportOptions) {
24
- return new Promise((resolve, reject) => {
25
- exportResultData(dataParam, excelName, listCode, exportOptions).then(result => {
26
- // 表示导出成功,需要执行导出成功回调方法
27
- if (isHasTheOption('afterExport', exportOptions) && typeof (exportOptions.afterExport) === 'function') {
28
- exportOptions.afterExport.call(this)
29
- }
30
- resolve(result)
31
- }).catch(error => {
32
- if (isHasTheOption('exportError', exportOptions) && typeof (exportOptions.exportError) === 'function') {
33
- exportOptions.exportError.call(this)
34
- }
35
- reject(error)
36
- })
37
- })
38
- }
39
- /**
40
- * 导出数据
41
- */
42
- function exportResultData(dataParam, excelName, listCode, exportOptions) {
43
- return new Promise((resolve, reject) => {
44
- let isCanExport = true
45
- if (isHasTheOption('beforeExport', exportOptions) && typeof (exportOptions.beforeExport) === 'function') {
46
- isCanExport = exportOptions.beforeExport.call(this)
47
- }
48
- if (!isCanExport) {
49
- resolve(false)
50
- } else {
51
- if (dataParam && dataParam.hasOwnProperty('data')) {
52
- // 导出选中行
53
- const result = {}
54
- result['_data'] = dataParam.data
55
- exportMyData(JSON.stringify(result), excelName, listCode).then((result) => {
56
- resolve(result)
57
- }).catch(error => {
58
- reject(error)
59
- })
60
- } else if (dataParam && dataParam.hasOwnProperty('url')) {
61
- // 导出url对应的数据
62
- exportUrlData(dataParam, excelName, listCode).then((result) => {
63
- resolve(result)
64
- }).catch(error => {
65
- reject(error)
66
- })
67
- } else {
68
- // 导出台账数据,有查询条件则导出查询条件对应的数据,没有查询条件则导出所有记录
69
- exportListData(excelName, listCode).then((result) => {
70
- resolve(result)
71
- }).catch(error => {
72
- reject(error)
73
- })
74
- }
75
- }
76
- })
77
- }
78
- // 导出的后台单独重写
79
- function exportUrlData(dataParam, excelName, listCode) {
80
- return new Promise((resolve, reject) => {
81
- const listCodeStore = getListCode(listCode)
82
- let param = getExportParamByGridParam(listCode)
83
- const url = dataParam.url
84
- if (dataParam.hasOwnProperty('param')) {
85
- param = Object.assign(param, dataParam.param)
86
- }
87
- Vue.prototype.$http.post(url, param).then(data => {
88
- let exportSheetData
89
- // console.log('data===', data)
90
- if (data instanceof Array) {
91
- // 是数组,表示返回的是list记录集合
92
- const result = {}
93
- // console.log('_data', data)
94
- result['_data'] = data
95
- exportSheetData = JSON.stringify(result)
96
- } else {
97
- // 表示返回的是{_data:{},_styles:{}}
98
- exportSheetData = JSON.stringify(data)
99
- }
100
- return exportMyData(exportSheetData, excelName, listCodeStore)
101
- }).then((result) => {
102
- resolve(result)
103
- }).catch(error => {
104
- reject(error)
105
- })
106
- })
107
- }
108
-
109
- function getListCode(listCode) {
110
- if (listCode !== null && listCode !== undefined && listCode !== '') {
111
- return listCode
112
- }
113
- let listCodeStore = listCode
114
- if (!listCode || listCode === null || listCode === '') {
115
- listCodeStore = store.get('_list_code')
116
- }
117
- if (listCodeStore === undefined || listCodeStore === null || listCodeStore === '') {
118
- listCodeStore = nineGridStore.get('_nine_list_code')
119
- if (listCodeStore && listCodeStore.indexOf('~') < 0) {
120
- // 拼接默认的九宫格gridId
121
- listCodeStore = listCodeStore + '~' + '_nineGrid'
122
- }
123
- }
124
- if (listCodeStore && listCodeStore.indexOf('~') > 0) {
125
- listCodeStore = listCodeStore.substring(0, listCodeStore.indexOf('~'))
126
- }
127
- return listCodeStore
128
- }
129
-
130
- function getGridParams(listCode) {
131
- let gridParams = null
132
- let listCodeStore = listCode
133
- if (!listCode || listCode === null || listCode === '') {
134
- listCodeStore = store.get('_list_code')
135
- }
136
- gridParams = store.get(listCodeStore)
137
- if (gridParams === undefined || gridParams === null) {
138
- if (!listCode || listCode === null || listCode === '') {
139
- listCodeStore = nineGridStore.get('_nine_list_code')
140
- }
141
- if (listCodeStore && listCodeStore.indexOf('~') < 0) {
142
- // 拼接默认的九宫格gridId
143
- listCodeStore = listCodeStore + '~' + '_nineGrid'
144
- }
145
- gridParams = nineGridStore.get(listCodeStore)
146
- }
147
- return gridParams
148
- }
149
-
150
- function getExportParamByGridParam(listCode) {
151
- let param = {}
152
- const gridParams = getGridParams(listCode)
153
- if (gridParams !== undefined && gridParams !== null) {
154
- const searchParam = Object.assign({}, gridParams.searchParam)
155
- const pagination = {
156
- 'currentPage': 1,
157
- 'pageSize': 99999999,
158
- 'showTotal': false
159
- }
160
- param = searchParam
161
- searchParam.pagination = pagination
162
- if (gridParams.options.extraParam) {
163
- // 当前有附加参数时,处理附加参数
164
- param = getExtraParam(searchParam, gridParams)
165
- }
166
- }
167
- return param
168
- }
169
- // 导出当前台账数据
170
- function exportListData(excelName, listCode) {
171
- return new Promise((resolve, reject) => {
172
- const gridParams = getGridParams(listCode)
173
- if (gridParams === undefined || gridParams === null) {
174
- reject('导出失败')
175
- } else {
176
- const param = getExportParamByGridParam(listCode)
177
- Vue.prototype.$http.post(gridParams.url, param).then(page => {
178
- let data = page.data
179
- if (!data) {
180
- data = []
181
- }
182
- const result = {}
183
- result['_data'] = data
184
- return exportMyData(JSON.stringify(result), excelName, listCode)
185
- }).then((result) => {
186
- resolve(result)
187
- }).catch(error => {
188
- reject(error)
189
- })
190
- }
191
- })
192
- }
193
-
194
- function exportMyData(data, excelName, listCode) {
195
- return new Promise((resolve, reject) => {
196
- const gridParams = getGridParams(listCode)
197
- if (gridParams !== undefined) {
198
- if (gridParams.columns) {
199
- // console.log('exportMyData--grid--gridParams.columns.length=', gridParams.columns)
200
- const columnInfoArr = getExportColumnsByStore(gridParams.columns)
201
- // console.log('exportMyData--grid--columnInfoArr.length=', columnInfoArr.length)
202
- if (columnInfoArr.length === 0) {
203
- Message({
204
- message: getI18n().t('imatrixUIMessage.noExportColumnsConfigured'),
205
- type: 'warning',
206
- showClose: true
207
- })
208
- resolve(false)
209
- } else {
210
- exportColumns(getExportInfo(data, excelName, listCode, columnInfoArr)).then((result) => {
211
- resolve(result)
212
- }).catch(error => {
213
- reject(error)
214
- })
215
- }
216
- } else {
217
- Message({
218
- message: getI18n().t('imatrixUIMessage.noExportColumnsConfigured'),
219
- type: 'warning',
220
- showClose: true
221
- })
222
- resolve(false)
223
- }
224
- } else {
225
- exportOtherListData(data, excelName, listCode).then(result => {
226
- resolve(result)
227
- }).catch(error => {
228
- reject(error)
229
- })
230
- }
231
- })
232
- }
233
-
234
- /**
235
- * 导出非台账列表数据
236
- * @param {*}} data
237
- * @param {*} excelName
238
- * @param {*} listCode
239
- */
240
- function exportOtherListData(data, excelName, listCode, additionalParameterStr) {
241
- return new Promise((resolve, reject) => {
242
- const params = {}
243
- if (additionalParameterStr && additionalParameterStr !== '') {
244
- params.additionalParamMap = additionalParameterStr
245
- }
246
- Vue.prototype.$http.post(Vue.prototype.baseAPI + '/component/super-grids/' + listCode + '/export-columns', params).then(columnInfoArr => {
247
- packageEnumAndBeanColumnValueSets(columnInfoArr, listCode).then(() => {
248
- if (columnInfoArr.length === 0) {
249
- Message({
250
- message: getI18n().t('imatrixUIMessage.noExportColumnsConfigured'),
251
- type: 'warning',
252
- showClose: true
253
- })
254
- resolve(false)
255
- } else {
256
- exportColumns(getExportInfo(data, excelName, listCode, columnInfoArr)).then((result) => {
257
- resolve(result)
258
- }).catch(error => {
259
- reject(error)
260
- })
261
- }
262
- }).catch(error => {
263
- reject(error)
264
- })
265
- }).catch(error => {
266
- reject(error)
267
- })
268
- })
269
- }
270
-
271
- /**
272
- * @param {exportInfo} Object 导出的字段配置集合及导出的数据信息
273
- */
274
- function exportColumns(exportInfo) {
275
- return new Promise((resolve, reject) => {
276
- let excelName = exportInfo.exportData.excelName
277
- if (!excelName || excelName === null || excelName === '') {
278
- excelName = 'default.xlsx'
279
- } else {
280
- excelName = excelName + '.xlsx'
281
- }
282
- Vue.prototype.$http.post(Vue.prototype.baseAPI + '/component/super-grids/exports', exportInfo).then(fileName => {
283
- // window.location.href = Vue.prototype.baseAPI + '/component/super-grids/downloads?fileName=' + encodeURI(fileName)
284
- return download(Vue.prototype.baseAPI + '/component/super-grids/downloads?fileName=' + encodeURI(fileName) + '&_t=' + new Date().getTime(), excelName)
285
- }).then((result) => {
286
- resolve(result)
287
- }).catch(error => {
288
- reject(error)
289
- })
290
- })
291
- }
292
-
293
- function getExportColumnsByStore(columns) {
294
- const exportColumns = []
295
- columns.forEach(column => {
296
- if (column.exportable && column.exportable === true) {
297
- exportColumns.push(column)
298
- }
299
- })
300
- return exportColumns
301
- }
302
-
303
- function getExportInfo(data, excelName, listCode, columnInfoArr) {
304
- if (!excelName || excelName === null || excelName === '') {
305
- excelName = listCode
306
- }
307
- return {
308
- exportColumns: columnInfoArr,
309
- exportData: getExportData(data, excelName)
310
- }
311
- }
312
-
313
- function getExportData(data, excelName) {
314
- return {
315
- excelName: excelName,
316
- exportSheetData: [{
317
- data: data,
318
- sheetName: excelName
319
- }]
320
- }
321
- }
322
-
323
- function isHasTheOption(event, exportOptions) {
324
- if (typeof (exportOptions) !== 'undefined' && typeof (exportOptions[event]) !== 'undefined') {
325
- return true
326
- }
327
- return false
328
- }
329
-
330
- function download(url, fileName) {
331
- return new Promise((resolve, reject) => {
332
- Vue.prototype.$http({
333
- method: 'GET',
334
- url: url,
335
- responseType: 'blob'
336
- }).then(res => {
337
- const blob = new Blob([res])
338
- if (window.navigator.msSaveOrOpenBlob) {
339
- navigator.msSaveBlob(blob, fileName)
340
- } else {
341
- const link = document.createElement('a')
342
- const evt = document.createEvent('HTMLEvents')
343
- evt.initEvent('click', false, false)
344
- link.href = URL.createObjectURL(blob)
345
- link.download = fileName
346
- link.style.display = 'none'
347
- document.body.appendChild(link)
348
- link.click()
349
- window.URL.revokeObjectURL(link.href)
350
- }
351
- resolve(true)
352
- }).catch(error => {
353
- reject(error)
354
- })
355
- })
356
- }
357
-
358
- export default {
359
- exportData,
360
- download
361
- }
@@ -1,15 +0,0 @@
1
- import ExportService from './export-data'
2
- import ExportNewService from './export-data-new'
3
- import publicMethodService from './public-method'
4
-
5
- export default {
6
- install: function(Vue, options) {
7
- Vue.prototype.$exportData = ExportService.exportData
8
- Vue.prototype.$isInIframe = publicMethodService.isInIframe
9
- Vue.prototype.$escapeHtml = publicMethodService.escapeHtml
10
- Vue.prototype.$download = ExportService.download
11
- Vue.prototype.$refreshList = publicMethodService.refreshList
12
- Vue.prototype.$exportDataNew = ExportNewService.exportData
13
- Vue.prototype.$downloadNew = ExportNewService.download
14
- }
15
- }
@@ -1,43 +0,0 @@
1
- /**
2
- * 判断当前元素是否在iframe内,如果在iframe内则返回true,否则返回false
3
- */
4
- function isInIframe() {
5
- // if (window.frames.length !== parent.frames.length) {
6
- // // 在iframe内
7
- // return true
8
- // } else {
9
- // // 不在iframe内
10
- // return false
11
- // }
12
- if (self !== top) {
13
- // 在iframe内
14
- return true
15
- } else {
16
- // 不在iframe内
17
- return false
18
- }
19
- }
20
-
21
- // 多个列表编码之间以逗号隔开;如果一个页面中有多个九宫格列表,且使用的是一个列表编码,listCode的格式应为:listCode~gridId,例如:MMS_BUSSINESS_SYSTEM~grid1
22
- function refreshList(listCodes) {
23
- if (listCodes) {
24
- const listCodesArr = listCodes.split(',')
25
- listCodesArr.forEach(listCode => {
26
- sessionStorage.setItem('refreshList-' + listCode, 'true')
27
- })
28
- }
29
- }
30
-
31
- // 处理xss攻击
32
- function escapeHtml(content) {
33
- if (content !== undefined && content !== null && typeof (content) === 'string') {
34
- content = content.replace(/</g, '&lt;').replace(/>/g, '&gt;')
35
- }
36
- return content
37
- }
38
-
39
- export default {
40
- isInIframe,
41
- refreshList,
42
- escapeHtml
43
- }
@@ -1,6 +0,0 @@
1
- import RemoveDepartment from './src/remove-department.vue'
2
- RemoveDepartment.install = function(Vue) {
3
- Vue.component(RemoveDepartment.name, RemoveDepartment)
4
- }
5
-
6
- export default RemoveDepartment
@@ -1,172 +0,0 @@
1
- <template>
2
- <div>
3
- <el-dialog
4
- class="user-tree"
5
- visible
6
- :title="$t('departmentTreeInline.removeDepartment')"
7
- append-to-body
8
- :close-on-click-modal="false"
9
- :width="width"
10
- @open="$emit('open')"
11
- @opend="$emit('opend')"
12
- @close="$emit('close')"
13
- @closed="$emit('closed')"
14
- >
15
- <div style="margin-bottom:10px">
16
- <el-button type="danger" size="mini" icon="el-icon-delete" @click="removeAllDept()">
17
- {{ $t('imatrixUIPublicModel.clear') }}
18
- </el-button>
19
- </div>
20
-
21
- <el-table
22
- ref="removeDeptGrid"
23
- :data="departments"
24
- row-key="id"
25
- border
26
- :height="height"
27
- >
28
- <el-table-column
29
- :label="$t('departmentTreeInline.name')"
30
- prop="name"
31
- />
32
- <el-table-column
33
- :label="$t('departmentTreeInline.code')"
34
- prop="code"
35
- />
36
- <el-table-column :label="$t('imatrixUIPublicModel.edit')" align="center" width="60px">
37
- <template slot-scope="scope">
38
- <div>
39
- <el-button type="danger" size="mini" icon="el-icon-delete" circle @click="removeDept(scope.$index)" />
40
- </div>
41
- </template>
42
- </el-table-column>
43
- </el-table>
44
- <div slot="footer" class="dialog-footer">
45
- <el-button size="small" @click="$emit('close')">
46
- {{ $t('imatrixUIPublicModel.cancel') }}
47
- </el-button>
48
- <el-button size="small" type="primary" @click="confirmSelectDept">
49
- {{ $t('imatrixUIPublicModel.sure') }}
50
- </el-button>
51
- </div>
52
- </el-dialog>
53
- </div>
54
- </template>
55
- <style>
56
- </style>
57
- <script>
58
- import removeDeptService from './remove-dept-service'
59
- export default {
60
- name: 'RemoveDepartment',
61
- components: {
62
- },
63
- props: {
64
- // 多选部门树时,已选择部门id或部门名称或编码集合,多个之间以逗号隔开
65
- selectDepartmentInfo: {
66
- type: [String, Number],
67
- default: null
68
- },
69
- // 移除部门时,部门属性名称:id、name、code,默认是id
70
- searchField: {
71
- type: String,
72
- default: 'id'
73
- },
74
- // 弹框的宽度
75
- width: {
76
- type: String,
77
- default: '30%'
78
- },
79
- // 弹框的高度
80
- height: {
81
- type: String,
82
- default: '300px'
83
- },
84
- // 多选树时结果之间的分隔符,默认是逗号分隔
85
- separator: {
86
- type: String,
87
- default: ','
88
- }
89
- },
90
- data() {
91
- return {
92
- departments: [],
93
- originalDepts: [], // 原来选择的部门集合
94
- containBranch: false, // 是否包含分支
95
- tenantNodeId: -1 // 公司节点的id
96
- }
97
- },
98
- created() {
99
- if (this.selectDepartmentInfo) {
100
- if (this.selectDepartmentInfo === this.tenantNodeId || this.selectDepartmentInfo === '所有部门') {
101
- // 表示已选择所有用户
102
- this.departments.push(this.packageAllDept())
103
- } else {
104
- // 表示不是选择的所有用户
105
- this.getSelectDepts(this.searchField, this.selectDepartmentInfo, this.separator).then(departments => {
106
- this.originalDepts = departments
107
- this.departments = departments
108
- })
109
- }
110
- }
111
- },
112
- methods: {
113
- ...removeDeptService,
114
- confirmSelectDept() {
115
- const searchFieldValues = []
116
- var retainSelectDepts = {
117
- ids: [],
118
- names: [],
119
- codes: [],
120
- departments: []
121
- }
122
- for (var i = 0; i < this.departments.length; i++) {
123
- var dept = this.departments[i]
124
- // 不存在该用户则放到结果集合中,去掉重复使用
125
- retainSelectDepts.ids.push(dept.id)
126
- retainSelectDepts.codes.push(dept.code)
127
- retainSelectDepts.departments.push(dept)
128
- var name = dept.name
129
- if (this.containBranch && dept.branchName) {
130
- // 如果包含分支机构,则拼接分支机构名称
131
- name = name + '(' + dept.branchName + ')'
132
- }
133
- retainSelectDepts.names.push(name)
134
- // 将用于查询的字段的值存到数组中,获得移除的元素时使用
135
- searchFieldValues.push(dept[this.searchField])
136
- }
137
- const removeItems = this.getRemoveItems(this.originalDepts, searchFieldValues, this.searchField)
138
- this.$emit('close', retainSelectDepts, removeItems)
139
- },
140
- // 选中了组织结构树的根节点
141
- packageAllDept() {
142
- // 表示集合中不存在该用户,则封装该用户
143
- var allDept = {
144
- id: this.tenantNodeId,
145
- name: '所有部门'
146
- }
147
- return allDept
148
- },
149
- // 移除用户
150
- removeDept(index) {
151
- this.departments.splice(index, 1)
152
- },
153
- // 清空用户
154
- removeAllDept() {
155
- this.departments = []
156
- },
157
- // 获得移除的元素集合
158
- getRemoveItems(allValues, retainValues, searchField) {
159
- if (retainValues === undefined || retainValues.length === 0) {
160
- // 表示没有保留任何一条记录,即移除了所有元素
161
- return allValues
162
- }
163
- if (allValues) {
164
- // 根据id筛选出
165
- return allValues.filter(item => retainValues.indexOf(item[searchField]) === -1)
166
- }
167
- return []
168
- }
169
-
170
- }
171
- }
172
- </script>
@@ -1,20 +0,0 @@
1
- import Vue from 'vue'
2
- const removeUserService = {
3
- // 根据指定部门信息获得部门集合
4
- getSelectDepts(searchField, selectDeptInfo, separator) {
5
- return new Promise((resolve, reject) => {
6
- if (!searchField) {
7
- resolve([])
8
- } else if (!selectDeptInfo) {
9
- resolve([])
10
- } else {
11
- this.$http.get(Vue.prototype.baseAPI + '/component/organization-trees/select-departments?searchField=' + searchField + '&selectDeptInfo=' + selectDeptInfo + '&separator=' + separator).then(departments => {
12
- resolve(departments)
13
- }).catch(error => {
14
- reject(error)
15
- })
16
- }
17
- })
18
- }
19
- }
20
- export default removeUserService
@@ -1,6 +0,0 @@
1
- import RemoveUser from './src/remove-user.vue'
2
- RemoveUser.install = function(Vue) {
3
- Vue.component(RemoveUser.name, RemoveUser)
4
- }
5
-
6
- export default RemoveUser
@@ -1,20 +0,0 @@
1
- import Vue from 'vue'
2
- const removeUserService = {
3
- // 根据指定用户信息获得用户集合
4
- getSelectUsers(searchField, selectUserInfo, separator) {
5
- return new Promise((resolve, reject) => {
6
- if (!searchField) {
7
- resolve([])
8
- } else if (!selectUserInfo) {
9
- resolve([])
10
- } else {
11
- this.$http.get(Vue.prototype.baseAPI + '/component/organization-trees/select-users?searchField=' + searchField + '&selectUserInfo=' + selectUserInfo + '&separator=' + separator).then(users => {
12
- resolve(users)
13
- }).catch(error => {
14
- reject(error)
15
- })
16
- }
17
- })
18
- }
19
- }
20
- export default removeUserService