vxe-table 4.20.9 → 4.20.11
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/dist/all.esm.js +339 -204
- package/dist/style.css +1 -1
- package/es/grid/src/grid.js +252 -161
- package/es/style.css +1 -1
- package/es/table/module/custom/panel.js +3 -3
- package/es/table/module/export/hook.js +53 -33
- package/es/table/render/index.js +12 -2
- package/es/table/src/table.js +17 -3
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +321 -204
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +442 -259
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/custom/panel.js +3 -3
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/export/hook.js +67 -40
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/render/index.js +24 -2
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/table.js +3 -3
- package/lib/table/src/table.min.js +1 -1
- package/lib/ui/index.js +1 -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/package.json +2 -2
- package/packages/grid/src/grid.ts +243 -153
- package/packages/table/module/custom/panel.ts +3 -3
- package/packages/table/module/export/hook.ts +51 -30
- package/packages/table/render/index.ts +12 -2
- package/packages/table/src/table.ts +17 -3
- /package/es/{iconfont.1785242738274.ttf → iconfont.1786329229929.ttf} +0 -0
- /package/es/{iconfont.1785242738274.woff → iconfont.1786329229929.woff} +0 -0
- /package/es/{iconfont.1785242738274.woff2 → iconfont.1786329229929.woff2} +0 -0
- /package/lib/{iconfont.1785242738274.ttf → iconfont.1786329229929.ttf} +0 -0
- /package/lib/{iconfont.1785242738274.woff → iconfont.1786329229929.woff} +0 -0
- /package/lib/{iconfont.1785242738274.woff2 → iconfont.1786329229929.woff2} +0 -0
|
@@ -1654,17 +1654,19 @@ hooks.add('tableExportModule', {
|
|
|
1654
1654
|
const { computeProxyOpts } = $xeGGWrapper.getComputeMaps()
|
|
1655
1655
|
const proxyOpts = computeProxyOpts.value
|
|
1656
1656
|
const { sortData } = gridReactData
|
|
1657
|
-
const { beforeQueryAll, afterQueryAll, ajax = {} } = proxyOpts
|
|
1657
|
+
const { beforeQueryAll: oldBeforeQueryAll, afterQueryAll: oldAfterQueryAll, ajax = {} } = proxyOpts
|
|
1658
1658
|
const resConfigs = proxyOpts.response || proxyOpts.props || {}
|
|
1659
|
-
const
|
|
1660
|
-
const
|
|
1661
|
-
const
|
|
1659
|
+
const beforeQueryAllMethod = ajax.beforeQueryAll
|
|
1660
|
+
const queryAllMethod = ajax.queryAll
|
|
1661
|
+
const afterQueryAllMethod = ajax.afterQueryAll
|
|
1662
|
+
const queryAllSuccessMethod = ajax.queryAllSuccess
|
|
1663
|
+
const queryAllErrorMethod = ajax.queryAllError
|
|
1662
1664
|
|
|
1663
|
-
if (!
|
|
1665
|
+
if (!queryAllMethod) {
|
|
1664
1666
|
errLog('vxe.error.notFunc', ['proxy-config.ajax.queryAll'])
|
|
1665
1667
|
}
|
|
1666
1668
|
|
|
1667
|
-
if (
|
|
1669
|
+
if (queryAllMethod) {
|
|
1668
1670
|
const params = {
|
|
1669
1671
|
$table: $xeTable,
|
|
1670
1672
|
$grid: $xeGrid,
|
|
@@ -1675,35 +1677,54 @@ hooks.add('tableExportModule', {
|
|
|
1675
1677
|
form: gridReactData.formData,
|
|
1676
1678
|
options: handleOptions
|
|
1677
1679
|
}
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
tdData = listProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt })
|
|
1680
|
+
|
|
1681
|
+
const handleQueryAll = () => {
|
|
1682
|
+
return Promise.resolve((oldBeforeQueryAll || queryAllMethod)(params))
|
|
1683
|
+
.then((rest) => {
|
|
1684
|
+
if (afterQueryAllMethod) {
|
|
1685
|
+
afterQueryAllMethod({ ...params, response: rest, status: 'success' })
|
|
1685
1686
|
} else {
|
|
1686
|
-
|
|
1687
|
+
const listProp = resConfigs.list
|
|
1688
|
+
let tdData: any[] = []
|
|
1689
|
+
if (listProp) {
|
|
1690
|
+
if (XEUtils.isFunction(listProp)) {
|
|
1691
|
+
tdData = listProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt })
|
|
1692
|
+
} else {
|
|
1693
|
+
tdData = XEUtils.isArray(rest) ? rest : XEUtils.get(rest, listProp)
|
|
1694
|
+
}
|
|
1695
|
+
} else {
|
|
1696
|
+
if (XEUtils.isArray(rest)) {
|
|
1697
|
+
tdData = rest
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
handleOptions.data = tdData
|
|
1701
|
+
if (oldAfterQueryAll) {
|
|
1702
|
+
oldAfterQueryAll({ ...params, response: rest })
|
|
1703
|
+
}
|
|
1687
1704
|
}
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
tdData = rest
|
|
1705
|
+
if (queryAllSuccessMethod) {
|
|
1706
|
+
queryAllSuccessMethod({ ...params, response: rest })
|
|
1691
1707
|
}
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1708
|
+
return handleExport(handleOptions)
|
|
1709
|
+
})
|
|
1710
|
+
.catch((rest) => {
|
|
1711
|
+
if (afterQueryAllMethod) {
|
|
1712
|
+
afterQueryAllMethod({ ...params, response: rest, status: 'error' })
|
|
1713
|
+
}
|
|
1714
|
+
if (queryAllErrorMethod) {
|
|
1715
|
+
queryAllErrorMethod({ ...params, response: rest })
|
|
1716
|
+
}
|
|
1717
|
+
})
|
|
1718
|
+
}
|
|
1719
|
+
|
|
1720
|
+
if (beforeQueryAllMethod) {
|
|
1721
|
+
return Promise.resolve(beforeQueryAllMethod(params)).then(status => {
|
|
1722
|
+
if (status !== false) {
|
|
1723
|
+
return handleQueryAll()
|
|
1705
1724
|
}
|
|
1706
1725
|
})
|
|
1726
|
+
}
|
|
1727
|
+
return handleQueryAll()
|
|
1707
1728
|
}
|
|
1708
1729
|
}
|
|
1709
1730
|
} if (mode === 'current') {
|
|
@@ -970,7 +970,12 @@ renderer.mixin({
|
|
|
970
970
|
},
|
|
971
971
|
FormatNumberInput: {
|
|
972
972
|
renderTableDefault: handleNumberCell,
|
|
973
|
-
tableFilterDefaultMethod
|
|
973
|
+
tableFilterDefaultMethod ({ option, row, column }) {
|
|
974
|
+
const { data } = option
|
|
975
|
+
const cellValue = XEUtils.get(row, column.field)
|
|
976
|
+
/* eslint-disable eqeqeq */
|
|
977
|
+
return cellValue == data
|
|
978
|
+
},
|
|
974
979
|
tableExportMethod (params) {
|
|
975
980
|
const { row, column } = params
|
|
976
981
|
const cellValue = XEUtils.get(row, column.field)
|
|
@@ -1021,7 +1026,12 @@ renderer.mixin({
|
|
|
1021
1026
|
createTableFilterOptions: defaultFilterOptions,
|
|
1022
1027
|
renderTableFilter: defaultFilterRender,
|
|
1023
1028
|
renderTableFloatingFilter: defaultFloatingFilterRender,
|
|
1024
|
-
tableFilterDefaultMethod
|
|
1029
|
+
tableFilterDefaultMethod ({ option, row, column }) {
|
|
1030
|
+
const { data } = option
|
|
1031
|
+
const cellValue = XEUtils.get(row, column.field)
|
|
1032
|
+
/* eslint-disable eqeqeq */
|
|
1033
|
+
return cellValue == data
|
|
1034
|
+
},
|
|
1025
1035
|
tableExportMethod (params) {
|
|
1026
1036
|
const { row, column } = params
|
|
1027
1037
|
const cellValue = XEUtils.get(row, column.field)
|
|
@@ -3608,7 +3608,7 @@ export default defineVxeComponent({
|
|
|
3608
3608
|
return
|
|
3609
3609
|
}
|
|
3610
3610
|
internalData.rsePending = true
|
|
3611
|
-
handleLazyRecalculate(
|
|
3611
|
+
handleLazyRecalculate(true, true, true, {
|
|
3612
3612
|
minRunDelay: 200
|
|
3613
3613
|
}).then(() => {
|
|
3614
3614
|
internalData.rsePending = false
|
|
@@ -5579,6 +5579,18 @@ export default defineVxeComponent({
|
|
|
5579
5579
|
}
|
|
5580
5580
|
const { editConfig } = props
|
|
5581
5581
|
const { formatter, editRender, cellRender } = column
|
|
5582
|
+
let etOpSize = null
|
|
5583
|
+
let etOgSize = null
|
|
5584
|
+
let clOpSize = null
|
|
5585
|
+
let clOgSize = null
|
|
5586
|
+
if (editRender) {
|
|
5587
|
+
etOpSize = editRender.options ? editRender.options.length : 0
|
|
5588
|
+
etOgSize = editRender.optionGroups ? editRender.optionGroups.length : 0
|
|
5589
|
+
}
|
|
5590
|
+
if (cellRender) {
|
|
5591
|
+
clOpSize = cellRender.options ? cellRender.options.length : 0
|
|
5592
|
+
clOgSize = cellRender.optionGroups ? cellRender.optionGroups.length : 0
|
|
5593
|
+
}
|
|
5582
5594
|
// formatter > tableCellFormatter
|
|
5583
5595
|
const renderOpts = formatter ? null : (editConfig && isEnableConf(editRender) ? editRender : (isEnableConf(cellRender) ? cellRender : null))
|
|
5584
5596
|
const compConf = renderOpts ? renderer.get(renderOpts.name) : null
|
|
@@ -5597,7 +5609,8 @@ export default defineVxeComponent({
|
|
|
5597
5609
|
formatData = fullAllDataRowIdData[rowid].formatData = {}
|
|
5598
5610
|
}
|
|
5599
5611
|
if (rowRest && formatData[colid]) {
|
|
5600
|
-
|
|
5612
|
+
const ftValue = formatData[colid].value
|
|
5613
|
+
if (ftValue && ftValue[0] === cellValue && ftValue[1] === etOpSize && ftValue[2] === etOgSize && ftValue[3] === clOpSize && ftValue[4] === clOgSize) {
|
|
5601
5614
|
return formatData[colid].label
|
|
5602
5615
|
}
|
|
5603
5616
|
}
|
|
@@ -5626,7 +5639,8 @@ export default defineVxeComponent({
|
|
|
5626
5639
|
cellLabel = tcFormatter(renderOpts, formatParams)
|
|
5627
5640
|
}
|
|
5628
5641
|
if (formatData) {
|
|
5629
|
-
|
|
5642
|
+
const ftValue = [cellValue, etOpSize, etOgSize, clOpSize, clOgSize]
|
|
5643
|
+
formatData[colid] = { value: ftValue, label: cellLabel }
|
|
5630
5644
|
}
|
|
5631
5645
|
}
|
|
5632
5646
|
return cellLabel
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|