doway-coms 2.11.61 → 2.11.62

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.11.61",
3
+ "version": "2.11.62",
4
4
  "description": "doway组件库",
5
5
  "author": "dowaysoft",
6
6
  "main": "packages/index.js",
@@ -1,8 +1,8 @@
1
- // 导入组件,组件必须声明 name
2
- import BaseDateMonth from './src/index.vue';
3
- // 为组件提供 install 安装方法,供按需引入
4
- BaseDateMonth.install = function(Vue) {
5
- Vue.component(BaseDateMonth.name, BaseDateMonth);
6
- };
7
- // 默认导出组件
1
+ // 导入组件,组件必须声明 name
2
+ import BaseDateMonth from './src/index.vue';
3
+ // 为组件提供 install 安装方法,供按需引入
4
+ BaseDateMonth.install = function(Vue) {
5
+ Vue.component(BaseDateMonth.name, BaseDateMonth);
6
+ };
7
+ // 默认导出组件
8
8
  export default BaseDateMonth;
@@ -1,164 +1,164 @@
1
- <template>
2
- <div class="d-control-container">
3
- <div class="d-control-label">
4
- {{ label }}
5
- <span v-if="rules && rules['required']" class="d-control-label-required"
6
- >*</span
7
- >
8
- <Tooltip :title="tooltip" v-if="tooltip" style="margin: 0 2px">
9
- <img src="../../styles/icon/help.png" alt="" style="width: 14px" />
10
- </Tooltip>
11
- </div>
12
- <div class="d-control">
13
- <ValidationProvider
14
- :name="label"
15
- v-slot="v"
16
- :rules="rules"
17
- v-if="edit === true"
18
- >
19
- <MonthPicker
20
- :size="'small'"
21
- placeholder="选择月"
22
- v-model="currentValue"
23
- value-format="YYYY-MM-DD"
24
- style="width: 100%"
25
- :class="{ 'd-error-input': v.errors.length > 0 }"
26
- @change="change"
27
- />
28
- <div class="d-error-msg">
29
- {{ v.errors[0] }}
30
- </div>
31
- </ValidationProvider>
32
- <Tooltip placement="topLeft" v-else>
33
- <template slot="title">
34
- {{ moment(currentValue).format("YYYY-MM") }}
35
- </template>
36
- <span @contextmenu.prevent="(event) => onContextmenu(event, currentValue)">
37
- {{ moment(currentValue).format("YYYY-MM") }}
38
- </span>
39
- </Tooltip>
40
- </div>
41
- </div>
42
- </template>
43
-
44
- <script>
45
- //VXETable插件
46
- import VXETable from "vxe-table";
47
- //轻量级剪贴板复制函数
48
- import XEClipboard from "xe-clipboard";
49
- import moment from "moment";
50
- import { DatePicker } from "ant-design-vue";
51
- import { ValidationProvider } from "vee-validate";
52
- import { Tooltip } from "ant-design-vue";
53
- export default {
54
- name: "BaseDateMonth",
55
- components: {
56
- MonthPicker: DatePicker.MonthPicker,
57
- ValidationProvider,
58
- Tooltip,
59
- },
60
- data() {
61
- return {
62
- moment,
63
- filterValue: "",
64
- isInputChanged: false,
65
- inputTimeout: null,
66
- searchRows: [],
67
- filterCols: [],
68
- gridLoading: false,
69
- gridPagerConfig: {
70
- total: 0,
71
- currentPage: 1,
72
- pageSize: 10,
73
- },
74
- };
75
- },
76
- computed: {
77
- currentValue: {
78
- // 动态计算currentValue的值
79
- get: function () {
80
- return this.value; // 将props中的value赋值给currentValue
81
- },
82
- set: function (val) {
83
- this.$emit("input", val); // 通过$emit触发父组件
84
- },
85
- },
86
- },
87
- props: {
88
- rules: {
89
- type: Object,
90
- default: function () {
91
- return null;
92
- },
93
- },
94
- value: {
95
- type: String,
96
- default: function () {
97
- return "";
98
- },
99
- },
100
- edit: {
101
- type: Boolean,
102
- default: function () {
103
- return false;
104
- },
105
- },
106
- name: {
107
- type: String,
108
- default: function () {
109
- return "";
110
- },
111
- },
112
- label: {
113
- type: String,
114
- default: function () {
115
- return "";
116
- },
117
- },
118
- placeholder: {
119
- type: String,
120
- default: function () {
121
- return "";
122
- },
123
- },
124
- tooltip: {
125
- type: String,
126
- default: function () {
127
- return "";
128
- },
129
- },
130
- },
131
- created() {},
132
- methods: {
133
- change() {
134
- this.$emit("change");
135
- },
136
- onContextmenu(event, currentValue) {
137
- this.$contextmenu({
138
- items: [
139
- {
140
- icon: 'ant-design:folder-open-filled',
141
- label: "复制",
142
- onClick: () => {
143
- if (XEClipboard.copy(currentValue)) {
144
- VXETable.modal.message({
145
- content: "已复制到剪贴板!",
146
- status: "success",
147
- });
148
- }
149
- }
150
- }
151
- ],
152
- event,
153
- zIndex: 1000,
154
- minWidth: 150
155
- });
156
- return false;
157
- }
158
- },
159
- };
160
- </script>
161
-
162
- <style lang="less">
163
- @import "../../styles/default.less";
1
+ <template>
2
+ <div class="d-control-container">
3
+ <div class="d-control-label">
4
+ {{ label }}
5
+ <span v-if="rules && rules['required']" class="d-control-label-required"
6
+ >*</span
7
+ >
8
+ <Tooltip :title="tooltip" v-if="tooltip" style="margin: 0 2px">
9
+ <img src="../../styles/icon/help.png" alt="" style="width: 14px" />
10
+ </Tooltip>
11
+ </div>
12
+ <div class="d-control">
13
+ <ValidationProvider
14
+ :name="label"
15
+ v-slot="v"
16
+ :rules="rules"
17
+ v-if="edit === true"
18
+ >
19
+ <MonthPicker
20
+ :size="'small'"
21
+ placeholder="选择月"
22
+ v-model="currentValue"
23
+ value-format="YYYY-MM-DD"
24
+ style="width: 100%"
25
+ :class="{ 'd-error-input': v.errors.length > 0 }"
26
+ @change="change"
27
+ />
28
+ <div class="d-error-msg">
29
+ {{ v.errors[0] }}
30
+ </div>
31
+ </ValidationProvider>
32
+ <Tooltip placement="topLeft" v-else>
33
+ <template slot="title">
34
+ {{ moment(currentValue).format("YYYY-MM") }}
35
+ </template>
36
+ <span @contextmenu.prevent="(event) => onContextmenu(event, currentValue)">
37
+ {{ moment(currentValue).format("YYYY-MM") }}
38
+ </span>
39
+ </Tooltip>
40
+ </div>
41
+ </div>
42
+ </template>
43
+
44
+ <script>
45
+ //VXETable插件
46
+ import VXETable from "vxe-table";
47
+ //轻量级剪贴板复制函数
48
+ import XEClipboard from "xe-clipboard";
49
+ import moment from "moment";
50
+ import { DatePicker } from "ant-design-vue";
51
+ import { ValidationProvider } from "vee-validate";
52
+ import { Tooltip } from "ant-design-vue";
53
+ export default {
54
+ name: "BaseDateMonth",
55
+ components: {
56
+ MonthPicker: DatePicker.MonthPicker,
57
+ ValidationProvider,
58
+ Tooltip,
59
+ },
60
+ data() {
61
+ return {
62
+ moment,
63
+ filterValue: "",
64
+ isInputChanged: false,
65
+ inputTimeout: null,
66
+ searchRows: [],
67
+ filterCols: [],
68
+ gridLoading: false,
69
+ gridPagerConfig: {
70
+ total: 0,
71
+ currentPage: 1,
72
+ pageSize: 10,
73
+ },
74
+ };
75
+ },
76
+ computed: {
77
+ currentValue: {
78
+ // 动态计算currentValue的值
79
+ get: function () {
80
+ return this.value; // 将props中的value赋值给currentValue
81
+ },
82
+ set: function (val) {
83
+ this.$emit("input", val); // 通过$emit触发父组件
84
+ },
85
+ },
86
+ },
87
+ props: {
88
+ rules: {
89
+ type: Object,
90
+ default: function () {
91
+ return null;
92
+ },
93
+ },
94
+ value: {
95
+ type: String,
96
+ default: function () {
97
+ return "";
98
+ },
99
+ },
100
+ edit: {
101
+ type: Boolean,
102
+ default: function () {
103
+ return false;
104
+ },
105
+ },
106
+ name: {
107
+ type: String,
108
+ default: function () {
109
+ return "";
110
+ },
111
+ },
112
+ label: {
113
+ type: String,
114
+ default: function () {
115
+ return "";
116
+ },
117
+ },
118
+ placeholder: {
119
+ type: String,
120
+ default: function () {
121
+ return "";
122
+ },
123
+ },
124
+ tooltip: {
125
+ type: String,
126
+ default: function () {
127
+ return "";
128
+ },
129
+ },
130
+ },
131
+ created() {},
132
+ methods: {
133
+ change() {
134
+ this.$emit("change");
135
+ },
136
+ onContextmenu(event, currentValue) {
137
+ this.$contextmenu({
138
+ items: [
139
+ {
140
+ icon: 'ant-design:folder-open-filled',
141
+ label: "复制",
142
+ onClick: () => {
143
+ if (XEClipboard.copy(currentValue)) {
144
+ VXETable.modal.message({
145
+ content: "已复制到剪贴板!",
146
+ status: "success",
147
+ });
148
+ }
149
+ }
150
+ }
151
+ ],
152
+ event,
153
+ zIndex: 1000,
154
+ minWidth: 150
155
+ });
156
+ return false;
157
+ }
158
+ },
159
+ };
160
+ </script>
161
+
162
+ <style lang="less">
163
+ @import "../../styles/default.less";
164
164
  </style>
@@ -85,6 +85,8 @@
85
85
  :show-footer="showFooter"
86
86
  @scroll="bodyScroll"
87
87
  @keydown="keydownEvent"
88
+ @cell-mouseenter="cellMouseEnter"
89
+ @cell-mouseleave="cellMouseLeave"
88
90
  >
89
91
  <template v-for="item in internalColumns" #[item.field]>
90
92
  <div :key="item.field">
@@ -818,7 +820,7 @@ import BasePagination from '../../BasePagination/index'
818
820
  import exportCmp from './exportCmp.vue'
819
821
  import BasePulldown from '../../BasePulldown/index'
820
822
  import BaseGridAdjust from '../../BaseGridAdjust/index'
821
- import { saveUserModuleDataFieldApi, userResetApi } from '../../utils/api'
823
+ import { saveUserModuleDataFieldApi, userResetApi, saveUserModuleDataPageSizeApi } from '../../utils/api'
822
824
  import { gridDefaultValueDisplay } from '../../utils/filters'
823
825
  import SeqSetting from './SeqSetting'
824
826
  import request from '../../utils/request'
@@ -850,6 +852,7 @@ export default {
850
852
  },
851
853
  data() {
852
854
  return {
855
+ selectedCells :[],//选中的列信息
853
856
  gridOptions:{},
854
857
  copySaveRow:null, //存储复制的行
855
858
  gridDefaultValueDisplay: gridDefaultValueDisplay,
@@ -924,6 +927,12 @@ export default {
924
927
  visible: true,
925
928
  disabled: false,
926
929
  },
930
+ {
931
+ code: 'batchPasteFirstValue',
932
+ name: '批量修改成第一个值',
933
+ visible: true,
934
+ disabled: false,
935
+ },
927
936
  {
928
937
  code: 'sort',
929
938
  name: '排序',
@@ -959,6 +968,16 @@ export default {
959
968
  if(item.code==='fixedLeft'){
960
969
  item.visible = Boolean(column && !column.fixed && this.moduleCode && this.dataCode && column.type!=='seq' && column.type!=='checkbox')
961
970
  }
971
+ if(item.code==='batchPasteFirstValue'){
972
+ let tempVisible = false
973
+ if(this.selectedCells.length>1){
974
+ let tempColumn = this.$refs.baseGrid.getColumns()[this.selectedCells[0].columnIndex]
975
+ if(tempColumn.params && tempColumn.params.batchPaste===true){
976
+ tempVisible = true
977
+ }
978
+ }
979
+ item.visible =tempVisible
980
+ }
962
981
  })
963
982
  })
964
983
  // if(column && column.fixed){
@@ -1434,7 +1453,17 @@ export default {
1434
1453
  }
1435
1454
  return scope.column.params.controlEdit === true && editExpResult
1436
1455
  },
1456
+ cellMouseEnter(scope){
1457
+ if(scope.$event.buttons===1){
1458
+ //左键被按下进行拖动
1459
+ this.setRangeSelectCell(scope)
1460
+ }
1461
+ // console.debug('cellMouseEnter',scope)
1462
+ },
1463
+ cellMouseLeave(scope){
1464
+ },
1437
1465
  keydownEvent({$event,$grid,$table}){
1466
+ console.log('keydownEvent',$event)
1438
1467
  if(this.keyBoardNavi){
1439
1468
  const key=$event.key
1440
1469
  //当前行
@@ -1555,6 +1584,8 @@ export default {
1555
1584
  //设置筛选过滤条件
1556
1585
  this.setFilterExpression()
1557
1586
  //通知外部筛选改变事件
1587
+ //清空选中单元格信息
1588
+ this.selectedCells = []
1558
1589
  this.$emit('filterChange', { filterCol: colInfo })
1559
1590
  } else {
1560
1591
  // 手动触发重新筛选filterMethod()方法
@@ -1776,7 +1807,7 @@ export default {
1776
1807
  contextMenuClickEvent({ menu, row, column }) {
1777
1808
  let vm = this
1778
1809
  const $table = this.$refs.baseGrid
1779
- console.debug('menu',menu)
1810
+ // console.debug('menu',menu)
1780
1811
  // if (column && column.field) {
1781
1812
  // if (
1782
1813
  // menu.code !== 'sort' &&
@@ -1887,6 +1918,8 @@ export default {
1887
1918
  this.tagData = JSON.parse(
1888
1919
  JSON.stringify(this.$refs.baseGrid.getCheckedFilters())
1889
1920
  )
1921
+ //清空选中单元格信息
1922
+ this.selectedCells = []
1890
1923
  vm.$emit('filterChange')
1891
1924
  break
1892
1925
  case 'desc':
@@ -1925,9 +1958,56 @@ export default {
1925
1958
  })
1926
1959
  this.$emit('sortChange', data)
1927
1960
  break
1928
- default:
1961
+ case 'batchPasteFirstValue':
1962
+ this.batchPasteFirstValue()
1963
+ break
1964
+ default:
1929
1965
  }
1930
1966
  },
1967
+ batchPasteFirstValue(){
1968
+ console.debug('batchPasteFirstValue')
1969
+ if(this.selectedCells.length===0){
1970
+ return
1971
+ }
1972
+ //获取第一个单元格的值,并且判断是否可以编辑
1973
+ if(this.gridEdit!==true){
1974
+ return
1975
+ }
1976
+
1977
+ let tempVisibleColumns = this.$refs.baseGrid.getColumns()
1978
+
1979
+ let firstColumn = tempVisibleColumns[this.selectedCells[0].columnIndex]
1980
+ if(!(firstColumn.params && firstColumn.params.edit===true)){
1981
+ //不可编辑的状态
1982
+ return
1983
+ }
1984
+ //可以批量复制的控件类型
1985
+ let availableControlTypes = [controlType.text,controlType.number,controlType.date,
1986
+ controlType.datetime,controlType.select
1987
+ ]
1988
+
1989
+ if(XEUtils.indexOf(availableControlTypes,firstColumn.params.controlType)<0){
1990
+ //不可编辑的状态
1991
+ return
1992
+ }
1993
+
1994
+ let visibleData = this.getVisibleData()
1995
+ let firstValue = visibleData[this.selectedCells[0].rowIndex][firstColumn.field]
1996
+ //可以编辑的状态
1997
+ for(let i=1;i<this.selectedCells.length;i++){
1998
+ if(this.selectedCells[i].columnIndex!==this.selectedCells[0].columnIndex){
1999
+ //如果不是同一列 就不处理
2000
+ continue
2001
+ }
2002
+ let currentRowInfo = visibleData[this.selectedCells[i].rowIndex]
2003
+ currentRowInfo[firstColumn.field]=firstValue
2004
+ this.cellValueChange({row:currentRowInfo,column:firstColumn})
2005
+ // console.debug('currentRowInfo',currentRowInfo)
2006
+ }
2007
+
2008
+
2009
+ // let firstCellValue=this.selectedCells[0].
2010
+ },
1931
2011
  /**
1932
2012
  * 固定列到左侧
1933
2013
  * @param scope
@@ -1956,6 +2036,8 @@ export default {
1956
2036
  return this.defaultSort.map((item) => [item.field, item.order])
1957
2037
  },
1958
2038
  filterChange({ column, property, values, datas, filterList, $event }) {
2039
+ //清空选中单元格信息
2040
+ this.selectedCells = []
1959
2041
  let vm = this
1960
2042
  //如果不是远程筛选 就不emit了
1961
2043
  if (!this.filterRemote) {
@@ -2127,6 +2209,9 @@ export default {
2127
2209
  if (originCol.editStates) {
2128
2210
  colParams['editStates'] = originCol.editStates
2129
2211
  }
2212
+ if(originCol.batchPaste===true){
2213
+ colParams['batchPaste'] = originCol.batchPaste
2214
+ }
2130
2215
  if (originCol.editStatuss) {
2131
2216
  colParams['editStatuss'] = originCol.editStatuss
2132
2217
  }
@@ -2146,7 +2231,7 @@ export default {
2146
2231
  colInfo.width = 100
2147
2232
  }
2148
2233
 
2149
- if (this.showHeaderOverflow = false){
2234
+ if (this.showHeaderOverflow === false){
2150
2235
  // 设置最小列宽为60px
2151
2236
  colInfo.minWidth = originCol.minWidth || 60
2152
2237
  }
@@ -2446,6 +2531,9 @@ export default {
2446
2531
  })
2447
2532
  },
2448
2533
  sortChange({ column, property, order, sortBy, sortList, $event }) {
2534
+ //清空单元格选中信息
2535
+ this.selectedCells = []
2536
+ // console.debug('sortChange')
2449
2537
  if (this.filterRemote) {
2450
2538
  let tempSortList = []
2451
2539
  XEUtils.arrayEach(sortList, (loopSort) => {
@@ -2458,6 +2546,12 @@ export default {
2458
2546
  this.$emit('currentChange', scope.row)
2459
2547
  },
2460
2548
  pageSizeChange(page, pageSize) {
2549
+ let postData = {
2550
+ moduleCode: this.moduleCode,
2551
+ dataCode: this.dataCode,
2552
+ pageSize: pageSize
2553
+ }
2554
+ saveUserModuleDataPageSizeApi(postData)
2461
2555
  this.$emit('pageSizeChange', page, pageSize, this.filterExpression)
2462
2556
  },
2463
2557
  pageChange(page, pageSize) {
@@ -2994,6 +3088,8 @@ export default {
2994
3088
  },
2995
3089
  checkBoxChanged({ checked, records, row }) {
2996
3090
  this.$emit('checkBoxChanged', checked, records, row)
3091
+ //更新表尾选中合计
3092
+ this.$refs.baseGrid.updateFooter()
2997
3093
  },
2998
3094
  checkBoxAllChanged({ checked, records }) {
2999
3095
  this.$emit('checkBoxAllChanged', checked, records)
@@ -3223,12 +3319,40 @@ export default {
3223
3319
  * 表尾
3224
3320
  */
3225
3321
  footerMethod({ columns, data }) {
3322
+ // console.debug('footer method',columns,data)
3226
3323
  let footerData= this.customFooterMethod({ columns, data })
3227
3324
  if(footerData){
3228
3325
  return footerData
3229
3326
  }else{
3230
3327
  if (this.footerSum.length > 0) {
3231
- let tempResult = [
3328
+ let tempResult = []
3329
+ //选中后合计
3330
+ let tempSelectRows = this.$refs.baseGrid.getCheckboxRecords(true)
3331
+ if(tempSelectRows.length>0){
3332
+ let tempCheckedResult = columns.map((column, columnIndex) => {
3333
+ if (columnIndex === 0) {
3334
+ return '选中'
3335
+ }
3336
+ if (this.footerSum.includes(column.property)) {
3337
+ let tempSumVal = XEUtils.sum(tempSelectRows, column.property)
3338
+ if (
3339
+ column.formatter &&
3340
+ column.formatter !== 'defaultFormat' &&
3341
+ VXETable.formats.store[column.formatter]
3342
+ ) {
3343
+ tempSumVal = VXETable.formats.store[column.formatter].cellFormatMethod({
3344
+ cellValue: tempSumVal,
3345
+ })
3346
+ }
3347
+ return tempSumVal
3348
+ }
3349
+ return null
3350
+ })
3351
+ tempResult.push(tempCheckedResult)
3352
+ }
3353
+
3354
+ //所有合计
3355
+ let tempTotalResult =
3232
3356
  columns.map((column, columnIndex) => {
3233
3357
  if (columnIndex === 0) {
3234
3358
  return '合计'
@@ -3247,16 +3371,58 @@ export default {
3247
3371
  return tempSumVal
3248
3372
  }
3249
3373
  return null
3250
- }),
3251
- ]
3374
+ })
3375
+
3376
+
3377
+ tempResult.push(tempTotalResult)
3378
+ // console.debug('tempResult',tempResult)
3252
3379
  return tempResult
3253
3380
  } else {
3254
3381
  return []
3255
3382
  }
3256
3383
  }
3257
3384
  },
3258
- async cellClick({ row, column }) {
3259
- this.$emit('cellClick', { row, column })
3385
+ async cellClick(scope) {
3386
+ // console.debug('cellClick',scope)
3387
+ // console.debug('cellClick event',scope.$event)
3388
+ let rowKeyField = '_X_ROW_KEY'
3389
+ // let rowElId = row._X_ROW_KEY
3390
+ if(this.rowConfig!=null&&this.rowConfig.keyField){
3391
+ rowKeyField= this.rowConfig.keyField
3392
+ }
3393
+
3394
+ // console.debug('columnIndex',scope.$columnIndex,scope.columnIndex)
3395
+ // console.debug(XEUtils.map(this.$refs.baseGrid.getColumns(),p=>p.field))
3396
+
3397
+
3398
+
3399
+
3400
+ // console.debug('cellClick',column.property,rowElId,row)
3401
+ if(scope.$event.ctrlKey===true){
3402
+ //按住了ctrl键后的点击
3403
+ this.selectedCells.push({
3404
+ columnIndex:scope.$columnIndex,
3405
+ rowIndex:scope.$rowIndex
3406
+ })
3407
+
3408
+ }else if(scope.$event.shiftKey===true && this.selectedCells.length>0){
3409
+ //按住了shift键后的点击,需要计算选中后的区域,清空除第一个之后的数据
3410
+ this.setRangeSelectCell(scope)
3411
+ // scope.$event.preventDefault()
3412
+ // scope.$event.stopPropagation()
3413
+
3414
+ }else{
3415
+ this.selectedCells = [{
3416
+ columnIndex:scope.$columnIndex,
3417
+ rowIndex:scope.$rowIndex
3418
+ }]
3419
+ }
3420
+ // console.debug('this.selectedCells',this.selectedCells)
3421
+ this.$emit('cellClick', { row:scope.row, column:scope.column })
3422
+ // if(this.selectedCells.lengh>1){
3423
+ // //多选情况下就不开启编辑行
3424
+ // return
3425
+ // }
3260
3426
  //判断是否可以跳转
3261
3427
  // if (
3262
3428
  // this.gridEdit != true ||
@@ -3288,7 +3454,7 @@ export default {
3288
3454
  if (this.gridEdit !== true) {
3289
3455
  return
3290
3456
  }
3291
- if (this.$refs.baseGrid.isEditByRow(row) === true) {
3457
+ if (this.$refs.baseGrid.isEditByRow(scope.row) === true) {
3292
3458
  //判断当前行是否是编辑行
3293
3459
  return
3294
3460
  }
@@ -3302,7 +3468,7 @@ export default {
3302
3468
  while (attempt < maxAttempts) {
3303
3469
  const editingRecord = this.$refs.baseGrid.getEditRecord()
3304
3470
  // 如果没有正在编辑的行,或者只有当前行在编辑,则退出等待
3305
- if (!editingRecord || editingRecord.row===row) {
3471
+ if (!editingRecord || editingRecord.row===scope.row) {
3306
3472
  // console.debug('当前行编辑')
3307
3473
  return true
3308
3474
  }
@@ -3319,11 +3485,40 @@ export default {
3319
3485
  //检查是否存在其他行还是编辑状态,如果还是编辑状态就等待关闭编辑状态后再执行当前行的编辑
3320
3486
  //因为会存在如果有校验的话会存在切换快,并且页面卡顿的情况的话会出现当前行打开编辑后又
3321
3487
 
3322
- if (column.editRender && column.editRender.enabled === true) {
3323
- this.$refs.baseGrid.setEditCell(row, column)
3488
+ if (scope.column.editRender && scope.column.editRender.enabled === true) {
3489
+ this.$refs.baseGrid.setEditCell(scope.row, scope.column)
3324
3490
  } else {
3325
- this.$refs.baseGrid.setEditRow(row)
3491
+ this.$refs.baseGrid.setEditRow(scope.row)
3492
+ }
3493
+ },
3494
+ setRangeSelectCell(scope){
3495
+ if(this.selectedCells.length===0){
3496
+ return
3326
3497
  }
3498
+ let startRowIndex = this.selectedCells[0].rowIndex
3499
+ let endRowIndex = scope.$rowIndex
3500
+ let startColumnIndex = this.selectedCells[0].columnIndex
3501
+ let endColumnIndex = scope.$columnIndex
3502
+ //清空除第一个的坐标
3503
+ this.selectedCells.splice(1)
3504
+ if(startRowIndex>endRowIndex){
3505
+ [startRowIndex, endRowIndex] = [endRowIndex, startRowIndex]
3506
+ }
3507
+ if (startColumnIndex > endColumnIndex) {
3508
+ [startColumnIndex, endColumnIndex] = [endColumnIndex, startColumnIndex]
3509
+ }
3510
+ for (let rowIndex = startRowIndex; rowIndex <= endRowIndex; rowIndex++) {
3511
+ for (let colIndex = startColumnIndex; colIndex <= endColumnIndex; colIndex++) {
3512
+ if(this.selectedCells[0].rowIndex===rowIndex&&this.selectedCells[0].columnIndex===colIndex){
3513
+ //第一个跳过
3514
+ continue
3515
+ }
3516
+ this.selectedCells.push({
3517
+ columnIndex:colIndex,
3518
+ rowIndex:rowIndex
3519
+ })
3520
+ }
3521
+ }
3327
3522
  },
3328
3523
  linkClick({item,index, row, column }) {
3329
3524
  if ( this.gridEdit !== true || !(column.editRender && column.editRender.enabled === true) ) {
@@ -3394,6 +3589,9 @@ export default {
3394
3589
  return customStyle
3395
3590
  },
3396
3591
  cellStyleFunc(scope){
3592
+
3593
+ // console.debug('cellstyle',scope.column.property)
3594
+
3397
3595
  let customStyle = {}
3398
3596
  if(this.cellStyle){
3399
3597
  customStyle = this.cellStyle
@@ -3403,6 +3601,20 @@ export default {
3403
3601
  customStyle[loopProp] = scope.column.params.cellStyle[loopProp]
3404
3602
  }
3405
3603
  }
3604
+
3605
+ //设置选中列样式
3606
+ let selectedCell = XEUtils.find(this.selectedCells,p=>p.rowIndex===scope.$rowIndex && p.columnIndex===scope.$columnIndex)
3607
+ if(selectedCell){
3608
+ // console.debug('scope',scope.column.property,scope.row.id,this.selectedCells)
3609
+ customStyle.border = '1px solid #409eff'
3610
+ customStyle.backgroundColor = 'rgb(198 223 247)'
3611
+ }
3612
+
3613
+ if(this.selectedCells.length>1){
3614
+ //多选情况下就禁用文本选择
3615
+ customStyle.userSelect = 'none'
3616
+ }
3617
+
3406
3618
  // customStyle.border = '1px solid black'
3407
3619
  this.$emit('cellStyleCallback',scope,customStyle)
3408
3620
  return customStyle
@@ -3501,6 +3713,8 @@ export default {
3501
3713
  this.tagData = JSON.parse(
3502
3714
  JSON.stringify(this.$refs.baseGrid.getCheckedFilters())
3503
3715
  )
3716
+ //清空选中单元格信息
3717
+ this.selectedCells = []
3504
3718
  vm.$emit('filterChange')
3505
3719
  },
3506
3720
  filterAddExp(colInfo) {
@@ -3545,6 +3759,8 @@ export default {
3545
3759
  if (this.filterRemote) {
3546
3760
  //设置筛选过滤条件
3547
3761
  this.setFilterExpression()
3762
+ //清空选中单元格信息
3763
+ this.selectedCells = []
3548
3764
  //通知外部筛选改变事件
3549
3765
  this.$emit('filterChange', { filterCol: colInfo }, this.filterExpression)
3550
3766
  } else {
@@ -19,7 +19,13 @@ export function saveUserModuleDataFieldApi(data) {
19
19
  data: data
20
20
  })
21
21
  }
22
-
22
+ export function saveUserModuleDataPageSizeApi(data) {
23
+ return request({
24
+ url: store.getters.umsUrl + '/v1/user/saveUserModuleDataPageSize',
25
+ method: 'post',
26
+ data: data
27
+ })
28
+ }
23
29
  export function attachGetAttachUrlApi() {
24
30
  return store.getters.msgUrl + '/v1/Attach'
25
31
  }