imatrix-ui 0.2.44-up → 0.2.45-test

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": "imatrix-ui",
3
- "version": "0.2.44-up",
3
+ "version": "0.2.45-test",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "main": "./lib/super-ui.js",
@@ -91,6 +91,9 @@ export default {
91
91
  type: String,
92
92
  default: ',',
93
93
  },
94
+ this: {
95
+ type: Object,
96
+ }
94
97
  },
95
98
  data() {
96
99
  let myTitle = this.$t('imatrixUIMessage.pleaseSelectDepartment')
@@ -60,8 +60,9 @@
60
60
  class="elTable"
61
61
  :tree-props="getTreeProps(parentProp, isSql, isLazy, dataSourceType)"
62
62
  @sort-change="handleSortChange"
63
- @select="select"
64
- @select-all="selectAll"
63
+ @select="selectRecord"
64
+ @select-all="selectAllRecord"
65
+ @selection-change="selectionChangeEvent"
65
66
  @row-click="rowClickEvent"
66
67
  @row-dblclick="rowDblclickEvent"
67
68
  @expand-change="expandChange"
@@ -657,6 +658,7 @@ export default {
657
658
  handler(newValue, oldValue) {
658
659
  console.log('watch====options.extraParam.entityMap===改变==', newValue)
659
660
  this.parentFormData = newValue
661
+ this.$emit('change-form-data', this.parentFormData)
660
662
  }
661
663
  }
662
664
  },
@@ -2918,6 +2920,81 @@ export default {
2918
2920
  store.set(this.code, gridParams)
2919
2921
  this['subTableData'] = data
2920
2922
  },
2923
+ // 选择记录
2924
+ selectRecord(selection, row){
2925
+ let selectRecordEventResult = true
2926
+ const gridParams = store.get(this.code)
2927
+ if (isHasOptionFunction('selectRecord', this.code)) {
2928
+ selectRecordEventResult = gridParams.options.selectRecord.call(this, {
2929
+ gridData: this.isSubTableShowPage
2930
+ ? this.subTableData
2931
+ : this.gridData,
2932
+ columns: gridParams.columns,
2933
+ superGrid: this.$refs.superGrid,
2934
+ pageGridData: this.isSubTableShowPage
2935
+ ? this.gridData
2936
+ : null,
2937
+ additionalParamMap: gridParams.additionalParamMap,
2938
+ selection: selection,
2939
+ row: row,
2940
+ parentFormData: this.parentFormData
2941
+ })
2942
+ if(selectRecordEventResult !== undefined && selectRecordEventResult=== false){
2943
+ // 最后选中的记录取消选中状态
2944
+ this.$refs.superGrid.toggleRowSelection(row, false)
2945
+ }
2946
+ }
2947
+ this.select(selection, row)
2948
+ },
2949
+ // 取消选择记录
2950
+ selectAllRecord(selection){
2951
+ let selectAllRecordsEventResult = true
2952
+ const gridParams = store.get(this.code)
2953
+ if (isHasOptionFunction('selectAllRecords', this.code)) {
2954
+ selectAllRecordsEventResult = gridParams.options.selectAllRecords.call(this, {
2955
+ gridData: this.isSubTableShowPage
2956
+ ? this.subTableData
2957
+ : this.gridData,
2958
+ columns: gridParams.columns,
2959
+ superGrid: this.$refs.superGrid,
2960
+ pageGridData: this.isSubTableShowPage
2961
+ ? this.gridData
2962
+ : null,
2963
+ additionalParamMap: gridParams.additionalParamMap,
2964
+ selection: selection,
2965
+ parentFormData: this.parentFormData
2966
+ })
2967
+ if(selectAllRecordsEventResult !== undefined && selectAllRecordsEventResult=== false){
2968
+ // 取消所有记录选中状态
2969
+ this.$refs.superGrid.toggleAllSelection()
2970
+ }
2971
+ }
2972
+ this.selectAll(selection)
2973
+ },
2974
+ // 选择记录发生改变时
2975
+ selectionChangeEvent(newSelection){
2976
+ const gridParams = store.get(this.code)
2977
+ if (isHasOptionFunction('selectionChange', this.code)) {
2978
+ gridParams.options.selectionChange.call(this, {
2979
+ gridData: this.isSubTableShowPage
2980
+ ? this.subTableData
2981
+ : this.gridData,
2982
+ columns: gridParams.columns,
2983
+ superGrid: this.$refs.superGrid,
2984
+ pageGridData: this.isSubTableShowPage
2985
+ ? this.gridData
2986
+ : null,
2987
+ additionalParamMap: gridParams.additionalParamMap,
2988
+ selection: newSelection,
2989
+ parentFormData: this.parentFormData
2990
+ })
2991
+ // if(selectionChangeEventResult !== undefined && selectionChangeEventResult=== false){
2992
+ // // 最后选中的记录取消选中状态
2993
+ // this.$refs.superGrid.toggleRowSelection(newSelection[newSelection.length - 1], false)
2994
+ // }
2995
+ }
2996
+ this.selectionChange(newSelection)
2997
+ },
2921
2998
  },
2922
2999
  emits: [
2923
3000
  'change-grid-data',
@@ -1,8 +1,4 @@
1
1
  .dark-blue {
2
- .el-dialog__header {
3
- padding: 22px 0px 0px 24px;
4
- }
5
-
6
2
  .el-dialog__title::before {
7
3
  content: "";
8
4
  text-align: center;
@@ -18,4 +14,4 @@
18
14
  }
19
15
 
20
16
 
21
- }
17
+ }