agilebuilder-ui 1.0.85-temp4 → 1.0.85-temp6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agilebuilder-ui",
3
- "version": "1.0.85-temp4",
3
+ "version": "1.0.85-temp6",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "main": "./lib/super-ui.js",
@@ -207,12 +207,8 @@ const customFormatter = {
207
207
  contextParameter,
208
208
  tableName,
209
209
  parentFormData,
210
- gridParams.pageContext
210
+ gridParams
211
211
  )
212
- debugger
213
- if (result.jumpPageSetting) {
214
- column.formatter.options.format = result.jumpPageSetting
215
- }
216
212
  // console.log('getHyperLinkSetting--resut=', result)
217
213
  if (result && result.label && result.label !== '') {
218
214
  console.log('label存在')
@@ -239,6 +235,10 @@ const customFormatter = {
239
235
  if (column && column.formatter && column.formatter.options && column.formatter.options.format) {
240
236
  jumpPageJson = column.formatter.options.format
241
237
  }
238
+ debugger
239
+ if (this.rowLinkConfigMapping[rowIndex]) {
240
+ jumpPageJson = this.rowLinkConfigMapping[rowIndex]
241
+ }
242
242
  if (jumpPageJson && jumpPageJson !== '') {
243
243
  // 解析是否需要显示该超链接
244
244
  let canClick = true
@@ -344,7 +344,7 @@ const customFormatter = {
344
344
  contextParameter,
345
345
  tableName,
346
346
  parentFormData,
347
- gridParams.pageContext
347
+ gridParams
348
348
  )
349
349
  // console.log('getHyperLinkSetting--resut=', result)
350
350
  if (result && result.label && result.label !== '') {
@@ -2,7 +2,7 @@
2
2
  <div style="width: 100%">
3
3
  <!--添加:key="column.prop+'_'+rowIndex"是为了解决多行是行编辑状态时新建的记录的文本框内有值的问题-->
4
4
  <dynamic-input
5
- v-if="((lineEdit.editable && isEditable && row.$editing) || isShowForm)"
5
+ v-if="(lineEdit.editable && isEditable && row.$editing) || isShowForm"
6
6
  v-model:value="row[column.prop]"
7
7
  :class="isRequired(row.$editing) ? 'm-requried' : ''"
8
8
  :column="column"
@@ -31,7 +31,11 @@
31
31
  />
32
32
  <span v-else>
33
33
  <span v-if="column.operations" class="grid-operation-buttons">
34
- <span v-for="(operation, operationIndex) in column.operations" :key="operationIndex" :class="isShowForm? '': 'cell--span'">
34
+ <span
35
+ v-for="(operation, operationIndex) in column.operations"
36
+ :key="operationIndex"
37
+ :class="isShowForm ? '' : 'cell--span'"
38
+ >
35
39
  <el-dropdown
36
40
  v-if="operation.isGroup"
37
41
  :size="operation.buttons && operation.buttons.length > 0 ? operation.buttons[0].props.size : 'small'"
@@ -81,7 +85,10 @@
81
85
  />
82
86
  </span>
83
87
  </span>
84
- <span v-else-if="customFormatValue(row, column.prop, customFormat, rowIndex)" :class="isShowForm? '': 'cell--span'">
88
+ <span
89
+ v-else-if="customFormatValue(row, column.prop, customFormat, rowIndex)"
90
+ :class="isShowForm ? '' : 'cell--span'"
91
+ >
85
92
  <component
86
93
  :is="column.prop + rowIndex"
87
94
  :entity="row"
@@ -106,7 +113,7 @@
106
113
  columnFormatter.options.format &&
107
114
  columnFormatter.options.format !== ''
108
115
  "
109
- :class="isShowForm? '': 'cell--span'"
116
+ :class="isShowForm ? '' : 'cell--span'"
110
117
  >
111
118
  <!--:key="column.prop+'_'+rowIndex+'_'+currentPage" 为了解决子表分页时,新增自动跳转到下一页,第一条记录的自定义控件被复用,导致业务逻辑没执行 -->
112
119
  <component
@@ -138,7 +145,7 @@
138
145
  columnFormatter !== undefined && columnFormatter.type !== undefined && columnFormatter.type === 'secretInfo'
139
146
  "
140
147
  :id="column.prop + 'DomData' + rowIndex"
141
- :class="isShowForm? '': 'cell--span'"
148
+ :class="isShowForm ? '' : 'cell--span'"
142
149
  >
143
150
  <secret-info
144
151
  :entity="row"
@@ -158,7 +165,7 @@
158
165
  :id="column.prop + 'DomData' + rowIndex"
159
166
  :style="isShowForm ? {} : { width: cellWidth + 'px' }"
160
167
  :title="isShowOverflowTooltip ? $escapeHtml(getLabel(row)) : ''"
161
- :class="isShowForm? '': 'ellipsis cell--span'"
168
+ :class="isShowForm ? '' : 'ellipsis cell--span'"
162
169
  >
163
170
  <FsPreview
164
171
  :entity="row"
@@ -183,7 +190,7 @@
183
190
  columnFormatter !== undefined &&
184
191
  columnFormatter.type !== undefined &&
185
192
  columnFormatter.type === 'hyperlinks' &&
186
- getMyHyperLinkSetting(row).visible === true
193
+ getMyHyperLinkSetting(row, rowIndex).visible === true
187
194
  "
188
195
  :type="getLinkType(row)"
189
196
  @click="clickHyperLink(column, row, listCode, rowIndex)"
@@ -192,17 +199,17 @@
192
199
  v-if="isShowOverflowTooltip"
193
200
  :id="column.prop + 'DomData' + rowIndex"
194
201
  :style="isShowForm ? {} : { width: cellWidth + 'px' }"
195
- :title="getMyHyperLinkSetting(row).title"
196
- :class="isShowForm? '': 'ellipsis cell--span'"
197
- >{{ getMyHyperLinkSetting(row).label }}
198
- <el-icon v-if="getMyHyperLinkSetting(row).icon">
199
- <component :is="getMyHyperLinkSetting(row).icon" />
202
+ :title="getMyHyperLinkSetting(row, rowIndex).title"
203
+ :class="isShowForm ? '' : 'ellipsis cell--span'"
204
+ >{{ getMyHyperLinkSetting(row, rowIndex).label }}
205
+ <el-icon v-if="getMyHyperLinkSetting(row, rowIndex).icon">
206
+ <component :is="(getMyHyperLinkSetting(row), rowIndex.icon)" />
200
207
  </el-icon>
201
208
  </span>
202
- <span v-else :id="column.prop + 'DomData' + rowIndex" :class="isShowForm? '': 'cell--span'"
203
- >{{ getMyHyperLinkSetting(row).label }}
204
- <el-icon v-if="getMyHyperLinkSetting(row).icon">
205
- <component :is="getMyHyperLinkSetting(row).icon" />
209
+ <span v-else :id="column.prop + 'DomData' + rowIndex" :class="isShowForm ? '' : 'cell--span'"
210
+ >{{ getMyHyperLinkSetting(row, rowIndex).label }}
211
+ <el-icon v-if="getMyHyperLinkSetting(row, rowIndex).icon">
212
+ <component :is="getMyHyperLinkSetting(row, rowIndex).icon" />
206
213
  </el-icon>
207
214
  </span>
208
215
  </el-link>
@@ -211,10 +218,10 @@
211
218
  :id="column.prop + 'DomData' + rowIndex"
212
219
  :style="isShowForm ? {} : { width: cellWidth + 'px' }"
213
220
  :title="$escapeHtml(getLabel(row))"
214
- :class="isShowForm? '': 'ellipsis cell--span'"
221
+ :class="isShowForm ? '' : 'ellipsis cell--span'"
215
222
  >{{ $escapeHtml(getLabel(row, rowIndex)) }}</span
216
223
  >
217
- <span v-else :id="column.prop + 'DomData' + rowIndex" :class="isShowForm? '': 'cell--span'">{{
224
+ <span v-else :id="column.prop + 'DomData' + rowIndex" :class="isShowForm ? '' : 'cell--span'">{{
218
225
  $escapeHtml(getLabel(row, rowIndex))
219
226
  }}</span>
220
227
  </span>
@@ -225,7 +232,7 @@
225
232
  :id="column.prop + 'DomData' + rowIndex"
226
233
  :style="isShowForm ? {} : { width: cellWidth + 'px' }"
227
234
  :title="$escapeHtml(getLabel(row))"
228
- :class="isShowForm? '': 'ellipsis cell--span'"
235
+ :class="isShowForm ? '' : 'ellipsis cell--span'"
229
236
  >
230
237
  <FsPreview
231
238
  :entity="row"
@@ -234,7 +241,7 @@
234
241
  :label="$escapeHtml(getLabel(row, rowIndex))"
235
242
  />
236
243
  </span>
237
- <span v-else :id="column.prop + 'DomData' + rowIndex" :class="isShowForm? '': 'cell--span'">
244
+ <span v-else :id="column.prop + 'DomData' + rowIndex" :class="isShowForm ? '' : 'cell--span'">
238
245
  <FsPreview
239
246
  :entity="row"
240
247
  :file-set-obj="getFileObj(column.fileSet)"
@@ -248,7 +255,7 @@
248
255
  :id="column.prop + 'DomData' + rowIndex"
249
256
  :style="isShowForm ? {} : { width: cellWidth + 'px' }"
250
257
  :title="isShowOverflowTooltip ? $escapeHtml(getLabel(row)) : ''"
251
- :class="isShowForm? '': 'ellipsis cell--span'"
258
+ :class="isShowForm ? '' : 'ellipsis cell--span'"
252
259
  >
253
260
  <FsPreview
254
261
  :entity="row"
@@ -274,13 +281,13 @@
274
281
  :id="column.prop + 'DomData' + rowIndex"
275
282
  :style="isShowForm ? {} : { width: cellWidth + 'px' }"
276
283
  :title="$escapeHtml(getMyHyperLinkSetting(row).title)"
277
- :class="isShowForm? '': 'ellipsis cell--span'"
284
+ :class="isShowForm ? '' : 'ellipsis cell--span'"
278
285
  >{{ $escapeHtml(getMyHyperLinkSetting(row).label) }}
279
286
  <el-icon v-if="getMyHyperLinkSetting(row).icon">
280
287
  <component :is="getMyHyperLinkSetting(row).icon" />
281
288
  </el-icon>
282
289
  </span>
283
- <span v-else :id="column.prop + 'DomData' + rowIndex" :class="isShowForm? '': 'cell--span'"
290
+ <span v-else :id="column.prop + 'DomData' + rowIndex" :class="isShowForm ? '' : 'cell--span'"
284
291
  >{{ $escapeHtml(getMyHyperLinkSetting(row).label) }}
285
292
  <el-icon v-if="getMyHyperLinkSetting(row).icon">
286
293
  <component :is="getMyHyperLinkSetting(row).icon" />
@@ -307,11 +314,11 @@
307
314
  :id="column.prop + 'DomData' + rowIndex"
308
315
  :style="isShowForm ? {} : { width: cellWidth + 'px' }"
309
316
  :title="getLabel(row)"
310
- :class="isShowForm? '': 'ellipsis cell--span'"
317
+ :class="isShowForm ? '' : 'ellipsis cell--span'"
311
318
  style="white-space: pre"
312
319
  v-html="$escapeHtml(getLabel(row, rowIndex))"
313
320
  />
314
- <span v-else :id="column.prop + 'DomData' + rowIndex" :class="isShowForm? '': 'cell--span'">{{
321
+ <span v-else :id="column.prop + 'DomData' + rowIndex" :class="isShowForm ? '' : 'cell--span'">{{
315
322
  $escapeHtml(getLabel(row, rowIndex))
316
323
  }}</span>
317
324
  </span>
@@ -323,7 +330,6 @@
323
330
  @closeRichEditorContent="closeRichEditorContent"
324
331
  />
325
332
  </div>
326
-
327
333
  </template>
328
334
 
329
335
  <script>
@@ -478,7 +484,8 @@ export default {
478
484
  disabled: false,
479
485
  controlConfig: this.getColumnCustomControlControlConfig(this.column.formatter),
480
486
  scanEnable,
481
- componentId
487
+ componentId,
488
+ rowLinkConfigMapping: {}
482
489
  }
483
490
  },
484
491
  computed: {
@@ -899,7 +906,7 @@ export default {
899
906
  }
900
907
  return dataModel
901
908
  },
902
- getMyHyperLinkSetting(row) {
909
+ getMyHyperLinkSetting(row, rowIndex) {
903
910
  this.transferColumnDataToUpperCase(row)
904
911
  const gridParams = store.get(this.listCode)
905
912
  let tableName
@@ -915,6 +922,9 @@ export default {
915
922
  tableName,
916
923
  this.listCode
917
924
  )
925
+ if (hyperLinkResult.jumpPageSetting) {
926
+ rowLinkConfigMapping[rowIndex] = hyperLinkResult.jumpPageSetting
927
+ }
918
928
  hyperLinkResult.icon = this.getHyperIconClass(hyperLinkResult)
919
929
  return hyperLinkResult
920
930
  },
@@ -10,12 +10,26 @@ export function initialization(
10
10
  contextParameter,
11
11
  tableName,
12
12
  parentFormData,
13
- pageContext
13
+ gridParams
14
14
  ) {
15
15
  const result = {}
16
16
  if (jumpPage) {
17
+ // 页面附加参数
18
+ result.visible = true
19
+ let additionalParameterMap = {}
20
+ if (additionalParamerter && typeof additionalParamerter === 'string' && additionalParamerter !== '') {
21
+ additionalParameterMap = JSON.parse(additionalParamerter)
22
+ } else if (additionalParamerter && typeof additionalParamerter === 'object') {
23
+ additionalParameterMap = additionalParamerter
24
+ }
25
+ // 环境变量,例如:当前用户id、当前用户登录名等
26
+ let contextParameterMap = {}
27
+ if (contextParameter && typeof contextParameter === 'string' && contextParameter !== '') {
28
+ contextParameterMap = JSON.parse(contextParameter)
29
+ } else if (contextParameter && typeof contextParameter === 'object') {
30
+ contextParameterMap = contextParameter
31
+ }
17
32
  if (Array.isArray(jumpPage)) {
18
- debugger
19
33
  for (let i = 0; i < jumpPage.length; i++) {
20
34
  let enable = false
21
35
  const jumpPageItem = jumpPage[i]
@@ -31,80 +45,75 @@ export function initialization(
31
45
  isSql,
32
46
  tableName,
33
47
  parentFormData,
34
- pageContext
48
+ gridParams.pageContext
35
49
  )
36
50
  enable = visible ? true : false
37
51
  } else {
38
52
  enable = true
39
53
  }
40
54
  } else if (jumpPageItem.jumpConditionType === 'customFunc') {
55
+ const param = {
56
+ row: entity,
57
+ additionalParamMap: gridParams.additionalParamMap
58
+ }
59
+ const funcResult = gridParams.options['eventCallBack'][jumpPageItem.customFunc].call(this, param)
60
+ enable = funcResult ? true : false
41
61
  }
42
- const jumpPageResult = initialization(
43
- jumpPageItem.jumpPageSetting,
44
- entity,
45
- isSql,
46
- additionalParamerter,
47
- contextParameter,
48
- tableName,
49
- parentFormData,
50
- pageContext
51
- )
52
- if (jumpPageResult && jumpPageResult.visible) {
53
- const res = { ...jumpPageResult }
54
- res.jumpPageSetting = JSON.stringify(jumpPageItem.jumpPageSetting)
55
- return res
62
+ if (enable) {
63
+ const jumpPageResult = initialization(
64
+ jumpPageItem.jumpPageSetting,
65
+ entity,
66
+ isSql,
67
+ additionalParamerter,
68
+ contextParameter,
69
+ tableName,
70
+ parentFormData,
71
+ gridParams
72
+ )
73
+ if (jumpPageResult && jumpPageResult.visible) {
74
+ const res = { ...jumpPageResult }
75
+ res.jumpPageSetting = JSON.stringify(jumpPageItem.jumpPageSetting)
76
+ return res
77
+ }
56
78
  }
57
79
  }
58
- }
59
- // 页面附加参数
60
- result.visible = true
61
- let additionalParameterMap = {}
62
- if (additionalParamerter && typeof additionalParamerter === 'string' && additionalParamerter !== '') {
63
- additionalParameterMap = JSON.parse(additionalParamerter)
64
- } else if (additionalParamerter && typeof additionalParamerter === 'object') {
65
- additionalParameterMap = additionalParamerter
66
- }
67
- // 环境变量,例如:当前用户id、当前用户登录名等
68
- let contextParameterMap = {}
69
- if (contextParameter && typeof contextParameter === 'string' && contextParameter !== '') {
70
- contextParameterMap = JSON.parse(contextParameter)
71
- } else if (contextParameter && typeof contextParameter === 'object') {
72
- contextParameterMap = contextParameter
73
- }
74
- if (jumpPage.displayTextJudge) {
75
- // 例如:${obj.menu_code}-#-#${input.---}-#-#${context.currentTransactor}
76
- const label = analysisValue(
77
- jumpPage.displayText,
78
- entity,
79
- additionalParameterMap,
80
- contextParameterMap,
81
- pageContext
82
- )
83
- result.label = label
84
- }
85
- if (jumpPage.icon) {
86
- result.icon = jumpPage.icon
87
- }
88
- if (jumpPage.linkTips) {
89
- result.title = jumpPage.linkTips
90
- }
91
- if (jumpPage.buttonDisplayConditionsList) {
92
- let displayJudgment = ''
93
- if (jumpPage.buttonDisplayConditionsList) {
94
- displayJudgment = JSON.stringify(jumpPage.buttonDisplayConditionsList)
95
- }
96
- if (displayJudgment && displayJudgment !== '') {
97
- const visible = analysisCondition(
98
- displayJudgment,
80
+ return { visible: false }
81
+ } else {
82
+ if (jumpPage.displayTextJudge) {
83
+ // 例如:${obj.menu_code}-#-#${input.---}-#-#${context.currentTransactor}
84
+ const label = analysisValue(
85
+ jumpPage.displayText,
99
86
  entity,
100
87
  additionalParameterMap,
101
88
  contextParameterMap,
102
- isSql,
103
- tableName,
104
- parentFormData,
105
- pageContext
89
+ gridParams.pageContext
106
90
  )
107
- result.visible = visible
91
+ result.label = label
92
+ }
93
+ if (jumpPage.icon) {
94
+ result.icon = jumpPage.icon
95
+ }
96
+ if (jumpPage.linkTips) {
97
+ result.title = jumpPage.linkTips
98
+ }
99
+ if (jumpPage.buttonDisplayConditionsList) {
100
+ let displayJudgment = ''
101
+ if (jumpPage.buttonDisplayConditionsList) {
102
+ displayJudgment = JSON.stringify(jumpPage.buttonDisplayConditionsList)
103
+ }
104
+ if (displayJudgment && displayJudgment !== '') {
105
+ const visible = analysisCondition(
106
+ displayJudgment,
107
+ entity,
108
+ additionalParameterMap,
109
+ contextParameterMap,
110
+ isSql,
111
+ tableName,
112
+ parentFormData,
113
+ gridParams.pageContext
114
+ )
115
+ result.visible = visible
116
+ }
108
117
  }
109
118
  }
110
119
  }