fix
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,6 +1,8 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
.history
|
.history
|
||||||
node_modules
|
node_modules
|
||||||
|
/lib_temp
|
||||||
|
/packages_temp
|
||||||
/dist
|
/dist
|
||||||
/es
|
/es
|
||||||
/lib
|
/lib
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ A [vue](https://www.npmjs.com/package/vue) based PC form component, support add
|
|||||||
* [x] ~~v2.0 Based on vue2.6, Support for all major browsers.~~
|
* [x] ~~v2.0 Based on vue2.6, Support for all major browsers.~~
|
||||||
* [x] v3.0 Based on vue2.6, supports modern browsers and retains compatibility with IE11.
|
* [x] v3.0 Based on vue2.6, supports modern browsers and retains compatibility with IE11.
|
||||||
* [x] v4.0 Based on vue3.x, Only support modern browser, not IE.
|
* [x] v4.0 Based on vue3.x, Only support modern browser, not IE.
|
||||||
|
* [x] v4.7 Based on vue3.x, refactor the components, split the excess components, and keep only the table.
|
||||||
|
|
||||||
## Browser Support
|
## Browser Support
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
* [x] ~~v2.0 基于 vue2.6,支持所有主流的浏览器,同时兼具功能与性能~~
|
* [x] ~~v2.0 基于 vue2.6,支持所有主流的浏览器,同时兼具功能与性能~~
|
||||||
* [x] v3.0 基于 vue2.6,支持现代浏览器并保留兼容 IE11
|
* [x] v3.0 基于 vue2.6,支持现代浏览器并保留兼容 IE11
|
||||||
* [x] v4.0 基于 vue3.x,只支持现代浏览器,不支持 IE
|
* [x] v4.0 基于 vue3.x,只支持现代浏览器,不支持 IE
|
||||||
|
* [x] v4.7 基于 vue3.x,重构组件,拆分多余组件,只保留表格
|
||||||
* [ ] 下一阶段:sticky 渲染模式、将虚拟滚动提升到极致、虚拟滚动动态行高、数据图表可视化
|
* [ ] 下一阶段:sticky 渲染模式、将虚拟滚动提升到极致、虚拟滚动动态行高、数据图表可视化
|
||||||
|
|
||||||
## 浏览器支持
|
## 浏览器支持
|
||||||
|
|||||||
@@ -23,7 +23,8 @@
|
|||||||
* [x] ~~v1.0 基於 vue2.6,支持所有主流的瀏覽器,實現表格的一切實用的功能~~
|
* [x] ~~v1.0 基於 vue2.6,支持所有主流的瀏覽器,實現表格的一切實用的功能~~
|
||||||
* [x] ~~v2.0 基於 vue2.6,支持所有主流的瀏覽器,同時兼具功能與效能~~
|
* [x] ~~v2.0 基於 vue2.6,支持所有主流的瀏覽器,同時兼具功能與效能~~
|
||||||
* [x] v3.0 基於 vue2.6,支持現代瀏覽器並保留相容IE11
|
* [x] v3.0 基於 vue2.6,支持現代瀏覽器並保留相容IE11
|
||||||
* [x] v4.0 基于 vue3.x,只支持現代瀏覽器,不支持IE
|
* [x] v4.0 基於 vue3.x,只支持現代瀏覽器,不支持IE
|
||||||
|
* [x] v4.7 基於 vue3.x,重構組件,拆分多餘組件,只保留表格
|
||||||
|
|
||||||
## 瀏覽器支持
|
## 瀏覽器支持
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vxe-table",
|
"name": "vxe-table",
|
||||||
"version": "4.6.16",
|
"version": "4.6.17-beta.0",
|
||||||
"description": "一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟树、列拖拽,懒加载、快捷菜单、数据校验、树形结构、打印导出、自定义模板、渲染器、JSON 配置式...",
|
"description": "一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟树、列拖拽,懒加载、快捷菜单、数据校验、树形结构、打印导出、自定义模板、渲染器、JSON 配置式...",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"update": "npm install --legacy-peer-deps",
|
"update": "npm install --legacy-peer-deps",
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ export function install (app: App, options: any) {
|
|||||||
if (XEUtils.isPlainObject(options)) {
|
if (XEUtils.isPlainObject(options)) {
|
||||||
setConfig(options)
|
setConfig(options)
|
||||||
if ((options as any).theme) {
|
if ((options as any).theme) {
|
||||||
setTheme(options)
|
setTheme((options as any).theme)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
components.forEach(component => component.install(app))
|
components.forEach(component => component.install(app))
|
||||||
|
|||||||
@@ -3181,8 +3181,14 @@ export default defineComponent({
|
|||||||
} else {
|
} else {
|
||||||
const { selectCheckboxMaps } = reactData
|
const { selectCheckboxMaps } = reactData
|
||||||
XEUtils.each(selectCheckboxMaps, (row, rowid) => {
|
XEUtils.each(selectCheckboxMaps, (row, rowid) => {
|
||||||
if (isFull ? fullDataRowIdData[rowid] : afterFullRowMaps[rowid]) {
|
if (isFull) {
|
||||||
rowList.push(row)
|
if (fullDataRowIdData[rowid]) {
|
||||||
|
rowList.push(fullDataRowIdData[rowid].row)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (afterFullRowMaps[rowid]) {
|
||||||
|
rowList.push(afterFullRowMaps[rowid])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ export function _t (key: string, args?: any) {
|
|||||||
export const setConfig: VxeGlobalConfigMethod = (options) => {
|
export const setConfig: VxeGlobalConfigMethod = (options) => {
|
||||||
if (options) {
|
if (options) {
|
||||||
if (options.theme) {
|
if (options.theme) {
|
||||||
setTheme(options)
|
setTheme(options.theme)
|
||||||
}
|
}
|
||||||
if (options.zIndex) {
|
if (options.zIndex) {
|
||||||
DomZIndex.setCurrent(options.zIndex)
|
DomZIndex.setCurrent(options.zIndex)
|
||||||
@@ -154,7 +154,7 @@ export const VXETable = {
|
|||||||
|
|
||||||
export const VxeUI = VXETable
|
export const VxeUI = VXETable
|
||||||
|
|
||||||
setTheme(globalStore)
|
setTheme('light')
|
||||||
|
|
||||||
export * from './src/interceptor'
|
export * from './src/interceptor'
|
||||||
export * from './src/renderer'
|
export * from './src/renderer'
|
||||||
|
|||||||
@@ -98,9 +98,16 @@ const GlobalConfig: VXETableConfigOptions = {
|
|||||||
showAsterisk: true
|
showAsterisk: true
|
||||||
},
|
},
|
||||||
importConfig: {
|
importConfig: {
|
||||||
|
_typeMaps: {},
|
||||||
modes: ['insert', 'covering']
|
modes: ['insert', 'covering']
|
||||||
},
|
},
|
||||||
exportConfig: {
|
exportConfig: {
|
||||||
|
_typeMaps: {
|
||||||
|
csv: 1,
|
||||||
|
html: 1,
|
||||||
|
xml: 1,
|
||||||
|
txt: 1
|
||||||
|
},
|
||||||
modes: ['current', 'selected']
|
modes: ['current', 'selected']
|
||||||
},
|
},
|
||||||
printConfig: {
|
printConfig: {
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
import GlobalConfig from './conf'
|
import GlobalConfig from './conf'
|
||||||
|
|
||||||
export function setTheme (options: any) {
|
export function setTheme (name: any) {
|
||||||
const theme = (options ? options.theme : null) || GlobalConfig.theme || 'default'
|
let theme = name || GlobalConfig.theme
|
||||||
|
if (!theme || theme === 'default') {
|
||||||
|
theme = 'light'
|
||||||
|
}
|
||||||
if (typeof document !== 'undefined') {
|
if (typeof document !== 'undefined') {
|
||||||
const documentElement = document.documentElement
|
const documentElement = document.documentElement
|
||||||
if (documentElement) {
|
if (documentElement) {
|
||||||
documentElement.setAttribute('data-vxe-table-theme', theme)
|
documentElement.setAttribute('data-vxe-ui-theme', theme)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,21 +112,21 @@ const validatorHook: VxeGlobalHooksHandles.HookOptions = {
|
|||||||
const treeOpts = computeTreeOpts.value
|
const treeOpts = computeTreeOpts.value
|
||||||
const childrenField = treeOpts.children || treeOpts.childrenField
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
||||||
const validOpts = computeValidOpts.value
|
const validOpts = computeValidOpts.value
|
||||||
let validDatas
|
let validList
|
||||||
if (rows === true) {
|
if (rows === true) {
|
||||||
validDatas = afterFullData
|
validList = afterFullData
|
||||||
} else if (rows) {
|
} else if (rows) {
|
||||||
if (XEUtils.isFunction(rows)) {
|
if (XEUtils.isFunction(rows)) {
|
||||||
cb = rows
|
cb = rows
|
||||||
} else {
|
} else {
|
||||||
validDatas = XEUtils.isArray(rows) ? rows : [rows]
|
validList = XEUtils.isArray(rows) ? rows : [rows]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!validDatas) {
|
if (!validList) {
|
||||||
if ($xetable.getInsertRecords) {
|
if ($xetable.getInsertRecords) {
|
||||||
validDatas = $xetable.getInsertRecords().concat($xetable.getUpdateRecords())
|
validList = $xetable.getInsertRecords().concat($xetable.getUpdateRecords())
|
||||||
} else {
|
} else {
|
||||||
validDatas = []
|
validList = []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const rowValidErrs: any = []
|
const rowValidErrs: any = []
|
||||||
@@ -181,9 +181,9 @@ const validatorHook: VxeGlobalHooksHandles.HookOptions = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (treeConfig) {
|
if (treeConfig) {
|
||||||
XEUtils.eachTree(validDatas, handleVaild, { children: childrenField })
|
XEUtils.eachTree(validList, handleVaild, { children: childrenField })
|
||||||
} else {
|
} else {
|
||||||
validDatas.forEach(handleVaild)
|
validList.forEach(handleVaild)
|
||||||
}
|
}
|
||||||
return Promise.all(rowValidErrs).then(() => {
|
return Promise.all(rowValidErrs).then(() => {
|
||||||
const ruleProps = Object.keys(validRest)
|
const ruleProps = Object.keys(validRest)
|
||||||
@@ -300,9 +300,9 @@ const validatorHook: VxeGlobalHooksHandles.HookOptions = {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
} else if (rowList.length) {
|
} else if (rowList.length) {
|
||||||
const rowidList = rowList.map(row => `${getRowid($xetable, row)}`)
|
const rowIdList = rowList.map(row => `${getRowid($xetable, row)}`)
|
||||||
XEUtils.each(validErrorMaps, (item, key) => {
|
XEUtils.each(validErrorMaps, (item, key) => {
|
||||||
if (rowidList.indexOf(key.split(':')[0]) > -1) {
|
if (rowIdList.indexOf(key.split(':')[0]) > -1) {
|
||||||
validErrMaps[key] = item
|
validErrMaps[key] = item
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -361,7 +361,7 @@ const validatorHook: VxeGlobalHooksHandles.HookOptions = {
|
|||||||
const { editRules } = props
|
const { editRules } = props
|
||||||
const { field } = column
|
const { field } = column
|
||||||
const errorRules: Rule[] = []
|
const errorRules: Rule[] = []
|
||||||
const syncVailds: Promise<any>[] = []
|
const syncValidList: Promise<any>[] = []
|
||||||
if (field && editRules) {
|
if (field && editRules) {
|
||||||
const rules = XEUtils.get(editRules, field)
|
const rules = XEUtils.get(editRules, field)
|
||||||
if (rules) {
|
if (rules) {
|
||||||
@@ -407,7 +407,7 @@ const validatorHook: VxeGlobalHooksHandles.HookOptions = {
|
|||||||
errorRules.push(new Rule({ type: 'custom', trigger, content: customValid.message, rule: new Rule(rule) }))
|
errorRules.push(new Rule({ type: 'custom', trigger, content: customValid.message, rule: new Rule(rule) }))
|
||||||
} else if (customValid.catch) {
|
} else if (customValid.catch) {
|
||||||
// 如果为异步校验(注:异步校验是并发无序的)
|
// 如果为异步校验(注:异步校验是并发无序的)
|
||||||
syncVailds.push(
|
syncValidList.push(
|
||||||
customValid.catch((e: any) => {
|
customValid.catch((e: any) => {
|
||||||
validRuleErr = true
|
validRuleErr = true
|
||||||
errorRules.push(new Rule({ type: 'custom', trigger, content: e && e.message ? e.message : (rule.content || rule.message), rule: new Rule(rule) }))
|
errorRules.push(new Rule({ type: 'custom', trigger, content: e && e.message ? e.message : (rule.content || rule.message), rule: new Rule(rule) }))
|
||||||
@@ -435,7 +435,7 @@ const validatorHook: VxeGlobalHooksHandles.HookOptions = {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Promise.all(syncVailds).then(() => {
|
return Promise.all(syncValidList).then(() => {
|
||||||
if (errorRules.length) {
|
if (errorRules.length) {
|
||||||
const rest = { rules: errorRules, rule: errorRules[0] }
|
const rest = { rules: errorRules, rule: errorRules[0] }
|
||||||
return Promise.reject(rest)
|
return Promise.reject(rest)
|
||||||
|
|||||||
@@ -608,7 +608,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
&.cell--area {
|
&.cell--area {
|
||||||
.vxe-table--main-wrapper {
|
.vxe-body--row {
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
@import '../variable.scss';
|
@import '../variable.scss';
|
||||||
|
|
||||||
[data-vxe-table-theme="dark"] {
|
[data-vxe-ui-theme="dark"] {
|
||||||
color-scheme: dark;
|
color-scheme: dark;
|
||||||
|
|
||||||
/*font*/
|
/*font*/
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
@import '../variable.scss';
|
@import '../variable.scss';
|
||||||
|
|
||||||
[data-vxe-table-theme="default"] {
|
[data-vxe-ui-theme="light"] {
|
||||||
/*font*/
|
/*font*/
|
||||||
--vxe-font-family: #{$vxe-font-family};
|
--vxe-font-family: #{$vxe-font-family};
|
||||||
--vxe-font-size: #{$vxe-font-size};
|
--vxe-font-size: #{$vxe-font-size};
|
||||||
|
|||||||
6
types/module/export.d.ts
vendored
6
types/module/export.d.ts
vendored
@@ -86,6 +86,9 @@ declare module '../table' {
|
|||||||
* 导入参数
|
* 导入参数
|
||||||
*/
|
*/
|
||||||
export interface ImportConfig {
|
export interface ImportConfig {
|
||||||
|
// 内置属性
|
||||||
|
_typeMaps?: Record<string, number>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 可选文件类型列表
|
* 可选文件类型列表
|
||||||
*/
|
*/
|
||||||
@@ -142,6 +145,9 @@ declare module '../table' {
|
|||||||
* 导出参数
|
* 导出参数
|
||||||
*/
|
*/
|
||||||
export interface ExportConfig {
|
export interface ExportConfig {
|
||||||
|
// 内置属性
|
||||||
|
_typeMaps?: Record<string, number>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件名
|
* 文件名
|
||||||
*/
|
*/
|
||||||
|
|||||||
3
types/v-x-e-table/index.d.ts
vendored
3
types/v-x-e-table/index.d.ts
vendored
@@ -94,6 +94,7 @@ export interface VxeGlobalIcon {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export type VxeGlobalConfigMethod = (options?: VXETableConfigOptions) => VXETableCore
|
export type VxeGlobalConfigMethod = (options?: VXETableConfigOptions) => VXETableCore
|
||||||
|
export type VxeGlobalThemeMethod = (name?: '' | 'light' | 'dark') => VXETableCore
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请使用 setConfig
|
* 请使用 setConfig
|
||||||
@@ -133,6 +134,7 @@ export type VxeGlobalTranslate = (key: string, args?: any) => string
|
|||||||
export type VxeGlobalUse = (plugin: VXETablePluginObject, ...options: any[]) => VXETableCore
|
export type VxeGlobalUse = (plugin: VXETablePluginObject, ...options: any[]) => VXETableCore
|
||||||
|
|
||||||
export const setConfig: VxeGlobalConfigMethod
|
export const setConfig: VxeGlobalConfigMethod
|
||||||
|
export const setTheme: VxeGlobalThemeMethod
|
||||||
export const interceptor: VxeGlobalInterceptor
|
export const interceptor: VxeGlobalInterceptor
|
||||||
export const renderer: VxeGlobalRenderer
|
export const renderer: VxeGlobalRenderer
|
||||||
export const commands: VxeGlobalCommands
|
export const commands: VxeGlobalCommands
|
||||||
@@ -194,6 +196,7 @@ export interface VXETableCore {
|
|||||||
* 设置全局参数/获取所有参数
|
* 设置全局参数/获取所有参数
|
||||||
*/
|
*/
|
||||||
setConfig: VxeGlobalConfigMethod
|
setConfig: VxeGlobalConfigMethod
|
||||||
|
setTheme: VxeGlobalThemeMethod
|
||||||
setIcon: typeof setIcon
|
setIcon: typeof setIcon
|
||||||
/**
|
/**
|
||||||
* 读取内部数据
|
* 读取内部数据
|
||||||
|
|||||||
Reference in New Issue
Block a user