vxe-table 3.12.13 → 3.12.15
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/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/edit/mixin.js +36 -21
- package/es/table/module/export/mixin.js +3 -2
- package/es/table/module/validator/mixin.js +18 -1
- package/es/table/render/index.js +104 -43
- package/es/table/src/body.js +1 -0
- package/es/table/src/header.js +4 -2
- package/es/table/src/methods.js +158 -116
- package/es/table/src/table.js +44 -7
- package/es/table/style.css +33 -2
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +33 -2
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +434 -248
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/edit/mixin.js +42 -21
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/mixin.js +3 -2
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/validator/mixin.js +26 -4
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/render/index.js +109 -41
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +1 -0
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/header.js +4 -2
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +207 -169
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +40 -7
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +33 -2
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +33 -2
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/table/module/edit/mixin.ts +42 -21
- package/packages/table/module/export/mixin.ts +3 -2
- package/packages/table/module/validator/mixin.ts +20 -2
- package/packages/table/render/index.ts +120 -51
- package/packages/table/src/body.ts +1 -0
- package/packages/table/src/header.ts +4 -2
- package/packages/table/src/methods.ts +169 -114
- package/packages/table/src/table.ts +47 -7
- package/styles/components/table.scss +31 -2
- /package/es/{iconfont.1739152166680.ttf → iconfont.1739257460253.ttf} +0 -0
- /package/es/{iconfont.1739152166680.woff → iconfont.1739257460253.woff} +0 -0
- /package/es/{iconfont.1739152166680.woff2 → iconfont.1739257460253.woff2} +0 -0
- /package/lib/{iconfont.1739152166680.ttf → iconfont.1739257460253.ttf} +0 -0
- /package/lib/{iconfont.1739152166680.woff → iconfont.1739257460253.woff} +0 -0
- /package/lib/{iconfont.1739152166680.woff2 → iconfont.1739257460253.woff2} +0 -0
|
@@ -5,8 +5,20 @@ import { getCellValue, setCellValue, getRowid } from '../../src/util'
|
|
|
5
5
|
import { browse, removeClass, addClass } from '../../../ui/src/dom'
|
|
6
6
|
import { warnLog, errLog } from '../../../ui/src/log'
|
|
7
7
|
|
|
8
|
+
import type { VxeTableConstructor, TableReactData } from '../../../../types'
|
|
9
|
+
|
|
8
10
|
const { getConfig, renderer, getI18n } = VxeUI
|
|
9
11
|
|
|
12
|
+
function removeCellSelectedClass ($xeTable: VxeTableConstructor) {
|
|
13
|
+
const el = $xeTable.$refs.refElem as HTMLDivElement
|
|
14
|
+
if (el) {
|
|
15
|
+
const cell = el.querySelector('.col--selected')
|
|
16
|
+
if (cell) {
|
|
17
|
+
removeClass(cell, 'col--selected')
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
10
22
|
function insertTreeRow (_vm: any, newRecords: any[], isAppend: any) {
|
|
11
23
|
const { tableFullTreeData, afterFullData, fullDataRowIdData, fullAllDataRowIdData, treeOpts } = _vm
|
|
12
24
|
const { rowField, parentField, mapChildrenField } = treeOpts
|
|
@@ -291,7 +303,7 @@ export default {
|
|
|
291
303
|
const treeOpts = $xeTable.computeTreeOpts
|
|
292
304
|
const { transform, mapChildrenField } = treeOpts
|
|
293
305
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
294
|
-
const { actived,
|
|
306
|
+
const { actived, removeMaps, insertMaps } = editStore
|
|
295
307
|
const { checkField } = checkboxOpts
|
|
296
308
|
let delList: any[] = []
|
|
297
309
|
if (!rows) {
|
|
@@ -302,7 +314,8 @@ export default {
|
|
|
302
314
|
// 如果是新增,则保存记录
|
|
303
315
|
rows.forEach(row => {
|
|
304
316
|
if (!$xeTable.isInsertByRow(row)) {
|
|
305
|
-
|
|
317
|
+
const rowid = getRowid($xeTable, row)
|
|
318
|
+
removeMaps[rowid] = row
|
|
306
319
|
}
|
|
307
320
|
})
|
|
308
321
|
// 如果绑定了多选属性,则更新状态
|
|
@@ -462,7 +475,16 @@ export default {
|
|
|
462
475
|
* 获取已删除的数据
|
|
463
476
|
*/
|
|
464
477
|
_getRemoveRecords () {
|
|
465
|
-
|
|
478
|
+
const $xeTable = this
|
|
479
|
+
const reactData = $xeTable
|
|
480
|
+
|
|
481
|
+
const { editStore } = reactData
|
|
482
|
+
const { removeMaps } = editStore
|
|
483
|
+
const removeRecords: any[] = []
|
|
484
|
+
XEUtils.each(removeMaps, (row) => {
|
|
485
|
+
removeRecords.push(row)
|
|
486
|
+
})
|
|
487
|
+
return removeRecords
|
|
466
488
|
},
|
|
467
489
|
/**
|
|
468
490
|
* 获取更新数据
|
|
@@ -643,11 +665,6 @@ export default {
|
|
|
643
665
|
}
|
|
644
666
|
focused.row = null
|
|
645
667
|
focused.column = null
|
|
646
|
-
$xeTable.$nextTick(() => {
|
|
647
|
-
if (mouseConfig && mouseOpts.area && $xeTable.handleRecalculateCellAreas) {
|
|
648
|
-
return $xeTable.handleRecalculateCellAreas()
|
|
649
|
-
}
|
|
650
|
-
})
|
|
651
668
|
if (validOpts.autoClear) {
|
|
652
669
|
if (validOpts.msgMode !== 'full' || getConfig().cellVaildMode === 'obsolete') {
|
|
653
670
|
if ($xeTable.clearValidate) {
|
|
@@ -655,7 +672,11 @@ export default {
|
|
|
655
672
|
}
|
|
656
673
|
}
|
|
657
674
|
}
|
|
658
|
-
return $xeTable.$nextTick()
|
|
675
|
+
return $xeTable.$nextTick().then(() => {
|
|
676
|
+
if (mouseConfig && mouseOpts.area && $xeTable.handleRecalculateCellAreas) {
|
|
677
|
+
return $xeTable.handleRecalculateCellAreas()
|
|
678
|
+
}
|
|
679
|
+
})
|
|
659
680
|
},
|
|
660
681
|
_getActiveRecord () {
|
|
661
682
|
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
@@ -820,7 +841,7 @@ export default {
|
|
|
820
841
|
selected.row = row
|
|
821
842
|
selected.column = column
|
|
822
843
|
if (isMouseSelected) {
|
|
823
|
-
this.
|
|
844
|
+
this.addCellSelectedClass()
|
|
824
845
|
}
|
|
825
846
|
this.focus()
|
|
826
847
|
if (evnt) {
|
|
@@ -846,11 +867,13 @@ export default {
|
|
|
846
867
|
* 清除所选中源状态
|
|
847
868
|
*/
|
|
848
869
|
_clearSelected () {
|
|
870
|
+
const $xeTable = this
|
|
871
|
+
|
|
849
872
|
const { selected } = this.editStore
|
|
850
873
|
selected.row = null
|
|
851
874
|
selected.column = null
|
|
852
875
|
this.reColTitleSdCls()
|
|
853
|
-
|
|
876
|
+
removeCellSelectedClass($xeTable)
|
|
854
877
|
return this.$nextTick()
|
|
855
878
|
},
|
|
856
879
|
reColTitleSdCls () {
|
|
@@ -859,18 +882,16 @@ export default {
|
|
|
859
882
|
XEUtils.arrayEach(headerElem.querySelectorAll('.col--title-selected'), elem => removeClass(elem, 'col--title-selected'))
|
|
860
883
|
}
|
|
861
884
|
},
|
|
862
|
-
|
|
863
|
-
const
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
}
|
|
867
|
-
|
|
868
|
-
addColSdCls () {
|
|
869
|
-
const { selected } = this.editStore
|
|
885
|
+
addCellSelectedClass () {
|
|
886
|
+
const $xeTable = this
|
|
887
|
+
const reactData = $xeTable as TableReactData
|
|
888
|
+
|
|
889
|
+
const { editStore } = reactData
|
|
890
|
+
const { selected } = editStore
|
|
870
891
|
const { row, column } = selected
|
|
871
|
-
|
|
892
|
+
removeCellSelectedClass($xeTable)
|
|
872
893
|
if (row && column) {
|
|
873
|
-
const cell =
|
|
894
|
+
const cell = $xeTable.getCellElement(row, column)
|
|
874
895
|
if (cell) {
|
|
875
896
|
addClass(cell, 'col--selected')
|
|
876
897
|
}
|
|
@@ -2,6 +2,7 @@ import XEUtils from 'xe-utils'
|
|
|
2
2
|
import { VxeUI } from '../../../ui'
|
|
3
3
|
import { isColumnInfo, mergeBodyMethod, getCellValue } from '../../src/util'
|
|
4
4
|
import { parseFile, formatText, eqEmptyValue } from '../../../ui/src/utils'
|
|
5
|
+
import { hasClass } from '../../../ui/src/dom'
|
|
5
6
|
import { createHtmlPage, getExportBlobByContent } from './util'
|
|
6
7
|
import { warnLog, errLog } from '../../../ui/src/log'
|
|
7
8
|
|
|
@@ -132,7 +133,7 @@ function getBodyLabelData ($xeTable: VxeTableConstructor, opts: VxeTablePropType
|
|
|
132
133
|
cellValue = htmlCellElem.innerText.trim()
|
|
133
134
|
} else {
|
|
134
135
|
const cell = $xeTable.getCellElement(row, column)
|
|
135
|
-
if (cell) {
|
|
136
|
+
if (cell && !hasClass(cell, 'is--progress')) {
|
|
136
137
|
cellValue = cell.innerText.trim()
|
|
137
138
|
}
|
|
138
139
|
}
|
|
@@ -190,7 +191,7 @@ function getBodyLabelData ($xeTable: VxeTableConstructor, opts: VxeTablePropType
|
|
|
190
191
|
cellValue = htmlCellElem.innerText.trim()
|
|
191
192
|
} else {
|
|
192
193
|
const cell = $xeTable.getCellElement(row, column)
|
|
193
|
-
if (cell) {
|
|
194
|
+
if (cell && !hasClass(cell, 'is--progress')) {
|
|
194
195
|
cellValue = cell.innerText.trim()
|
|
195
196
|
}
|
|
196
197
|
}
|
|
@@ -5,7 +5,7 @@ import { scrollToView } from '../../../ui/src/dom'
|
|
|
5
5
|
import { handleFieldOrColumn, getRowid } from '../../src/util'
|
|
6
6
|
import { warnLog, errLog } from '../../../ui/src/log'
|
|
7
7
|
|
|
8
|
-
import type { VxeTableDefines } from '../../../../types'
|
|
8
|
+
import type { VxeTableDefines, TableReactData, TableInternalData } from '../../../../types'
|
|
9
9
|
|
|
10
10
|
const { getConfig, validators } = VxeUI
|
|
11
11
|
|
|
@@ -154,8 +154,17 @@ export default {
|
|
|
154
154
|
* 返回 Promise 对象,或者使用回调方式
|
|
155
155
|
*/
|
|
156
156
|
beginValidate (rows: any, cols: VxeTableDefines.ColumnInfo[] | null, cb: any, isFull: any) {
|
|
157
|
+
const $xeTable = this
|
|
158
|
+
const props = $xeTable
|
|
159
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
160
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
161
|
+
|
|
157
162
|
const validRest: any = {}
|
|
158
|
-
const { editRules,
|
|
163
|
+
const { editRules, treeConfig } = props
|
|
164
|
+
const { editStore, pendingRowMaps } = reactData
|
|
165
|
+
const { afterFullData } = internalData
|
|
166
|
+
const { removeMaps } = editStore
|
|
167
|
+
const treeOpts = $xeTable.computeTreeOpts
|
|
159
168
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
160
169
|
let validList
|
|
161
170
|
if (rows === true) {
|
|
@@ -178,6 +187,15 @@ export default {
|
|
|
178
187
|
if (editRules) {
|
|
179
188
|
const columns = cols && cols.length ? cols : this.getColumns()
|
|
180
189
|
const handleVaild = (row: any) => {
|
|
190
|
+
const rowid = getRowid($xeTable, row)
|
|
191
|
+
// 是否删除
|
|
192
|
+
if (removeMaps[rowid]) {
|
|
193
|
+
return
|
|
194
|
+
}
|
|
195
|
+
// 是否标记删除
|
|
196
|
+
if (pendingRowMaps[rowid]) {
|
|
197
|
+
return
|
|
198
|
+
}
|
|
181
199
|
if (isFull || !this.validRuleErr) {
|
|
182
200
|
const colVailds: any[] = []
|
|
183
201
|
columns.forEach((column: any) => {
|
|
@@ -6,7 +6,7 @@ import { getFuncText, formatText, isEmptyValue } from '../../ui/src/utils'
|
|
|
6
6
|
import { getOnName, getModelEvent, getChangeEvent } from '../../ui/src/vn'
|
|
7
7
|
import { errLog } from '../../ui/src/log'
|
|
8
8
|
|
|
9
|
-
import type { VxeGlobalRendererHandles, VxeColumnPropTypes } from '../../../types'
|
|
9
|
+
import type { VxeGlobalRendererHandles, VxeColumnPropTypes, VxeTableConstructor, VxeTablePrivateMethods } from '../../../types'
|
|
10
10
|
|
|
11
11
|
const { getConfig, renderer, getI18n } = VxeUI
|
|
12
12
|
|
|
@@ -113,10 +113,15 @@ function getCellLabelVNs (h: CreateElement, renderOpts: any, params: any, cellLa
|
|
|
113
113
|
* @param modelFunc
|
|
114
114
|
* @param changeFunc
|
|
115
115
|
*/
|
|
116
|
-
function getNativeElementOns (renderOpts: any, params: any,
|
|
116
|
+
function getNativeElementOns (renderOpts: any, params: any, eFns?: {
|
|
117
|
+
model: (evnt: Event) => void
|
|
118
|
+
change?: (evnt: Event) => void
|
|
119
|
+
blur?: (evnt: Event) => void
|
|
120
|
+
}) {
|
|
117
121
|
const { events } = renderOpts
|
|
118
122
|
const modelEvent = getModelEvent(renderOpts)
|
|
119
123
|
const changeEvent = getChangeEvent(renderOpts)
|
|
124
|
+
const { model: modelFunc, change: changeFunc, blur: blurFunc } = eFns || {}
|
|
120
125
|
const isSameEvent = changeEvent === modelEvent
|
|
121
126
|
const ons: any = {}
|
|
122
127
|
if (events) {
|
|
@@ -138,16 +143,26 @@ function getNativeElementOns (renderOpts: any, params: any, modelFunc?: any, cha
|
|
|
138
143
|
}
|
|
139
144
|
}
|
|
140
145
|
if (!isSameEvent && changeFunc) {
|
|
141
|
-
ons[getOnName(changeEvent)] = function (
|
|
142
|
-
changeFunc(
|
|
146
|
+
ons[getOnName(changeEvent)] = function (evnt: Event) {
|
|
147
|
+
changeFunc(evnt)
|
|
143
148
|
if (events && events[changeEvent]) {
|
|
144
|
-
events[changeEvent](params,
|
|
149
|
+
events[changeEvent](params, evnt)
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
if (blurFunc) {
|
|
154
|
+
ons[getOnName(blurEvent)] = function (evnt: Event) {
|
|
155
|
+
blurFunc(evnt)
|
|
156
|
+
if (events && events[blurEvent]) {
|
|
157
|
+
events[blurEvent](params, evnt)
|
|
145
158
|
}
|
|
146
159
|
}
|
|
147
160
|
}
|
|
148
161
|
return ons
|
|
149
162
|
}
|
|
150
163
|
|
|
164
|
+
const blurEvent = 'blur'
|
|
165
|
+
|
|
151
166
|
/**
|
|
152
167
|
* 组件事件处理
|
|
153
168
|
* @param renderOpts
|
|
@@ -155,10 +170,15 @@ function getNativeElementOns (renderOpts: any, params: any, modelFunc?: any, cha
|
|
|
155
170
|
* @param modelFunc
|
|
156
171
|
* @param changeFunc
|
|
157
172
|
*/
|
|
158
|
-
function getComponentOns (renderOpts: any, params: any,
|
|
173
|
+
function getComponentOns (renderOpts: any, params: any, eFns?: {
|
|
174
|
+
model: (cellValue: any) => void
|
|
175
|
+
change?: (...args: any[]) => void
|
|
176
|
+
blur?: (...args: any[]) => void
|
|
177
|
+
}) {
|
|
159
178
|
const { events } = renderOpts
|
|
160
179
|
const modelEvent = getModelEvent(renderOpts)
|
|
161
180
|
const changeEvent = getChangeEvent(renderOpts)
|
|
181
|
+
const { model: modelFunc, change: changeFunc, blur: blurFunc } = eFns || {}
|
|
162
182
|
const ons: any = {}
|
|
163
183
|
XEUtils.objectEach(events, (func, key: any) => {
|
|
164
184
|
ons[getOnName(key)] = function (...args: any[]) {
|
|
@@ -186,68 +206,117 @@ function getComponentOns (renderOpts: any, params: any, modelFunc?: any, changeF
|
|
|
186
206
|
}
|
|
187
207
|
}
|
|
188
208
|
}
|
|
209
|
+
if (blurFunc) {
|
|
210
|
+
ons[getOnName(blurEvent)] = function (...args: any[]) {
|
|
211
|
+
blurFunc(...args)
|
|
212
|
+
if (events && events[blurEvent]) {
|
|
213
|
+
events[blurEvent](params, ...args)
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
189
217
|
return ons
|
|
190
218
|
}
|
|
191
219
|
|
|
192
|
-
function getEditOns (renderOpts:
|
|
220
|
+
function getEditOns (renderOpts: VxeGlobalRendererHandles.RenderTableEditOptions, params: VxeGlobalRendererHandles.RenderTableEditParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
193
221
|
const { $table, row, column } = params
|
|
194
222
|
const { name } = renderOpts
|
|
195
223
|
const { model } = column
|
|
196
224
|
const isImmediate = isImmediateCell(renderOpts, params)
|
|
197
|
-
return getComponentOns(renderOpts, params,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
model.value = cellValue
|
|
201
|
-
if (isImmediate) {
|
|
202
|
-
setCellValue(row, column, cellValue)
|
|
203
|
-
}
|
|
204
|
-
}, (eventParams: any) => {
|
|
205
|
-
// 处理 change 事件相关逻辑
|
|
206
|
-
if (!isImmediate && (['VxeInput', 'VxeNumberInput', 'VxeTextarea', '$input', '$textarea'].includes(name))) {
|
|
207
|
-
const cellValue = eventParams.value
|
|
225
|
+
return getComponentOns(renderOpts, params, {
|
|
226
|
+
model (cellValue) {
|
|
227
|
+
// 处理 model 值双向绑定
|
|
208
228
|
model.update = true
|
|
209
229
|
model.value = cellValue
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
230
|
+
if (isImmediate) {
|
|
231
|
+
setCellValue(row, column, cellValue)
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
change (eventParams) {
|
|
235
|
+
// 处理 change 事件相关逻辑
|
|
236
|
+
if (!isImmediate && name && (['VxeInput', 'VxeNumberInput', 'VxeTextarea', '$input', '$textarea'].includes(name))) {
|
|
237
|
+
const cellValue = eventParams.value
|
|
238
|
+
model.update = true
|
|
239
|
+
model.value = cellValue
|
|
240
|
+
$table.updateStatus(params, cellValue)
|
|
241
|
+
} else {
|
|
242
|
+
$table.updateStatus(params)
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
blur () {
|
|
246
|
+
if (isImmediate) {
|
|
247
|
+
$table.handleCellRuleUpdateStatus('blur', params)
|
|
248
|
+
} else {
|
|
249
|
+
$table.handleCellRuleUpdateStatus('blur', params, model.value)
|
|
250
|
+
}
|
|
213
251
|
}
|
|
214
252
|
})
|
|
215
253
|
}
|
|
216
254
|
|
|
217
255
|
function getFilterOns (renderOpts: any, params: any, option: any) {
|
|
218
|
-
return getComponentOns(renderOpts, params,
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
256
|
+
return getComponentOns(renderOpts, params, {
|
|
257
|
+
model (value) {
|
|
258
|
+
// 处理 model 值双向绑定
|
|
259
|
+
option.data = value
|
|
260
|
+
},
|
|
261
|
+
change () {
|
|
262
|
+
handleConfirmFilter(params, !XEUtils.eqNull(option.data), option)
|
|
263
|
+
},
|
|
264
|
+
blur () {
|
|
265
|
+
handleConfirmFilter(params, !XEUtils.eqNull(option.data), option)
|
|
266
|
+
}
|
|
223
267
|
})
|
|
224
268
|
}
|
|
225
269
|
|
|
226
270
|
function getNativeEditOns (renderOpts: any, params: any) {
|
|
227
271
|
const { $table, row, column } = params
|
|
228
272
|
const { model } = column
|
|
229
|
-
return getNativeElementOns(renderOpts, params,
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
273
|
+
return getNativeElementOns(renderOpts, params, {
|
|
274
|
+
model (evnt) {
|
|
275
|
+
// 处理 model 值双向绑定
|
|
276
|
+
const targetEl = evnt.target as HTMLInputElement
|
|
277
|
+
if (targetEl) {
|
|
278
|
+
const cellValue = targetEl.value
|
|
279
|
+
if (isImmediateCell(renderOpts, params)) {
|
|
280
|
+
setCellValue(row, column, cellValue)
|
|
281
|
+
} else {
|
|
282
|
+
model.update = true
|
|
283
|
+
model.value = cellValue
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
change (evnt) {
|
|
288
|
+
// 处理 change 事件相关逻辑
|
|
289
|
+
const targetEl = evnt.target as HTMLInputElement
|
|
290
|
+
if (targetEl) {
|
|
291
|
+
const cellValue = targetEl.value
|
|
292
|
+
$table.updateStatus(params, cellValue)
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
blur (evnt) {
|
|
296
|
+
const targetEl = evnt.target as HTMLInputElement
|
|
297
|
+
if (targetEl) {
|
|
298
|
+
const cellValue = targetEl.value
|
|
299
|
+
$table.updateStatus(params, cellValue)
|
|
300
|
+
}
|
|
237
301
|
}
|
|
238
|
-
}, (evnt: any) => {
|
|
239
|
-
// 处理 change 事件相关逻辑
|
|
240
|
-
const cellValue = evnt.target.value
|
|
241
|
-
$table.updateStatus(params, cellValue)
|
|
242
302
|
})
|
|
243
303
|
}
|
|
244
304
|
|
|
245
305
|
function getNativeFilterOns (renderOpts: any, params: any, option: any) {
|
|
246
|
-
return getNativeElementOns(renderOpts, params,
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
306
|
+
return getNativeElementOns(renderOpts, params, {
|
|
307
|
+
model (evnt) {
|
|
308
|
+
// 处理 model 值双向绑定
|
|
309
|
+
const targetEl = evnt.target as HTMLInputElement
|
|
310
|
+
if (targetEl) {
|
|
311
|
+
option.data = targetEl.value
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
change () {
|
|
315
|
+
handleConfirmFilter(params, !XEUtils.eqNull(option.data), option)
|
|
316
|
+
},
|
|
317
|
+
blur () {
|
|
318
|
+
handleConfirmFilter(params, !XEUtils.eqNull(option.data), option)
|
|
319
|
+
}
|
|
251
320
|
})
|
|
252
321
|
}
|
|
253
322
|
|
|
@@ -280,7 +349,7 @@ function buttonCellRender (h: CreateElement, renderOpts: any, params: any) {
|
|
|
280
349
|
]
|
|
281
350
|
}
|
|
282
351
|
|
|
283
|
-
function defaultEditRender (h: CreateElement, renderOpts: VxeGlobalRendererHandles.RenderTableEditOptions, params: VxeGlobalRendererHandles.RenderEditParams) {
|
|
352
|
+
function defaultEditRender (h: CreateElement, renderOpts: VxeGlobalRendererHandles.RenderTableEditOptions, params: VxeGlobalRendererHandles.RenderEditParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
284
353
|
const { row, column } = params
|
|
285
354
|
const cellValue = getCellValue(row, column)
|
|
286
355
|
return [
|
|
@@ -291,7 +360,7 @@ function defaultEditRender (h: CreateElement, renderOpts: VxeGlobalRendererHandl
|
|
|
291
360
|
]
|
|
292
361
|
}
|
|
293
362
|
|
|
294
|
-
function radioAndCheckboxEditRender (h: CreateElement, renderOpts: VxeGlobalRendererHandles.RenderTableEditOptions, params: VxeGlobalRendererHandles.RenderEditParams) {
|
|
363
|
+
function radioAndCheckboxEditRender (h: CreateElement, renderOpts: VxeGlobalRendererHandles.RenderTableEditOptions, params: VxeGlobalRendererHandles.RenderEditParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
295
364
|
const { options } = renderOpts
|
|
296
365
|
const { row, column } = params
|
|
297
366
|
const cellValue = getCellValue(row, column)
|
|
@@ -310,7 +379,7 @@ function radioAndCheckboxEditRender (h: CreateElement, renderOpts: VxeGlobalRend
|
|
|
310
379
|
* 已废弃
|
|
311
380
|
* @deprecated
|
|
312
381
|
*/
|
|
313
|
-
function oldEditRender (h: CreateElement, renderOpts: VxeGlobalRendererHandles.RenderTableEditOptions, params: VxeGlobalRendererHandles.RenderEditParams) {
|
|
382
|
+
function oldEditRender (h: CreateElement, renderOpts: VxeGlobalRendererHandles.RenderTableEditOptions, params: VxeGlobalRendererHandles.RenderEditParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
314
383
|
const { row, column } = params
|
|
315
384
|
const cellValue = getCellValue(row, column)
|
|
316
385
|
return [
|
|
@@ -776,7 +845,7 @@ renderer.mixin({
|
|
|
776
845
|
},
|
|
777
846
|
VxeColorPicker: {
|
|
778
847
|
tableAutoFocus: 'input',
|
|
779
|
-
renderTableEdit (h, renderOpts, params) {
|
|
848
|
+
renderTableEdit (h, renderOpts, params: VxeGlobalRendererHandles.RenderTableEditParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
780
849
|
const { row, column } = params
|
|
781
850
|
const { options } = renderOpts
|
|
782
851
|
const cellValue = getCellValue(row, column)
|
|
@@ -804,7 +873,7 @@ renderer.mixin({
|
|
|
804
873
|
},
|
|
805
874
|
VxeIconPicker: {
|
|
806
875
|
tableAutoFocus: 'input',
|
|
807
|
-
renderTableEdit (h, renderOpts, params) {
|
|
876
|
+
renderTableEdit (h, renderOpts, params: VxeGlobalRendererHandles.RenderTableEditParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
808
877
|
const { row, column } = params
|
|
809
878
|
const { options } = renderOpts
|
|
810
879
|
const cellValue = getCellValue(row, column)
|
|
@@ -840,7 +909,7 @@ renderer.mixin({
|
|
|
840
909
|
renderTableDefault: defaultEditRender
|
|
841
910
|
},
|
|
842
911
|
VxeImage: {
|
|
843
|
-
renderTableDefault (h, renderOpts, params) {
|
|
912
|
+
renderTableDefault (h, renderOpts, params: VxeGlobalRendererHandles.RenderTableDefaultParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
844
913
|
const { row, column } = params
|
|
845
914
|
const { props } = renderOpts
|
|
846
915
|
const cellValue = getCellValue(row, column)
|
|
@@ -856,7 +925,7 @@ renderer.mixin({
|
|
|
856
925
|
}
|
|
857
926
|
},
|
|
858
927
|
VxeImageGroup: {
|
|
859
|
-
renderTableDefault (h, renderOpts, params) {
|
|
928
|
+
renderTableDefault (h, renderOpts, params: VxeGlobalRendererHandles.RenderTableDefaultParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
860
929
|
const { row, column } = params
|
|
861
930
|
const { props } = renderOpts
|
|
862
931
|
const cellValue = getCellValue(row, column)
|
|
@@ -872,7 +941,7 @@ renderer.mixin({
|
|
|
872
941
|
}
|
|
873
942
|
},
|
|
874
943
|
VxeTextEllipsis: {
|
|
875
|
-
renderTableDefault (h, renderOpts, params) {
|
|
944
|
+
renderTableDefault (h, renderOpts, params: VxeGlobalRendererHandles.RenderTableDefaultParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
876
945
|
const { row, column } = params
|
|
877
946
|
const { props } = renderOpts
|
|
878
947
|
const cellValue = getCellValue(row, column)
|
|
@@ -403,6 +403,7 @@ function renderTdColumn (
|
|
|
403
403
|
'fixed--width': !isAutoCellWidth,
|
|
404
404
|
'fixed--hidden': fixedHiddenColumn,
|
|
405
405
|
'is--padding': isCellPadding,
|
|
406
|
+
'is--progress': (fixedHiddenColumn && isAllOverflow) || isVNPreEmptyStatus,
|
|
406
407
|
'is--drag-cell': isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
|
|
407
408
|
'is--drag-disabled': isDisabledDrag,
|
|
408
409
|
'col--dirty': isDirty,
|
|
@@ -89,8 +89,10 @@ const renderRows = (h: CreateElement, _vm: any, isGroup: boolean, isOptimizeMode
|
|
|
89
89
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto')
|
|
90
90
|
|
|
91
91
|
let isVNPreEmptyStatus = false
|
|
92
|
-
if (
|
|
93
|
-
|
|
92
|
+
if (!isGroup) {
|
|
93
|
+
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
94
|
+
isVNPreEmptyStatus = true
|
|
95
|
+
}
|
|
94
96
|
}
|
|
95
97
|
|
|
96
98
|
const tcStyle: Record<string, string> = {}
|