vxe-table 4.15.4 → 4.15.6
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/README.en.md +2 -6
- package/README.ja-JP.md +2 -6
- package/README.md +8 -10
- package/README.zh-TW.md +2 -6
- package/es/grid/src/emits.js +16 -0
- package/es/grid/src/grid.js +77 -62
- package/es/grid/src/props.js +7 -0
- package/es/style.css +1 -1
- package/es/table/index.js +0 -8
- package/es/table/module/custom/hook.js +3 -0
- package/es/table/module/edit/hook.js +3 -0
- package/es/table/module/export/hook.js +6 -1
- package/es/table/module/filter/hook.js +3 -0
- package/es/table/module/menu/hook.js +3 -0
- package/es/table/module/validator/hook.js +3 -0
- package/es/table/src/emits.js +1 -1
- package/es/table/src/header.js +2 -2
- package/es/table/src/props.js +1 -1
- package/es/table/src/table.js +161 -63
- package/es/table/src/util.js +1 -14
- package/es/toolbar/src/toolbar.js +2 -2
- package/es/ui/index.js +13 -4
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/emits.js +8 -0
- package/lib/grid/src/emits.min.js +1 -0
- package/lib/grid/src/grid.js +78 -54
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/grid/src/props.js +24 -0
- package/lib/grid/src/props.min.js +1 -0
- package/lib/index.umd.js +12073 -12008
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/index.js +0 -8
- package/lib/table/index.min.js +1 -1
- package/lib/table/module/custom/hook.js +3 -0
- package/lib/table/module/custom/hook.min.js +1 -1
- package/lib/table/module/edit/hook.js +3 -0
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/module/export/hook.js +8 -1
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/module/filter/hook.js +3 -0
- package/lib/table/module/filter/hook.min.js +1 -1
- package/lib/table/module/menu/hook.js +3 -0
- package/lib/table/module/menu/hook.min.js +1 -1
- package/lib/table/module/validator/hook.js +3 -0
- package/lib/table/module/validator/hook.min.js +1 -1
- package/lib/table/src/emits.js +2 -2
- package/lib/table/src/emits.min.js +1 -1
- package/lib/table/src/header.js +2 -2
- package/lib/table/src/props.js +2 -2
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +33 -26
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +1 -14
- package/lib/table/src/util.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +2 -0
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/ui/index.js +12 -3
- 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/package.json +1 -1
- package/packages/grid/src/emits.ts +19 -0
- package/packages/grid/src/grid.ts +89 -85
- package/packages/grid/src/props.ts +23 -0
- package/packages/table/index.ts +0 -8
- package/packages/table/module/custom/hook.ts +3 -0
- package/packages/table/module/edit/hook.ts +3 -0
- package/packages/table/module/export/hook.ts +8 -3
- package/packages/table/module/filter/hook.ts +3 -0
- package/packages/table/module/menu/hook.ts +3 -0
- package/packages/table/module/validator/hook.ts +3 -0
- package/packages/table/src/emits.ts +2 -2
- package/packages/table/src/header.ts +5 -5
- package/packages/table/src/props.ts +1 -1
- package/packages/table/src/table.ts +167 -66
- package/packages/table/src/util.ts +1 -14
- package/packages/toolbar/src/toolbar.ts +2 -2
- package/packages/ui/index.ts +12 -2
- package/packages/ui/src/dom.ts +1 -1
- package/styles/cssvar.scss +0 -2
- /package/es/{iconfont.1754457119712.ttf → iconfont.1754905357789.ttf} +0 -0
- /package/es/{iconfont.1754457119712.woff → iconfont.1754905357789.woff} +0 -0
- /package/es/{iconfont.1754457119712.woff2 → iconfont.1754905357789.woff2} +0 -0
- /package/lib/{iconfont.1754457119712.ttf → iconfont.1754905357789.ttf} +0 -0
- /package/lib/{iconfont.1754457119712.woff → iconfont.1754905357789.woff} +0 -0
- /package/lib/{iconfont.1754457119712.woff2 → iconfont.1754905357789.woff2} +0 -0
package/README.en.md
CHANGED
|
@@ -34,15 +34,11 @@ Get on [unpkg](https://unpkg.com/vxe-table/) and [cdnjs](https://cdn.jsdelivr.ne
|
|
|
34
34
|
|
|
35
35
|
```javascript
|
|
36
36
|
// ...
|
|
37
|
-
import
|
|
37
|
+
import VxeUITable from 'vxe-table'
|
|
38
38
|
import 'vxe-table/lib/style.css'
|
|
39
39
|
// ...
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
import 'vxe-pc-ui/lib/style.css'
|
|
43
|
-
// ...
|
|
44
|
-
|
|
45
|
-
createApp(App).use(VxeUI).use(VxeTable).mount('#app')
|
|
41
|
+
createApp(App).use(VxeUITable).mount('#app')
|
|
46
42
|
```
|
|
47
43
|
|
|
48
44
|
### CDN
|
package/README.ja-JP.md
CHANGED
|
@@ -34,15 +34,11 @@ npm install vxe-table@next
|
|
|
34
34
|
|
|
35
35
|
```javascript
|
|
36
36
|
// ...
|
|
37
|
-
import
|
|
37
|
+
import VxeUITable from 'vxe-table'
|
|
38
38
|
import 'vxe-table/lib/style.css'
|
|
39
39
|
// ...
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
import 'vxe-pc-ui/lib/style.css'
|
|
43
|
-
// ...
|
|
44
|
-
|
|
45
|
-
createApp(App).use(VxeUI).use(VxeTable).mount('#app')
|
|
41
|
+
createApp(App).use(VxeUITable).mount('#app')
|
|
46
42
|
```
|
|
47
43
|
|
|
48
44
|
### CDN
|
package/README.md
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
* 版本说明
|
|
23
23
|
* **V4**
|
|
24
|
+
* [x] v3.16 适配 Gantt 甘特图
|
|
24
25
|
* [x] v4.14 重构虚拟渲染,提高渲染与拖拽效果流畅度
|
|
25
26
|
* [x] v4.13 优化虚拟渲染,提升 Chrome、Safari、Firefox 流畅度极兼容性
|
|
26
27
|
* [x] v4.12 重构虚拟渲染,支持百万级数据渲染、渲染性能及流畅度大幅提升
|
|
@@ -28,16 +29,17 @@
|
|
|
28
29
|
* [x] v4.7 基于 vue3.2+,内部重构,拆分 Table 库和 UI 库,只支持现代浏览器,不支持 IE
|
|
29
30
|
* [x] ~~v4.0 基于 vue3.2+,只支持现代浏览器,不支持 IE(2020-03-01 ~ 2024-12-01 已停止维护)~~
|
|
30
31
|
* **V3**
|
|
32
|
+
* [x] v3.18 适配 Gantt 甘特图
|
|
31
33
|
* [x] v3.16 重构虚拟渲染,提高渲染与拖拽效果流畅度
|
|
32
34
|
* [x] v3.15 优化虚拟渲染,提升 Chrome、Safari、Firefox 流畅度极兼容性
|
|
33
35
|
* [x] v3.14 重构虚拟渲染,支持百万级数据渲染、渲染性能及流畅度大幅提升
|
|
34
36
|
* [x] v3.13 重构展开行功能,同时支持展开行与虚拟渲染和冻结列
|
|
35
|
-
* [x] v3.9 基于 vue2.6
|
|
36
|
-
* [x] ~~v3.0 基于 vue2.6
|
|
37
|
+
* [x] v3.9 基于 vue2.6~2.7,内部重构,拆分 Table 库和 UI 库,只支持现代浏览器,不支持 IE
|
|
38
|
+
* [x] ~~v3.0 基于 vue2.6~2.7,支持现代浏览器并保留兼容 IE11(2020-03-01 ~ 2024-12-01 已停止维护)~~
|
|
37
39
|
* **V2**
|
|
38
|
-
* [x] ~~v2.0 基于 vue2.6,支持所有主流的浏览器,同时兼具功能与性能(2019-03-01 ~ 2021-12-01 已停止维护)~~
|
|
40
|
+
* [x] ~~v2.0 基于 vue2.6~2.7,支持所有主流的浏览器,同时兼具功能与性能(2019-03-01 ~ 2021-12-01 已停止维护)~~
|
|
39
41
|
* **V1**
|
|
40
|
-
* [x] ~~v1.0 基于 vue2.6,支持所有主流的浏览器,实现表格的一切实用的功能(2018-02-01 ~ 2020-04-01 已停止维护)~~
|
|
42
|
+
* [x] ~~v1.0 基于 vue2.6~2.7,支持所有主流的浏览器,实现表格的一切实用的功能(2018-02-01 ~ 2020-04-01 已停止维护)~~
|
|
41
43
|
* 版本计划
|
|
42
44
|
* [x] 优化展开行与冻结列
|
|
43
45
|
* [ ] 优化虚拟渲染,支持千万级数据渲染
|
|
@@ -128,15 +130,11 @@ Get on [unpkg](https://unpkg.com/vxe-table/) and [cdnjs](https://cdn.jsdelivr.ne
|
|
|
128
130
|
|
|
129
131
|
```javascript
|
|
130
132
|
// ...
|
|
131
|
-
import
|
|
133
|
+
import VxeUITable from 'vxe-table'
|
|
132
134
|
import 'vxe-table/lib/style.css'
|
|
133
135
|
// ...
|
|
134
136
|
|
|
135
|
-
|
|
136
|
-
import 'vxe-pc-ui/lib/style.css'
|
|
137
|
-
// ...
|
|
138
|
-
|
|
139
|
-
createApp(App).use(VxeUIAll).use(VxeTable).mount('#app')
|
|
137
|
+
createApp(App).use(VxeUITable).mount('#app')
|
|
140
138
|
```
|
|
141
139
|
|
|
142
140
|
### CDN
|
package/README.zh-TW.md
CHANGED
|
@@ -34,15 +34,11 @@ Get on [unpkg](https://unpkg.com/vxe-table/) and [cdnjs](https://cdn.jsdelivr.ne
|
|
|
34
34
|
|
|
35
35
|
```javascript
|
|
36
36
|
// ...
|
|
37
|
-
import
|
|
37
|
+
import VxeUITable from 'vxe-table'
|
|
38
38
|
import 'vxe-table/lib/style.css'
|
|
39
39
|
// ...
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
import 'vxe-pc-ui/lib/style.css'
|
|
43
|
-
// ...
|
|
44
|
-
|
|
45
|
-
createApp(App).use(VxeUI).use(VxeTable).mount('#app')
|
|
41
|
+
createApp(App).use(VxeUITable).mount('#app')
|
|
46
42
|
```
|
|
47
43
|
|
|
48
44
|
### CDN
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { tableEmits } from '../../table/src/emits';
|
|
2
|
+
export const gridEmits = [
|
|
3
|
+
...tableEmits,
|
|
4
|
+
'page-change',
|
|
5
|
+
'form-submit',
|
|
6
|
+
'form-submit-invalid',
|
|
7
|
+
'form-reset',
|
|
8
|
+
'form-collapse',
|
|
9
|
+
'form-toggle-collapse',
|
|
10
|
+
'proxy-query',
|
|
11
|
+
'proxy-delete',
|
|
12
|
+
'proxy-save',
|
|
13
|
+
'toolbar-button-click',
|
|
14
|
+
'toolbar-tool-click',
|
|
15
|
+
'zoom'
|
|
16
|
+
];
|
package/es/grid/src/grid.js
CHANGED
|
@@ -4,42 +4,24 @@ import XEUtils from 'xe-utils';
|
|
|
4
4
|
import { getLastZIndex, nextZIndex, isEnableConf } from '../../ui/src/utils';
|
|
5
5
|
import { getOffsetHeight, getPaddingTopBottomSize, getDomNode, toCssUnit } from '../../ui/src/dom';
|
|
6
6
|
import { VxeUI } from '../../ui';
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import tableComponentProps from '../../table/src/props';
|
|
10
|
-
import tableComponentEmits from '../../table/src/emits';
|
|
7
|
+
import { gridProps } from './props';
|
|
8
|
+
import { gridEmits } from './emits';
|
|
11
9
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
12
10
|
import { warnLog, errLog } from '../../ui/src/log';
|
|
11
|
+
import { tableEmits } from '../../table/src/emits';
|
|
12
|
+
import { tableProps } from '../../table/src/props';
|
|
13
|
+
import VxeTableComponent from '../../table/src/table';
|
|
14
|
+
import VxeToolbarComponent from '../../toolbar/src/toolbar';
|
|
13
15
|
const { getConfig, getI18n, commands, hooks, useFns, createEvent, globalEvents, GLOBAL_EVENT_KEYS, renderEmptyElement } = VxeUI;
|
|
14
|
-
const tableComponentPropKeys = Object.keys(
|
|
15
|
-
const tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isRemoveByRow', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeRowChildren', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'setRowHeightConf', 'getRowHeightConf', 'setRowHeight', 'getRowHeight', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'hasPendingByRow', 'isPendingByRow', 'getPendingRecords', 'clearPendingRow', 'setFilterByEvent', 'sort', 'setSort', 'setSortByEvent', 'clearSort', 'clearSortByEvent', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'clearFilterByEvent', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'scrollTo', 'scrollToRow', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'getCustomStoreData', 'setRowGroupExpand', 'setAllRowGroupExpand', 'clearRowGroupExpand', 'isRowGroupExpandByRow', 'isRowGroupRecord', 'isAggregateRecord', 'isAggregateExpandByRow', 'getAggregateContentByRow', 'getAggregateRowChildren', 'setRowGroups', 'clearRowGroups', 'openTooltip', 'moveColumnTo', 'moveRowTo', 'getCellLabel', 'getCellElement', 'focus', 'blur', 'connect'];
|
|
16
|
-
const gridComponentEmits = [
|
|
17
|
-
...tableComponentEmits,
|
|
18
|
-
'page-change',
|
|
19
|
-
'form-submit',
|
|
20
|
-
'form-submit-invalid',
|
|
21
|
-
'form-reset',
|
|
22
|
-
'form-collapse',
|
|
23
|
-
'form-toggle-collapse',
|
|
24
|
-
'proxy-query',
|
|
25
|
-
'proxy-delete',
|
|
26
|
-
'proxy-save',
|
|
27
|
-
'toolbar-button-click',
|
|
28
|
-
'toolbar-tool-click',
|
|
29
|
-
'zoom'
|
|
30
|
-
];
|
|
16
|
+
const tableComponentPropKeys = Object.keys(tableProps);
|
|
17
|
+
const tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isRemoveByRow', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeRowChildren', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'recalcRowHeight', 'setRowHeightConf', 'getRowHeightConf', 'setRowHeight', 'getRowHeight', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'hasPendingByRow', 'isPendingByRow', 'getPendingRecords', 'clearPendingRow', 'setFilterByEvent', 'sort', 'setSort', 'setSortByEvent', 'clearSort', 'clearSortByEvent', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'clearFilterByEvent', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'scrollTo', 'scrollToRow', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'getCustomStoreData', 'setRowGroupExpand', 'setAllRowGroupExpand', 'clearRowGroupExpand', 'isRowGroupExpandByRow', 'isRowGroupRecord', 'isAggregateRecord', 'isAggregateExpandByRow', 'getAggregateContentByRow', 'getAggregateRowChildren', 'setRowGroups', 'clearRowGroups', 'openTooltip', 'moveColumnTo', 'moveRowTo', 'getCellLabel', 'getCellElement', 'focus', 'blur', 'connect', 'connectToolbar'];
|
|
31
18
|
function createInternalData() {
|
|
32
|
-
return {
|
|
33
|
-
connectTable: null
|
|
34
|
-
};
|
|
19
|
+
return {};
|
|
35
20
|
}
|
|
36
21
|
export default defineVxeComponent({
|
|
37
22
|
name: 'VxeGrid',
|
|
38
|
-
props:
|
|
39
|
-
|
|
40
|
-
default: () => getConfig().grid.size || getConfig().size
|
|
41
|
-
} }),
|
|
42
|
-
emits: gridComponentEmits,
|
|
23
|
+
props: gridProps,
|
|
24
|
+
emits: gridEmits,
|
|
43
25
|
setup(props, context) {
|
|
44
26
|
var _a;
|
|
45
27
|
const { slots, emit } = context;
|
|
@@ -138,9 +120,8 @@ export default defineVxeComponent({
|
|
|
138
120
|
});
|
|
139
121
|
const computeTableExtendProps = computed(() => {
|
|
140
122
|
const rest = {};
|
|
141
|
-
const gridProps = props;
|
|
142
123
|
tableComponentPropKeys.forEach((key) => {
|
|
143
|
-
rest[key] =
|
|
124
|
+
rest[key] = props[key];
|
|
144
125
|
});
|
|
145
126
|
return rest;
|
|
146
127
|
});
|
|
@@ -252,7 +233,7 @@ export default defineVxeComponent({
|
|
|
252
233
|
const $xeTable = refTable.value;
|
|
253
234
|
const $xeToolbar = refToolbar.value;
|
|
254
235
|
if ($xeTable && $xeToolbar) {
|
|
255
|
-
$xeTable.
|
|
236
|
+
$xeTable.connectToolbar($xeToolbar);
|
|
256
237
|
}
|
|
257
238
|
});
|
|
258
239
|
}
|
|
@@ -291,10 +272,12 @@ export default defineVxeComponent({
|
|
|
291
272
|
const triggerPendingEvent = (code) => {
|
|
292
273
|
const isActiveMsg = computeIsActiveMsg.value;
|
|
293
274
|
const $xeTable = refTable.value;
|
|
294
|
-
const selectRecords = $xeTable.getCheckboxRecords();
|
|
275
|
+
const selectRecords = $xeTable ? $xeTable.getCheckboxRecords() : [];
|
|
295
276
|
if (selectRecords.length) {
|
|
296
|
-
$xeTable
|
|
297
|
-
|
|
277
|
+
if ($xeTable) {
|
|
278
|
+
$xeTable.togglePendingRow(selectRecords);
|
|
279
|
+
}
|
|
280
|
+
$xeGrid.clearCheckboxRow();
|
|
298
281
|
}
|
|
299
282
|
else {
|
|
300
283
|
if (isActiveMsg) {
|
|
@@ -308,15 +291,16 @@ export default defineVxeComponent({
|
|
|
308
291
|
const proxyOpts = computeProxyOpts.value;
|
|
309
292
|
const resConfigs = proxyOpts.response || proxyOpts.props || {};
|
|
310
293
|
const messageProp = resConfigs.message;
|
|
294
|
+
const $xeTable = refTable.value;
|
|
311
295
|
let msg;
|
|
312
296
|
if (rest && messageProp) {
|
|
313
|
-
msg = XEUtils.isFunction(messageProp) ? messageProp({ data: rest, $grid: $xeGrid }) : XEUtils.get(rest, messageProp);
|
|
297
|
+
msg = XEUtils.isFunction(messageProp) ? messageProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: null }) : XEUtils.get(rest, messageProp);
|
|
314
298
|
}
|
|
315
299
|
return msg || getI18n(defaultMsg);
|
|
316
300
|
};
|
|
317
301
|
const handleDeleteRow = (code, alertKey, callback) => {
|
|
318
302
|
const isActiveMsg = computeIsActiveMsg.value;
|
|
319
|
-
const selectRecords =
|
|
303
|
+
const selectRecords = $xeGrid.getCheckboxRecords();
|
|
320
304
|
if (isActiveMsg) {
|
|
321
305
|
if (selectRecords.length) {
|
|
322
306
|
if (VxeUI.modal) {
|
|
@@ -357,6 +341,9 @@ export default defineVxeComponent({
|
|
|
357
341
|
const handleSortEvent = (params) => {
|
|
358
342
|
const $xeTable = refTable.value;
|
|
359
343
|
const { proxyConfig } = props;
|
|
344
|
+
if (!$xeTable) {
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
360
347
|
const { computeSortOpts } = $xeTable.getComputeMaps();
|
|
361
348
|
const proxyOpts = computeProxyOpts.value;
|
|
362
349
|
const sortOpts = computeSortOpts.value;
|
|
@@ -382,6 +369,9 @@ export default defineVxeComponent({
|
|
|
382
369
|
const handleFilterEvent = (params) => {
|
|
383
370
|
const $xeTable = refTable.value;
|
|
384
371
|
const { proxyConfig } = props;
|
|
372
|
+
if (!$xeTable) {
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
385
375
|
const { computeFilterOpts } = $xeTable.getComputeMaps();
|
|
386
376
|
const proxyOpts = computeProxyOpts.value;
|
|
387
377
|
const filterOpts = computeFilterOpts.value;
|
|
@@ -423,7 +413,9 @@ export default defineVxeComponent({
|
|
|
423
413
|
const { $event } = params;
|
|
424
414
|
const proxyOpts = computeProxyOpts.value;
|
|
425
415
|
if (proxyConfig && isEnableConf(proxyOpts)) {
|
|
426
|
-
$xeTable
|
|
416
|
+
if ($xeTable) {
|
|
417
|
+
$xeTable.clearScroll();
|
|
418
|
+
}
|
|
427
419
|
$xeGrid.commitProxy('reload').then((rest) => {
|
|
428
420
|
$xeGrid.dispatchEvent('proxy-query', Object.assign(Object.assign({}, rest), { isReload: true }), $event);
|
|
429
421
|
});
|
|
@@ -500,7 +492,7 @@ export default defineVxeComponent({
|
|
|
500
492
|
if ((formConfig && isEnableConf(formOpts)) || slots.form) {
|
|
501
493
|
let slotVNs = [];
|
|
502
494
|
if (slots.form) {
|
|
503
|
-
slotVNs = slots.form({ $grid: $xeGrid });
|
|
495
|
+
slotVNs = slots.form({ $grid: $xeGrid, $gantt: null });
|
|
504
496
|
}
|
|
505
497
|
else {
|
|
506
498
|
if (formOpts.items) {
|
|
@@ -510,7 +502,7 @@ export default defineVxeComponent({
|
|
|
510
502
|
const beforeItem = proxyOpts.beforeItem;
|
|
511
503
|
if (proxyOpts && beforeItem) {
|
|
512
504
|
formOpts.items.forEach((item) => {
|
|
513
|
-
beforeItem({ $grid: $xeGrid, item });
|
|
505
|
+
beforeItem({ $grid: $xeGrid, $gantt: null, item });
|
|
514
506
|
});
|
|
515
507
|
}
|
|
516
508
|
}
|
|
@@ -548,7 +540,7 @@ export default defineVxeComponent({
|
|
|
548
540
|
if ((toolbarConfig && isEnableConf(toolbarOpts)) || slots.toolbar) {
|
|
549
541
|
let slotVNs = [];
|
|
550
542
|
if (slots.toolbar) {
|
|
551
|
-
slotVNs = slots.toolbar({ $grid: $xeGrid });
|
|
543
|
+
slotVNs = slots.toolbar({ $grid: $xeGrid, $gantt: null });
|
|
552
544
|
}
|
|
553
545
|
else {
|
|
554
546
|
const toolbarOptSlots = toolbarOpts.slots;
|
|
@@ -599,7 +591,7 @@ export default defineVxeComponent({
|
|
|
599
591
|
ref: refTopWrapper,
|
|
600
592
|
key: 'top',
|
|
601
593
|
class: 'vxe-grid--top-wrapper'
|
|
602
|
-
}, topSlot({ $grid: $xeGrid }));
|
|
594
|
+
}, topSlot({ $grid: $xeGrid, $gantt: null }));
|
|
603
595
|
}
|
|
604
596
|
return renderEmptyElement($xeGrid);
|
|
605
597
|
};
|
|
@@ -608,7 +600,7 @@ export default defineVxeComponent({
|
|
|
608
600
|
if (leftSlot) {
|
|
609
601
|
return h('div', {
|
|
610
602
|
class: 'vxe-grid--left-wrapper'
|
|
611
|
-
}, leftSlot({ $grid: $xeGrid }));
|
|
603
|
+
}, leftSlot({ $grid: $xeGrid, $gantt: null }));
|
|
612
604
|
}
|
|
613
605
|
return renderEmptyElement($xeGrid);
|
|
614
606
|
};
|
|
@@ -617,7 +609,7 @@ export default defineVxeComponent({
|
|
|
617
609
|
if (rightSlot) {
|
|
618
610
|
return h('div', {
|
|
619
611
|
class: 'vxe-grid--right-wrapper'
|
|
620
|
-
}, rightSlot({ $grid: $xeGrid }));
|
|
612
|
+
}, rightSlot({ $grid: $xeGrid, $gantt: null }));
|
|
621
613
|
}
|
|
622
614
|
return renderEmptyElement($xeGrid);
|
|
623
615
|
};
|
|
@@ -671,7 +663,7 @@ export default defineVxeComponent({
|
|
|
671
663
|
ref: refBottomWrapper,
|
|
672
664
|
key: 'bottom',
|
|
673
665
|
class: 'vxe-grid--bottom-wrapper'
|
|
674
|
-
}, slots.bottom({ $grid: $xeGrid }));
|
|
666
|
+
}, slots.bottom({ $grid: $xeGrid, $gantt: null }));
|
|
675
667
|
}
|
|
676
668
|
return renderEmptyElement($xeGrid);
|
|
677
669
|
};
|
|
@@ -689,7 +681,7 @@ export default defineVxeComponent({
|
|
|
689
681
|
key: 'pager',
|
|
690
682
|
class: 'vxe-grid--pager-wrapper'
|
|
691
683
|
}, pagerSlot
|
|
692
|
-
? pagerSlot({ $grid: $xeGrid })
|
|
684
|
+
? pagerSlot({ $grid: $xeGrid, $gantt: null })
|
|
693
685
|
: [
|
|
694
686
|
VxeUIPagerComponent
|
|
695
687
|
? h(VxeUIPagerComponent, Object.assign(Object.assign(Object.assign({ ref: refPager }, pagerOpts), (proxyConfig && isEnableConf(proxyOpts) ? reactData.tablePage : {})), { onPageChange: pageChangeEvent }), getConfigSlot(pagerOpts.slots))
|
|
@@ -766,7 +758,7 @@ export default defineVxeComponent({
|
|
|
766
758
|
];
|
|
767
759
|
};
|
|
768
760
|
const tableCompEvents = {};
|
|
769
|
-
|
|
761
|
+
tableEmits.forEach(name => {
|
|
770
762
|
const type = XEUtils.camelCase(`on-${name}`);
|
|
771
763
|
tableCompEvents[type] = (...args) => emit(name, ...args);
|
|
772
764
|
});
|
|
@@ -806,8 +798,8 @@ export default defineVxeComponent({
|
|
|
806
798
|
if (!proxyInited) {
|
|
807
799
|
reactData.proxyInited = true;
|
|
808
800
|
if (proxyOpts.autoLoad !== false) {
|
|
809
|
-
nextTick().then(() =>
|
|
810
|
-
|
|
801
|
+
nextTick().then(() => $xeGrid.commitProxy('initial')).then((rest) => {
|
|
802
|
+
dispatchEvent('proxy-query', Object.assign(Object.assign({}, rest), { isInited: true }), new Event('initial'));
|
|
811
803
|
});
|
|
812
804
|
}
|
|
813
805
|
}
|
|
@@ -821,7 +813,7 @@ export default defineVxeComponent({
|
|
|
821
813
|
}
|
|
822
814
|
};
|
|
823
815
|
const dispatchEvent = (type, params, evnt) => {
|
|
824
|
-
emit(type, createEvent(evnt, { $grid: $xeGrid }, params));
|
|
816
|
+
emit(type, createEvent(evnt, { $grid: $xeGrid, $gantt: null }, params));
|
|
825
817
|
};
|
|
826
818
|
const gridMethods = {
|
|
827
819
|
dispatchEvent,
|
|
@@ -843,6 +835,9 @@ export default defineVxeComponent({
|
|
|
843
835
|
const { beforeQuery, afterQuery, beforeDelete, afterDelete, beforeSave, afterSave, ajax = {} } = proxyOpts;
|
|
844
836
|
const resConfigs = proxyOpts.response || proxyOpts.props || {};
|
|
845
837
|
const $xeTable = refTable.value;
|
|
838
|
+
if (!$xeTable) {
|
|
839
|
+
return nextTick();
|
|
840
|
+
}
|
|
846
841
|
let formData = getFormData();
|
|
847
842
|
let button = null;
|
|
848
843
|
let code = null;
|
|
@@ -960,11 +955,13 @@ export default defineVxeComponent({
|
|
|
960
955
|
}
|
|
961
956
|
}
|
|
962
957
|
const commitParams = {
|
|
958
|
+
$table: $xeTable,
|
|
959
|
+
$grid: $xeGrid,
|
|
960
|
+
$gantt: null,
|
|
963
961
|
code,
|
|
964
962
|
button,
|
|
965
963
|
isInited,
|
|
966
964
|
isReload,
|
|
967
|
-
$grid: $xeGrid,
|
|
968
965
|
page: pageParams,
|
|
969
966
|
sort: sortList.length ? sortList[0] : {},
|
|
970
967
|
sorts: sortList,
|
|
@@ -982,10 +979,10 @@ export default defineVxeComponent({
|
|
|
982
979
|
if (rest) {
|
|
983
980
|
if (pagerConfig && isEnableConf(pagerOpts)) {
|
|
984
981
|
const totalProp = resConfigs.total;
|
|
985
|
-
const total = (XEUtils.isFunction(totalProp) ? totalProp({ data: rest, $grid: $xeGrid }) : XEUtils.get(rest, totalProp || 'page.total')) || 0;
|
|
982
|
+
const total = (XEUtils.isFunction(totalProp) ? totalProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: null }) : XEUtils.get(rest, totalProp || 'page.total')) || 0;
|
|
986
983
|
tablePage.total = XEUtils.toNumber(total);
|
|
987
984
|
const resultProp = resConfigs.result;
|
|
988
|
-
tableData = (XEUtils.isFunction(resultProp) ? resultProp({ data: rest, $grid: $xeGrid }) : XEUtils.get(rest, resultProp || 'result')) || [];
|
|
985
|
+
tableData = (XEUtils.isFunction(resultProp) ? resultProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: null }) : XEUtils.get(rest, resultProp || 'result')) || [];
|
|
989
986
|
// 检验当前页码,不能超出当前最大页数
|
|
990
987
|
const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1);
|
|
991
988
|
if (tablePage.currentPage > pageCount) {
|
|
@@ -994,7 +991,7 @@ export default defineVxeComponent({
|
|
|
994
991
|
}
|
|
995
992
|
else {
|
|
996
993
|
const listProp = resConfigs.list;
|
|
997
|
-
tableData = (listProp ? (XEUtils.isFunction(listProp) ? listProp({ data: rest, $grid: $xeGrid }) : XEUtils.get(rest, listProp)) : rest) || [];
|
|
994
|
+
tableData = (listProp ? (XEUtils.isFunction(listProp) ? listProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: null }) : XEUtils.get(rest, listProp)) : rest) || [];
|
|
998
995
|
}
|
|
999
996
|
}
|
|
1000
997
|
if ($xeTable) {
|
|
@@ -1032,10 +1029,19 @@ export default defineVxeComponent({
|
|
|
1032
1029
|
const deleteSuccessMethods = ajax.deleteSuccess;
|
|
1033
1030
|
const deleteErrorMethods = ajax.deleteError;
|
|
1034
1031
|
if (ajaxMethods) {
|
|
1035
|
-
const selectRecords =
|
|
1032
|
+
const selectRecords = $xeGrid.getCheckboxRecords();
|
|
1036
1033
|
const removeRecords = selectRecords.filter(row => !$xeTable.isInsertByRow(row));
|
|
1037
1034
|
const body = { removeRecords };
|
|
1038
|
-
const commitParams = {
|
|
1035
|
+
const commitParams = {
|
|
1036
|
+
$table: $xeTable,
|
|
1037
|
+
$grid: $xeGrid,
|
|
1038
|
+
$gantt: null,
|
|
1039
|
+
code,
|
|
1040
|
+
button,
|
|
1041
|
+
body,
|
|
1042
|
+
form: formData,
|
|
1043
|
+
options: ajaxMethods
|
|
1044
|
+
};
|
|
1039
1045
|
if (selectRecords.length) {
|
|
1040
1046
|
return handleDeleteRow(code, 'vxe.grid.deleteSelectRecord', () => {
|
|
1041
1047
|
if (!removeRecords.length) {
|
|
@@ -1055,7 +1061,7 @@ export default defineVxeComponent({
|
|
|
1055
1061
|
afterDelete(commitParams, ...args);
|
|
1056
1062
|
}
|
|
1057
1063
|
else {
|
|
1058
|
-
|
|
1064
|
+
$xeGrid.commitProxy('query');
|
|
1059
1065
|
}
|
|
1060
1066
|
if (deleteSuccessMethods) {
|
|
1061
1067
|
deleteSuccessMethods(Object.assign(Object.assign({}, commitParams), { response: rest }));
|
|
@@ -1096,7 +1102,16 @@ export default defineVxeComponent({
|
|
|
1096
1102
|
if (ajaxMethods) {
|
|
1097
1103
|
const body = $xeTable.getRecordset();
|
|
1098
1104
|
const { insertRecords, removeRecords, updateRecords, pendingRecords } = body;
|
|
1099
|
-
const commitParams = {
|
|
1105
|
+
const commitParams = {
|
|
1106
|
+
$table: $xeTable,
|
|
1107
|
+
$grid: $xeGrid,
|
|
1108
|
+
$gantt: null,
|
|
1109
|
+
code,
|
|
1110
|
+
button,
|
|
1111
|
+
body,
|
|
1112
|
+
form: formData,
|
|
1113
|
+
options: ajaxMethods
|
|
1114
|
+
};
|
|
1100
1115
|
// 排除掉新增且标记为删除的数据
|
|
1101
1116
|
if (insertRecords.length) {
|
|
1102
1117
|
body.pendingRecords = pendingRecords.filter((row) => $xeTable.findRowIndexOf(insertRecords, row) === -1);
|
|
@@ -1130,7 +1145,7 @@ export default defineVxeComponent({
|
|
|
1130
1145
|
afterSave(commitParams, ...args);
|
|
1131
1146
|
}
|
|
1132
1147
|
else {
|
|
1133
|
-
|
|
1148
|
+
$xeGrid.commitProxy('query');
|
|
1134
1149
|
}
|
|
1135
1150
|
if (saveSuccessMethods) {
|
|
1136
1151
|
saveSuccessMethods(Object.assign(Object.assign({}, commitParams), { response: rest }));
|
|
@@ -1169,7 +1184,7 @@ export default defineVxeComponent({
|
|
|
1169
1184
|
if (gCommandOpts) {
|
|
1170
1185
|
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
|
|
1171
1186
|
if (tCommandMethod) {
|
|
1172
|
-
tCommandMethod({ code, button, $grid: $xeGrid, $table: $xeTable }, ...args);
|
|
1187
|
+
tCommandMethod({ code, button, $grid: $xeGrid, $table: $xeTable, $gantt: null }, ...args);
|
|
1173
1188
|
}
|
|
1174
1189
|
else {
|
|
1175
1190
|
errLog('vxe.error.notCommands', [code]);
|
|
@@ -1184,9 +1199,9 @@ export default defineVxeComponent({
|
|
|
1184
1199
|
},
|
|
1185
1200
|
zoom() {
|
|
1186
1201
|
if (reactData.isZMax) {
|
|
1187
|
-
return
|
|
1202
|
+
return $xeGrid.revert();
|
|
1188
1203
|
}
|
|
1189
|
-
return
|
|
1204
|
+
return $xeGrid.maximize();
|
|
1190
1205
|
},
|
|
1191
1206
|
isMaximized() {
|
|
1192
1207
|
return reactData.isZMax;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { VxeUI } from '../../ui';
|
|
2
|
+
import { tableProps } from '../../table/src/props';
|
|
3
|
+
const { getConfig } = VxeUI;
|
|
4
|
+
export const gridProps = Object.assign(Object.assign({}, tableProps), { layouts: Array, columns: Array, pagerConfig: Object, proxyConfig: Object, toolbarConfig: Object, formConfig: Object, zoomConfig: Object, size: {
|
|
5
|
+
type: String,
|
|
6
|
+
default: () => getConfig().grid.size || getConfig().size
|
|
7
|
+
} });
|