ling-yun-custom-components 0.0.40 → 0.0.41

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.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./assets/PaginationTable.css');const se=require("./chunks/index.CkihWzK6.js"),t=require("vue"),x=require("element-plus"),T=require("ling-yun-methods"),ie=require("./chunks/layout.DE2WIKAN.js"),ce=require("./chunks/_plugin-vue_export-helper.BHFhmbuH.js"),de={class:"flex h-full flex-col"},fe={class:"w-full flex justify-between overflow-hidden",style:{height:"auto"}},ve={key:0,class:"flex-1 overflow-hidden"},he={class:"flex",style:{width:"auto",gap:"10px"}},pe={key:1,class:"flex items-center mg-b-18"},ge={class:"fz-12 text-74798c"},me={class:"btn-group mg-l-12"},ye={class:"w-full flex-1 overflow-hidden flex flex-col"},Se={class:"flex-1 overflow-hidden TABLE-AREA"},be={key:0,class:"flex justify-end mg-t-20",style:{height:"auto"}},Ce=Object.assign({name:"PaginationTable"},{__name:"layout",props:{isPagination:{type:Boolean,default:!0},total:{type:Number,default:0},tableData:{type:Array,default:()=>[]},pagination:{type:Object,default:()=>T.paginationConfig},params:{type:Object,default:()=>{}},requestFn:{type:Function},columns:{type:Array,default:()=>[]},hasBatchSelect:{type:Boolean,default:!1},expandColumnKey:{type:String,default:""},columnWidthMap:{type:Object,default:()=>{}},tableDataKey:{type:String,default:"list"},tableDomWidth:{type:Number,default:0},pageMapping:{type:Object,default:()=>({pageSize:"pageSize",pageNum:"pageNum"})},sortState:{type:Object,default:()=>{}}},emits:[T.emitsMap.paginationChange,"updateTableData","handleTableSelect","handleBatchDelete","updateSortState"],setup(v,{expose:Y,emit:G}){const y=G,r=v,w=t.useSlots(),B=t.computed(()=>typeof r.requestFn=="function"),i=t.computed({get:()=>B.value?p.value:r.tableData,set:e=>{B.value?p.value=e:y("updateTableData",e)}}),P=t.ref(0),q=t.computed(()=>B.value?P.value:r.total),S=t.computed({get:()=>r.sortState,set:e=>{y("updateSortState",e)}}),J=({key:e,order:l})=>{S.value[e]=l,i.value=i.value.reverse()},p=t.ref([]),d=t.computed(()=>r.pageMapping.pageNum),k=t.computed(()=>r.pageMapping.pageSize),V={[d.value]:1,[k.value]:20},s=t.ref({...V}),f=t.ref([]),u=t.ref([]),_=t.ref([]),g=t.ref({}),j=t.computed(()=>Q(g.value));function Q(e){const l=new Set;for(const a in e)e.hasOwnProperty(a)&&e[a].forEach(n=>{l.add(n.id)});return l}const I=({value:e,intermediate:l=!1,onChange:a})=>t.h(x.ElCheckbox,{onChange:a,modelValue:e,indeterminate:l}),X=(e,l)=>{if(e.selected=l,l?u.value.some(a=>a.id===e.id)||u.value.push(e):u.value=u.value.filter(({id:a})=>a!==e.id),e.children&&e.children.length>0){const a=n=>{n.forEach(o=>{o.selected=l,l?u.value.some(c=>c.id===o.id)||u.value.push(o):u.value=u.value.filter(({id:c})=>c!==o.id),o.children&&o.children.length>0&&a(o.children)})};a(e.children)}e.parentId&&O(e.parentId),D(),b()},O=e=>{const l=M(i.value,e);if(!l)return;const a=l.children.every(n=>n.selected);a&&!l.selected?(l.selected=!0,u.value.some(n=>n.id===l.id)||u.value.push(l)):!a&&l.selected&&(l.selected=!1,u.value=u.value.filter(({id:n})=>n!==l.id)),l.parentId&&O(l.parentId)},M=(e,l)=>{for(const a of e){if(a.id===l)return a;if(a.children){const n=M(a.children,l);if(n)return n}}return null};function D(){g.value[s.value[d.value]]=K(i.value)}function K(e){let l=[];return e.forEach(a=>{a.selected&&l.push(a),a.children&&a.children.length>0&&(l=l.concat(K(a.children)))}),l}function R(e,l){e.selected=l,e.children&&e.children.length>0&&e.children.forEach(a=>R(a,l))}const Z=e=>{const l=i.value.map(a=>(R(a,e),a));return i.value=[...l],D(),u.value=e?[...Object.values(g.value).flat()]:[],b(),[...u.value]},ee=()=>{f.value.unshift({key:"selection",width:50,cellRenderer:e=>{const{rowData:l}=e,n=l.children&&l.children.length>0?te(l):!1;return t.h(I,{value:l.selected,intermediate:n,onChange:o=>X(l,o)})},headerCellRenderer:()=>{const e=t.unref(i),l=e.every(n=>{const o=n.selected,c=W(n);return o&&c}),a=e.some(n=>n.selected||F(n));return t.h(I,{value:l,intermediate:a&&!l,onChange:Z})}})},te=e=>{if(!e.children||e.children.length===0)return!1;const l=e.children.filter(a=>a.selected).length;return l>0&&l<e.children.length};function W(e){return e.children?.length?!!e.selected&&e.children.every(W):!!e.selected}function F(e){return e.selected?!0:e.children?.some(F)||!1}function L(e){return e.map(l=>{const a={...l,selected:!1};return a.children&&(a.children=L(a.children)),a})}const h=t.ref(!1),le=()=>{h.value=!0,ee()},z=()=>{h.value=!1,u.value=[],i.value=i.value.map(e=>(R(e,!1),e)),g.value={},p.value=L(p.value),f.value.shift(),b()},ae=()=>{y("handleBatchDelete",{selectedRows:Object.values(g.value).flat(),cb:()=>{z(),b()}})},ne=()=>{u.value=[],b()};function b(){const e=Object.values(g.value).flat();y("handleTableSelect",{originNodeData:u.value,allSelectedNodes:e,selectedSubNodes:e.filter(l=>!l.children)})}const C=()=>{B.value?r.requestFn({...r.params,...s.value}).then(e=>{p.value=A(e?.data[r.tableDataKey],s.value[d.value],j.value)||[],P.value=e?.data?.total}):(p.value=A(r.tableData,s.value[d.value],j.value),P.value=r.total)};function A(e,l,a,n=!1){return e.map(o=>{const c=a.has(o.id)||n,m={...o,selected:c};return m.children&&(m.children=A(m.children,l,a,c)),m})}const ue=()=>{s.value[d.value]=V[d.value],C()},oe=()=>{s.value={...V},C()},$=e=>{e==="size"&&(s.value[d.value]=1),C(),y(T.emitsMap.paginationChange,s.value)},N=t.ref(0),E=()=>{let e=N.value;e=h.value?e-50:e;let l=t.unref(f);h.value&&(l=t.unref(f).slice(1));const a=1/T.calculateScale();l=l.map((n,o)=>(r.columnWidthMap?n.width=e*r.columnWidthMap[o]*a:(n.width=e*(100/l.length/100)*a,n.width<100&&(n.width=100*a)),S.value&&Object.keys(S.value).length&&S.value[n.key]&&(n.sortable=!0),n)),h.value?f.value=[t.unref(f)[0],...l]:f.value=[...l]};t.watch(()=>h.value,()=>{E()}),t.watch(()=>r.tableDomWidth,e=>{e&&(N.value=e,E())});function re(e,l=200){let a;return function(){clearTimeout(a),a=setTimeout(()=>{e.apply(this,arguments)},l)}}const U=re(()=>{N.value=document.querySelector(".TABLE-AREA").getBoundingClientRect().width,E()},200);return t.onMounted(()=>{C(),f.value=r.columns,N.value=document.querySelector(".TABLE-AREA").getBoundingClientRect().width,t.nextTick(()=>{E()}),window.addEventListener("resize",U)}),Y({getTableList:C,search:ue,reset:oe,initBatchSelect:ne,handleCancelSelect:z,handleResize:U}),(e,l)=>(t.openBlock(),t.createElementBlock("div",de,[t.createElementVNode("div",fe,[t.unref(w)["filter-left"]?(t.openBlock(),t.createElementBlock("div",ve,[t.renderSlot(e.$slots,"filter-left",{},void 0,!0)])):t.createCommentVNode("",!0),t.createElementVNode("div",he,[v.hasBatchSelect&&i.value.length?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[h.value?(t.openBlock(),t.createElementBlock("div",pe,[t.createElementVNode("div",ge,"已选"+t.toDisplayString(u.value.length)+"条数据",1),t.createElementVNode("div",{class:"fz-12 text-3b64ff mg-l-4 pointer",onClick:z},"取消选择"),t.renderSlot(e.$slots,"btn-group",{},()=>[t.createElementVNode("div",me,[t.createVNode(t.unref(x.ElButton),{type:"danger",onClick:ae,disabled:!u.value.length},{default:t.withCtx(()=>[...l[6]||(l[6]=[t.createTextVNode("删除",-1)])]),_:1},8,["disabled"])])],!0)])):(t.openBlock(),t.createBlock(t.unref(x.ElButton),{key:0,type:"default",onClick:le},{default:t.withCtx(()=>[...l[5]||(l[5]=[t.createTextVNode(" 批量选择 ",-1)])]),_:1}))],64)):t.createCommentVNode("",!0),t.unref(w)["filter-right"]?t.renderSlot(e.$slots,"filter-right",{key:1},void 0,!0):t.createCommentVNode("",!0)])]),t.createElementVNode("div",ye,[t.createElementVNode("div",Se,[t.createVNode(t.unref(x.ElAutoResizer),null,{default:t.withCtx(({width:a,height:n})=>[t.createVNode(t.unref(x.ElTableV2),{"expanded-row-keys":_.value,"onUpdate:expandedRowKeys":l[0]||(l[0]=o=>_.value=o),"expand-column-key":v.expandColumnKey,columns:f.value,data:i.value,width:a,height:n,fixed:"","sort-state":S.value,onColumnSort:J},t.createSlots({_:2},[t.renderList(t.unref(w),(o,c)=>({name:c,fn:t.withCtx(m=>[t.renderSlot(e.$slots,c,t.normalizeProps(t.guardReactiveProps(m)),void 0,!0)])}))]),1032,["expanded-row-keys","expand-column-key","columns","data","width","height","sort-state"])]),_:3})]),v.isPagination&&q.value>s.value[k.value]?(t.openBlock(),t.createElementBlock("div",be,[v.isPagination?(t.openBlock(),t.createBlock(ie._sfc_main,{key:0,"current-page":s.value[d.value],"onUpdate:currentPage":l[1]||(l[1]=a=>s.value[d.value]=a),"page-size":s.value[k.value],"onUpdate:pageSize":l[2]||(l[2]=a=>s.value[k.value]=a),"page-sizes":v.pagination.pageSizes,layout:v.pagination.layout,total:q.value,onSizeChange:l[3]||(l[3]=a=>$("size")),onCurrentChange:l[4]||(l[4]=a=>$("page"))},null,8,["current-page","page-size","page-sizes","layout","total"])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)])]))}}),xe=ce._export_sfc(Ce,[["__scopeId","data-v-7d5408b1"]]),H=se.withInstall(xe);exports.PaginationTable=H;exports.default=H;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./assets/PaginationTable.css');const se=require("./chunks/index.CkihWzK6.js"),t=require("vue"),x=require("element-plus"),A=require("ling-yun-methods"),ie=require("color-star-custom-methods"),ce=require("./chunks/layout.DE2WIKAN.js"),de=require("./chunks/_plugin-vue_export-helper.BHFhmbuH.js"),fe={class:"flex h-full flex-col"},ve={class:"w-full flex justify-between overflow-hidden",style:{height:"auto"}},he={key:0,class:"flex-1 overflow-hidden"},pe={class:"flex",style:{width:"auto",gap:"10px"}},ge={key:1,class:"flex items-center mg-b-18"},me={class:"fz-12 text-74798c"},Se={class:"btn-group mg-l-12"},ye={class:"w-full flex-1 overflow-hidden flex flex-col"},be={class:"flex-1 overflow-hidden TABLE-AREA"},Ce={key:0,class:"flex justify-end mg-t-20",style:{height:"auto"}},xe=Object.assign({name:"PaginationTable"},{__name:"layout",props:{isPagination:{type:Boolean,default:!0},total:{type:Number,default:0},tableData:{type:Array,default:()=>[]},pagination:{type:Object,default:()=>A.paginationConfig},params:{type:Object,default:()=>{}},requestFn:{type:Function},columns:{type:Array,default:()=>[]},hasBatchSelect:{type:Boolean,default:!1},expandColumnKey:{type:String,default:""},columnWidthMap:{type:Object,default:()=>{}},tableDataKey:{type:String,default:"list"},tableDomWidth:{type:Number,default:0},pageMapping:{type:Object,default:()=>({pageSize:"pageSize",pageNum:"pageNum"})},sortState:{type:Object,default:()=>{}}},emits:[A.emitsMap.paginationChange,"updateTableData","handleTableSelect","handleBatchDelete","updateSortState"],setup(v,{expose:Y,emit:G}){const S=G,r=v,T=t.useSlots(),B=t.computed(()=>typeof r.requestFn=="function"),i=t.computed({get:()=>B.value?p.value:r.tableData,set:e=>{B.value?p.value=e:S("updateTableData",e)}}),w=t.ref(0),q=t.computed(()=>B.value?w.value:r.total),y=t.computed({get:()=>r.sortState,set:e=>{S("updateSortState",e)}}),J=({key:e,order:l})=>{y.value[e]=l,i.value=i.value.reverse()},p=t.ref([]),d=t.computed(()=>r.pageMapping.pageNum),k=t.computed(()=>r.pageMapping.pageSize),P={[d.value]:1,[k.value]:20},s=t.ref({...P}),f=t.ref([]),u=t.ref([]),_=t.ref([]),g=t.ref({}),j=t.computed(()=>Q(g.value));function Q(e){const l=new Set;for(const a in e)e.hasOwnProperty(a)&&e[a].forEach(n=>{l.add(n.id)});return l}const I=({value:e,intermediate:l=!1,onChange:a})=>t.h(x.ElCheckbox,{onChange:a,modelValue:e,indeterminate:l}),X=(e,l)=>{if(e.selected=l,l?u.value.some(a=>a.id===e.id)||u.value.push(e):u.value=u.value.filter(({id:a})=>a!==e.id),e.children&&e.children.length>0){const a=n=>{n.forEach(o=>{o.selected=l,l?u.value.some(c=>c.id===o.id)||u.value.push(o):u.value=u.value.filter(({id:c})=>c!==o.id),o.children&&o.children.length>0&&a(o.children)})};a(e.children)}e.parentId&&M(e.parentId),D(),b()},M=e=>{const l=O(i.value,e);if(!l)return;const a=l.children.every(n=>n.selected);a&&!l.selected?(l.selected=!0,u.value.some(n=>n.id===l.id)||u.value.push(l)):!a&&l.selected&&(l.selected=!1,u.value=u.value.filter(({id:n})=>n!==l.id)),l.parentId&&M(l.parentId)},O=(e,l)=>{for(const a of e){if(a.id===l)return a;if(a.children){const n=O(a.children,l);if(n)return n}}return null};function D(){g.value[s.value[d.value]]=K(i.value)}function K(e){let l=[];return e.forEach(a=>{a.selected&&l.push(a),a.children&&a.children.length>0&&(l=l.concat(K(a.children)))}),l}function V(e,l){e.selected=l,e.children&&e.children.length>0&&e.children.forEach(a=>V(a,l))}const Z=e=>{const l=i.value.map(a=>(V(a,e),a));return i.value=[...l],D(),u.value=e?[...Object.values(g.value).flat()]:[],b(),[...u.value]},ee=()=>{f.value.unshift({key:"selection",width:50,cellRenderer:e=>{const{rowData:l}=e,n=l.children&&l.children.length>0?te(l):!1;return t.h(I,{value:l.selected,intermediate:n,onChange:o=>X(l,o)})},headerCellRenderer:()=>{const e=t.unref(i),l=e.every(n=>{const o=n.selected,c=W(n);return o&&c}),a=e.some(n=>n.selected||F(n));return t.h(I,{value:l,intermediate:a&&!l,onChange:Z})}})},te=e=>{if(!e.children||e.children.length===0)return!1;const l=e.children.filter(a=>a.selected).length;return l>0&&l<e.children.length};function W(e){return e.children?.length?!!e.selected&&e.children.every(W):!!e.selected}function F(e){return e.selected?!0:e.children?.some(F)||!1}function L(e){return e.map(l=>{const a={...l,selected:!1};return a.children&&(a.children=L(a.children)),a})}const h=t.ref(!1),le=()=>{h.value=!0,ee()},R=()=>{h.value=!1,u.value=[],i.value=i.value.map(e=>(V(e,!1),e)),g.value={},p.value=L(p.value),f.value.shift(),b()},ae=()=>{S("handleBatchDelete",{selectedRows:Object.values(g.value).flat(),cb:()=>{R(),b()}})},ne=()=>{u.value=[],b()};function b(){const e=Object.values(g.value).flat();S("handleTableSelect",{originNodeData:u.value,allSelectedNodes:e,selectedSubNodes:e.filter(l=>!l.children)})}const C=()=>{B.value?r.requestFn({...r.params,...s.value}).then(e=>{p.value=z(e?.data[r.tableDataKey],s.value[d.value],j.value)||[],w.value=e?.data?.total}):(p.value=z(r.tableData,s.value[d.value],j.value),w.value=r.total)};function z(e,l,a,n=!1){return e.map(o=>{const c=a.has(o.id)||n,m={...o,selected:c};return m.children&&(m.children=z(m.children,l,a,c)),m})}const ue=()=>{s.value[d.value]=P[d.value],C()},oe=()=>{s.value={...P},C()},$=e=>{e==="size"&&(s.value[d.value]=1),C(),S(A.emitsMap.paginationChange,s.value)},N=t.ref(0),E=()=>{let e=N.value;e=h.value?e-50:e;let l=t.unref(f);h.value&&(l=t.unref(f).slice(1));const a=1/ie.calculateScale();l=l.map((n,o)=>(r.columnWidthMap?n.width=e*r.columnWidthMap[o]*a:(n.width=e*(100/l.length/100)*a,n.width<100&&(n.width=100*a)),y.value&&Object.keys(y.value).length&&y.value[n.key]&&(n.sortable=!0),n)),h.value?f.value=[t.unref(f)[0],...l]:f.value=[...l]};t.watch(()=>h.value,()=>{E()}),t.watch(()=>r.tableDomWidth,e=>{e&&(N.value=e,E())});function re(e,l=200){let a;return function(){clearTimeout(a),a=setTimeout(()=>{e.apply(this,arguments)},l)}}const U=re(()=>{N.value=document.querySelector(".TABLE-AREA").getBoundingClientRect().width,E()},200);return t.onMounted(()=>{C(),f.value=r.columns,N.value=document.querySelector(".TABLE-AREA").getBoundingClientRect().width,t.nextTick(()=>{E()}),window.addEventListener("resize",U)}),Y({getTableList:C,search:ue,reset:oe,initBatchSelect:ne,handleCancelSelect:R,handleResize:U}),(e,l)=>(t.openBlock(),t.createElementBlock("div",fe,[t.createElementVNode("div",ve,[t.unref(T)["filter-left"]?(t.openBlock(),t.createElementBlock("div",he,[t.renderSlot(e.$slots,"filter-left",{},void 0,!0)])):t.createCommentVNode("",!0),t.createElementVNode("div",pe,[v.hasBatchSelect&&i.value.length?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[h.value?(t.openBlock(),t.createElementBlock("div",ge,[t.createElementVNode("div",me,"已选"+t.toDisplayString(u.value.length)+"条数据",1),t.createElementVNode("div",{class:"fz-12 text-3b64ff mg-l-4 pointer",onClick:R},"取消选择"),t.renderSlot(e.$slots,"btn-group",{},()=>[t.createElementVNode("div",Se,[t.createVNode(t.unref(x.ElButton),{type:"danger",onClick:ae,disabled:!u.value.length},{default:t.withCtx(()=>[...l[6]||(l[6]=[t.createTextVNode("删除",-1)])]),_:1},8,["disabled"])])],!0)])):(t.openBlock(),t.createBlock(t.unref(x.ElButton),{key:0,type:"default",onClick:le},{default:t.withCtx(()=>[...l[5]||(l[5]=[t.createTextVNode(" 批量选择 ",-1)])]),_:1}))],64)):t.createCommentVNode("",!0),t.unref(T)["filter-right"]?t.renderSlot(e.$slots,"filter-right",{key:1},void 0,!0):t.createCommentVNode("",!0)])]),t.createElementVNode("div",ye,[t.createElementVNode("div",be,[t.createVNode(t.unref(x.ElAutoResizer),null,{default:t.withCtx(({width:a,height:n})=>[t.createVNode(t.unref(x.ElTableV2),{"expanded-row-keys":_.value,"onUpdate:expandedRowKeys":l[0]||(l[0]=o=>_.value=o),"expand-column-key":v.expandColumnKey,columns:f.value,data:i.value,width:a,height:n,fixed:"","sort-state":y.value,onColumnSort:J},t.createSlots({_:2},[t.renderList(t.unref(T),(o,c)=>({name:c,fn:t.withCtx(m=>[t.renderSlot(e.$slots,c,t.normalizeProps(t.guardReactiveProps(m)),void 0,!0)])}))]),1032,["expanded-row-keys","expand-column-key","columns","data","width","height","sort-state"])]),_:3})]),v.isPagination&&q.value>s.value[k.value]?(t.openBlock(),t.createElementBlock("div",Ce,[v.isPagination?(t.openBlock(),t.createBlock(ce._sfc_main,{key:0,"current-page":s.value[d.value],"onUpdate:currentPage":l[1]||(l[1]=a=>s.value[d.value]=a),"page-size":s.value[k.value],"onUpdate:pageSize":l[2]||(l[2]=a=>s.value[k.value]=a),"page-sizes":v.pagination.pageSizes,layout:v.pagination.layout,total:q.value,onSizeChange:l[3]||(l[3]=a=>$("size")),onCurrentChange:l[4]||(l[4]=a=>$("page"))},null,8,["current-page","page-size","page-sizes","layout","total"])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)])]))}}),Be=de._export_sfc(xe,[["__scopeId","data-v-639533d7"]]),H=se.withInstall(Be);exports.PaginationTable=H;exports.default=H;
@@ -0,0 +1 @@
1
+ .config-item__label[data-v-410e68d5]{width:80px;height:auto}.config-item__label span[data-v-410e68d5]{line-height:20px;color:#5d6c89}.hover-overlay[data-v-4137d33a]{background-color:#00000080}[data-v-4e41255e] .el-timeline-item__timestamp{color:#86909c}[data-v-4e41255e] .el-card{background:#f7f8fa}.el-tab-pane[data-v-0ffdf013]{height:100%;overflow:hidden}
File without changes
@@ -1 +1 @@
1
- [data-v-7d5408b1] .el-table-v2__header-cell-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
1
+ [data-v-639533d7] .el-table-v2__header-cell-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}