ocpview-pro 0.1.10 → 0.1.12

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.js CHANGED
@@ -453,7 +453,7 @@ common.initEview = function(ViewUI2) {
453
453
  common.initAnchor(ViewUI2.Anchor);
454
454
  };
455
455
  const name = "ocpview-pro";
456
- const version$2 = "0.1.8";
456
+ const version$2 = "0.1.10";
457
457
  const title = "ocpviewPlus";
458
458
  const description = "A high quality Service UI components Library with Vue.js";
459
459
  const homepage = "";
@@ -23399,7 +23399,7 @@ function _sfc_render$12(_ctx, _cache, $props, $setup, $data, $options) {
23399
23399
  } : void 0
23400
23400
  ]), 1040);
23401
23401
  }
23402
- var ShowText = /* @__PURE__ */ _export_sfc$1(_sfc_main$19, [["render", _sfc_render$12], ["__scopeId", "data-v-98a304ae"]]);
23402
+ var ShowText = /* @__PURE__ */ _export_sfc$1(_sfc_main$19, [["render", _sfc_render$12], ["__scopeId", "data-v-2a7c7871"]]);
23403
23403
  var billimport_vue_vue_type_style_index_0_lang = "";
23404
23404
  const _sfc_main$18 = {
23405
23405
  name: "billimport",
@@ -45195,6 +45195,9 @@ const _sfc_main$f = {
45195
45195
  return {
45196
45196
  startIndex: (this.myConfig.pageConfig.page_no - 1) * this.myConfig.pageConfig.page_size
45197
45197
  };
45198
+ },
45199
+ sumFields() {
45200
+ return this.tableColumns.filter((item) => item.summary).map((item) => item.name);
45198
45201
  }
45199
45202
  },
45200
45203
  methods: {
@@ -45236,6 +45239,57 @@ const _sfc_main$f = {
45236
45239
  }
45237
45240
  }
45238
45241
  return {};
45242
+ },
45243
+ footerMethod({ columns }) {
45244
+ const sumSub = 0;
45245
+ return [
45246
+ columns.map((column2) => {
45247
+ if (column2.index === sumSub) {
45248
+ return this.myConfig.sumText;
45249
+ }
45250
+ if (this.sumFields.includes(column2.field)) {
45251
+ const serverValue = this.total_summary[column2.field];
45252
+ if (serverValue !== void 0) {
45253
+ const columnConfig2 = this.tableColumns.find(
45254
+ (c10) => c10.name === column2.field
45255
+ );
45256
+ const format3 = columnConfig2 == null ? void 0 : columnConfig2.format;
45257
+ const notzero2 = columnConfig2 == null ? void 0 : columnConfig2.notzero;
45258
+ const rawValue = serverValue === 0 ? 0 : serverValue;
45259
+ return this.$Method.formatNumber(
45260
+ rawValue,
45261
+ format3,
45262
+ notzero2
45263
+ );
45264
+ }
45265
+ const sumData = this.handleSumField({
45266
+ list: this.tempData,
45267
+ field: column2.field
45268
+ });
45269
+ const columnConfig = this.tableColumns.find(
45270
+ (c10) => c10.name === column2.field
45271
+ );
45272
+ const format2 = columnConfig == null ? void 0 : columnConfig.format;
45273
+ const notzero = columnConfig == null ? void 0 : columnConfig.notzero;
45274
+ return this.$Method.formatNumber(
45275
+ sumData,
45276
+ format2,
45277
+ notzero
45278
+ );
45279
+ }
45280
+ return null;
45281
+ })
45282
+ ];
45283
+ },
45284
+ handleSumField(params) {
45285
+ const { list, field } = params;
45286
+ let count = 0;
45287
+ list.forEach((item) => {
45288
+ count = this.$utils.add(count, item[field]);
45289
+ });
45290
+ if (count === 0)
45291
+ count = 0;
45292
+ return count;
45239
45293
  }
45240
45294
  },
45241
45295
  mounted() {
@@ -45308,6 +45362,8 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
45308
45362
  height: _ctx.tableHeight,
45309
45363
  "max-height": _ctx.tableMaxHeight,
45310
45364
  loading: _ctx.loading,
45365
+ "show-footer": _ctx.myConfig.showSummary,
45366
+ "footer-method": $options.footerMethod,
45311
45367
  "sort-config": { remote: true, trigger: "cell" },
45312
45368
  "column-config": { useKey: true },
45313
45369
  "row-config": { useKey: true },
@@ -45331,7 +45387,7 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
45331
45387
  ])
45332
45388
  };
45333
45389
  })
45334
- ]), 1032, ["columns", "data", "height", "max-height", "loading", "seq-config", "onSortChange", "onCellDblclick"])
45390
+ ]), 1032, ["columns", "data", "height", "max-height", "loading", "show-footer", "footer-method", "seq-config", "onSortChange", "onCellDblclick"])
45335
45391
  ]),
45336
45392
  _: 3
45337
45393
  }),
@@ -46427,6 +46483,8 @@ const _sfc_main$b = {
46427
46483
  list.forEach((item) => {
46428
46484
  count = this.$utils.add(count, item[field]);
46429
46485
  });
46486
+ if (count === 0)
46487
+ count = 0;
46430
46488
  return count;
46431
46489
  },
46432
46490
  getTableColumnConfig(index) {