vue2-client 1.17.51 → 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.
@@ -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
  }
@@ -17,7 +17,7 @@ const ANTD = {
17
17
  },
18
18
  theme: {
19
19
  dark: {
20
- 'layout-body-background': '#F7FAFC',
20
+ 'layout-body-background': '#f0f2f5',
21
21
  'body-background': '#fff',
22
22
  'component-background': '#fff',
23
23
  'heading-color': 'rgba(0, 0, 0, 0.85)',
@@ -40,7 +40,7 @@ const ANTD = {
40
40
  'btn-primary-color': '#fefefe'
41
41
  },
42
42
  light: {
43
- 'layout-body-background': '##F7FAFC',
43
+ 'layout-body-background': '#f0f2f5',
44
44
  'body-background': '#fff',
45
45
  'component-background': '#fff',
46
46
  'heading-color': 'rgba(0, 0, 0, 0.85)',