@juzhenfe/page-model 3.17.7 → 3.17.9

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/index.es.js CHANGED
@@ -9043,10 +9043,30 @@ var SummaryTypeEnum = /* @__PURE__ */ ((SummaryTypeEnum2) => {
9043
9043
  return SummaryTypeEnum2;
9044
9044
  })(SummaryTypeEnum || {});
9045
9045
  function useUserSummary(tableManager) {
9046
- let isHijacked = false;
9047
9046
  let summaryResult = reactive([]);
9048
9047
  let currentTableColumns = [];
9049
9048
  let lastSummaryColumns = [];
9049
+ const getSummaryEls = () => {
9050
+ return tableManager.currentRenderTableEls.filter((a) => a.showSummary != null && a.showSummary !== "").filter((a) => a.prop).map((a) => {
9051
+ return {
9052
+ prop: a.prop,
9053
+ showSummary: a.showSummary
9054
+ };
9055
+ });
9056
+ };
9057
+ const getSummaryData = debounce(async () => {
9058
+ const summaryColumns = lastSummaryColumns = getSummaryEls();
9059
+ const reqResult = tableManager.table.serverSummaryFn.call(
9060
+ tableManager,
9061
+ summaryColumns,
9062
+ cloneDeep(tableManager.manager.lastReqData),
9063
+ currentTableColumns
9064
+ );
9065
+ const _result = await reqResult;
9066
+ _result.forEach((item, index2) => {
9067
+ summaryResult[index2] = item;
9068
+ });
9069
+ }, 300);
9050
9070
  return function initSummary() {
9051
9071
  if (tableManager.tableProps.summaryMethod && !tableManager.tableProps._customSummary) {
9052
9072
  return false;
@@ -9060,41 +9080,17 @@ function useUserSummary(tableManager) {
9060
9080
  }
9061
9081
  tableManager.tableProps.showSummary = true;
9062
9082
  tableManager.tableProps._customSummary = true;
9063
- const getSummaryEls = () => {
9064
- return tableManager.currentRenderTableEls.filter((a) => a.showSummary != null && a.showSummary !== "").filter((a) => a.prop).map((a) => {
9065
- return {
9066
- prop: a.prop,
9067
- showSummary: a.showSummary
9068
- };
9069
- });
9070
- };
9071
9083
  const summaryEls = getSummaryEls();
9072
9084
  const isServerSummary = tableManager.table.useServerSummary && typeof tableManager.table.serverSummaryFn === "function";
9073
- const getSummaryData = debounce(async () => {
9074
- const summaryColumns = lastSummaryColumns = getSummaryEls();
9075
- const reqResult = tableManager.table.serverSummaryFn.call(
9076
- tableManager,
9077
- summaryColumns,
9078
- cloneDeep(tableManager.manager.lastReqData),
9079
- currentTableColumns
9080
- );
9081
- const _result = await reqResult;
9082
- _result.forEach((item, index2) => {
9083
- summaryResult[index2] = item;
9084
- });
9085
- }, 300);
9086
9085
  if (isServerSummary) {
9087
- if (!isHijacked) {
9088
- const config = tableManager.manager.config;
9089
- let _beforeGetRequest = config.beforeGetRequest;
9090
- config.beforeGetRequest = async function(reqParams) {
9091
- if (typeof _beforeGetRequest === "function") {
9092
- _beforeGetRequest.call(tableManager.manager, reqParams);
9093
- }
9094
- getSummaryData();
9095
- };
9096
- isHijacked = true;
9097
- }
9086
+ const config = tableManager.manager.config;
9087
+ let _beforeGetRequest = config.beforeGetRequest;
9088
+ config.beforeGetRequest = function(reqParams) {
9089
+ if (typeof _beforeGetRequest === "function") {
9090
+ _beforeGetRequest.call(tableManager.manager, reqParams);
9091
+ }
9092
+ getSummaryData();
9093
+ };
9098
9094
  }
9099
9095
  tableManager.tableProps.summaryMethod = function({
9100
9096
  columns,
@@ -14891,7 +14887,7 @@ const defineEditableTable = function(config) {
14891
14887
  };
14892
14888
  var iconfont = "";
14893
14889
  const name = "@juzhenfe/page-model";
14894
- const version = "3.17.7";
14890
+ const version = "3.17.9";
14895
14891
  const types = "dist/main.d.ts";
14896
14892
  const main = "dist/index.umd.js";
14897
14893
  const keywords = [