vxe-table 3.11.34 → 3.11.36
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 +57 -33
- package/es/table/module/export/mixin.js +23 -20
- package/es/table/module/filter/panel.js +10 -7
- package/es/table/src/methods.js +17 -10
- package/es/table/style.css +3 -25
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +2 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +3 -25
- 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 +121 -71
- 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 +67 -33
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/mixin.js +22 -19
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/filter/panel.js +12 -6
- package/lib/table/module/filter/panel.min.js +1 -1
- package/lib/table/src/methods.js +17 -11
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/style/style.css +3 -25
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +2 -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 +3 -25
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/table/module/edit/mixin.ts +58 -33
- package/packages/table/module/export/mixin.ts +24 -20
- package/packages/table/module/filter/panel.ts +11 -7
- package/packages/table/src/methods.ts +17 -10
- package/packages/ui/index.ts +1 -0
- package/styles/components/table.scss +3 -22
- /package/es/{iconfont.1734489177027.ttf → iconfont.1734659093549.ttf} +0 -0
- /package/es/{iconfont.1734489177027.woff → iconfont.1734659093549.woff} +0 -0
- /package/es/{iconfont.1734489177027.woff2 → iconfont.1734659093549.woff2} +0 -0
- /package/lib/{iconfont.1734489177027.ttf → iconfont.1734659093549.ttf} +0 -0
- /package/lib/{iconfont.1734489177027.woff → iconfont.1734659093549.woff} +0 -0
- /package/lib/{iconfont.1734489177027.woff2 → iconfont.1734659093549.woff2} +0 -0
|
@@ -48,8 +48,7 @@ function insertTreeRow (_vm: any, newRecords: any[], isAppend: any) {
|
|
|
48
48
|
})
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
function handleInsertRowAt (
|
|
52
|
-
const $xeTable = _vm
|
|
51
|
+
function handleInsertRowAt ($xeTable: any, records: any[], targetRow: any, isInsertNextRow?: any) {
|
|
53
52
|
const props = $xeTable
|
|
54
53
|
const reactData = $xeTable
|
|
55
54
|
const internalData = $xeTable
|
|
@@ -63,11 +62,11 @@ function handleInsertRowAt (_vm: any, records: any[], row: any, isInsertNextRow?
|
|
|
63
62
|
if (!XEUtils.isArray(records)) {
|
|
64
63
|
records = [records]
|
|
65
64
|
}
|
|
66
|
-
const newRecords: any[] =
|
|
67
|
-
if (XEUtils.eqNull(
|
|
65
|
+
const newRecords: any[] = $xeTable.defineField(records.map(record => Object.assign(treeConfig && transform ? { [mapChildrenField]: [], [childrenField]: [] } : {}, record)))
|
|
66
|
+
if (XEUtils.eqNull(targetRow)) {
|
|
68
67
|
// 如果为虚拟树
|
|
69
68
|
if (treeConfig && transform) {
|
|
70
|
-
insertTreeRow(
|
|
69
|
+
insertTreeRow($xeTable, newRecords, false)
|
|
71
70
|
} else {
|
|
72
71
|
newRecords.forEach(item => {
|
|
73
72
|
const rowid = getRowid($xeTable, item)
|
|
@@ -86,10 +85,10 @@ function handleInsertRowAt (_vm: any, records: any[], row: any, isInsertNextRow?
|
|
|
86
85
|
})
|
|
87
86
|
}
|
|
88
87
|
} else {
|
|
89
|
-
if (
|
|
88
|
+
if (targetRow === -1) {
|
|
90
89
|
// 如果为虚拟树
|
|
91
90
|
if (treeConfig && transform) {
|
|
92
|
-
insertTreeRow(
|
|
91
|
+
insertTreeRow($xeTable, newRecords, true)
|
|
93
92
|
} else {
|
|
94
93
|
newRecords.forEach(item => {
|
|
95
94
|
const rowid = getRowid($xeTable, item)
|
|
@@ -110,14 +109,14 @@ function handleInsertRowAt (_vm: any, records: any[], row: any, isInsertNextRow?
|
|
|
110
109
|
} else {
|
|
111
110
|
// 如果为虚拟树
|
|
112
111
|
if (treeConfig && transform) {
|
|
113
|
-
const matchMapObj = XEUtils.findTree(tableFullTreeData, (item: any) =>
|
|
112
|
+
const matchMapObj = XEUtils.findTree(tableFullTreeData, (item: any) => targetRow[rowField] === item[rowField], { children: mapChildrenField })
|
|
114
113
|
if (matchMapObj) {
|
|
115
114
|
const { parent: parentRow } = matchMapObj as any
|
|
116
115
|
const parentMapChilds = parentRow ? parentRow[mapChildrenField] : tableFullTreeData
|
|
117
|
-
const parentRest = fullAllDataRowIdData[getRowid(
|
|
116
|
+
const parentRest = fullAllDataRowIdData[getRowid($xeTable, parentRow)]
|
|
118
117
|
const parentLevel = parentRest ? parentRest.level : 0
|
|
119
118
|
newRecords.forEach((item: any, i: any) => {
|
|
120
|
-
const rowid = getRowid(
|
|
119
|
+
const rowid = getRowid($xeTable, item)
|
|
121
120
|
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
122
121
|
if (item[treeOpts.parentField]) {
|
|
123
122
|
if (parentRow && item[treeOpts.parentField] !== parentRow[rowField]) {
|
|
@@ -140,7 +139,7 @@ function handleInsertRowAt (_vm: any, records: any[], row: any, isInsertNextRow?
|
|
|
140
139
|
|
|
141
140
|
// 源
|
|
142
141
|
if (parentRow) {
|
|
143
|
-
const matchObj = XEUtils.findTree(tableFullTreeData, (item: any) =>
|
|
142
|
+
const matchObj = XEUtils.findTree(tableFullTreeData, (item: any) => targetRow[rowField] === item[rowField], { children: childrenField })
|
|
144
143
|
if (matchObj) {
|
|
145
144
|
const parentChilds = matchObj.items
|
|
146
145
|
let targetIndex = matchObj.index
|
|
@@ -154,7 +153,7 @@ function handleInsertRowAt (_vm: any, records: any[], row: any, isInsertNextRow?
|
|
|
154
153
|
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
155
154
|
warnLog('vxe.error.unableInsert')
|
|
156
155
|
}
|
|
157
|
-
insertTreeRow(
|
|
156
|
+
insertTreeRow($xeTable, newRecords, true)
|
|
158
157
|
}
|
|
159
158
|
} else {
|
|
160
159
|
if (treeConfig) {
|
|
@@ -162,12 +161,12 @@ function handleInsertRowAt (_vm: any, records: any[], row: any, isInsertNextRow?
|
|
|
162
161
|
}
|
|
163
162
|
let afIndex = -1
|
|
164
163
|
// 如果是可视索引
|
|
165
|
-
if (XEUtils.isNumber(
|
|
166
|
-
if (
|
|
167
|
-
afIndex =
|
|
164
|
+
if (XEUtils.isNumber(targetRow)) {
|
|
165
|
+
if (targetRow < afterFullData.length) {
|
|
166
|
+
afIndex = targetRow
|
|
168
167
|
}
|
|
169
168
|
} else {
|
|
170
|
-
afIndex =
|
|
169
|
+
afIndex = $xeTable.findRowIndexOf(afterFullData, targetRow)
|
|
171
170
|
}
|
|
172
171
|
// 如果是插入指定行的下一行
|
|
173
172
|
if (isInsertNextRow) {
|
|
@@ -177,7 +176,7 @@ function handleInsertRowAt (_vm: any, records: any[], row: any, isInsertNextRow?
|
|
|
177
176
|
throw new Error(errLog('vxe.error.unableInsert'))
|
|
178
177
|
}
|
|
179
178
|
afterFullData.splice(afIndex, 0, ...newRecords)
|
|
180
|
-
tableFullData.splice(
|
|
179
|
+
tableFullData.splice($xeTable.findRowIndexOf(tableFullData, targetRow), 0, ...newRecords)
|
|
181
180
|
// 刷新单元格合并
|
|
182
181
|
mergeList.forEach((mergeItem: any) => {
|
|
183
182
|
const { row: mergeRowIndex, rowspan: mergeRowspan } = mergeItem
|
|
@@ -195,20 +194,20 @@ function handleInsertRowAt (_vm: any, records: any[], row: any, isInsertNextRow?
|
|
|
195
194
|
const rowid = getRowid($xeTable, newRow)
|
|
196
195
|
insertMaps[rowid] = newRow
|
|
197
196
|
})
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
197
|
+
$xeTable.cacheRowMap()
|
|
198
|
+
$xeTable.updateScrollYStatus()
|
|
199
|
+
$xeTable.handleTableData(treeConfig && transform)
|
|
201
200
|
if (!(treeConfig && transform)) {
|
|
202
|
-
|
|
201
|
+
$xeTable.updateAfterDataIndex()
|
|
203
202
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
if (
|
|
207
|
-
|
|
203
|
+
$xeTable.updateFooter()
|
|
204
|
+
$xeTable.checkSelectionStatus()
|
|
205
|
+
if ($xeTable.scrollYLoad) {
|
|
206
|
+
$xeTable.updateScrollYSpace()
|
|
208
207
|
}
|
|
209
|
-
return
|
|
210
|
-
|
|
211
|
-
return
|
|
208
|
+
return $xeTable.$nextTick().then(() => {
|
|
209
|
+
$xeTable.updateCellAreas()
|
|
210
|
+
return $xeTable.recalculate()
|
|
212
211
|
}).then(() => {
|
|
213
212
|
return {
|
|
214
213
|
row: newRecords.length ? newRecords[newRecords.length - 1] : null,
|
|
@@ -217,6 +216,23 @@ function handleInsertRowAt (_vm: any, records: any[], row: any, isInsertNextRow?
|
|
|
217
216
|
})
|
|
218
217
|
}
|
|
219
218
|
|
|
219
|
+
function handleInsertChildRowAt ($xeTable: any, records: any, parentRow: any, targetRow: any, isInsertNextRow?: boolean) {
|
|
220
|
+
const props = $xeTable
|
|
221
|
+
|
|
222
|
+
const { treeConfig } = props
|
|
223
|
+
const treeOpts = $xeTable.computeTreeOpts
|
|
224
|
+
const { transform, rowField, parentField } = treeOpts
|
|
225
|
+
if (treeConfig && transform) {
|
|
226
|
+
if (!XEUtils.isArray(records)) {
|
|
227
|
+
records = [records]
|
|
228
|
+
}
|
|
229
|
+
return handleInsertRowAt($xeTable, records.map((item: any) => Object.assign({}, item, { [parentField]: parentRow[rowField] })), targetRow, isInsertNextRow)
|
|
230
|
+
} else {
|
|
231
|
+
errLog('vxe.error.errProp', ['tree-config.treeConfig=false', 'tree-config.treeConfig=true'])
|
|
232
|
+
}
|
|
233
|
+
return Promise.resolve({ row: null, rows: [] })
|
|
234
|
+
}
|
|
235
|
+
|
|
220
236
|
export default {
|
|
221
237
|
methods: {
|
|
222
238
|
/**
|
|
@@ -233,14 +249,23 @@ export default {
|
|
|
233
249
|
* 如果 row 为 -1 则从插入到底部
|
|
234
250
|
* 如果 row 为有效行则插入到该行的位置
|
|
235
251
|
* @param {Object/Array} records 新的数据
|
|
236
|
-
* @param {Row}
|
|
252
|
+
* @param {Row} targetRow 指定行
|
|
237
253
|
* @returns
|
|
238
254
|
*/
|
|
239
|
-
_insertAt (records: any,
|
|
240
|
-
return handleInsertRowAt(this, records,
|
|
255
|
+
_insertAt (records: any, targetRow: any) {
|
|
256
|
+
return handleInsertRowAt(this, records, targetRow)
|
|
257
|
+
},
|
|
258
|
+
_insertNextAt (records: any, targetRow: any) {
|
|
259
|
+
return handleInsertRowAt(this, records, targetRow, true)
|
|
260
|
+
},
|
|
261
|
+
_insertChild (records: any, parentRow: any) {
|
|
262
|
+
return handleInsertChildRowAt(this, records, parentRow, null)
|
|
263
|
+
},
|
|
264
|
+
_insertChildAt (records: any, parentRow: any, targetRow: any) {
|
|
265
|
+
return handleInsertChildRowAt(this, records, parentRow, targetRow)
|
|
241
266
|
},
|
|
242
|
-
|
|
243
|
-
return
|
|
267
|
+
_insertChildNextAt (records: any, parentRow: any, targetRow: any) {
|
|
268
|
+
return handleInsertChildRowAt(this, records, parentRow, targetRow, true)
|
|
244
269
|
},
|
|
245
270
|
/**
|
|
246
271
|
* 删除指定行数据
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils'
|
|
2
2
|
import { VxeUI } from '../../../ui'
|
|
3
3
|
import { isColumnInfo, mergeBodyMethod, getCellValue } from '../../src/util'
|
|
4
|
-
import { parseFile, formatText } from '../../../ui/src/utils'
|
|
4
|
+
import { parseFile, formatText, eqEmptyValue } from '../../../ui/src/utils'
|
|
5
5
|
import { browse } from '../../../ui/src/dom'
|
|
6
6
|
import { createHtmlPage, getExportBlobByContent } from './util'
|
|
7
7
|
import { warnLog, errLog } from '../../../ui/src/log'
|
|
@@ -66,9 +66,13 @@ function toBooleanValue (cellValue: any) {
|
|
|
66
66
|
return XEUtils.isBoolean(cellValue) ? (cellValue ? 'TRUE' : 'FALSE') : cellValue
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
const toStringValue = (cellValue: any) => {
|
|
70
|
+
return eqEmptyValue(cellValue) ? '' : `${cellValue}`
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function getBodyLabelData ($xeTable: any, opts: any, columns: any[], datas: any[]) {
|
|
70
74
|
const { isAllExpand, mode } = opts
|
|
71
|
-
const { treeConfig, treeOpts, radioOpts, checkboxOpts, columnOpts } = $
|
|
75
|
+
const { treeConfig, treeOpts, radioOpts, checkboxOpts, columnOpts } = $xeTable
|
|
72
76
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
73
77
|
if (!htmlCellElem) {
|
|
74
78
|
htmlCellElem = document.createElement('div')
|
|
@@ -80,13 +84,13 @@ function getBodyLabelData ($xetable: any, opts: any, columns: any[], datas: any[
|
|
|
80
84
|
XEUtils.eachTree(datas, (item, $rowIndex, items, path, parent, nodes) => {
|
|
81
85
|
const row = item._row || item
|
|
82
86
|
const parentRow = parent && parent._row ? parent._row : parent
|
|
83
|
-
if ((isAllExpand || !parentRow || (expandMaps.has(parentRow) && $
|
|
84
|
-
const hasRowChild = hasTreeChildren($
|
|
87
|
+
if ((isAllExpand || !parentRow || (expandMaps.has(parentRow) && $xeTable.isTreeExpandByRow(parentRow)))) {
|
|
88
|
+
const hasRowChild = hasTreeChildren($xeTable, row)
|
|
85
89
|
const item: any = {
|
|
86
90
|
_row: row,
|
|
87
91
|
_level: nodes.length - 1,
|
|
88
92
|
_hasChild: hasRowChild,
|
|
89
|
-
_expand: hasRowChild && $
|
|
93
|
+
_expand: hasRowChild && $xeTable.isTreeExpandByRow(row)
|
|
90
94
|
}
|
|
91
95
|
columns.forEach((column, $columnIndex) => {
|
|
92
96
|
let cellValue = ''
|
|
@@ -102,21 +106,21 @@ function getBodyLabelData ($xetable: any, opts: any, columns: any[], datas: any[
|
|
|
102
106
|
bodyExportMethod = columnOpts.exportMethod
|
|
103
107
|
}
|
|
104
108
|
if (bodyExportMethod) {
|
|
105
|
-
cellValue = bodyExportMethod({ $table: $
|
|
109
|
+
cellValue = bodyExportMethod({ $table: $xeTable, row, column, options: opts })
|
|
106
110
|
} else {
|
|
107
111
|
switch (column.type) {
|
|
108
112
|
case 'seq': {
|
|
109
113
|
const seqValue = path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('')
|
|
110
|
-
cellValue = mode === 'all' ? seqValue : getSeq($
|
|
114
|
+
cellValue = mode === 'all' ? seqValue : getSeq($xeTable, seqValue, row, $rowIndex, column, $columnIndex)
|
|
111
115
|
break
|
|
112
116
|
}
|
|
113
117
|
case 'checkbox':
|
|
114
|
-
cellValue = toBooleanValue($
|
|
118
|
+
cellValue = toBooleanValue($xeTable.isCheckedByCheckboxRow(row))
|
|
115
119
|
item._checkboxLabel = checkboxOpts.labelField ? XEUtils.get(row, checkboxOpts.labelField) : ''
|
|
116
120
|
item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({ row })
|
|
117
121
|
break
|
|
118
122
|
case 'radio':
|
|
119
|
-
cellValue = toBooleanValue($
|
|
123
|
+
cellValue = toBooleanValue($xeTable.isCheckedByRadioRow(row))
|
|
120
124
|
item._radioLabel = radioOpts.labelField ? XEUtils.get(row, radioOpts.labelField) : ''
|
|
121
125
|
item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({ row })
|
|
122
126
|
break
|
|
@@ -124,12 +128,12 @@ function getBodyLabelData ($xetable: any, opts: any, columns: any[], datas: any[
|
|
|
124
128
|
if (opts.original) {
|
|
125
129
|
cellValue = getCellValue(row, column)
|
|
126
130
|
} else {
|
|
127
|
-
cellValue = $
|
|
131
|
+
cellValue = $xeTable.getCellLabel(row, column)
|
|
128
132
|
if (column.type === 'html') {
|
|
129
133
|
htmlCellElem.innerHTML = cellValue
|
|
130
134
|
cellValue = htmlCellElem.innerText.trim()
|
|
131
135
|
} else {
|
|
132
|
-
const cell = $
|
|
136
|
+
const cell = $xeTable.getCellElement(row, column)
|
|
133
137
|
if (cell) {
|
|
134
138
|
cellValue = cell.innerText.trim()
|
|
135
139
|
}
|
|
@@ -137,7 +141,7 @@ function getBodyLabelData ($xetable: any, opts: any, columns: any[], datas: any[
|
|
|
137
141
|
}
|
|
138
142
|
}
|
|
139
143
|
}
|
|
140
|
-
item[column.id] =
|
|
144
|
+
item[column.id] = toStringValue(cellValue)
|
|
141
145
|
})
|
|
142
146
|
expandMaps.set(row, 1)
|
|
143
147
|
rest.push(Object.assign(item, row))
|
|
@@ -163,21 +167,21 @@ function getBodyLabelData ($xetable: any, opts: any, columns: any[], datas: any[
|
|
|
163
167
|
bodyExportMethod = columnOpts.exportMethod
|
|
164
168
|
}
|
|
165
169
|
if (bodyExportMethod) {
|
|
166
|
-
cellValue = bodyExportMethod({ $table: $
|
|
170
|
+
cellValue = bodyExportMethod({ $table: $xeTable, row, column, options: opts })
|
|
167
171
|
} else {
|
|
168
172
|
switch (column.type) {
|
|
169
173
|
case 'seq': {
|
|
170
174
|
const seqValue = $rowIndex + 1
|
|
171
|
-
cellValue = mode === 'all' ? seqValue : getSeq($
|
|
175
|
+
cellValue = mode === 'all' ? seqValue : getSeq($xeTable, seqValue, row, $rowIndex, column, $columnIndex)
|
|
172
176
|
break
|
|
173
177
|
}
|
|
174
178
|
case 'checkbox':
|
|
175
|
-
cellValue = toBooleanValue($
|
|
179
|
+
cellValue = toBooleanValue($xeTable.isCheckedByCheckboxRow(row))
|
|
176
180
|
item._checkboxLabel = checkboxOpts.labelField ? XEUtils.get(row, checkboxOpts.labelField) : ''
|
|
177
181
|
item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({ row })
|
|
178
182
|
break
|
|
179
183
|
case 'radio':
|
|
180
|
-
cellValue = toBooleanValue($
|
|
184
|
+
cellValue = toBooleanValue($xeTable.isCheckedByRadioRow(row))
|
|
181
185
|
item._radioLabel = radioOpts.labelField ? XEUtils.get(row, radioOpts.labelField) : ''
|
|
182
186
|
item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({ row })
|
|
183
187
|
break
|
|
@@ -185,12 +189,12 @@ function getBodyLabelData ($xetable: any, opts: any, columns: any[], datas: any[
|
|
|
185
189
|
if (opts.original) {
|
|
186
190
|
cellValue = getCellValue(row, column)
|
|
187
191
|
} else {
|
|
188
|
-
cellValue = $
|
|
192
|
+
cellValue = $xeTable.getCellLabel(row, column)
|
|
189
193
|
if (column.type === 'html') {
|
|
190
194
|
htmlCellElem.innerHTML = cellValue
|
|
191
195
|
cellValue = htmlCellElem.innerText.trim()
|
|
192
196
|
} else {
|
|
193
|
-
const cell = $
|
|
197
|
+
const cell = $xeTable.getCellElement(row, column)
|
|
194
198
|
if (cell) {
|
|
195
199
|
cellValue = cell.innerText.trim()
|
|
196
200
|
}
|
|
@@ -198,7 +202,7 @@ function getBodyLabelData ($xetable: any, opts: any, columns: any[], datas: any[
|
|
|
198
202
|
}
|
|
199
203
|
}
|
|
200
204
|
}
|
|
201
|
-
item[column.id] =
|
|
205
|
+
item[column.id] = toStringValue(cellValue)
|
|
202
206
|
})
|
|
203
207
|
return item
|
|
204
208
|
})
|
|
@@ -17,25 +17,29 @@ export default {
|
|
|
17
17
|
}
|
|
18
18
|
} as any,
|
|
19
19
|
render (this: any, h: CreateElement) {
|
|
20
|
-
const
|
|
21
|
-
|
|
20
|
+
const $xeTable = this.$parent
|
|
21
|
+
|
|
22
|
+
const { filterStore } = this
|
|
23
|
+
const { args, visible, multiple, column } = filterStore
|
|
22
24
|
const filterRender = column ? column.filterRender : null
|
|
23
25
|
const compConf = isEnableConf(filterRender) ? renderer.get(filterRender.name) : null
|
|
24
26
|
const filterClassName = compConf ? (compConf.tableFilterClassName || compConf.filterClassName) : ''
|
|
27
|
+
const filterOpts = $xeTable.computeFilterOpts
|
|
28
|
+
const { destroyOnClose } = filterOpts
|
|
25
29
|
return h('div', {
|
|
26
30
|
class: [
|
|
27
31
|
'vxe-table--filter-wrapper',
|
|
28
32
|
'filter--prevent-default',
|
|
29
33
|
compConf && compConf.className ? compConf.className : '',
|
|
30
|
-
getClass(filterClassName, Object.assign({ $panel: this, $table: $
|
|
34
|
+
getClass(filterClassName, Object.assign({ $panel: this, $table: $xeTable }, args)),
|
|
31
35
|
{
|
|
32
|
-
'is--animat': $
|
|
33
|
-
'is--multiple':
|
|
34
|
-
'is--active':
|
|
36
|
+
'is--animat': $xeTable.animat,
|
|
37
|
+
'is--multiple': multiple,
|
|
38
|
+
'is--active': visible
|
|
35
39
|
}
|
|
36
40
|
],
|
|
37
41
|
style: filterStore.style
|
|
38
|
-
}, filterStore.visible && column ? this.renderOptions(h, filterRender, compConf).concat(this.renderFooter(h)) : [])
|
|
42
|
+
}, filterStore.visible && (destroyOnClose ? visible : true) && column ? this.renderOptions(h, filterRender, compConf).concat(this.renderFooter(h)) : [])
|
|
39
43
|
},
|
|
40
44
|
methods: {
|
|
41
45
|
renderOptions (h: CreateElement, filterRender: any, compConf: any) {
|
|
@@ -2685,7 +2685,7 @@ const Methods = {
|
|
|
2685
2685
|
|
|
2686
2686
|
const { rceTimeout } = internalData
|
|
2687
2687
|
const el = $xeTable.$refs.refElem
|
|
2688
|
-
if (
|
|
2688
|
+
if (el && el.clientWidth) {
|
|
2689
2689
|
$xeTable.autoCellWidth()
|
|
2690
2690
|
}
|
|
2691
2691
|
if (rceTimeout) {
|
|
@@ -6288,18 +6288,25 @@ const Methods = {
|
|
|
6288
6288
|
const rowRest = fullAllDataRowIdData[getRowid($xeTable, row)]
|
|
6289
6289
|
return rowRest && !!rowRest.treeLoaded
|
|
6290
6290
|
},
|
|
6291
|
-
clearTreeExpandLoaded (
|
|
6291
|
+
clearTreeExpandLoaded (rows: any) {
|
|
6292
6292
|
const $xeTable = this
|
|
6293
6293
|
|
|
6294
6294
|
const { treeOpts, treeExpandedMaps, fullAllDataRowIdData } = this
|
|
6295
|
-
const { transform
|
|
6296
|
-
|
|
6297
|
-
|
|
6298
|
-
|
|
6299
|
-
rowRest.treeLoaded = false
|
|
6300
|
-
if (treeExpandedMaps[rowid]) {
|
|
6301
|
-
delete treeExpandedMaps[rowid]
|
|
6295
|
+
const { transform } = treeOpts
|
|
6296
|
+
if (rows) {
|
|
6297
|
+
if (!XEUtils.isArray(rows)) {
|
|
6298
|
+
rows = [rows]
|
|
6302
6299
|
}
|
|
6300
|
+
rows.forEach((row: any) => {
|
|
6301
|
+
const rowid = getRowid($xeTable, row)
|
|
6302
|
+
const rowRest = fullAllDataRowIdData[rowid]
|
|
6303
|
+
if (rowRest) {
|
|
6304
|
+
rowRest.treeLoaded = false
|
|
6305
|
+
if (treeExpandedMaps[rowid]) {
|
|
6306
|
+
delete treeExpandedMaps[rowid]
|
|
6307
|
+
}
|
|
6308
|
+
}
|
|
6309
|
+
})
|
|
6303
6310
|
}
|
|
6304
6311
|
if (transform) {
|
|
6305
6312
|
this.handleVirtualTreeToList()
|
|
@@ -7435,7 +7442,7 @@ const Methods = {
|
|
|
7435
7442
|
} as any
|
|
7436
7443
|
|
|
7437
7444
|
// Module methods
|
|
7438
|
-
const funcs = 'setFilter,openFilter,clearFilter,saveFilterPanel,resetFilterPanel,getCheckedFilters,updateFilterOptionStatus,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,getCopyCellAreas,clearCopyCellArea,setCellAreas,openFNR,openFind,openReplace,closeFNR,getSelectedCell,clearSelected,insert,insertAt,insertNextAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearEdit,clearActived,getEditRecord,getActiveRecord,isEditByRow,isActiveByRow,setEditRow,setActiveRow,setEditCell,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,fullValidateField,validateField,openExport,closeExport,openPrint,closePrint,getPrintHtml,exportData,openImport,closeImport,importData,saveFile,readFile,importByFile,print,openCustom,closeCustom,saveCustom,cancelCustom,resetCustom,toggleCustomAllCheckbox,setCustomAllCheckbox'.split(',')
|
|
7445
|
+
const funcs = 'setFilter,openFilter,clearFilter,saveFilterPanel,resetFilterPanel,getCheckedFilters,updateFilterOptionStatus,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,getCopyCellAreas,clearCopyCellArea,setCellAreas,openFNR,openFind,openReplace,closeFNR,getSelectedCell,clearSelected,insert,insertAt,insertNextAt,insertChild,insertChildAt,insertChildNextAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearEdit,clearActived,getEditRecord,getActiveRecord,isEditByRow,isActiveByRow,setEditRow,setActiveRow,setEditCell,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,fullValidateField,validateField,openExport,closeExport,openPrint,closePrint,getPrintHtml,exportData,openImport,closeImport,importData,saveFile,readFile,importByFile,print,openCustom,closeCustom,saveCustom,cancelCustom,resetCustom,toggleCustomAllCheckbox,setCustomAllCheckbox'.split(',')
|
|
7439
7446
|
|
|
7440
7447
|
funcs.forEach(name => {
|
|
7441
7448
|
Methods[name] = function (...args: any[]) {
|
package/packages/ui/index.ts
CHANGED
|
@@ -78,17 +78,6 @@
|
|
|
78
78
|
.vxe-ico-picker {
|
|
79
79
|
width: 100%;
|
|
80
80
|
}
|
|
81
|
-
.vxe-cell--tree-node {
|
|
82
|
-
.vxe-input,
|
|
83
|
-
.vxe-textarea,
|
|
84
|
-
.vxe-select,
|
|
85
|
-
.vxe-tree-select,
|
|
86
|
-
.vxe-date-picker,
|
|
87
|
-
.vxe-number-input,
|
|
88
|
-
.vxe-ico-picker {
|
|
89
|
-
width: 100%;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
81
|
}
|
|
93
82
|
}
|
|
94
83
|
}
|
|
@@ -110,6 +99,9 @@
|
|
|
110
99
|
width: 100%;
|
|
111
100
|
}
|
|
112
101
|
& > .vxe-cell--tree-node {
|
|
102
|
+
.vxe-default-input,
|
|
103
|
+
.vxe-default-textarea,
|
|
104
|
+
.vxe-default-select,
|
|
113
105
|
.vxe-input,
|
|
114
106
|
.vxe-textarea,
|
|
115
107
|
.vxe-select,
|
|
@@ -138,17 +130,6 @@
|
|
|
138
130
|
& > .vxe-ico-picker {
|
|
139
131
|
width: 100%;
|
|
140
132
|
}
|
|
141
|
-
& > .vxe-cell--tree-node {
|
|
142
|
-
.vxe-input,
|
|
143
|
-
.vxe-textarea,
|
|
144
|
-
.vxe-select,
|
|
145
|
-
.vxe-tree-select,
|
|
146
|
-
.vxe-date-picker,
|
|
147
|
-
.vxe-number-input,
|
|
148
|
-
.vxe-ico-picker {
|
|
149
|
-
width: 100%;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
133
|
}
|
|
153
134
|
.vxe-cell,
|
|
154
135
|
.vxe-table--filter-template {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|