@ditari/bsui 1.0.63 → 1.0.64

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),q=require("vue-request"),z=require("../../utils/get.cjs.js"),f=(r,e={})=>{e.pagination||(e.pagination={currentKey:"page",pageSizeKey:"limit",totalKey:"data.total"});const{dataKey:i,pagination:{currentKey:l,pageSizeKey:c}}=e,a=e.params||n.ref({}),{total:s,pageSize:g,current:v,loading:d,data:p,run:u}=q.usePagination(r,{manual:!0,pagination:e.pagination,loadingDelay:400,loadingKeep:100,onSuccess:(t,o)=>{e.onSuccess&&e.onSuccess(t,o)},onError:(t,o)=>{console.log(o,t)}}),y=n.computed(()=>({total:s.value,current:v.value,pageSize:g.value})),S=n.computed(()=>z.get(p.value,i||"data",[])||[]),m=t=>{a.value[l]=t.page,a.value[c]=t.size,u(a.value||{})},K=t=>{a.value={...a.value,...t},a.value[l]=1,u(a.value||{})};return n.onMounted(()=>{e.manual&&u(a.value)}),{data:S,pagination:y,loading:d,run:u,onPageChange:m,onQuery:K}};exports.useRequestList=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),q=require("vue-request"),f=require("../../utils/get.cjs.js"),z=(i,e={})=>{e.pagination||(e.pagination={currentKey:"page",pageSizeKey:"limit",totalKey:"data.total"}),e.manual===void 0&&(e.manual=!0);const{dataKey:o,pagination:{currentKey:r,pageSizeKey:c}}=e,a=e.params||n.ref({}),{total:s,pageSize:g,current:v,loading:d,data:m,run:u}=q.usePagination(i,{manual:!0,pagination:e.pagination,loadingDelay:400,loadingKeep:100,onSuccess:(t,l)=>{e.onSuccess&&e.onSuccess(t,l)},onError:(t,l)=>{console.log(l,t)}}),y=n.computed(()=>({total:s.value,current:v.value,pageSize:g.value})),S=n.computed(()=>f.get(m.value,o||"data",[])||[]),p=t=>{a.value[r]=t.page,a.value[c]=t.size,u(a.value||{})},K=t=>{a.value={...a.value,...t},a.value[r]=1,u(a.value||{})};return n.onMounted(()=>{e.manual&&u(a.value)}),{data:S,pagination:y,loading:d,run:u,onPageChange:p,onQuery:K}};exports.useRequestList=z;
@@ -1,23 +1,23 @@
1
- import { ref as f, computed as l, onMounted as z } from "vue";
1
+ import { ref as S, computed as r, onMounted as z } from "vue";
2
2
  import { usePagination as D } from "vue-request";
3
3
  import { get as P } from "../../utils/get.esm.js";
4
- const C = (r, a = {}) => {
4
+ const C = (o, a = {}) => {
5
5
  a.pagination || (a.pagination = {
6
6
  currentKey: "page",
7
7
  pageSizeKey: "limit",
8
8
  totalKey: "data.total"
9
- });
9
+ }), a.manual === void 0 && (a.manual = !0);
10
10
  const {
11
11
  dataKey: i,
12
- pagination: { currentKey: o, pageSizeKey: c }
13
- } = a, e = a.params || f({}), {
12
+ pagination: { currentKey: l, pageSizeKey: c }
13
+ } = a, e = a.params || S({}), {
14
14
  total: g,
15
- pageSize: s,
16
- current: v,
17
- loading: m,
18
- data: p,
15
+ pageSize: m,
16
+ current: s,
17
+ loading: v,
18
+ data: d,
19
19
  run: n
20
- } = D(r, {
20
+ } = D(o, {
21
21
  manual: !0,
22
22
  pagination: a.pagination,
23
23
  loadingDelay: 400,
@@ -28,26 +28,26 @@ const C = (r, a = {}) => {
28
28
  onError: (t, u) => {
29
29
  console.log(u, t);
30
30
  }
31
- }), d = l(() => ({
31
+ }), p = r(() => ({
32
32
  total: g.value,
33
- current: v.value,
34
- pageSize: s.value
35
- })), y = l(
36
- () => P(p.value, i || "data", []) || []
37
- ), K = (t) => {
38
- e.value[o] = t.page, e.value[c] = t.size, n(e.value || {});
39
- }, S = (t) => {
40
- e.value = { ...e.value, ...t }, e.value[o] = 1, n(e.value || {});
33
+ current: s.value,
34
+ pageSize: m.value
35
+ })), y = r(
36
+ () => P(d.value, i || "data", []) || []
37
+ ), f = (t) => {
38
+ e.value[l] = t.page, e.value[c] = t.size, n(e.value || {});
39
+ }, K = (t) => {
40
+ e.value = { ...e.value, ...t }, e.value[l] = 1, n(e.value || {});
41
41
  };
42
42
  return z(() => {
43
43
  a.manual && n(e.value);
44
44
  }), {
45
45
  data: y,
46
- pagination: d,
47
- loading: m,
46
+ pagination: p,
47
+ loading: v,
48
48
  run: n,
49
- onPageChange: K,
50
- onQuery: S
49
+ onPageChange: f,
50
+ onQuery: K
51
51
  };
52
52
  };
53
53
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ditari/bsui",
3
- "version": "1.0.63",
3
+ "version": "1.0.64",
4
4
  "files": [
5
5
  "dist/**",
6
6
  "src"
@@ -29,7 +29,9 @@ const useRequestList = (service: any, options: Options = {}) => {
29
29
  totalKey: "data.total"
30
30
  };
31
31
  }
32
-
32
+ if (options.manual === undefined) {
33
+ options.manual = true;
34
+ }
33
35
  const {
34
36
  dataKey,
35
37
  pagination: { currentKey, pageSizeKey }