imatrix-ui 2.8.21-dw → 2.8.21
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.
- package/lib/super-ui.css +1 -1
- package/lib/super-ui.umd.min.js +5 -35
- package/package.json +4 -2
- package/packages/breadcrumb/index.js +6 -0
- package/packages/breadcrumb/src/breadcrumb.vue +71 -0
- package/packages/department-tree/index.js +6 -0
- package/packages/department-tree/src/department-tree.vue +108 -0
- package/packages/department-tree-inline/index.js +6 -0
- package/packages/department-tree-inline/src/department-multi-tree-inline.vue +402 -0
- package/packages/department-tree-inline/src/department-single-tree-inline.vue +284 -0
- package/packages/department-tree-inline/src/department-tree-inline.vue +86 -0
- package/packages/department-tree-inline/src/department-tree-service.js +245 -0
- package/packages/department-tree-inline/src/search-result.vue +176 -0
- package/packages/department-user-tree/index.js +6 -0
- package/packages/department-user-tree/src/department-user-multiple-tree.vue +116 -0
- package/packages/department-user-tree/src/department-user-single-tree.vue +76 -0
- package/packages/department-user-tree/src/department-user-tree.vue +101 -0
- package/packages/department-user-tree-inline/index.js +6 -0
- package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +626 -0
- package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +269 -0
- package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +79 -0
- package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +230 -0
- package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +122 -0
- package/packages/department-user-tree-inline/src/search-result.vue +197 -0
- package/packages/directives/prevent-reclick.js +19 -0
- package/packages/dynamic-source-select/index.js +6 -0
- package/packages/dynamic-source-select/src/dynamic-source-select-service.js +70 -0
- package/packages/dynamic-source-select/src/dynamic-source-select.vue +440 -0
- package/packages/dynamic-source-select/src/events.js +55 -0
- package/packages/fs-preview/index.js +6 -0
- package/packages/fs-preview/src/fs-preview.vue +226 -0
- package/packages/fs-upload/index.js +6 -0
- package/packages/fs-upload/src/fs-upload-multi.vue +420 -0
- package/packages/fs-upload/src/fs-upload-single.vue +312 -0
- package/packages/fs-upload/src/fs-upload.vue +189 -0
- package/packages/fs-upload/src/see-big-picture.vue +55 -0
- package/packages/fs-upload-list/index.js +6 -0
- package/packages/fs-upload-list/src/fs-upload-list.vue +287 -0
- package/packages/hamburger/index.js +6 -0
- package/packages/hamburger/src/hamburger.vue +38 -0
- package/packages/index.js +121 -0
- package/packages/multipart-upload/index.js +6 -0
- package/packages/multipart-upload/src/index.vue +73 -0
- package/packages/multipart-upload/src/multipart-upload-form.vue +297 -0
- package/packages/multipart-upload/src/multipart-upload-list.vue +378 -0
- package/packages/organization-input/index.js +6 -0
- package/packages/organization-input/src/organization-input.vue +542 -0
- package/packages/plugins/export-data-new.js +453 -0
- package/packages/plugins/export-data.js +361 -0
- package/packages/plugins/index.js +15 -0
- package/packages/plugins/public-method.js +43 -0
- package/packages/remove-department/index.js +6 -0
- package/packages/remove-department/src/remove-department.vue +172 -0
- package/packages/remove-department/src/remove-dept-service.js +20 -0
- package/packages/remove-user/index.js +6 -0
- package/packages/remove-user/src/remove-user-service.js +20 -0
- package/packages/remove-user/src/remove-user.vue +195 -0
- package/packages/remove-workgroup/index.js +6 -0
- package/packages/remove-workgroup/src/remove-workgroup-service.js +20 -0
- package/packages/remove-workgroup/src/remove-workgroup.vue +159 -0
- package/packages/rich-editor/index.js +7 -0
- package/packages/rich-editor/index.vue +278 -0
- package/packages/rich-editor/langs/zh-Hans.js +1 -0
- package/packages/rich-editor/viewer.vue +103 -0
- package/packages/scan-code-input/index.js +6 -0
- package/packages/scan-code-input/src/events.js +33 -0
- package/packages/scan-code-input/src/scan-code-input-colse.vue +131 -0
- package/packages/scan-code-input/src/scan-code-input.vue +116 -0
- package/packages/secret-info/index.js +7 -0
- package/packages/secret-info/index.vue +90 -0
- package/packages/super-grid/index.js +7 -0
- package/packages/super-grid/src/apis.js +763 -0
- package/packages/super-grid/src/columns-config.vue +335 -0
- package/packages/super-grid/src/custom-formatter.js +250 -0
- package/packages/super-grid/src/dynamic-input.vue +1279 -0
- package/packages/super-grid/src/eventBus.js +2 -0
- package/packages/super-grid/src/events.js +55 -0
- package/packages/super-grid/src/formValidatorUtil.js +226 -0
- package/packages/super-grid/src/formatter.js +181 -0
- package/packages/super-grid/src/group-column.vue +100 -0
- package/packages/super-grid/src/header-context-menu.vue +87 -0
- package/packages/super-grid/src/index-column.vue +51 -0
- package/packages/super-grid/src/normal-column.vue +769 -0
- package/packages/super-grid/src/public-methods.js +31 -0
- package/packages/super-grid/src/row-operation.vue +161 -0
- package/packages/super-grid/src/search-button.vue +66 -0
- package/packages/super-grid/src/search-condition-input.vue +61 -0
- package/packages/super-grid/src/search-condition-list.vue +59 -0
- package/packages/super-grid/src/search-form-advancedQuery.vue +653 -0
- package/packages/super-grid/src/search-form-dialog.vue +79 -0
- package/packages/super-grid/src/search-form-item.vue +386 -0
- package/packages/super-grid/src/search-form-number.vue +38 -0
- package/packages/super-grid/src/search-form-open.vue +162 -0
- package/packages/super-grid/src/search-form-ordinarySearch.vue +188 -0
- package/packages/super-grid/src/search-form.vue +634 -0
- package/packages/super-grid/src/search-methods.js +387 -0
- package/packages/super-grid/src/selection-column.vue +43 -0
- package/packages/super-grid/src/store.js +3 -0
- package/packages/super-grid/src/super-grid-service.js +561 -0
- package/packages/super-grid/src/super-grid.vue +2793 -0
- package/packages/super-grid/src/utils.js +763 -0
- package/packages/super-grid/src/view-image-dialog.vue +130 -0
- package/packages/super-nine-grid/index.js +7 -0
- package/packages/super-nine-grid/src/apis.js +103 -0
- package/packages/super-nine-grid/src/custom-formatter.js +66 -0
- package/packages/super-nine-grid/src/formatter.js +132 -0
- package/packages/super-nine-grid/src/search-form-number.vue +38 -0
- package/packages/super-nine-grid/src/search-form.vue +430 -0
- package/packages/super-nine-grid/src/search-methods.js +134 -0
- package/packages/super-nine-grid/src/store.js +3 -0
- package/packages/super-nine-grid/src/super-grid-service.js +91 -0
- package/packages/super-nine-grid/src/super-nine-grid.vue +872 -0
- package/packages/super-nine-grid/src/utils.js +261 -0
- package/packages/svg-icon/index.js +6 -0
- package/packages/svg-icon/src/svg-icon.vue +43 -0
- package/packages/utils/utils.js +152 -0
- package/packages/utils/value-set.js +86 -0
- package/packages/valid-code/index.js +7 -0
- package/packages/valid-code/src/valid-code.vue +95 -0
- package/packages/workflow-button/index.js +6 -0
- package/packages/workflow-button/src/workflow-button.vue +325 -0
- package/packages/workflow-history-list/index.js +6 -0
- package/packages/workflow-history-list/src/api.js +7 -0
- package/packages/workflow-history-list/src/workflow-history-list.vue +185 -0
- package/packages/workgroup-tree/index.js +6 -0
- package/packages/workgroup-tree/src/workgroup-tree.vue +76 -0
- package/packages/workgroup-tree-inline/index.js +6 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +317 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +43 -0
- package/packages/workgroup-user-tree/index.js +6 -0
- package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +100 -0
- package/packages/workgroup-user-tree-inline/index.js +6 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +163 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +436 -0
- package/packages/year-range-picker/index.js +6 -0
- package/packages/year-range-picker/src/year-range-picker.vue +51 -0
- package/src/i18n/i18n.js +1 -1
- package/src/i18n/langs/cn.js +4 -2
- package/src/i18n/langs/en.js +4 -2
- package/src/index.js +93 -0
- package/src/permission.js +7 -3
- package/src/plugins.js +3 -3
- package/src/router/index.js +24 -0
- package/src/store/getters.js +2 -1
- package/src/store/modules/app.js +10 -1
- package/src/styles/display-layout.scss +34 -0
- package/src/styles/index.scss +32 -4
- package/src/styles/theme/dark-blue/button.scss +9 -0
- package/src/styles/theme/dark-blue/card.scss +64 -0
- package/src/styles/theme/dark-blue/checkbox.scss +10 -0
- package/src/styles/theme/dark-blue/dark-blue-var.scss +8 -0
- package/src/styles/theme/dark-blue/dialog.scss +21 -0
- package/src/styles/theme/dark-blue/element-variables.scss +7 -0
- package/src/styles/theme/dark-blue/font.scss +71 -0
- package/src/styles/theme/dark-blue/form.scss +51 -0
- package/src/styles/theme/dark-blue/index.scss +247 -0
- package/src/styles/theme/dark-blue/input.scss +15 -0
- package/src/styles/theme/dark-blue/pagination.scss +14 -0
- package/src/styles/theme/dark-blue/scrollbar-style.scss +32 -0
- package/src/styles/theme/dark-blue/sidebar.scss +296 -0
- package/src/styles/theme/dark-blue/tab.scss +83 -0
- package/src/styles/theme/dark-blue/table.scss +60 -0
- package/src/styles/theme/dark-blue/tree.scss +31 -0
- package/src/styles/theme/dark-blue/var.scss +1028 -0
- package/src/styles/theme/gray/form-style.scss +2 -2
- package/src/styles/theme/gray/input-style.scss +8 -0
- package/src/utils/auth-api.js +115 -0
- package/src/utils/auth.js +34 -42
- package/src/utils/calculator/calculator-factory.js +2 -2
- package/src/utils/common-util.js +34 -0
- package/src/utils/jump-page-utils.js +29 -5
- package/src/utils/menu.js +19 -0
- package/src/utils/permission.js +4 -0
- package/src/utils/request.js +18 -2
- package/src/utils/util.js +7 -3
- package/src/views/dsc-component/Sidebar/Item.vue +4 -4
- package/src/views/dsc-component/Sidebar/Link.vue +11 -2
- package/src/views/dsc-component/Sidebar/SidebarItem.vue +36 -20
- package/src/views/dsc-component/Sidebar/index.vue +24 -12
- package/src/views/dsc-component/tabs/tab-content.vue +16 -1
- package/src/views/login/index.vue +1 -1
|
@@ -0,0 +1,361 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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, '<').replace(/>/g, '>')
|
|
35
|
+
}
|
|
36
|
+
return content
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export default {
|
|
40
|
+
isInIframe,
|
|
41
|
+
refreshList,
|
|
42
|
+
escapeHtml
|
|
43
|
+
}
|
|
@@ -0,0 +1,172 @@
|
|
|
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>
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|