From 99421397366091a244ae5a58730b14b1e85ffe1d Mon Sep 17 00:00:00 2001 From: Theluyuan <1162963624@qq.com> Date: Wed, 17 May 2023 14:38:47 +0800 Subject: [PATCH] test table --- es/table/index.js | 3 ++- lib/index.js | 3 ++- src/component/table/index.vue | 4 +++- umd/index.js | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/es/table/index.js b/es/table/index.js index 2cd7b90..9a97262 100644 --- a/es/table/index.js +++ b/es/table/index.js @@ -1058,7 +1058,7 @@ const _sfc_main = defineComponent({ }); }; findFinalNode(0, tableColumns.value); - const tableSelectedKeys = ref([...props.selectedKeys]); + const tableSelectedKeys = ref(props.selectedKeys); const tableExpandKeys = ref([...props.expandKeys]); watch(() => props.selectedKeys, () => { tableSelectedKeys.value = props.selectedKeys; @@ -1103,6 +1103,7 @@ const _sfc_main = defineComponent({ hasChecked.value = false; } if (tableSelectedKeys.value != props.selectedKeys) { + console.log("\u521D\u59CB\u5316\u8D4B\u503C\u89E6\u53D1\u4FEE\u6539", tableSelectedKeys.value, props.selectedKeys); emit("update:selectedKeys", tableSelectedKeys.value); } }, { deep: true, immediate: true }); diff --git a/lib/index.js b/lib/index.js index 1590efd..cb51bd1 100644 --- a/lib/index.js +++ b/lib/index.js @@ -19492,7 +19492,7 @@ const _sfc_main$D = defineComponent({ }); }; findFinalNode(0, tableColumns.value); - const tableSelectedKeys = ref([...props.selectedKeys]); + const tableSelectedKeys = ref(props.selectedKeys); const tableExpandKeys = ref([...props.expandKeys]); watch(() => props.selectedKeys, () => { tableSelectedKeys.value = props.selectedKeys; @@ -19537,6 +19537,7 @@ const _sfc_main$D = defineComponent({ hasChecked.value = false; } if (tableSelectedKeys.value != props.selectedKeys) { + console.log("\u521D\u59CB\u5316\u8D4B\u503C\u89E6\u53D1\u4FEE\u6539", tableSelectedKeys.value, props.selectedKeys); emit("update:selectedKeys", tableSelectedKeys.value); } }, { deep: true, immediate: true }); diff --git a/src/component/table/index.vue b/src/component/table/index.vue index 033af30..31233e3 100644 --- a/src/component/table/index.vue +++ b/src/component/table/index.vue @@ -238,7 +238,8 @@ const findFinalNode = (level: number, columns: any[]) => { findFinalNode(0, tableColumns.value); -const tableSelectedKeys = ref([...props.selectedKeys]); +// 你浅拷贝他干什么呀 +const tableSelectedKeys = ref(props.selectedKeys); const tableExpandKeys = ref([...props.expandKeys]); watch( @@ -314,6 +315,7 @@ watch( hasChecked.value = false; } if(tableSelectedKeys.value != props.selectedKeys){ + console.log("初始化赋值触发修改",tableSelectedKeys.value,props.selectedKeys) emit("update:selectedKeys", tableSelectedKeys.value); } }, diff --git a/umd/index.js b/umd/index.js index 614eb6c..8912e9d 100644 --- a/umd/index.js +++ b/umd/index.js @@ -80,7 +80,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `)(),N3=(()=>`.layui-table-cell[data-v-21a1010c] .layui-input input{padding-left:0} `)();const uA=["colspan","rowspan"],tA={key:1,class:"layui-table-cell-expand-icon-spaced"},TA=["colspan","rowspan"],yA={key:1,class:"layui-table-cell-expand-icon-spaced"},gA=["colspan","rowspan"],LA={key:1,class:"layui-table-cell-expand-icon-spaced"},aA=["colspan","rowspan"],cA={key:1,class:"layui-table-cell-expand-icon-spaced"},IA=["colspan","rowspan","onClick"],sA={key:1,class:"layui-table-cell-expand-icon-spaced"},oA={key:0},nA={key:1},OA={key:0,class:"layui-table-cell-expand"},lA=["colspan"],rA={name:"TableRow"},wA=M.defineComponent({...rA,props:{index:null,indentSize:null,currentIndentSize:null,expandSpace:{type:Boolean},expandIndex:null,selectedKeys:null,selectedKey:null,tableColumnKeys:null,childrenColumnName:{default:"children"},columns:null,checkbox:{type:Boolean,default:!1},cellClassName:{type:[String,Function],default:""},cellStyle:{type:[String,Function],default:""},rowClassName:null,rowStyle:null,id:null,data:null,spanMethod:null,defaultExpandAll:{type:Boolean},expandKeys:null,getCheckboxProps:null,getRadioProps:null},emits:["row","row-double","row-contextmenu","update:expandKeys","update:selectedKeys","update:selectedKey"],setup(D,{emit:j}){const N=D,z=M.useSlots(),e=M.ref(N.defaultExpandAll),i=M.ref({}),u=M.computed({get(){return[...N.expandKeys]},set(q){j("update:expandKeys",q)}}),T=M.computed({get(){return[...N.selectedKeys]},set(q){j("update:selectedKeys",q)}}),y=M.computed({get(){return N.selectedKey},set(q){j("update:selectedKey",q)}}),L=M.computed({get(){return e.value?!0:u.value.includes(N.data[N.id])},set(q){let zM=[...u.value];q?zM.push(N.data[N.id]):zM.splice(zM.indexOf(N.data[N.id]),1),e.value=!1,u.value=zM}}),c=M.ref([]);N.columns.map(q=>{q.customSlot&&c.value.push(q.customSlot)});const a=function(q,zM){let eM=new Event("click");window.dispatchEvent(eM),j("row",q,zM)},s=function(q,zM){j("row-double",q,zM)},l=function(q,zM){j("row-contextmenu",q,zM)},O=M.computed(()=>L.value?"layui-icon-subtraction":"layui-icon-addition"),r=()=>{L.value=!L.value},x=(q,zM,eM,H)=>typeof N.cellStyle=="string"?N.cellStyle:N.cellStyle(q,zM,eM,H),o=(q,zM,eM,H)=>typeof N.cellClassName=="string"?N.cellClassName:N.cellClassName(q,zM,eM,H),w=(q,zM)=>typeof N.rowStyle=="string"?N.rowStyle:N.rowStyle(q,zM),A=(q,zM)=>typeof N.rowClassName=="string"?N.rowClassName:N.rowClassName(q,zM),E=M.computed(()=>N.currentIndentSize+N.indentSize),k=(q,zM)=>{var b,v,B,Z;if(q.fixed)if(q.fixed=="left"){for(var eM=0,H=0;H{if(q.fixed)if(q.fixed=="left"){for(var eM=!0,H=zM+1;H{const h=N.spanMethod(q,zM,eM,H);return h instanceof Array?{rowspan:h[0],colspan:h[1]}:h instanceof Object?h:{rowspan:1,colspan:1}},p=(q,zM,eM,H)=>{const h=C(q,zM,eM,H);return!(h.colspan==0&&h.rowspan==0)},G=N.getCheckboxProps(N.data,N.index),$=N.getRadioProps(N.data,N.index);return(q,zM)=>{const eM=M.resolveComponent("lay-input"),H=M.resolveComponent("table-row",!0);return M.openBlock(),M.createElementBlock(M.Fragment,null,[M.createElementVNode("tr",{style:M.normalizeStyle([w(D.data,D.index)]),class:M.normalizeClass([A(D.data,D.index)]),onClick:zM[2]||(zM[2]=M.withModifiers(h=>a(D.data,h),["stop"])),onDblclick:zM[3]||(zM[3]=M.withModifiers(h=>s(D.data,h),["stop"])),onContextmenu:zM[4]||(zM[4]=M.withModifiers(h=>l(D.data,h),["stop"]))},[(M.openBlock(!0),M.createElementBlock(M.Fragment,null,M.renderList(D.columns,(h,F)=>(M.openBlock(),M.createElementBlock(M.Fragment,{key:F},[D.tableColumnKeys.includes(h.key)?(M.openBlock(),M.createElementBlock(M.Fragment,{key:0},[h.type?(M.openBlock(),M.createElementBlock(M.Fragment,{key:0},[h.type=="radio"?(M.openBlock(),M.createElementBlock(M.Fragment,{key:0},[p(D.data,h,D.index,F)?(M.openBlock(),M.createElementBlock("td",{key:0,class:M.normalizeClass(["layui-table-cell layui-table-cell-radio",[Q(h,F),o(D.data,h,D.index,F),h.fixed?`layui-table-fixed-${h.fixed}`:""]]),colspan:C(D.data,h,D.index,F).colspan,rowspan:C(D.data,h,D.index,F).rowspan,style:M.normalizeStyle([{textAlign:h.align,whiteSpace:h.ellipsisTooltip?"nowrap":"normal"},k(h,F),x(D.data,h,D.index,F)])},[D.expandSpace&&F===D.expandIndex?(M.openBlock(),M.createElementBlock("span",{key:0,style:M.normalizeStyle({"margin-right":D.currentIndentSize+"px"})},null,4)):M.createCommentVNode("",!0),D.expandSpace&&!D.data[D.childrenColumnName]&&!M.unref(z).expand&&F===D.expandIndex?(M.openBlock(),M.createElementBlock("span",tA)):M.createCommentVNode("",!0),(M.unref(z).expand||D.data[D.childrenColumnName])&&F===D.expandIndex?(M.openBlock(),M.createBlock(M.unref(P),{key:2,class:"layui-table-cell-expand-icon",type:M.unref(O),onClick:r},null,8,["type"])):M.createCommentVNode("",!0),M.createVNode(X4,M.mergeProps({modelValue:M.unref(y),"onUpdate:modelValue":zM[0]||(zM[0]=b=>M.isRef(y)?y.value=b:null)},M.unref($),{value:D.data[D.id]}),null,16,["modelValue","value"])],14,uA)):M.createCommentVNode("",!0)],64)):M.createCommentVNode("",!0),h.type=="checkbox"?(M.openBlock(),M.createElementBlock(M.Fragment,{key:1},[p(D.data,h,D.index,F)?(M.openBlock(),M.createElementBlock("td",{key:0,class:M.normalizeClass(["layui-table-cell layui-table-cell-checkbox",[Q(h,F),o(D.data,h,D.index,F),h.fixed?`layui-table-fixed-${h.fixed}`:""]]),colspan:C(D.data,h,D.index,F).colspan,rowspan:C(D.data,h,D.index,F).rowspan,style:M.normalizeStyle([{textAlign:h.align,whiteSpace:h.ellipsisTooltip?"nowrap":"normal"},k(h,F),x(D.data,h,D.index,F)])},[D.expandSpace&&F===D.expandIndex?(M.openBlock(),M.createElementBlock("span",{key:0,style:M.normalizeStyle({"margin-right":D.currentIndentSize+"px"})},null,4)):M.createCommentVNode("",!0),D.expandSpace&&!D.data[D.childrenColumnName]&&!M.unref(z).expand&&F===D.expandIndex?(M.openBlock(),M.createElementBlock("span",yA)):M.createCommentVNode("",!0),(M.unref(z).expand||D.data[D.childrenColumnName])&&F===D.expandIndex?(M.openBlock(),M.createBlock(M.unref(P),{key:2,class:"layui-table-cell-expand-icon",type:M.unref(O),onClick:r},null,8,["type"])):M.createCommentVNode("",!0),M.createVNode(jD,M.mergeProps({modelValue:M.unref(T),"onUpdate:modelValue":zM[1]||(zM[1]=b=>M.isRef(T)?T.value=b:null)},M.unref(G),{value:D.data[D.id],skin:"primary"}),null,16,["modelValue","value"])],14,TA)):M.createCommentVNode("",!0)],64)):M.createCommentVNode("",!0),h.type=="number"?(M.openBlock(),M.createElementBlock(M.Fragment,{key:2},[p(D.data,h,D.index,F)?(M.openBlock(),M.createElementBlock("td",{key:0,class:M.normalizeClass(["layui-table-cell layui-table-cell-number",[Q(h,F),o(D.data,h,D.index,F),h.fixed?`layui-table-fixed-${h.fixed}`:""]]),colspan:C(D.data,h,D.index,F).colspan,rowspan:C(D.data,h,D.index,F).rowspan,style:M.normalizeStyle([{textAlign:h.align,whiteSpace:h.ellipsisTooltip?"nowrap":"normal"},k(h,F),x(D.data,h,D.index,F)])},[D.expandSpace&&F===D.expandIndex?(M.openBlock(),M.createElementBlock("span",{key:0,style:M.normalizeStyle({"margin-right":D.currentIndentSize+"px"})},null,4)):M.createCommentVNode("",!0),D.expandSpace&&!D.data[D.childrenColumnName]&&!M.unref(z).expand&&F===D.expandIndex?(M.openBlock(),M.createElementBlock("span",LA)):M.createCommentVNode("",!0),(M.unref(z).expand||D.data[D.childrenColumnName])&&F===D.expandIndex?(M.openBlock(),M.createBlock(M.unref(P),{key:2,class:"layui-table-cell-expand-icon",type:M.unref(O),onClick:r},null,8,["type"])):M.createCommentVNode("",!0),M.createTextVNode(" "+M.toDisplayString(D.index+1),1)],14,gA)):M.createCommentVNode("",!0)],64)):M.createCommentVNode("",!0)],64)):(M.openBlock(),M.createElementBlock(M.Fragment,{key:1},[h.customSlot?(M.openBlock(),M.createElementBlock(M.Fragment,{key:0},[p(D.data,h,D.index,F)?(M.openBlock(),M.createElementBlock("td",{key:0,class:M.normalizeClass(["layui-table-cell",[Q(h,F),o(D.data,h,D.index,F),h.fixed?`layui-table-fixed-${h.fixed}`:""]]),colspan:C(D.data,h,D.index,F).colspan,rowspan:C(D.data,h,D.index,F).rowspan,style:M.normalizeStyle([{textAlign:h.align,whiteSpace:h.ellipsisTooltip?"nowrap":"normal"},k(h,F),x(D.data,h,D.index,F)])},[M.createElementVNode("div",{style:M.normalizeStyle([{display:"flex"},[{textAlign:h.align,justifyContent:h.align}]])},[D.expandSpace&&F===D.expandIndex?(M.openBlock(),M.createElementBlock("span",{key:0,style:M.normalizeStyle({"margin-right":D.currentIndentSize+"px"})},null,4)):M.createCommentVNode("",!0),D.expandSpace&&!D.data[D.childrenColumnName]&&!M.unref(z).expand&&F===D.expandIndex?(M.openBlock(),M.createElementBlock("span",cA)):M.createCommentVNode("",!0),(M.unref(z).expand||D.data[D.childrenColumnName])&&F===D.expandIndex?(M.openBlock(),M.createBlock(M.unref(P),{key:2,class:"layui-table-cell-expand-icon",type:M.unref(O),onClick:r},null,8,["type"])):M.createCommentVNode("",!0),h.ellipsisTooltip?(M.openBlock(),M.createBlock(DD,{key:3,isAutoShow:!0},{content:M.withCtx(()=>[M.renderSlot(q.$slots,h.customSlot,{data:D.data,column:h},void 0,!0)]),default:M.withCtx(()=>[M.renderSlot(q.$slots,h.customSlot,{data:D.data,column:h},void 0,!0)]),_:2},1024)):M.renderSlot(q.$slots,h.customSlot,{key:4,data:D.data,column:h},void 0,!0)],4)],14,aA)):M.createCommentVNode("",!0)],64)):(M.openBlock(),M.createElementBlock(M.Fragment,{key:1},[p(D.data,h,D.index,F)?(M.openBlock(),M.createElementBlock("td",{key:0,class:M.normalizeClass(["layui-table-cell",[Q(h,F),o(D.data,h,D.index,F),h.fixed?`layui-table-fixed-${h.fixed}`:""]]),colspan:C(D.data,h,D.index,F).colspan,rowspan:C(D.data,h,D.index,F).rowspan,style:M.normalizeStyle([{textAlign:h.align,whiteSpace:h.ellipsisTooltip?"nowrap":"normal"},k(h,F),x(D.data,h,D.index,F)]),onClick:b=>i.value[F]=!0},[M.createElementVNode("div",{style:M.normalizeStyle([{display:"flex"},[{textAlign:h.align,justifyContent:h.align}]])},[D.expandSpace&&F===D.expandIndex?(M.openBlock(),M.createElementBlock("span",{key:0,style:M.normalizeStyle({"margin-right":D.currentIndentSize+"px"})},null,4)):M.createCommentVNode("",!0),D.expandSpace&&!D.data[D.childrenColumnName]&&!M.unref(z).expand&&F===D.expandIndex?(M.openBlock(),M.createElementBlock("span",sA)):M.createCommentVNode("",!0),(M.unref(z).expand||D.data[D.childrenColumnName])&&F===D.expandIndex?(M.openBlock(),M.createBlock(M.unref(P),{key:2,class:"layui-table-cell-expand-icon",type:M.unref(O),onClick:r},null,8,["type"])):M.createCommentVNode("",!0),h.ellipsisTooltip?(M.openBlock(),M.createBlock(DD,{key:3,content:D.data[h.key],isAutoShow:!0},{default:M.withCtx(()=>[M.createTextVNode(M.toDisplayString(D.data[h.key]),1)]),_:2},1032,["content"])):(M.openBlock(),M.createElementBlock(M.Fragment,{key:4},[h.edit?(M.openBlock(),M.createElementBlock(M.Fragment,{key:0},[i.value[F]?(M.openBlock(),M.createBlock(eM,{key:1,autofocus:!0,modelValue:D.data[h.key],"onUpdate:modelValue":b=>D.data[h.key]=b,onKeyup:M.withKeys(b=>i.value[F]=!1,["enter"]),onBlur:b=>i.value[F]=!1},null,8,["modelValue","onUpdate:modelValue","onKeyup","onBlur"])):(M.openBlock(),M.createElementBlock("span",oA,M.toDisplayString(D.data[h.key]),1))],64)):(M.openBlock(),M.createElementBlock("span",nA,M.toDisplayString(D.data[h.key]),1))],64))],4)],14,IA)):M.createCommentVNode("",!0)],64))],64))],64)):M.createCommentVNode("",!0)],64))),128))],38),M.unref(z).expand&&M.unref(L)?(M.openBlock(),M.createElementBlock("tr",OA,[M.createElementVNode("td",{class:"layui-table-cell",colspan:D.columns.length},[M.renderSlot(q.$slots,"expand",{data:D.data},void 0,!0)],8,lA)])):M.createCommentVNode("",!0),D.data[D.childrenColumnName]&&M.unref(L)?(M.openBlock(!0),M.createElementBlock(M.Fragment,{key:1},M.renderList(D.data[D.childrenColumnName],(h,F)=>(M.openBlock(),M.createBlock(H,{key:F,id:D.id,data:h,index:F,columns:D.columns,"indent-size":D.indentSize,"current-indent-size":M.unref(E),checkbox:D.checkbox,tableColumnKeys:D.tableColumnKeys,expandSpace:D.expandSpace,expandIndex:D.expandIndex,cellStyle:D.cellStyle,cellClassName:D.cellClassName,rowStyle:D.rowStyle,rowClassName:D.rowClassName,spanMethod:D.spanMethod,defaultExpandAll:D.defaultExpandAll,getCheckboxProps:D.getCheckboxProps,getRadioProps:D.getRadioProps,onRow:a,onRowDouble:s,onRowContextmenu:l,expandKeys:M.unref(u),"onUpdate:expandKeys":zM[5]||(zM[5]=b=>M.isRef(u)?u.value=b:null),selectedKeys:M.unref(T),"onUpdate:selectedKeys":zM[6]||(zM[6]=b=>M.isRef(T)?T.value=b:null),selectedKey:M.unref(y),"onUpdate:selectedKey":zM[7]||(zM[7]=b=>M.isRef(y)?y.value=b:null)},M.createSlots({_:2},[M.renderList(c.value,b=>({name:b,fn:M.withCtx(v=>[M.renderSlot(q.$slots,b,{data:v.data,column:v.column},void 0,!0)])})),M.unref(z).expand?{name:"expand",fn:M.withCtx(b=>[M.renderSlot(q.$slots,"expand",{data:b.data,column:b.column},void 0,!0)]),key:"0"}:void 0]),1032,["id","data","index","columns","indent-size","current-indent-size","checkbox","tableColumnKeys","expandSpace","expandIndex","cellStyle","cellClassName","rowStyle","rowClassName","spanMethod","defaultExpandAll","getCheckboxProps","getRadioProps","expandKeys","selectedKeys","selectedKey"]))),128)):M.createCommentVNode("",!0)],64)}}});var AA=Dj(wA,[["__scopeId","data-v-21a1010c"]]),D3=(()=>`.layui-laypage{display:inline-block;vertical-align:middle;margin:10px 0;font-size:0}.layui-laypage>a:first-child,.layui-laypage>a:first-child em{border-radius:2px 0 0 2px}.layui-laypage>a:last-child,.layui-laypage>a:last-child em{border-radius:0 2px 2px 0}.layui-laypage>:first-child{margin-left:0!important}.layui-laypage>:last-child{margin-right:0!important}.layui-laypage a,.layui-laypage button,.layui-laypage input,.layui-laypage select,.layui-laypage span{border:1px solid var(--global-neutral-color-3)}.layui-laypage a,.layui-laypage span{display:inline-block;vertical-align:middle;padding:0 15px;height:28px;line-height:28px;margin:0 -1px 5px 0;background-color:#fff;color:#333;font-size:12px}.layui-laypage a:hover{color:var(--global-primary-color)}.layui-laypage-a-red:hover{color:#ff5722!important}.layui-laypage-a-orange:hover{color:#ffb800!important}.layui-laypage-a-green:hover{color:#009688!important}.layui-laypage-a-cyan:hover{color:#2f4056!important}.layui-laypage-a-blue:hover{color:#01aaed!important}.layui-laypage-a-black:hover{color:#000!important}.layui-laypage-a-gray:hover{color:#c2c2c2!important}.layui-laypage em{font-style:normal}.layui-laypage .layui-laypage-spr{color:#999;font-weight:700}.layui-laypage a{text-decoration:none}.layui-laypage .layui-laypage-curr{position:relative}.layui-laypage .layui-laypage-curr em{position:relative;color:#fff}.layui-laypage .layui-laypage-curr .layui-laypage-em{position:absolute;left:-1px;top:-1px;padding:1px;width:100%;height:100%;background-color:var(--global-primary-color)}.layui-laypage-em{border-radius:2px}.layui-laypage-next em,.layui-laypage-prev em{font-family:Sim sun;font-size:16px}.layui-laypage .layui-laypage-count,.layui-laypage .layui-laypage-limits,.layui-laypage .layui-laypage-refresh,.layui-laypage .layui-laypage-skip{margin-left:10px;margin-right:10px;padding:0;border:none}.layui-laypage .layui-laypage-limits,.layui-laypage .layui-laypage-refresh{vertical-align:top}.layui-laypage .layui-laypage-refresh i{font-size:18px;cursor:pointer}.layui-laypage select{height:22px;padding:3px;margin-top:4px;border-radius:2px;cursor:pointer}.layui-laypage .layui-laypage-skip{height:30px;line-height:30px;color:#999}.layui-laypage button,.layui-laypage input{height:30px;line-height:30px;border-radius:2px;vertical-align:top;background-color:#fff;box-sizing:border-box}.layui-laypage input{display:inline-block;width:40px;margin:0 10px;padding:0 3px;text-align:center}.layui-laypage input::-webkit-outer-spin-button,.layui-laypage input::-webkit-inner-spin-button{-webkit-appearance:none}.layui-laypage input:focus,.layui-laypage select:focus{border-color:var(--global-primary-color)!important}.layui-laypage button{margin-left:10px;padding:0 10px;cursor:pointer} `)();const EA={class:"layui-laypage layui-laypage-default"},xA={key:0,class:"layui-laypage-count"},QA={key:0,class:"layui-laypage-curr"},YA=["onClick"],kA={key:2,class:"layui-laypage-limits"},UA=["value"],CA=[M.createElementVNode("i",{class:"layui-icon layui-icon-refresh"},null,-1)],dA={key:4,class:"layui-laypage-skip"},SA=["disabled"],pA={key:5},fA={name:"LayPage"},ht=M.defineComponent({...fA,props:{total:null,limit:{default:10},theme:{default:"green"},showPage:{type:Boolean,default:!1},showSkip:{type:Boolean,default:!1},showCount:{type:Boolean,default:!1},showLimit:{type:Boolean,default:!0},showInput:{type:Boolean,default:!1},showRefresh:{type:Boolean,default:!1},pages:{default:10},limits:{default:()=>[10,20,30,40,50]},modelValue:{default:1},count:null},emits:["update:modelValue","update:limit","change"],setup(D,{emit:j}){const N=D,{t:z}=vN(),e=M.useSlots(),i=M.ref(0),u=M.ref(N.limits),T=M.computed(()=>Math.floor(N.pages/2)),y=M.ref(N.modelValue),L=M.ref(y.value),c=M.ref(N.limit);M.watch(()=>N.limit,()=>{c.value=N.limit});const a=M.computed(()=>{i.value=Math.ceil(N.total/c.value);let w=[],A=i.value<=N.pages?1:y.value>T.value?i.value-y.value+1=N.pages||E>i.value);E++)w.push(E);return w}),s=()=>{y.value!==1&&(y.value--,j("change",{current:y.value,limit:c.value}))},l=()=>{y.value===i.value||i.value===0||(y.value++,j("change",{current:y.value,limit:c.value}))},O=w=>{y.value=w,j("change",{current:y.value,limit:c.value})},r=()=>{y.value=L.value,j("change",{current:y.value,limit:c.value})},x=()=>{const w=Math.ceil(N.total/c.value);y.value>w&&(y.value=w),j("change",{current:y.value,limit:c.value})},o=()=>{j("change",{current:y.value,limit:c.value})};return M.watch(c,()=>{j("update:limit",c.value)}),M.watch(y,()=>{const w=a.value[0],A=a.value[a.value.length-1];y.value>A&&(y.value=A),y.valueN.modelValue,()=>{y.value=N.modelValue,L.value=y.value}),(w,A)=>(M.openBlock(),M.createElementBlock("div",EA,[D.showCount?(M.openBlock(),M.createElementBlock("span",xA,M.toDisplayString(M.unref(z)("page.total"))+" "+M.toDisplayString(D.total)+" "+M.toDisplayString(M.unref(z)("page.item"))+" "+M.toDisplayString(i.value)+" "+M.toDisplayString(M.unref(z)("page.page")),1)):M.createCommentVNode("",!0),M.createElementVNode("a",{href:"javascript:;",class:M.normalizeClass(["layui-laypage-prev",[y.value===1?"layui-disabled":"",D.theme&&y.value!==1?"layui-laypage-a-"+D.theme:""]]),onClick:A[0]||(A[0]=E=>s())},[M.unref(e).prev?M.renderSlot(w.$slots,"prev",{key:0}):(M.openBlock(),M.createElementBlock(M.Fragment,{key:1},[M.createTextVNode(M.toDisplayString(M.unref(z)("page.previous")),1)],64))],2),D.showPage?(M.openBlock(!0),M.createElementBlock(M.Fragment,{key:1},M.renderList(M.unref(a),E=>(M.openBlock(),M.createElementBlock(M.Fragment,{key:E},[E===y.value?(M.openBlock(),M.createElementBlock("span",QA,[M.createElementVNode("em",{class:M.normalizeClass(["layui-laypage-em",[D.theme?"layui-bg-"+D.theme:""]])},null,2),M.createElementVNode("em",null,M.toDisplayString(E),1)])):(M.openBlock(),M.createElementBlock("a",{key:1,href:"javascript:;",onClick:k=>O(E),class:M.normalizeClass([D.theme?"layui-laypage-a-"+D.theme:""])},M.toDisplayString(E),11,YA))],64))),128)):M.createCommentVNode("",!0),M.createElementVNode("a",{href:"javascript:;",class:M.normalizeClass(["layui-laypage-next",[y.value===i.value||i.value===0?"layui-disabled":"",D.theme&&y.value!==i.value&&i.value!==0?"layui-laypage-a-"+D.theme:""]]),onClick:A[1]||(A[1]=E=>l())},[M.unref(e).next?M.renderSlot(w.$slots,"next",{key:0}):(M.openBlock(),M.createElementBlock(M.Fragment,{key:1},[M.createTextVNode(M.toDisplayString(M.unref(z)("page.next")),1)],64))],2),D.showLimit?(M.openBlock(),M.createElementBlock("span",kA,[M.withDirectives(M.createElementVNode("select",{"onUpdate:modelValue":A[2]||(A[2]=E=>c.value=E),onChange:x},[(M.openBlock(!0),M.createElementBlock(M.Fragment,null,M.renderList(u.value,E=>(M.openBlock(),M.createElementBlock("option",{key:E,value:E},M.toDisplayString(E)+" "+M.toDisplayString(M.unref(z)("page.item"))+"/"+M.toDisplayString(M.unref(z)("page.page")),9,UA))),128))],544),[[M.vModelSelect,c.value]])])):M.createCommentVNode("",!0),D.showRefresh?(M.openBlock(),M.createElementBlock("a",{key:3,href:"javascript:;",onClick:o,class:"layui-laypage-refresh"},CA)):M.createCommentVNode("",!0),N.showSkip?(M.openBlock(),M.createElementBlock("span",dA,[M.createTextVNode(M.toDisplayString(M.unref(z)("page.goTo"))+" ",1),M.withDirectives(M.createElementVNode("input",{"onUpdate:modelValue":A[3]||(A[3]=E=>L.value=E),onKeypress:A[4]||(A[4]=M.withKeys(E=>r(),["enter"])),type:"number",class:"layui-input layui-input-number"},null,544),[[M.vModelText,L.value]]),M.createTextVNode(M.toDisplayString(M.unref(z)("page.page"))+" ",1),M.createElementVNode("button",{type:"button",class:"layui-laypage-btn",onClick:A[5]||(A[5]=E=>r()),disabled:L.value>i.value||L.value==y.value},M.toDisplayString(M.unref(z)("page.confirm")),9,SA)])):M.createCommentVNode("",!0),D.count?(M.openBlock(),M.createElementBlock("span",pA,"\u5171"+M.toDisplayString(D.count)+"\u6761",1)):M.createCommentVNode("",!0)]))}}),mA={name:"TablePage"},hA=M.defineComponent({...mA,props:{showPage:{type:Boolean,default:!0},showSkip:{type:Boolean,default:!0},showLimit:{type:Boolean,default:!0},showCount:{type:Boolean},showRefresh:{type:Boolean},current:null,limits:null,pages:null,total:null,limit:null,theme:null,count:null},emits:["update:current","update:limit","change"],setup(D,{emit:j}){const N=D,z=M.computed({get(){return N.current},set(u){j("update:current",u)}}),e=M.computed({get(){return N.limit},set(u){j("update:limit",u)}}),i=u=>{j("change",u)};return(u,T)=>(M.openBlock(),M.createBlock(ht,{total:D.total,"show-page":D.showPage,"show-skip":D.showSkip,"show-limit":D.showLimit,"show-count":D.showCount,"show-refresh":D.showRefresh,limits:D.limits,theme:D.theme,pages:D.pages,count:D.count,modelValue:M.unref(z),"onUpdate:modelValue":T[0]||(T[0]=y=>M.isRef(z)?z.value=y:null),limit:M.unref(e),"onUpdate:limit":T[1]||(T[1]=y=>M.isRef(e)?e.value=y:null),onChange:i},{prev:M.withCtx(()=>[M.createVNode(M.unref(P),{type:"layui-icon-left"})]),next:M.withCtx(()=>[M.createVNode(M.unref(P),{type:"layui-icon-right"})]),_:1},8,["total","show-page","show-skip","show-limit","show-count","show-refresh","limits","theme","pages","count","modelValue","limit"]))}});var z3=(()=>`.soulbox{background-color:#333;color:#fff;display:inline-block;position:absolute;z-index:2147483647;min-width:160px;max-width:320px;overflow-y:auto;border:1px solid #e6e6e6;border-radius:5px;box-shadow:2px 2px 4px -2px #0003} -`)();const BA=M.createElementVNode("i",{class:"soul-icon soul-icon-asc"},null,-1),bA=M.createElementVNode("i",{class:"soul-icon soul-icon-desc"},null,-1),vA=M.createElementVNode("li",{class:"soul-dropList",style:{},show:"select"},[M.createElementVNode("i",{class:"soul-icon soul-icon-drop-list",show:"select"}),M.createTextVNode(" \u7B5B\u9009\u6570\u636E "),M.createElementVNode("i",{class:"layui-icon layui-icon-right",style:{float:"right"},show:"select"})],-1),FA=M.createElementVNode("i",{class:"soul-icon soul-icon-download"},null,-1),GA={class:"soulbox",style:{left:"100%",top:"65px"}},PA={class:"check",style:{"min-width":"190px"}},WA=M.createElementVNode("i",{class:"soul-icon"},"\uE623",-1),VA=M.createElementVNode("i",{class:"soul-icon"},"\uE63E",-1),RA=M.createElementVNode("i",{class:"soul-icon"},"\uE614",-1),_A={style:{"max-height":"300px",overflow:"auto"}},ZA=M.defineComponent({__name:"soultable",props:{left:{default:10},top:{default:10},list:{default:[]},soulkey:{default:""},show:{type:Boolean,default:!1}},emits:["asc","desc","sx","daochu"],setup(D,{emit:j}){const N=D;function z(l){j("asc",l)}function e(l){j("desc",l)}function i(){j("daochu")}const u=M.ref([]),T=M.ref([]),y=M.ref([]);M.watch(()=>[N.show],()=>{let l=new Set;for(let O of N.list)l.add(O[N.soulkey]);y.value=Array.from(l),T.value=y.value,a.value=!1},{deep:!0});const L=M.ref("");M.watch(L,()=>{let l=[];if(L.value)for(let O of y.value)O.indexOf(L.value)!=-1&&l.push(O);else l=y.value;T.value=l}),M.watch(u,()=>{j("sx",{key:N.soulkey,list:u.value})});function c(l){if(l==1){u.value=[];let O=[];for(let r of T.value)O.push(r);u.value=O}else if(l==3){let O=[];for(let r of T.value)u.value.includes(r)||O.push(r);u.value=O}else l==2&&(u.value=[])}const a=M.ref(!1);function s(l){console.log(l,160),l.target.getAttribute("show")=="select"?a.value=!0:a.value=!1}return(l,O)=>(M.openBlock(),M.createElementBlock("div",{class:"soulbox",style:M.normalizeStyle(`top: ${N.top}px;left:${N.left}px`),onClick:O[5]||(O[5]=M.withModifiers(()=>{},["stop"]))},[M.createElementVNode("ul",{onMouseover:s},[M.createElementVNode("li",{onClick:z,class:"soul-sort","data-value":"asc",style:{}},[BA,M.createTextVNode(" \u5347\u5E8F\u6392\u5217 ")]),M.createElementVNode("li",{onClick:e,class:"soul-sort","data-value":"desc",style:{"border-bottom":"1px solid rgb(230, 230, 230)"}},[bA,M.createTextVNode(" \u964D\u5E8F\u6392\u5217 ")]),vA,M.createElementVNode("li",{onClick:i,class:"soul-sort","data-value":"desc",style:{"border-bottom":"1px solid rgb(230, 230, 230)"}},[FA,M.createTextVNode(" \u5BFC\u51FAexcel ")])],32),M.withDirectives(M.createElementVNode("div",GA,[M.createVNode(ND,{"prefix-icon":"layui-icon-search",modelValue:L.value,"onUpdate:modelValue":O[0]||(O[0]=r=>L.value=r),size:"sm",placeholder:"\u5173\u952E\u5B57\u641C\u7D22"},null,8,["modelValue"]),M.createElementVNode("div",PA,[M.createElementVNode("div",{class:"multiOption","data-type":"all",onClick:O[1]||(O[1]=r=>c(1))},[WA,M.createTextVNode(" \u5168\u9009 ")]),M.createElementVNode("div",{class:"multiOption","data-type":"none",onClick:O[2]||(O[2]=r=>c(2))},[VA,M.createTextVNode(" \u6E05\u7A7A ")]),M.createElementVNode("div",{class:"multiOption","data-type":"reverse",onClick:O[3]||(O[3]=r=>c(3))},[RA,M.createTextVNode("\u53CD\u9009 ")])]),M.createElementVNode("ul",_A,[M.createVNode($u,{modelValue:u.value,"onUpdate:modelValue":O[4]||(O[4]=r=>u.value=r)},{default:M.withCtx(()=>[(M.openBlock(!0),M.createElementBlock(M.Fragment,null,M.renderList(T.value,(r,x)=>(M.openBlock(),M.createElementBlock("li",null,[M.createVNode(jD,{skin:"primary",value:r},null,8,["value"]),M.createTextVNode(M.toDisplayString(r),1)]))),256))]),_:1},8,["modelValue"])])],512),[[M.vShow,a.value]])],4))}}),HA=M.createElementVNode("table",{class:"layui-hide","lay-filter":"test"},null,-1),$A={key:0,class:"layui-table-tool"},JA={class:"layui-table-tool-temp"},XA={key:0,class:"layui-table-tool-self"},KA=M.createElementVNode("div",{class:"layui-inline",title:"\u7B5B\u9009","lay-event":""},[M.createElementVNode("i",{class:"layui-icon layui-icon-slider"})],-1),qA={class:"layui-table-tool-checkbox"},M0=[M.createElementVNode("i",{class:"layui-icon layui-icon-export"},null,-1)],N0=[M.createElementVNode("i",{class:"layui-icon layui-icon-print"},null,-1)],D0={key:1,class:"layui-table-box-header"},j0={class:"layui-table-box"},z0=["lay-size","lay-skin"],e0=["width"],i0=["colspan","rowspan"],u0={key:0,class:"layui-table-sort layui-inline","lay-sort":""},t0=["onClick"],T0=["onClick"],y0={key:1,class:"layui-table-sort layui-inline soul-icon"},g0=["onClick"],L0=["lay-size","lay-skin"],a0=["width"],c0={key:0,class:"layui-table-total"},I0=["innerHTML"],s0={key:2,class:"layui-table-loading"},o0=[M.createElementVNode("i",{class:"layui-icon-loading layui-icon layui-anim layui-anim-rotate layui-anim-loop"},null,-1)],n0={key:0,class:"layui-table-footer"},O0={key:2,class:"layui-table-page"},l0={name:"LayTable"},r0=M.defineComponent({...l0,props:{id:{default:"id"},skin:null,size:{default:"md"},page:null,columns:null,dataSource:{default:()=>[]},defaultToolbar:{type:[Boolean,Array],default:!1},selectedKey:{default:""},selectedKeys:{default:()=>[]},indentSize:{default:30},childrenColumnName:{default:"children"},height:null,maxHeight:{default:"auto"},even:{type:Boolean,default:!1},expandIndex:{default:0},rowClassName:{type:[String,Function],default:""},cellClassName:{type:[String,Function],default:""},rowStyle:{type:[String,Function],default:""},cellStyle:{type:[String,Function],default:""},spanMethod:{type:Function,default:()=>{}},defaultExpandAll:{type:Boolean,default:!1},expandKeys:{default:()=>[]},loading:{type:Boolean,default:!1},getCheckboxProps:{type:Function,default:()=>{}},getRadioProps:{type:Function,default:()=>{}},download:{default:""}},emits:["change","update:expandKeys","update:selectedKeys","update:selectedKey","row-contextmenu","row-double","row","update:page"],setup(D,{emit:j}){const N=D,z=M.useSlots();z.default&&z.default();const e=M.ref(),i=M.ref([...N.dataSource]);console.log(i.value,97);const u=M.ref(!1),T=M.ref(!1),y=M.ref([...N.dataSource]),L=M.computed(()=>[...N.columns]),c=M.ref([]),a=M.ref([]),s=iM=>{let nM=0;return function IM(YM,EM){++EM,nM=Math.max(EM,nM);for(let vM=0;vM0?IM(RM.children,EM):delete RM.children}}(iM,0),nM};function l(iM){if(!iM.children||iM.children.length==0)return iM.colspan=1,1;for(var nM=0,IM=0;IM{iM.forEach(nM=>{nM.children?O(nM.children):a.value.push(nM)})};O(L.value);const r=M.ref([]),x=iM=>{iM.forEach(nM=>{nM.children?(r.value.push(nM.key),x(nM.children)):nM.hide||r.value.push(nM.key)})};x(L.value);const o=(iM,nM)=>{nM.forEach(IM=>{if(IM.children){const YM=l(IM);IM.colspan=YM,c.value[iM]||(c.value[iM]=[]),IM.fixed&&!IM.width&&(IM.type?IM.width="50px":IM.width="100px"),c.value[iM].push(IM),o(iM+1,IM.children)}else{const YM=s(nM);IM.rowspan=YM,c.value[iM]||(c.value[iM]=[]),IM.fixed&&!IM.width&&(IM.type?IM.width="50px":IM.width="100px"),c.value[iM].push(IM)}})};o(0,L.value);const w=M.ref([...N.selectedKeys]),A=M.ref([...N.expandKeys]);M.watch(()=>N.selectedKeys,()=>{w.value=N.selectedKeys},{deep:!0}),M.watch(()=>N.expandKeys,()=>{A.value=N.expandKeys},{deep:!0});const E=M.computed({get(){return N.selectedKey},set(iM){j("update:selectedKey",iM)}});M.watch(()=>N.dataSource,()=>{y.value=[...N.dataSource]},{deep:!0});const k=iM=>{if(iM){const IM=i.value.filter((YM,EM)=>{var vM;return!((vM=N.getCheckboxProps(YM,EM))!=null&&vM.disabled)}).map(YM=>YM[N.id]);w.value=[...IM]}else w.value=[]};M.watch(w,()=>{w.value.length===N.dataSource.length?u.value=!0:u.value=!1,w.value.length>0?T.value=!0:T.value=!1,w.value!=N.selectedKeys&&j("update:selectedKeys",w.value)},{deep:!0,immediate:!0}),M.watch(A,()=>{j("update:expandKeys",A.value)},{deep:!0,immediate:!0}),M.watch(y,()=>{if(!N.page)i.value=y.value;else{let iM={...N.page};iM.total=y.value.length,j("update:page",iM),C({limit:N.page.limit,current:Q||N.page.current})}}),M.watch(()=>N.page,()=>{console.log(N.page,342)});let Q;const C=function(iM){Q=iM.current,i.value=y.value.slice(iM.limit*(iM.current-1),iM.limit*iM.current)},p=function(iM,nM){j("row",iM,nM)},G=function(iM,nM){j("row-double",iM,nM)},$=(iM,nM)=>{j("row-contextmenu",iM,nM)},q=()=>{let nM=e.value.innerHTML,IM=document.body.innerHTML;document.body.innerHTML=nM,window.print(),window.location.reload(),document.body.innerHTML=IM},zM=()=>{var iM="";for(let vM of c.value){iM+="";for(let RM of vM)iM+=`${RM.title}`;iM+=""}i.value.forEach((vM,RM)=>{iM+="",a.value.forEach((VN,RN)=>{Object.keys(vM).forEach(_N=>{if(VN.key===_N){const lD=N.spanMethod(vM,VN,RM,RN),kz=lD?lD[0]:1,Uz=lD?lD[1]:1;kz!=0&&Uz!=0&&(iM+=`${vM[_N]}`)}})}),iM+=""});var nM="Sheet1",IM="data:application/vnd.ms-excel;base64,",YM=`[N.show],()=>{let l=new Set;for(let O of N.list)l.add(O[N.soulkey]);y.value=Array.from(l),T.value=y.value,a.value=!1},{deep:!0});const L=M.ref("");M.watch(L,()=>{let l=[];if(L.value)for(let O of y.value)O.indexOf(L.value)!=-1&&l.push(O);else l=y.value;T.value=l}),M.watch(u,()=>{j("sx",{key:N.soulkey,list:u.value})});function c(l){if(l==1){u.value=[];let O=[];for(let r of T.value)O.push(r);u.value=O}else if(l==3){let O=[];for(let r of T.value)u.value.includes(r)||O.push(r);u.value=O}else l==2&&(u.value=[])}const a=M.ref(!1);function s(l){console.log(l,160),l.target.getAttribute("show")=="select"?a.value=!0:a.value=!1}return(l,O)=>(M.openBlock(),M.createElementBlock("div",{class:"soulbox",style:M.normalizeStyle(`top: ${N.top}px;left:${N.left}px`),onClick:O[5]||(O[5]=M.withModifiers(()=>{},["stop"]))},[M.createElementVNode("ul",{onMouseover:s},[M.createElementVNode("li",{onClick:z,class:"soul-sort","data-value":"asc",style:{}},[BA,M.createTextVNode(" \u5347\u5E8F\u6392\u5217 ")]),M.createElementVNode("li",{onClick:e,class:"soul-sort","data-value":"desc",style:{"border-bottom":"1px solid rgb(230, 230, 230)"}},[bA,M.createTextVNode(" \u964D\u5E8F\u6392\u5217 ")]),vA,M.createElementVNode("li",{onClick:i,class:"soul-sort","data-value":"desc",style:{"border-bottom":"1px solid rgb(230, 230, 230)"}},[FA,M.createTextVNode(" \u5BFC\u51FAexcel ")])],32),M.withDirectives(M.createElementVNode("div",GA,[M.createVNode(ND,{"prefix-icon":"layui-icon-search",modelValue:L.value,"onUpdate:modelValue":O[0]||(O[0]=r=>L.value=r),size:"sm",placeholder:"\u5173\u952E\u5B57\u641C\u7D22"},null,8,["modelValue"]),M.createElementVNode("div",PA,[M.createElementVNode("div",{class:"multiOption","data-type":"all",onClick:O[1]||(O[1]=r=>c(1))},[WA,M.createTextVNode(" \u5168\u9009 ")]),M.createElementVNode("div",{class:"multiOption","data-type":"none",onClick:O[2]||(O[2]=r=>c(2))},[VA,M.createTextVNode(" \u6E05\u7A7A ")]),M.createElementVNode("div",{class:"multiOption","data-type":"reverse",onClick:O[3]||(O[3]=r=>c(3))},[RA,M.createTextVNode("\u53CD\u9009 ")])]),M.createElementVNode("ul",_A,[M.createVNode($u,{modelValue:u.value,"onUpdate:modelValue":O[4]||(O[4]=r=>u.value=r)},{default:M.withCtx(()=>[(M.openBlock(!0),M.createElementBlock(M.Fragment,null,M.renderList(T.value,(r,x)=>(M.openBlock(),M.createElementBlock("li",null,[M.createVNode(jD,{skin:"primary",value:r},null,8,["value"]),M.createTextVNode(M.toDisplayString(r),1)]))),256))]),_:1},8,["modelValue"])])],512),[[M.vShow,a.value]])],4))}}),HA=M.createElementVNode("table",{class:"layui-hide","lay-filter":"test"},null,-1),$A={key:0,class:"layui-table-tool"},JA={class:"layui-table-tool-temp"},XA={key:0,class:"layui-table-tool-self"},KA=M.createElementVNode("div",{class:"layui-inline",title:"\u7B5B\u9009","lay-event":""},[M.createElementVNode("i",{class:"layui-icon layui-icon-slider"})],-1),qA={class:"layui-table-tool-checkbox"},M0=[M.createElementVNode("i",{class:"layui-icon layui-icon-export"},null,-1)],N0=[M.createElementVNode("i",{class:"layui-icon layui-icon-print"},null,-1)],D0={key:1,class:"layui-table-box-header"},j0={class:"layui-table-box"},z0=["lay-size","lay-skin"],e0=["width"],i0=["colspan","rowspan"],u0={key:0,class:"layui-table-sort layui-inline","lay-sort":""},t0=["onClick"],T0=["onClick"],y0={key:1,class:"layui-table-sort layui-inline soul-icon"},g0=["onClick"],L0=["lay-size","lay-skin"],a0=["width"],c0={key:0,class:"layui-table-total"},I0=["innerHTML"],s0={key:2,class:"layui-table-loading"},o0=[M.createElementVNode("i",{class:"layui-icon-loading layui-icon layui-anim layui-anim-rotate layui-anim-loop"},null,-1)],n0={key:0,class:"layui-table-footer"},O0={key:2,class:"layui-table-page"},l0={name:"LayTable"},r0=M.defineComponent({...l0,props:{id:{default:"id"},skin:null,size:{default:"md"},page:null,columns:null,dataSource:{default:()=>[]},defaultToolbar:{type:[Boolean,Array],default:!1},selectedKey:{default:""},selectedKeys:{default:()=>[]},indentSize:{default:30},childrenColumnName:{default:"children"},height:null,maxHeight:{default:"auto"},even:{type:Boolean,default:!1},expandIndex:{default:0},rowClassName:{type:[String,Function],default:""},cellClassName:{type:[String,Function],default:""},rowStyle:{type:[String,Function],default:""},cellStyle:{type:[String,Function],default:""},spanMethod:{type:Function,default:()=>{}},defaultExpandAll:{type:Boolean,default:!1},expandKeys:{default:()=>[]},loading:{type:Boolean,default:!1},getCheckboxProps:{type:Function,default:()=>{}},getRadioProps:{type:Function,default:()=>{}},download:{default:""}},emits:["change","update:expandKeys","update:selectedKeys","update:selectedKey","row-contextmenu","row-double","row","update:page"],setup(D,{emit:j}){const N=D,z=M.useSlots();z.default&&z.default();const e=M.ref(),i=M.ref([...N.dataSource]);console.log(i.value,97);const u=M.ref(!1),T=M.ref(!1),y=M.ref([...N.dataSource]),L=M.computed(()=>[...N.columns]),c=M.ref([]),a=M.ref([]),s=iM=>{let nM=0;return function IM(YM,EM){++EM,nM=Math.max(EM,nM);for(let vM=0;vM0?IM(RM.children,EM):delete RM.children}}(iM,0),nM};function l(iM){if(!iM.children||iM.children.length==0)return iM.colspan=1,1;for(var nM=0,IM=0;IM{iM.forEach(nM=>{nM.children?O(nM.children):a.value.push(nM)})};O(L.value);const r=M.ref([]),x=iM=>{iM.forEach(nM=>{nM.children?(r.value.push(nM.key),x(nM.children)):nM.hide||r.value.push(nM.key)})};x(L.value);const o=(iM,nM)=>{nM.forEach(IM=>{if(IM.children){const YM=l(IM);IM.colspan=YM,c.value[iM]||(c.value[iM]=[]),IM.fixed&&!IM.width&&(IM.type?IM.width="50px":IM.width="100px"),c.value[iM].push(IM),o(iM+1,IM.children)}else{const YM=s(nM);IM.rowspan=YM,c.value[iM]||(c.value[iM]=[]),IM.fixed&&!IM.width&&(IM.type?IM.width="50px":IM.width="100px"),c.value[iM].push(IM)}})};o(0,L.value);const w=M.ref(N.selectedKeys),A=M.ref([...N.expandKeys]);M.watch(()=>N.selectedKeys,()=>{w.value=N.selectedKeys},{deep:!0}),M.watch(()=>N.expandKeys,()=>{A.value=N.expandKeys},{deep:!0});const E=M.computed({get(){return N.selectedKey},set(iM){j("update:selectedKey",iM)}});M.watch(()=>N.dataSource,()=>{y.value=[...N.dataSource]},{deep:!0});const k=iM=>{if(iM){const IM=i.value.filter((YM,EM)=>{var vM;return!((vM=N.getCheckboxProps(YM,EM))!=null&&vM.disabled)}).map(YM=>YM[N.id]);w.value=[...IM]}else w.value=[]};M.watch(w,()=>{w.value.length===N.dataSource.length?u.value=!0:u.value=!1,w.value.length>0?T.value=!0:T.value=!1,w.value!=N.selectedKeys&&(console.log("\u521D\u59CB\u5316\u8D4B\u503C\u89E6\u53D1\u4FEE\u6539",w.value,N.selectedKeys),j("update:selectedKeys",w.value))},{deep:!0,immediate:!0}),M.watch(A,()=>{j("update:expandKeys",A.value)},{deep:!0,immediate:!0}),M.watch(y,()=>{if(!N.page)i.value=y.value;else{let iM={...N.page};iM.total=y.value.length,j("update:page",iM),C({limit:N.page.limit,current:Q||N.page.current})}}),M.watch(()=>N.page,()=>{console.log(N.page,342)});let Q;const C=function(iM){Q=iM.current,i.value=y.value.slice(iM.limit*(iM.current-1),iM.limit*iM.current)},p=function(iM,nM){j("row",iM,nM)},G=function(iM,nM){j("row-double",iM,nM)},$=(iM,nM)=>{j("row-contextmenu",iM,nM)},q=()=>{let nM=e.value.innerHTML,IM=document.body.innerHTML;document.body.innerHTML=nM,window.print(),window.location.reload(),document.body.innerHTML=IM},zM=()=>{var iM="";for(let vM of c.value){iM+="";for(let RM of vM)iM+=`${RM.title}`;iM+=""}i.value.forEach((vM,RM)=>{iM+="",a.value.forEach((VN,RN)=>{Object.keys(vM).forEach(_N=>{if(VN.key===_N){const lD=N.spanMethod(vM,VN,RM,RN),kz=lD?lD[0]:1,Uz=lD?lD[1]:1;kz!=0&&Uz!=0&&(iM+=`${vM[_N]}`)}})}),iM+=""});var nM="Sheet1",IM="data:application/vnd.ms-excel;base64,",YM=`