agilebuilder-ui 1.1.13 → 1.1.14

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.
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div :style="subTableStyle">
2
+ <div data-v="1.0.0" :style="subTableStyle">
3
3
  <search-form
4
4
  v-if="!isFormSubTable && hasLoadedColumns && query && query.showType === 'embedded'"
5
5
  v-show="!isMobile || (isMobile && isShowMobileSearch)"
@@ -35,10 +35,27 @@
35
35
  @close="closeSearchFormDialog"
36
36
  />
37
37
  <div :class="'grid-area ' + code">
38
+ <MobileCard
39
+ v-if="isShowCard"
40
+ :selection="selectionTableData"
41
+ :columns="visibleColumns"
42
+ :listCode="code"
43
+ :getColumnComponentData="getColumnComponentData"
44
+ :data="tableDatas"
45
+ v-model:current-page="currentPage"
46
+ :page-size="pagination?.pageSizes?.[0]"
47
+ :page-total="pagination?.total"
48
+ @select="selectRecord"
49
+ @selection-change="cardSelectionChangeEvent"
50
+ @current-change="handleCurrentChange"
51
+ @row-click="rowClickEvent"
52
+ @row-dblclick="rowDblclickEvent"
53
+ />
54
+
38
55
  <el-table
39
- v-if="refreshGrid && hasLoadedColumns"
56
+ v-if="refreshGrid && hasLoadedColumns && !isShowCard"
40
57
  ref="superGrid"
41
- :data="hasFilterDataEvent ? filterGridData : gridData"
58
+ :data="tableDatas"
42
59
  :row-key="getRowKeyProp"
43
60
  :show-summary="showSummary"
44
61
  :summary-method="getSummaries"
@@ -71,70 +88,18 @@
71
88
  @cell-dblclick="cellDblClick"
72
89
  >
73
90
  <row-detail v-if="detailColumn" :column="detailColumn" :list-code="code" @show-detail="openRowForm" />
74
- <template v-if="myCustomFormatter">
75
- <component
76
- :is="getComponentType(column)"
77
- v-for="(column, index) in visibleColumns"
78
- :ref="column.prop"
79
- :key="column.label + index"
80
- :column="column"
81
- :is-sql="isSql"
82
- :list-code="code"
83
- :custom-format="
84
- getComponentType(column) === 'GroupColumn' ? myCustomFormatter : myCustomFormatter[column.prop]
85
- "
86
- :new-width="newWidth"
87
- :drag-column-prop="dragColumnProp"
88
- :right-click-menu-arr="options.rightClickMenuArr"
89
- :table-name="tableName"
90
- :page-code="pageCode"
91
- :list-name="listName"
92
- :options="options"
93
- :pagination="pagination"
94
- :current-page="currentPage"
95
- :grid-data="isSubTableShowPage ? subTableData : gridData"
96
- :page-grid-data="isSubTableShowPage ? getSubTableGridData(subTableData) : gridData"
97
- @refresh-list="refreshList"
98
- @open-page="openPageDialog"
99
- @refresPortData="refresPortData"
100
- @refresPortsData="refresPortsData"
101
- @refresMainTableFields="refresMainTableFields"
102
- @prohibitToEdit="prohibitToEdit"
103
- />
104
- </template>
105
- <template v-else>
106
- <component
107
- :is="getComponentType(column)"
108
- v-for="(column, index) in visibleColumns"
109
- :ref="column.prop"
110
- :key="column.label + index"
111
- :is-sql="isSql"
112
- :column="column"
113
- :list-code="code"
114
- :is-line-edit="lineEdit !== null && lineEdit.editable"
115
- :new-width="newWidth"
116
- :drag-column-prop="dragColumnProp"
117
- :right-click-menu-arr="options.rightClickMenuArr"
118
- :table-name="tableName"
119
- :page-code="pageCode"
120
- :list-toolbar-form-data="listToolbarFormData"
121
- :list-name="listName"
122
- :options="options"
123
- :current-page="currentPage"
124
- :pagination="pagination"
125
- :grid-data="isSubTableShowPage ? subTableData : gridData"
126
- :page-grid-data="isSubTableShowPage ? getSubTableGridData(subTableData) : gridData"
127
- @open-page="openPageDialog"
128
- @refresData="refresData"
129
- @refresh-list="refreshList"
130
- @refresPortData="refresPortData"
131
- @refresPortsData="refresPortsData"
132
- @refresMainTableFields="refresMainTableFields"
133
- @prohibitToEdit="prohibitToEdit"
134
- />
135
- </template>
91
+
92
+ <component
93
+ :is="getComponentType(column)"
94
+ v-for="({column, ...item}, index) in visibleColumnsComponentData"
95
+ :ref="column.prop"
96
+ :key="column.label + index"
97
+ v-bind="item.$bind"
98
+ v-on="item.$on"
99
+ />
100
+
136
101
  </el-table>
137
- <div v-if="showPagination" style="position: relative; margin-top: 5px">
102
+ <div v-if="showPagination && !isShowCard" style="position: relative; margin-top: 5px">
138
103
  <el-row>
139
104
  <!-- <el-col
140
105
  v-if="
@@ -230,7 +195,7 @@
230
195
  :page-grid-data="isSubTableShowPage ? getSubTableGridData(subTableData) : gridData"
231
196
  :line-edit="lineEdit"
232
197
  :show-page="pagination && isShowPage"
233
- :page-size="pagination ? pagination.pageSize : null"
198
+ :page-size="pagination?pagination.pageSize: null"
234
199
  @close="closeRowForm"
235
200
  @refresData="refresData"
236
201
  @refresPortData="refresPortData"
@@ -254,6 +219,7 @@ import ColumnsConfig from './columns-config.vue'
254
219
  import SearchForm from './search-form.vue'
255
220
  import searchFormDialog from './search-form-dialog.vue'
256
221
  import RowDetail from './row-detail.vue'
222
+ import MobileCard from './components/mobile-table-card.jsx'
257
223
  import { getEntityFieldValueWithOutCase, setEntityFieldValue } from '../../../src/utils/util'
258
224
  import eventBus from './eventBus'
259
225
  import {
@@ -282,6 +248,9 @@ import apis from './apis'
282
248
  import headerContextMenu from './header-context-menu.vue'
283
249
  import { isMobileBrowser, isPromise } from '../../../src/utils/common-util'
284
250
  import { checkPermission } from '../../../src/utils/permission'
251
+ import { getGuId } from '../../../src/utils/guid.js';
252
+ // import resizeMixin from '../../../src/mixins/resizeMixin.js';
253
+ import storeVuex from '../../../src/store';
285
254
 
286
255
  export default {
287
256
  components: {
@@ -295,10 +264,17 @@ export default {
295
264
  searchFormDialog,
296
265
  ElIconSetting,
297
266
  ElIconRefresh,
298
- RowDetail
267
+ RowDetail,
268
+ MobileCard
299
269
  },
300
270
  name: 'SuperGrid',
271
+ // mixins: [resizeMixin],
301
272
  props: {
273
+ // 是否自适应卡片
274
+ isShowAutoCard: {
275
+ type: Boolean,
276
+ default: true
277
+ },
302
278
  code: {
303
279
  type: String,
304
280
  default: ''
@@ -462,7 +438,6 @@ export default {
462
438
  isShowPageDialog: false, // 是否显示弹框
463
439
  jumpPageSetting: null,
464
440
  pageCode,
465
- tableHeight: null,
466
441
  maxHeight: null,
467
442
  pageHeight, // 页面高度
468
443
  currentSelectCell: null,
@@ -491,14 +466,24 @@ export default {
491
466
  showRowForm: false, // 是否显示行记录详情
492
467
  baseURL: null,
493
468
  hasFilterDataEvent: false, // 是否是表格过滤
494
- restoreCurrentRowTimer: null // 恢复当前行的定时器
469
+ selectionTableData: [], // 勾选数据
495
470
  }
496
471
  },
497
472
  computed: {
473
+ isMobileResize() {
474
+ return storeVuex.getters.isMobileResize
475
+ },
476
+ // 是否显示卡片
477
+ isShowCard() {
478
+ return this.isShowAutoCard && this.isMobileResize
479
+ },
498
480
  visibleColumns() {
499
481
  const gridParams = store.get(this.code)
500
482
  const operations = this.getOptionOperations()
501
483
  gridParams.canntEdit = false
484
+
485
+ const setAttrs = data => data.map(item => ({ property: item.prop, ...item}))
486
+
502
487
  if (operations && operations.operation && operations.operation.length > 0) {
503
488
  operations.operation.forEach((buttonInfo) => {
504
489
  if (buttonInfo.props.code === 'lineEditUpdate') {
@@ -513,50 +498,61 @@ export default {
513
498
  this.options.isAdministerListView != null &&
514
499
  this.options.isAdministerListView === true
515
500
  ) {
516
- return this.columns
501
+ return setAttrs(this.columns)
517
502
  } else {
518
- return this.columns.filter((column) => {
519
- if (
520
- typeof this.options.multiple !== 'undefined' &&
521
- this.options.multiple === false &&
522
- column.prop === '$selection'
523
- ) {
524
- // 表示不显示“多选”列
525
- return false
526
- }
527
- if (
528
- typeof this.options.showIndex !== 'undefined' &&
529
- this.options.showIndex === false &&
530
- column.prop === '$index'
531
- ) {
532
- // 表示不显示“序号”列
533
- return false
534
- }
535
- let isVisible
536
- if (column.show === undefined || column.show) {
537
- isVisible = true
538
- const hiddenColumns = this.options.hiddenColumns
539
- if (hiddenColumns && hiddenColumns.length > 0 && column.prop && hiddenColumns.indexOf(column.prop) !== -1) {
540
- // 如果当前字段包含在隐藏字段集合中,则不显示该字段
541
- isVisible = false
542
- return isVisible
503
+ return setAttrs(
504
+ this.columns.filter((column) => {
505
+ if (
506
+ typeof this.options.multiple !== 'undefined' &&
507
+ this.options.multiple === false &&
508
+ column.prop === '$selection'
509
+ ) {
510
+ // 表示不显示“多选”列
511
+ return false
543
512
  }
544
- // 给列配置操作属性
545
- this.initColumnOperation(column, operations)
546
- if (!gridParams.$dataTypeMap) {
547
- gridParams.$dataTypeMap = {}
513
+ if (
514
+ typeof this.options.showIndex !== 'undefined' &&
515
+ this.options.showIndex === false &&
516
+ column.prop === '$index'
517
+ ) {
518
+ // 表示不显示“序号”列
519
+ return false
548
520
  }
549
- // sql时行编辑保存后台代码需要
550
- gridParams.$dataTypeMap[column.prop] = column.dataType
551
- } else {
552
- isVisible = false
553
- }
554
- // 存储有默认值的字段集合
555
- this.storeHasDefaultValueColumns(column, gridParams)
556
- return isVisible
557
- })
521
+ let isVisible
522
+ if (column.show === undefined || column.show) {
523
+ isVisible = true
524
+ const hiddenColumns = this.options.hiddenColumns
525
+ if (hiddenColumns && hiddenColumns.length > 0 && column.prop && hiddenColumns.indexOf(column.prop) !== -1) {
526
+ // 如果当前字段包含在隐藏字段集合中,则不显示该字段
527
+ isVisible = false
528
+ return isVisible
529
+ }
530
+ // 给列配置操作属性
531
+ this.initColumnOperation(column, operations)
532
+ if (!gridParams.$dataTypeMap) {
533
+ gridParams.$dataTypeMap = {}
534
+ }
535
+ // sql时行编辑保存后台代码需要
536
+ gridParams.$dataTypeMap[column.prop] = column.dataType
537
+ } else {
538
+ isVisible = false
539
+ }
540
+ // 存储有默认值的字段集合
541
+ this.storeHasDefaultValueColumns(column, gridParams)
542
+ return isVisible
543
+ })
544
+ )
558
545
  }
559
546
  },
547
+ visibleColumnsComponentData() {
548
+ return this.visibleColumns.map(data => this.getColumnComponentData(data, this.myCustomFormatter))
549
+ },
550
+ mobileColumns() {
551
+ return 'Layout'
552
+ },
553
+ tableDatas() {
554
+ return this.hasFilterDataEvent ? this.filterGridData : this.gridData
555
+ },
560
556
  spanArr() {
561
557
  const spanArr = []
562
558
  for (const column of this.columns) {
@@ -599,11 +595,33 @@ export default {
599
595
  // }
600
596
  },
601
597
  watch: {
602
- mergeFields: {
598
+ // 切换表格 与 卡片是否
599
+ 'isShowCard': {
603
600
  deep: true,
604
- handler: function (value) {
605
- // debugger
606
- console.log('mergeFields', value)
601
+ handler(is) {
602
+ // 是否开启卡片,如果开启则平台切换时候重新回到第一页
603
+ if(this.isShowAutoCard) {
604
+ if (this.currentPage > 1) {
605
+ this.currentPage = 1
606
+ this.handleCurrentChange()
607
+ } else {
608
+ this.$nextTick()
609
+ }
610
+ }
611
+ if(!is) {
612
+ // 显示表格后重新格式化展示
613
+ this.$nextTick(() => {
614
+ this.resizeTableHeight()
615
+ this.$refs.superGrid?.doLayout()
616
+ })
617
+ }
618
+ }
619
+ },
620
+ 'tableDatas': {
621
+ deep: true,
622
+ immediate: true,
623
+ handler(a, b) {
624
+ console.log('SGQ --- 表格监听数据修改============================》', a, b)
607
625
  }
608
626
  },
609
627
  'options.SuperGrid': {
@@ -727,6 +745,7 @@ export default {
727
745
  return {}
728
746
  },
729
747
  created() {
748
+ storeVuex?.dispatch?.('startListeningToResize');
730
749
  store.set(this.code, getGridParams())
731
750
  store.set('_list_code', this.code)
732
751
  this.initSetting()
@@ -882,11 +901,6 @@ export default {
882
901
  )
883
902
  })
884
903
  },
885
- beforeDestroy() {
886
- if (this.restoreCurrentRowTimer) {
887
- clearTimeout(this.restoreCurrentRowTimer)
888
- }
889
- },
890
904
  methods: {
891
905
  ...events,
892
906
  ...publicMethods,
@@ -1751,11 +1765,24 @@ export default {
1751
1765
  .post(requestUrl, param)
1752
1766
  .then((data) => {
1753
1767
  if (typeof parentRowIds === 'undefined' || parentRowIds === null) {
1768
+ // 当开启卡片的时候,则开启滚动分页
1769
+ const getChildren = (data) => {
1770
+ return data?.map(item => {
1771
+ return {
1772
+ $rowDataGuId: getGuId(),
1773
+ ...item,
1774
+ ...(item?.children?.length ? {
1775
+ children: getChildren(item.children)
1776
+ } : {})
1777
+ }
1778
+ }) ?? []
1779
+ }
1780
+ const dataList = [...(this.isShowCard && this.currentPage > 1 ? this.gridData : []), ...getChildren(data?.data ?? [])]
1754
1781
  let tableData = []
1755
1782
  // 对数据做序列化,比如:处理xss攻击
1756
1783
  if (isHasOptionFunction('gridDataLoaded', this.code)) {
1757
1784
  const gridDataLoadedParam = {
1758
- gridData: data.data,
1785
+ gridData: dataList,
1759
1786
  columns: gridParams.columns,
1760
1787
  additionalParamMap: gridParams.additionalParamMap,
1761
1788
  pageContext: this.pageContext,
@@ -1769,10 +1796,10 @@ export default {
1769
1796
  if (gridData) {
1770
1797
  tableData = gridData
1771
1798
  } else {
1772
- tableData = data.data
1799
+ tableData = dataList
1773
1800
  }
1774
1801
  } else {
1775
- tableData = data.data
1802
+ tableData = dataList
1776
1803
  }
1777
1804
  if (!tableData) {
1778
1805
  tableData = []
@@ -1867,18 +1894,20 @@ export default {
1867
1894
  if (typeof resove !== 'undefined' && resove !== null) {
1868
1895
  // 首次加载或点击三角展开父节点时走该分支
1869
1896
  // 刷新数据后,移除该父节点下的所有已选中的子节点记录。
1870
- // 必须调用该方法,否则在删除记录时,数据即使刷新了,已选中集合this.$refs.superGrid.store.states.selection中仍会有该已删除记录,导致再次执行删除报id不存在
1897
+ // 必须调用该方法,否则在删除记录时,数据即使刷新了,已选中集合this.$refs.superGrid?.store.states.selection中仍会有该已删除记录,导致再次执行删除报id不存在
1871
1898
  this.removeGridStoreSelection(parentRowIds)
1872
1899
  resove(data[parentRowIds[0]])
1873
1900
  } else {
1874
1901
  // 刷新父记录对应的子记录集合时需要,例如:删除时
1875
1902
  parentRowIds.forEach((parentRowId) => {
1876
1903
  // 单行父记录id
1877
- this.$refs.superGrid.store.states.lazyTreeNodeMap[parentRowId] = data[parentRowId]
1878
- this.$refs.superGrid.store.states.treeData[parentRowId].children = data[parentRowId]
1904
+ if (this.$refs.superGrid) {
1905
+ this.$refs.superGrid.store.states.lazyTreeNodeMap[parentRowId] = data[parentRowId]
1906
+ this.$refs.superGrid.store.states.treeData[parentRowId].children = data[parentRowId]
1907
+ }
1879
1908
  })
1880
1909
  // 刷新数据后,移除该父节点下的所有已选中的子节点记录
1881
- // 必须调用该方法,否则在删除记录时,数据即使刷新了,已选中集合this.$refs.superGrid.store.states.selection中仍会有该已删除记录,导致再次执行删除报id不存在
1910
+ // 必须调用该方法,否则在删除记录时,数据即使刷新了,已选中集合this.$refs.superGrid?.store.states.selection中仍会有该已删除记录,导致再次执行删除报id不存在
1882
1911
  this.removeGridStoreSelection(parentRowIds)
1883
1912
  }
1884
1913
  this.hasLoadData = true
@@ -2178,8 +2207,7 @@ export default {
2178
2207
  },
2179
2208
  getSearchParam() {
2180
2209
  const searchParam = {
2181
- code: this.code,
2182
- tableName: this.tableName
2210
+ code: this.code
2183
2211
  }
2184
2212
  const gridParams = store.get(this.code)
2185
2213
  const pagination = this.getPaginationInfo()
@@ -2285,8 +2313,9 @@ export default {
2285
2313
  }
2286
2314
  },
2287
2315
  changePage() {
2316
+ console.log('点击了分页')
2288
2317
  // 翻页操作会导致筛选项发生变化,所以需要清空已有的
2289
- this.$refs.superGrid.clearFilter()
2318
+ this.$refs.superGrid?.clearFilter()
2290
2319
  // TODO: 把当前页数、每页条数、查询条件、排序信息传回后台
2291
2320
  if (this.isSubTableShowPage) {
2292
2321
  this.gridData = this.getSubTableGridData(this.subTableData)
@@ -2311,7 +2340,7 @@ export default {
2311
2340
  // 如果最后编辑行没有保存或撤销编辑,则给出提示
2312
2341
  const gridParams = store.get(this.code)
2313
2342
  console.log('请先保存或撤销编辑第' + gridParams.$rowIndex + 1 + '行记录,再排序')
2314
- this.$refs.superGrid.clearSort()
2343
+ this.$refs.superGrid?.clearSort()
2315
2344
  } else {
2316
2345
  // TODO: 应该调用fetchData来获取信息,把当前页数、查询条件、排序信息传回后台
2317
2346
  if (prop !== null && columnSetting && columnSetting !== null) {
@@ -2517,30 +2546,30 @@ export default {
2517
2546
  },
2518
2547
  expandChange(row, expanded) {
2519
2548
  if (this.isLazy) {
2520
- // console.log('expandChange==row, expanded', row, expanded, this.$refs.superGrid.store.states)
2549
+ // console.log('expandChange==row, expanded', row, expanded, this.$refs.superGrid?.store.states)
2521
2550
  if (expanded === false) {
2522
2551
  // 折叠时清空表格缓存的已加载的标识位,使其能够动态更新子集合
2523
2552
  // 必须添加这句,否则不会重新走load
2524
- if (this.$refs.superGrid.store.states.treeData) {
2553
+ if (this.$refs.superGrid?.store.states.treeData) {
2525
2554
  this.$refs.superGrid.store.states.treeData[row.id ? row.id : row.ID].loaded = false
2526
2555
  }
2527
2556
  } else {
2528
- // console.log('expandChange=this.$refs.superGrid.store.states.lazyTreeNodeMap', this.$refs.superGrid.store.states.lazyTreeNodeMap)
2529
- // console.log('expandChange=this.$refs.superGrid.store.states.treeData', this.$refs.superGrid.store.states.treeData)
2530
- // console.log('expandChange=this.$refs.superGrid.store.states.selection', this.$refs.superGrid.store.states.selection)
2557
+ // console.log('expandChange=this.$refs.superGrid?.store.states.lazyTreeNodeMap', this.$refs.superGrid?.store.states.lazyTreeNodeMap)
2558
+ // console.log('expandChange=this.$refs.superGrid?.store.states.treeData', this.$refs.superGrid?.store.states.treeData)
2559
+ // console.log('expandChange=this.$refs.superGrid?.store.states.selection', this.$refs.superGrid?.store.states.selection)
2531
2560
  }
2532
2561
  }
2533
2562
  },
2534
2563
  removeGridStoreSelection(parentRowIds) {
2535
2564
  let selection = []
2536
- if (this.$refs.superGrid.store.states.selection) {
2537
- selection = [].concat(JSON.parse(JSON.stringify(this.$refs.superGrid.store.states.selection)))
2565
+ if (this.$refs.superGrid?.store.states.selection) {
2566
+ selection = [].concat(JSON.parse(JSON.stringify(this.$refs.superGrid?.store.states.selection)))
2538
2567
  }
2539
2568
  for (let i = 0; i < selection.length; i++) {
2540
2569
  if (parentRowIds && parentRowIds.indexOf(selection[i][this.parentProp]) >= 0) {
2541
2570
  // 移除第i个元素
2542
- this.$refs.superGrid.store.states.selection.splice(i, 1)
2543
- if (this.$refs.superGrid.store.states.selection.length > 0) {
2571
+ this.$refs.superGrid?.store.states.selection.splice(i, 1)
2572
+ if (this.$refs.superGrid?.store.states.selection.length > 0) {
2544
2573
  this.removeGridStoreSelection(parentRowIds)
2545
2574
  }
2546
2575
  break
@@ -2623,7 +2652,7 @@ export default {
2623
2652
  this.createBackgroundColorMap()
2624
2653
  this.backgroundColorMap[item.prop] = '#409EFF'
2625
2654
  if (this.$refs && this.$refs.superGrid) {
2626
- this.$refs.superGrid.doLayout()
2655
+ this.$refs.superGrid?.doLayout()
2627
2656
  }
2628
2657
  }
2629
2658
  },
@@ -2647,7 +2676,7 @@ export default {
2647
2676
  this.backgroundColorMap = backgroundColorMap
2648
2677
  this.externalClickFlag = false
2649
2678
  if (this.$refs && this.$refs.superGrid) {
2650
- this.$refs.superGrid.doLayout()
2679
+ this.$refs.superGrid?.doLayout()
2651
2680
  }
2652
2681
  },
2653
2682
  // 根据element事件传递的column来获取自定义封装的column
@@ -2753,6 +2782,7 @@ export default {
2753
2782
  return this.isSubTableShowPage ? this.subTableData : this.gridData
2754
2783
  },
2755
2784
  rowDblclickEvent(row, column, event) {
2785
+ debugger;
2756
2786
  const gridParams = store.get(this.code)
2757
2787
  if (gridParams.options && gridParams.options.isFormSubTable && gridParams.options.isPdfEditor) {
2758
2788
  // 如果是子表并且是pdf模式
@@ -2762,6 +2792,7 @@ export default {
2762
2792
  let canEdit = true
2763
2793
  const gridParams = store.get(this.code)
2764
2794
  if (isEditOptionFunction('beforeEdit', this.code)) {
2795
+ debugger;
2765
2796
  const isSubTableShowPage = gridParams.isSubTableShowPage
2766
2797
  // 每页显示多少条
2767
2798
  const pageSize = gridParams.pagination && gridParams.pagination.pageSize
@@ -2792,6 +2823,7 @@ export default {
2792
2823
  }
2793
2824
  } else {
2794
2825
  if (row) {
2826
+ debugger;
2795
2827
  if (gridParams && gridParams.lineEdit && gridParams.lineEdit.editable && gridParams.canntEdit) {
2796
2828
  let index = this.gridData.findIndex(function (item) {
2797
2829
  return (item.id && item.id === row.id) || (item.ID && item.ID === row.ID)
@@ -2806,6 +2838,7 @@ export default {
2806
2838
  this.rowDblClick(row, column, event)
2807
2839
  },
2808
2840
  rowDbClickEditRow(gridParams, row) {
2841
+ console.log('rowDbClickEditRow+++++++++++++++++++', gridParams, row)
2809
2842
  // 取消上一行的编辑状态
2810
2843
  let editRows
2811
2844
  if (this.isSubTableShowPage) {
@@ -2987,6 +3020,7 @@ export default {
2987
3020
  * @param entity 格式如:{'NAME':false,"DYM_COLUMN":true}。表示NAME字段不可编辑,DYM_COLUMN可以被编辑
2988
3021
  */
2989
3022
  prohibitToEdit(entity) {
3023
+ console.log('我执行了 prohibitToEdit=================================》', entity)
2990
3024
  this.fnProhibitToEdit(entity)
2991
3025
  },
2992
3026
  // 树形结构时数据展示
@@ -3027,6 +3061,7 @@ export default {
3027
3061
  },
3028
3062
  // 选择记录
3029
3063
  selectRecord(selection, row) {
3064
+ this.selectionTableData = row
3030
3065
  let selectRecordEventResult = true
3031
3066
  const gridParams = store.get(this.code)
3032
3067
  if (isHasOptionFunction('selectRecord', this.code)) {
@@ -3044,7 +3079,7 @@ export default {
3044
3079
  })
3045
3080
  if (selectRecordEventResult !== undefined && selectRecordEventResult === false) {
3046
3081
  // 最后选中的记录取消选中状态
3047
- this.$refs.superGrid.toggleRowSelection(row, false)
3082
+ this.$refs.superGrid?.toggleRowSelection(row, false)
3048
3083
  }
3049
3084
  }
3050
3085
  this.select(selection, row)
@@ -3067,13 +3102,26 @@ export default {
3067
3102
  })
3068
3103
  if (selectAllRecordsEventResult !== undefined && selectAllRecordsEventResult === false) {
3069
3104
  // 取消所有记录选中状态
3070
- this.$refs.superGrid.toggleAllSelection()
3105
+ this.$refs.superGrid?.toggleAllSelection()
3071
3106
  }
3072
3107
  }
3073
3108
  this.selectAll(selection)
3074
3109
  },
3110
+ cardSelectionChangeEvent(newSelection) {
3111
+ try {
3112
+ this.$refs.superGrid?.clearSelection()
3113
+ for(const i in newSelection) {
3114
+ const row = newSelection[i]
3115
+ this.$refs.superGrid?.toggleRowSelection(row, true)
3116
+ }
3117
+ } catch (error) {
3118
+ console.error(error)
3119
+ }
3120
+ this.selectionChangeEvent(newSelection)
3121
+ },
3075
3122
  // 选择记录发生改变时
3076
3123
  selectionChangeEvent(newSelection) {
3124
+ this.selectionTableData = newSelection
3077
3125
  const gridParams = store.get(this.code)
3078
3126
  if (isHasOptionFunction('selectionChange', this.code)) {
3079
3127
  gridParams.options.selectionChange.call(this, {
@@ -3089,7 +3137,7 @@ export default {
3089
3137
  })
3090
3138
  // if(selectionChangeEventResult !== undefined && selectionChangeEventResult=== false){
3091
3139
  // // 最后选中的记录取消选中状态
3092
- // this.$refs.superGrid.toggleRowSelection(newSelection[newSelection.length - 1], false)
3140
+ // this.$refs.superGrid?.toggleRowSelection(newSelection[newSelection.length - 1], false)
3093
3141
  // }
3094
3142
  }
3095
3143
  this.selectionChange(newSelection)
@@ -3189,6 +3237,57 @@ export default {
3189
3237
  } else {
3190
3238
  return prop
3191
3239
  }
3240
+ },
3241
+ getColumnComponentData(column, myCustomFormatter) {
3242
+ try {
3243
+ // if (!['[object Object]'].includes(Object.prototype.toString.call(column))) throw new Error('no column');
3244
+ const componentType = this.getComponentType(column)
3245
+ return {
3246
+ column,
3247
+ getComponentType: this.getComponentType,
3248
+ customFormat: myCustomFormatter,
3249
+ // props + attrs 参数
3250
+ $bind: {
3251
+ column,
3252
+ 'ref': column.prop,
3253
+ // 'is': componentType,
3254
+ 'is-sql': this.isSql,
3255
+ 'list-code': this.code,
3256
+ 'new-width': this.newWidth,
3257
+ 'drag-column-prop': this.dragColumnProp,
3258
+ 'right-click-menu-arr': this.options?.rightClickMenuArr,
3259
+ 'table-name': this.tableName,
3260
+ 'page-code': this.pageCode,
3261
+ 'list-name': this.listName,
3262
+ 'options': this.options,
3263
+ 'current-page': this.currentPage,
3264
+ 'pagination': this.pagination,
3265
+ 'grid-data': this.isSubTableShowPage ? this.subTableData : this.gridData,
3266
+ 'page-grid-data': this.isSubTableShowPage ? this.getSubTableGridData(this.subTableData) : this.gridData,
3267
+ ...(myCustomFormatter ? {
3268
+ 'custom-format': ['GroupColumn'].includes(componentType) ? myCustomFormatter : myCustomFormatter[column.prop],
3269
+ } : {
3270
+ 'is-line-edit': this.lineEdit?.editable ?? false,
3271
+ 'list-toolbar-form-data': this.listToolbarFormData,
3272
+ }),
3273
+ },
3274
+ // 事件绑定
3275
+ $on: {
3276
+ 'open-page': this.openPageDialog,
3277
+ 'refresData': this.refresData,
3278
+ 'refresh-list': this.refreshList,
3279
+ 'refresPortData': this.refresPortData,
3280
+ 'refresPortsData': this.refresPortsData,
3281
+ 'refresMainTableFields': this.refresMainTableFields,
3282
+ 'prohibitToEdit': this.prohibitToEdit,
3283
+ }
3284
+ }
3285
+ } catch (error) {
3286
+ console.error(error)
3287
+ return {
3288
+ column
3289
+ }
3290
+ }
3192
3291
  }
3193
3292
  },
3194
3293
  emits: [
@@ -3216,4 +3315,9 @@ export default {
3216
3315
  padding: 2px 0 !important;
3217
3316
  }
3218
3317
  }
3318
+ .el-table ::v-deep {
3319
+ & > .el-table__inner-wrapper {
3320
+ height: 100% !important;
3321
+ }
3322
+ }
3219
3323
  </style>
@@ -564,7 +564,7 @@ export function getTableHeight(superGrid, listCode, pageHeight) {
564
564
  if (superGrid) {
565
565
  rect = superGrid.$el.getBoundingClientRect()
566
566
  }
567
- const totalHeight = window.innerHeight - rect.y - 110
567
+ const totalHeight = window.innerHeight - (rect?.y ?? 0) - 110
568
568
  console.log('rect=', rect, 'window.innerHeight=', window.innerHeight, 'totalHeight=', totalHeight)
569
569
  return totalHeight
570
570