agilebuilder-ui 1.1.35 → 1.1.36-sit1

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 (72) hide show
  1. package/lib/{401-20f1c97c.js → 401-e367a09a.js} +1 -1
  2. package/lib/{404-36d09e24.js → 404-45104bc5.js} +1 -1
  3. package/lib/{iframe-page-51c292dc.js → iframe-page-8a758d4d.js} +1 -1
  4. package/lib/{index-19f46200.js → index-8c6ab0ba.js} +2054 -1966
  5. package/lib/super-ui.css +1 -1
  6. package/lib/super-ui.js +1 -1
  7. package/lib/super-ui.umd.cjs +100 -100
  8. package/lib/{tab-content-iframe-index-5d9d85c0.js → tab-content-iframe-index-16f7cb65.js} +1 -1
  9. package/lib/{tab-content-index-bd535c86.js → tab-content-index-f136be89.js} +1 -1
  10. package/lib/{tache-subprocess-history-56bf69ba.js → tache-subprocess-history-4f9a7773.js} +1 -1
  11. package/package.json +1 -1
  12. package/packages/department-tree/src/department-tree.vue +130 -123
  13. package/packages/department-tree-inline/src/department-multi-tree-inline.vue +435 -466
  14. package/packages/department-tree-inline/src/department-single-tree-inline.vue +335 -342
  15. package/packages/department-tree-inline/src/department-tree-inline.vue +18 -11
  16. package/packages/department-tree-inline/src/department-tree-service.js +10 -11
  17. package/packages/department-tree-mobile/src/department-tree-app.vue +103 -75
  18. package/packages/department-tree-mobile/src/department-tree-inline-app.vue +256 -225
  19. package/packages/department-tree-mobile/src/department-tree-service.ts +98 -75
  20. package/packages/department-user-tree/src/department-user-multiple-tree.vue +111 -115
  21. package/packages/department-user-tree/src/department-user-single-tree.vue +85 -88
  22. package/packages/department-user-tree/src/department-user-tree.vue +127 -119
  23. package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +6 -1
  24. package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +5 -0
  25. package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +18 -11
  26. package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +25 -51
  27. package/packages/department-user-tree-inline/src/group-user/group-list.vue +97 -90
  28. package/packages/department-user-tree-inline/src/group-user/group-user.vue +28 -32
  29. package/packages/department-user-tree-mobile/src/department-user-tree-app.vue +103 -75
  30. package/packages/department-user-tree-mobile/src/department-user-tree-inline-app.vue +282 -224
  31. package/packages/department-user-tree-mobile/src/department-user-tree-service.ts +58 -51
  32. package/packages/fs-upload-new/src/file-upload-mobile/file-upload-browser.vue +1 -1
  33. package/packages/organization-input/src/organization-input.vue +34 -12
  34. package/packages/super-grid/src/apis.js +21 -4
  35. package/packages/super-grid/src/dynamic-input.vue +1 -12
  36. package/packages/super-grid/src/formatter.js +4 -3
  37. package/packages/super-grid/src/normal-column-content.vue +25 -1
  38. package/packages/super-grid/src/row-operation.vue +23 -13
  39. package/packages/super-grid/src/search-form-open.vue +0 -1
  40. package/packages/super-grid/src/super-grid-service.js +1 -1
  41. package/packages/super-grid/src/super-grid.vue +51 -42
  42. package/packages/super-grid/src/utils.js +19 -6
  43. package/packages/super-icon/src/index.vue +11 -2
  44. package/packages/utils/value-set.js +147 -1
  45. package/packages/workgroup-tree/src/workgroup-tree.vue +117 -110
  46. package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +6 -1
  47. package/packages/workgroup-tree-mobile/src/workgroup-tree-app.vue +103 -75
  48. package/packages/workgroup-tree-mobile/src/workgroup-tree-inline-app.vue +229 -208
  49. package/src/api/sso-service.js +6 -5
  50. package/src/store/modules/table.js +0 -1
  51. package/src/styles/theme/black/font-style.scss +2 -0
  52. package/src/styles/theme/blue/font-style.scss +2 -0
  53. package/src/styles/theme/blue2/font-style.scss +2 -0
  54. package/src/styles/theme/dark-blue/font.scss +2 -0
  55. package/src/styles/theme/dark-blue/sidebar.scss +8 -0
  56. package/src/styles/theme/gray/font-style.scss +2 -0
  57. package/src/styles/theme/green/font.scss +3 -1
  58. package/src/styles/theme/green/sidebar.scss +9 -0
  59. package/src/styles/theme/ocean-blue/font.scss +3 -1
  60. package/src/styles/theme/ocean-blue/sidebar.scss +8 -0
  61. package/src/styles/theme/tiffany-blue-mobile/font.scss +2 -0
  62. package/src/styles/theme/tiffany-blue-mobile/sidebar.scss +8 -0
  63. package/src/utils/file-util.ts +32 -0
  64. package/src/utils/insert_css.js +1 -1
  65. package/src/utils/util.js +721 -715
  66. package/src/views/dsc-component/Sidebar/Item.vue +7 -2
  67. package/src/views/dsc-component/Sidebar/SidebarItem.vue +2 -2
  68. package/src/views/dsc-component/Sidebar/index.vue +36 -18
  69. package/src/views/layout/components/Menubar/Item.vue +0 -9
  70. package/src/views/layout/components/Menubar/SidebarItem.vue +2 -2
  71. package/src/views/layout/components/Sidebar/Item.vue +4 -1
  72. package/src/views/layout/components/Sidebar/SidebarItem.vue +2 -2
@@ -581,11 +581,15 @@ export default {
581
581
  if (gridParams && gridParams.options && gridParams.options.rowKeyProp) {
582
582
  return gridParams.options.rowKeyProp
583
583
  } else {
584
- if (this.dataSourceType === 'oracle') {
585
- return 'ID'
586
- } else {
587
- return 'id'
588
- }
584
+ // 使用rowDataGuId作为唯一标识,解决台账显示或不显示id。
585
+ // 大小写、或(子表时id还不存在问题,导致行选择和push新数据后 3行数据,
586
+ // 在第二行插入数据,因为key问题3、4行数据变成一样的)
587
+ return '$rowDataGuId'
588
+ // if (this.dataSourceType === 'oracle') {
589
+ // return 'ID'
590
+ // } else {
591
+ // return 'id'
592
+ // }
589
593
  }
590
594
  },
591
595
  filterGridData() {
@@ -630,15 +634,12 @@ export default {
630
634
  tableDatas: {
631
635
  deep: true,
632
636
  immediate: true,
633
- handler(a, b) {
634
- console.log('SGQ --- 表格监听数据修改============================》', a, b)
635
- }
637
+ handler(a, b) {}
636
638
  },
637
639
  'options.SuperGrid': {
638
640
  deep: true,
639
641
  handler: function () {
640
642
  this.externalClickFlag = true
641
- console.log('监听到数据改变')
642
643
  this.initSetting()
643
644
  this.initialize()
644
645
  }
@@ -714,7 +715,6 @@ export default {
714
715
  deep: true,
715
716
  handler: function () {
716
717
  this.externalClickFlag = true
717
- console.log('监听到数据改变================', this.options.validateRules)
718
718
  const gridParams = store.get(this.code)
719
719
  if (gridParams && gridParams.options) {
720
720
  gridParams.options.validateRules = this.options.validateRules
@@ -746,7 +746,6 @@ export default {
746
746
  'options.extraParam.entityMap': {
747
747
  deep: true,
748
748
  handler(newValue, oldValue) {
749
- console.log('watch====options.extraParam.entityMap===改变==', newValue)
750
749
  this.parentFormData = newValue
751
750
  this.$emit('change-form-data', this.parentFormData)
752
751
  }
@@ -937,7 +936,6 @@ export default {
937
936
  if (that.options.isEnableEnterEvent !== undefined && that.options.isEnableEnterEvent === false) {
938
937
  canCall = false
939
938
  }
940
- console.log('super-grid-----isEnableEnterEvent=', that.options.isEnableEnterEvent, 'canCall=', canCall)
941
939
  const gridParams = store.get(that.code)
942
940
  if (canCall && gridParams.options && gridParams.options.isFormSubTable) {
943
941
  canCall = false
@@ -994,19 +992,19 @@ export default {
994
992
  tempMaxHeight = tableHeight
995
993
  }
996
994
  }
997
- if(tempMaxHeight === null){
995
+ if (tempMaxHeight === null) {
998
996
  // 高度是null会导致页面卡死
999
997
  tempMaxHeight = undefined
1000
998
  }
1001
- if(tempMaxHeight !== null && tempMaxHeight !== undefined && parseFloat(tempMaxHeight+'') < 100){
999
+ if (tempMaxHeight !== null && tempMaxHeight !== undefined && parseFloat(tempMaxHeight + '') < 100) {
1002
1000
  // 如果小于100时,高度给100
1003
1001
  tempMaxHeight = 100
1004
1002
  }
1005
- if(tempMaxHeight !== null && tempMaxHeight !== undefined){
1003
+ if (tempMaxHeight !== null && tempMaxHeight !== undefined) {
1006
1004
  // 用parseFloat是因为tempMaxHeight的值有时是数字字符串
1007
- tempMaxHeight = parseFloat(tempMaxHeight+'')
1008
- }
1009
- if(gridParams.options && gridParams.options.isFormSubTable){
1005
+ tempMaxHeight = parseFloat(tempMaxHeight + '')
1006
+ }
1007
+ if (gridParams.options && gridParams.options.isFormSubTable) {
1010
1008
  // 表示表单页面子表时,不解析 显示效果了,直接使用高度就行了
1011
1009
  if (
1012
1010
  !this.basicInfo.displayEffect ||
@@ -1037,16 +1035,6 @@ export default {
1037
1035
  this.tableHeight = undefined
1038
1036
  }
1039
1037
  }
1040
- console.log(
1041
- 'resizeTableHeight-----tempMaxHeight=',
1042
- tempMaxHeight,
1043
- 'this.tableHeight=',
1044
- this.tableHeight,
1045
- 'this.maxHeight=',
1046
- this.maxHeight,
1047
- 'gridParams.options=',
1048
- gridParams.options
1049
- )
1050
1038
  })
1051
1039
  },
1052
1040
  // 回车键
@@ -1556,7 +1544,6 @@ export default {
1556
1544
  // 子表无记录时不需要刷新子表记录。表示是新建或修改时子表无记录,且不需要刷新子表。
1557
1545
  if (this.isSubTableEmpty(gridParams)) {
1558
1546
  // 表示是新建表单时,子表记录集合是空数组
1559
- console.log('子表无记录----code=', this.code, gridParams)
1560
1547
  const subTableData = []
1561
1548
  this.packageSubTableData(gridParams, subTableData)
1562
1549
  }
@@ -2180,7 +2167,7 @@ export default {
2180
2167
  } else {
2181
2168
  vm.fetchData(vm.getSearchParam(), isSearch, parentRowIds)
2182
2169
  .then((data) => {
2183
- console.log('打印1====', gridParams)
2170
+ // console.log('打印1====', gridParams)
2184
2171
  if (
2185
2172
  gridParams !== undefined &&
2186
2173
  gridParams.options !== undefined &&
@@ -2188,18 +2175,18 @@ export default {
2188
2175
  gridParams.options.isHiddenSearchForm === true
2189
2176
  ) {
2190
2177
  // 查询时,是否隐藏查询区域,默认是不隐藏查询区域
2191
- console.log('打印2====', vm)
2178
+ // console.log('打印2====', vm)
2192
2179
  vm.showSearch = false
2193
2180
  $emit(vm, 'cancel-search')
2194
2181
  }
2195
- console.log('打印3====', vm)
2196
- console.log('打印4====', vm.$refs)
2182
+ // console.log('打印3====', vm)
2183
+ // console.log('打印4====', vm.$refs)
2197
2184
  if (vm.$refs && vm.$refs.sf) {
2198
- console.log('打印5====', vm.$refs.sf)
2185
+ // console.log('打印5====', vm.$refs.sf)
2199
2186
  vm.$refs.sf.loading = false
2200
2187
  vm.$refs.sf.searchComplete()
2201
2188
  }
2202
- console.log('打印6====', vm)
2189
+ // console.log('打印6====', vm)
2203
2190
  // 重新计算列表高度
2204
2191
  this.resizeTableHeight()
2205
2192
  resolve(data)
@@ -2344,8 +2331,6 @@ export default {
2344
2331
  } else if (prop === undefined && column.children && column.children.length > 0) {
2345
2332
  type = 'GroupColumn'
2346
2333
  }
2347
- // console.log('%c描述-180428','color:#2E3435;background:#F8BB07;padding:3px;border-radius:2px',this.myCustomFormatter);
2348
- // console.log('%c描述-155704','color:#2E3435;background:#F8BB07;padding:3px;border-radius:2px',type);
2349
2334
  return type
2350
2335
  },
2351
2336
  focusOnFirstEditableInput() {
@@ -2356,7 +2341,6 @@ export default {
2356
2341
  },
2357
2342
  handleSizeChange(val) {
2358
2343
  if (!this.options || !this.options.isPageShow) {
2359
- // console.log(`每页 ${val} 条`)
2360
2344
  this.currentPage = 1
2361
2345
  this.pageSize = val
2362
2346
  this.pagination.pageSize = val
@@ -2839,7 +2823,6 @@ export default {
2839
2823
  return this.isSubTableShowPage ? this.subTableData : this.gridData
2840
2824
  },
2841
2825
  rowDblclickEvent(row, column, event) {
2842
- debugger
2843
2826
  const gridParams = store.get(this.code)
2844
2827
  if (gridParams.options && gridParams.options.isFormSubTable && gridParams.options.isPdfEditor) {
2845
2828
  // 如果是子表并且是pdf模式
@@ -2849,7 +2832,6 @@ export default {
2849
2832
  let canEdit = true
2850
2833
  const gridParams = store.get(this.code)
2851
2834
  if (isEditOptionFunction('beforeEdit', this.code)) {
2852
- debugger;
2853
2835
  const isSubTableShowPage = gridParams.isSubTableShowPage
2854
2836
  // 每页显示多少条
2855
2837
  const pageSize = gridParams.pagination && gridParams.pagination.pageSize
@@ -2880,7 +2862,6 @@ export default {
2880
2862
  }
2881
2863
  } else {
2882
2864
  if (row) {
2883
- debugger
2884
2865
  if (gridParams && gridParams.lineEdit && gridParams.lineEdit.editable && gridParams.canntEdit) {
2885
2866
  let index = this.gridData.findIndex(function (item) {
2886
2867
  return (item.id && item.id === row.id) || (item.ID && item.ID === row.ID)
@@ -2895,7 +2876,6 @@ export default {
2895
2876
  this.rowDblClick(row, column, event)
2896
2877
  },
2897
2878
  rowDbClickEditRow(gridParams, row) {
2898
- console.log('rowDbClickEditRow+++++++++++++++++++', gridParams, row)
2899
2879
  // 取消上一行的编辑状态
2900
2880
  let editRows
2901
2881
  if (this.isSubTableShowPage) {
@@ -3353,6 +3333,35 @@ export default {
3353
3333
  },
3354
3334
  changeOperationAddState(state) {
3355
3335
  eventBus.$emit('change-add-state', state)
3336
+ },
3337
+ scrollTo(options, yCoord) {
3338
+ this.$refs.superGrid?.scrollTo(options, yCoord)
3339
+ },
3340
+ setScrollTop(top) {
3341
+ this.$refs.superGrid?.setScrollTop(top)
3342
+ },
3343
+ setScrollLeft(left) {
3344
+ this.$refs.superGrid?.setScrollLeft(left)
3345
+ },
3346
+ setScrollTopByRowIndex(rowIndex) {
3347
+ if (this.$refs.superGrid) {
3348
+ const theTableRows = this.$refs.superGrid.$el.querySelectorAll('.el-table__body tbody .el-table__row')
3349
+ let scrollTop = 0
3350
+ for (let i = 0; i < theTableRows.length; i++) {
3351
+ if (i === rowIndex) {
3352
+ break
3353
+ }
3354
+ scrollTop += theTableRows[i].offsetHeight
3355
+ }
3356
+ this.$refs.superGrid.setScrollTop(scrollTop)
3357
+ }
3358
+ },
3359
+ setCurrentRowIndex(rowIndex) {
3360
+ // 选中行
3361
+ this.$refs.superGrid.setCurrentRow(this.tableDatas[rowIndex])
3362
+ },
3363
+ getSuperGridRef() {
3364
+ return this.$refs.superGrid
3356
3365
  }
3357
3366
  },
3358
3367
  emits: [
@@ -264,9 +264,14 @@ export function isDisableEdit(prop, listCode, row) {
264
264
  }
265
265
  if (isDiabled === false) {
266
266
  // 表示不是禁止编辑的,继续校验自定义规则中是否是禁止编辑的
267
- if(gridParams.options.customRules && (gridParams.options.customRules[prop] || gridParams.options.customRules['_all_fields'])){
268
- const columnRules = gridParams.options.customRules[prop]? gridParams.options.customRules[prop]: gridParams.options.customRules['_all_fields']
269
- if(columnRules && columnRules.disabled){
267
+ if (
268
+ gridParams.options.customRules &&
269
+ (gridParams.options.customRules[prop] || gridParams.options.customRules['_all_fields'])
270
+ ) {
271
+ const columnRules = gridParams.options.customRules[prop]
272
+ ? gridParams.options.customRules[prop]
273
+ : gridParams.options.customRules['_all_fields']
274
+ if (columnRules && columnRules.disabled) {
270
275
  isDiabled = true
271
276
  }
272
277
  }
@@ -565,7 +570,6 @@ export function getTableHeight(superGrid, listCode, pageHeight) {
565
570
  rect = superGrid.$el.getBoundingClientRect()
566
571
  }
567
572
  const totalHeight = window.innerHeight - (rect?.y ?? 0) - 110
568
- console.log('rect=', rect, 'window.innerHeight=', window.innerHeight, 'totalHeight=', totalHeight)
569
573
  return totalHeight
570
574
 
571
575
  // let topDivHeight = 120
@@ -755,7 +759,18 @@ export function getDynamicDataSourceOptions(column, isSql, additionalParamMap, b
755
759
 
756
760
  // 值设置是否是动态数据源类型的数据源
757
761
  export function isDynamicDataSourceSource(column) {
762
+ if (column.valueSetOptions) {
763
+ const valueSetOptionsObj = JSON.parse(column.valueSetOptions)
764
+ if (
765
+ (valueSetOptionsObj.type && valueSetOptionsObj.type === 'dynamicData') ||
766
+ valueSetOptionsObj.dynamicDataSourceCode
767
+ ) {
768
+ // 表示是动态数据源
769
+ return true
770
+ }
771
+ }
758
772
  if (column.valueSet && column.valueSet.length > 0 && column.valueSet[0].value === 'dynamicDataSource') {
773
+ // 表示是动态数据源
759
774
  return true
760
775
  } else {
761
776
  return false
@@ -774,10 +789,8 @@ export function getLastPageNum(total, rowsPerPage) {
774
789
  // 纵向滚动条滚动最底部功能
775
790
  export function scrollYToBottom(listCode) {
776
791
  const scrollDivElement = document.querySelector('.' + listCode + ' .el-table--scrollable-y .el-table__body-wrapper')
777
- console.log('scrollDivElement==', scrollDivElement)
778
792
  if (scrollDivElement && scrollDivElement !== null) {
779
793
  // 表示有滚动条,需要将滚动条滚动最底部
780
- console.log('scrollDivElement==scrollDivElement.scrollHeight=', scrollDivElement.scrollHeight)
781
794
  scrollDivElement.scrollTop = scrollDivElement.scrollHeight
782
795
  }
783
796
  }
@@ -1,10 +1,10 @@
1
1
  <template>
2
2
  <i v-if="iconValue.indexOf('amb-icon-') === 0" class="amb-iconfont" :class="iconValue" />
3
- <i v-else-if="iconValue.indexOf('amb-color-icon-') === 0" class="amb-color-iconfont" :class="iconValue" />
3
+ <i v-else-if="iconValue.indexOf('amb-color-icon-') === 0" class="amb-color-iconfont super-icon" :class="iconValue" />
4
4
  <i v-else-if="iconValue.indexOf('fa-') === 0" :class="'fa ' + iconValue" />
5
5
  <img
6
6
  v-else-if="iconValue.indexOf('svg-img-') === 0"
7
- :src="defaultShowImageAction + iconValue.substring('svg-img-'.length)"
7
+ :src="defaultShowSvgAction + iconValue"
8
8
  style="width: 1em; height: 1em"
9
9
  />
10
10
  <SvgIcon v-else-if="iconValue.indexOf('svg-') === 0" :icon-class="iconValue.substring('svg-'.length)" />
@@ -39,4 +39,13 @@ const props = defineProps({
39
39
  const defaultShowImageAction = ref(
40
40
  window.$vueApp.config.globalProperties.baseAPI + '/component/super-form/show-image?serverPath='
41
41
  )
42
+ const defaultShowSvgAction = ref(
43
+ window.$vueApp.config.globalProperties.baseAPI + '/component/super-form/show-svg?svgName='
44
+ )
42
45
  </script>
46
+ <style lang="scss" scoped>
47
+ .super-icon {
48
+ width: 14px;
49
+ height: 14px;
50
+ }
51
+ </style>
@@ -1,8 +1,19 @@
1
1
  import * as Vue from 'vue'
2
+ import { isPlateSys } from '../../src/utils/common-util'
3
+
4
+ export function packageEnumAndBeanColumnValueSets(columns, listCode, additionalParamMap, entity) {
5
+ if (isPlateSys(window.$vueApp.config.globalProperties.systemCode)) {
6
+ // 平台系统时,beanName和枚举类型时
7
+ return packageEnumAndBeanColumnValueSetsWhenPlate(columns, listCode)
8
+ } else {
9
+ // 业务系统时,获得选项配置
10
+ return packageEnumAndBeanColumnValueSetsWhenOtherSys(columns, listCode, additionalParamMap, entity)
11
+ }
12
+ }
2
13
  /**
3
14
  * 封装值设置为枚举 或 bean方式时的值为'key-value'键值对信息
4
15
  */
5
- export function packageEnumAndBeanColumnValueSets(columns, listCode) {
16
+ function packageEnumAndBeanColumnValueSetsWhenPlate(columns, listCode) {
6
17
  return new Promise((resolve, reject) => {
7
18
  const valueSetColumnsInfo = {
8
19
  listCode: listCode,
@@ -95,3 +106,138 @@ function packageEnumAndBeanColumnValueSet(valueSetInfo) {
95
106
  return BEAN_NAME_PREFIX + beanName
96
107
  }
97
108
  }
109
+
110
+ /**
111
+ * 封装值设置为枚举 或 bean方式时的值为'key-value'键值对信息
112
+ */
113
+ function packageEnumAndBeanColumnValueSetsWhenOtherSys(columns, listCode, additionalParamMap, entity, systemCode) {
114
+ return new Promise((resolve, reject) => {
115
+ const dataSourceList = getDataSourceConfigList(columns)
116
+ const valueSetColumnIndexs = dataSourceList.valueSetColumnIndexs
117
+ const param = {
118
+ listCode: listCode,
119
+ entityMap: entity,
120
+ additionalParamMap: additionalParamMap,
121
+ dataSourceList: dataSourceList.dataSourceConfigList,
122
+ dataSourceListTitle: dataSourceList.dataSourceConfigListTitle,
123
+ systemCode: systemCode
124
+ }
125
+ const url = window.$vueApp.config.globalProperties.baseURL + '/common/common-data/find-grid-datas'
126
+ //const url = window['$vueApp'].config.globalProperties.baseAPI + '/common/common-data/xxxx'
127
+ window.$vueApp.config.globalProperties.$http
128
+ .post(url, param)
129
+ .then((result) => {
130
+ const columnValueSet = result.columnValueSet
131
+ const columnTitleValueSet = result.columnTitleValueSet
132
+ for(let prop in valueSetColumnIndexs){
133
+ const columnIndex = valueSetColumnIndexs[prop]
134
+ const valueSet = columnValueSet[prop]
135
+ if (valueSet) {
136
+ columns[columnIndex].valueSet = valueSet
137
+ }
138
+ const valueSetTitle = columnTitleValueSet[prop]
139
+ if (valueSetTitle) {
140
+ columns[columnIndex].titleValueSetValue = valueSetTitle
141
+ }
142
+ }
143
+ console.log('查询选项数据完成', result)
144
+ resolve(result)
145
+ })
146
+ .catch((error) => {
147
+ console.log('查询选项数据失败', error)
148
+ //失败时
149
+ reject(error)
150
+ })
151
+ })
152
+ }
153
+
154
+ function getDataSourceConfigList(columns) {
155
+ const dataSourceConfigList = []
156
+ const dataSourceConfigListTitle = []
157
+ const valueSetColumnIndexs = {}
158
+ for (let i = 0; i < columns.length; i++) {
159
+ const column = columns[i]
160
+ const prop = column.prop ? column.prop : column.label
161
+ const columnValueSet = getConfigWithValueSet(column, prop, column)
162
+ let titleValueSet = null
163
+ const titleValueSetJson = column.titleValueSet
164
+ if (titleValueSetJson) {
165
+ titleValueSet = getConfigWithValueSet(JSON.parse(titleValueSetJson), prop)
166
+ }
167
+ if (columnValueSet || titleValueSet) {
168
+ if (columnValueSet) {
169
+ // 字段的值设置
170
+ dataSourceConfigList.push(columnValueSet)
171
+ }
172
+ if (titleValueSet) {
173
+ dataSourceConfigListTitle.push(titleValueSet)
174
+ }
175
+ valueSetColumnIndexs[prop] = i
176
+ }
177
+ }
178
+ return {dataSourceConfigList, dataSourceConfigListTitle, valueSetColumnIndexs}
179
+ }
180
+
181
+ function getConfigWithValueSet(valueSetInfo, prop, column) {
182
+ /**
183
+ * 枚举类型值设置前缀
184
+ */
185
+ const ENUM_NAME_PREFIX = 'enumname:'
186
+ /**
187
+ * bean形式值设置前缀
188
+ */
189
+ const BEAN_NAME_PREFIX = 'beanname:'
190
+ const enumName = valueSetInfo.enumName
191
+ const beanName = valueSetInfo.beanName
192
+ let infoObj = {
193
+ uuid: prop
194
+ }
195
+ // 选项组的在解析列表字段配置时就获得了,不需要在此处获得了
196
+ if (enumName && enumName !== '') {
197
+ if (valueSetInfo.remoteEnum === true) {
198
+ // 需要远程获得枚举值
199
+ infoObj.type = 'enumName'
200
+ infoObj.props = {
201
+ prop: prop,
202
+ valueSet: ENUM_NAME_PREFIX + enumName
203
+ }
204
+ }
205
+ } else if (beanName && beanName !== '') {
206
+ infoObj.type = 'beanName'
207
+ infoObj.props = {
208
+ prop: prop,
209
+ valueSet: BEAN_NAME_PREFIX + beanName
210
+ }
211
+ }else if(column && column.valueSetOptions) {
212
+ // 动态数据源、数据表/视图、服务
213
+ const valueSetOptionsObj = JSON.parse(column.valueSetOptions)
214
+ if((valueSetOptionsObj.type || valueSetOptionsObj.dynamicDataSourceCode) && valueSetOptionsObj.valueLabelSwitch){
215
+ // 表示是动态数据源等值设置信息
216
+ // const isShouldInitSearch = (valueSetOptionsObj.filterType === undefined || valueSetOptionsObj.filterType != 'remote')
217
+ if(!valueSetOptionsObj.type || valueSetOptionsObj.type !== 'optionGroup'){
218
+ // 选项组时不需要在此处获得
219
+ Object.assign(infoObj, valueSetOptionsObj)
220
+ // 更新uuid为字段名
221
+ infoObj.uuid = prop
222
+ if(!infoObj.props){
223
+ infoObj.props = {}
224
+ }
225
+ infoObj.props.prop = prop
226
+ }
227
+ if(valueSetOptionsObj.dynamicDataSourceCode){
228
+ infoObj.type = 'dynamicData'
229
+ if(!infoObj.props){
230
+ infoObj.props = {}
231
+ }
232
+ infoObj.props.code = valueSetOptionsObj.dynamicDataSourceCode
233
+ }
234
+ }
235
+ }
236
+ if(infoObj.type){
237
+ // 表示是有效的值设置
238
+ return infoObj
239
+ }
240
+ return null
241
+ }
242
+
243
+