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.
Files changed (38) hide show
  1. package/lib/super-ui.css +1 -1
  2. package/lib/super-ui.js +24626 -23708
  3. package/lib/super-ui.umd.cjs +76 -76
  4. package/package.json +2 -2
  5. package/packages/dynamic-source-select/src/dynamic-source-select.vue +3 -0
  6. package/packages/fs-upload-list/src/fs-upload-list.vue +2 -1
  7. package/packages/index.js +5 -2
  8. package/packages/rich-editor/index.vue +1 -1
  9. package/packages/row-form/index.js +7 -0
  10. package/packages/row-form/index.vue +211 -0
  11. package/packages/super-grid/src/apis.js +26 -0
  12. package/packages/super-grid/src/components/grid-icon.vue +7 -14
  13. package/packages/super-grid/src/components/hyperlinks.vue +24 -8
  14. package/packages/super-grid/src/custom-formatter.js +312 -386
  15. package/packages/super-grid/src/dynamic-input.vue +8 -1
  16. package/packages/super-grid/src/normal-column-content.vue +1079 -0
  17. package/packages/super-grid/src/normal-column.vue +41 -752
  18. package/packages/super-grid/src/row-detail.vue +50 -0
  19. package/packages/super-grid/src/search-form-advancedQuery.vue +6 -1
  20. package/packages/super-grid/src/search-form-item.vue +6 -1
  21. package/packages/super-grid/src/super-grid-service.js +41 -1
  22. package/packages/super-grid/src/super-grid.vue +123 -49
  23. package/packages/super-grid/src/utils.js +80 -56
  24. package/src/i18n/langs/cn.js +4 -1
  25. package/src/i18n/langs/en.js +3 -0
  26. package/src/permission.js +7 -1
  27. package/src/store/modules/user.js +4 -1
  28. package/src/styles/theme/dark-blue/button.scss +2 -2
  29. package/src/styles/theme/dark-blue/index.scss +1 -1
  30. package/src/styles/theme/green/button.scss +2 -2
  31. package/src/styles/theme/green/index.scss +1 -1
  32. package/src/styles/theme/ocean-blue/button.scss +2 -2
  33. package/src/styles/theme/ocean-blue/index.scss +1 -1
  34. package/src/utils/jump-page-utils.js +199 -321
  35. package/src/utils/permissionAuth.js +1 -1
  36. package/src/views/layout/components/Menubar/Item.vue +27 -4
  37. package/src/views/layout/components/Menubar/SidebarItem.vue +6 -2
  38. 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
- * @param {prop} 属性名
13
- * @param {formatValue} 格式化后的值
14
- * @param {format} 格式化方法
15
- * @param {componentName} 组件名
16
- */
17
- customFormatValue(row, prop, format, rowIndex) {
18
- // const start = new Date().getTime()
19
- // console.log('---super-grid--customFormatValue--')
20
- if (this.customFormat) {
21
- let originalValue = row[prop]
22
- if (this.isObjectProp(prop)) {
23
- originalValue = this.objectPropOriginalValue(row, prop)
24
- }
25
- const formatValue = doFormat(this.column, originalValue)
26
- const component = format.call(
27
- this,
28
- originalValue,
29
- formatValue,
30
- row,
31
- this.column,
32
- rowIndex
33
- )
34
- if (typeof component === 'undefined') {
35
- return false
36
- } else {
37
- // const aa = defineCustomElement(component)
38
- // window.customElements.define(prop + rowIndex , aa)
39
- window.$vueApp.component(prop + rowIndex, component)
40
- }
41
-
42
- // const end = new Date().getTime()
43
- // console.log('---super-grid--customFormatValue--time1=', (end - start))
44
- return true
45
- } else {
46
- // const end = new Date().getTime()
47
- // console.log('---super-grid--customFormatValue--time2=', (end - start))
48
- return false
49
- }
50
- },
51
-
52
- isObjectProp(prop) {
53
- // const start = new Date().getTime()
54
- // console.log('---super-grid--isObjectProp--')
55
- if (prop && prop.indexOf('.') > 0) {
56
- // const end = new Date().getTime()
57
- // console.log('---super-grid--isObjectProp--time1=', (end - start))
58
- return true
59
- } else {
60
- // const end = new Date().getTime()
61
- // console.log('---super-grid--isObjectProp--time2=', (end - start))
62
- return false
63
- }
64
- },
65
-
66
- objectPropOriginalValue(row, prop) {
67
- try {
68
- // console.log('---super-grid--objectPropOriginalValue--')
69
- let objValue = row
70
- if (prop && prop.indexOf('.') > 0) {
71
- const props = prop.split('.')
72
- props.forEach((subProp) => {
73
- if (objValue) {
74
- objValue = objValue[subProp]
75
- } else {
76
- objValue = ''
77
- throw objValue
78
- }
79
- })
80
- return objValue
81
- } else {
82
- return row[prop]
83
- }
84
- } catch (e) {
85
- // console.log(e)
86
- return ''
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
- objectPropValue(row, prop) {
91
- return this.formatter(row, prop, this.column)
92
- },
93
- // 获取显示的值
94
- // 附件类型,显示值与实际值不相同。如果时子表多选,需要单独判断
95
- objectPropValueTwo(row, column) {
96
- if (
97
- (column.componentType === 'annex' ||
98
- column.componentType === 'multipartUpload') && column.fileSet
99
- ) {
100
- // 判断是否是对象集合(子表存储)
101
- const fileSetObj = JSON.parse(column.fileSet)
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
- formatter(row, prop, column) {
144
- const cellValue = this.objectPropOriginalValue(row, prop)
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
- this.columnFormatter !== undefined &&
147
- this.columnFormatter.type === 'custom'
134
+ gridParams.options &&
135
+ gridParams.options['eventCallBack'] &&
136
+ gridParams.options['eventCallBack'][funName] &&
137
+ typeof gridParams.options['eventCallBack'][funName] === 'function'
148
138
  ) {
149
- // 自定义事件
150
- let funName
151
- if (this.columnFormatter.options && this.columnFormatter.options.format) {
152
- funName = this.columnFormatter.options.format
153
- }
154
- if (funName && funName !== null && funName !== '') {
155
- const gridParams = store.get(this.listCode)
156
- if (
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
- return doFormat(column, cellValue)
148
+ return doFormat(column, cellValue)
178
149
  }
179
- },
180
- getColumnValue(row, column) {
181
- const prop = column.prop
182
- let originalValue = row[prop]
183
- if (this.isObjectProp(prop)) {
184
- originalValue = this.objectPropOriginalValue(row, prop)
185
- }
186
- const formatValue = doFormat(column, originalValue)
187
- return {
188
- originalValue,
189
- formatValue,
190
- }
191
- },
192
- onClickFun(row, column, onClick, rowIndex, button) {
193
- const values = this.getColumnValue(row, column)
194
- onClick.call(
195
- this,
196
- values.originalValue,
197
- values.formatValue,
198
- row,
199
- column,
200
- rowIndex,
201
- button
202
- )
203
- },
204
- isShowButtonFun(row, column, isShowFun, rowIndex) {
205
- if (isShowFun === undefined) {
206
- return true
207
- }
208
- if (typeof isShowFun === 'function') {
209
- const values = this.getColumnValue(row, column)
210
- let isShow = isShowFun.call(
211
- this,
212
- values.originalValue,
213
- values.formatValue,
214
- row,
215
- column,
216
- rowIndex
217
- )
218
- if (isShow === undefined) {
219
- isShow = true
220
- }
221
- return isShow
222
- } else {
223
- return isShowFun
224
- }
225
- },
226
- // 超链接解析
227
- getHyperLinkSetting(
228
- column,
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
- listCode
235
- ) {
236
- const gridParams = store.get(listCode)
237
- let parentFormData = null
238
- if (
239
- gridParams.options.extraParam &&
240
- gridParams.options.extraParam.entityMap
241
- ) {
242
- parentFormData = gridParams.options.extraParam.entityMap
243
- }
244
- let hyperLinkResult = {}
245
- let jumpPageJson
246
- if (
247
- column &&
248
- column.formatter &&
249
- column.formatter.options &&
250
- column.formatter.options.format
251
- ) {
252
- jumpPageJson = column.formatter.options.format
253
- }
254
- if (jumpPageJson && jumpPageJson !== '') {
255
- // 解析是否需要显示该超链接
256
- const result = initialization(
257
- JSON.parse(jumpPageJson),
258
- row,
259
- isSql,
260
- additionalParamerter,
261
- contextParameter,
262
- tableName,
263
- parentFormData,
264
- gridParams.pageContext
265
- )
266
- // console.log('getHyperLinkSetting--resut=', result)
267
- if (result && result.label && result.label !== '') {
268
- console.log('label存在')
269
- } else {
270
- result.label = this.objectPropValueTwo(row, column)
271
- }
272
- if (result && result.title && result.title !== '') {
273
- console.log('title存在')
274
- } else {
275
- result.title = result.label
276
- }
277
- hyperLinkResult = result
278
- } else {
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
- gridParams.options.extraParam &&
360
- gridParams.options.extraParam.entityMap
255
+ gridParams.options &&
256
+ gridParams.options['eventCallBack'] &&
257
+ gridParams.options['eventCallBack'][funName] &&
258
+ typeof gridParams.options['eventCallBack'][funName] === 'function'
361
259
  ) {
362
- parentFormData = gridParams.options.extraParam.entityMap
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
- console.log(
365
- 'ridParams.options.extraParam.entityMap',
366
- gridParams.options.extraParam
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(JSON.parse(formatJson), row, isSql, additionalParamerter, contextParameter, tableName, parentFormData, gridParams.pageContext)
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存在')