agilebuilder-ui 1.0.621 → 1.0.962

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