@lingshugroup/web-plus 1.0.7 → 1.0.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/lib/index.css.br CHANGED
Binary file
package/lib/index.css.gz CHANGED
Binary file
@@ -0,0 +1 @@
1
+ "use strict";var d=Object.defineProperty;var o=(e,t)=>d(e,"name",{value:t,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("vue");function c(e=500,t){const a=f.ref(!0);let l=null;async function n(s){a.value=!0;const i=Date.now();let u;try{u=await s()}finally{const r=Date.now()-i;r<e?l=setTimeout(()=>{a.value=!1,t(u),clearTimeout(l),l=null},e-r):(a.value=!1,t(u))}}return o(n,"loadData"),{loading:a,loadData:n}}o(c,"useDelayLoader");exports.default=c;
@@ -0,0 +1,25 @@
1
+ var i = Object.defineProperty;
2
+ var n = (e, t) => i(e, "name", { value: t, configurable: !0 });
3
+ import { ref as d } from "vue";
4
+ function D(e = 500, t) {
5
+ const a = d(!0);
6
+ let l = null;
7
+ async function u(s) {
8
+ a.value = !0;
9
+ const f = Date.now();
10
+ let o;
11
+ try {
12
+ o = await s();
13
+ } finally {
14
+ const r = Date.now() - f;
15
+ r < e ? l = setTimeout(() => {
16
+ a.value = !1, t(o), clearTimeout(l), l = null;
17
+ }, e - r) : (a.value = !1, t(o));
18
+ }
19
+ }
20
+ return n(u, "loadData"), { loading: a, loadData: u };
21
+ }
22
+ n(D, "useDelayLoader");
23
+ export {
24
+ D as default
25
+ };
@@ -1 +1 @@
1
- "use strict";var D=Object.defineProperty;var u=(r,c)=>D(r,"name",{value:c,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue");function M(r,c,P){const l=t.ref(!0),o=t.ref(!1),a=t.ref(1),s=t.ref(10),z=[10,20,30,50],i=t.ref([]),f=t.ref(0),{autoFetch:T=!0,dealData:v,dealParams:m}=P||{},n=u((e=!0,C=!1)=>{if(!r||e&&o.value)return;e&&(o.value=!0),C&&(l.value=!0);let d={currentPage:a.value,pageSize:s.value,...c};m&&(d=m(d)),r(d).then(g=>{if(v&&typeof v=="function"){const{data:h,total:b=0}=v(g);i.value=h||[],f.value=Number(b||0)}else{const{records:h=[],total:b}=g||{};i.value=h||[],f.value=Number(b||0)}}).catch(g=>{}).finally(()=>{o.value=!1,l.value&&setTimeout(()=>{l.value=!1},200)})},"loadData");t.watch(a,e=>{p(e)}),t.watch(s,e=>{S(e)});const p=u(e=>{a.value=e,n()},"handleCurrentPageChange"),S=u(e=>{s.value=e,a.value=1,n()},"handleSizeChange"),y=u(()=>{a.value=1,t.nextTick(()=>{n()})},"handleReset");return t.onMounted(()=>{T&&(l.value=!0,n())}),{isFirst:l,loading:o,pageSize:s,pageSizes:z,currentPage:a,tableData:i,total:f,handleCurrentPageChange:p,handleSizeChange:S,handleReset:y,loadData:n}}u(M,"useTableListHook");exports.default=M;
1
+ "use strict";var x=Object.defineProperty;var t=(u,r)=>x(u,"name",{value:r,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const A=require("../useDelayLoader/index.cjs"),l=require("vue");function E(u,r,D){const{currentPageProp:d=1,pageSizeProp:g=10,isDelayLoader:P=!1,isFullDose:y=!1,autoFetch:F=!0,hasPanigation:m=!0,callbackAfter:h,dealParams:z,dealData:S}=D||{},b=l.ref(!0),c=l.ref(!1),n=l.ref(d),i=l.ref(g),N=[10,20,30,50],o=l.ref([]),T=l.ref([]),s=l.ref(0),k=t(e=>{if(m){if(y){const a=e||[];o.value=a||[],T.value=a,s.value=Number(a.length)}else if(S&&typeof S=="function"){const{data:a,total:v=0}=S(e);o.value=a||[],s.value=Number(v||0)}else{const{records:a=[],total:v}=e||{};o.value=a||[],s.value=Number(v)}h&&h(e,{tableData:o,total:s})}else o.value=e,h&&h(e,{})},"disposeResponseData"),C=t(()=>new Promise((e,a)=>{if(!u){a(new Error("requestFn is required"));return}const v=(typeof r=="function"?r():r)||{};let w={currentPage:m?n.value:null,pageSize:m?i.value:null,...v};z&&(w=z(w)),u(w).then(p=>{P||k(p),e(p)}).catch(p=>{a(p)}).finally(()=>{c.value=!1,setTimeout(()=>{b.value=!1},400)})}),"requestData"),L=A.default(2e3,e=>{k(e)}),f=t((e=!0,a=!1)=>{if(u&&!(e&&c.value)){if(e&&(c.value=!0),a&&(b.value=!0),P){L.loadData(C);return}C().finally(()=>{c.value=!1})}},"loadData");l.watch(n,e=>{M(e)}),l.watch(i,e=>{R(e)});const M=t(e=>{n.value=e,y?q(o,T,s,n,i):f()},"handleCurrentPageChange"),R=t(e=>{i.value=e,n.value=1,y?q(o,T,s,n,i):f()},"handleSizeChange"),_=t(()=>{n.value=1,l.nextTick(()=>{f()})},"handleReset");return l.onMounted(()=>{F&&(b.value=!0,f())}),{isFirst:b,loading:P?L.loading:c,pageSize:i,pageSizes:N,currentPage:n,tableData:o,total:s,handleCurrentPageChange:M,handleSizeChange:R,handleReset:_,loadData:f}}t(E,"useTableListHook");function q(u,r,D,d,g){u.value=r.value.slice((d.value-1)*g.value,d.value*g.value),D.value=u.value.length}t(q,"sliceTableData");exports.default=E;
@@ -1,62 +1,101 @@
1
- var x = Object.defineProperty;
2
- var t = (o, c) => x(o, "name", { value: c, configurable: !0 });
3
- import { ref as u, watch as P, onMounted as y, nextTick as N } from "vue";
4
- function M(o, c, S) {
5
- const l = u(!0), r = u(!1), a = u(1), s = u(10), C = [10, 20, 30, 50], i = u([]), f = u(0), { autoFetch: D = !0, dealData: v, dealParams: p } = S || {}, n = /* @__PURE__ */ t((e = !0, k = !1) => {
6
- if (!o || e && r.value)
7
- return;
8
- e && (r.value = !0), k && (l.value = !0);
9
- let d = {
10
- currentPage: a.value,
11
- pageSize: s.value,
12
- ...c
13
- };
14
- p && (d = p(d)), o(d).then((g) => {
15
- if (v && typeof v == "function") {
16
- const { data: h, total: m = 0 } = v(g);
17
- i.value = h || [], f.value = Number(m || 0);
1
+ var M = Object.defineProperty;
2
+ var l = (t, o) => M(t, "name", { value: o, configurable: !0 });
3
+ import q from "../useDelayLoader/index.js";
4
+ import { ref as i, watch as F, onMounted as B, nextTick as G } from "vue";
5
+ function O(t, o, D) {
6
+ const {
7
+ currentPageProp: d = 1,
8
+ pageSizeProp: g = 10,
9
+ isDelayLoader: b = !1,
10
+ isFullDose: P = !1,
11
+ autoFetch: A = !0,
12
+ hasPanigation: y = !0,
13
+ callbackAfter: p,
14
+ dealParams: k,
15
+ dealData: S
16
+ } = D || {}, h = i(!0), c = i(!1), u = i(d), r = i(g), E = [10, 20, 30, 50], n = i([]), z = i([]), s = i(0), w = /* @__PURE__ */ l((e) => {
17
+ if (y) {
18
+ if (P) {
19
+ const a = e || [];
20
+ n.value = a || [], z.value = a, s.value = Number(a.length);
21
+ } else if (S && typeof S == "function") {
22
+ const { data: a, total: v = 0 } = S(e);
23
+ n.value = a || [], s.value = Number(v || 0);
18
24
  } else {
19
- const { records: h = [], total: m } = g || {};
20
- i.value = h || [], f.value = Number(m || 0);
25
+ const { records: a = [], total: v } = e || {};
26
+ n.value = a || [], s.value = Number(v);
21
27
  }
22
- }).catch((g) => {
28
+ p && p(e, { tableData: n, total: s });
29
+ } else
30
+ n.value = e, p && p(e, {});
31
+ }, "disposeResponseData"), C = /* @__PURE__ */ l(() => new Promise((e, a) => {
32
+ if (!t) {
33
+ a(new Error("requestFn is required"));
34
+ return;
35
+ }
36
+ const v = (typeof o == "function" ? o() : o) || {};
37
+ let T = {
38
+ currentPage: y ? u.value : null,
39
+ pageSize: y ? r.value : null,
40
+ ...v
41
+ };
42
+ k && (T = k(T)), t(T).then((m) => {
43
+ b || w(m), e(m);
44
+ }).catch((m) => {
45
+ a(m);
23
46
  }).finally(() => {
24
- r.value = !1, l.value && setTimeout(() => {
25
- l.value = !1;
26
- }, 200);
47
+ c.value = !1, setTimeout(() => {
48
+ h.value = !1;
49
+ }, 400);
27
50
  });
51
+ }), "requestData"), L = q(2e3, (e) => {
52
+ w(e);
53
+ }), f = /* @__PURE__ */ l((e = !0, a = !1) => {
54
+ if (t && !(e && c.value)) {
55
+ if (e && (c.value = !0), a && (h.value = !0), b) {
56
+ L.loadData(C);
57
+ return;
58
+ }
59
+ C().finally(() => {
60
+ c.value = !1;
61
+ });
62
+ }
28
63
  }, "loadData");
29
- P(a, (e) => {
30
- b(e);
31
- }), P(s, (e) => {
32
- z(e);
64
+ F(u, (e) => {
65
+ R(e);
66
+ }), F(r, (e) => {
67
+ x(e);
33
68
  });
34
- const b = /* @__PURE__ */ t((e) => {
35
- a.value = e, n();
36
- }, "handleCurrentPageChange"), z = /* @__PURE__ */ t((e) => {
37
- s.value = e, a.value = 1, n();
38
- }, "handleSizeChange"), T = /* @__PURE__ */ t(() => {
39
- a.value = 1, N(() => {
40
- n();
69
+ const R = /* @__PURE__ */ l((e) => {
70
+ u.value = e, P ? N(n, z, s, u, r) : f();
71
+ }, "handleCurrentPageChange"), x = /* @__PURE__ */ l((e) => {
72
+ r.value = e, u.value = 1, P ? N(n, z, s, u, r) : f();
73
+ }, "handleSizeChange"), H = /* @__PURE__ */ l(() => {
74
+ u.value = 1, G(() => {
75
+ f();
41
76
  });
42
77
  }, "handleReset");
43
- return y(() => {
44
- D && (l.value = !0, n());
78
+ return B(() => {
79
+ A && (h.value = !0, f());
45
80
  }), {
46
- isFirst: l,
47
- loading: r,
48
- pageSize: s,
49
- pageSizes: C,
50
- currentPage: a,
51
- tableData: i,
52
- total: f,
53
- handleCurrentPageChange: b,
54
- handleSizeChange: z,
55
- handleReset: T,
56
- loadData: n
81
+ isFirst: h,
82
+ loading: b ? L.loading : c,
83
+ pageSize: r,
84
+ pageSizes: E,
85
+ currentPage: u,
86
+ tableData: n,
87
+ total: s,
88
+ handleCurrentPageChange: R,
89
+ handleSizeChange: x,
90
+ handleReset: H,
91
+ loadData: f
57
92
  };
58
93
  }
59
- t(M, "useTableListHook");
94
+ l(O, "useTableListHook");
95
+ function N(t, o, D, d, g) {
96
+ t.value = o.value.slice((d.value - 1) * g.value, d.value * g.value), D.value = t.value.length;
97
+ }
98
+ l(N, "sliceTableData");
60
99
  export {
61
- M as default
100
+ O as default
62
101
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=;/* empty css */;/* empty css */const t=,/* empty css */u=t.default(e.default,[["__scopeId","data-v-d6223962"]]);exports.default=u;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=;/* empty css */;/* empty css */const t=,/* empty css */u=t.default(e.default,[["__scopeId","data-v-d2e67b71"]]);exports.default=u;
@@ -1,7 +1,7 @@
1
1
  import o from "./index2.js";
2
2
  /* empty css */
3
3
  import t from "../../../../../_virtual/_plugin-vue_export-helper/index.js";
4
- const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d6223962"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d2e67b71"]]);
5
5
  export {
6
6
  p as default
7
7
  };
@@ -1 +1 @@
1
- "use strict";var J=Object.defineProperty;var n=(p,w)=>J(p,"name",{value:w,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */const e=require("vue"),Q=,/* empty css */i=require("element-plus"),W=,/* empty css */X=,/* empty css */Y=,/* empty css */Z=,/* empty css */x=,/* empty css */_=,/* empty css */ee=,/* empty css */te={key:0,class:"animate_fadeIn transition-all-300 ls-list-wrap"},le={class:"flex items-center"},ae=e.defineComponent({name:"LSList"}),oe=e.defineComponent({...ae,props:W.lsListProps,emits:["submitForm"],setup(p,{expose:w,emit:S}){const{jumpRouteCom:T,currentRouter:v}=Z.default(),t=p,P=S,{isFirst:D,loading:c,tableData:$,total:C,pageSize:b,currentPage:m,handleReset:E,loadData:h}=Q.default(t.listApi,t.formData,{dealData:t==null?void 0:t.dealData,dealParams:t==null?void 0:t.dealParams});function q(l){P("submitForm",l),t!=null&&t.queryFn?t.queryFn(l):h()}n(q,"submitForm");function R(l){E()}n(R,"resetForm");const y=e.computed(()=>v?v.value.path:"");function V(){t!=null&&t.addFn?t.addFn():T({path:t!=null&&t.addRoutePath?t.addRoutePath:`${y.value}/add`},1)}n(V,"onAdd");function N(l,a){t!=null&&t.tableDetailFn?t.tableDetailFn(a):T({path:`${t!=null&&t.detailRoutePath?t.detailRoutePath:`${y.value}/detail`}/${l}`},1)}n(N,"onDetail");function F(l,a){t!=null&&t.tableEditFn?t.tableEditFn(a):T({path:`${t!=null&&t.editRoutePath?t.editRoutePath:`${y.value}/edit`}/${l}`},1)}n(F,"onEdit");const k=e.ref(void 0),u=e.ref(!1);function A(l,a){if(t.delApi){k.value=l,u.value=!0;let d=l;t!=null&&t.dealDelParams&&(d=t.dealDelParams(a)),t.delApi(d).then(()=>{i.ElMessage.success("删除成功"),h()}).catch(f=>{}).finally(()=>{u.value=!1})}}n(A,"onDel");const B=e.ref(),g=e.ref(!1);function L(l,a,d){B.value=l;const f=n((s,o)=>{if(t.switchApi){g.value=!0;let r=l;t!=null&&t.dealSwitchParams&&(r=t.dealSwitchParams(d)),t.switchApi(r).then(()=>{h(!1),s(!0)}).catch(()=>{o(new Error("Error"))}).finally(()=>{g.value=!1})}else o(new Error("Error"))},"onSwitch");return new Promise((s,o)=>{a?i.ElMessageBox.confirm('<strong class="text-14px">请问是否关闭?</strong>',{confirmButtonText:"确定",cancelButtonText:"取消",dangerouslyUseHTMLString:!0,customStyle:{width:"240px"}}).then(()=>{f(s,o)}).catch(()=>{o(new Error("Error"))}):f(s,o)})}n(L,"switchBeforeChange");function K(l){let a=!1;return t!=null&&t.disabledTableSwitch&&(typeof t.disabledTableSwitch=="boolean"?a=t.disabledTableSwitch:typeof t.disabledTableSwitch=="function"&&(a=t.disabledTableSwitch(l))),!!a}n(K,"disabledTableSwitch");function z(l){let a=!1;return t!=null&&t.showTableDetail&&(typeof t.showTableDetail=="boolean"?a=t.showTableDetail:typeof t.showTableDetail=="function"&&(a=t.showTableDetail(l))),!!a}n(z,"showTableDetail");function O(l){let a=!1;return t!=null&&t.disabledTableDetail&&(typeof t.disabledTableDetail=="boolean"?a=t.disabledTableDetail:typeof t.disabledTableDetail=="function"&&(a=t.disabledTableDetail(l))),!!a}n(O,"disabledTableDetail");function M(l){let a=!1;return t!=null&&t.showTableEdit&&(typeof t.showTableEdit=="boolean"?a=t.showTableEdit:typeof t.showTableEdit=="function"&&(a=t.showTableEdit(l))),!!a}n(M,"showTableEdit");function H(l){let a=!1;return t!=null&&t.disabledTableEdit&&(typeof t.disabledTableEdit=="boolean"?a=t.disabledTableEdit:typeof t.disabledTableEdit=="function"&&(a=t.disabledTableEdit(l))),!!a}n(H,"disabledTableEdit");function I(l){let a=!1;return t!=null&&t.showTableDel&&(typeof t.showTableDel=="boolean"?a=t.showTableDel:typeof t.showTableDel=="function"&&(a=t.showTableDel(l))),!!a}n(I,"showTableDel");function U(l){let a=!1;return t!=null&&t.disabledTableDel&&(typeof t.disabledTableDel=="boolean"?a=t.disabledTableDel:typeof t.disabledTableDel=="function"&&(a=t.disabledTableDel(l))),!!a}n(U,"disabledTableDel");const j=e.h(i.ElDivider,{direction:"vertical"});return w({loadData:h,handleReset:E,isFirst:D,loading:c,currentPage:m,pageSize:b,total:C}),(l,a)=>{const d=x.ElTableColumn,f=_.ElPopconfirm,s=ee.ElSkeleton;return e.unref(D)?(e.openBlock(),e.createBlock(s,{key:1,rows:5,animated:""})):(e.openBlock(),e.createElementBlock("div",te,[l.showForm?(e.openBlock(),e.createBlock(X.default,e.mergeProps({key:0,class:["mb-6px ls-form-cpo",l.formClass],"label-position":"top","show-btn-loading":!1,colon:!1,inline:!0,"form-data":l.formData,"form-items":l.formItems,loading:e.unref(c),"confirm-text":"查询"},l.formAttrs,{onSubmit:q,onReset:R}),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"form-append",{},void 0,!0)]),_:3},16,["class","form-data","form-items","loading"])):e.createCommentVNode("",!0),l.showOperate?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.$slots.operate?e.renderSlot(l.$slots,"operate",{key:0},void 0,!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.showOperateDivider?(e.openBlock(),e.createBlock(e.unref(i.ElDivider),{key:0,"border-style":"dashed"})):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["mt-24px flex items-center justify-start",l.operateClass])},[e.renderSlot(l.$slots,"operate-prepend",{},void 0,!0),l.showAdd?(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:0,type:"primary",disabled:e.unref(c),onClick:V},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.addBtnText),1)]),_:1},8,["disabled"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"operate-append",{},void 0,!0)],2)],64))],64)):e.createCommentVNode("",!0),e.createVNode(Y.default,e.mergeProps({class:["ls-table-cpo",[l.showOperate?"mt-16px":"mt-24px"]],"show-overflow-tooltip":!0,loading:e.unref(c),total:e.unref(C),"table-data":e.unref($),"table-column":l.tableColumn,"current-page":e.unref(m),"onUpdate:currentPage":a[0]||(a[0]=o=>e.isRef(m)?m.value=o:null),"page-size":e.unref(b),"onUpdate:pageSize":a[1]||(a[1]=o=>e.isRef(b)?b.value=o:null)},l.tableAttrs,e.toHandlers(l.tableListeners||{})),e.createSlots({default:e.withCtx(()=>[l.showTableSwitch?(e.openBlock(),e.createBlock(d,e.mergeProps({key:0,prop:l.switchProp,label:"是否开启",width:"100"},l.tableSwitchColumn),{default:e.withCtx(({row:o})=>[e.createVNode(e.unref(i.ElSwitch),{class:"ls-list-table__switch","model-value":o[l.switchProp]?1:0,"active-value":1,"inactive-value":0,loading:e.unref(g)&&o[l.tableRowKey]===e.unref(B),"before-change":n(()=>L(o[l.tableRowKey],o[l.switchProp],o),"before-change"),disabled:K(o)},null,8,["model-value","loading","before-change","disabled"])]),_:1},16,["prop"])):e.createCommentVNode("",!0),l.showTableOperate?(e.openBlock(),e.createBlock(d,e.mergeProps({key:1,fixed:"right",prop:"operate",label:"操作","show-overflow-tooltip":!1},l.tableOperateColumn),{default:e.withCtx(({row:o})=>[e.createElementVNode("div",le,[e.createVNode(e.unref(i.ElSpace),{size:0,spacer:e.unref(j)},{default:e.withCtx(()=>[e.renderSlot(l.$slots,"table-operate-prepend",{row:o},void 0,!0),z(o)?(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:0,disabled:O(o),link:"",type:"primary",onClick:n(r=>N(o[l.tableRowKey],o),"onClick")},{default:e.withCtx(()=>[e.createTextVNode(" 查看 ")]),_:2},1032,["disabled","onClick"])):e.createCommentVNode("",!0),M(o)?(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:1,disabled:H(o),link:"",type:"primary",onClick:n(r=>F(o[l.tableRowKey],o),"onClick")},{default:e.withCtx(()=>[e.createTextVNode(" 编辑 ")]),_:2},1032,["disabled","onClick"])):e.createCommentVNode("",!0),I(o)?(e.openBlock(),e.createBlock(f,{key:2,"hide-icon":"",placement:"top",width:"180","confirm-button-text":"确认","cancel-button-text":"取消",title:"是否删除当前列数据?",onConfirm:n(r=>A(o[l.tableRowKey],o),"onConfirm")},{reference:e.withCtx(()=>[e.createVNode(e.unref(i.ElButton),{link:"",type:"danger",disabled:e.unref(u)||U(o),loading:e.unref(u)&&e.unref(k)===o[l.tableRowKey]},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)&&e.unref(k)===o[l.tableRowKey]?"":"删除"),1)]),_:2},1032,["disabled","loading"])]),_:2},1032,["onConfirm"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"table-operate-append",{row:o},void 0,!0)]),_:2},1032,["spacer"])])]),_:3},16)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"table-append",{},void 0,!0)]),_:2},[e.renderList(l.$slots,(o,r)=>({name:r,fn:e.withCtx(({row:G})=>[["default","form-append","operate-prepend","operate-append","table-operate-prepend","table-operate-append","table-append"].includes(`${r}`)?e.createCommentVNode("",!0):e.renderSlot(l.$slots,r,{key:0,row:G},void 0,!0)])}))]),1040,["class","loading","total","table-data","table-column","current-page","page-size"])]))}}});exports.default=oe;
1
+ "use strict";var J=Object.defineProperty;var i=(p,w)=>J(p,"name",{value:w,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */const e=require("vue"),Q=,/* empty css */n=require("element-plus"),W=,/* empty css */X=,/* empty css */Y=,/* empty css */Z=,/* empty css */x=,/* empty css */_=,/* empty css */ee=,/* empty css */te={key:0,class:"animate_fadeIn transition-all-300 ls-list-wrap"},le={class:"flex items-center"},ae=e.defineComponent({name:"LSList"}),oe=e.defineComponent({...ae,props:W.lsListProps,emits:["submitForm"],setup(p,{expose:w,emit:S}){const{jumpRouteCom:T,currentRouter:v}=Z.default(),t=p,P=S,{isFirst:C,loading:c,tableData:$,total:D,pageSize:b,currentPage:m,handleReset:E,loadData:h}=Q.default(t.listApi,t.formData,{dealData:t==null?void 0:t.dealData,dealParams:t==null?void 0:t.dealParams,...t==null?void 0:t.listHookConfig});function q(l){P("submitForm",l),t!=null&&t.queryFn?t.queryFn(l):h()}i(q,"submitForm");function R(l){E()}i(R,"resetForm");const y=e.computed(()=>v?v.value.path:"");function V(){t!=null&&t.addFn?t.addFn():T({path:t!=null&&t.addRoutePath?t.addRoutePath:`${y.value}/add`},1)}i(V,"onAdd");function N(l,a){t!=null&&t.tableDetailFn?t.tableDetailFn(a):T({path:`${t!=null&&t.detailRoutePath?t.detailRoutePath:`${y.value}/detail`}/${l}`},1)}i(N,"onDetail");function F(l,a){t!=null&&t.tableEditFn?t.tableEditFn(a):T({path:`${t!=null&&t.editRoutePath?t.editRoutePath:`${y.value}/edit`}/${l}`},1)}i(F,"onEdit");const k=e.ref(void 0),u=e.ref(!1);function A(l,a){if(t.delApi){k.value=l,u.value=!0;let d=l;t!=null&&t.dealDelParams&&(d=t.dealDelParams(a)),t.delApi(d).then(()=>{n.ElMessage.success("删除成功"),h()}).catch(f=>{}).finally(()=>{u.value=!1})}}i(A,"onDel");const B=e.ref(),g=e.ref(!1);function L(l,a,d){B.value=l;const f=i((s,o)=>{if(t.switchApi){g.value=!0;let r=l;t!=null&&t.dealSwitchParams&&(r=t.dealSwitchParams(d)),t.switchApi(r).then(()=>{h(!1),s(!0)}).catch(()=>{o(new Error("Error"))}).finally(()=>{g.value=!1})}else o(new Error("Error"))},"onSwitch");return new Promise((s,o)=>{a?n.ElMessageBox.confirm('<strong class="text-14px">请问是否关闭?</strong>',{confirmButtonText:"确定",cancelButtonText:"取消",dangerouslyUseHTMLString:!0,customStyle:{width:"240px"}}).then(()=>{f(s,o)}).catch(()=>{o(new Error("Error"))}):f(s,o)})}i(L,"switchBeforeChange");function K(l){let a=!1;return t!=null&&t.disabledTableSwitch&&(typeof t.disabledTableSwitch=="boolean"?a=t.disabledTableSwitch:typeof t.disabledTableSwitch=="function"&&(a=t.disabledTableSwitch(l))),!!a}i(K,"disabledTableSwitch");function z(l){let a=!1;return t!=null&&t.showTableDetail&&(typeof t.showTableDetail=="boolean"?a=t.showTableDetail:typeof t.showTableDetail=="function"&&(a=t.showTableDetail(l))),!!a}i(z,"showTableDetail");function O(l){let a=!1;return t!=null&&t.disabledTableDetail&&(typeof t.disabledTableDetail=="boolean"?a=t.disabledTableDetail:typeof t.disabledTableDetail=="function"&&(a=t.disabledTableDetail(l))),!!a}i(O,"disabledTableDetail");function H(l){let a=!1;return t!=null&&t.showTableEdit&&(typeof t.showTableEdit=="boolean"?a=t.showTableEdit:typeof t.showTableEdit=="function"&&(a=t.showTableEdit(l))),!!a}i(H,"showTableEdit");function M(l){let a=!1;return t!=null&&t.disabledTableEdit&&(typeof t.disabledTableEdit=="boolean"?a=t.disabledTableEdit:typeof t.disabledTableEdit=="function"&&(a=t.disabledTableEdit(l))),!!a}i(M,"disabledTableEdit");function I(l){let a=!1;return t!=null&&t.showTableDel&&(typeof t.showTableDel=="boolean"?a=t.showTableDel:typeof t.showTableDel=="function"&&(a=t.showTableDel(l))),!!a}i(I,"showTableDel");function U(l){let a=!1;return t!=null&&t.disabledTableDel&&(typeof t.disabledTableDel=="boolean"?a=t.disabledTableDel:typeof t.disabledTableDel=="function"&&(a=t.disabledTableDel(l))),!!a}i(U,"disabledTableDel");const j=e.h(n.ElDivider,{direction:"vertical"});return w({loadData:h,handleReset:E,isFirst:C,loading:c,currentPage:m,pageSize:b,total:D}),(l,a)=>{const d=x.ElTableColumn,f=_.ElPopconfirm,s=ee.ElSkeleton;return e.unref(C)?(e.openBlock(),e.createBlock(s,{key:1,rows:5,animated:""})):(e.openBlock(),e.createElementBlock("div",te,[l.showForm?(e.openBlock(),e.createBlock(X.default,e.mergeProps({key:0,class:["mb-6px ls-form-cpo",l.formClass],"label-position":"top","show-btn-loading":!1,colon:!1,inline:!0,"form-data":l.formData,"form-items":l.formItems,loading:e.unref(c),"confirm-text":"查询"},l.formAttrs,{onSubmit:q,onReset:R}),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"form-append",{},void 0,!0)]),_:3},16,["class","form-data","form-items","loading"])):e.createCommentVNode("",!0),l.showOperate?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.$slots.operate?e.renderSlot(l.$slots,"operate",{key:0},void 0,!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.showOperateDivider?(e.openBlock(),e.createBlock(e.unref(n.ElDivider),{key:0,"border-style":"dashed"})):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["mt-24px flex items-center justify-start",l.operateClass])},[e.renderSlot(l.$slots,"operate-prepend",{},void 0,!0),l.showAdd?(e.openBlock(),e.createBlock(e.unref(n.ElButton),{key:0,type:"primary",disabled:e.unref(c),onClick:V},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.addBtnText),1)]),_:1},8,["disabled"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"operate-append",{},void 0,!0)],2)],64))],64)):e.createCommentVNode("",!0),e.createVNode(Y.default,e.mergeProps({class:["ls-table-cpo",[l.showOperate?"mt-16px":"mt-24px"]],"show-overflow-tooltip":!0,loading:e.unref(c),total:e.unref(D),"table-data":e.unref($),"table-column":l.tableColumn,"current-page":e.unref(m),"onUpdate:currentPage":a[0]||(a[0]=o=>e.isRef(m)?m.value=o:null),"page-size":e.unref(b),"onUpdate:pageSize":a[1]||(a[1]=o=>e.isRef(b)?b.value=o:null)},l.tableAttrs,e.toHandlers(l.tableListeners||{})),e.createSlots({default:e.withCtx(()=>[l.showTableSwitch?(e.openBlock(),e.createBlock(d,e.mergeProps({key:0,prop:l.switchProp,label:"是否开启",width:"100"},l.tableSwitchColumn),{default:e.withCtx(({row:o})=>[e.createVNode(e.unref(n.ElSwitch),{class:"ls-list-table__switch","model-value":o[l.switchProp]?1:0,"active-value":1,"inactive-value":0,loading:e.unref(g)&&o[l.tableRowKey]===e.unref(B),"before-change":i(()=>L(o[l.tableRowKey],o[l.switchProp],o),"before-change"),disabled:K(o)},null,8,["model-value","loading","before-change","disabled"])]),_:1},16,["prop"])):e.createCommentVNode("",!0),l.showTableOperate?(e.openBlock(),e.createBlock(d,e.mergeProps({key:1,fixed:"right",prop:"operate",label:"操作","show-overflow-tooltip":!1},l.tableOperateColumn),{default:e.withCtx(({row:o})=>[e.createElementVNode("div",le,[e.createVNode(e.unref(n.ElSpace),{size:0,spacer:e.unref(j)},{default:e.withCtx(()=>[e.renderSlot(l.$slots,"table-operate-prepend",{row:o},void 0,!0),z(o)?(e.openBlock(),e.createBlock(e.unref(n.ElButton),{key:0,disabled:O(o),link:"",type:"primary",onClick:i(r=>N(o[l.tableRowKey],o),"onClick")},{default:e.withCtx(()=>[e.createTextVNode(" 查看 ")]),_:2},1032,["disabled","onClick"])):e.createCommentVNode("",!0),H(o)?(e.openBlock(),e.createBlock(e.unref(n.ElButton),{key:1,disabled:M(o),link:"",type:"primary",onClick:i(r=>F(o[l.tableRowKey],o),"onClick")},{default:e.withCtx(()=>[e.createTextVNode(" 编辑 ")]),_:2},1032,["disabled","onClick"])):e.createCommentVNode("",!0),I(o)?(e.openBlock(),e.createBlock(f,{key:2,"hide-icon":"",placement:"top",width:"180","confirm-button-text":"确认","cancel-button-text":"取消",title:"是否删除当前列数据?",onConfirm:i(r=>A(o[l.tableRowKey],o),"onConfirm")},{reference:e.withCtx(()=>[e.createVNode(e.unref(n.ElButton),{link:"",type:"danger",disabled:e.unref(u)||U(o),loading:e.unref(u)&&e.unref(k)===o[l.tableRowKey]},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)&&e.unref(k)===o[l.tableRowKey]?"":"删除"),1)]),_:2},1032,["disabled","loading"])]),_:2},1032,["onConfirm"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"table-operate-append",{row:o},void 0,!0)]),_:2},1032,["spacer"])])]),_:3},16)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"table-append",{},void 0,!0)]),_:2},[e.renderList(l.$slots,(o,r)=>({name:r,fn:e.withCtx(({row:G})=>[["default","form-append","operate-prepend","operate-append","table-operate-prepend","table-operate-append","table-append"].includes(`${r}`)?e.createCommentVNode("",!0):e.renderSlot(l.$slots,r,{key:0,row:G},void 0,!0)])}))]),1040,["class","loading","total","table-data","table-column","current-page","page-size"])]))}}});exports.default=oe;
@@ -10,7 +10,7 @@ var o = (S, P) => de(S, "name", { value: P, configurable: !0 });
10
10
  /* empty css */
11
11
  /* empty css */
12
12
  /* empty css */
13
- import { defineComponent as q, computed as re, ref as D, h as fe, unref as i, openBlock as n, createElementBlock as L, createBlock as f, mergeProps as v, withCtx as s, renderSlot as u, createCommentVNode as d, Fragment as H, createElementVNode as I, normalizeClass as ue, createTextVNode as g, toDisplayString as V, createVNode as E, isRef as M, toHandlers as be, createSlots as me, renderList as ce } from "vue";
13
+ import { defineComponent as q, computed as re, ref as D, h as fe, unref as i, openBlock as n, createElementBlock as L, createBlock as f, mergeProps as v, withCtx as s, renderSlot as u, createCommentVNode as d, Fragment as O, createElementVNode as I, normalizeClass as ue, createTextVNode as g, toDisplayString as V, createVNode as E, isRef as M, toHandlers as be, createSlots as me, renderList as ce } from "vue";
14
14
  import he from "../../_hooks/useTableListHook/index.js";
15
15
  import { ElDivider as U, ElButton as k, ElSwitch as pe, ElSpace as Te, ElMessage as we, ElMessageBox as ye } from "element-plus";
16
16
  import { lsListProps as De } from "../types/index.js";
@@ -20,20 +20,20 @@ import Ee from "../../_hooks/useRouterHook/index.js";
20
20
  import { ElTableColumn as ke } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.4.38_typescript@5.5.4_/node_modules/element-plus/es/components/table/index/index.js";
21
21
  import { ElPopconfirm as Se } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.4.38_typescript@5.5.4_/node_modules/element-plus/es/components/popconfirm/index/index.js";
22
22
  import { ElSkeleton as Pe } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.4.38_typescript@5.5.4_/node_modules/element-plus/es/components/skeleton/index/index.js";
23
- const $e = {
23
+ const Ce = {
24
24
  key: 0,
25
25
  class: "animate_fadeIn transition-all-300 ls-list-wrap"
26
- }, Ce = { class: "flex items-center" }, Re = q({
26
+ }, $e = { class: "flex items-center" }, Re = q({
27
27
  name: "LSList"
28
28
  }), je = /* @__PURE__ */ q({
29
29
  ...Re,
30
30
  props: De,
31
31
  emits: ["submitForm"],
32
32
  setup(S, { expose: P, emit: N }) {
33
- const { jumpRouteCom: $, currentRouter: A } = Ee(), e = S, G = N, { isFirst: B, loading: p, tableData: J, total: K, pageSize: T, currentPage: w, handleReset: z, loadData: y } = he(
33
+ const { jumpRouteCom: C, currentRouter: A } = Ee(), e = S, G = N, { isFirst: B, loading: p, tableData: J, total: K, pageSize: T, currentPage: w, handleReset: z, loadData: y } = he(
34
34
  e.listApi,
35
35
  e.formData,
36
- { dealData: e == null ? void 0 : e.dealData, dealParams: e == null ? void 0 : e.dealParams }
36
+ { dealData: e == null ? void 0 : e.dealData, dealParams: e == null ? void 0 : e.dealParams, ...e == null ? void 0 : e.listHookConfig }
37
37
  );
38
38
  function Q(t) {
39
39
  G("submitForm", t), e != null && e.queryFn ? e.queryFn(t) : y();
@@ -43,29 +43,29 @@ const $e = {
43
43
  z();
44
44
  }
45
45
  o(W, "resetForm");
46
- const C = re(() => A ? A.value.path : "");
46
+ const $ = re(() => A ? A.value.path : "");
47
47
  function X() {
48
- e != null && e.addFn ? e.addFn() : $(
48
+ e != null && e.addFn ? e.addFn() : C(
49
49
  {
50
- path: e != null && e.addRoutePath ? e.addRoutePath : `${C.value}/add`
50
+ path: e != null && e.addRoutePath ? e.addRoutePath : `${$.value}/add`
51
51
  },
52
52
  1
53
53
  );
54
54
  }
55
55
  o(X, "onAdd");
56
56
  function Y(t, a) {
57
- e != null && e.tableDetailFn ? e.tableDetailFn(a) : $(
57
+ e != null && e.tableDetailFn ? e.tableDetailFn(a) : C(
58
58
  {
59
- path: `${e != null && e.detailRoutePath ? e.detailRoutePath : `${C.value}/detail`}/${t}`
59
+ path: `${e != null && e.detailRoutePath ? e.detailRoutePath : `${$.value}/detail`}/${t}`
60
60
  },
61
61
  1
62
62
  );
63
63
  }
64
64
  o(Y, "onDetail");
65
65
  function Z(t, a) {
66
- e != null && e.tableEditFn ? e.tableEditFn(a) : $(
66
+ e != null && e.tableEditFn ? e.tableEditFn(a) : C(
67
67
  {
68
- path: `${e != null && e.editRoutePath ? e.editRoutePath : `${C.value}/edit`}/${t}`
68
+ path: `${e != null && e.editRoutePath ? e.editRoutePath : `${$.value}/edit`}/${t}`
69
69
  },
70
70
  1
71
71
  );
@@ -85,9 +85,9 @@ const $e = {
85
85
  }
86
86
  }
87
87
  o(j, "onDel");
88
- const O = D(), F = D(!1);
88
+ const H = D(), F = D(!1);
89
89
  function _(t, a, b) {
90
- O.value = t;
90
+ H.value = t;
91
91
  const h = /* @__PURE__ */ o((m, l) => {
92
92
  if (e.switchApi) {
93
93
  F.value = !0;
@@ -168,7 +168,7 @@ const $e = {
168
168
  key: 1,
169
169
  rows: 5,
170
170
  animated: ""
171
- })) : (n(), L("div", $e, [
171
+ })) : (n(), L("div", Ce, [
172
172
  t.showForm ? (n(), f(ve, v({
173
173
  key: 0,
174
174
  class: ["mb-6px ls-form-cpo", t.formClass],
@@ -189,8 +189,8 @@ const $e = {
189
189
  ]),
190
190
  _: 3
191
191
  }, 16, ["class", "form-data", "form-items", "loading"])) : d("", !0),
192
- t.showOperate ? (n(), L(H, { key: 1 }, [
193
- t.$slots.operate ? u(t.$slots, "operate", { key: 0 }, void 0, !0) : (n(), L(H, { key: 1 }, [
192
+ t.showOperate ? (n(), L(O, { key: 1 }, [
193
+ t.$slots.operate ? u(t.$slots, "operate", { key: 0 }, void 0, !0) : (n(), L(O, { key: 1 }, [
194
194
  t.showOperateDivider ? (n(), f(i(U), {
195
195
  key: 0,
196
196
  "border-style": "dashed"
@@ -239,7 +239,7 @@ const $e = {
239
239
  "model-value": l[t.switchProp] ? 1 : 0,
240
240
  "active-value": 1,
241
241
  "inactive-value": 0,
242
- loading: i(F) && l[t.tableRowKey] === i(O),
242
+ loading: i(F) && l[t.tableRowKey] === i(H),
243
243
  "before-change": /* @__PURE__ */ o(() => _(l[t.tableRowKey], l[t.switchProp], l), "before-change"),
244
244
  disabled: x(l)
245
245
  }, null, 8, ["model-value", "loading", "before-change", "disabled"])
@@ -254,7 +254,7 @@ const $e = {
254
254
  "show-overflow-tooltip": !1
255
255
  }, t.tableOperateColumn), {
256
256
  default: s(({ row: l }) => [
257
- I("div", Ce, [
257
+ I("div", $e, [
258
258
  E(i(Te), {
259
259
  size: 0,
260
260
  spacer: i(ne)
@@ -1 +1 @@
1
- "use strict";var l=Object.defineProperty;var t=(e,a)=>l(e,"name",{value:a,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../_utils/runtime/index.cjs"),n=o.buildProps({listApi:{type:Function},dealParams:{type:Function},dealData:{type:Function},delApi:{type:Function},dealDelParams:{type:Function},switchApi:{type:Function},dealSwitchParams:{type:Function},showForm:{type:Boolean,default:!0},formClass:{type:String,default:""},formData:{type:Object,default:t(()=>({}),"default")},formItems:{type:Array,default:t(()=>[],"default")},formAttrs:{type:Object,default:t(()=>{},"default")},queryFn:{type:Function},tableColumn:{type:Array,default:t(()=>[],"default")},tableRowKey:{type:String,default:"id"},tableAttrs:{type:Object,default:t(()=>{},"default")},tableListeners:{type:Object,default:t(()=>{},"default")},showOperate:{type:Boolean,default:!0},showOperateDivider:{type:Boolean,default:!0},operateClass:{type:String,default:""},showAdd:{type:Boolean,default:!0},addBtnText:{type:String,default:"添加"},addFn:{type:Function},showTableSwitch:{type:Boolean,default:!1},switchProp:{type:String,default:"status"},tableSwitchColumn:{type:Object,default:t(()=>{},"default")},disabledTableSwitch:{type:[Boolean,Function],default:!1},showTableOperate:{type:Boolean,default:!0},tableOperateColumn:{type:Object,default:t(()=>{},"default")},tableDetailFn:{type:Function},tableEditFn:{type:Function},showTableDetail:{type:[Boolean,Function],default:!0},disabledTableDetail:{type:[Boolean,Function],default:!1},showTableEdit:{type:[Boolean,Function],default:!0},disabledTableEdit:{type:[Boolean,Function],default:!1},showTableDel:{type:[Boolean,Function],default:!0},disabledTableDel:{type:[Boolean,Function],default:!1},addRoutePath:{type:String,default:""},detailRoutePath:{type:String,default:""},editRoutePath:{type:String,default:""}});exports.lsListProps=n;
1
+ "use strict";var l=Object.defineProperty;var t=(e,a)=>l(e,"name",{value:a,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../_utils/runtime/index.cjs"),n=o.buildProps({listApi:{type:Function},dealParams:{type:Function},dealData:{type:Function},listHookConfig:{type:Object},delApi:{type:Function},dealDelParams:{type:Function},switchApi:{type:Function},dealSwitchParams:{type:Function},showForm:{type:Boolean,default:!0},formClass:{type:String,default:""},formData:{type:Object,default:t(()=>({}),"default")},formItems:{type:Array,default:t(()=>[],"default")},formAttrs:{type:Object,default:t(()=>{},"default")},queryFn:{type:Function},tableColumn:{type:Array,default:t(()=>[],"default")},tableRowKey:{type:String,default:"id"},tableAttrs:{type:Object,default:t(()=>{},"default")},tableListeners:{type:Object,default:t(()=>{},"default")},showOperate:{type:Boolean,default:!0},showOperateDivider:{type:Boolean,default:!0},operateClass:{type:String,default:""},showAdd:{type:Boolean,default:!0},addBtnText:{type:String,default:"添加"},addFn:{type:Function},showTableSwitch:{type:Boolean,default:!1},switchProp:{type:String,default:"status"},tableSwitchColumn:{type:Object,default:t(()=>{},"default")},disabledTableSwitch:{type:[Boolean,Function],default:!1},showTableOperate:{type:Boolean,default:!0},tableOperateColumn:{type:Object,default:t(()=>{},"default")},tableDetailFn:{type:Function},tableEditFn:{type:Function},showTableDetail:{type:[Boolean,Function],default:!0},disabledTableDetail:{type:[Boolean,Function],default:!1},showTableEdit:{type:[Boolean,Function],default:!0},disabledTableEdit:{type:[Boolean,Function],default:!1},showTableDel:{type:[Boolean,Function],default:!0},disabledTableDel:{type:[Boolean,Function],default:!1},addRoutePath:{type:String,default:""},detailRoutePath:{type:String,default:""},editRoutePath:{type:String,default:""}});exports.lsListProps=n;
@@ -14,6 +14,10 @@ const d = o({
14
14
  dealData: {
15
15
  type: Function
16
16
  },
17
+ // 列表hook配置
18
+ listHookConfig: {
19
+ type: Object
20
+ },
17
21
  // 删除api
18
22
  delApi: {
19
23
  type: Function
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingshugroup/web-plus",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "零数科技前端UI组件库(Vue3)",
5
5
  "type": "module",
6
6
  "main": "./lib/index/index.cjs",