vue2-client 1.18.1 → 1.18.2

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": "vue2-client",
3
- "version": "1.18.1",
3
+ "version": "1.18.2",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -86,6 +86,7 @@
86
86
  @editButtonStateDataClick="editButtonStateDataClick"
87
87
  @importExcelOk="importExcelOk"
88
88
  @rowClick="handleRowClick"
89
+ @rowDblClick="handleRowDblClick"
89
90
  @beforeDataChange="beforeDataChange"
90
91
  @expand="onExpand">
91
92
  <template slot="leftButton" slot-scope="{selectedRowKeys, selectedRows}">
@@ -150,6 +151,7 @@
150
151
  @editButtonStateDataClick="editButtonStateDataClick"
151
152
  @importExcelOk="importExcelOk"
152
153
  @rowClick="handleRowClick"
154
+ @rowDblClick="handleRowDblClick"
153
155
  @beforeDataChange="beforeDataChange"
154
156
  @expand="onExpand">
155
157
  <template slot="leftButton" slot-scope="{selectedRowKeys, selectedRows}">
@@ -1046,6 +1048,9 @@ export default {
1046
1048
  handleRowClick (record) {
1047
1049
  this.$emit('rowClick', record)
1048
1050
  },
1051
+ handleRowDblClick (record) {
1052
+ this.$emit('rowDblClick', record)
1053
+ },
1049
1054
  beforeDataChange (record) {
1050
1055
  this.$emit('beforeDataChange', record)
1051
1056
  },
@@ -9,6 +9,7 @@
9
9
  @selectRow="selectRow"
10
10
  @columnClick="columnClick"
11
11
  @ceshi="ceshi"
12
+ @rowDblClick="rowDblClick"
12
13
  :defaultQueryForm="{
13
14
  s_f_user_name: '张三'
14
15
  }"
@@ -58,6 +59,9 @@ export default {
58
59
  }
59
60
  },
60
61
  methods: {
62
+ rowDblClick (record) {
63
+ console.log('rowDblClick', record)
64
+ },
61
65
  // input框 行編輯參數傳遞
62
66
  ceshi (...args) {
63
67
  // attr, value, currentRecord, currentIndex, nextRecord, nextIndex
@@ -167,6 +167,7 @@
167
167
  :queryParamsName="queryParamsName"
168
168
  :disableAction="disableAction"
169
169
  @rowClick="handleRowClick"
170
+ @rowDblClick="handleRowDblClick"
170
171
  @beforeDataChange="beforeDataChange"
171
172
  @expand="onExpand">
172
173
  <template slot="expandedRowRender">
@@ -278,7 +279,8 @@
278
279
  ref="selectedDataTable"
279
280
  :load-selected-data="true"
280
281
  @beforeDataChange="beforeDataChange"
281
- @rowClick="handleRowClick">
282
+ @rowClick="handleRowClick"
283
+ @rowDblClick="handleRowDblClick">
282
284
  </x-table-wrapper>
283
285
  </a-modal>
284
286
  </div>
@@ -1564,6 +1566,9 @@ export default {
1564
1566
  handleRowClick (record) {
1565
1567
  this.$emit('rowClick', record)
1566
1568
  },
1569
+ handleRowDblClick (record) {
1570
+ this.$emit('rowDblClick', record)
1571
+ },
1567
1572
  beforeDataChange (record) {
1568
1573
  this.$emit('beforeDataChange', record)
1569
1574
  },
@@ -25,6 +25,7 @@
25
25
  @beforeDataChange="beforeDataChange"
26
26
  @expand="onExpand"
27
27
  @rowClick="handleRowClick"
28
+ @rowDblClick="handleRowDblClick"
28
29
  >
29
30
  <template
30
31
  v-for="(item, c_index) in realTableColumns"
@@ -61,7 +62,7 @@
61
62
  </span>
62
63
  <CustomFuncCel
63
64
  :text="text"
64
- :record="text"
65
+ :record="record"
65
66
  :index="index"
66
67
  :item="item"
67
68
  :localDataSource="activeTable?.localDataSource"
@@ -166,6 +167,7 @@
166
167
  :components="components"
167
168
  :rowStyleFunction="tableContext.rowStyleFunction"
168
169
  @rowClick="handleRowClick"
170
+ @rowDblClick="handleRowDblClick"
169
171
  @beforeDataChange="beforeDataChange"
170
172
  >
171
173
  <template
@@ -508,6 +510,9 @@ export default {
508
510
  handleRowClick (record) {
509
511
  this.$emit('rowClick', record)
510
512
  },
513
+ handleRowDblClick (record) {
514
+ this.$emit('rowDblClick', record)
515
+ },
511
516
  beforeDataChange (record) {
512
517
  this.$emit('beforeDataChange', record)
513
518
  },
@@ -185,6 +185,9 @@ export default {
185
185
  this.needTotalList = this.initTotalList(this.columns)
186
186
  // this.loadData()
187
187
  },
188
+ beforeDestroy () {
189
+ this.clearClickTimer()
190
+ },
188
191
  methods: {
189
192
  /**
190
193
  * 表格重新加载方法
@@ -371,19 +374,32 @@ export default {
371
374
  onExpand (expanded, record) {
372
375
  this.$emit('expand', expanded, record)
373
376
  },
374
- handleRowClick (record, index) {
377
+ handleRowClick (record, index, event, options = {}) {
378
+ const { forceSelect = false, emitRowClick = true } = options
375
379
  const isRowKeySequence = this.rowKey === '序号'
376
380
  const currentRowKey = isRowKeySequence ? index : record[this.rowKey]
381
+ const isDoubleClick = event && event.detail > 1
382
+ const isSameRow = this.clickedRowKey === currentRowKey
383
+
384
+ if (forceSelect || isDoubleClick) {
385
+ this.clickedRowKey = currentRowKey
386
+ emitRowClick && this.$emit('rowClick', record)
387
+ return
388
+ }
377
389
 
378
390
  // 如果点击的是已选中的行,则取消选中;否则选中该行
379
- if (this.clickedRowKey === currentRowKey) {
391
+ if (isSameRow) {
380
392
  this.clickedRowKey = null
381
- this.$emit('rowClick', null) // 传递 null 表示取消选中
393
+ emitRowClick && this.$emit('rowClick', null) // 传递 null 表示取消选中
382
394
  } else {
383
395
  this.clickedRowKey = currentRowKey
384
- this.$emit('rowClick', record)
396
+ emitRowClick && this.$emit('rowClick', record)
385
397
  }
386
398
  },
399
+ handleRowDoubleClick (record, index, event) {
400
+ this.handleRowClick(record, index, event, { forceSelect: true })
401
+ this.$emit('rowDblClick', record)
402
+ },
387
403
  handleRowMouseEnter (record, index) {
388
404
  if (this.rowKey === '序号') {
389
405
  this.hoveredRowKey = index
@@ -537,7 +553,8 @@ export default {
537
553
  props.customRow = (record, index) => {
538
554
  return {
539
555
  on: {
540
- click: () => this.handleRowClick(record, index),
556
+ click: (event) => this.handleRowClick(record, index, event),
557
+ dblclick: (event) => this.handleRowDoubleClick(record, index, event),
541
558
  mouseenter: () => this.handleRowMouseEnter(record, index),
542
559
  mouseleave: () => this.handleRowMouseLeave(record, index)
543
560
  }