agilebuilder-ui 1.0.85 → 1.0.87-temp1
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.js +24626 -23708
- package/lib/super-ui.umd.cjs +76 -76
- package/package.json +2 -2
- package/packages/dynamic-source-select/src/dynamic-source-select.vue +3 -0
- package/packages/fs-upload-list/src/fs-upload-list.vue +2 -1
- package/packages/index.js +5 -2
- package/packages/rich-editor/index.vue +1 -1
- package/packages/row-form/index.js +7 -0
- package/packages/row-form/index.vue +211 -0
- package/packages/super-grid/src/apis.js +26 -0
- package/packages/super-grid/src/components/grid-icon.vue +7 -14
- package/packages/super-grid/src/components/hyperlinks.vue +24 -8
- package/packages/super-grid/src/custom-formatter.js +312 -386
- package/packages/super-grid/src/dynamic-input.vue +8 -1
- package/packages/super-grid/src/normal-column-content.vue +1079 -0
- package/packages/super-grid/src/normal-column.vue +41 -752
- package/packages/super-grid/src/row-detail.vue +50 -0
- package/packages/super-grid/src/search-form-advancedQuery.vue +6 -1
- package/packages/super-grid/src/search-form-item.vue +6 -1
- package/packages/super-grid/src/super-grid-service.js +41 -1
- package/packages/super-grid/src/super-grid.vue +123 -49
- package/packages/super-grid/src/utils.js +80 -56
- package/src/i18n/langs/cn.js +4 -1
- package/src/i18n/langs/en.js +3 -0
- package/src/permission.js +7 -1
- package/src/store/modules/user.js +4 -1
- package/src/styles/theme/dark-blue/button.scss +2 -2
- package/src/styles/theme/dark-blue/index.scss +1 -1
- package/src/styles/theme/green/button.scss +2 -2
- package/src/styles/theme/green/index.scss +1 -1
- package/src/styles/theme/ocean-blue/button.scss +2 -2
- package/src/styles/theme/ocean-blue/index.scss +1 -1
- package/src/utils/jump-page-utils.js +199 -321
- package/src/utils/permissionAuth.js +1 -1
- package/src/views/layout/components/Menubar/Item.vue +27 -4
- package/src/views/layout/components/Menubar/SidebarItem.vue +6 -2
- package/src/views/layout/components/Menubar/index.vue +14 -2
|
@@ -1,406 +1,323 @@
|
|
|
1
|
-
import {$emit} from '../../utils/gogocodeTransfer'
|
|
2
|
-
import {doFormat} from './formatter'
|
|
1
|
+
import { $emit } from '../../utils/gogocodeTransfer'
|
|
2
|
+
import { doFormat } from './formatter'
|
|
3
3
|
import store from './store'
|
|
4
|
-
import {initialization, jumpToPage} from '../../../src/utils/jump-page-utils'
|
|
5
|
-
import {analysisFileSetObj, otherFilesToStandard} from './utils'
|
|
6
|
-
import {isPromise} from '../../../src/utils/common-util'
|
|
7
|
-
|
|
4
|
+
import { initialization, jumpToPage } from '../../../src/utils/jump-page-utils'
|
|
5
|
+
import { analysisFileSetObj, otherFilesToStandard } from './utils'
|
|
6
|
+
import { isPromise } from '../../../src/utils/common-util'
|
|
8
7
|
|
|
9
8
|
const customFormatter = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
9
|
+
/**
|
|
10
|
+
* 自定义格式化值
|
|
11
|
+
* @param {prop} 属性名
|
|
12
|
+
* @param {formatValue} 格式化后的值
|
|
13
|
+
* @param {format} 格式化方法
|
|
14
|
+
* @param {componentName} 组件名
|
|
15
|
+
*/
|
|
16
|
+
customFormatValue(row, prop, format, rowIndex) {
|
|
17
|
+
// const start = new Date().getTime()
|
|
18
|
+
// console.log('---super-grid--customFormatValue--this.customFormat=', this.customFormat)
|
|
19
|
+
if (this.customFormat) {
|
|
20
|
+
let originalValue = row[prop]
|
|
21
|
+
if (this.isObjectProp(prop)) {
|
|
22
|
+
originalValue = this.objectPropOriginalValue(row, prop)
|
|
23
|
+
}
|
|
24
|
+
const formatValue = doFormat(this.column, originalValue)
|
|
25
|
+
const component = format.call(this, originalValue, formatValue, row, this.column, rowIndex)
|
|
26
|
+
// console.log('---super-grid--customFormatValue--component=', component)
|
|
27
|
+
if (typeof component === 'undefined') {
|
|
28
|
+
return false
|
|
29
|
+
} else {
|
|
30
|
+
// const aa = defineCustomElement(component)
|
|
31
|
+
// window.customElements.define(prop + rowIndex , aa)
|
|
32
|
+
window.$vueApp.component(prop + rowIndex, component)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// const end = new Date().getTime()
|
|
36
|
+
// console.log('---super-grid--customFormatValue--time1=', (end - start))
|
|
37
|
+
return true
|
|
38
|
+
} else {
|
|
39
|
+
// const end = new Date().getTime()
|
|
40
|
+
// console.log('---super-grid--customFormatValue--time2=', (end - start))
|
|
41
|
+
return false
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
isObjectProp(prop) {
|
|
46
|
+
// const start = new Date().getTime()
|
|
47
|
+
// console.log('---super-grid--isObjectProp--')
|
|
48
|
+
if (prop && prop.indexOf('.') > 0) {
|
|
49
|
+
// const end = new Date().getTime()
|
|
50
|
+
// console.log('---super-grid--isObjectProp--time1=', (end - start))
|
|
51
|
+
return true
|
|
52
|
+
} else {
|
|
53
|
+
// const end = new Date().getTime()
|
|
54
|
+
// console.log('---super-grid--isObjectProp--time2=', (end - start))
|
|
55
|
+
return false
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
objectPropOriginalValue(row, prop) {
|
|
60
|
+
try {
|
|
61
|
+
// console.log('---super-grid--objectPropOriginalValue--')
|
|
62
|
+
let objValue = row
|
|
63
|
+
if (prop && prop.indexOf('.') > 0) {
|
|
64
|
+
const props = prop.split('.')
|
|
65
|
+
props.forEach((subProp) => {
|
|
66
|
+
if (objValue) {
|
|
67
|
+
objValue = objValue[subProp]
|
|
68
|
+
} else {
|
|
69
|
+
objValue = ''
|
|
70
|
+
throw objValue
|
|
71
|
+
}
|
|
72
|
+
})
|
|
73
|
+
return objValue
|
|
74
|
+
} else {
|
|
75
|
+
return row[prop]
|
|
76
|
+
}
|
|
77
|
+
} catch (e) {
|
|
78
|
+
// console.log(e)
|
|
79
|
+
return ''
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
objectPropValue(row, prop) {
|
|
84
|
+
return this.formatter(row, prop, this.column)
|
|
85
|
+
},
|
|
86
|
+
// 获取显示的值
|
|
87
|
+
// 附件类型,显示值与实际值不相同。如果时子表多选,需要单独判断
|
|
88
|
+
objectPropValueTwo(row, column) {
|
|
89
|
+
if ((column.componentType === 'annex' || column.componentType === 'multipartUpload') && column.fileSet) {
|
|
90
|
+
// 判断是否是对象集合(子表存储)
|
|
91
|
+
const fileSetObj = JSON.parse(column.fileSet)
|
|
92
|
+
if (fileSetObj.childAnnexDataTableCode) {
|
|
93
|
+
// 获取存好的json并解析
|
|
94
|
+
const keyValueParam = analysisFileSetObj(fileSetObj, this.isSql)
|
|
95
|
+
// 子表存储。返回最后一个对象的展示名称
|
|
96
|
+
const fileArr = this.objectPropValue(row, column.prop)
|
|
97
|
+
if (fileArr && fileArr.length > 0) {
|
|
98
|
+
const fileList = otherFilesToStandard(fileSetObj, keyValueParam, fileArr, null)
|
|
99
|
+
return fileList[fileList.length - 1].showName
|
|
87
100
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
if (fileSetObj.childAnnexDataTableCode) {
|
|
103
|
-
// 获取存好的json并解析
|
|
104
|
-
const keyValueParam = analysisFileSetObj(fileSetObj, this.isSql)
|
|
105
|
-
// 子表存储。返回最后一个对象的展示名称
|
|
106
|
-
const fileArr = this.objectPropValue(row, column.prop)
|
|
107
|
-
if (fileArr && fileArr.length > 0) {
|
|
108
|
-
const fileList = otherFilesToStandard(
|
|
109
|
-
fileSetObj,
|
|
110
|
-
keyValueParam,
|
|
111
|
-
fileArr,
|
|
112
|
-
null
|
|
113
|
-
)
|
|
114
|
-
return fileList[fileList.length - 1].showName
|
|
115
|
-
}
|
|
116
|
-
} else {
|
|
117
|
-
return this.objectPropValue(row, column.prop)
|
|
118
|
-
}
|
|
119
|
-
} else if (column.formatter && column.formatter.type === 'files') {
|
|
120
|
-
// 判断是否是对象集合(子表存储)
|
|
121
|
-
const fileSetObj = JSON.parse(column.formatter.options.fileSet)
|
|
122
|
-
if (fileSetObj.childAnnexDataTableCode) {
|
|
123
|
-
// 获取存好的json并解析
|
|
124
|
-
const keyValueParam = analysisFileSetObj(fileSetObj, this.isSql)
|
|
125
|
-
// 子表存储。返回最后一个对象的展示名称
|
|
126
|
-
const fileArr = this.objectPropValue(row, column.prop)
|
|
127
|
-
if (fileArr && fileArr.length > 0) {
|
|
128
|
-
const fileList = otherFilesToStandard(
|
|
129
|
-
fileSetObj,
|
|
130
|
-
keyValueParam,
|
|
131
|
-
fileArr,
|
|
132
|
-
null
|
|
133
|
-
)
|
|
134
|
-
return fileList[fileList.length - 1].showName
|
|
135
|
-
}
|
|
136
|
-
} else {
|
|
137
|
-
return this.objectPropValue(row, column.prop)
|
|
138
|
-
}
|
|
139
|
-
} else {
|
|
140
|
-
return this.objectPropValue(row, column.prop)
|
|
101
|
+
} else {
|
|
102
|
+
return this.objectPropValue(row, column.prop)
|
|
103
|
+
}
|
|
104
|
+
} else if (column.formatter && column.formatter.type === 'files') {
|
|
105
|
+
// 判断是否是对象集合(子表存储)
|
|
106
|
+
const fileSetObj = JSON.parse(column.formatter.options.fileSet)
|
|
107
|
+
if (fileSetObj.childAnnexDataTableCode) {
|
|
108
|
+
// 获取存好的json并解析
|
|
109
|
+
const keyValueParam = analysisFileSetObj(fileSetObj, this.isSql)
|
|
110
|
+
// 子表存储。返回最后一个对象的展示名称
|
|
111
|
+
const fileArr = this.objectPropValue(row, column.prop)
|
|
112
|
+
if (fileArr && fileArr.length > 0) {
|
|
113
|
+
const fileList = otherFilesToStandard(fileSetObj, keyValueParam, fileArr, null)
|
|
114
|
+
return fileList[fileList.length - 1].showName
|
|
141
115
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
116
|
+
} else {
|
|
117
|
+
return this.objectPropValue(row, column.prop)
|
|
118
|
+
}
|
|
119
|
+
} else {
|
|
120
|
+
return this.objectPropValue(row, column.prop)
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
formatter(row, prop, column) {
|
|
124
|
+
const cellValue = this.objectPropOriginalValue(row, prop)
|
|
125
|
+
if (this.columnFormatter !== undefined && this.columnFormatter.type === 'custom') {
|
|
126
|
+
// 自定义事件
|
|
127
|
+
let funName
|
|
128
|
+
if (this.columnFormatter.options && this.columnFormatter.options.format) {
|
|
129
|
+
funName = this.columnFormatter.options.format
|
|
130
|
+
}
|
|
131
|
+
if (funName && funName !== null && funName !== '') {
|
|
132
|
+
const gridParams = store.get(this.listCode)
|
|
145
133
|
if (
|
|
146
|
-
|
|
147
|
-
|
|
134
|
+
gridParams.options &&
|
|
135
|
+
gridParams.options['eventCallBack'] &&
|
|
136
|
+
gridParams.options['eventCallBack'][funName] &&
|
|
137
|
+
typeof gridParams.options['eventCallBack'][funName] === 'function'
|
|
148
138
|
) {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
gridParams.options &&
|
|
158
|
-
gridParams.options['eventCallBack'] &&
|
|
159
|
-
gridParams.options['eventCallBack'][funName] &&
|
|
160
|
-
typeof gridParams.options['eventCallBack'][funName] === 'function'
|
|
161
|
-
) {
|
|
162
|
-
const param = {
|
|
163
|
-
value: cellValue,
|
|
164
|
-
row: row,
|
|
165
|
-
column: this.column,
|
|
166
|
-
prop: prop,
|
|
167
|
-
additionalParamMap: gridParams.additionalParamMap,
|
|
168
|
-
}
|
|
169
|
-
return gridParams.options['eventCallBack'][funName].call(this, param)
|
|
170
|
-
} else {
|
|
171
|
-
return doFormat(column, cellValue)
|
|
172
|
-
}
|
|
173
|
-
} else {
|
|
174
|
-
return doFormat(column, cellValue)
|
|
175
|
-
}
|
|
139
|
+
const param = {
|
|
140
|
+
value: cellValue,
|
|
141
|
+
row: row,
|
|
142
|
+
column: this.column,
|
|
143
|
+
prop: prop,
|
|
144
|
+
additionalParamMap: gridParams.additionalParamMap
|
|
145
|
+
}
|
|
146
|
+
return gridParams.options['eventCallBack'][funName].call(this, param)
|
|
176
147
|
} else {
|
|
177
|
-
|
|
148
|
+
return doFormat(column, cellValue)
|
|
178
149
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
150
|
+
} else {
|
|
151
|
+
return doFormat(column, cellValue)
|
|
152
|
+
}
|
|
153
|
+
} else {
|
|
154
|
+
return doFormat(column, cellValue)
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
getColumnValue(row, column) {
|
|
158
|
+
const prop = column.prop
|
|
159
|
+
let originalValue = row[prop]
|
|
160
|
+
if (this.isObjectProp(prop)) {
|
|
161
|
+
originalValue = this.objectPropOriginalValue(row, prop)
|
|
162
|
+
}
|
|
163
|
+
const formatValue = doFormat(column, originalValue)
|
|
164
|
+
return {
|
|
165
|
+
originalValue,
|
|
166
|
+
formatValue
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
onClickFun(row, column, onClick, rowIndex, button) {
|
|
170
|
+
const values = this.getColumnValue(row, column)
|
|
171
|
+
onClick.call(this, values.originalValue, values.formatValue, row, column, rowIndex, button)
|
|
172
|
+
},
|
|
173
|
+
isShowButtonFun(row, column, isShowFun, rowIndex) {
|
|
174
|
+
if (isShowFun === undefined) {
|
|
175
|
+
return true
|
|
176
|
+
}
|
|
177
|
+
if (typeof isShowFun === 'function') {
|
|
178
|
+
const values = this.getColumnValue(row, column)
|
|
179
|
+
let isShow = isShowFun.call(this, values.originalValue, values.formatValue, row, column, rowIndex)
|
|
180
|
+
if (isShow === undefined) {
|
|
181
|
+
isShow = true
|
|
182
|
+
}
|
|
183
|
+
return isShow
|
|
184
|
+
} else {
|
|
185
|
+
return isShowFun
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
// 超链接解析
|
|
189
|
+
getHyperLinkSetting(column, row, isSql, additionalParamerter, contextParameter, tableName, listCode) {
|
|
190
|
+
const gridParams = store.get(listCode)
|
|
191
|
+
let parentFormData = null
|
|
192
|
+
if (gridParams.options.extraParam && gridParams.options.extraParam.entityMap) {
|
|
193
|
+
parentFormData = gridParams.options.extraParam.entityMap
|
|
194
|
+
}
|
|
195
|
+
let hyperLinkResult = {}
|
|
196
|
+
let jumpPageJson
|
|
197
|
+
if (column && column.formatter && column.formatter.options && column.formatter.options.format) {
|
|
198
|
+
jumpPageJson = column.formatter.options.format
|
|
199
|
+
}
|
|
200
|
+
if (jumpPageJson && jumpPageJson !== '') {
|
|
201
|
+
// 解析是否需要显示该超链接
|
|
202
|
+
const result = initialization(
|
|
203
|
+
JSON.parse(jumpPageJson),
|
|
229
204
|
row,
|
|
230
205
|
isSql,
|
|
231
206
|
additionalParamerter,
|
|
232
207
|
contextParameter,
|
|
233
208
|
tableName,
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
)
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
// 表示显示超链接
|
|
280
|
-
hyperLinkResult.visible = true
|
|
281
|
-
hyperLinkResult.label = this.objectPropValueTwo(row, column)
|
|
282
|
-
hyperLinkResult.title = hyperLinkResult.label
|
|
283
|
-
}
|
|
284
|
-
return hyperLinkResult
|
|
285
|
-
},
|
|
286
|
-
// 点击超链接
|
|
287
|
-
clickHyperLink(column, row, listCode, rowIndex) {
|
|
288
|
-
let jumpPageJson
|
|
289
|
-
if (
|
|
290
|
-
column &&
|
|
291
|
-
column.formatter &&
|
|
292
|
-
column.formatter.options &&
|
|
293
|
-
column.formatter.options.format
|
|
294
|
-
) {
|
|
295
|
-
jumpPageJson = column.formatter.options.format
|
|
296
|
-
}
|
|
297
|
-
if (jumpPageJson && jumpPageJson !== '') {
|
|
298
|
-
// 解析是否需要显示该超链接
|
|
299
|
-
let canClick = true
|
|
300
|
-
const gridParams = store.get(listCode)
|
|
301
|
-
const jumpPageSetting = JSON.parse(jumpPageJson)
|
|
302
|
-
console.log(
|
|
303
|
-
'gupre-grid---clickHyperLink--jumpPageSetting=',
|
|
304
|
-
jumpPageSetting
|
|
305
|
-
)
|
|
306
|
-
if (jumpPageSetting.beforeClick) {
|
|
307
|
-
const funName = jumpPageSetting.beforeClick
|
|
308
|
-
console.log(
|
|
309
|
-
'gupre-grid---clickHyperLink--jumpPageSetting.beforeClick=',
|
|
310
|
-
funName
|
|
311
|
-
)
|
|
312
|
-
console.log(
|
|
313
|
-
'gupre-grid---clickHyperLink--gridParams.options[eventCallBack]=',
|
|
314
|
-
gridParams.options['eventCallBack']
|
|
315
|
-
)
|
|
316
|
-
if (
|
|
317
|
-
gridParams.options &&
|
|
318
|
-
gridParams.options['eventCallBack'] &&
|
|
319
|
-
gridParams.options['eventCallBack'][funName] &&
|
|
320
|
-
typeof gridParams.options['eventCallBack'][funName] === 'function'
|
|
321
|
-
) {
|
|
322
|
-
const param = {
|
|
323
|
-
row: row,
|
|
324
|
-
column: column,
|
|
325
|
-
rowIndex: rowIndex,
|
|
326
|
-
listCode,
|
|
327
|
-
additionalParamMap: gridParams.additionalParamMap,
|
|
328
|
-
}
|
|
329
|
-
canClick = gridParams.options['eventCallBack'][funName].call(
|
|
330
|
-
this,
|
|
331
|
-
param
|
|
332
|
-
)
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
if (isPromise(canClick)) {
|
|
336
|
-
canClick.then((result) => {
|
|
337
|
-
this.doClickHyperLink(
|
|
338
|
-
row,
|
|
339
|
-
listCode,
|
|
340
|
-
rowIndex,
|
|
341
|
-
jumpPageSetting,
|
|
342
|
-
gridParams
|
|
343
|
-
)
|
|
344
|
-
})
|
|
345
|
-
} else {
|
|
346
|
-
this.doClickHyperLink(
|
|
347
|
-
row,
|
|
348
|
-
listCode,
|
|
349
|
-
rowIndex,
|
|
350
|
-
jumpPageSetting,
|
|
351
|
-
gridParams
|
|
352
|
-
)
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
},
|
|
356
|
-
doClickHyperLink(row, listCode, rowIndex, jumpPageSetting, gridParams) {
|
|
357
|
-
let parentFormData = null
|
|
209
|
+
parentFormData,
|
|
210
|
+
gridParams
|
|
211
|
+
)
|
|
212
|
+
// console.log('getHyperLinkSetting--resut=', result)
|
|
213
|
+
if (result && result.label && result.label !== '') {
|
|
214
|
+
console.log('label存在')
|
|
215
|
+
} else {
|
|
216
|
+
result.label = this.objectPropValueTwo(row, column)
|
|
217
|
+
}
|
|
218
|
+
if (result && result.title && result.title !== '') {
|
|
219
|
+
console.log('title存在')
|
|
220
|
+
} else {
|
|
221
|
+
result.title = result.label
|
|
222
|
+
}
|
|
223
|
+
hyperLinkResult = result
|
|
224
|
+
} else {
|
|
225
|
+
// 表示显示超链接
|
|
226
|
+
hyperLinkResult.visible = true
|
|
227
|
+
hyperLinkResult.label = this.objectPropValueTwo(row, column)
|
|
228
|
+
hyperLinkResult.title = hyperLinkResult.label
|
|
229
|
+
}
|
|
230
|
+
return hyperLinkResult
|
|
231
|
+
},
|
|
232
|
+
// 点击超链接
|
|
233
|
+
clickHyperLink(column, row, listCode, rowIndex) {
|
|
234
|
+
let jumpPageJson
|
|
235
|
+
if (column && column.formatter && column.formatter.options && column.formatter.options.format) {
|
|
236
|
+
jumpPageJson = column.formatter.options.format
|
|
237
|
+
}
|
|
238
|
+
if (this.rowLinkConfigMapping[rowIndex]) {
|
|
239
|
+
jumpPageJson = this.rowLinkConfigMapping[rowIndex]
|
|
240
|
+
}
|
|
241
|
+
if (jumpPageJson && jumpPageJson !== '') {
|
|
242
|
+
// 解析是否需要显示该超链接
|
|
243
|
+
let canClick = true
|
|
244
|
+
const gridParams = store.get(listCode)
|
|
245
|
+
const jumpPageSetting = JSON.parse(jumpPageJson)
|
|
246
|
+
console.log('gupre-grid---clickHyperLink--jumpPageSetting=', jumpPageSetting)
|
|
247
|
+
if (jumpPageSetting.beforeClick) {
|
|
248
|
+
const funName = jumpPageSetting.beforeClick
|
|
249
|
+
console.log('gupre-grid---clickHyperLink--jumpPageSetting.beforeClick=', funName)
|
|
250
|
+
console.log(
|
|
251
|
+
'gupre-grid---clickHyperLink--gridParams.options[eventCallBack]=',
|
|
252
|
+
gridParams.options['eventCallBack']
|
|
253
|
+
)
|
|
358
254
|
if (
|
|
359
|
-
|
|
360
|
-
|
|
255
|
+
gridParams.options &&
|
|
256
|
+
gridParams.options['eventCallBack'] &&
|
|
257
|
+
gridParams.options['eventCallBack'][funName] &&
|
|
258
|
+
typeof gridParams.options['eventCallBack'][funName] === 'function'
|
|
361
259
|
) {
|
|
362
|
-
|
|
260
|
+
const param = {
|
|
261
|
+
row: row,
|
|
262
|
+
column: column,
|
|
263
|
+
rowIndex: rowIndex,
|
|
264
|
+
listCode,
|
|
265
|
+
additionalParamMap: gridParams.additionalParamMap
|
|
266
|
+
}
|
|
267
|
+
canClick = gridParams.options['eventCallBack'][funName].call(this, param)
|
|
363
268
|
}
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
/// 把父页面的pageData传给弹出的页面或新页签
|
|
370
|
-
const copyPageData = JSON.parse(JSON.stringify((gridParams.pageContext && gridParams.pageContext.page?gridParams.pageContext.page: {})))
|
|
371
|
-
jumpPageSetting._pageData = copyPageData
|
|
372
|
-
jumpToPage(
|
|
373
|
-
jumpPageSetting,
|
|
374
|
-
gridParams.system,
|
|
375
|
-
row.id ? row.id : row.ID,
|
|
376
|
-
row,
|
|
377
|
-
gridParams.additionalParamMap,
|
|
378
|
-
null,
|
|
379
|
-
null,
|
|
380
|
-
parentFormData
|
|
381
|
-
).then((openPageParams) => {
|
|
382
|
-
console.log('doClickHyperLink----openPageParams----', openPageParams)
|
|
383
|
-
if (openPageParams) {
|
|
384
|
-
// 点击列表组件中某元素弹出的页面
|
|
385
|
-
if (
|
|
386
|
-
jumpPageSetting &&
|
|
387
|
-
typeof jumpPageSetting === 'string' &&
|
|
388
|
-
jumpPageSetting !== ''
|
|
389
|
-
) {
|
|
390
|
-
jumpPageSetting = JSON.parse(jumpPageSetting)
|
|
391
|
-
}
|
|
392
|
-
Object.assign(openPageParams, jumpPageSetting)
|
|
393
|
-
// console.log('clickHyperLink--openPageParams22===', openPageParams, '----jumpPageSetting===', jumpPageSetting)
|
|
394
|
-
openPageParams._position = 'list'
|
|
395
|
-
openPageParams._listCode = listCode
|
|
396
|
-
openPageParams._rowIndex = rowIndex
|
|
397
|
-
// 行编辑的记录
|
|
398
|
-
openPageParams.row = row
|
|
399
|
-
// 通知父页面弹出页面
|
|
400
|
-
$emit(this, 'open-page', openPageParams)
|
|
401
|
-
}
|
|
269
|
+
}
|
|
270
|
+
if (isPromise(canClick)) {
|
|
271
|
+
canClick.then((result) => {
|
|
272
|
+
this.doClickHyperLink(row, listCode, rowIndex, jumpPageSetting, gridParams, column)
|
|
402
273
|
})
|
|
403
|
-
|
|
274
|
+
} else {
|
|
275
|
+
this.doClickHyperLink(row, listCode, rowIndex, jumpPageSetting, gridParams, column)
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
doClickHyperLink(row, listCode, rowIndex, jumpPageSetting, gridParams, column) {
|
|
280
|
+
let parentFormData = null
|
|
281
|
+
if (gridParams.options.extraParam && gridParams.options.extraParam.entityMap) {
|
|
282
|
+
parentFormData = gridParams.options.extraParam.entityMap
|
|
283
|
+
}
|
|
284
|
+
console.log('ridParams.options.extraParam.entityMap', gridParams.options.extraParam)
|
|
285
|
+
|
|
286
|
+
/// 把父页面的pageData传给弹出的页面或新页签
|
|
287
|
+
const copyPageData = JSON.parse(
|
|
288
|
+
JSON.stringify(gridParams.pageContext && gridParams.pageContext.page ? gridParams.pageContext.page : {})
|
|
289
|
+
)
|
|
290
|
+
jumpPageSetting._pageData = copyPageData
|
|
291
|
+
jumpToPage(
|
|
292
|
+
jumpPageSetting,
|
|
293
|
+
gridParams.system,
|
|
294
|
+
row.id ? row.id : row.ID,
|
|
295
|
+
row,
|
|
296
|
+
gridParams.additionalParamMap,
|
|
297
|
+
null,
|
|
298
|
+
null,
|
|
299
|
+
parentFormData
|
|
300
|
+
).then((openPageParams) => {
|
|
301
|
+
console.log('doClickHyperLink----openPageParams----', openPageParams)
|
|
302
|
+
if (openPageParams) {
|
|
303
|
+
// 点击列表组件中某元素弹出的页面
|
|
304
|
+
if (jumpPageSetting && typeof jumpPageSetting === 'string' && jumpPageSetting !== '') {
|
|
305
|
+
jumpPageSetting = JSON.parse(jumpPageSetting)
|
|
306
|
+
}
|
|
307
|
+
Object.assign(openPageParams, jumpPageSetting)
|
|
308
|
+
// console.log('clickHyperLink--openPageParams22===', openPageParams, '----jumpPageSetting===', jumpPageSetting)
|
|
309
|
+
openPageParams._position = 'list'
|
|
310
|
+
openPageParams._listCode = listCode
|
|
311
|
+
openPageParams._rowIndex = rowIndex
|
|
312
|
+
// 行编辑的记录
|
|
313
|
+
openPageParams.row = row
|
|
314
|
+
// 列点击时列属性名
|
|
315
|
+
openPageParams._columnProp = column.prop
|
|
316
|
+
// 通知父页面弹出页面
|
|
317
|
+
$emit(this, 'open-page', openPageParams)
|
|
318
|
+
}
|
|
319
|
+
})
|
|
320
|
+
},
|
|
404
321
|
// 图标解析
|
|
405
322
|
getIconSetting(column, row, isSql, gridParams, listCode) {
|
|
406
323
|
let tableName
|
|
@@ -420,7 +337,16 @@ const customFormatter = {
|
|
|
420
337
|
}
|
|
421
338
|
if (formatJson && formatJson !== '') {
|
|
422
339
|
// 解析是否需要显示该超链接
|
|
423
|
-
const result = initialization(
|
|
340
|
+
const result = initialization(
|
|
341
|
+
JSON.parse(formatJson),
|
|
342
|
+
row,
|
|
343
|
+
isSql,
|
|
344
|
+
additionalParamerter,
|
|
345
|
+
contextParameter,
|
|
346
|
+
tableName,
|
|
347
|
+
parentFormData,
|
|
348
|
+
gridParams
|
|
349
|
+
)
|
|
424
350
|
// console.log('getHyperLinkSetting--resut=', result)
|
|
425
351
|
if (result && result.label && result.label !== '') {
|
|
426
352
|
console.log('label存在')
|