@lingshugroup/web-plus 1.3.2 → 1.4.0
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 +1 -1
- package/lib/index.css.br +0 -0
- package/lib/index.css.gz +0 -0
- package/lib/packages/ls-components/components/form/Form.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/form/Form.vue/index.js +2 -2
- package/lib/packages/ls-components/components/form/Form.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/form/Form.vue/index2.js +29 -29
- package/lib/packages/ls-components/components/form/Form.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/form/Form.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/form/FormItem.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/form/FormItem.vue/index.js +2 -2
- package/lib/packages/ls-components/components/form/FormItem.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/form/FormItem.vue/index2.js +517 -473
- package/lib/packages/ls-components/components/form/FormItem.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/form/FormItem.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/form/types/index.cjs +1 -1
- package/lib/packages/ls-components/components/form/types/index.js +8 -0
- package/lib/packages/ls-components/components/form/types/index.js.br +0 -0
- package/lib/packages/ls-components/components/form/types/index.js.gz +0 -0
- package/lib/packages/ls-components/components/list/List.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/list/List.vue/index.js +2 -2
- package/lib/packages/ls-components/components/list/List.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/list/List.vue/index2.js +120 -107
- package/lib/packages/ls-components/components/list/List.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/list/List.vue/index2.js.gz +0 -0
- package/lib/types/components/form/FormItem.vue.d.ts +44 -0
- package/lib/types/components/form/index.d.ts +50 -0
- package/lib/types/components/form/types.d.ts +2 -0
- package/lib/types/components/list/List.vue.d.ts +2 -0
- package/lib/types/components/list/index.d.ts +6 -0
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var o=Object.defineProperty;var e=(a,l)=>o(a,"name",{value:l,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../_utils/runtime/index.cjs"),r=t.buildProps({formData:{type:Object,default:e(()=>({}),"default"),required:!0},formItems:{type:Array,default:e(()=>[],"default"),required:!0},column:{type:Number,default:1},loading:{type:Boolean,default:!1},showBtnLoading:{type:Boolean,default:!0},read:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},showButtons:{type:Boolean,default:!0},buttonsClass:{type:String,default:""},buttonsLeft:{type:Boolean,default:!1},showReset:{type:Boolean,default:!0},showSubmit:{type:Boolean,default:!0},confirmText:{type:String,default:"确认"},resetText:{type:String,default:"重置"},confirmClassName:{type:String,default:""},colon:{type:Boolean,default:!1},labelEmpty:{type:String,default:"--"},hasDefReadStyle:{type:Boolean,default:!1},hideColumn:{type:Boolean,default:!1}}),u=t.buildProps({isValue:{type:Boolean,default:!1},value:{type:[String,Number,Boolean,Object,Array]},type:{type:String,values:["label","input","textarea","number","radio","checkbox","select","date","datetimerange","timePicker","timeSelect","cascader","multipleCascader","switch","inputRange","inputNumberRange","slot","itemSlot"]},label:{type:String,default:""},prop:{type:[String,Array],default:""},rules:{type:Object,default:e(()=>{},"default")},className:{type:String,default:""},labelClass:{type:String,default:""},labelIconClass:{type:String,default:""},tooltip:{type:String,default:""},options:{type:Array,default:e(()=>[],"default")},attrs:{type:Object,default:e(()=>{},"default")},listeners:{type:Object,default:e(()=>{},"default")},colon:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},read:{type:Boolean,default:!1},labelEmpty:{type:String,default:"--"},labelNumber:{type:Boolean,default:!1},dateFormat:{type:String,default:"YYYY-MM-DD HH:mm:ss"},formatReadValue:{type:Function},rangeSeparator:{type:String,default:"~"},rangeProps:{type:Array,default:e(()=>["start","end"],"default")},radioType:{type:String,default:""},isRow:{type:Boolean,default:!1},selectAll:{type:Boolean,default:!0},index:{type:Number,default:0},slotKey:{type:String,default:""},levelMatch:{type:Boolean,default:!1}});exports.lsFormItemProps=u;exports.lsFormProps=r;
|
|
1
|
+
"use strict";var o=Object.defineProperty;var e=(a,l)=>o(a,"name",{value:l,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../_utils/runtime/index.cjs"),r=t.buildProps({formData:{type:Object,default:e(()=>({}),"default"),required:!0},formItems:{type:Array,default:e(()=>[],"default"),required:!0},column:{type:Number,default:1},loading:{type:Boolean,default:!1},showBtnLoading:{type:Boolean,default:!0},read:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},showButtons:{type:Boolean,default:!0},buttonsClass:{type:String,default:""},buttonsLeft:{type:Boolean,default:!1},showReset:{type:Boolean,default:!0},showSubmit:{type:Boolean,default:!0},confirmText:{type:String,default:"确认"},resetText:{type:String,default:"重置"},confirmClassName:{type:String,default:""},colon:{type:Boolean,default:!1},labelEmpty:{type:String,default:"--"},hasDefReadStyle:{type:Boolean,default:!1},hideColumn:{type:Boolean,default:!1}}),u=t.buildProps({isValue:{type:Boolean,default:!1},value:{type:[String,Number,Boolean,Object,Array]},type:{type:String,values:["label","input","textarea","number","radio","checkbox","select","date","datetimerange","timePicker","timeSelect","cascader","multipleCascader","switch","inputRange","inputNumberRange","slot","itemSlot"]},label:{type:String,default:""},prop:{type:[String,Array],default:""},rules:{type:Object,default:e(()=>{},"default")},className:{type:String,default:""},labelClass:{type:String,default:""},labelIconClass:{type:String,default:""},tooltip:{type:String,default:""},options:{type:Array,default:e(()=>[],"default")},trim:{type:Boolean,default:!0},attrs:{type:Object,default:e(()=>{},"default")},listeners:{type:Object,default:e(()=>{},"default")},colon:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},read:{type:Boolean,default:!1},labelEmpty:{type:String,default:"--"},labelNumber:{type:Boolean,default:!1},dateFormat:{type:String,default:"YYYY-MM-DD HH:mm:ss"},formatReadValue:{type:Function},rangeSeparator:{type:String,default:"~"},rangeProps:{type:Array,default:e(()=>["start","end"],"default")},radioType:{type:String,default:""},isRow:{type:Boolean,default:!1},selectAll:{type:Boolean,default:!0},index:{type:Number,default:0},slotKey:{type:String,default:""},levelMatch:{type:Boolean,default:!1},manualValidate:{type:Boolean,default:!1}});exports.lsFormItemProps=u;exports.lsFormProps=r;
|
|
@@ -146,6 +146,10 @@ const n = t({
|
|
|
146
146
|
type: Array,
|
|
147
147
|
default: /* @__PURE__ */ e(() => [], "default")
|
|
148
148
|
},
|
|
149
|
+
trim: {
|
|
150
|
+
type: Boolean,
|
|
151
|
+
default: !0
|
|
152
|
+
},
|
|
149
153
|
attrs: {
|
|
150
154
|
type: Object,
|
|
151
155
|
default: /* @__PURE__ */ e(() => {
|
|
@@ -214,6 +218,10 @@ const n = t({
|
|
|
214
218
|
levelMatch: {
|
|
215
219
|
type: Boolean,
|
|
216
220
|
default: !1
|
|
221
|
+
},
|
|
222
|
+
manualValidate: {
|
|
223
|
+
type: Boolean,
|
|
224
|
+
default: !1
|
|
217
225
|
}
|
|
218
226
|
});
|
|
219
227
|
export {
|
|
Binary file
|
|
Binary file
|
|
@@ -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-
|
|
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-ef9be0ac"]]);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
|
|
4
|
+
const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ef9be0ac"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var x=Object.defineProperty;var n=(p,T)=>x(p,"name",{value:T,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"),_=,/* empty css */r=require("element-plus"),ee=,/* empty css */te=,/* empty css */le=,/* empty css */ae=,/* empty css */oe=,/* empty css */ne=,/* empty css */ie=,/* empty css */re={key:0,class:"animate_fadeIn transition-all-300 ls-list-wrap"},se={class:"flex items-center"},de=e.defineComponent({name:"LSList"}),ue=e.defineComponent({...de,props:ee.lsListProps,emits:["submitForm","handleLoading","handleCurrentPage","handlePageSize"],setup(p,{expose:T,emit:V}){const{jumpRouteCom:g,currentRouter:D}=ae.default(),t=p,h=V,v=e.useSlots(),C=e.ref(),E=e.ref(),N=e.computed(()=>Object.keys(v).filter(l=>l.toString().endsWith("-form-slot"))),A=e.computed(()=>Object.keys(v).filter(l=>l.toString().endsWith("-table-slot")));function P(l,a=!1){if(l){const i=l.toString().lastIndexOf(`${a?"-form-slot":"-table-slot"}`);return i!==-1?l.toString().slice(0,i):l}return""}n(P,"getSlotName");const{isFirst:B,loading:f,tableData:R,total:$,pageSize:c,currentPage:b,handleReset:q,loadData:w}=_.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});e.watch(f,l=>{h("handleLoading",l)}),e.watch(b,l=>{h("handleCurrentPage",l)}),e.watch(c,l=>{h("handlePageSize",l)});function L(l){h("submitForm",l),t!=null&&t.queryFn?t.queryFn(l):w()}n(L,"submitForm");function z(l){console.warn("resetForm",l),q()}n(z,"resetForm");const y=e.computed(()=>D?D.value.path:"");function O(){t!=null&&t.addFn?t.addFn():g({path:t!=null&&t.addRoutePath?t.addRoutePath:`${y.value}/add`},1)}n(O,"onAdd");function K(l,a){t!=null&&t.tableDetailFn?t.tableDetailFn(a):g({path:`${t!=null&&t.detailRoutePath?t.detailRoutePath:`${y.value}/detail`}/${l}`},1)}n(K,"onDetail");function H(l,a){t!=null&&t.tableEditFn?t.tableEditFn(a):g({path:`${t!=null&&t.editRoutePath?t.editRoutePath:`${y.value}/edit`}/${l}`},1)}n(H,"onEdit");const k=e.ref(void 0),m=e.ref(!1);function I(l,a){if(t.delApi){k.value=l,m.value=!0;let i=l;t!=null&&t.dealDelParams&&(i=t.dealDelParams(a)),t.delApi(i).then(()=>{r.ElMessage.success("删除成功"),w()}).catch(d=>{console.warn(d)}).finally(()=>{m.value=!1})}}n(I,"onDel");const F=e.ref(),S=e.ref(!1);function M(l,a,i){F.value=l;const d=n((u,o)=>{if(t.switchApi){S.value=!0;let s=l;t!=null&&t.dealSwitchParams&&(s=t.dealSwitchParams(i)),t.switchApi(s).then(()=>{w(!1),u(!0)}).catch(()=>{o(new Error("Error"))}).finally(()=>{S.value=!1})}else o(new Error("Error"))},"onSwitch");return new Promise((u,o)=>{a?r.ElMessageBox.confirm('<strong class="text-14px">请问是否关闭?</strong>',{confirmButtonText:"确定",cancelButtonText:"取消",dangerouslyUseHTMLString:!0,customStyle:{width:"240px"}}).then(()=>{d(u,o)}).catch(()=>{o(new Error("Error"))}):d(u,o)})}n(M,"switchBeforeChange");function U(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(U,"disabledTableSwitch");function j(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(j,"showTableDetail");function W(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(W,"disabledTableDetail");function G(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(G,"showTableEdit");function J(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(J,"disabledTableEdit");function Q(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(Q,"showTableDel");function X(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(X,"disabledTableDel");const Y=e.h(r.ElDivider,{direction:"vertical"}),Z=e.computed(()=>t.showSkeleton?!B.value:!0);return T({loadData:w,handleReset:q,isFirst:B,loading:f,currentPage:b,pageSize:c,total:$,FormRef:C,TableRef:E}),(l,a)=>{const i=oe.ElTableColumn,d=ne.ElPopconfirm,u=ie.ElSkeleton;return e.unref(Z)?(e.openBlock(),e.createElementBlock("div",re,[l.showForm?(e.openBlock(),e.createBlock(te.default,e.mergeProps({key:0,ref_key:"FormRef",ref:C,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(f),"confirm-text":"查询"},l.formAttrs,{onSubmit:L,onReset:z}),e.createSlots({default:e.withCtx(o=>[e.renderSlot(l.$slots,"form-append",e.normalizeProps(e.guardReactiveProps(o)),void 0,!0)]),_:2},[e.renderList(e.unref(N),o=>({name:P(o,!0),fn:e.withCtx(s=>[e.renderSlot(l.$slots,o,e.normalizeProps(e.guardReactiveProps(s)),void 0,!0)])}))]),1040,["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(r.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(r.ElButton),e.mergeProps({key:0,type:"primary",disabled:e.unref(f)||l.disabledAddBtn},l.addBtnAttrs,{onClick:O}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.addBtnText),1)]),_:1},16,["disabled"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"operate-append",{},void 0,!0)],2)],64))],64)):e.createCommentVNode("",!0),e.createVNode(le.default,e.mergeProps({ref_key:"TableRef",ref:E,class:["ls-table-cpo",[l.showOperate?"mt-16px":"mt-24px"]],"show-overflow-tooltip":!0,loading:e.unref(f),total:e.unref($),"table-data":e.unref(R),"table-column":l.tableColumn,"current-page":e.unref(b),"onUpdate:currentPage":a[0]||(a[0]=o=>e.isRef(b)?b.value=o:null),"page-size":e.unref(c),"onUpdate:pageSize":a[1]||(a[1]=o=>e.isRef(c)?c.value=o:null)},l.tableAttrs,e.toHandlers(l.tableListeners||{})),e.createSlots({default:e.withCtx(()=>[l.showTableSwitch?(e.openBlock(),e.createBlock(i,e.mergeProps({key:0,prop:l.switchProp,label:"是否开启",width:"100"},l.tableSwitchColumn),{default:e.withCtx(({row:o})=>[e.createVNode(e.unref(r.ElSwitch),{class:"ls-list-table__switch","model-value":o[l.switchProp]?1:0,"active-value":1,"inactive-value":0,loading:e.unref(S)&&o[l.tableRowKey]===e.unref(F),"before-change":n(()=>M(o[l.tableRowKey],o[l.switchProp],o),"before-change"),disabled:U(o)},null,8,["model-value","loading","before-change","disabled"])]),_:1},16,["prop"])):e.createCommentVNode("",!0),l.showTableOperate?(e.openBlock(),e.createBlock(i,e.mergeProps({key:1,fixed:"right",prop:"operate",label:"操作","show-overflow-tooltip":!1},l.tableOperateColumn),{default:e.withCtx(({row:o})=>[e.createElementVNode("div",se,[e.createVNode(e.unref(r.ElSpace),{size:0,spacer:e.unref(Y)},{default:e.withCtx(()=>[e.renderSlot(l.$slots,"table-operate-prepend",{row:o},void 0,!0),j(o)?(e.openBlock(),e.createBlock(e.unref(r.ElButton),{key:0,disabled:W(o),link:"",type:"primary",onClick:n(s=>K(o[l.tableRowKey],o),"onClick")},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.tableDetailText||"查看"),1)]),_:2},1032,["disabled","onClick"])):e.createCommentVNode("",!0),G(o)?(e.openBlock(),e.createBlock(e.unref(r.ElButton),{key:1,disabled:J(o),link:"",type:"primary",onClick:n(s=>H(o[l.tableRowKey],o),"onClick")},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.tableEditText||"编辑"),1)]),_:2},1032,["disabled","onClick"])):e.createCommentVNode("",!0),Q(o)?(e.openBlock(),e.createBlock(d,{key:2,"hide-icon":"",placement:"top",width:"180","confirm-button-text":"确认","cancel-button-text":"取消",title:`是否${l.tableDelText||"删除"}当前列数据?`,onConfirm:n(s=>I(o[l.tableRowKey],o),"onConfirm")},{reference:e.withCtx(()=>[e.createVNode(e.unref(r.ElButton),{link:"",type:"danger",disabled:e.unref(m)||X(o),loading:e.unref(m)&&e.unref(k)===o[l.tableRowKey]},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(m)&&e.unref(k)===o[l.tableRowKey]?"":l.tableDelText||"删除"),1)]),_:2},1032,["disabled","loading"])]),_:2},1032,["title","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",{tableData:e.unref(R)},void 0,!0)]),_:2},[e.renderList(e.unref(A),o=>({name:P(o,!1),fn:e.withCtx(s=>[e.renderSlot(l.$slots,o,e.normalizeProps(e.guardReactiveProps(s)),void 0,!0)])}))]),1040,["class","loading","total","table-data","table-column","current-page","page-size"])])):(e.openBlock(),e.createBlock(u,e.mergeProps({key:1,rows:5,animated:""},l.skeletonAttrs),null,16))}}});exports.default=ue;
|
|
1
|
+
"use strict";var ee=Object.defineProperty;var n=(p,g)=>ee(p,"name",{value:g,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"),te=,/* empty css */r=require("element-plus"),le=,/* empty css */ae=,/* empty css */oe=,/* empty css */ne=,/* empty css */ie=,/* empty css */re=,/* empty css */se=,/* empty css */de={key:0,class:"animate_fadeIn transition-all-300 ls-list-wrap"},ue={class:"flex items-center"},fe=e.defineComponent({name:"LSList"}),ce=e.defineComponent({...fe,props:le.lsListProps,emits:["submitForm","handleLoading","handleCurrentPage","handlePageSize"],setup(p,{expose:g,emit:N}){const{jumpRouteCom:T,currentRouter:D}=ne.default(),t=p,h=N,C=e.useSlots(),v=e.ref(),P=e.ref(),z=e.computed(()=>Object.keys(C).filter(l=>l.toString().endsWith("-form-slot"))),A=e.computed(()=>Object.keys(C).filter(l=>l.toString().endsWith("-table-slot")));function E(l,a=!1){if(l){const i=l.toString().lastIndexOf(`${a?"-form-slot":"-table-slot"}`);return i!==-1?l.toString().slice(0,i):l}return""}n(E,"getSlotName");const{isFirst:B,loading:f,tableData:R,total:$,pageSize:c,currentPage:b,handleReset:q,loadData:w,handleCurrentPageChange:F,handleSizeChange:L}=te.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});e.watch(f,l=>{h("handleLoading",l)}),e.watch(b,l=>{h("handleCurrentPage",l)}),e.watch(c,l=>{h("handlePageSize",l)});function O(l){F(1),h("submitForm",l),t!=null&&t.queryFn?t.queryFn(l):w()}n(O,"submitForm");function K(l){console.warn("resetForm",l),q()}n(K,"resetForm");const y=e.computed(()=>D?D.value.path:"");function H(){t!=null&&t.addFn?t.addFn():T({path:t!=null&&t.addRoutePath?t.addRoutePath:`${y.value}/add`},1)}n(H,"onAdd");function I(l,a){t!=null&&t.tableDetailFn?t.tableDetailFn(a):T({path:`${t!=null&&t.detailRoutePath?t.detailRoutePath:`${y.value}/detail`}/${l}`},1)}n(I,"onDetail");function M(l,a){t!=null&&t.tableEditFn?t.tableEditFn(a):T({path:`${t!=null&&t.editRoutePath?t.editRoutePath:`${y.value}/edit`}/${l}`},1)}n(M,"onEdit");const k=e.ref(void 0),m=e.ref(!1);function U(l,a){if(t.delApi){k.value=l,m.value=!0;let i=l;t!=null&&t.dealDelParams&&(i=t.dealDelParams(a)),t.delApi(i).then(()=>{r.ElMessage.success("删除成功"),w()}).catch(d=>{console.warn(d)}).finally(()=>{m.value=!1})}}n(U,"onDel");const V=e.ref(),S=e.ref(!1);function j(l,a,i){V.value=l;const d=n((u,o)=>{if(t.switchApi){S.value=!0;let s=l;t!=null&&t.dealSwitchParams&&(s=t.dealSwitchParams(i)),t.switchApi(s).then(()=>{w(!1),u(!0)}).catch(()=>{o(new Error("Error"))}).finally(()=>{S.value=!1})}else o(new Error("Error"))},"onSwitch");return new Promise((u,o)=>{a?r.ElMessageBox.confirm('<strong class="text-14px">请问是否关闭?</strong>',{confirmButtonText:"确定",cancelButtonText:"取消",dangerouslyUseHTMLString:!0,customStyle:{width:"240px"}}).then(()=>{d(u,o)}).catch(()=>{o(new Error("Error"))}):d(u,o)})}n(j,"switchBeforeChange");function W(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(W,"disabledTableSwitch");function G(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(G,"showTableDetail");function J(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(J,"disabledTableDetail");function Q(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(Q,"showTableEdit");function X(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(X,"disabledTableEdit");function Y(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(Y,"showTableDel");function Z(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(Z,"disabledTableDel");const x=e.h(r.ElDivider,{direction:"vertical"}),_=e.computed(()=>t.showSkeleton?!B.value:!0);return g({loadData:w,handleReset:q,setCurrentPage:F,setPageSize:L,isFirst:B,loading:f,currentPage:b,pageSize:c,total:$,FormRef:v,TableRef:P}),(l,a)=>{const i=ie.ElTableColumn,d=re.ElPopconfirm,u=se.ElSkeleton;return e.unref(_)?(e.openBlock(),e.createElementBlock("div",de,[l.showForm?(e.openBlock(),e.createBlock(ae.default,e.mergeProps({key:0,ref_key:"FormRef",ref:v,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(f),"confirm-text":"查询"},l.formAttrs,{onSubmit:O,onReset:K}),e.createSlots({default:e.withCtx(o=>[e.renderSlot(l.$slots,"form-append",e.normalizeProps(e.guardReactiveProps(o)),void 0,!0)]),_:2},[e.renderList(e.unref(z),o=>({name:E(o,!0),fn:e.withCtx(s=>[e.renderSlot(l.$slots,o,e.normalizeProps(e.guardReactiveProps(s)),void 0,!0)])}))]),1040,["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(r.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(r.ElButton),e.mergeProps({key:0,type:"primary",disabled:e.unref(f)||l.disabledAddBtn},l.addBtnAttrs,{onClick:H}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.addBtnText),1)]),_:1},16,["disabled"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"operate-append",{},void 0,!0)],2)],64))],64)):e.createCommentVNode("",!0),e.createVNode(oe.default,e.mergeProps({ref_key:"TableRef",ref:P,class:["ls-table-cpo",[l.showOperate?"mt-16px":"mt-24px"]],"show-overflow-tooltip":!0,loading:e.unref(f),total:e.unref($),"table-data":e.unref(R),"table-column":l.tableColumn,"current-page":e.unref(b),"onUpdate:currentPage":a[0]||(a[0]=o=>e.isRef(b)?b.value=o:null),"page-size":e.unref(c),"onUpdate:pageSize":a[1]||(a[1]=o=>e.isRef(c)?c.value=o:null)},l.tableAttrs,e.toHandlers(l.tableListeners||{})),e.createSlots({default:e.withCtx(()=>[l.showTableSwitch?(e.openBlock(),e.createBlock(i,e.mergeProps({key:0,prop:l.switchProp,label:"是否开启",width:"100"},l.tableSwitchColumn),{default:e.withCtx(({row:o})=>[e.createVNode(e.unref(r.ElSwitch),{class:"ls-list-table__switch","model-value":o[l.switchProp]?1:0,"active-value":1,"inactive-value":0,loading:e.unref(S)&&o[l.tableRowKey]===e.unref(V),"before-change":n(()=>j(o[l.tableRowKey],o[l.switchProp],o),"before-change"),disabled:W(o)},null,8,["model-value","loading","before-change","disabled"])]),_:1},16,["prop"])):e.createCommentVNode("",!0),l.showTableOperate?(e.openBlock(),e.createBlock(i,e.mergeProps({key:1,fixed:"right",prop:"operate",label:"操作","show-overflow-tooltip":!1},l.tableOperateColumn),{default:e.withCtx(({row:o})=>[e.createElementVNode("div",ue,[e.createVNode(e.unref(r.ElSpace),{size:0,spacer:e.unref(x)},{default:e.withCtx(()=>[e.renderSlot(l.$slots,"table-operate-prepend",{row:o},void 0,!0),G(o)?(e.openBlock(),e.createBlock(e.unref(r.ElButton),{key:0,disabled:J(o),link:"",type:"primary",onClick:n(s=>I(o[l.tableRowKey],o),"onClick")},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.tableDetailText||"查看"),1)]),_:2},1032,["disabled","onClick"])):e.createCommentVNode("",!0),Q(o)?(e.openBlock(),e.createBlock(e.unref(r.ElButton),{key:1,disabled:X(o),link:"",type:"primary",onClick:n(s=>M(o[l.tableRowKey],o),"onClick")},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.tableEditText||"编辑"),1)]),_:2},1032,["disabled","onClick"])):e.createCommentVNode("",!0),Y(o)?(e.openBlock(),e.createBlock(d,{key:2,"hide-icon":"",placement:"top",width:"180","confirm-button-text":"确认","cancel-button-text":"取消",title:`是否${l.tableDelText||"删除"}当前列数据?`,onConfirm:n(s=>U(o[l.tableRowKey],o),"onConfirm")},{reference:e.withCtx(()=>[e.createVNode(e.unref(r.ElButton),{link:"",type:"danger",disabled:e.unref(m)||Z(o),loading:e.unref(m)&&e.unref(k)===o[l.tableRowKey]},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(m)&&e.unref(k)===o[l.tableRowKey]?"":l.tableDelText||"删除"),1)]),_:2},1032,["disabled","loading"])]),_:2},1032,["title","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",{tableData:e.unref(R)},void 0,!0)]),_:2},[e.renderList(e.unref(A),o=>({name:E(o,!1),fn:e.withCtx(s=>[e.renderSlot(l.$slots,o,e.normalizeProps(e.guardReactiveProps(s)),void 0,!0)])}))]),1040,["class","loading","total","table-data","table-column","current-page","page-size"])])):(e.openBlock(),e.createBlock(u,e.mergeProps({key:1,rows:5,animated:""},l.skeletonAttrs),null,16))}}});exports.default=ce;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var
|
|
2
|
-
var o = (
|
|
1
|
+
var ve = Object.defineProperty;
|
|
2
|
+
var o = (R, $) => ve(R, "name", { value: $, configurable: !0 });
|
|
3
3
|
/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
5
|
/* empty css */
|
|
@@ -10,27 +10,27 @@ var o = (C, $) => ge(C, "name", { value: $, configurable: !0 });
|
|
|
10
10
|
/* empty css */
|
|
11
11
|
/* empty css */
|
|
12
12
|
/* empty css */
|
|
13
|
-
import { defineComponent as
|
|
14
|
-
import
|
|
15
|
-
import { ElDivider as
|
|
16
|
-
import { lsListProps as
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import { ElTableColumn as
|
|
21
|
-
import { ElPopconfirm as
|
|
22
|
-
import { ElSkeleton as
|
|
23
|
-
const
|
|
13
|
+
import { defineComponent as te, useSlots as Se, ref as c, computed as S, watch as B, h as ke, unref as i, openBlock as n, createElementBlock as O, createBlock as f, mergeProps as p, createSlots as X, withCtx as s, renderSlot as u, normalizeProps as K, guardReactiveProps as H, renderList as Y, createCommentVNode as b, Fragment as Z, createElementVNode as _, normalizeClass as Ee, createTextVNode as k, toDisplayString as E, createVNode as P, isRef as x, toHandlers as Pe } from "vue";
|
|
14
|
+
import Ce from "../../_hooks/useTableListHook/index.js";
|
|
15
|
+
import { ElDivider as ee, ElButton as C, ElSwitch as Re, ElSpace as $e, ElMessage as Fe, ElMessageBox as Le } from "element-plus";
|
|
16
|
+
import { lsListProps as Ae } from "../types/index.js";
|
|
17
|
+
import ze from "../../form/Form.vue/index.js";
|
|
18
|
+
import Be from "../../table/Table.vue/index.js";
|
|
19
|
+
import Oe from "../../_hooks/useRouterHook/index.js";
|
|
20
|
+
import { ElTableColumn as Ke } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.5.13_typescript@5.5.4_/node_modules/element-plus/es/components/table/index/index.js";
|
|
21
|
+
import { ElPopconfirm as He } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.5.13_typescript@5.5.4_/node_modules/element-plus/es/components/popconfirm/index/index.js";
|
|
22
|
+
import { ElSkeleton as Ie } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.5.13_typescript@5.5.4_/node_modules/element-plus/es/components/skeleton/index/index.js";
|
|
23
|
+
const Ve = {
|
|
24
24
|
key: 0,
|
|
25
25
|
class: "animate_fadeIn transition-all-300 ls-list-wrap"
|
|
26
|
-
},
|
|
26
|
+
}, Me = { class: "flex items-center" }, Ue = te({
|
|
27
27
|
name: "LSList"
|
|
28
|
-
}),
|
|
29
|
-
...
|
|
30
|
-
props:
|
|
28
|
+
}), rt = /* @__PURE__ */ te({
|
|
29
|
+
...Ue,
|
|
30
|
+
props: Ae,
|
|
31
31
|
emits: ["submitForm", "handleLoading", "handleCurrentPage", "handlePageSize"],
|
|
32
|
-
setup(
|
|
33
|
-
const { jumpRouteCom: F, currentRouter: I } =
|
|
32
|
+
setup(R, { expose: $, emit: le }) {
|
|
33
|
+
const { jumpRouteCom: F, currentRouter: I } = Oe(), e = R, D = le, V = Se(), M = c(), U = c(), ae = S(() => Object.keys(V).filter((t) => t.toString().endsWith("-form-slot"))), ie = S(() => Object.keys(V).filter((t) => t.toString().endsWith("-table-slot")));
|
|
34
34
|
function q(t, l = !1) {
|
|
35
35
|
if (t) {
|
|
36
36
|
const d = t.toString().lastIndexOf(`${l ? "-form-slot" : "-table-slot"}`);
|
|
@@ -39,28 +39,39 @@ const He = {
|
|
|
39
39
|
return "";
|
|
40
40
|
}
|
|
41
41
|
o(q, "getSlotName");
|
|
42
|
-
const {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
const {
|
|
43
|
+
isFirst: W,
|
|
44
|
+
loading: T,
|
|
45
|
+
tableData: j,
|
|
46
|
+
total: G,
|
|
47
|
+
pageSize: w,
|
|
48
|
+
currentPage: y,
|
|
49
|
+
handleReset: J,
|
|
50
|
+
loadData: v,
|
|
51
|
+
handleCurrentPageChange: N,
|
|
52
|
+
handleSizeChange: oe
|
|
53
|
+
} = Ce(e.listApi, e.formData, {
|
|
54
|
+
dealData: e == null ? void 0 : e.dealData,
|
|
55
|
+
dealParams: e == null ? void 0 : e.dealParams,
|
|
56
|
+
...e == null ? void 0 : e.listHookConfig
|
|
57
|
+
});
|
|
58
|
+
B(T, (t) => {
|
|
48
59
|
D("handleLoading", t);
|
|
49
|
-
}),
|
|
60
|
+
}), B(y, (t) => {
|
|
50
61
|
D("handleCurrentPage", t);
|
|
51
|
-
}),
|
|
62
|
+
}), B(w, (t) => {
|
|
52
63
|
D("handlePageSize", t);
|
|
53
64
|
});
|
|
54
|
-
function
|
|
55
|
-
D("submitForm", t), e != null && e.queryFn ? e.queryFn(t) : v();
|
|
65
|
+
function ne(t) {
|
|
66
|
+
N(1), D("submitForm", t), e != null && e.queryFn ? e.queryFn(t) : v();
|
|
56
67
|
}
|
|
57
|
-
o(
|
|
58
|
-
function
|
|
68
|
+
o(ne, "submitForm");
|
|
69
|
+
function se(t) {
|
|
59
70
|
console.warn("resetForm", t), J();
|
|
60
71
|
}
|
|
61
|
-
o(
|
|
72
|
+
o(se, "resetForm");
|
|
62
73
|
const L = S(() => I ? I.value.path : "");
|
|
63
|
-
function
|
|
74
|
+
function de() {
|
|
64
75
|
e != null && e.addFn ? e.addFn() : F(
|
|
65
76
|
{
|
|
66
77
|
path: e != null && e.addRoutePath ? e.addRoutePath : `${L.value}/add`
|
|
@@ -68,8 +79,8 @@ const He = {
|
|
|
68
79
|
1
|
|
69
80
|
);
|
|
70
81
|
}
|
|
71
|
-
o(
|
|
72
|
-
function
|
|
82
|
+
o(de, "onAdd");
|
|
83
|
+
function re(t, l) {
|
|
73
84
|
e != null && e.tableDetailFn ? e.tableDetailFn(l) : F(
|
|
74
85
|
{
|
|
75
86
|
path: `${e != null && e.detailRoutePath ? e.detailRoutePath : `${L.value}/detail`}/${t}`
|
|
@@ -77,8 +88,8 @@ const He = {
|
|
|
77
88
|
1
|
|
78
89
|
);
|
|
79
90
|
}
|
|
80
|
-
o(
|
|
81
|
-
function
|
|
91
|
+
o(re, "onDetail");
|
|
92
|
+
function fe(t, l) {
|
|
82
93
|
e != null && e.tableEditFn ? e.tableEditFn(l) : F(
|
|
83
94
|
{
|
|
84
95
|
path: `${e != null && e.editRoutePath ? e.editRoutePath : `${L.value}/edit`}/${t}`
|
|
@@ -86,14 +97,14 @@ const He = {
|
|
|
86
97
|
1
|
|
87
98
|
);
|
|
88
99
|
}
|
|
89
|
-
o(
|
|
90
|
-
const A =
|
|
91
|
-
function
|
|
100
|
+
o(fe, "onEdit");
|
|
101
|
+
const A = c(void 0), g = c(!1);
|
|
102
|
+
function ue(t, l) {
|
|
92
103
|
if (e.delApi) {
|
|
93
104
|
A.value = t, g.value = !0;
|
|
94
105
|
let d = t;
|
|
95
106
|
e != null && e.dealDelParams && (d = e.dealDelParams(l)), e.delApi(d).then(() => {
|
|
96
|
-
|
|
107
|
+
Fe.success("删除成功"), v();
|
|
97
108
|
}).catch((m) => {
|
|
98
109
|
console.warn(m);
|
|
99
110
|
}).finally(() => {
|
|
@@ -101,26 +112,26 @@ const He = {
|
|
|
101
112
|
});
|
|
102
113
|
}
|
|
103
114
|
}
|
|
104
|
-
o(
|
|
105
|
-
const
|
|
106
|
-
function
|
|
107
|
-
|
|
108
|
-
const m = /* @__PURE__ */ o((
|
|
115
|
+
o(ue, "onDel");
|
|
116
|
+
const Q = c(), z = c(!1);
|
|
117
|
+
function be(t, l, d) {
|
|
118
|
+
Q.value = t;
|
|
119
|
+
const m = /* @__PURE__ */ o((h, a) => {
|
|
109
120
|
if (e.switchApi) {
|
|
110
|
-
|
|
121
|
+
z.value = !0;
|
|
111
122
|
let r = t;
|
|
112
123
|
e != null && e.dealSwitchParams && (r = e.dealSwitchParams(d)), e.switchApi(r).then(() => {
|
|
113
|
-
v(!1),
|
|
124
|
+
v(!1), h(!0);
|
|
114
125
|
}).catch(() => {
|
|
115
126
|
a(new Error("Error"));
|
|
116
127
|
}).finally(() => {
|
|
117
|
-
|
|
128
|
+
z.value = !1;
|
|
118
129
|
});
|
|
119
130
|
} else
|
|
120
131
|
a(new Error("Error"));
|
|
121
132
|
}, "onSwitch");
|
|
122
|
-
return new Promise((
|
|
123
|
-
l ?
|
|
133
|
+
return new Promise((h, a) => {
|
|
134
|
+
l ? Le.confirm('<strong class="text-14px">请问是否关闭?</strong>', {
|
|
124
135
|
confirmButtonText: "确定",
|
|
125
136
|
cancelButtonText: "取消",
|
|
126
137
|
dangerouslyUseHTMLString: !0,
|
|
@@ -128,52 +139,54 @@ const He = {
|
|
|
128
139
|
width: "240px"
|
|
129
140
|
}
|
|
130
141
|
}).then(() => {
|
|
131
|
-
m(
|
|
142
|
+
m(h, a);
|
|
132
143
|
}).catch(() => {
|
|
133
144
|
a(new Error("Error"));
|
|
134
|
-
}) : m(
|
|
145
|
+
}) : m(h, a);
|
|
135
146
|
});
|
|
136
147
|
}
|
|
137
|
-
o(
|
|
138
|
-
function
|
|
148
|
+
o(be, "switchBeforeChange");
|
|
149
|
+
function me(t) {
|
|
139
150
|
let l = !1;
|
|
140
151
|
return e != null && e.disabledTableSwitch && (typeof e.disabledTableSwitch == "boolean" ? l = e.disabledTableSwitch : typeof e.disabledTableSwitch == "function" && (l = e.disabledTableSwitch(t))), !!l;
|
|
141
152
|
}
|
|
142
|
-
o(
|
|
143
|
-
function
|
|
153
|
+
o(me, "disabledTableSwitch");
|
|
154
|
+
function he(t) {
|
|
144
155
|
let l = !1;
|
|
145
156
|
return e != null && e.showTableDetail && (typeof e.showTableDetail == "boolean" ? l = e.showTableDetail : typeof e.showTableDetail == "function" && (l = e.showTableDetail(t))), !!l;
|
|
146
157
|
}
|
|
147
|
-
o(
|
|
148
|
-
function
|
|
158
|
+
o(he, "showTableDetail");
|
|
159
|
+
function ce(t) {
|
|
149
160
|
let l = !1;
|
|
150
161
|
return e != null && e.disabledTableDetail && (typeof e.disabledTableDetail == "boolean" ? l = e.disabledTableDetail : typeof e.disabledTableDetail == "function" && (l = e.disabledTableDetail(t))), !!l;
|
|
151
162
|
}
|
|
152
|
-
o(
|
|
153
|
-
function
|
|
163
|
+
o(ce, "disabledTableDetail");
|
|
164
|
+
function pe(t) {
|
|
154
165
|
let l = !1;
|
|
155
166
|
return e != null && e.showTableEdit && (typeof e.showTableEdit == "boolean" ? l = e.showTableEdit : typeof e.showTableEdit == "function" && (l = e.showTableEdit(t))), !!l;
|
|
156
167
|
}
|
|
157
|
-
o(
|
|
158
|
-
function
|
|
168
|
+
o(pe, "showTableEdit");
|
|
169
|
+
function Te(t) {
|
|
159
170
|
let l = !1;
|
|
160
171
|
return e != null && e.disabledTableEdit && (typeof e.disabledTableEdit == "boolean" ? l = e.disabledTableEdit : typeof e.disabledTableEdit == "function" && (l = e.disabledTableEdit(t))), !!l;
|
|
161
172
|
}
|
|
162
|
-
o(
|
|
163
|
-
function
|
|
173
|
+
o(Te, "disabledTableEdit");
|
|
174
|
+
function we(t) {
|
|
164
175
|
let l = !1;
|
|
165
176
|
return e != null && e.showTableDel && (typeof e.showTableDel == "boolean" ? l = e.showTableDel : typeof e.showTableDel == "function" && (l = e.showTableDel(t))), !!l;
|
|
166
177
|
}
|
|
167
|
-
o(
|
|
168
|
-
function
|
|
178
|
+
o(we, "showTableDel");
|
|
179
|
+
function ye(t) {
|
|
169
180
|
let l = !1;
|
|
170
181
|
return e != null && e.disabledTableDel && (typeof e.disabledTableDel == "boolean" ? l = e.disabledTableDel : typeof e.disabledTableDel == "function" && (l = e.disabledTableDel(t))), !!l;
|
|
171
182
|
}
|
|
172
|
-
o(
|
|
173
|
-
const
|
|
183
|
+
o(ye, "disabledTableDel");
|
|
184
|
+
const ge = ke(ee, { direction: "vertical" }), De = S(() => e.showSkeleton ? !W.value : !0);
|
|
174
185
|
return $({
|
|
175
186
|
loadData: v,
|
|
176
187
|
handleReset: J,
|
|
188
|
+
setCurrentPage: N,
|
|
189
|
+
setPageSize: oe,
|
|
177
190
|
isFirst: W,
|
|
178
191
|
loading: T,
|
|
179
192
|
currentPage: y,
|
|
@@ -182,9 +195,9 @@ const He = {
|
|
|
182
195
|
FormRef: M,
|
|
183
196
|
TableRef: U
|
|
184
197
|
}), (t, l) => {
|
|
185
|
-
const d =
|
|
186
|
-
return i(
|
|
187
|
-
t.showForm ? (n(), f(
|
|
198
|
+
const d = Ke, m = He, h = Ie;
|
|
199
|
+
return i(De) ? (n(), O("div", Ve, [
|
|
200
|
+
t.showForm ? (n(), f(ze, p({
|
|
188
201
|
key: 0,
|
|
189
202
|
ref_key: "FormRef",
|
|
190
203
|
ref: M,
|
|
@@ -198,36 +211,36 @@ const He = {
|
|
|
198
211
|
loading: i(T),
|
|
199
212
|
"confirm-text": "查询"
|
|
200
213
|
}, t.formAttrs, {
|
|
201
|
-
onSubmit:
|
|
202
|
-
onReset:
|
|
203
|
-
}),
|
|
214
|
+
onSubmit: ne,
|
|
215
|
+
onReset: se
|
|
216
|
+
}), X({
|
|
204
217
|
default: s((a) => [
|
|
205
218
|
u(t.$slots, "form-append", K(H(a)), void 0, !0)
|
|
206
219
|
]),
|
|
207
220
|
_: 2
|
|
208
221
|
}, [
|
|
209
|
-
|
|
222
|
+
Y(i(ae), (a) => ({
|
|
210
223
|
name: q(a, !0),
|
|
211
224
|
fn: s((r) => [
|
|
212
225
|
u(t.$slots, a, K(H(r)), void 0, !0)
|
|
213
226
|
])
|
|
214
227
|
}))
|
|
215
228
|
]), 1040, ["class", "form-data", "form-items", "loading"])) : b("", !0),
|
|
216
|
-
t.showOperate ? (n(), O(
|
|
217
|
-
t.$slots.operate ? u(t.$slots, "operate", { key: 0 }, void 0, !0) : (n(), O(
|
|
218
|
-
t.showOperateDivider ? (n(), f(i(
|
|
229
|
+
t.showOperate ? (n(), O(Z, { key: 1 }, [
|
|
230
|
+
t.$slots.operate ? u(t.$slots, "operate", { key: 0 }, void 0, !0) : (n(), O(Z, { key: 1 }, [
|
|
231
|
+
t.showOperateDivider ? (n(), f(i(ee), {
|
|
219
232
|
key: 0,
|
|
220
233
|
"border-style": "dashed"
|
|
221
234
|
})) : b("", !0),
|
|
222
|
-
|
|
223
|
-
class:
|
|
235
|
+
_("div", {
|
|
236
|
+
class: Ee(["mt-24px flex items-center justify-start", t.operateClass])
|
|
224
237
|
}, [
|
|
225
238
|
u(t.$slots, "operate-prepend", {}, void 0, !0),
|
|
226
|
-
t.showAdd ? (n(), f(i(
|
|
239
|
+
t.showAdd ? (n(), f(i(C), p({
|
|
227
240
|
key: 0,
|
|
228
241
|
type: "primary",
|
|
229
242
|
disabled: i(T) || t.disabledAddBtn
|
|
230
|
-
}, t.addBtnAttrs, { onClick:
|
|
243
|
+
}, t.addBtnAttrs, { onClick: de }), {
|
|
231
244
|
default: s(() => [
|
|
232
245
|
k(E(t.addBtnText), 1)
|
|
233
246
|
]),
|
|
@@ -237,7 +250,7 @@ const He = {
|
|
|
237
250
|
], 2)
|
|
238
251
|
], 64))
|
|
239
252
|
], 64)) : b("", !0),
|
|
240
|
-
P(
|
|
253
|
+
P(Be, p({
|
|
241
254
|
ref_key: "TableRef",
|
|
242
255
|
ref: U,
|
|
243
256
|
class: ["ls-table-cpo", [t.showOperate ? "mt-16px" : "mt-24px"]],
|
|
@@ -247,10 +260,10 @@ const He = {
|
|
|
247
260
|
"table-data": i(j),
|
|
248
261
|
"table-column": t.tableColumn,
|
|
249
262
|
"current-page": i(y),
|
|
250
|
-
"onUpdate:currentPage": l[0] || (l[0] = (a) =>
|
|
263
|
+
"onUpdate:currentPage": l[0] || (l[0] = (a) => x(y) ? y.value = a : null),
|
|
251
264
|
"page-size": i(w),
|
|
252
|
-
"onUpdate:pageSize": l[1] || (l[1] = (a) =>
|
|
253
|
-
}, t.tableAttrs,
|
|
265
|
+
"onUpdate:pageSize": l[1] || (l[1] = (a) => x(w) ? w.value = a : null)
|
|
266
|
+
}, t.tableAttrs, Pe(t.tableListeners || {})), X({
|
|
254
267
|
default: s(() => [
|
|
255
268
|
t.showTableSwitch ? (n(), f(d, p({
|
|
256
269
|
key: 0,
|
|
@@ -259,14 +272,14 @@ const He = {
|
|
|
259
272
|
width: "100"
|
|
260
273
|
}, t.tableSwitchColumn), {
|
|
261
274
|
default: s(({ row: a }) => [
|
|
262
|
-
P(i(
|
|
275
|
+
P(i(Re), {
|
|
263
276
|
class: "ls-list-table__switch",
|
|
264
277
|
"model-value": a[t.switchProp] ? 1 : 0,
|
|
265
278
|
"active-value": 1,
|
|
266
279
|
"inactive-value": 0,
|
|
267
|
-
loading: i(
|
|
268
|
-
"before-change": /* @__PURE__ */ o(() =>
|
|
269
|
-
disabled:
|
|
280
|
+
loading: i(z) && a[t.tableRowKey] === i(Q),
|
|
281
|
+
"before-change": /* @__PURE__ */ o(() => be(a[t.tableRowKey], a[t.switchProp], a), "before-change"),
|
|
282
|
+
disabled: me(a)
|
|
270
283
|
}, null, 8, ["model-value", "loading", "before-change", "disabled"])
|
|
271
284
|
]),
|
|
272
285
|
_: 1
|
|
@@ -279,38 +292,38 @@ const He = {
|
|
|
279
292
|
"show-overflow-tooltip": !1
|
|
280
293
|
}, t.tableOperateColumn), {
|
|
281
294
|
default: s(({ row: a }) => [
|
|
282
|
-
|
|
283
|
-
P(i(
|
|
295
|
+
_("div", Me, [
|
|
296
|
+
P(i($e), {
|
|
284
297
|
size: 0,
|
|
285
|
-
spacer: i(
|
|
298
|
+
spacer: i(ge)
|
|
286
299
|
}, {
|
|
287
300
|
default: s(() => [
|
|
288
301
|
u(t.$slots, "table-operate-prepend", { row: a }, void 0, !0),
|
|
289
|
-
|
|
302
|
+
he(a) ? (n(), f(i(C), {
|
|
290
303
|
key: 0,
|
|
291
|
-
disabled:
|
|
304
|
+
disabled: ce(a),
|
|
292
305
|
link: "",
|
|
293
306
|
type: "primary",
|
|
294
|
-
onClick: /* @__PURE__ */ o((r) =>
|
|
307
|
+
onClick: /* @__PURE__ */ o((r) => re(a[t.tableRowKey], a), "onClick")
|
|
295
308
|
}, {
|
|
296
309
|
default: s(() => [
|
|
297
310
|
k(E(t.tableDetailText || "查看"), 1)
|
|
298
311
|
]),
|
|
299
312
|
_: 2
|
|
300
313
|
}, 1032, ["disabled", "onClick"])) : b("", !0),
|
|
301
|
-
|
|
314
|
+
pe(a) ? (n(), f(i(C), {
|
|
302
315
|
key: 1,
|
|
303
|
-
disabled:
|
|
316
|
+
disabled: Te(a),
|
|
304
317
|
link: "",
|
|
305
318
|
type: "primary",
|
|
306
|
-
onClick: /* @__PURE__ */ o((r) =>
|
|
319
|
+
onClick: /* @__PURE__ */ o((r) => fe(a[t.tableRowKey], a), "onClick")
|
|
307
320
|
}, {
|
|
308
321
|
default: s(() => [
|
|
309
322
|
k(E(t.tableEditText || "编辑"), 1)
|
|
310
323
|
]),
|
|
311
324
|
_: 2
|
|
312
325
|
}, 1032, ["disabled", "onClick"])) : b("", !0),
|
|
313
|
-
|
|
326
|
+
we(a) ? (n(), f(m, {
|
|
314
327
|
key: 2,
|
|
315
328
|
"hide-icon": "",
|
|
316
329
|
placement: "top",
|
|
@@ -318,13 +331,13 @@ const He = {
|
|
|
318
331
|
"confirm-button-text": "确认",
|
|
319
332
|
"cancel-button-text": "取消",
|
|
320
333
|
title: `是否${t.tableDelText || "删除"}当前列数据?`,
|
|
321
|
-
onConfirm: /* @__PURE__ */ o((r) =>
|
|
334
|
+
onConfirm: /* @__PURE__ */ o((r) => ue(a[t.tableRowKey], a), "onConfirm")
|
|
322
335
|
}, {
|
|
323
336
|
reference: s(() => [
|
|
324
|
-
P(i(
|
|
337
|
+
P(i(C), {
|
|
325
338
|
link: "",
|
|
326
339
|
type: "danger",
|
|
327
|
-
disabled: i(g) ||
|
|
340
|
+
disabled: i(g) || ye(a),
|
|
328
341
|
loading: i(g) && i(A) === a[t.tableRowKey]
|
|
329
342
|
}, {
|
|
330
343
|
default: s(() => [
|
|
@@ -347,14 +360,14 @@ const He = {
|
|
|
347
360
|
]),
|
|
348
361
|
_: 2
|
|
349
362
|
}, [
|
|
350
|
-
|
|
363
|
+
Y(i(ie), (a) => ({
|
|
351
364
|
name: q(a, !1),
|
|
352
365
|
fn: s((r) => [
|
|
353
366
|
u(t.$slots, a, K(H(r)), void 0, !0)
|
|
354
367
|
])
|
|
355
368
|
}))
|
|
356
369
|
]), 1040, ["class", "loading", "total", "table-data", "table-column", "current-page", "page-size"])
|
|
357
|
-
])) : (n(), f(
|
|
370
|
+
])) : (n(), f(h, p({
|
|
358
371
|
key: 1,
|
|
359
372
|
rows: 5,
|
|
360
373
|
animated: ""
|
|
@@ -363,5 +376,5 @@ const He = {
|
|
|
363
376
|
}
|
|
364
377
|
});
|
|
365
378
|
export {
|
|
366
|
-
|
|
379
|
+
rt as default
|
|
367
380
|
};
|
|
Binary file
|
|
Binary file
|