imatrix-ui 2.9.18-dw → 2.9.19-boe02
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,261 +0,0 @@
|
|
|
1
|
-
import store from './store'
|
|
2
|
-
import Vue from 'vue'
|
|
3
|
-
export function getColumnValues(data, prop) {
|
|
4
|
-
const values = []
|
|
5
|
-
for (const obj of data) {
|
|
6
|
-
values.push(obj[prop])
|
|
7
|
-
}
|
|
8
|
-
return values
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* 返回的数组表示当前列每行的合并情况:[3,0,0,1,1]表示1到3行合并,四五行不合并
|
|
12
|
-
* @param {Array} data 列表数据
|
|
13
|
-
* @param {String} prop 列名
|
|
14
|
-
*/
|
|
15
|
-
export function getSpanValuesForColumn(data, prop) {
|
|
16
|
-
const spanArr = []
|
|
17
|
-
let pos = 0
|
|
18
|
-
for (let i = 0; i < data.length; i++) {
|
|
19
|
-
if (i === 0) {
|
|
20
|
-
spanArr.push(1)
|
|
21
|
-
pos = 0
|
|
22
|
-
} else {
|
|
23
|
-
// 判断当前元素与上一个元素是否相同
|
|
24
|
-
if (data[i][prop] === data[i - 1][prop]) {
|
|
25
|
-
spanArr[pos] += 1
|
|
26
|
-
spanArr.push(0)
|
|
27
|
-
} else {
|
|
28
|
-
spanArr.push(1)
|
|
29
|
-
pos = i
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return spanArr
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function getFirstEditableColumn(listCode) {
|
|
37
|
-
if (!listCode) {
|
|
38
|
-
listCode = store.get('_nine_list_code')
|
|
39
|
-
}
|
|
40
|
-
if (listCode && listCode.indexOf('~') < 0) {
|
|
41
|
-
// 拼接默认的九宫格gridId
|
|
42
|
-
listCode = listCode + '~' + '_nineGrid'
|
|
43
|
-
}
|
|
44
|
-
for (const column of store.get(listCode).columns) {
|
|
45
|
-
if (column.editable) {
|
|
46
|
-
return column.prop
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return null
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const ArrowKeyAction = {
|
|
53
|
-
getIndex(prop) {
|
|
54
|
-
let i = 0
|
|
55
|
-
for (const column of store.columns) {
|
|
56
|
-
if (column.prop === prop) {
|
|
57
|
-
return i
|
|
58
|
-
} else {
|
|
59
|
-
i++
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
getLeftColumn(prop) {
|
|
64
|
-
const index = ArrowKeyAction.getIndex(prop)
|
|
65
|
-
let i = 0
|
|
66
|
-
for (i = index - 1; i >= 0; i--) {
|
|
67
|
-
if (store.columns[i].editable) {
|
|
68
|
-
return store.columns[i].prop
|
|
69
|
-
} else {
|
|
70
|
-
return null
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
export { ArrowKeyAction }
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* 是否是行编辑时的属性
|
|
80
|
-
* @param {*} event
|
|
81
|
-
*/
|
|
82
|
-
export function isHasEditOption(event, listCode) {
|
|
83
|
-
if (!listCode) {
|
|
84
|
-
listCode = store.get('_nine_list_code')
|
|
85
|
-
}
|
|
86
|
-
if (listCode && listCode.indexOf('~') < 0) {
|
|
87
|
-
// 拼接默认的九宫格gridId
|
|
88
|
-
listCode = listCode + '~' + '_nineGrid'
|
|
89
|
-
}
|
|
90
|
-
const gridParams = store.get(listCode)
|
|
91
|
-
if (gridParams.options.lineEditOptions && gridParams.options.lineEditOptions[event]) {
|
|
92
|
-
return true
|
|
93
|
-
}
|
|
94
|
-
return false
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export function isEditOptionFunction(event, listCode) {
|
|
98
|
-
if (!listCode) {
|
|
99
|
-
listCode = store.get('_nine_list_code')
|
|
100
|
-
}
|
|
101
|
-
if (listCode && listCode.indexOf('~') < 0) {
|
|
102
|
-
// 拼接默认的九宫格gridId
|
|
103
|
-
listCode = listCode + '~' + '_nineGrid'
|
|
104
|
-
}
|
|
105
|
-
const gridParams = store.get(listCode)
|
|
106
|
-
if (gridParams.options.lineEditOptions && typeof (gridParams.options.lineEditOptions[event]) === 'function') {
|
|
107
|
-
return true
|
|
108
|
-
}
|
|
109
|
-
return false
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* 是否是行编辑时的属性
|
|
114
|
-
* @param {*} event
|
|
115
|
-
*/
|
|
116
|
-
export function isHasOptionFunction(event, listCode) {
|
|
117
|
-
if (!listCode) {
|
|
118
|
-
listCode = store.get('_nine_list_code')
|
|
119
|
-
}
|
|
120
|
-
if (listCode && listCode.indexOf('~') < 0) {
|
|
121
|
-
// 拼接默认的九宫格gridId
|
|
122
|
-
listCode = listCode + '~' + '_nineGrid'
|
|
123
|
-
}
|
|
124
|
-
const gridParams = store.get(listCode)
|
|
125
|
-
if (gridParams.options && typeof (gridParams.options[event]) === 'function') {
|
|
126
|
-
return true
|
|
127
|
-
}
|
|
128
|
-
return false
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
export function isOptionFunction(props, listCode) {
|
|
132
|
-
if (!listCode) {
|
|
133
|
-
listCode = store.get('_nine_list_code')
|
|
134
|
-
}
|
|
135
|
-
if (listCode && listCode.indexOf('~') < 0) {
|
|
136
|
-
// 拼接默认的九宫格gridId
|
|
137
|
-
listCode = listCode + '~' + '_nineGrid'
|
|
138
|
-
}
|
|
139
|
-
const gridParams = store.get(listCode)
|
|
140
|
-
if (props.indexOf('.') > 0) {
|
|
141
|
-
let optionProp = gridParams.options
|
|
142
|
-
const propsArr = props.split('.')
|
|
143
|
-
for (let i = 0; i < propsArr.length; i++) {
|
|
144
|
-
const event = propsArr[i]
|
|
145
|
-
if (optionProp) {
|
|
146
|
-
if (typeof (optionProp[event]) === 'function') {
|
|
147
|
-
return true
|
|
148
|
-
} else {
|
|
149
|
-
optionProp = optionProp[event]
|
|
150
|
-
}
|
|
151
|
-
} else {
|
|
152
|
-
return false
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
} else {
|
|
156
|
-
if (gridParams.options && typeof (gridParams.options[event]) === 'function') {
|
|
157
|
-
return true
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* 获得控制表格需要的参数
|
|
164
|
-
*/
|
|
165
|
-
export function getGridParams() {
|
|
166
|
-
const gridParams = {
|
|
167
|
-
columns: [],
|
|
168
|
-
gridData: [],
|
|
169
|
-
orgGridData: [], // 行编辑保存时使用
|
|
170
|
-
showValidateError: true, // 是否可以显示验证信息,防止同时弹出两个验证信息的
|
|
171
|
-
options: {
|
|
172
|
-
// id: '_nineGrid', // 九宫格组件的元素id,影响格子拖动功能,当tab页签中有多个九宫格时必须配置该属性,如果当前页面中只有一个九宫格组件,不配也可以
|
|
173
|
-
// 附加参数
|
|
174
|
-
// extraParam: {},
|
|
175
|
-
// 表格及数据均加载完成后
|
|
176
|
-
// gridComplete: function(gridData, columns) {}, // gridData, columns
|
|
177
|
-
// 刚请求到字段配置,没有请求数据时,可以通过该方法修改表头或添加自定义表头
|
|
178
|
-
// loadBeforeSend: function(columns, settings) { return true }, // columns, settings(列表所有设置,包括字段设置、分页设置、查询设置、行编辑设置)
|
|
179
|
-
// 数据加载失败的回调方法
|
|
180
|
-
// loadError: function(code, error) {}, // code, error
|
|
181
|
-
// 数据请求成功后,表格记录显示前的回调方法,该方法主要是处理业务数据,比如:处理xss攻击
|
|
182
|
-
// gridDataLoaded: function(data) { return data },
|
|
183
|
-
// 查询组件需要的一些参数
|
|
184
|
-
// search: {
|
|
185
|
-
// // 属性自定义组件,当不是行编辑时,查询框需要自定义控件时
|
|
186
|
-
// customSearchElements: function(column) { return null },
|
|
187
|
-
// labelWidth: '150px',
|
|
188
|
-
// fieldNum: 4, // 查询的每行排放的字段个数,默认是4个字段
|
|
189
|
-
// },
|
|
190
|
-
// isSql:false, // 是否是sql查询数据内容。在使用sql语句查询表内容时,否则会导致列表字段的值不显示,都显示为空
|
|
191
|
-
// initSearchForm: [], // 初始查询条件,格式同“查询”按钮封装的json格式
|
|
192
|
-
// multiple: true/false,// 是否多选,默认以列表管理中配置的为准
|
|
193
|
-
// initSortInfo: {prop:'',order: 'ASC/DESC'},// 默认排序字段,和排序方式
|
|
194
|
-
// pageSizes: '20,30,50,100',// 可选行数
|
|
195
|
-
// initSearch: true/false, // 初始化时是否查询,默认是查询
|
|
196
|
-
// isHiddenSearchForm: false, //查询时,是否隐藏查询区域,不配置默认是显示的
|
|
197
|
-
// isHasCreate: true/false, // 是否显示新建按钮
|
|
198
|
-
// createPermission: 'a.b.c', // 新建按钮的资源编码,用于控制新建按钮的权限
|
|
199
|
-
// props: {imageUrl:'prop1', content:'prop1', title:'prop2', subTitle:'prop3'}, // 九宫格中图片、标题、副标题属性名配置
|
|
200
|
-
// operations: [ // 按钮区按钮信息
|
|
201
|
-
// {
|
|
202
|
-
// name:'修改',
|
|
203
|
-
// icon:'el-icon-edit',
|
|
204
|
-
// event: this.updateItem,
|
|
205
|
-
// permission:'sss.ddd.ddds'
|
|
206
|
-
// },
|
|
207
|
-
// {
|
|
208
|
-
// name:'删除',
|
|
209
|
-
// icon:'el-icon-delete',
|
|
210
|
-
// event: this.deleteItem
|
|
211
|
-
// },
|
|
212
|
-
// {
|
|
213
|
-
// name:'设为模板',
|
|
214
|
-
// icon:'el-icon-document-copy',
|
|
215
|
-
// event: this.setToTemplate
|
|
216
|
-
// }
|
|
217
|
-
// ]
|
|
218
|
-
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
}
|
|
222
|
-
return Vue.observable(gridParams)
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
export function addDynamicProp(target, prop, propValue) {
|
|
226
|
-
const nestedProp = prop.split('.')
|
|
227
|
-
if (nestedProp.length === 1) {
|
|
228
|
-
if (propValue !== undefined) {
|
|
229
|
-
target[prop] = propValue
|
|
230
|
-
} else {
|
|
231
|
-
target[prop] = null
|
|
232
|
-
}
|
|
233
|
-
return
|
|
234
|
-
}
|
|
235
|
-
// 如果是嵌套属性,就要逐层添加空对象,起点是searchForm,属性每多一层嵌套,parent就前进一层,到倒数第二层为止
|
|
236
|
-
let parent = target
|
|
237
|
-
for (let i = 0; i < nestedProp.length - 1; i++) {
|
|
238
|
-
if (parent[nestedProp[i]] === undefined) {
|
|
239
|
-
parent[nestedProp[i]] = {}
|
|
240
|
-
}
|
|
241
|
-
parent = parent[nestedProp[i]]
|
|
242
|
-
}
|
|
243
|
-
if (propValue !== undefined) {
|
|
244
|
-
parent[nestedProp[nestedProp.length - 1]] = propValue
|
|
245
|
-
} else {
|
|
246
|
-
parent[nestedProp[nestedProp.length - 1]] = null
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
export function getTableHeight(showSearch, searchForm) {
|
|
251
|
-
if (showSearch === true) {
|
|
252
|
-
let searchHeight = 0
|
|
253
|
-
if (searchForm) {
|
|
254
|
-
// 获得查询区高度
|
|
255
|
-
searchHeight = searchForm.$el.offsetHeight
|
|
256
|
-
}
|
|
257
|
-
return window.innerHeight - searchHeight - 165
|
|
258
|
-
} else {
|
|
259
|
-
return window.innerHeight - 165
|
|
260
|
-
}
|
|
261
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<svg :class="svgClass" aria-hidden="true">
|
|
3
|
-
<use :xlink:href="iconName" />
|
|
4
|
-
</svg>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
export default {
|
|
9
|
-
name: 'SvgIcon',
|
|
10
|
-
props: {
|
|
11
|
-
iconClass: {
|
|
12
|
-
type: String,
|
|
13
|
-
required: true
|
|
14
|
-
},
|
|
15
|
-
className: {
|
|
16
|
-
type: String,
|
|
17
|
-
default: ''
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
computed: {
|
|
21
|
-
iconName() {
|
|
22
|
-
return `#icon-${this.iconClass}`
|
|
23
|
-
},
|
|
24
|
-
svgClass() {
|
|
25
|
-
if (this.className) {
|
|
26
|
-
return 'svg-icon ' + this.className
|
|
27
|
-
} else {
|
|
28
|
-
return 'svg-icon'
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
</script>
|
|
34
|
-
|
|
35
|
-
<style scoped>
|
|
36
|
-
.svg-icon {
|
|
37
|
-
width: 1.2em;
|
|
38
|
-
height: 1.2em;
|
|
39
|
-
vertical-align: -0.25em;
|
|
40
|
-
fill: currentColor;
|
|
41
|
-
overflow: hidden;
|
|
42
|
-
}
|
|
43
|
-
</style>
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import localStorage from '../../src/utils/local-storage'
|
|
2
|
-
const memoryCacheUtils = {
|
|
3
|
-
memorySearch(queryString, cb) {
|
|
4
|
-
var memoryCacheData = this.memoryCacheData
|
|
5
|
-
var results = memoryCacheData
|
|
6
|
-
setTimeout(() => {
|
|
7
|
-
cb(results)
|
|
8
|
-
}, 10 * Math.random())
|
|
9
|
-
},
|
|
10
|
-
setMemoryCacheData(row, componentType) {
|
|
11
|
-
if (componentType === 'departmentUser') {
|
|
12
|
-
this.setDepartmentUserMemoryCacheData(row)
|
|
13
|
-
} else if (componentType === 'department') {
|
|
14
|
-
this.setDepartmentMemoryCacheData(row)
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
getMemoryCacheData(componentType) {
|
|
18
|
-
if (componentType === 'departmentUser') {
|
|
19
|
-
this.getDepartmentUserMemoryCacheData()
|
|
20
|
-
} else if (componentType === 'department') {
|
|
21
|
-
this.getDepartmentMemoryCacheData()
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
setDepartmentUserMemoryCacheData(selectUser) {
|
|
25
|
-
const cacheLength = 10
|
|
26
|
-
var memoryCacheData = localStorage.getObject(this.memoryCacheKey)
|
|
27
|
-
var name = (selectUser.name === undefined || selectUser.name === null || selectUser.name === 'undefined') ? '' : selectUser.name
|
|
28
|
-
var loginName = (selectUser.loginName === undefined || selectUser.loginName === null || selectUser.loginName === 'undefined') ? '' : selectUser.loginName
|
|
29
|
-
var mainDepartmentName = (selectUser.mainDepartmentName === undefined || selectUser.mainDepartmentName === null || selectUser.mainDepartmentName === 'undefined') ? '' : selectUser.mainDepartmentName
|
|
30
|
-
const valueKey = name + '(' + loginName + '/' + mainDepartmentName + ')'
|
|
31
|
-
var index = -1
|
|
32
|
-
if (memoryCacheData && memoryCacheData.length > 0) {
|
|
33
|
-
index = memoryCacheData.findIndex(item => item.loginName === selectUser.loginName)
|
|
34
|
-
} else {
|
|
35
|
-
memoryCacheData = []
|
|
36
|
-
}
|
|
37
|
-
selectUser['value'] = valueKey
|
|
38
|
-
if (index < 0) {
|
|
39
|
-
if (memoryCacheData.length === cacheLength) {
|
|
40
|
-
memoryCacheData.splice(cacheLength - 1, 1)
|
|
41
|
-
}
|
|
42
|
-
memoryCacheData.unshift(selectUser)
|
|
43
|
-
localStorage.setObject(this.memoryCacheKey, memoryCacheData)
|
|
44
|
-
} else {
|
|
45
|
-
// 最后选中优先排序
|
|
46
|
-
memoryCacheData.splice(index, 1)
|
|
47
|
-
memoryCacheData.unshift(selectUser)
|
|
48
|
-
localStorage.setObject(this.memoryCacheKey, memoryCacheData)
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
setDepartmentMemoryCacheData(selectDept) {
|
|
52
|
-
const cacheLength = 10
|
|
53
|
-
var memoryCacheData = localStorage.getObject(this.memoryCacheKey)
|
|
54
|
-
var name = (selectDept.name === undefined || selectDept.name === null || selectDept.name === 'undefined') ? '' : selectDept.name
|
|
55
|
-
var code = (selectDept.code === undefined || selectDept.code === null || selectDept.code === 'undefined') ? '' : selectDept.code
|
|
56
|
-
const valueKey = name + '(' + code + ')'
|
|
57
|
-
var index = -1
|
|
58
|
-
if (memoryCacheData && memoryCacheData.length > 0) {
|
|
59
|
-
index = memoryCacheData.findIndex(item => item.code === selectDept.code)
|
|
60
|
-
} else {
|
|
61
|
-
memoryCacheData = []
|
|
62
|
-
}
|
|
63
|
-
selectDept['value'] = valueKey
|
|
64
|
-
if (index < 0) {
|
|
65
|
-
if (memoryCacheData.length === cacheLength) {
|
|
66
|
-
memoryCacheData.splice(cacheLength - 1, 1)
|
|
67
|
-
}
|
|
68
|
-
memoryCacheData.unshift(selectDept)
|
|
69
|
-
localStorage.setObject(this.memoryCacheKey, memoryCacheData)
|
|
70
|
-
} else {
|
|
71
|
-
// 最后选中优先排序
|
|
72
|
-
memoryCacheData.splice(index, 1)
|
|
73
|
-
memoryCacheData.unshift(selectDept)
|
|
74
|
-
localStorage.setObject(this.memoryCacheKey, memoryCacheData)
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
getDepartmentUserMemoryCacheData() {
|
|
78
|
-
var memoryCacheData = localStorage.getObject(this.memoryCacheKey)
|
|
79
|
-
if (memoryCacheData && memoryCacheData.length > 0) {
|
|
80
|
-
this.memoryCacheData = memoryCacheData
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
getDepartmentMemoryCacheData() {
|
|
84
|
-
var memoryCacheData = localStorage.getObject(this.memoryCacheKey)
|
|
85
|
-
if (memoryCacheData && memoryCacheData.length > 0) {
|
|
86
|
-
this.memoryCacheData = memoryCacheData
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
export default memoryCacheUtils
|
package/packages/utils/utils.js
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import { getI18n } from '../../src/utils/util'
|
|
2
|
-
import Vue from 'vue'
|
|
3
|
-
const utils = {
|
|
4
|
-
getSearchUserFields() {
|
|
5
|
-
const i18n = getI18n()
|
|
6
|
-
return [
|
|
7
|
-
{ value: 'name', label: i18n.t('departmentUserTree.searchFieldUserName') },
|
|
8
|
-
{ value: 'loginName', label: i18n.t('departmentUserTree.searchFieldLoginName') },
|
|
9
|
-
{ value: 'email', label: i18n.t('departmentUserTree.searchFieldEmail') },
|
|
10
|
-
{ value: 'telephone', label: i18n.t('departmentUserTree.searchFieldTelephone') },
|
|
11
|
-
{ value: 'jobNumber', label: i18n.t('departmentUserTree.searchFieldJobNumber') },
|
|
12
|
-
{ value: 'honorificName', label: i18n.t('departmentUserTree.searchFieldHonorificName') }
|
|
13
|
-
]
|
|
14
|
-
},
|
|
15
|
-
removeRow(arr, row) {
|
|
16
|
-
var length = arr.length
|
|
17
|
-
for (var i = 0; i < length; i++) {
|
|
18
|
-
if (arr[i].id === row.id) {
|
|
19
|
-
if (i === 0) {
|
|
20
|
-
arr.shift() // 删除并返回数组的第一个元素
|
|
21
|
-
return arr
|
|
22
|
-
} else if (i === length - 1) {
|
|
23
|
-
arr.pop() // 删除并返回数组的最后一个元素
|
|
24
|
-
return arr
|
|
25
|
-
} else {
|
|
26
|
-
arr.splice(i, 1) // 删除下标为i的元素
|
|
27
|
-
return arr
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return arr
|
|
32
|
-
},
|
|
33
|
-
storeSeachValue(localStorage, searchStoreKey, searchValue) {
|
|
34
|
-
// localStorage.removeItem(searchStoreKey)
|
|
35
|
-
if (searchValue && searchValue !== '') {
|
|
36
|
-
// 查询条件不为空
|
|
37
|
-
var searchValues = localStorage.getObject(searchStoreKey)
|
|
38
|
-
if (searchValues && searchValues.length > 0) {
|
|
39
|
-
// 表示缓存中已有部门查询条件,则追加该查询条件
|
|
40
|
-
var containsResult = searchValues.filter(this.createFilter(searchValue))
|
|
41
|
-
if (containsResult.length === 0) {
|
|
42
|
-
// 如果不包含相同的查询条件,则添加,如果包含则不需要再添加
|
|
43
|
-
const searchValueObj = { value: searchValue }
|
|
44
|
-
searchValues.push(searchValueObj)
|
|
45
|
-
localStorage.setObject(searchStoreKey, searchValues)
|
|
46
|
-
}
|
|
47
|
-
} else {
|
|
48
|
-
var searchValuesArr = []
|
|
49
|
-
const searchValueObj = { value: searchValue }
|
|
50
|
-
searchValuesArr.push(searchValueObj)
|
|
51
|
-
localStorage.setObject(searchStoreKey, searchValuesArr)
|
|
52
|
-
}
|
|
53
|
-
this.restaurants = localStorage.getObject(searchStoreKey)
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
createFilter(queryString) {
|
|
57
|
-
return (restaurant) => {
|
|
58
|
-
return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0)
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
handleSelectUtil(item, localStorage) {
|
|
62
|
-
this.storeSeachValue(localStorage, this.searchStoreKey, this.filterText)
|
|
63
|
-
this.search(item.value)
|
|
64
|
-
},
|
|
65
|
-
analysisLabelTag(labelTag, row, contextParam, additionalParam) {
|
|
66
|
-
let returnStr = ''
|
|
67
|
-
if (labelTag) {
|
|
68
|
-
let tags
|
|
69
|
-
if (labelTag !== '' && typeof (labelTag) === 'string') {
|
|
70
|
-
tags = labelTag.split('-#-#')
|
|
71
|
-
} else if (typeof (labelTag) === 'object') {
|
|
72
|
-
tags = labelTag
|
|
73
|
-
}
|
|
74
|
-
if (tags && tags.length > 0) {
|
|
75
|
-
for (var i = 0; i < tags.length; i++) {
|
|
76
|
-
let tag = tags[i]
|
|
77
|
-
if (tag.indexOf('obj.') !== -1) {
|
|
78
|
-
tag = tag.replace('${obj.', '').replace('}', '')
|
|
79
|
-
if (row) {
|
|
80
|
-
let originalValue = row[tag]
|
|
81
|
-
if (this.childIsObjectProp(tag)) {
|
|
82
|
-
originalValue = this.childObjectPropOriginalValue(row, tag)
|
|
83
|
-
}
|
|
84
|
-
returnStr += originalValue
|
|
85
|
-
}
|
|
86
|
-
} else if (tag.indexOf('request.') !== -1) {
|
|
87
|
-
tag = tag.replace('${request.', '').replace('}', '')
|
|
88
|
-
if (additionalParam) {
|
|
89
|
-
const originalValue = additionalParam[tag]
|
|
90
|
-
if (originalValue) {
|
|
91
|
-
returnStr += originalValue
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
} else if (tag.indexOf('input.') !== -1) {
|
|
95
|
-
tag = tag.replace('${input.', '').replace('}', '')
|
|
96
|
-
returnStr += tag
|
|
97
|
-
} else if (tag.indexOf('context.') !== -1) {
|
|
98
|
-
tag = tag.replace('${context.', '').replace('}', '')
|
|
99
|
-
if (contextParam) {
|
|
100
|
-
const originalValue = contextParam[tag]
|
|
101
|
-
if (originalValue) {
|
|
102
|
-
returnStr += originalValue
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
return returnStr
|
|
110
|
-
},
|
|
111
|
-
childIsObjectProp(prop) {
|
|
112
|
-
if (prop.indexOf('.') > 0) {
|
|
113
|
-
return true
|
|
114
|
-
} else {
|
|
115
|
-
return false
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
childObjectPropOriginalValue(row, prop) {
|
|
119
|
-
try {
|
|
120
|
-
let objValue = row
|
|
121
|
-
const props = prop.split('.')
|
|
122
|
-
props.forEach(subProp => {
|
|
123
|
-
if (objValue) {
|
|
124
|
-
objValue = objValue[subProp]
|
|
125
|
-
} else {
|
|
126
|
-
objValue = ''
|
|
127
|
-
throw objValue
|
|
128
|
-
}
|
|
129
|
-
})
|
|
130
|
-
return objValue
|
|
131
|
-
} catch (e) {
|
|
132
|
-
return ''
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
// 根据指定用户信息获得用户集合
|
|
136
|
-
getSelectUsers(searchField, selectUserInfo, separator) {
|
|
137
|
-
return new Promise((resolve, reject) => {
|
|
138
|
-
if (!searchField) {
|
|
139
|
-
resolve([])
|
|
140
|
-
} else if (!selectUserInfo) {
|
|
141
|
-
resolve([])
|
|
142
|
-
} else {
|
|
143
|
-
this.$http.get(Vue.prototype.baseAPI + '/component/organization-trees/select-users?searchField=' + searchField + '&selectUserInfo=' + selectUserInfo + '&separator=' + separator).then(users => {
|
|
144
|
-
resolve(users)
|
|
145
|
-
}).catch(error => {
|
|
146
|
-
reject(error)
|
|
147
|
-
})
|
|
148
|
-
}
|
|
149
|
-
})
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
export default utils
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-undef */
|
|
2
|
-
import Vue from 'vue'
|
|
3
|
-
/**
|
|
4
|
-
* 封装值设置为枚举 或 bean方式时的值为'key-value'键值对信息
|
|
5
|
-
*/
|
|
6
|
-
export function packageEnumAndBeanColumnValueSets(columns, listCode) {
|
|
7
|
-
return new Promise((resolve, reject) => {
|
|
8
|
-
const valueSetColumnsInfo = {
|
|
9
|
-
listCode: listCode,
|
|
10
|
-
valueSetMetas: []
|
|
11
|
-
}
|
|
12
|
-
const valueSetColumnIndexs = []
|
|
13
|
-
for (let i = 0; i < columns.length; i++) {
|
|
14
|
-
const column = columns[i]
|
|
15
|
-
const prop = column.prop ? column.prop : column.label
|
|
16
|
-
const columnValueSet = packageEnumAndBeanColumnValueSet(column)
|
|
17
|
-
let titleValueSet = null
|
|
18
|
-
const titleValueSetJson = column.titleValueSet
|
|
19
|
-
if (titleValueSetJson) {
|
|
20
|
-
titleValueSet = packageEnumAndBeanColumnValueSet(JSON.parse(titleValueSetJson))
|
|
21
|
-
}
|
|
22
|
-
if (columnValueSet || titleValueSet) {
|
|
23
|
-
const valueSetMeta = {
|
|
24
|
-
prop: prop
|
|
25
|
-
}
|
|
26
|
-
if (columnValueSet) {
|
|
27
|
-
// 字段的值设置
|
|
28
|
-
valueSetMeta.valueSet = columnValueSet
|
|
29
|
-
}
|
|
30
|
-
if (titleValueSet) {
|
|
31
|
-
valueSetMeta.titleValueSet = titleValueSet
|
|
32
|
-
}
|
|
33
|
-
valueSetColumnsInfo.valueSetMetas.push(valueSetMeta)
|
|
34
|
-
valueSetColumnIndexs.push(i)
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
if (valueSetColumnsInfo.valueSetMetas.length > 0) {
|
|
38
|
-
Vue.prototype.$http.post(Vue.prototype.baseURL + '/common/super-grids/value-sets', valueSetColumnsInfo).then(columnValueSets => {
|
|
39
|
-
valueSetColumnIndexs.forEach(columnIndex => {
|
|
40
|
-
let valueSetMap
|
|
41
|
-
const prop = columns[columnIndex].prop ? columns[columnIndex].prop : columns[columnIndex].label
|
|
42
|
-
for (const prop1 in columnValueSets) {
|
|
43
|
-
if (prop === prop1) {
|
|
44
|
-
valueSetMap = columnValueSets[prop]
|
|
45
|
-
break
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
if (valueSetMap) {
|
|
49
|
-
if (valueSetMap.valueSet) {
|
|
50
|
-
columns[columnIndex].valueSet = valueSetMap.valueSet
|
|
51
|
-
}
|
|
52
|
-
if (valueSetMap.titleValueSet) {
|
|
53
|
-
columns[columnIndex].titleValueSetValue = valueSetMap.titleValueSet
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
})
|
|
57
|
-
resolve(columns)
|
|
58
|
-
}).catch((error) => {
|
|
59
|
-
reject(error)
|
|
60
|
-
})
|
|
61
|
-
} else {
|
|
62
|
-
resolve(columns)
|
|
63
|
-
}
|
|
64
|
-
})
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function packageEnumAndBeanColumnValueSet(valueSetInfo) {
|
|
68
|
-
/**
|
|
69
|
-
* 枚举类型值设置前缀
|
|
70
|
-
*/
|
|
71
|
-
const ENUM_NAME_PREFIX = 'enumname:'
|
|
72
|
-
/**
|
|
73
|
-
* bean形式值设置前缀
|
|
74
|
-
*/
|
|
75
|
-
const BEAN_NAME_PREFIX = 'beanname:'
|
|
76
|
-
const enumName = valueSetInfo.enumName
|
|
77
|
-
const beanName = valueSetInfo.beanName
|
|
78
|
-
if (enumName && enumName !== '') {
|
|
79
|
-
if (valueSetInfo.remoteEnum === true) {
|
|
80
|
-
// 需要远程获得枚举值
|
|
81
|
-
return ENUM_NAME_PREFIX + enumName
|
|
82
|
-
}
|
|
83
|
-
} else if (beanName && beanName !== '') {
|
|
84
|
-
return BEAN_NAME_PREFIX + beanName
|
|
85
|
-
}
|
|
86
|
-
}
|