Skip to content

Commit

Permalink
releases 3.11.34
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed Dec 18, 2024
1 parent af82a98 commit bb6a095
Show file tree
Hide file tree
Showing 24 changed files with 192 additions and 37 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vxe-table",
"version": "3.11.33",
"version": "3.11.34",
"description": "一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟树、拖拽排序,懒加载、快捷菜单、数据校验、树形结构、打印、导入导出、自定义模板、渲染器、JSON 配置式...",
"scripts": {
"update": "npm install --legacy-peer-deps",
Expand Down Expand Up @@ -28,7 +28,7 @@
"style": "lib/style.css",
"typings": "types/index.d.ts",
"dependencies": {
"vxe-pc-ui": "^3.3.38"
"vxe-pc-ui": "^3.3.39"
},
"devDependencies": {
"@babel/plugin-transform-modules-commonjs": "^7.25.7",
Expand Down
3 changes: 3 additions & 0 deletions packages/locale/lang/ar-EG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ export default {
}
}
},
numberInput: {
currencySymbol: '$'
},
imagePreview: {
popupTitle: '预览',
operBtn: {
Expand Down
3 changes: 3 additions & 0 deletions packages/locale/lang/de-DE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ export default {
}
}
},
numberInput: {
currencySymbol: '$'
},
imagePreview: {
popupTitle: '预览',
operBtn: {
Expand Down
3 changes: 3 additions & 0 deletions packages/locale/lang/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ export default {
}
}
},
numberInput: {
currencySymbol: '$'
},
imagePreview: {
popupTitle: 'Preview',
operBtn: {
Expand Down
3 changes: 3 additions & 0 deletions packages/locale/lang/es-ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ export default {
}
}
},
numberInput: {
currencySymbol: '$'
},
imagePreview: {
popupTitle: 'Preview',
operBtn: {
Expand Down
3 changes: 3 additions & 0 deletions packages/locale/lang/fr-FR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ export default {
}
}
},
numberInput: {
currencySymbol: '$'
},
imagePreview: {
popupTitle: '预览',
operBtn: {
Expand Down
3 changes: 3 additions & 0 deletions packages/locale/lang/hu-HU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ export default {
}
}
},
numberInput: {
currencySymbol: '$'
},
imagePreview: {
popupTitle: 'Előnézet',
operBtn: {
Expand Down
3 changes: 3 additions & 0 deletions packages/locale/lang/hy-AM.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ export default {
}
}
},
numberInput: {
currencySymbol: '$'
},
imagePreview: {
popupTitle: '预览',
operBtn: {
Expand Down
3 changes: 3 additions & 0 deletions packages/locale/lang/ja-JP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ export default {
}
}
},
numberInput: {
currencySymbol: '$'
},
imagePreview: {
popupTitle: 'Preview',
operBtn: {
Expand Down
3 changes: 3 additions & 0 deletions packages/locale/lang/ko-KR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ export default {
}
}
},
numberInput: {
currencySymbol: '$'
},
imagePreview: {
popupTitle: '预览',
operBtn: {
Expand Down
3 changes: 3 additions & 0 deletions packages/locale/lang/nb-NO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ export default {
}
}
},
numberInput: {
currencySymbol: '$'
},
imagePreview: {
popupTitle: '预览',
operBtn: {
Expand Down
3 changes: 3 additions & 0 deletions packages/locale/lang/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ export default {
}
}
},
numberInput: {
currencySymbol: '$'
},
imagePreview: {
popupTitle: 'Preview',
operBtn: {
Expand Down
3 changes: 3 additions & 0 deletions packages/locale/lang/ru-RU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ export default {
}
}
},
numberInput: {
currencySymbol: '$'
},
imagePreview: {
popupTitle: 'Предварительный просмотр',
operBtn: {
Expand Down
3 changes: 3 additions & 0 deletions packages/locale/lang/ug-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ export default {
}
}
},
numberInput: {
currencySymbol: '$'
},
imagePreview: {
popupTitle: 'كۆرۈش',
operBtn: {
Expand Down
3 changes: 3 additions & 0 deletions packages/locale/lang/uk-UA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ export default {
}
}
},
numberInput: {
currencySymbol: '$'
},
imagePreview: {
popupTitle: '预览',
operBtn: {
Expand Down
3 changes: 3 additions & 0 deletions packages/locale/lang/vi-VN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ export default {
}
}
},
numberInput: {
currencySymbol: '$'
},
imagePreview: {
popupTitle: '预览',
operBtn: {
Expand Down
3 changes: 3 additions & 0 deletions packages/locale/lang/zh-CHT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ export default {
}
}
},
numberInput: {
currencySymbol: '¥'
},
imagePreview: {
popupTitle: '預覽',
operBtn: {
Expand Down
3 changes: 3 additions & 0 deletions packages/locale/lang/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ export default {
}
}
},
numberInput: {
currencySymbol: '¥'
},
imagePreview: {
popupTitle: '预览',
operBtn: {
Expand Down
33 changes: 23 additions & 10 deletions packages/table/module/export/mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function getSeq ($xetable: any, cellValue: any, row: any, $rowIndex: any, column
}

function defaultFilterExportColumn (column: any) {
return column.property || ['seq', 'checkbox', 'radio'].indexOf(column.type) > -1
return column.field || ['seq', 'checkbox', 'radio'].indexOf(column.type) > -1
}

function toTableBorder (border: any) {
Expand Down Expand Up @@ -220,7 +220,7 @@ function getBooleanValue (cellValue: any) {
function getHeaderTitle ($xetable: any, opts: any, column: any) {
const { columnOpts } = $xetable
const headExportMethod = column.headerExportMethod || columnOpts.headerExportMethod
return headExportMethod ? headExportMethod({ column, options: opts, $table: $xetable }) : ((opts.original ? column.property : column.getTitle()) || '')
return headExportMethod ? headExportMethod({ column, options: opts, $table: $xetable }) : ((opts.original ? column.field : column.getTitle()) || '')
}

function getFooterCellValue ($xetable: any, opts: any, row: any, column: any) {
Expand Down Expand Up @@ -776,7 +776,7 @@ function parseXML (columns: any, content: any) {
function checkImportData (columns: any[], fields: any[]) {
const tableFields: any[] = []
columns.forEach((column) => {
const field = column.property
const field = column.field
if (field) {
tableFields.push(field)
}
Expand Down Expand Up @@ -1083,13 +1083,13 @@ function handleExportAndPrint ($xetable: any, options: any, isPrint?: any) {
} else {
const colid = item.id || item.colId
const type = item.type
const field = item.property || item.field
const field = item.field
if (colid) {
return column.id === colid
} else if (field && type) {
return column.property === field && column.type === type
return column.field === field && column.type === type
} else if (field) {
return column.property === field
return column.field === field
} else if (type) {
return column.type === type
}
Expand Down Expand Up @@ -1219,13 +1219,26 @@ export default {
}, exportOpts, {
print: false
}, options)
const { type, mode, columns, original, beforeExportMethod } = opts
const { type, mode, columns, original, beforeExportMethod, excludeFields, includeFields } = opts
let groups = []
const customCols = columns && columns.length ? columns : null
// 如果设置源数据,则默认导出设置了字段的列
let columnFilterMethod = opts.columnFilterMethod
if (!customCols && !columnFilterMethod) {
columnFilterMethod = original ? ({ column }: any) => column.property : ({ column }: any) => defaultFilterExportColumn(column)
columnFilterMethod = ({ column }: any) => {
if (excludeFields) {
if (XEUtils.includes(excludeFields, column.field)) {
return false
}
}
if (includeFields) {
if (XEUtils.includes(includeFields, column.field)) {
return true
}
return false
}
return original ? column.field : defaultFilterExportColumn(column)
}
}
if (customCols) {
opts._isCustomColumn = true
Expand All @@ -1240,11 +1253,11 @@ export default {
} else {
const colid = item.id || item.colId
const type = item.type
const field = item.property || item.field
const field = item.field
if (colid) {
targetColumn = this.getColumnById(colid)
} else if (field && type) {
targetColumn = tableFullColumn.find((column: any) => column.property === field && column.type === type)
targetColumn = tableFullColumn.find((column: any) => column.field === field && column.type === type)
} else if (field) {
targetColumn = this.getColumnByField(field)
} else if (type) {
Expand Down
24 changes: 18 additions & 6 deletions packages/table/render/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,8 @@ renderer.mixin({
renderTableCell (h, renderOpts, params) {
const { props = {} } = renderOpts
const { row, column } = params
const digits = props.digits || getConfig().input?.digits || 2
const inputConfig = getConfig().input || {}
const digits = props.digits || inputConfig.digits || 2
let cellValue = XEUtils.get(row, column.field)
if (cellValue) {
switch (props.type) {
Expand Down Expand Up @@ -620,12 +621,17 @@ renderer.mixin({
const { type } = props
let cellValue = XEUtils.get(row, column.field)
if (cellValue) {
const numberInputConfig = getConfig().numberInput || {}
if (type === 'float') {
const digits = props.digits || getConfig().numberInput.digits || 1
const digits = props.digits || numberInputConfig.digits || 1
cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits)
} else if (type === 'amount') {
const digits = props.digits || getConfig().numberInput.digits || 2
const digits = props.digits || numberInputConfig.digits || 2
cellValue = XEUtils.commafy(XEUtils.toNumber(cellValue), { digits })
const showCurrency = props.showCurrency
if (XEUtils.isBoolean(showCurrency) ? showCurrency : numberInputConfig.showCurrency) {
cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || getI18n('vxe.numberInput.currencySymbol') || ''}${cellValue}`
}
}
}
return getCellLabelVNs(h, renderOpts, params, cellValue)
Expand All @@ -637,19 +643,25 @@ renderer.mixin({
// 兼容老模式
const cellValue = XEUtils.isArray(row) ? row[_columnIndex] : XEUtils.get(row, column.field)
if (XEUtils.isNumber(cellValue)) {
const numberInputConfig = getConfig().numberInput || {}
if (type === 'float') {
const digits = props.digits || getConfig().numberInput.digits || 1
const digits = props.digits || numberInputConfig.digits || 1
return XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits)
} else if (type === 'amount') {
const digits = props.digits || getConfig().numberInput.digits || 2
const digits = props.digits || numberInputConfig.digits || 2
return XEUtils.commafy(XEUtils.toNumber(cellValue), { digits })
}
}
return getFuncText(cellValue, 1)
},
renderTableDefault: defaultEditRender,
renderTableFilter: defaultFilterRender,
tableFilterDefaultMethod: handleInputFilterMethod
tableFilterDefaultMethod: handleInputFilterMethod,
tableExportMethod (params) {
const { row, column } = params
const cellValue = XEUtils.get(row, column.field)
return cellValue
}
},
VxeDatePicker: {
tableAutoFocus: 'input',
Expand Down
2 changes: 2 additions & 0 deletions packages/table/src/body.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ function renderColumn (h: any, _vm: any, $xetable: any, seq: any, rowid: any, fi
)
}
}
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto')

return h('td', {
class: [
Expand All @@ -323,6 +324,7 @@ function renderColumn (h: any, _vm: any, $xetable: any, seq: any, rowid: any, fi
'col--tree-node': treeNode,
'col--edit': isEdit,
'col--ellipsis': hasEllipsis,
'fixed--width': !isAutoCellWidth,
'fixed--hidden': fixedHiddenColumn,
'is--drag-cell': isColDragCell,
'is--drag-disabled': isDisabledDrag,
Expand Down
3 changes: 3 additions & 0 deletions packages/table/src/footer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,14 @@ function renderRows (h: CreateElement, _vm: any, tableColumn: VxeTableDefines.Co
attrs.colspan = colspan
}
}
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto')

return h('td', {
class: ['vxe-footer--column', column.id, {
[`col--${footAlign}`]: footAlign,
[`col--${type}`]: type,
'col--last': $columnIndex === tableColumn.length - 1,
'fixed--width': !isAutoCellWidth,
'fixed--hidden': fixedHiddenColumn,
'col--ellipsis': hasEllipsis,
'col--current': currentColumn === column
Expand Down
3 changes: 3 additions & 0 deletions packages/table/src/header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ const renderRows = (h: CreateElement, _vm: any, cols: VxeTableDefines.ColumnInfo
thOns.mouseup = $xeTable.handleHeaderCellDragMouseupEvent
}
}
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto')

return h('th', {
class: ['vxe-header--column', colid, {
[`col--${headAlign}`]: headAlign,
Expand All @@ -77,6 +79,7 @@ const renderRows = (h: CreateElement, _vm: any, cols: VxeTableDefines.ColumnInfo
'col--fixed': column.fixed,
'col--group': isColGroup,
'col--ellipsis': hasEllipsis,
'fixed--width': !isAutoCellWidth,
'fixed--hidden': fixedHiddenColumn,
'is--sortable': column.sortable,
'col--filter': !!column.filters,
Expand Down
Loading

0 comments on commit bb6a095

Please sign in to comment.