zzz-pc-view 0.0.18 → 0.0.20

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zzz-pc-view",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "main": "src/index.umd.js",
5
5
  "module": "src/index.es.js",
6
6
  "types": "src/index.d.ts",
@@ -454,6 +454,12 @@ export declare abstract class CurdHandler<T extends object = object> extends Fil
454
454
  * @description 这对于性能优化很重要,因为它避免了不必要的更新。
455
455
  */
456
456
  protected readonly totalRef: import('vue').ShallowRef<number, number>;
457
+ /**
458
+ * 获取列表数据的总数。
459
+ * 这个方法返回 totalRef 引用的值,它表示列表数据的总数。
460
+ * @returns {number} - 列表数据的总数。
461
+ */
462
+ get total(): number;
457
463
  /**
458
464
  * 设置列表数据和总数。
459
465
  * 这个方法用于更新 listRef 和 totalRef 引用的值,从而更新列表数据和总数。
package/src/index.es.js CHANGED
@@ -3724,6 +3724,14 @@ class CurdHandler extends FilterHandler {
3724
3724
  get displayList() {
3725
3725
  return this.displayListComputed.value;
3726
3726
  }
3727
+ /**
3728
+ * 获取列表数据的总数。
3729
+ * 这个方法返回 totalRef 引用的值,它表示列表数据的总数。
3730
+ * @returns {number} - 列表数据的总数。
3731
+ */
3732
+ get total() {
3733
+ return this.totalRef.value;
3734
+ }
3727
3735
  /**
3728
3736
  * 设置列表数据和总数。
3729
3737
  * 这个方法用于更新 listRef 和 totalRef 引用的值,从而更新列表数据和总数。
@@ -9671,6 +9679,9 @@ class CurdViewHandler extends CurdHandler {
9671
9679
  constructor(...args) {
9672
9680
  super(...args);
9673
9681
  __publicField(this, "tableElRef", shallowRef());
9682
+ __publicField(this, "onSearchBtnClick", () => {
9683
+ this.search();
9684
+ });
9674
9685
  __publicField(this, "editorFormElRef", shallowRef());
9675
9686
  }
9676
9687
  onValidateQueryFail(error) {
@@ -9943,8 +9954,11 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
9943
9954
  viewHandler: {}
9944
9955
  },
9945
9956
  setup(__props) {
9957
+ const props = __props;
9958
+ const { pagination } = props.viewHandler;
9946
9959
  return (_ctx, _cache) => {
9947
9960
  const _component_el_card = resolveComponent("el-card");
9961
+ const _component_el_pagination = resolveComponent("el-pagination");
9948
9962
  const _directive_loading = resolveDirective("loading");
9949
9963
  return openBlock(), createBlock(_sfc_main$b, null, {
9950
9964
  header: withCtx(() => [
@@ -9988,6 +10002,21 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
9988
10002
  ])) : createCommentVNode("", true)
9989
10003
  ])
9990
10004
  ]),
10005
+ footer: withCtx(() => [
10006
+ unref(pagination) ? (openBlock(), createBlock(_component_el_pagination, {
10007
+ key: 0,
10008
+ "current-page": unref(pagination).currentPage,
10009
+ "onUpdate:currentPage": _cache[0] || (_cache[0] = ($event) => unref(pagination).currentPage = $event),
10010
+ "page-size": unref(pagination).pageSize,
10011
+ "onUpdate:pageSize": _cache[1] || (_cache[1] = ($event) => unref(pagination).pageSize = $event),
10012
+ "page-sizes": [10, 20, 30, 40, 50, 100],
10013
+ total: _ctx.viewHandler.total,
10014
+ layout: "total, sizes, prev, pager, next",
10015
+ background: "",
10016
+ onCurrentChange: _ctx.viewHandler.onCurrentPageChange,
10017
+ onSizeChange: _ctx.viewHandler.onPageSizeChange
10018
+ }, null, 8, ["current-page", "page-size", "total", "onCurrentChange", "onSizeChange"])) : createCommentVNode("", true)
10019
+ ]),
9991
10020
  _: 3
9992
10021
  });
9993
10022
  };