releases 4.7.42
This commit is contained in:
@@ -2,8 +2,8 @@ import { createApp } from 'vue'
|
|||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
import router from './router'
|
import router from './router'
|
||||||
|
|
||||||
// import VxeUI from 'vxe-pc-ui'
|
import VxeUI from 'vxe-pc-ui'
|
||||||
// import 'vxe-pc-ui/lib/style.css'
|
import 'vxe-pc-ui/lib/style.css'
|
||||||
|
|
||||||
// import enUS from 'vxe-pc-ui/packages/language/en-US'
|
// import enUS from 'vxe-pc-ui/packages/language/en-US'
|
||||||
|
|
||||||
@@ -16,6 +16,6 @@ import './style/index.scss'
|
|||||||
|
|
||||||
createApp(App)
|
createApp(App)
|
||||||
.use(router)
|
.use(router)
|
||||||
// .use(VxeUI)
|
.use(VxeUI)
|
||||||
.use(VxeTable)
|
.use(VxeTable)
|
||||||
.mount('#app')
|
.mount('#app')
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
:data="demo1.tableData">
|
:data="demo1.tableData">
|
||||||
<vxe-column type="seq" width="60"></vxe-column>
|
<vxe-column type="seq" width="60"></vxe-column>
|
||||||
<vxe-column type="checkbox" title="ID" width="140"></vxe-column>
|
<vxe-column type="checkbox" title="ID" width="140"></vxe-column>
|
||||||
<vxe-colgroup title="分组1">
|
<vxe-colgroup title="分组1" field="g1">
|
||||||
<vxe-column type="expand" field="role" title="Role">
|
<vxe-column type="expand" field="role" title="Role">
|
||||||
<template #content="{ row }">
|
<template #content="{ row }">
|
||||||
<div>{{ row.name }}</div>
|
<div>{{ row.name }}</div>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vxe-table",
|
"name": "vxe-table",
|
||||||
"version": "4.7.41",
|
"version": "4.7.42",
|
||||||
"description": "一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟树、列拖拽,懒加载、快捷菜单、数据校验、树形结构、打印、导入导出、自定义模板、渲染器、JSON 配置式...",
|
"description": "一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟树、列拖拽,懒加载、快捷菜单、数据校验、树形结构、打印、导入导出、自定义模板、渲染器、JSON 配置式...",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"update": "npm install --legacy-peer-deps",
|
"update": "npm install --legacy-peer-deps",
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
"style": "lib/style.css",
|
"style": "lib/style.css",
|
||||||
"typings": "types/index.d.ts",
|
"typings": "types/index.d.ts",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"vxe-pc-ui": "^4.0.45"
|
"vxe-pc-ui": "^4.0.46"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/resize-observer-browser": "^0.1.11",
|
"@types/resize-observer-browser": "^0.1.11",
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
/**
|
|
||||||
* v4保留兼容,已废弃,即将删除文件
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
export default {
|
export default {
|
||||||
vxe: {
|
vxe: {
|
||||||
base: {
|
base: {
|
||||||
@@ -126,7 +122,8 @@ export default {
|
|||||||
colTitle: 'Title',
|
colTitle: 'Title',
|
||||||
colResizable: 'Column width (px)',
|
colResizable: 'Column width (px)',
|
||||||
colVisible: 'Display',
|
colVisible: 'Display',
|
||||||
colFixed: 'Freeze columns (Max. {0})',
|
colFixed: 'Freeze columns',
|
||||||
|
colFixedMax: 'Freeze columns (Max. {0})',
|
||||||
fixedLeft: 'Left',
|
fixedLeft: 'Left',
|
||||||
fixedUnset: 'Unset',
|
fixedUnset: 'Unset',
|
||||||
fixedRight: 'Right'
|
fixedRight: 'Right'
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
/**
|
|
||||||
* v4保留兼容,已废弃,即将删除文件
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
export default {
|
export default {
|
||||||
vxe: {
|
vxe: {
|
||||||
base: {
|
base: {
|
||||||
@@ -126,7 +122,8 @@ export default {
|
|||||||
colTitle: 'Title',
|
colTitle: 'Title',
|
||||||
colResizable: 'Column width (px)',
|
colResizable: 'Column width (px)',
|
||||||
colVisible: 'Display',
|
colVisible: 'Display',
|
||||||
colFixed: 'Freeze columns (Max {0})',
|
colFixed: 'Freeze columns',
|
||||||
|
colFixedMax: 'Freeze columns (Max {0})',
|
||||||
fixedLeft: 'Left',
|
fixedLeft: 'Left',
|
||||||
fixedUnset: 'Unset',
|
fixedUnset: 'Unset',
|
||||||
fixedRight: 'Right'
|
fixedRight: 'Right'
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
/**
|
|
||||||
* v4保留兼容,已废弃,即将删除文件
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
export default {
|
export default {
|
||||||
vxe: {
|
vxe: {
|
||||||
base: {
|
base: {
|
||||||
@@ -126,7 +122,8 @@ export default {
|
|||||||
colTitle: 'タイトル',
|
colTitle: 'タイトル',
|
||||||
colResizable: 'Column width (px)',
|
colResizable: 'Column width (px)',
|
||||||
colVisible: 'Display',
|
colVisible: 'Display',
|
||||||
colFixed: '冻结列(最多 {0} 列)',
|
colFixed: '冻结列',
|
||||||
|
colFixedMax: '冻结列(最多 {0} 列)',
|
||||||
fixedLeft: '左側',
|
fixedLeft: '左側',
|
||||||
fixedUnset: '指定しない',
|
fixedUnset: '指定しない',
|
||||||
fixedRight: '右側'
|
fixedRight: '右側'
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
/**
|
|
||||||
* v4保留兼容,已废弃,即将删除文件
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
export default {
|
export default {
|
||||||
vxe: {
|
vxe: {
|
||||||
base: {
|
base: {
|
||||||
@@ -126,7 +122,8 @@ export default {
|
|||||||
colTitle: 'Title',
|
colTitle: 'Title',
|
||||||
colResizable: 'Column width (px)',
|
colResizable: 'Column width (px)',
|
||||||
colVisible: 'Display',
|
colVisible: 'Display',
|
||||||
colFixed: 'Freeze columns (Max {0})',
|
colFixed: 'Freeze columns',
|
||||||
|
colFixedMax: 'Freeze columns (Max {0})',
|
||||||
fixedLeft: 'Left',
|
fixedLeft: 'Left',
|
||||||
fixedUnset: 'Unset',
|
fixedUnset: 'Unset',
|
||||||
fixedRight: 'Right'
|
fixedRight: 'Right'
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
/**
|
|
||||||
* v4保留兼容,已废弃,即将删除文件
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
export default {
|
export default {
|
||||||
vxe: {
|
vxe: {
|
||||||
base: {
|
base: {
|
||||||
@@ -126,7 +122,8 @@ export default {
|
|||||||
colTitle: '标题',
|
colTitle: '标题',
|
||||||
colResizable: '列宽(像素)',
|
colResizable: '列宽(像素)',
|
||||||
colVisible: '是否显示',
|
colVisible: '是否显示',
|
||||||
colFixed: '冻结列(最多 {0} 列)',
|
colFixed: '冻结列',
|
||||||
|
colFixedMax: '冻结列(最多 {0} 列)',
|
||||||
fixedLeft: '左侧',
|
fixedLeft: '左侧',
|
||||||
fixedUnset: '不设置',
|
fixedUnset: '不设置',
|
||||||
fixedRight: '右侧'
|
fixedRight: '右侧'
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
/**
|
|
||||||
* v4保留兼容,已废弃,即将删除文件
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
export default {
|
export default {
|
||||||
vxe: {
|
vxe: {
|
||||||
base: {
|
base: {
|
||||||
@@ -23,7 +19,7 @@ export default {
|
|||||||
useErr: '安裝 "{0}" 模組時發生錯誤,可能順序不正確,依賴的模組需要在Table之前安裝',
|
useErr: '安裝 "{0}" 模組時發生錯誤,可能順序不正確,依賴的模組需要在Table之前安裝',
|
||||||
barUnableLink: '工具欄無法關聯表格',
|
barUnableLink: '工具欄無法關聯表格',
|
||||||
expandContent: '展開行的插槽應該是 “content”,請檢查是否正確',
|
expandContent: '展開行的插槽應該是 “content”,請檢查是否正確',
|
||||||
reqComp: '缺少 "{0}" 組件,請檢查是否正確安裝',
|
reqComp: '缺少 "{0}" 組件,请检查是否正确安装',
|
||||||
reqModule: '缺少 "{0}" 模組',
|
reqModule: '缺少 "{0}" 模組',
|
||||||
reqProp: '缺少必要的 "{0}" 參數,可能會導致出現錯誤',
|
reqProp: '缺少必要的 "{0}" 參數,可能會導致出現錯誤',
|
||||||
emptyProp: '參數 "{0}" 不允許為空',
|
emptyProp: '參數 "{0}" 不允許為空',
|
||||||
@@ -126,7 +122,8 @@ export default {
|
|||||||
colTitle: '標題',
|
colTitle: '標題',
|
||||||
colResizable: '列宽(像素)',
|
colResizable: '列宽(像素)',
|
||||||
colVisible: '是否顯示',
|
colVisible: '是否顯示',
|
||||||
colFixed: '冻结列(最多 {0} 列)',
|
colFixed: '冻结列',
|
||||||
|
colFixedMax: '冻结列(最多 {0} 列)',
|
||||||
fixedLeft: '左側',
|
fixedLeft: '左側',
|
||||||
fixedUnset: '不設定',
|
fixedUnset: '不設定',
|
||||||
fixedRight: '右側'
|
fixedRight: '右側'
|
||||||
|
|||||||
@@ -495,6 +495,7 @@ export default defineComponent({
|
|||||||
const customOpts = computeCustomOpts.value
|
const customOpts = computeCustomOpts.value
|
||||||
const { modalOptions, allowVisible, allowSort, allowFixed, allowResizable, checkMethod, visibleMethod } = customOpts
|
const { modalOptions, allowVisible, allowSort, allowFixed, allowResizable, checkMethod, visibleMethod } = customOpts
|
||||||
const columnOpts = computeColumnOpts.value
|
const columnOpts = computeColumnOpts.value
|
||||||
|
const { maxFixedSize } = columnOpts
|
||||||
const modalOpts = Object.assign({}, modalOptions)
|
const modalOpts = Object.assign({}, modalOptions)
|
||||||
const isMaxFixedColumn = computeIsMaxFixedColumn.value
|
const isMaxFixedColumn = computeIsMaxFixedColumn.value
|
||||||
const trVNs: VNode[] = []
|
const trVNs: VNode[] = []
|
||||||
@@ -630,12 +631,15 @@ export default defineComponent({
|
|||||||
minWidth: modalOpts.minWidth || 700,
|
minWidth: modalOpts.minWidth || 700,
|
||||||
height: modalOpts.height || '50vh',
|
height: modalOpts.height || '50vh',
|
||||||
minHeight: modalOpts.minHeight || 400,
|
minHeight: modalOpts.minHeight || 400,
|
||||||
mask: true,
|
showZoom: modalOpts.showZoom,
|
||||||
lockView: true,
|
showMaximize: modalOpts.showMaximize,
|
||||||
showFooter: true,
|
showMinimize: modalOpts.showMinimize,
|
||||||
resize: true,
|
mask: modalOpts.mask,
|
||||||
escClosable: true,
|
lockView: modalOpts.lockView,
|
||||||
|
resize: modalOpts.resize,
|
||||||
|
escClosable: !!modalOpts.escClosable,
|
||||||
destroyOnClose: true,
|
destroyOnClose: true,
|
||||||
|
showFooter: true,
|
||||||
'onUpdate:modelValue' (value: any) {
|
'onUpdate:modelValue' (value: any) {
|
||||||
customStore.visible = value
|
customStore.visible = value
|
||||||
}
|
}
|
||||||
@@ -729,7 +733,7 @@ export default defineComponent({
|
|||||||
? h('th', {}, getI18n('vxe.custom.setting.colResizable'))
|
? h('th', {}, getI18n('vxe.custom.setting.colResizable'))
|
||||||
: createCommentVNode(),
|
: createCommentVNode(),
|
||||||
allowFixed
|
allowFixed
|
||||||
? h('th', {}, getI18n('vxe.custom.setting.colFixed', [columnOpts.maxFixedSize || 0]))
|
? h('th', {}, getI18n(`vxe.custom.setting.${maxFixedSize ? 'colFixedMax' : 'colFixed'}`, [maxFixedSize]))
|
||||||
: createCommentVNode()
|
: createCommentVNode()
|
||||||
])
|
])
|
||||||
]),
|
]),
|
||||||
|
|||||||
@@ -541,7 +541,7 @@ export default defineComponent({
|
|||||||
let fixedSize = 0
|
let fixedSize = 0
|
||||||
// 只判断第一层
|
// 只判断第一层
|
||||||
collectColumn.forEach((column) => {
|
collectColumn.forEach((column) => {
|
||||||
if (column.fixed) {
|
if (column.renderFixed) {
|
||||||
fixedSize++
|
fixedSize++
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -898,27 +898,29 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleCustomRestore = (storeData: VxeTableDefines.CustomStoreData) => {
|
const handleCustomRestore = (storeData: VxeTableDefines.CustomStoreData) => {
|
||||||
const { tableFullColumn } = internalData
|
|
||||||
let { collectColumn } = internalData
|
let { collectColumn } = internalData
|
||||||
const { resizableData, sortData, visibleData, fixedData } = storeData
|
const { resizableData, sortData, visibleData, fixedData } = storeData
|
||||||
let hasCustomSort = false
|
let hasCustomSort = false
|
||||||
// 处理还原
|
// 处理还原
|
||||||
if (resizableData || sortData || visibleData || fixedData) {
|
if (resizableData || sortData || visibleData || fixedData) {
|
||||||
tableFullColumn.forEach(column => {
|
XEUtils.eachTree(collectColumn, (column, index, items, path, parent) => {
|
||||||
const colKey = column.getKey()
|
const colKey = column.getKey()
|
||||||
|
// 支持一级
|
||||||
|
if (!parent) {
|
||||||
|
if (fixedData && fixedData[colKey]) {
|
||||||
|
column.fixed = fixedData[colKey]
|
||||||
|
}
|
||||||
|
if (sortData && XEUtils.isNumber(sortData[colKey])) {
|
||||||
|
hasCustomSort = true
|
||||||
|
column.renderSortNumber = sortData[colKey]
|
||||||
|
}
|
||||||
|
}
|
||||||
if (resizableData && XEUtils.isNumber(resizableData[colKey])) {
|
if (resizableData && XEUtils.isNumber(resizableData[colKey])) {
|
||||||
column.resizeWidth = resizableData[colKey]
|
column.resizeWidth = resizableData[colKey]
|
||||||
}
|
}
|
||||||
if (visibleData && XEUtils.isBoolean(visibleData[colKey])) {
|
if (visibleData && XEUtils.isBoolean(visibleData[colKey])) {
|
||||||
column.visible = visibleData[colKey]
|
column.visible = visibleData[colKey]
|
||||||
}
|
}
|
||||||
if (fixedData && fixedData[colKey]) {
|
|
||||||
column.fixed = fixedData[colKey]
|
|
||||||
}
|
|
||||||
if (sortData && XEUtils.isNumber(sortData[colKey])) {
|
|
||||||
hasCustomSort = true
|
|
||||||
column.renderSortNumber = sortData[colKey]
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
// 如果自定义了顺序
|
// 如果自定义了顺序
|
||||||
if (hasCustomSort) {
|
if (hasCustomSort) {
|
||||||
@@ -3318,14 +3320,13 @@ export default defineComponent({
|
|||||||
const targetColumn = getRootColumn($xeTable, column as any)
|
const targetColumn = getRootColumn($xeTable, column as any)
|
||||||
const isMaxFixedColumn = computeIsMaxFixedColumn.value
|
const isMaxFixedColumn = computeIsMaxFixedColumn.value
|
||||||
const columnOpts = computeColumnOpts.value
|
const columnOpts = computeColumnOpts.value
|
||||||
const { maxFixedSize } = columnOpts
|
|
||||||
if (targetColumn && targetColumn.fixed !== fixed) {
|
if (targetColumn && targetColumn.fixed !== fixed) {
|
||||||
// 是否超过最大固定列数量
|
// 是否超过最大固定列数量
|
||||||
if (!targetColumn.fixed && isMaxFixedColumn) {
|
if (!targetColumn.fixed && isMaxFixedColumn) {
|
||||||
if (VxeUI.modal) {
|
if (VxeUI.modal) {
|
||||||
VxeUI.modal.message({
|
VxeUI.modal.message({
|
||||||
status: 'error',
|
status: 'error',
|
||||||
content: getI18n('vxe.table.maxFixedCol', [maxFixedSize])
|
content: getI18n('vxe.table.maxFixedCol', [columnOpts.maxFixedSize])
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return nextTick()
|
return nextTick()
|
||||||
@@ -4595,7 +4596,7 @@ export default defineComponent({
|
|||||||
let hasFixedt = 0
|
let hasFixedt = 0
|
||||||
let hasVisible = 0
|
let hasVisible = 0
|
||||||
XEUtils.eachTree(collectColumn, (column, index, items, path, parent) => {
|
XEUtils.eachTree(collectColumn, (column, index, items, path, parent) => {
|
||||||
// 排序只支持一级
|
// 只支持一级
|
||||||
if (!parent) {
|
if (!parent) {
|
||||||
collectColumn.forEach((column) => {
|
collectColumn.forEach((column) => {
|
||||||
const colKey = column.getKey()
|
const colKey = column.getKey()
|
||||||
@@ -4604,6 +4605,13 @@ export default defineComponent({
|
|||||||
sortData[colKey] = column.renderSortNumber
|
sortData[colKey] = column.renderSortNumber
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
if (column.fixed && column.fixed !== column.defaultFixed) {
|
||||||
|
const colKey = column.getKey()
|
||||||
|
if (colKey) {
|
||||||
|
hasFixedt = 1
|
||||||
|
fixedData[colKey] = column.fixed
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (column.resizeWidth) {
|
if (column.resizeWidth) {
|
||||||
const colKey = column.getKey()
|
const colKey = column.getKey()
|
||||||
@@ -4612,13 +4620,6 @@ export default defineComponent({
|
|||||||
resizableData[colKey] = column.renderWidth
|
resizableData[colKey] = column.renderWidth
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (column.fixed && column.fixed !== column.defaultFixed) {
|
|
||||||
const colKey = column.getKey()
|
|
||||||
if (colKey) {
|
|
||||||
hasFixedt = 1
|
|
||||||
fixedData[colKey] = column.fixed
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!checkMethod || checkMethod({ column })) {
|
if (!checkMethod || checkMethod({ column })) {
|
||||||
if (!column.visible && column.defaultVisible) {
|
if (!column.visible && column.defaultVisible) {
|
||||||
const colKey = column.getKey()
|
const colKey = column.getKey()
|
||||||
|
|||||||
@@ -68,9 +68,16 @@ VxeUI.setConfig({
|
|||||||
allowFixed: true,
|
allowFixed: true,
|
||||||
allowSort: true,
|
allowSort: true,
|
||||||
showFooter: true,
|
showFooter: true,
|
||||||
placement: 'top-right'
|
placement: 'top-right',
|
||||||
// storage: false,
|
// storage: false,
|
||||||
// checkMethod () {}
|
// checkMethod () {},
|
||||||
|
modalOptions: {
|
||||||
|
showMaximize: true,
|
||||||
|
mask: true,
|
||||||
|
lockView: true,
|
||||||
|
resize: true,
|
||||||
|
escClosable: true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
sortConfig: {
|
sortConfig: {
|
||||||
// remote: false,
|
// remote: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user