doway-coms 2.3.6 → 2.3.8

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": "doway-coms",
3
- "version": "2.3.6",
3
+ "version": "2.3.8",
4
4
  "description": "doway组件库",
5
5
  "author": "dowaysoft",
6
6
  "main": "packages/index.js",
@@ -785,6 +785,7 @@ export default {
785
785
  },
786
786
  data() {
787
787
  return {
788
+ copySaveRow:null, //存储复制的行
788
789
  gridDefaultValueDisplay: gridDefaultValueDisplay,
789
790
  showFooter: false,
790
791
  showGridColumnUserDefine: false,
@@ -832,6 +833,18 @@ export default {
832
833
  visible: true,
833
834
  disabled: false,
834
835
  },
836
+ {
837
+ code: 'copyRow',
838
+ name: '复制行',
839
+ visible: true,
840
+ disabled: false,
841
+ },
842
+ {
843
+ code: 'paste',
844
+ name: '粘贴',
845
+ visible: true,
846
+ disabled: false,
847
+ },
835
848
  {
836
849
  code: 'sort',
837
850
  name: '排序',
@@ -850,9 +863,31 @@ export default {
850
863
  },
851
864
  ],
852
865
  },
866
+
853
867
  ],
854
868
  ],
855
869
  },
870
+ visibleMethod: ({ options, column }) => {
871
+ console.log(options)
872
+ if(this.gridEdit){
873
+ options.forEach(list => {
874
+ list.forEach(item => {
875
+ if(item.code=='copyRow'||item.code=='paste'){
876
+ item.visible=true
877
+ }
878
+ })
879
+ })
880
+ }else{
881
+ options.forEach(list => {
882
+ list.forEach(item => {
883
+ if(item.code=='copyRow'||item.code=='paste'){
884
+ item.visible=false
885
+ }
886
+ })
887
+ })
888
+ }
889
+ return true
890
+ },
856
891
  },
857
892
  toolBarConfig: {
858
893
  custom: true,
@@ -1539,6 +1574,18 @@ export default {
1539
1574
  }
1540
1575
  }
1541
1576
  break
1577
+ case 'copyRow':
1578
+ if(this.gridEdit){
1579
+ this.copySaveRow=cloneDeep(row)
1580
+ this.copySaveRow.id= this.$store.getters.newId() + ''
1581
+ delete this.copySaveRow['_X_ROW_KEY']
1582
+ }
1583
+ break
1584
+ case 'paste':
1585
+ if(this.copySaveRow&&this.gridEdit){
1586
+ $table.insertAt(this.copySaveRow,-1)
1587
+ }
1588
+ break
1542
1589
  case 'clearFilter':
1543
1590
  // 示例
1544
1591
  const filterList = this.$refs.baseGrid.getCheckedFilters()
@@ -2339,7 +2386,7 @@ export default {
2339
2386
  let colElId = scope.column.id
2340
2387
  let rowElId = scope.row._X_ROW_KEY
2341
2388
  //如果用了rowConfig里的keyField
2342
- if(this.rowConfig.keyField){
2389
+ if(this.rowConfig?.keyField){
2343
2390
  rowElId=scope.row[this.rowConfig.keyField]
2344
2391
  }
2345
2392
  //延迟设置输入框自动获取焦点以及选中