imatrix-ui 2.9.18-dw → 2.9.19-boe01
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/super-ui.css +1 -1
- package/lib/super-ui.umd.min.js +5 -35
- package/package.json +4 -3
- package/src/api/sso-service.js +19 -1
- package/src/assets/nonemessage.png +0 -0
- package/src/i18n/i18n.js +1 -1
- package/src/i18n/langs/cn.js +25 -6
- package/src/i18n/langs/en.js +27 -7
- package/src/permission.js +2 -2
- package/src/plugins.js +3 -3
- package/src/router/index.js +10 -0
- package/src/store/modules/tab-content.js +6 -0
- package/src/store/modules/user.js +32 -2
- package/src/styles/display-layout.scss +1 -1
- package/src/styles/index.scss +74 -4
- package/src/styles/theme/black/font-style.scss +70 -0
- package/src/styles/theme/black/index.scss +6 -30
- package/src/styles/theme/blue/font-style.scss +37 -0
- package/src/styles/theme/blue/index.scss +2 -18
- package/src/styles/theme/blue2/font-style.scss +70 -0
- package/src/styles/theme/blue2/index.scss +3 -13
- package/src/styles/theme/dark-blue/card.scss +4 -6
- package/src/styles/theme/dark-blue/form.scss +7 -4
- package/src/styles/theme/dark-blue/index.scss +30 -5
- package/src/styles/theme/dark-blue/input.scss +4 -1
- package/src/styles/theme/dark-blue/message.scss +8 -0
- package/src/styles/theme/dark-blue/radio.scss +13 -0
- package/src/styles/theme/dark-blue/scrollbar-style.scss +8 -3
- package/src/styles/theme/dark-blue/sidebar.scss +7 -37
- package/src/styles/theme/dark-blue/tab.scss +4 -1
- package/src/styles/theme/dark-blue/table.scss +2 -2
- package/src/styles/theme/dark-blue/tree.scss +35 -10
- package/src/styles/theme/gray/card-style.scss +13 -1
- package/src/styles/theme/gray/font-style.scss +38 -0
- package/src/styles/theme/gray/index.scss +13 -25
- package/src/styles/theme/gray/scrollbar-style.scss +37 -0
- package/src/styles/theme/gray/sidebar.scss +7 -14
- package/src/utils/auth-api.js +47 -1
- package/src/utils/calculator/calculator-util.js +14 -0
- package/src/utils/common-util.js +22 -81
- package/src/utils/jump-page-utils.js +12 -9
- package/src/utils/preview-util.js +32 -0
- package/src/utils/range-selector.js +185 -0
- package/src/utils/request.js +20 -12
- package/src/utils/util.js +13 -11
- package/src/utils/workflow-util.js +3 -0
- package/src/views/dsc-component/Sidebar/Item.vue +7 -5
- package/src/views/dsc-component/Sidebar/SidebarItem.vue +2 -3
- package/src/views/dsc-component/Sidebar/index.vue +14 -22
- package/src/views/dsc-component/tabs/tab-content.vue +8 -9
- package/src/views/layout/EmptyLayout.vue +4 -1
- package/src/views/layout/NewLayout.vue +6 -65
- package/src/views/layout/components/AppMain.vue +2 -1
- package/src/views/layout/components/Breadcrumb/index.vue +1 -1
- package/src/views/layout/components/Menubar/Item.vue +23 -7
- package/src/views/layout/components/Menubar/Link.vue +11 -2
- package/src/views/layout/components/Menubar/SidebarItem.vue +50 -7
- package/src/views/layout/components/Menubar/index.vue +51 -16
- package/src/views/layout/components/Sidebar/index.vue +2 -2
- package/src/views/layout/components/tabs/tab-content.vue +162 -0
- package/src/views/layout/tab-content-iframe-index.vue +31 -0
- package/src/views/layout/tab-content-index.vue +84 -0
- package/src/views/login/index.vue +1 -1
- package/packages/breadcrumb/index.js +0 -6
- package/packages/breadcrumb/src/breadcrumb.vue +0 -71
- package/packages/department-tree/index.js +0 -6
- package/packages/department-tree/src/department-tree.vue +0 -108
- package/packages/department-tree-inline/index.js +0 -6
- package/packages/department-tree-inline/src/department-multi-tree-inline.vue +0 -411
- package/packages/department-tree-inline/src/department-single-tree-inline.vue +0 -293
- package/packages/department-tree-inline/src/department-tree-inline.vue +0 -86
- package/packages/department-tree-inline/src/department-tree-service.js +0 -275
- package/packages/department-tree-inline/src/search-result.vue +0 -176
- package/packages/department-user-tree/index.js +0 -6
- package/packages/department-user-tree/src/department-user-multiple-tree.vue +0 -116
- package/packages/department-user-tree/src/department-user-single-tree.vue +0 -76
- package/packages/department-user-tree/src/department-user-tree.vue +0 -101
- package/packages/department-user-tree-inline/index.js +0 -6
- package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +0 -639
- package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +0 -274
- package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +0 -79
- package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +0 -248
- package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +0 -142
- package/packages/department-user-tree-inline/src/search-result.vue +0 -197
- package/packages/directives/prevent-reclick.js +0 -19
- package/packages/dynamic-source-select/index.js +0 -6
- package/packages/dynamic-source-select/src/dynamic-source-select-service.js +0 -70
- package/packages/dynamic-source-select/src/dynamic-source-select.vue +0 -440
- package/packages/dynamic-source-select/src/events.js +0 -55
- package/packages/fs-preview/index.js +0 -6
- package/packages/fs-preview/src/fs-preview.vue +0 -226
- package/packages/fs-upload/index.js +0 -6
- package/packages/fs-upload/src/fs-upload-multi.vue +0 -420
- package/packages/fs-upload/src/fs-upload-single.vue +0 -312
- package/packages/fs-upload/src/fs-upload.vue +0 -189
- package/packages/fs-upload/src/see-big-picture.vue +0 -55
- package/packages/fs-upload-list/index.js +0 -6
- package/packages/fs-upload-list/src/fs-upload-list.vue +0 -287
- package/packages/hamburger/index.js +0 -6
- package/packages/hamburger/src/hamburger.vue +0 -38
- package/packages/index.js +0 -121
- package/packages/multipart-upload/index.js +0 -6
- package/packages/multipart-upload/src/index.vue +0 -73
- package/packages/multipart-upload/src/multipart-upload-form.vue +0 -297
- package/packages/multipart-upload/src/multipart-upload-list.vue +0 -378
- package/packages/organization-input/index.js +0 -6
- package/packages/organization-input/src/organization-input.vue +0 -542
- package/packages/plugins/export-data-new.js +0 -466
- package/packages/plugins/export-data.js +0 -361
- package/packages/plugins/index.js +0 -15
- package/packages/plugins/public-method.js +0 -43
- package/packages/remove-department/index.js +0 -6
- package/packages/remove-department/src/remove-department.vue +0 -172
- package/packages/remove-department/src/remove-dept-service.js +0 -20
- package/packages/remove-user/index.js +0 -6
- package/packages/remove-user/src/remove-user-service.js +0 -20
- package/packages/remove-user/src/remove-user.vue +0 -195
- package/packages/remove-workgroup/index.js +0 -6
- package/packages/remove-workgroup/src/remove-workgroup-service.js +0 -20
- package/packages/remove-workgroup/src/remove-workgroup.vue +0 -159
- package/packages/rich-editor/index.js +0 -7
- package/packages/rich-editor/index.vue +0 -278
- package/packages/rich-editor/langs/zh-Hans.js +0 -1
- package/packages/rich-editor/viewer.vue +0 -103
- package/packages/scan-code-input/index.js +0 -6
- package/packages/scan-code-input/src/events.js +0 -33
- package/packages/scan-code-input/src/scan-code-input-colse.vue +0 -131
- package/packages/scan-code-input/src/scan-code-input.vue +0 -116
- package/packages/secret-info/index.js +0 -7
- package/packages/secret-info/index.vue +0 -90
- package/packages/super-grid/index.js +0 -7
- package/packages/super-grid/src/apis.js +0 -820
- package/packages/super-grid/src/columns-config.vue +0 -335
- package/packages/super-grid/src/custom-formatter.js +0 -278
- package/packages/super-grid/src/dynamic-input.vue +0 -1279
- package/packages/super-grid/src/eventBus.js +0 -2
- package/packages/super-grid/src/events.js +0 -55
- package/packages/super-grid/src/formValidatorUtil.js +0 -226
- package/packages/super-grid/src/formatter.js +0 -181
- package/packages/super-grid/src/group-column.vue +0 -100
- package/packages/super-grid/src/header-context-menu.vue +0 -87
- package/packages/super-grid/src/index-column.vue +0 -51
- package/packages/super-grid/src/normal-column.vue +0 -775
- package/packages/super-grid/src/public-methods.js +0 -31
- package/packages/super-grid/src/row-operation.vue +0 -161
- package/packages/super-grid/src/search-button.vue +0 -66
- package/packages/super-grid/src/search-condition-input.vue +0 -61
- package/packages/super-grid/src/search-condition-list.vue +0 -59
- package/packages/super-grid/src/search-form-advancedQuery.vue +0 -654
- package/packages/super-grid/src/search-form-dialog.vue +0 -79
- package/packages/super-grid/src/search-form-item.vue +0 -405
- package/packages/super-grid/src/search-form-number.vue +0 -38
- package/packages/super-grid/src/search-form-open.vue +0 -170
- package/packages/super-grid/src/search-form-ordinarySearch.vue +0 -196
- package/packages/super-grid/src/search-form.vue +0 -642
- package/packages/super-grid/src/search-methods.js +0 -448
- package/packages/super-grid/src/selection-column.vue +0 -43
- package/packages/super-grid/src/store.js +0 -3
- package/packages/super-grid/src/super-grid-service.js +0 -593
- package/packages/super-grid/src/super-grid.vue +0 -2873
- package/packages/super-grid/src/utils.js +0 -772
- package/packages/super-grid/src/view-image-dialog.vue +0 -130
- package/packages/super-nine-grid/index.js +0 -7
- package/packages/super-nine-grid/src/apis.js +0 -103
- package/packages/super-nine-grid/src/custom-formatter.js +0 -66
- package/packages/super-nine-grid/src/formatter.js +0 -132
- package/packages/super-nine-grid/src/search-form-number.vue +0 -38
- package/packages/super-nine-grid/src/search-form.vue +0 -430
- package/packages/super-nine-grid/src/search-methods.js +0 -134
- package/packages/super-nine-grid/src/store.js +0 -3
- package/packages/super-nine-grid/src/super-grid-service.js +0 -91
- package/packages/super-nine-grid/src/super-nine-grid.vue +0 -872
- package/packages/super-nine-grid/src/utils.js +0 -261
- package/packages/svg-icon/index.js +0 -6
- package/packages/svg-icon/src/svg-icon.vue +0 -43
- package/packages/utils/memory-cache-utils.js +0 -90
- package/packages/utils/utils.js +0 -152
- package/packages/utils/value-set.js +0 -86
- package/packages/valid-code/index.js +0 -7
- package/packages/valid-code/src/valid-code.vue +0 -95
- package/packages/workflow-button/index.js +0 -6
- package/packages/workflow-button/src/workflow-button.vue +0 -325
- package/packages/workflow-history-list/index.js +0 -6
- package/packages/workflow-history-list/src/api.js +0 -7
- package/packages/workflow-history-list/src/workflow-history-list.vue +0 -185
- package/packages/workgroup-tree/index.js +0 -6
- package/packages/workgroup-tree/src/workgroup-tree.vue +0 -76
- package/packages/workgroup-tree-inline/index.js +0 -6
- package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +0 -317
- package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +0 -43
- package/packages/workgroup-user-tree/index.js +0 -6
- package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +0 -100
- package/packages/workgroup-user-tree-inline/index.js +0 -6
- package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +0 -163
- package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +0 -436
- package/packages/year-range-picker/index.js +0 -6
- package/packages/year-range-picker/src/year-range-picker.vue +0 -51
- package/src/index.js +0 -93
- package/src/styles/theme/gray/form-style.scss +0 -41
|
@@ -1,593 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-undef */
|
|
2
|
-
import Sortable from 'sortablejs'
|
|
3
|
-
import Vue from 'vue'
|
|
4
|
-
import {
|
|
5
|
-
packageEnumAndBeanColumnValueSets
|
|
6
|
-
} from '../../utils/value-set'
|
|
7
|
-
import store from './store'
|
|
8
|
-
import {
|
|
9
|
-
isHasOptionFunction
|
|
10
|
-
} from './utils'
|
|
11
|
-
const superGridService = {
|
|
12
|
-
initialize() {
|
|
13
|
-
const a = new Date().getTime()
|
|
14
|
-
return new Promise((resolve, reject) => {
|
|
15
|
-
const gridParams = store.get(this.code)
|
|
16
|
-
if (this.options.isAdministerListView) {
|
|
17
|
-
// 要从配置中实时获取页面的配置
|
|
18
|
-
// 根据this.options.showColumns设置显示的字段
|
|
19
|
-
this.getShowColumns(this.options.SuperGrid)
|
|
20
|
-
Object.assign(this, this.options.SuperGrid)
|
|
21
|
-
gridParams.isSql = this.isSql
|
|
22
|
-
gridParams.columns = this.columns
|
|
23
|
-
gridParams.query = this.query
|
|
24
|
-
gridParams.pagination = this.pagination
|
|
25
|
-
this.createBackgroundColorMap()
|
|
26
|
-
this.hasLoadedColumns = true
|
|
27
|
-
this.fetchData(null, null, null, null)
|
|
28
|
-
resolve()
|
|
29
|
-
} else {
|
|
30
|
-
const url = Vue.prototype.baseAPI + '/component/super-grids/' + this.code
|
|
31
|
-
const param = {}
|
|
32
|
-
const isSqlSetting = this.options.isSql
|
|
33
|
-
if (this.options && typeof (isSqlSetting) !== 'undefined') {
|
|
34
|
-
this.isSql = isSqlSetting
|
|
35
|
-
param.isSql = isSqlSetting + ''
|
|
36
|
-
}
|
|
37
|
-
if (this.options && typeof (this.options.isAdministerListView) !== 'undefined' && this.options.isAdministerListView) {
|
|
38
|
-
param.isAdminister = this.options.isAdministerListView + ''
|
|
39
|
-
}
|
|
40
|
-
let additionalParams
|
|
41
|
-
const additionalParamMap = sessionStorage.getItem('additionalParamMap')
|
|
42
|
-
if (additionalParamMap) {
|
|
43
|
-
console.log('进入判断', additionalParamMap)
|
|
44
|
-
if (additionalParamMap && typeof (additionalParamMap) === 'object') {
|
|
45
|
-
additionalParams = JSON.stringify(additionalParamMap)
|
|
46
|
-
} else if (additionalParamMap && additionalParamMap !== '') {
|
|
47
|
-
additionalParams = additionalParamMap
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
if (this.options.additionalParamMap && typeof (this.options.additionalParamMap) === 'object') {
|
|
51
|
-
const optionParam = JSON.stringify(this.options.additionalParamMap)
|
|
52
|
-
if (additionalParams) {
|
|
53
|
-
Object.assign(additionalParams, optionParam)
|
|
54
|
-
} else {
|
|
55
|
-
additionalParams = optionParam
|
|
56
|
-
}
|
|
57
|
-
} else if (this.options.additionalParamMap && this.options.additionalParamMap !== '') {
|
|
58
|
-
const optionParam = this.options.additionalParamMap
|
|
59
|
-
if (additionalParams) {
|
|
60
|
-
Object.assign(additionalParams, optionParam)
|
|
61
|
-
} else {
|
|
62
|
-
additionalParams = optionParam
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
if (additionalParams) {
|
|
66
|
-
param.additionalParamMap = additionalParams
|
|
67
|
-
}
|
|
68
|
-
if (this.options.extraParam && this.options.extraParam.entityMap) {
|
|
69
|
-
this.parentFormData = this.options.extraParam.entityMap
|
|
70
|
-
}
|
|
71
|
-
this.isLoading = true
|
|
72
|
-
// 初始化组件时先获取元信息再获取数据,以后翻页、排序、查询不再去获取元数据了
|
|
73
|
-
this.$http.post(url, param).then(data => {
|
|
74
|
-
const p1 = new Date().getTime()
|
|
75
|
-
// 判断是否查询组件渲染完之后查询
|
|
76
|
-
this.isLoadCompleteQuery(data.columns)
|
|
77
|
-
// 行编辑设置所有字段的默认值null时使用,优化行编辑性能
|
|
78
|
-
let allColumns = []
|
|
79
|
-
allColumns = allColumns.concat(JSON.parse(JSON.stringify(data.columns)))
|
|
80
|
-
// 根据this.options.showColumns设置显示的字段
|
|
81
|
-
this.getShowColumns(data)
|
|
82
|
-
// 将列表信息存入store缓存中,用来导出时获取国际化名
|
|
83
|
-
if (data.basicInfo) {
|
|
84
|
-
store.set(this.code + 'basicInfo', data.basicInfo)
|
|
85
|
-
}
|
|
86
|
-
if (this.options.pageSizes && data.pagination) {
|
|
87
|
-
// 组件的options属性配置中配置“可选行数”,已该配置为准
|
|
88
|
-
let pageSizeArr = null
|
|
89
|
-
const pageSizeStrs = this.options.pageSizes.split(',')
|
|
90
|
-
if (pageSizeStrs && pageSizeStrs.length > 0) {
|
|
91
|
-
pageSizeArr = []
|
|
92
|
-
for (var i = 0; i < pageSizeStrs.length; i++) {
|
|
93
|
-
pageSizeArr.push(pageSizeStrs[i] * 1)
|
|
94
|
-
}
|
|
95
|
-
data.pagination.pageSize = pageSizeArr[0]
|
|
96
|
-
}
|
|
97
|
-
data.pagination.layout = 'total, sizes, prev, pager, next, jumper'
|
|
98
|
-
data.pagination.pageSizes = pageSizeArr
|
|
99
|
-
}
|
|
100
|
-
if (typeof (this.options.initSortInfo) !== 'undefined') {
|
|
101
|
-
// 组件的options属性配置中配置“排序信息”,以该配置为准
|
|
102
|
-
if (Array.isArray(this.options.initSortInfo)) {
|
|
103
|
-
data.sortInfo = this.options.initSortInfo
|
|
104
|
-
} else {
|
|
105
|
-
data.sortInfo = []
|
|
106
|
-
data.sortInfo.push(this.options.initSortInfo)
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// 需要多个组件共享的数据放到store中,避免组件定义一堆props来接收这些共享数据
|
|
111
|
-
packageEnumAndBeanColumnValueSets(data.columns, this.code).then(() => {
|
|
112
|
-
return this.getDynamicColumnByBean(additionalParams, data.dynamicColumnInfo, data.columns, gridParams)
|
|
113
|
-
}).then((dynamicColumns) => {
|
|
114
|
-
const b = new Date().getTime()
|
|
115
|
-
let showColumns = []
|
|
116
|
-
if (typeof (this.options.showColumns) !== 'undefined') {
|
|
117
|
-
showColumns = this.options.showColumns.split(',')
|
|
118
|
-
}
|
|
119
|
-
let customDynamicColumns = dynamicColumns
|
|
120
|
-
if (!customDynamicColumns || customDynamicColumns.length === 0) {
|
|
121
|
-
if (this.options.dynamicColumns && this.options.dynamicColumns.length > 0) {
|
|
122
|
-
customDynamicColumns = this.options.dynamicColumns
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
if (customDynamicColumns && customDynamicColumns.length > 0) {
|
|
126
|
-
allColumns = allColumns.concat(JSON.parse(JSON.stringify(customDynamicColumns)))
|
|
127
|
-
if (showColumns && showColumns.length > 0) {
|
|
128
|
-
for (let i = 0; i < customDynamicColumns.length; i++) {
|
|
129
|
-
const prop = customDynamicColumns[i].prop
|
|
130
|
-
customDynamicColumns[i].dynamic = true
|
|
131
|
-
if (showColumns.indexOf(prop) >= 0) {
|
|
132
|
-
customDynamicColumns[i].show = true
|
|
133
|
-
} else {
|
|
134
|
-
customDynamicColumns[i].show = false
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
data.columns = data.columns.concat(customDynamicColumns)
|
|
139
|
-
// 按照排序字段的值升序排列字段
|
|
140
|
-
data.columns = data.columns.sort((col1, col2) => col1.displayOrder - col2.displayOrder)
|
|
141
|
-
}
|
|
142
|
-
Object.assign(this, data)
|
|
143
|
-
if (this.options && typeof (isSqlSetting) === 'undefined') {
|
|
144
|
-
// 如果options中没有配置,则以后台传过来的为准,在有动态列配置时,该值会赋值为true
|
|
145
|
-
this.isSql = this.basicInfo.sql
|
|
146
|
-
}
|
|
147
|
-
gridParams.isSql = this.isSql
|
|
148
|
-
// 行编辑时使用
|
|
149
|
-
gridParams.allColumns = allColumns
|
|
150
|
-
gridParams.columns = this.columns
|
|
151
|
-
// 存放map,prop-columnOption。方便直接通过prop 获取对应的配置
|
|
152
|
-
this.packageColumnOptionMap(gridParams)
|
|
153
|
-
// const columnOptionMap = {}
|
|
154
|
-
// if (gridParams.columns && gridParams.columns.length > 0) {
|
|
155
|
-
// gridParams.columns.forEach(item => {
|
|
156
|
-
// if (item && item.prop) {
|
|
157
|
-
// columnOptionMap[item.prop] = item
|
|
158
|
-
// }
|
|
159
|
-
// })
|
|
160
|
-
// }
|
|
161
|
-
// gridParams.columnOptionMap = columnOptionMap
|
|
162
|
-
this.judgeIsFormSubTable()
|
|
163
|
-
gridParams.colSetting = this.colSetting
|
|
164
|
-
gridParams.lineEdit = this.lineEdit
|
|
165
|
-
gridParams.basicInfo = this.basicInfo
|
|
166
|
-
gridParams.pagination = this.pagination
|
|
167
|
-
if (this.pagination) {
|
|
168
|
-
// 监控每行显示多少条变量使用
|
|
169
|
-
this.pageSize = this.pagination.pageSize
|
|
170
|
-
}
|
|
171
|
-
gridParams.query = this.query
|
|
172
|
-
gridParams.dynamicColumnInfo = this.dynamicColumnInfo
|
|
173
|
-
gridParams.mainDefaultValueColumns = this.mainDefaultValueColumns
|
|
174
|
-
gridParams.contextParameter = this.contextParameter
|
|
175
|
-
// 是否显示分页区域
|
|
176
|
-
this.isShowPage = this.isShowPageArea()
|
|
177
|
-
// 子表是否分页
|
|
178
|
-
this.isSubTableShowPage = this.isFormSubTable ? this.isShowPage : false
|
|
179
|
-
gridParams.isSubTableShowPage = this.isSubTableShowPage
|
|
180
|
-
this.hasLoadedColumns = true
|
|
181
|
-
let canFetchData = true
|
|
182
|
-
if (isHasOptionFunction('loadBeforeSend', this.code)) {
|
|
183
|
-
canFetchData = gridParams.options.loadBeforeSend.call(this, {
|
|
184
|
-
columns: this.columns,
|
|
185
|
-
gridParams
|
|
186
|
-
})
|
|
187
|
-
}
|
|
188
|
-
if (canFetchData === undefined || canFetchData === true) {
|
|
189
|
-
// 表示初始化时查询记录
|
|
190
|
-
if (this.options.isPageInfo) {
|
|
191
|
-
// 表示是页面展示模式
|
|
192
|
-
} else if (typeof (this.options.initSearch) === 'undefined') {
|
|
193
|
-
if (typeof (gridParams.basicInfo.initializationQuery) === 'undefined' || gridParams.basicInfo.initializationQuery) {
|
|
194
|
-
// 判断是否初始化完查询条件后再查询数据
|
|
195
|
-
if (this.loadCompleteQuery) {
|
|
196
|
-
this.isLoading = false
|
|
197
|
-
} else {
|
|
198
|
-
this.fetchData()
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
} else if (this.options.initSearch !== false) {
|
|
202
|
-
// 判断是否初始化完查询条件后再查询数据
|
|
203
|
-
if (this.loadCompleteQuery) {
|
|
204
|
-
this.isLoading = false
|
|
205
|
-
} else {
|
|
206
|
-
this.fetchData()
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
this.createBackgroundColorMap()
|
|
211
|
-
const p2 = new Date().getTime()
|
|
212
|
-
console.log('拿到共享数据并存储p2-p1=', p2 - p1)
|
|
213
|
-
console.log('拿到共享数据并存储p2-b=', p2 - b)
|
|
214
|
-
resolve()
|
|
215
|
-
}).catch(error => {
|
|
216
|
-
reject(error)
|
|
217
|
-
})
|
|
218
|
-
}).catch(error => {
|
|
219
|
-
reject(error)
|
|
220
|
-
})
|
|
221
|
-
}
|
|
222
|
-
const a1 = new Date().getTime()
|
|
223
|
-
console.log('初始化所耗时间', a1 - a)
|
|
224
|
-
})
|
|
225
|
-
},
|
|
226
|
-
isLoadCompleteQuery(columns) {
|
|
227
|
-
if (columns !== null) {
|
|
228
|
-
let queryParameterSize = 0
|
|
229
|
-
columns.forEach(column => {
|
|
230
|
-
if (column.hasOwnProperty('queryType') && column.hasOwnProperty('prop')) {
|
|
231
|
-
if (column.prop !== '$index' && column.prop !== '$selection') {
|
|
232
|
-
if (column.queryType && column.queryType !== 'no') {
|
|
233
|
-
// 配置了默认值
|
|
234
|
-
if (column.controlConfig) {
|
|
235
|
-
queryParameterSize++
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
})
|
|
241
|
-
if (queryParameterSize > 0) {
|
|
242
|
-
this.loadCompleteQuery = true
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
},
|
|
246
|
-
packageColumnOptionMap(gridParams) {
|
|
247
|
-
const columnOptionMap = {}
|
|
248
|
-
if (gridParams.columns && gridParams.columns.length > 0) {
|
|
249
|
-
this.packageColumnOptionMapItems(gridParams.columns, columnOptionMap)
|
|
250
|
-
}
|
|
251
|
-
gridParams.columnOptionMap = columnOptionMap
|
|
252
|
-
},
|
|
253
|
-
packageColumnOptionMapItems(columns, columnOptionMap) {
|
|
254
|
-
columns.forEach(item => {
|
|
255
|
-
if (item.children && item.children.length > 0) {
|
|
256
|
-
this.packageColumnOptionMapItems(item.children, columnOptionMap)
|
|
257
|
-
}
|
|
258
|
-
if (item && item.prop) {
|
|
259
|
-
columnOptionMap[item.prop] = item
|
|
260
|
-
}
|
|
261
|
-
})
|
|
262
|
-
},
|
|
263
|
-
getDynamicColumnByBean(additionalParams, dynamicColumnInfos, columns, gridParams) {
|
|
264
|
-
return new Promise((resolve, reject) => {
|
|
265
|
-
if (gridParams.options.extraParam && gridParams.options.extraParam.entityMap) {
|
|
266
|
-
this.parentFormData = gridParams.options.extraParam.entityMap
|
|
267
|
-
}
|
|
268
|
-
if (!this.options.isPageInfo && dynamicColumnInfos && dynamicColumnInfos.length > 0) {
|
|
269
|
-
const totalDynamicColumns = []
|
|
270
|
-
this.getDynamicColumnByBeanWithOneSet(additionalParams, dynamicColumnInfos[0], columns, 0, dynamicColumnInfos, totalDynamicColumns, gridParams).then(totalDynamicColumns => {
|
|
271
|
-
resolve(totalDynamicColumns)
|
|
272
|
-
}).catch(error => {
|
|
273
|
-
reject(error)
|
|
274
|
-
})
|
|
275
|
-
} else {
|
|
276
|
-
resolve([])
|
|
277
|
-
}
|
|
278
|
-
})
|
|
279
|
-
},
|
|
280
|
-
getDynamicColumnByBeanWithOneSet(additionalParams, dynamicColumnInfo, columns, index, dynamicColumnInfos, totalDynamicColumns, gridParams) {
|
|
281
|
-
return new Promise((resolve, reject) => {
|
|
282
|
-
if (dynamicColumnInfo && dynamicColumnInfo.beanName) {
|
|
283
|
-
const url = Vue.prototype.baseURL + '/common/dynamic-columns'
|
|
284
|
-
const param = {
|
|
285
|
-
additionalParams, // 附加参数对象
|
|
286
|
-
listCode: this.code,
|
|
287
|
-
columns,
|
|
288
|
-
beanName: dynamicColumnInfo.beanName
|
|
289
|
-
}
|
|
290
|
-
if (this.parentFormData) {
|
|
291
|
-
// 初始化表单时,加载动态列需要
|
|
292
|
-
if (gridParams.dynamicTemp) {
|
|
293
|
-
param.parent = gridParams.dynamicTemp.parent
|
|
294
|
-
param.watchParentAttrValues = gridParams.dynamicTemp.watchParentAttrValues
|
|
295
|
-
} else {
|
|
296
|
-
param.parent = this.parentFormData
|
|
297
|
-
}
|
|
298
|
-
// 监听主表字段的值
|
|
299
|
-
if (dynamicColumnInfo.watchParentAttr) {
|
|
300
|
-
const watchParentAttrs = dynamicColumnInfo.watchParentAttr.split(',')
|
|
301
|
-
watchParentAttrs.forEach(watchParentAttr => {
|
|
302
|
-
if (watchParentAttr) {
|
|
303
|
-
// 存储属性对应的值
|
|
304
|
-
if (!param.watchParentAttrValues) {
|
|
305
|
-
param.watchParentAttrValues = {}
|
|
306
|
-
}
|
|
307
|
-
param.watchParentAttrValues[watchParentAttr] = this.parentFormData[watchParentAttr]
|
|
308
|
-
const unWatch = this.$watch('parentFormData.' + watchParentAttr, function (newValue, oldValue) {
|
|
309
|
-
// 重新加载表格及表格数据
|
|
310
|
-
if (!gridParams.dynamicTemp) {
|
|
311
|
-
gridParams.dynamicTemp = {}
|
|
312
|
-
}
|
|
313
|
-
gridParams.dynamicTemp.parent = this.parentFormData
|
|
314
|
-
if (!gridParams.dynamicTemp.watchParentAttrValues) {
|
|
315
|
-
gridParams.dynamicTemp.watchParentAttrValues = {}
|
|
316
|
-
}
|
|
317
|
-
gridParams.dynamicTemp.watchParentAttrValues[watchParentAttr] = newValue
|
|
318
|
-
if (this.$refs && this.$refs.superGrid) {
|
|
319
|
-
// 手动注销watch,否则会调用多次watch
|
|
320
|
-
unWatch()
|
|
321
|
-
// 重新加载表格及表格数据
|
|
322
|
-
this.$emit('reload-grid')
|
|
323
|
-
}
|
|
324
|
-
})
|
|
325
|
-
}
|
|
326
|
-
})
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
this.$http.post(url, param).then(dynamicColumns => {
|
|
330
|
-
// 给动态列分组。如果是后台接口返回的动态列,保存时要自己实现动态列的保存
|
|
331
|
-
dynamicColumnInfo.dynamicColumns = dynamicColumns
|
|
332
|
-
totalDynamicColumns = totalDynamicColumns.concat(dynamicColumns)
|
|
333
|
-
if (index + 1 < dynamicColumnInfos.length) {
|
|
334
|
-
this.getDynamicColumnByBeanWithOneSet(additionalParams, dynamicColumnInfos[index + 1], columns, index + 1, dynamicColumnInfos, totalDynamicColumns)
|
|
335
|
-
} else {
|
|
336
|
-
resolve(totalDynamicColumns)
|
|
337
|
-
}
|
|
338
|
-
}).catch(() => {
|
|
339
|
-
resolve([])
|
|
340
|
-
})
|
|
341
|
-
} else {
|
|
342
|
-
resolve([])
|
|
343
|
-
}
|
|
344
|
-
})
|
|
345
|
-
},
|
|
346
|
-
// 列拖拽
|
|
347
|
-
columnDrop() {
|
|
348
|
-
const vm = this
|
|
349
|
-
// 作用于实际展示列表数据时拖拽列
|
|
350
|
-
let isDragColumnFlag = false
|
|
351
|
-
if (typeof (this.options.isDragColumnFlag) !== 'undefined' && this.options.isDragColumn != null &&
|
|
352
|
-
this.options.isDragColumn === true) {
|
|
353
|
-
isDragColumnFlag = true
|
|
354
|
-
const wrapperTr = document.querySelector('.el-table__header-wrapper tr')
|
|
355
|
-
if (wrapperTr != null) {
|
|
356
|
-
this.sortable = Sortable.create(wrapperTr, {
|
|
357
|
-
animation: 180,
|
|
358
|
-
delay: 0,
|
|
359
|
-
onEnd: evt => {
|
|
360
|
-
let oldIndex = evt.oldIndex
|
|
361
|
-
let newIndex = evt.newIndex
|
|
362
|
-
// 判断冻结列,获取真实index
|
|
363
|
-
const frozenArr = []
|
|
364
|
-
// const columns = this.listColumnList.filter(listColumn => {
|
|
365
|
-
// return listColumn.listColumnFixed === 'left' || listColumn.listColumnFixed === 'right'
|
|
366
|
-
// })
|
|
367
|
-
for (var r = 0; r < vm.columns.length; r++) {
|
|
368
|
-
if (vm.columns[r].fixed === 'left' || vm.columns[r].fixed === 'right') {
|
|
369
|
-
frozenArr.push(r)
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
if (frozenArr && frozenArr.length > 0) {
|
|
373
|
-
for (var m = 0; m < frozenArr.length; m++) {
|
|
374
|
-
if (frozenArr[m] >= newIndex) {
|
|
375
|
-
newIndex--
|
|
376
|
-
}
|
|
377
|
-
if (frozenArr[m] >= oldIndex) {
|
|
378
|
-
oldIndex--
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
if (oldIndex !== null && oldIndex !== undefined && oldIndex !== -1 && newIndex !== null && newIndex !== undefined && newIndex !== -1) {
|
|
383
|
-
if (oldIndex > newIndex) {
|
|
384
|
-
// 从后往前
|
|
385
|
-
if (vm.columns && vm.columns.length > 0) {
|
|
386
|
-
const item = vm.columns[oldIndex]
|
|
387
|
-
for (var i = oldIndex - 1; i >= newIndex; i--) {
|
|
388
|
-
const col = vm.columns[i]
|
|
389
|
-
col.displayOrderType = 'custom'
|
|
390
|
-
vm.columns[i + 1] = col
|
|
391
|
-
}
|
|
392
|
-
vm.columns[newIndex] = item
|
|
393
|
-
}
|
|
394
|
-
} else {
|
|
395
|
-
// 从前往后
|
|
396
|
-
if (vm.columns && vm.columns.length > 0) {
|
|
397
|
-
const item = vm.columns[oldIndex]
|
|
398
|
-
for (var k = oldIndex + 1; k <= newIndex; k++) {
|
|
399
|
-
const col = vm.columns[k]
|
|
400
|
-
col.displayOrderType = 'custom'
|
|
401
|
-
vm.columns[k - 1] = col
|
|
402
|
-
}
|
|
403
|
-
vm.columns[newIndex] = item
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
vm.indexAfterTheChangeUpdateDisplayOrder(vm.columns, oldIndex, newIndex, 'displayOrder')
|
|
408
|
-
let splitArr = []
|
|
409
|
-
if (oldIndex > newIndex) {
|
|
410
|
-
// 从后往前
|
|
411
|
-
splitArr = vm.columns.slice(newIndex, oldIndex + 1)
|
|
412
|
-
} else {
|
|
413
|
-
// 从前往后
|
|
414
|
-
splitArr = vm.columns.slice(oldIndex, newIndex + 1)
|
|
415
|
-
}
|
|
416
|
-
const params = {
|
|
417
|
-
listCode: vm.code,
|
|
418
|
-
columns: splitArr
|
|
419
|
-
}
|
|
420
|
-
vm.$http.post(Vue.prototype.baseAPI + '/component/super-grids/drag-columns', params).then(data => {
|
|
421
|
-
console.log('移动成功')
|
|
422
|
-
})
|
|
423
|
-
// const oldIndex = evt.oldIndex
|
|
424
|
-
// const newIndex = evt.newIndex
|
|
425
|
-
// const currentItem = vm.columns[evt.oldIndex]
|
|
426
|
-
// const targetItem = vm.columns[evt.newIndex]
|
|
427
|
-
// const currentDisplayOrder = vm.getDisplayOrder(currentItem, oldIndex + 1)
|
|
428
|
-
// const targetDisplayOrder = vm.getDisplayOrder(targetItem, newIndex + 1)
|
|
429
|
-
// const params = {
|
|
430
|
-
// 'listCode': vm.code,
|
|
431
|
-
// 'oldIndex': currentDisplayOrder,
|
|
432
|
-
// 'newIndex': targetDisplayOrder,
|
|
433
|
-
// 'currentProp': currentItem.prop, // 当前拖动的列的属性名
|
|
434
|
-
// 'targetProp': targetItem.prop // 拖动的列的原属性名
|
|
435
|
-
// }
|
|
436
|
-
// vm.$http.post(Vue.prototype.baseAPI + '/component/super-grids/drag-columns', params).then(data => {
|
|
437
|
-
// vm.columns.splice(oldIndex, 1)
|
|
438
|
-
// vm.columns.splice(newIndex, 0, currentItem)
|
|
439
|
-
// vm.$set(currentItem, 'displayOrder', targetDisplayOrder)
|
|
440
|
-
// vm.$set(currentItem, 'displayOrderType', 'custom')
|
|
441
|
-
// vm.$set(targetItem, 'displayOrder', currentDisplayOrder)
|
|
442
|
-
// vm.$set(targetItem, 'displayOrderType', 'custom')
|
|
443
|
-
// })
|
|
444
|
-
}
|
|
445
|
-
})
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
// 作用于列表管理编辑模式
|
|
449
|
-
// 作用于列表管理编辑模式
|
|
450
|
-
if (typeof (this.options.isAdministerListView) !== 'undefined' && this.options.isAdministerListView != null &&
|
|
451
|
-
this.options.isAdministerListView === true && !isDragColumnFlag) {
|
|
452
|
-
const wrapperTr = document.querySelector('.el-table__header-wrapper tr')
|
|
453
|
-
if (wrapperTr != null) {
|
|
454
|
-
this.sortable = Sortable.create(wrapperTr, {
|
|
455
|
-
animation: 180,
|
|
456
|
-
delay: 0,
|
|
457
|
-
onEnd: evt => {
|
|
458
|
-
const oldIndex = evt.oldIndex
|
|
459
|
-
const newIndex = evt.newIndex
|
|
460
|
-
const oldItem = this.columns[evt.oldIndex]
|
|
461
|
-
const that = this
|
|
462
|
-
that.columns.splice(oldIndex, 1)
|
|
463
|
-
that.columns.splice(newIndex, 0, oldItem)
|
|
464
|
-
this.$emit('columnDrop', oldIndex, newIndex)
|
|
465
|
-
}
|
|
466
|
-
})
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
},
|
|
470
|
-
// 移动完成后的displayOrder设置
|
|
471
|
-
indexAfterTheChangeUpdateDisplayOrder(dataList, oldIndex, newIndex, prop) {
|
|
472
|
-
if (dataList && dataList.length > 0) {
|
|
473
|
-
if (oldIndex != null && oldIndex !== undefined && oldIndex !== -1) {
|
|
474
|
-
if (newIndex !== null && newIndex !== undefined && newIndex !== -1) {
|
|
475
|
-
if (prop && prop !== '') {
|
|
476
|
-
const selectCol = dataList[newIndex]
|
|
477
|
-
if (newIndex > oldIndex) {
|
|
478
|
-
// 表示向后移动
|
|
479
|
-
// 位置已经移动,所以参数要赋值给原始位置的下一个
|
|
480
|
-
const afProp = dataList[newIndex - 1][prop]
|
|
481
|
-
const arr = dataList.slice(oldIndex, newIndex)
|
|
482
|
-
if (arr && arr.length > 0) {
|
|
483
|
-
for (let i = arr.length - 1; i > -1; i--) {
|
|
484
|
-
const col = arr[i]
|
|
485
|
-
if (i === 0) {
|
|
486
|
-
// 紧靠原始位置的上一个
|
|
487
|
-
col[prop] = selectCol[prop]
|
|
488
|
-
} else {
|
|
489
|
-
col[prop] = arr[i - 1][prop]
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
selectCol[prop] = afProp
|
|
494
|
-
} else {
|
|
495
|
-
const befProp = dataList[newIndex + 1][prop]
|
|
496
|
-
// 表示向前移动
|
|
497
|
-
// 位置已经移动,所以参数要赋值给原始位置的上一个
|
|
498
|
-
const arr = dataList.slice(newIndex + 1, oldIndex + 1)
|
|
499
|
-
if (arr && arr.length > 0) {
|
|
500
|
-
for (let i = 0; i < arr.length; i++) {
|
|
501
|
-
const col = arr[i]
|
|
502
|
-
if (i === arr.length - 1) {
|
|
503
|
-
// 紧靠原始位置的上一个
|
|
504
|
-
col[prop] = selectCol[prop]
|
|
505
|
-
} else {
|
|
506
|
-
col[prop] = arr[i + 1][prop]
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
selectCol[prop] = befProp
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
},
|
|
517
|
-
getDisplayOrder(column, dragIndex) {
|
|
518
|
-
if (column && column.displayOrder !== undefined && column.displayOrder !== null) {
|
|
519
|
-
return column.displayOrder
|
|
520
|
-
} else {
|
|
521
|
-
return dragIndex + 1
|
|
522
|
-
}
|
|
523
|
-
},
|
|
524
|
-
getShowColumns(data) {
|
|
525
|
-
let showColumns = []
|
|
526
|
-
if (typeof (this.options.showColumns) !== 'undefined') {
|
|
527
|
-
showColumns = this.options.showColumns.split(',')
|
|
528
|
-
}
|
|
529
|
-
if (showColumns.length > 0) {
|
|
530
|
-
const columns = []
|
|
531
|
-
for (let i = 0; i < data.columns.length; i++) {
|
|
532
|
-
const column = data.columns[i]
|
|
533
|
-
const prop = column.prop
|
|
534
|
-
if (prop === '$index' || prop === '$selection') {
|
|
535
|
-
columns.push(column)
|
|
536
|
-
continue
|
|
537
|
-
}
|
|
538
|
-
if (column.hasOwnProperty('children')) {
|
|
539
|
-
// 表示是组合表头,需要判断子表头是否显示
|
|
540
|
-
const children = this.getChildrenColumns(column.children, showColumns)
|
|
541
|
-
column.children = children
|
|
542
|
-
if (children.length > 0) {
|
|
543
|
-
columns.push(column)
|
|
544
|
-
}
|
|
545
|
-
} else {
|
|
546
|
-
if (showColumns.indexOf(prop) >= 0) {
|
|
547
|
-
columns.push(column)
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
data.columns = columns
|
|
552
|
-
}
|
|
553
|
-
},
|
|
554
|
-
getChildrenColumns(children, showColumns) {
|
|
555
|
-
const columns = []
|
|
556
|
-
for (let i = 0; i < children.length; i++) {
|
|
557
|
-
const column = children[i]
|
|
558
|
-
const prop = column.prop
|
|
559
|
-
if (column.hasOwnProperty('children')) {
|
|
560
|
-
// 表示是组合表头,需要判断子表头是否显示
|
|
561
|
-
const children = this.getChildrenColumns(column.children, showColumns)
|
|
562
|
-
column.children = children
|
|
563
|
-
if (children.length > 0) {
|
|
564
|
-
columns.push(column)
|
|
565
|
-
}
|
|
566
|
-
} else {
|
|
567
|
-
if (showColumns.indexOf(prop) >= 0) {
|
|
568
|
-
columns.push(column)
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
return columns
|
|
573
|
-
},
|
|
574
|
-
// 保存拖动列宽
|
|
575
|
-
saveColumnWidth(prop, width) {
|
|
576
|
-
return new Promise((resolve, reject) => {
|
|
577
|
-
if (width !== undefined) {
|
|
578
|
-
const params = {
|
|
579
|
-
'prop': prop,
|
|
580
|
-
'width': width + ''
|
|
581
|
-
}
|
|
582
|
-
this.$http.post(Vue.prototype.baseAPI + '/component/super-grids/setting-column-widths/' + this.code, params).then(data => {
|
|
583
|
-
resolve(width)
|
|
584
|
-
}).catch(error => {
|
|
585
|
-
reject(error)
|
|
586
|
-
})
|
|
587
|
-
} else {
|
|
588
|
-
resolve()
|
|
589
|
-
}
|
|
590
|
-
})
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
export default superGridService
|