@juzhenfe/page-model 3.17.7 → 3.17.8

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
@@ -9046,7 +9046,29 @@ function useUserSummary(tableManager) {
9046
9046
  let isHijacked = false;
9047
9047
  let summaryResult = reactive([]);
9048
9048
  let currentTableColumns = [];
9049
+ let isFirstQuery = true;
9049
9050
  let lastSummaryColumns = [];
9051
+ const getSummaryEls = () => {
9052
+ return tableManager.currentRenderTableEls.filter((a) => a.showSummary != null && a.showSummary !== "").filter((a) => a.prop).map((a) => {
9053
+ return {
9054
+ prop: a.prop,
9055
+ showSummary: a.showSummary
9056
+ };
9057
+ });
9058
+ };
9059
+ const getSummaryData = debounce(async () => {
9060
+ const summaryColumns = lastSummaryColumns = getSummaryEls();
9061
+ const reqResult = tableManager.table.serverSummaryFn.call(
9062
+ tableManager,
9063
+ summaryColumns,
9064
+ cloneDeep(tableManager.manager.lastReqData),
9065
+ currentTableColumns
9066
+ );
9067
+ const _result = await reqResult;
9068
+ _result.forEach((item, index2) => {
9069
+ summaryResult[index2] = item;
9070
+ });
9071
+ }, 300);
9050
9072
  return function initSummary() {
9051
9073
  if (tableManager.tableProps.summaryMethod && !tableManager.tableProps._customSummary) {
9052
9074
  return false;
@@ -9060,29 +9082,8 @@ function useUserSummary(tableManager) {
9060
9082
  }
9061
9083
  tableManager.tableProps.showSummary = true;
9062
9084
  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
9085
  const summaryEls = getSummaryEls();
9072
9086
  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
9087
  if (isServerSummary) {
9087
9088
  if (!isHijacked) {
9088
9089
  const config = tableManager.manager.config;
@@ -9091,7 +9092,11 @@ function useUserSummary(tableManager) {
9091
9092
  if (typeof _beforeGetRequest === "function") {
9092
9093
  _beforeGetRequest.call(tableManager.manager, reqParams);
9093
9094
  }
9094
- getSummaryData();
9095
+ if (isFirstQuery) {
9096
+ isFirstQuery = false;
9097
+ } else {
9098
+ getSummaryData();
9099
+ }
9095
9100
  };
9096
9101
  isHijacked = true;
9097
9102
  }
@@ -14891,7 +14896,7 @@ const defineEditableTable = function(config) {
14891
14896
  };
14892
14897
  var iconfont = "";
14893
14898
  const name = "@juzhenfe/page-model";
14894
- const version = "3.17.7";
14899
+ const version = "3.17.8";
14895
14900
  const types = "dist/main.d.ts";
14896
14901
  const main = "dist/index.umd.js";
14897
14902
  const keywords = [