vxe-table 3.22.9 → 3.22.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/es/grid/src/grid.js +251 -165
- package/es/style.css +1 -1
- package/es/table/module/custom/panel.js +3 -3
- package/es/table/module/export/mixin.js +53 -33
- package/es/table/render/index.js +12 -2
- package/es/table/src/methods.js +16 -2
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +319 -209
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +438 -263
- 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/mixin.js +67 -40
- package/lib/table/module/export/mixin.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/methods.js +2 -2
- package/lib/table/src/methods.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 +239 -157
- package/packages/table/module/custom/panel.ts +3 -3
- package/packages/table/module/export/mixin.ts +51 -30
- package/packages/table/render/index.ts +12 -2
- package/packages/table/src/methods.ts +16 -2
- /package/es/{iconfont.1785242725062.ttf → iconfont.1786329223308.ttf} +0 -0
- /package/es/{iconfont.1785242725062.woff → iconfont.1786329223308.woff} +0 -0
- /package/es/{iconfont.1785242725062.woff2 → iconfont.1786329223308.woff2} +0 -0
- /package/lib/{iconfont.1785242725062.ttf → iconfont.1786329223308.ttf} +0 -0
- /package/lib/{iconfont.1785242725062.woff → iconfont.1786329223308.woff} +0 -0
- /package/lib/{iconfont.1785242725062.woff2 → iconfont.1786329223308.woff2} +0 -0
|
@@ -1680,17 +1680,19 @@ export default {
|
|
|
1680
1680
|
const gridReactData = $xeGGWrapper.reactData
|
|
1681
1681
|
const proxyOpts = $xeGGWrapper.computeProxyOpts
|
|
1682
1682
|
const { sortData } = gridReactData
|
|
1683
|
-
const { beforeQueryAll, afterQueryAll, ajax = {} } = proxyOpts
|
|
1683
|
+
const { beforeQueryAll: oldBeforeQueryAll, afterQueryAll: oldAfterQueryAll, ajax = {} } = proxyOpts
|
|
1684
1684
|
const resConfigs = proxyOpts.response || proxyOpts.props || {}
|
|
1685
|
-
const
|
|
1686
|
-
const
|
|
1687
|
-
const
|
|
1685
|
+
const beforeQueryAllMethod = ajax.beforeQueryAll
|
|
1686
|
+
const queryAllMethod = ajax.queryAll
|
|
1687
|
+
const afterQueryAllMethod = ajax.afterQueryAll
|
|
1688
|
+
const queryAllSuccessMethod = ajax.queryAllSuccess
|
|
1689
|
+
const queryAllErrorMethod = ajax.queryAllError
|
|
1688
1690
|
|
|
1689
|
-
if (!
|
|
1691
|
+
if (!queryAllMethod) {
|
|
1690
1692
|
errLog('vxe.error.notFunc', ['proxy-config.ajax.queryAll'])
|
|
1691
1693
|
}
|
|
1692
1694
|
|
|
1693
|
-
if (
|
|
1695
|
+
if (queryAllMethod) {
|
|
1694
1696
|
const params = {
|
|
1695
1697
|
$table: $xeTable,
|
|
1696
1698
|
$grid: $xeGrid,
|
|
@@ -1701,35 +1703,54 @@ export default {
|
|
|
1701
1703
|
form: gridReactData.formData,
|
|
1702
1704
|
options: handleOptions
|
|
1703
1705
|
}
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
tdData = listProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt })
|
|
1706
|
+
|
|
1707
|
+
const handleQueryAll = () => {
|
|
1708
|
+
return Promise.resolve((oldBeforeQueryAll || queryAllMethod)(params))
|
|
1709
|
+
.then((rest) => {
|
|
1710
|
+
if (afterQueryAllMethod) {
|
|
1711
|
+
afterQueryAllMethod({ ...params, response: rest, status: 'success' })
|
|
1711
1712
|
} else {
|
|
1712
|
-
|
|
1713
|
+
const listProp = resConfigs.list
|
|
1714
|
+
let tdData: any[] = []
|
|
1715
|
+
if (listProp) {
|
|
1716
|
+
if (XEUtils.isFunction(listProp)) {
|
|
1717
|
+
tdData = listProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt })
|
|
1718
|
+
} else {
|
|
1719
|
+
tdData = XEUtils.isArray(rest) ? rest : XEUtils.get(rest, listProp)
|
|
1720
|
+
}
|
|
1721
|
+
} else {
|
|
1722
|
+
if (XEUtils.isArray(rest)) {
|
|
1723
|
+
tdData = rest
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
handleOptions.data = tdData
|
|
1727
|
+
if (oldAfterQueryAll) {
|
|
1728
|
+
oldAfterQueryAll({ ...params, response: rest })
|
|
1729
|
+
}
|
|
1713
1730
|
}
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
tdData = rest
|
|
1731
|
+
if (queryAllSuccessMethod) {
|
|
1732
|
+
queryAllSuccessMethod({ ...params, response: rest })
|
|
1717
1733
|
}
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1734
|
+
return handleExport($xeTable, handleOptions)
|
|
1735
|
+
})
|
|
1736
|
+
.catch((rest) => {
|
|
1737
|
+
if (afterQueryAllMethod) {
|
|
1738
|
+
afterQueryAllMethod({ ...params, response: rest, status: 'error' })
|
|
1739
|
+
}
|
|
1740
|
+
if (queryAllErrorMethod) {
|
|
1741
|
+
queryAllErrorMethod({ ...params, response: rest })
|
|
1742
|
+
}
|
|
1743
|
+
})
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
if (beforeQueryAllMethod) {
|
|
1747
|
+
return Promise.resolve(beforeQueryAllMethod(params)).then(status => {
|
|
1748
|
+
if (status !== false) {
|
|
1749
|
+
return handleQueryAll()
|
|
1731
1750
|
}
|
|
1732
1751
|
})
|
|
1752
|
+
}
|
|
1753
|
+
return handleQueryAll()
|
|
1733
1754
|
}
|
|
1734
1755
|
}
|
|
1735
1756
|
} else if (mode === 'current') {
|
|
@@ -980,7 +980,12 @@ renderer.mixin({
|
|
|
980
980
|
},
|
|
981
981
|
FormatNumberInput: {
|
|
982
982
|
renderTableDefault: handleNumberCell,
|
|
983
|
-
tableFilterDefaultMethod
|
|
983
|
+
tableFilterDefaultMethod ({ option, row, column }) {
|
|
984
|
+
const { data } = option
|
|
985
|
+
const cellValue = XEUtils.get(row, column.field)
|
|
986
|
+
/* eslint-disable eqeqeq */
|
|
987
|
+
return cellValue == data
|
|
988
|
+
},
|
|
984
989
|
tableExportMethod (params) {
|
|
985
990
|
const { row, column } = params
|
|
986
991
|
const cellValue = XEUtils.get(row, column.field)
|
|
@@ -1031,7 +1036,12 @@ renderer.mixin({
|
|
|
1031
1036
|
createTableFilterOptions: defaultFilterOptions,
|
|
1032
1037
|
renderTableFilter: defaultFilterRender,
|
|
1033
1038
|
renderTableFloatingFilter: defaultFloatingFilterRender,
|
|
1034
|
-
tableFilterDefaultMethod
|
|
1039
|
+
tableFilterDefaultMethod ({ option, row, column }) {
|
|
1040
|
+
const { data } = option
|
|
1041
|
+
const cellValue = XEUtils.get(row, column.field)
|
|
1042
|
+
/* eslint-disable eqeqeq */
|
|
1043
|
+
return cellValue == data
|
|
1044
|
+
},
|
|
1035
1045
|
tableExportMethod (params) {
|
|
1036
1046
|
const { row, column } = params
|
|
1037
1047
|
const cellValue = XEUtils.get(row, column.field)
|
|
@@ -5744,6 +5744,18 @@ const tableMethods: any = {
|
|
|
5744
5744
|
}
|
|
5745
5745
|
const { editConfig } = props
|
|
5746
5746
|
const { formatter, editRender, cellRender } = column
|
|
5747
|
+
let etOpSize = null
|
|
5748
|
+
let etOgSize = null
|
|
5749
|
+
let clOpSize = null
|
|
5750
|
+
let clOgSize = null
|
|
5751
|
+
if (editRender) {
|
|
5752
|
+
etOpSize = editRender.options ? editRender.options.length : 0
|
|
5753
|
+
etOgSize = editRender.optionGroups ? editRender.optionGroups.length : 0
|
|
5754
|
+
}
|
|
5755
|
+
if (cellRender) {
|
|
5756
|
+
clOpSize = cellRender.options ? cellRender.options.length : 0
|
|
5757
|
+
clOgSize = cellRender.optionGroups ? cellRender.optionGroups.length : 0
|
|
5758
|
+
}
|
|
5747
5759
|
// formatter > tableCellFormatter
|
|
5748
5760
|
const renderOpts = formatter ? null : (editConfig && isEnableConf(editRender) ? editRender : (isEnableConf(cellRender) ? cellRender : null))
|
|
5749
5761
|
const compConf = renderOpts ? renderer.get(renderOpts.name) : null
|
|
@@ -5762,7 +5774,8 @@ const tableMethods: any = {
|
|
|
5762
5774
|
formatData = fullAllDataRowIdData[rowid].formatData = {}
|
|
5763
5775
|
}
|
|
5764
5776
|
if (rowRest && formatData[colid]) {
|
|
5765
|
-
|
|
5777
|
+
const ftValue = formatData[colid].value
|
|
5778
|
+
if (ftValue && ftValue[0] === cellValue && ftValue[1] === etOpSize && ftValue[2] === etOgSize && ftValue[3] === clOpSize && ftValue[4] === clOgSize) {
|
|
5766
5779
|
return formatData[colid].label
|
|
5767
5780
|
}
|
|
5768
5781
|
}
|
|
@@ -5791,7 +5804,8 @@ const tableMethods: any = {
|
|
|
5791
5804
|
cellLabel = tcFormatter(renderOpts, formatParams)
|
|
5792
5805
|
}
|
|
5793
5806
|
if (formatData) {
|
|
5794
|
-
|
|
5807
|
+
const ftValue = [cellValue, etOpSize, etOgSize, clOpSize, clOgSize]
|
|
5808
|
+
formatData[colid] = { value: ftValue, label: cellLabel }
|
|
5795
5809
|
}
|
|
5796
5810
|
}
|
|
5797
5811
|
return cellLabel
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|