tm-table 1.2.6 → 1.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -2
- package/dist/vue2/tm-table.css +1 -1
- package/dist/vue2/tm-table.es.js +16 -11
- package/dist/vue2/tm-table.umd.js +1 -1
- package/dist/vue3/tm-table.css +1 -1
- package/dist/vue3/tm-table.es.js +61 -56
- package/dist/vue3/tm-table.umd.js +1 -1
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(m,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue"),require("@element-plus/icons-vue"),require("sortablejs")):typeof define=="function"&&define.amd?define(["exports","vue","@element-plus/icons-vue","sortablejs"],t):(m=typeof globalThis!="undefined"?globalThis:m||self,t(m.TmTable={},m.Vue,m.ElementPlusIconsVue,m.Sortable))})(this,function(m,t,y,f){"use strict";var Gl=Object.defineProperty,Xl=Object.defineProperties;var Zl=Object.getOwnPropertyDescriptors;var P=Object.getOwnPropertySymbols;var fe=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable;var pe=(m,t,y)=>t in m?Gl(m,t,{enumerable:!0,configurable:!0,writable:!0,value:y}):m[t]=y,g=(m,t)=>{for(var y in t||(t={}))fe.call(t,y)&&pe(m,y,t[y]);if(P)for(var y of P(t))ge.call(t,y)&&pe(m,y,t[y]);return m},T=(m,t)=>Xl(m,Zl(t));var be=(m,t)=>{var y={};for(var f in m)fe.call(m,f)&&t.indexOf(f)<0&&(y[f]=m[f]);if(m!=null&&P)for(var f of P(m))t.indexOf(f)<0&&ge.call(m,f)&&(y[f]=m[f]);return y};const ne={mini:"small",small:"small",default:"default",large:"large"},B=e=>ne[e]||ne.default,S=()=>"default",ye={"zh-CN":{today:"今天",yesterday:"昨天",last7days:"最近7天",last30days:"最近30天",thisMonth:"本月",lastMonth:"上月",checkAll:"全选",search:"搜索",query:"查询",reset:"重置",columnSetting:"列设置",refresh:"刷新",cancel:"取消",fixedLeft:"固定在左侧",fixedRight:"固定在右侧",top:"置顶",restoreDefault:"恢复默认",saveAndApply:"保存并应用",startDate:"开始日期",endDate:"结束日期",all:"全选",SelectableFields:"可选择字段",fixedColumns:"固定列",leftmost:"左侧最多",rightmost:"右侧最多",items:"项",accurateSearchTips:"每行一个,支持多个值",accurateSearchPlaceholder:"精确搜索,一行一项",selectPlaceholder:"请选择",clear:"清空",saveSuccess:"保存成功",cancelRightFixed:"取消右侧固定",rightFixed:"固定到右侧",cancelLeftFixed:"取消左侧固定",leftFixed:"固定到左侧",cancelTop:"取消置顶",copySuccess:"复制成功",copyFailed:"复制失败"},"en-US":{today:"Today",yesterday:"Yesterday",last7days:"Last 7 days",last30days:"Last 30 days",thisMonth:"This month",lastMonth:"Last month",checkAll:"Check all",search:"Search",query:"Search",reset:"Reset",columnSetting:"Column Setting",refresh:"Refresh",cancel:"Cancel",fixedLeft:"Fixed left",fixedRight:"Fixed right",top:"Top",restoreDefault:"Restore default",saveAndApply:"Save and apply",startDate:"Start date",endDate:"End date",all:"All",SelectableFields:"Fields",fixedColumns:"Fixed columns",leftmost:"Leftmost",rightmost:"Rightmost",items:"item(s)",accurateSearchTips:"One per line, supporting multiple values",accurateSearchPlaceholder:"Accurate search, one per line",selectPlaceholder:"Please select",clear:"Clear",saveSuccess:"Successfully saved",cancelRightFixed:"Cancel right fixed",rightFixed:"Fixed to right",cancelLeftFixed:"Cancel left fixed",leftFixed:"Fixed to left",cancelTop:"Cancel top",copySuccess:"Copy successfully",copyFailed:"Copy failed"}};let M={value:"zh-CN"};M=t.ref("zh-CN");const Ce=e=>{var i;return((i=ye[M.value])==null?void 0:i[e])||e},H=e=>{M.value=e},x=()=>({t:Ce,setLang:H,currentLang:M}),b=(e,i)=>{const l=e.__vccOpts||e;for(const[o,n]of i)l[o]=n;return l},_e={name:"BaseIcon",props:{path:{type:String},size:{type:[String,Number]},color:{type:String}},methods:{handleClick(){}}},Se=["width","height"],xe=["d"];function Ve(e,i,l,o,n,a){return t.openBlock(),t.createElementBlock("i",{class:"tm-icon",onClick:i[0]||(i[0]=(...r)=>a.handleClick&&a.handleClick(...r))},[(t.openBlock(),t.createElementBlock("svg",{width:l.size,height:l.size,style:t.normalizeStyle({color:l.color}),viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:l.path},null,8,xe)],12,Se))])}const ke=b(_e,[["render",Ve],["__scopeId","data-v-1c30ca93"]]),V=Object.entries({menu:"M160 448a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zM160 896a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32z",more:"M76.92892277 192.94787572h864.34120754c23.20379058 0 46.40758118-17.40284367 46.40758118-46.40758118s-23.20379058-46.40758118-46.40758118-46.40758116H76.92892277c-29.00473897 0-46.40758264 17.40284367-46.40758264 46.40758116s23.20379058 46.40758118 46.40758264 46.40758118zM941.27013031 465.59241882H76.92892277c-29.00473897 0-46.40758264 17.40284367-46.40758264 46.40758118s23.20379058 46.40758118 46.40758264 46.40758118h864.34120754c23.20379058 0 46.40758118-17.40284367 46.40758118-46.40758118s-23.20379058-46.40758118-46.40758118-46.40758118zM941.27013031 825.25117589H76.92892277c-29.00473897 0-46.40758264 17.40284367-46.40758264 46.40758118s23.20379058 46.40758118 46.40758264 46.40758264h864.34120754c23.20379058 0 46.40758118-17.40284367 46.40758118-46.40758264s-23.20379058-46.40758118-46.40758118-46.40758118z",refresh:"M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z",move:"M238.93333333 102.4a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m409.6 0a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0zM238.93333333 375.46666667a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m409.6 0a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m-409.6 273.06666666a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m409.6 0a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m-341.33333333 204.8a68.26666667 68.26666667 0 1 0 0 136.53333334 68.26666667 68.26666667 0 0 0 0-136.53333334z m341.33333333 68.26666667a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z","column-setting":"M436.05333334 18.36373333a109.22666667 109.22666667 0 0 1 109.22666666 0l345.56586667 199.54346667c33.792 19.52426667 54.61333333 55.56906667 54.61333333 94.54933333V580.26666667h-81.92V312.45653333a27.30666667 27.30666667 0 0 0-13.65333333-23.62026666L504.32 89.2928a27.30666667 27.30666667 0 0 0-27.30666666 0L131.44746667 288.83626667a27.30666667 27.30666667 0 0 0-13.65333333 23.62026666v399.08693334a27.30666667 27.30666667 0 0 0 13.65333333 23.62026666L477.01333334 934.7072a27.30666667 27.30666667 0 0 0 27.30666666 0l54.61333334-31.5392v94.54933333l-13.65333334 7.91893334a109.22666667 109.22666667 0 0 1-109.22666666 0l-345.56586667-199.54346667a109.22666667 109.22666667 0 0 1-54.61333333-94.54933333V312.45653333c0-38.98026667 20.82133333-75.09333333 54.61333333-94.54933333L436.05333334 18.36373333z","fixed-left":"M843.36363653 311.54545478l-53.18181827 1e-8-20.45454521 28.63636347-163.63636435 204.54545479-24.54545391 28.63636347 12.27272695 36.81818175c8.18181826 28.63636347 12.27272695 57.27272695 12.27272696 85.90909042 0 32.72727305-4.09090869 61.36363652-16.36363565 90-4.09090869 16.36363653-12.27272695 32.72727306-24.54545479 49.09090957l-163.63636347-163.63636347-40.90909131-40.90909132-12.27272695-12.27272695-163.63636348-163.63636347c28.63636347-16.36363653 61.36363652-28.63636347 94.09090869-32.72727305 45-8.18181826 90-4.09090869 134.99999999 8.18181826l36.81818175 12.27272695 28.63636347-24.54545391 204.54545479-163.63636435 28.63636347-16.36363564 0-32.72727305L712.45454521 184.72727305l130.90909132 126.81818173zM941.54545479 327.90909131c0-8.18181826-4.09090869-16.36363653-8.18181826-24.54545478L720.63636348 94.72727305c-12.27272695-16.36363653-36.81818174-12.27272695-49.09090869 4.0909087-20.45454521 28.63636347-28.63636347 65.45454521-28.63636348 98.18181825l0 4.09090869-204.54545478 163.63636436c-110.45454521-36.81818174-233.18181826-16.36363653-327.27272784 61.36363564-8.18181826 8.18181826-12.27272695 16.36363653-12.27272694 24.54545478 0 8.18181826 4.09090869 16.36363653 8.18181825 24.5454548l196.36363653 196.36363652-212.72727305 212.72727216c-4.09090869 4.09090869-8.18181826 12.27272695-8.18181826 20.4545461s4.09090869 16.36363653 8.18181826 20.4545452c12.27272695 12.27272695 32.72727306 12.27272695 45 1e-8L352.45454522 716.54545479l196.36363652 196.36363652c12.27272695 12.27272695 36.81818174 12.27272695 49.09090957-4.09090957C651.09090869 847.45454521 675.63636347 773.81818174 675.63636346 696.09090869c0-36.81818173-4.09090869-73.63636348-16.36363651-106.36363564l163.63636436-204.54545479c36.81818173 0 73.63636348-8.18181826 106.36363564-28.63636347C937.45454519 348.36363653 941.54545478 336.09090869 941.54545479 327.90909131z","fixed-right":"M311.54545479 180.63636347v53.18181827l28.63636347 20.45454521 204.54545479 163.63636436 28.63636347 24.5454539 36.81818174-12.27272695c28.63636347-8.18181826 57.27272695-12.27272695 85.90909043-12.27272695 32.72727305 0 61.36363652 4.09090869 90 16.36363564 16.36363653 4.09090869 32.72727305 12.27272695 49.09090957 24.54545479l-163.63636347 163.63636347-40.90909132 40.90909131-12.27272695 12.27272695-163.63636347 163.63636348c-16.36363653-28.63636347-28.63636347-61.36363652-32.72727305-94.09090869-8.18181826-45-4.09090869-90 8.18181826-135l12.27272695-36.81818174-24.5454539-28.63636347-163.63636436-204.54545479-16.36363564-28.63636347h-32.72727305H184.72727305l126.81818174-130.90909132zM327.90909131 82.45454521c-8.18181826 0-16.36363653 4.09090869-24.54545478 8.18181826L94.72727305 303.36363652c-16.36363653 12.27272695-12.27272695 36.81818174 4.09090869 49.09090869 28.63636347 20.45454521 65.45454521 28.63636347 98.18181826 28.63636348h4.09090869l163.63636436 204.54545478c-36.81818174 110.45454521-16.36363653 233.18181826 61.36363564 327.27272784 8.18181826 8.18181826 16.36363653 12.27272695 24.54545478 12.27272695 8.18181826 0 16.36363653-4.09090869 24.54545479-8.18181826l196.36363653-196.36363653 212.72727216 212.72727305c4.09090869 4.09090869 12.27272695 8.18181826 20.4545461 8.18181827s16.36363653-4.09090869 20.45454521-8.18181827c12.27272695-12.27272695 12.27272695-32.72727305 0-45L716.54545479 671.54545479l196.36363652-196.36363653c12.27272695-12.27272695 12.27272695-36.81818174-4.09090957-49.09090957C847.45454521 372.90909131 773.81818174 348.36363653 696.09090869 348.36363653c-36.81818174 0-73.63636348 4.09090869-106.36363564 16.36363652l-204.54545479-163.63636436c0-36.81818174-8.18181826-73.63636348-28.63636347-106.36363564C348.36363653 86.54545479 336.09090869 82.45454521 327.90909131 82.45454521z",upload:"M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248z",download:"M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64z",delete:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32",copy:"M128 320v576h576V320zm-32-64h640a32 32 0 0 1 32 32v640a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V288a32 32 0 0 1 32-32M960 96v704a32 32 0 0 1-32 32h-96v-64h64V128H384v64h-64V96a32 32 0 0 1 32-32h576a32 32 0 0 1 32 32M256 672h320v64H256zm0-192h320v64H256z"}).reduce((e,[i,l])=>{const o=`${i}Icon`,n={name:o,props:{path:{type:String,default:l},size:{type:[String,Number]},color:{type:String}},render(a){return t.h(ke,this.$props)}};return n.install=a=>{a.component(o,n)},e[i]=n,e},{}),we=V.menu,Te=V.refresh,Fe=V.move;V["column-setting"];const ze=V.more,Le=V["fixed-left"],Be=V["fixed-right"],Ne=V.upload,Ee=V.download,Oe=V.delete,ae=V.copy,{t:W}=x(),De=!1,Ae=!0,Me={name:"TmEllipsisText",components:{CopyIcon:ae},props:{text:{type:String,required:!0},width:{type:[String,Number],default:"auto"},maxWidth:{type:[String,Number],default:"100%"},lines:{type:Number,default:1},showTooltip:{type:Boolean,default:!0},lineHeight:{type:[String,Number]},copyable:{type:Boolean,default:!1},textAlign:{type:String,default:"left"}},data(){return{isVue2:De,isVue3:Ae,isOverflow:!1,currentLines:1,resizeObserver:null}},computed:{tooltipDisabled(){return!this.showTooltip||!this.isOverflow},textStyle(){const e=typeof this.width=="number"?`${this.width}px`:this.width,i=typeof this.maxWidth=="number"?`${this.maxWidth}px`:this.maxWidth;return{width:e,maxWidth:i,lineHeight:this.lineHeight,display:"-webkit-inline-box",overflow:"hidden",WebkitBoxOrient:"vertical",WebkitLineClamp:this.lines,textAlign:this.textAlign}}},mounted(){this.checkOverflow(),this.setupResizeObserver()},beforeDestroy(){this.cleanupResizeObserver()},beforeUnmount(){this.cleanupResizeObserver()},watch:{text(){this.$nextTick(this.checkOverflow)}},methods:{checkOverflow(){this.$refs.textEl&&this.$nextTick(()=>{this.$nextTick(()=>{this.performOverflowCheck()})})},performOverflowCheck(){var u;const e=this.$refs.textEl;if(!e)return;const i=getComputedStyle(e);if(!i.width||i.width==="0px"){this.$nextTick(()=>{this.performOverflowCheck()});return}const l=e.scrollHeight,o=e.scrollWidth,n=e.clientHeight,a=e.clientWidth,r=1,d=l>n+r,h=o>a+r;if(d||h){this.isOverflow=!0;const p=parseFloat(i.lineHeight)||16;this.currentLines=Math.ceil(l/p)}else{const p=e.getBoundingClientRect(),_=(u=e.parentElement)==null?void 0:u.getBoundingClientRect();if(_){const k=p.height>_.height||p.width>_.width;this.isOverflow=k}else this.isOverflow=!1;this.currentLines=1}},setupResizeObserver(){window.ResizeObserver&&this.$nextTick(()=>{try{this.resizeObserver=new ResizeObserver(()=>{this.checkOverflow()});const e=this.$el;e&&e instanceof Element&&this.resizeObserver.observe(e)}catch(e){console.warn("Failed to setup ResizeObserver:",e)}})},cleanupResizeObserver(){if(this.resizeObserver)try{this.resizeObserver.disconnect()}catch(e){console.warn("Failed to disconnect ResizeObserver:",e)}finally{this.resizeObserver=null}},handleCopy(){navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(this.text).then(()=>{this.$message.success(W("copySuccess"))}).catch(()=>{this.fallbackCopy()}):this.fallbackCopy()},fallbackCopy(){const e=document.createElement("textarea");e.value=this.text,e.style.position="fixed",e.style.left="-999999px",e.style.top="-999999px",document.body.appendChild(e),e.focus(),e.select();try{document.execCommand("copy"),this.$message.success(W("copySuccess"))}catch(i){this.$message.error(W("copyFailed"))}document.body.removeChild(e)}}},He={class:"ellipsis-text-container"};function Re(e,i,l,o,n,a){const r=t.resolveComponent("CopyIcon"),d=t.resolveComponent("el-tooltip");return t.openBlock(),t.createBlock(d,t.mergeProps({disabled:a.tooltipDisabled,content:l.text,effect:"dark",placement:"top"},{[n.isVue2?"open-delay":"show-after"]:300}),{default:t.withCtx(()=>[t.createElementVNode("div",He,[t.createElementVNode("div",{ref:"textEl",class:"ellipsis-text",style:t.normalizeStyle(a.textStyle)},t.toDisplayString(l.text),5),t.createElementVNode("div",{class:t.normalizeClass(["toolbar",{multiline:n.currentLines>1&&l.lines>1}])},[l.copyable?(t.openBlock(),t.createBlock(r,{key:0,class:"icon-item",onClick:a.handleCopy},null,8,["onClick"])):t.createCommentVNode("",!0)],2)])]),_:1},16,["disabled","content"])}const N=b(Me,[["render",Re],["__scopeId","data-v-70ba8157"]]);var Ie=Object.defineProperty,ve=Object.defineProperties,Pe=Object.getOwnPropertyDescriptors,oe=Object.getOwnPropertySymbols,We=Object.prototype.hasOwnProperty,Ue=Object.prototype.propertyIsEnumerable,se=(e,i,l)=>i in e?Ie(e,i,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[i]=l,re=(e,i)=>{for(var l in i||(i={}))We.call(i,l)&&se(e,l,i[l]);if(oe)for(var l of oe(i))Ue.call(i,l)&&se(e,l,i[l]);return e},de=(e,i)=>ve(e,Pe(i));const je={name:"RenderVue3",inheritAttrs:!1},Je=t.defineComponent(de(re({},je),{props:{renderFn:{type:Function},data:{}},setup(e){const i=e,l=t.useAttrs(),o=t.useSlots(),n=t.computed(()=>de(re({},i.data||{}),{$attrs:l,$slots:o})),a=t.computed(()=>{try{if(!i.renderFn||typeof i.renderFn!="function")return console.warn("[RenderComponent] renderFn must be a function"),null;const r=i.renderFn.toString(),d=/\(\s*h\s*[,)]/.test(r)||i.renderFn.length>=1;let h;return d?h=i.renderFn(t.h,n.value):h=i.renderFn(n.value),h}catch(r){return console.error("[RenderComponent] Error in render function:",r),null}});return(r,d)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(a.value)))}})),Ke=!1,Qe=!0,qe={name:"FormItemLayout",components:{EllipsisText:N,RenderComponent:Je},props:{direction:{type:String,default:"horizontal",validator:e=>["horizontal","vertical"].includes(e)},labelWidth:{type:[String,Number],default:120},inputWidth:{type:[String,Number],default:240},label:{type:[String,Function,Object,Array],default:""},labelOptions:{type:Array,default:()=>[]},field:{type:[String,Number],default:""},labelAlign:{type:String,default:"right",validator:e=>["left","right","center"].includes(e)}},data(){return{t:x().t,isVue2:Ke,isVue3:Qe,getDefaultSize:S}},computed:{hasLabel(){return this.labelOptions&&this.labelOptions.length||this.label},containerStyle(){const e={};if(this.direction==="horizontal"){const i=this.hasLabel?this.parsedLabelWidth+this.parsedInputWidth:this.parsedInputWidth;e.width=`${i}px`}else e.width=`${this.parsedInputWidth}px`;return e},labelStyle(){const e={};return this.direction==="horizontal"?e.width=`${this.parsedLabelWidth}px`:e.width=`${this.parsedInputWidth}px`,e},inputStyle(){return{width:`${this.parsedInputWidth}px`}},parsedLabelWidth(){return typeof this.labelWidth=="string"?parseInt(this.labelWidth):this.labelWidth},parsedInputWidth(){return typeof this.inputWidth=="string"?parseInt(this.inputWidth):this.inputWidth},fieldValue:{get(){return this.field},set(e){this.$emit("field-change",e)}}},watch:{labelOptions:{handler(e){e&&e.length>0&&!this.field&&this.$emit("field-change",e[0].value)},deep:!0,immediate:!0}},methods:{handleFieldChange(e){this.$emit("field-change",e)}}},Ye={key:0,class:"label-text"},Ge={key:1,class:"label-render"};function Xe(e,i,l,o,n,a){const r=t.resolveComponent("el-option"),d=t.resolveComponent("el-select"),h=t.resolveComponent("EllipsisText"),u=t.resolveComponent("RenderComponent");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["form-item-layout",{"form-item-layout--horizontal":l.direction==="horizontal","form-item-layout--vertical":l.direction==="vertical"}]),style:t.normalizeStyle(a.containerStyle)},[a.hasLabel?(t.openBlock(),t.createElementBlock("div",{key:0,class:"form-item-label",style:t.normalizeStyle(a.labelStyle)},[l.labelOptions&&l.labelOptions.length?(t.openBlock(),t.createBlock(d,{key:0,modelValue:a.fieldValue,"onUpdate:modelValue":i[0]||(i[0]=p=>a.fieldValue=p),placeholder:n.t("selectPlaceholder"),size:n.getDefaultSize(),class:"label-select",onChange:a.handleFieldChange},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.labelOptions,p=>(t.openBlock(),t.createBlock(r,{key:p.value,label:p.label,value:p.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","size","onChange"])):l.label?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[typeof l.label=="string"?(t.openBlock(),t.createElementBlock("div",Ye,[t.createVNode(h,{text:l.label,lines:2,width:l.labelWidth-4,"text-align":l.labelAlign},null,8,["text","width","text-align"])])):typeof l.label=="function"?(t.openBlock(),t.createElementBlock("div",Ge,[t.createVNode(u,{"render-fn":l.label},null,8,["render-fn"])])):t.createCommentVNode("",!0)],64)):t.createCommentVNode("",!0)],4)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"form-item-input",style:t.normalizeStyle(a.inputStyle)},[t.renderSlot(e.$slots,"default",{},void 0,!0)],4)],6)}const w=b(qe,[["render",Xe],["__scopeId","data-v-57462da5"]]),Ze=!1,$e=!0,R="modelValue",et="update:modelValue",tt={name:"TmSelectFilter",components:{FormItemLayout:w},props:{[R]:{type:[String,Number,Array],default:""},field:{type:[String,Number],default:""},options:{type:[Array,Function],default:()=>[]},labelOptions:{type:Array,default:()=>[]},label:{type:[String,Function,Object,Array],default:null},props:{type:Object,default:()=>({label:"label",value:"value"})},filterable:{type:Boolean,default:!0},clearable:{type:Boolean,default:!0},collapseTags:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},showCheckAll:{type:Boolean,default:!0},placeholder:{type:String,default:""},valueOnClear:{type:[String,Number,Boolean,Array,Function],default:void 0},labelWidth:{type:[String,Number],default:void 0},inputWidth:{type:[String,Number],default:void 0},direction:{type:String,default:void 0,validator:e=>!e||["horizontal","vertical"].includes(e)},labelAlign:{type:String,default:"right",validator:e=>["left","right","center"].includes(e)}},data(){return{t:x().t,isVue2:Ze,isVue3:$e,getDefaultSize:S,optionsList:[],loading:!1,indeterminate:!1,checkAll:!1}},computed:{computedValue:{get(){return this[R]},set(e){let i=e;if(this.multiple&&Array.isArray(e)&&e.length===0&&this.valueOnClear!==void 0){const l=this[R];Array.isArray(l)&&l.length>0&&(i=typeof this.valueOnClear=="function"?this.valueOnClear():this.valueOnClear)}this.$emit(et,i),this.$emit("change",i)}},propMap(){return{label:this.props.label||"label",value:this.props.value||"value"}}},watch:{[R](e){!this.multiple||!this.showCheckAll||(e.length===0?(this.checkAll=!1,this.indeterminate=!1):e.length===this.optionsList.length?(this.checkAll=!0,this.indeterminate=!1):this.indeterminate=!0)}},created(){this.initOptions()},methods:{handleFieldChange(e){this.$emit("field-change",e)},async initOptions(){if(Array.isArray(this.options))this.optionsList=this.options;else if(typeof this.options=="function")try{this.loading=!0;const e=await this.options();Array.isArray(e)&&(this.optionsList=e)}catch(e){console.error(e)}finally{this.loading=!1}},handleCheckAll(e){this.indeterminate=!1;let i=[];e&&(i=this.optionsList.map(l=>l[this.propMap.value])),this.computedValue=i},handleClear(){if(this.valueOnClear!==void 0){const e=typeof this.valueOnClear=="function"?this.valueOnClear():this.valueOnClear;this.$nextTick(()=>{this.computedValue=e})}}}},lt={key:0,class:"check-all-option"};function it(e,i,l,o,n,a){const r=t.resolveComponent("el-checkbox"),d=t.resolveComponent("el-option"),h=t.resolveComponent("el-select"),u=t.resolveComponent("FormItemLayout");return t.openBlock(),t.createBlock(u,{label:l.label,"label-options":l.labelOptions,field:l.field,onFieldChange:a.handleFieldChange,"label-width":l.labelWidth,"input-width":l.inputWidth,direction:l.direction,"label-align":l.labelAlign},{default:t.withCtx(()=>[t.createVNode(h,t.mergeProps({ref:"select",class:"select",onClear:a.handleClear,modelValue:a.computedValue,"onUpdate:modelValue":i[2]||(i[2]=p=>a.computedValue=p)},T(g({},e.$attrs),{size:n.getDefaultSize(),filterable:l.filterable,clearable:l.clearable,collapseTags:l.collapseTags,multiple:l.multiple,placeholder:l.placeholder,loading:n.loading}),t.toHandlers(n.isVue2?e.$listeners:{}),{loading:n.loading}),{header:t.withCtx(()=>[n.isVue3&&l.multiple&&l.showCheckAll?(t.openBlock(),t.createBlock(r,{key:0,modelValue:n.checkAll,"onUpdate:modelValue":i[1]||(i[1]=p=>n.checkAll=p),indeterminate:n.indeterminate,size:n.getDefaultSize(),onChange:a.handleCheckAll,style:{width:"100%",height:"20px","padding-left":"10px"}},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.t("all")),1)]),_:1},8,["modelValue","indeterminate","size","onChange"])):t.createCommentVNode("",!0)]),default:t.withCtx(()=>[n.isVue2&&l.multiple&&l.showCheckAll?(t.openBlock(),t.createElementBlock("div",lt,[t.createVNode(r,{style:{width:"100%"},modelValue:n.checkAll,"onUpdate:modelValue":i[0]||(i[0]=p=>n.checkAll=p),indeterminate:n.indeterminate,size:n.getDefaultSize(),onChange:a.handleCheckAll},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.t("all")),1)]),_:1},8,["modelValue","indeterminate","size","onChange"])])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.optionsList,p=>(t.openBlock(),t.createBlock(d,{key:p[a.propMap.value],label:p[a.propMap.label],value:p[a.propMap.value],disabled:p.disabled},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"option",{item:p},()=>[t.createTextVNode(t.toDisplayString(p[a.propMap.label]),1)],!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:3},16,["onClear","modelValue","loading"])]),_:3},8,["label","label-options","field","onFieldChange","label-width","input-width","direction","label-align"])}const U=b(tt,[["render",it],["__scopeId","data-v-ef8f7987"]]),nt={name:"TmInputFilter",components:{MoreIcon:ze,FormItemLayout:w},props:{label:{type:[String,Function,Object,Array],default:""},value:{type:String,default:""},field:{type:[String,Number],default:""},placeholder:{type:String,default:""},multiple:{type:Boolean,default:!1},labelOptions:{type:Array,default:()=>[]},labelWidth:{type:[String,Number],default:void 0},inputWidth:{type:[String,Number],default:void 0},direction:{type:String,default:void 0,validator:e=>!e||["horizontal","vertical"].includes(e)},labelAlign:{type:String,default:"right",validator:e=>["left","right","center"].includes(e)}},data(){return{t:x().t,getDefaultSize:S,getCompatSize:B,exactValue:"",inputValue:"",isExactMode:!1,currentOptionMultiple:!1}},computed:{shouldShowMultiple(){return this.currentOptionMultiple!==null?this.currentOptionMultiple:this.multiple},selectedOption(){return!this.labelOptions||!this.labelOptions.length||!this.field?null:this.labelOptions.find(e=>e.value===this.field)}},watch:{isExactMode(e){e?this.$emit("value-change",this.exactValue):this.$emit("value-change",this.inputValue)},exactValue(e){this.$emit("value-change",e)},inputValue(e){this.$emit("value-change",e)},value:{handler(e){this.isExactMode?this.exactValue=e:this.inputValue=e},immediate:!0}},methods:{handlePopoverClose(){document.activeElement&&document.activeElement.blur(),this.isExactMode=!1},handleVisibleChange(e){this.isExactMode=e},handlefieldChange(e){this.$emit("field-change",e),this.updateCurrentOptionMultiple()},updateCurrentOptionMultiple(){const e=this.selectedOption;e&&"multiple"in e?this.currentOptionMultiple=e.multiple:this.currentOptionMultiple=this.multiple},handleExactSearch(){this.$emit("value-change",this.exactValue),this.$emit("search",this.exactValue)},handleClear(){this.exactValue="",this.$emit("value-change","")},handleEnter(){this.$emit("search")}},created(){this.updateCurrentOptionMultiple()}},at={class:"popover-content"},ot={class:"popover-subtitle"},st={class:"popover-footer"};function rt(e,i,l,o,n,a){const r=t.resolveComponent("el-input"),d=t.resolveComponent("el-button"),h=t.resolveComponent("MoreIcon"),u=t.resolveComponent("el-popover"),p=t.resolveComponent("FormItemLayout");return t.openBlock(),t.createBlock(p,{label:l.label,"label-options":l.labelOptions,field:l.field,onFieldChange:a.handlefieldChange,"label-width":l.labelWidth,"input-width":l.inputWidth,direction:l.direction,"label-align":l.labelAlign},{default:t.withCtx(()=>[t.createVNode(r,{modelValue:n.inputValue,"onUpdate:modelValue":i[1]||(i[1]=_=>n.inputValue=_),size:n.getDefaultSize(),placeholder:l.placeholder,onKeyup:t.withKeys(a.handleEnter,["enter","native"]),clearable:"",class:"tm-input"},t.createSlots({_:2},[a.shouldShowMultiple?{name:"append",fn:t.withCtx(()=>[t.createVNode(u,{visible:n.isExactMode,placement:"bottom-end",width:260,trigger:"click","onUpdate:visible":a.handleVisibleChange},{reference:t.withCtx(()=>[t.createVNode(h,{style:{cursor:"pointer"}})]),default:t.withCtx(()=>[t.createElementVNode("div",at,[t.createElementVNode("p",ot,t.toDisplayString(n.t("accurateSearchTips")),1),t.createVNode(r,{size:n.getDefaultSize(),type:"textarea",rows:8,modelValue:n.exactValue,"onUpdate:modelValue":i[0]||(i[0]=_=>n.exactValue=_),placeholder:n.t("accurateSearchPlaceholder"),style:{"font-size":"12px"}},null,8,["size","modelValue","placeholder"]),t.createElementVNode("div",st,[t.createVNode(d,{style:{float:"left"},size:n.getCompatSize("mini"),onClick:a.handleClear},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.t("clear")),1)]),_:1},8,["size","onClick"]),t.createVNode(d,{size:n.getCompatSize("mini"),onClick:a.handlePopoverClose},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.t("cancel")),1)]),_:1},8,["size","onClick"]),t.createVNode(d,{type:"primary",size:n.getCompatSize("mini"),onClick:a.handleExactSearch},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.t("search")),1)]),_:1},8,["size","onClick"])])])]),_:1},8,["visible","onUpdate:visible"])]),key:"0"}:void 0]),1032,["modelValue","size","placeholder","onKeyup"])]),_:1},8,["label","label-options","field","onFieldChange","label-width","input-width","direction","label-align"])}const j=b(nt,[["render",rt],["__scopeId","data-v-90ce9bc0"]]),{t:C}=x(),dt=!1,ct=!0,ht="modelValue",ut={name:"TmDateFilter",components:{FormItemLayout:w},props:{value:{type:[Array,String,Date],default:()=>null},field:{type:[String,Number],default:""},start:{type:[String,Number],default:""},end:{type:[String,Number],default:""},size:{type:String,default:"mini"},labelOptions:{type:Array,default:()=>[]},label:{type:[String,Function,Object,Array],default:""},type:{type:String,default:"daterange",validator:e=>["date","daterange","datetime","datetimerange","year","month","dates","months","years","week","monthrange"].includes(e)},format:{type:String,default:""},startPlaceholder:{type:String,default:void 0},endPlaceholder:{type:String,default:void 0},placeholder:{type:String,default:void 0},rangeSeparator:{type:String,default:"-"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},readonly:{type:Boolean,default:!1},editable:{type:Boolean,default:!0},align:{type:String,default:"left"},popperClass:{type:String,default:""},defaultValue:{type:[Date,Array],default:null},defaultTime:{type:[Date,String,Array],default:null},shortcuts:{type:Array,default:()=>[]},pastOnly:{type:Boolean,default:!1},labelWidth:{type:[String,Number],default:void 0},inputWidth:{type:[String,Number],default:void 0},direction:{type:String,default:void 0,validator:e=>!e||["horizontal","vertical"].includes(e)},labelAlign:{type:String,default:"right",validator:e=>["left","right","center"].includes(e)}},computed:{isRangeType(){return["daterange","datetimerange","monthrange"].includes(this.type)},computedStartPlaceholder(){if(this.isRangeType)return this.startPlaceholder!==void 0?this.startPlaceholder:C("startDate")},computedEndPlaceholder(){if(this.isRangeType)return this.endPlaceholder!==void 0?this.endPlaceholder:C("endDate")},computedFormat(){const e="YYYY";return this.format?this.format:this.type==="year"?e:this.type==="month"?`${e}-MM`:this.type==="date"?`${e}-MM-DD`:this.type==="dates"?`${e}-MM-DD`:this.type==="months"?`${e}-MM`:this.type==="years"?e:this.type==="week"?`${e}-MM-WW`:this.type==="datetime"?`${e}-MM-DD HH:mm:ss`:this.type==="datetimerange"?`${e}-MM-DD HH:mm:ss`:this.type==="daterange"?`${e}-MM-DD`:this.type==="monthrange"?`${e}-MM`:""},computedPickerOptions(){const e={};if(this.pastOnly&&(e.disabledDate=i=>i.getTime()>Date.now()),["daterange","datetimerange"].includes(this.type)){const i=this.type==="datetimerange";e.shortcuts=this.shortcuts.length>0?this.shortcuts:[{text:C("today"),onClick(l){const o=new Date,n=new Date;i&&(n.setHours(0,0,0,0),o.setHours(23,59,59,999)),l.$emit("pick",[n,o])}},{text:C("yesterday"),onClick(l){const o=new Date,n=new Date;n.setTime(n.getTime()-3600*1e3*24),o.setTime(o.getTime()-3600*1e3*24),i&&(n.setHours(0,0,0,0),o.setHours(23,59,59,999)),l.$emit("pick",[n,o])}},{text:C("last7days"),onClick(l){const o=new Date,n=new Date;n.setTime(n.getTime()-3600*1e3*24*7),i&&(n.setHours(0,0,0,0),o.setHours(23,59,59,999)),l.$emit("pick",[n,o])}},{text:C("last30days"),onClick(l){const o=new Date,n=new Date;n.setTime(n.getTime()-3600*1e3*24*30),i&&(n.setHours(0,0,0,0),o.setHours(23,59,59,999)),l.$emit("pick",[n,o])}},{text:C("thisMonth"),onClick(l){const o=new Date,n=new Date;n.setDate(1),i&&(n.setHours(0,0,0,0),o.setHours(23,59,59,999)),l.$emit("pick",[n,o])}},{text:C("lastMonth"),onClick(l){const o=new Date,n=new Date;n.setMonth(n.getMonth()-1),n.setDate(1),o.setDate(0),i&&(n.setHours(0,0,0,0),o.setHours(23,59,59,999)),l.$emit("pick",[n,o])}}]}return e},computedShortcuts(){if(!["daterange","datetimerange"].includes(this.type))return[];if(this.shortcuts&&this.shortcuts.length>0)return this.shortcuts;const e=this.type==="datetimerange";return[{text:C("today"),value:()=>{const i=new Date,l=new Date;return e&&(l.setHours(0,0,0,0),i.setHours(23,59,59,999)),[l,i]}},{text:C("yesterday"),value:()=>{const i=new Date,l=new Date;return l.setTime(l.getTime()-3600*1e3*24),i.setTime(i.getTime()-3600*1e3*24),e&&(l.setHours(0,0,0,0),i.setHours(23,59,59,999)),[l,i]}},{text:C("last7days"),value:()=>{const i=new Date,l=new Date;return l.setTime(l.getTime()-3600*1e3*24*7),e&&(l.setHours(0,0,0,0),i.setHours(23,59,59,999)),[l,i]}},{text:C("last30days"),value:()=>{const i=new Date,l=new Date;return l.setTime(l.getTime()-3600*1e3*24*30),e&&(l.setHours(0,0,0,0),i.setHours(23,59,59,999)),[l,i]}},{text:C("thisMonth"),value:()=>{const i=new Date,l=new Date;return l.setDate(1),e&&(l.setHours(0,0,0,0),i.setHours(23,59,59,999)),[l,i]}},{text:C("lastMonth"),value:()=>{const i=new Date,l=new Date;return l.setMonth(l.getMonth()-1),l.setDate(1),i.setDate(0),e&&(l.setHours(0,0,0,0),i.setHours(23,59,59,999)),[l,i]}}]},computedDisabledDate(){return this.pastOnly?e=>e.getTime()>Date.now():null},computedDefaultTime(){let e=this.defaultTime;if(this.type==="datetimerange"&&!this.defaultTime&&(e=["00:00:00","23:59:59"]),this.isVue2)return e;if(e){if(this.type==="datetimerange"&&Array.isArray(e))return e.map(i=>{if(typeof i=="string"){const l=new Date,[o,n,a]=i.split(":").map(Number);return new Date(l.getFullYear(),l.getMonth(),l.getDate(),o,n,a||0)}return i});if(this.type==="datetime"&&typeof e=="string"){const i=new Date,[l,o,n]=e.split(":").map(Number);return new Date(i.getFullYear(),i.getMonth(),i.getDate(),l,o,n||0)}return e}},dateValue(){return this.isRangeType?this.start||this.end?[this.start,this.end]:this.value:this.value}},data(){return{t:C,isVue2:dt,isVue3:ct,getDefaultSize:S,valueField:ht}},methods:{handleFieldChange(e){this.$emit("field-change",e)},handleDateChange(e){this.isRangeType?(this.$emit("value-change",e),e&&Array.isArray(e)&&e.length===2?(this.$emit("start-change",e),this.$emit("end-change",e)):(this.$emit("start-change",[]),this.$emit("end-change",[]))):this.$emit("value-change",e)},handleBlur(e){this.$emit("blur",e)},handleFocus(e){this.$emit("focus",e)}}};function mt(e,i,l,o,n,a){const r=t.resolveComponent("el-date-picker"),d=t.resolveComponent("FormItemLayout");return t.openBlock(),t.createBlock(d,{label:l.label,"label-options":l.labelOptions,field:l.field,onFieldChange:a.handleFieldChange,"label-width":l.labelWidth,"input-width":l.inputWidth,direction:l.direction,"label-align":l.labelAlign},{default:t.withCtx(()=>[t.createVNode(r,{"model-value":a.dateValue,type:l.type,size:n.getDefaultSize(),"range-separator":l.rangeSeparator,"start-placeholder":a.computedStartPlaceholder,"end-placeholder":a.computedEndPlaceholder,placeholder:l.placeholder,shortcuts:a.computedShortcuts,"disabled-date":a.computedDisabledDate,class:"date-picker",format:a.computedFormat,"value-format":a.computedFormat,disabled:l.disabled,clearable:l.clearable,readonly:l.readonly,editable:l.editable,teleported:!1,"popper-class":l.popperClass,"default-value":l.defaultValue,"default-time":a.computedDefaultTime,"onUpdate:modelValue":a.handleDateChange,onChange:a.handleDateChange,onBlur:a.handleBlur,onFocus:a.handleFocus},null,8,["model-value","type","size","range-separator","start-placeholder","end-placeholder","placeholder","shortcuts","disabled-date","format","value-format","disabled","clearable","readonly","editable","popper-class","default-value","default-time","onUpdate:modelValue","onChange","onBlur","onFocus"])]),_:1},8,["label","label-options","field","onFieldChange","label-width","input-width","direction","label-align"])}const J=b(ut,[["render",mt],["__scopeId","data-v-cd8a2978"]]),pt=!1,ft={name:"TmCascaderFilter",components:{FormItemLayout:w},props:{value:{type:[String,Number,Array],default:""},options:{type:[Array,Function],default:()=>[]},label:{type:[String,Function,Object,Array],default:null},props:{type:Object,default:()=>({label:"label",value:"value",children:"children",expandTrigger:"hover"})},filterable:{type:Boolean,default:!0},clearable:{type:Boolean,default:!0},collapseTags:{type:Boolean,default:!0},collapseTagsTooltip:{type:Boolean,default:!0},placeholder:{type:String,default:""},labelWidth:{type:[String,Number],default:void 0},inputWidth:{type:[String,Number],default:void 0},direction:{type:String,default:void 0,validator:e=>!e||["horizontal","vertical"].includes(e)},labelAlign:{type:String,default:"right",validator:e=>["left","right","center"].includes(e)}},data(){return{isVue2:pt,getDefaultSize:S,selectedValue:this.value,optionsList:[],loading:!1}},computed:{propMap(){return{label:this.props.label||"label",value:this.props.value||"value",children:this.props.children||"children"}},cascaderProps(){return T(g({},this.props),{expandTrigger:this.props.expandTrigger||"hover"})}},watch:{value:{immediate:!0,handler(e){this.selectedValue=e}},options:{immediate:!0,handler(e){this.initOptions(e)}},selectedValue(e){this.$emit("input",e),this.$emit("change",e)}},methods:{async initOptions(e){if(typeof e=="function")try{this.loading=!0;const i=await e();Array.isArray(i)&&(this.optionsList=i)}catch(i){console.error(i)}finally{this.loading=!1}else Array.isArray(e)&&(this.optionsList=e)}}},gt={class:"cascader"};function bt(e,i,l,o,n,a){const r=t.resolveComponent("el-cascader"),d=t.resolveComponent("FormItemLayout");return t.openBlock(),t.createBlock(d,{label:l.label,"label-width":l.labelWidth,"input-width":l.inputWidth,direction:l.direction,"label-align":l.labelAlign},{default:t.withCtx(()=>[t.createElementVNode("div",gt,[t.createVNode(r,t.mergeProps({ref:"cascader",modelValue:n.selectedValue,"onUpdate:modelValue":i[0]||(i[0]=h=>n.selectedValue=h)},T(g({},e.$attrs),{size:n.getDefaultSize(),filterable:l.filterable,clearable:l.clearable,collapseTags:l.collapseTags,collapseTagsTooltip:l.collapseTagsTooltip,props:a.cascaderProps,placeholder:l.placeholder,options:n.optionsList,loading:n.loading}),t.toHandlers(n.isVue2?e.$listeners:{})),{default:t.withCtx(({node:h,data:u})=>[t.renderSlot(e.$slots,"default",{node:h,data:u},()=>[t.createElementVNode("span",null,t.toDisplayString(u[a.propMap.label]),1)],!0)]),_:3},16,["modelValue"])])]),_:3},8,["label","label-width","input-width","direction","label-align"])}const K=b(ft,[["render",bt],["__scopeId","data-v-7c915d17"]]),yt=!1,Ct=!0,_t={name:"TmRadioFilter",components:{FormItemLayout:w},props:{value:{type:[String,Number],default:""},options:{type:[Array,Function],default:()=>[]},props:{type:Object,default:()=>({label:"label",value:"value"})},size:{type:String,default:"mini"},width:{type:[String,Number],default:200},label:{type:[String,Function,Object,Array],default:null},labelWidth:{type:[String,Number],default:void 0},inputWidth:{type:[String,Number],default:void 0},direction:{type:String,default:void 0,validator:e=>!e||["horizontal","vertical"].includes(e)},labelAlign:{type:String,default:"right",validator:e=>["left","right","center"].includes(e)}},data(){return{isVue2:yt,isVue3:Ct,getDefaultSize:S,selectedValue:this.value,optionsList:[],loading:!1}},computed:{propMap(){return{label:this.props.label||"label",value:this.props.value||"value"}}},watch:{value:{immediate:!0,handler(e){this.selectedValue=e}},options:{immediate:!0,handler(e){this.$slots.default||this.initOptions(e)}},selectedValue(e){this.$emit("input",e),this.$emit("change",e)}},methods:{async initOptions(e){if(typeof e=="function")try{this.loading=!0;const i=await e();Array.isArray(i)&&(this.optionsList=i)}catch(i){console.error(i)}finally{this.loading=!1}else Array.isArray(e)&&(this.optionsList=e)}}};function St(e,i,l,o,n,a){const r=t.resolveComponent("el-radio-button"),d=t.resolveComponent("el-radio-group"),h=t.resolveComponent("FormItemLayout");return t.openBlock(),t.createBlock(h,{label:l.label,"label-width":l.labelWidth,"input-width":l.inputWidth,direction:l.direction,"label-align":l.labelAlign},{default:t.withCtx(()=>[t.createVNode(d,t.mergeProps({ref:"radioGroup",modelValue:n.selectedValue,"onUpdate:modelValue":i[0]||(i[0]=u=>n.selectedValue=u)},T(g({},e.$attrs),{size:n.getDefaultSize()}),{class:"radio-group"},t.toHandlers(n.isVue2?e.$listeners:{})),{default:t.withCtx(()=>[e.$slots.default?t.renderSlot(e.$slots,"default",{key:0},void 0,!0):(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(n.optionsList,u=>(t.openBlock(),t.createBlock(r,t.mergeProps({ref_for:!0},{[n.isVue3?"value":"label"]:u[a.propMap.value],disabled:u.disabled},{style:{flex:"1"},key:u[a.propMap.value]}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"option",{item:u},()=>[t.createTextVNode(t.toDisplayString(u[a.propMap.label]),1)],!0)]),_:2},1040))),128))]),_:3},16,["modelValue"])]),_:3},8,["label","label-width","input-width","direction","label-align"])}const Q=b(_t,[["render",St],["__scopeId","data-v-210a44fd"]]),xt=!1,Vt=!0,kt={name:"TmCheckboxFilter",components:{FormItemLayout:w},props:{value:{type:Array,default:()=>[]},options:{type:[Array,Function],default:()=>[]},props:{type:Object,default:()=>({label:"label",value:"value"})},size:{type:String,default:"mini"},label:{type:[String,Function,Object,Array],default:null},labelWidth:{type:[String,Number],default:void 0},inputWidth:{type:[String,Number],default:void 0},direction:{type:String,default:void 0,validator:e=>!e||["horizontal","vertical"].includes(e)},labelAlign:{type:String,default:"right",validator:e=>["left","right","center"].includes(e)}},data(){return{isVue2:xt,isVue3:Vt,getDefaultSize:S,selectedValue:this.value||[],optionsList:[],loading:!1}},computed:{propMap(){return{label:this.props.label||"label",value:this.props.value||"value"}}},watch:{value:{immediate:!0,handler(e){this.selectedValue=e||[]}},options:{immediate:!0,handler(e){this.$slots.default||this.initOptions(e)}},selectedValue(e){this.$emit("input",e),this.$emit("change",e)}},methods:{async initOptions(e){if(typeof e=="function")try{this.loading=!0;const i=await e();Array.isArray(i)&&(this.optionsList=i)}catch(i){console.error(i)}finally{this.loading=!1}else Array.isArray(e)&&(this.optionsList=e)}}},wt={class:"checkbox-content"};function Tt(e,i,l,o,n,a){const r=t.resolveComponent("el-checkbox-button"),d=t.resolveComponent("el-checkbox-group"),h=t.resolveComponent("FormItemLayout");return t.openBlock(),t.createBlock(h,{label:l.label,"label-width":l.labelWidth,"input-width":l.inputWidth,direction:l.direction,"label-align":l.labelAlign},{default:t.withCtx(()=>[t.createElementVNode("div",wt,[t.createVNode(d,t.mergeProps({ref:"checkboxGroup",modelValue:n.selectedValue,"onUpdate:modelValue":i[0]||(i[0]=u=>n.selectedValue=u)},T(g({},e.$attrs),{size:n.getDefaultSize()}),t.toHandlers(n.isVue2?e.$listeners:{})),{default:t.withCtx(()=>[e.$slots.default?t.renderSlot(e.$slots,"default",{key:0},void 0,!0):(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(n.optionsList,u=>(t.openBlock(),t.createBlock(r,t.mergeProps({key:u[a.propMap.value]},{ref_for:!0},{[n.isVue3?"value":"label"]:u[a.propMap.value],disabled:u.disabled},{style:{flex:"1"}}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"option",{item:u},()=>[t.createTextVNode(t.toDisplayString(u[a.propMap.label]),1)],!0)]),_:2},1040))),128))]),_:3},16,["modelValue"])])]),_:3},8,["label","label-width","input-width","direction","label-align"])}const q=b(kt,[["render",Tt],["__scopeId","data-v-39ef0641"]]),Ft=!1,zt={name:"TmSwitchFilter",components:{FormItemLayout:w},props:{value:{type:Boolean,default:!1},label:{type:[String,Function,Object,Array],default:""},labelWidth:{type:[String,Number],default:void 0},inputWidth:{type:[String,Number],default:void 0},direction:{type:String,default:void 0,validator:e=>!e||["horizontal","vertical"].includes(e)},labelAlign:{type:String,default:"right",validator:e=>["left","right","center"].includes(e)}},data(){return{isVue2:Ft,getDefaultSize:S,switchValue:this.value}},watch:{value:{immediate:!0,handler(e){this.switchValue=e}},switchValue(e){this.$emit("input",e),this.$emit("change",e)}}},Lt={class:"switch-content"};function Bt(e,i,l,o,n,a){const r=t.resolveComponent("el-switch"),d=t.resolveComponent("FormItemLayout");return t.openBlock(),t.createBlock(d,{label:l.label,"label-width":l.labelWidth,"input-width":l.inputWidth,direction:l.direction,"label-align":l.labelAlign},{default:t.withCtx(()=>[t.createElementVNode("div",Lt,[t.createVNode(r,t.mergeProps({ref:"switch",modelValue:n.switchValue,"onUpdate:modelValue":i[0]||(i[0]=h=>n.switchValue=h)},e.$attrs,t.toHandlers(n.isVue2?e.$listeners:{}),{size:n.getDefaultSize()}),null,16,["modelValue","size"])])]),_:1},8,["label","label-width","input-width","direction","label-align"])}const Y=b(zt,[["render",Bt],["__scopeId","data-v-7455db21"]]),Nt=!1,Et=!0,ce="modelValue",G="update:modelValue",Ot={name:"TmTextareaFilter",components:{FormItemLayout:w,CircleClose:y.CircleClose},props:{label:{type:[String,Function,Object,Array],default:""},[ce]:{type:String,default:""},field:{type:[String,Number],default:""},placeholder:{type:String,default:""},labelOptions:{type:Array,default:()=>[]},autosize:{type:[Boolean,Object],default:()=>({minRows:1,maxRows:10})},maxlength:{type:[String,Number],default:""},minlength:{type:[String,Number],default:""},showWordLimit:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},resize:{type:String,default:"vertical",validator:e=>["none","both","horizontal","vertical"].includes(e)},tabindex:{type:[String,Number],default:""},validateEvent:{type:Boolean,default:!0},clearable:{type:Boolean,default:!0},labelWidth:{type:[String,Number],default:void 0},inputWidth:{type:[String,Number],default:void 0},direction:{type:String,default:void 0,validator:e=>!e||["horizontal","vertical"].includes(e)},labelAlign:{type:String,default:"right",validator:e=>["left","right","center"].includes(e)}},data(){return{isVue2:Nt,isVue3:Et,getDefaultSize:S,inputValue:this.value}},computed:{selectedOption(){return!this.labelOptions||!this.labelOptions.length||!this.field?null:this.labelOptions.find(e=>e.value===this.field)}},watch:{[ce]:{immediate:!0,handler(e){this.inputValue=e}},inputValue(e){this.$emit(G,e)}},methods:{handleInput(e){this.inputValue=e,this.$emit(G,e)},handleChange(e){this.$emit("change",e)},handleFocus(e){this.$emit("focus",e)},handleBlur(e){this.$emit("blur",e)},handleClear(){this.inputValue="",this.$emit(G,""),this.$emit("clear")},handleFieldChange(e){this.$emit("field-change",e)},focus(){this.$refs.textarea.focus()},blur(){this.$refs.textarea.blur()},select(){this.$refs.textarea.select()}}},Dt={class:"textarea"};function At(e,i,l,o,n,a){const r=t.resolveComponent("el-input"),d=t.resolveComponent("CircleClose"),h=t.resolveComponent("el-icon"),u=t.resolveComponent("FormItemLayout");return t.openBlock(),t.createBlock(u,{label:l.label,"label-options":l.labelOptions,field:l.field,onFieldChange:a.handleFieldChange,"label-width":l.labelWidth,"input-width":l.inputWidth,direction:l.direction,"label-align":l.labelAlign},{default:t.withCtx(()=>[t.createElementVNode("div",Dt,[t.createVNode(r,t.mergeProps({ref:"textarea",modelValue:n.inputValue,"onUpdate:modelValue":i[0]||(i[0]=p=>n.inputValue=p),size:n.getDefaultSize(),placeholder:l.placeholder,type:"textarea",autosize:l.autosize,maxlength:l.maxlength,minlength:l.minlength,"show-word-limit":l.showWordLimit,readonly:l.readonly,disabled:l.disabled,resize:l.resize,tabindex:l.tabindex,"validate-event":l.validateEvent},e.$attrs,t.toHandlers(n.isVue2?e.$listeners:{}),{onInput:a.handleInput,onChange:a.handleChange,onFocus:a.handleFocus,onBlur:a.handleBlur,onClear:a.handleClear,class:"textarea-input"}),null,16,["modelValue","size","placeholder","autosize","maxlength","minlength","show-word-limit","readonly","disabled","resize","tabindex","validate-event","onInput","onChange","onFocus","onBlur","onClear"]),l.clearable&&n.inputValue?(t.openBlock(),t.createBlock(h,{key:0,class:"textarea-clear-icon",onClick:a.handleClear},{default:t.withCtx(()=>[t.createVNode(d)]),_:1},8,["onClick"])):t.createCommentVNode("",!0)])]),_:1},8,["label","label-options","field","onFieldChange","label-width","input-width","direction","label-align"])}const X=b(Ot,[["render",At],["__scopeId","data-v-9b0ae8e6"]]),Mt={name:"DynamicSlot",props:{name:{type:String,required:!0},slotProps:{type:Object,default:()=>({})}},render(e){var n;const i=a=>{var r;return a?(r=a.$slots)==null?void 0:r[this.name]:null},l=a=>{var r,d,h,u;return a?((d=(r=a.$)==null?void 0:r.type)==null?void 0:d.name)==="TmTable"||((u=(h=a.$)==null?void 0:h.type)==null?void 0:u.__name)==="TmTable":!1};let o=i(this.$parent);if(!o){let a=(n=this.$parent)==null?void 0:n.$parent;for(;a&&!o;){if(l(a)){o=i(a);break}a=a.$parent}}return o?typeof o=="function"?o(this.slotProps):o:null}},{t:Ht}=x(),Rt=!1,It=!0,vt=["date","daterange","datetime","datetimerange","year","month","dates","months","years","week","monthrange"],Pt={name:"TmTableSearch",components:{TmSelect:U,TmInput:j,TmDate:J,TmCascader:K,TmRadio:Q,TmCheckbox:q,TmSwitch:Y,TmTextarea:X,DynamicSlot:Mt},props:{disabled:{type:Boolean,default:!1},searchColumns:{type:Array,default:null},searchForm:{type:Object,default:()=>({})},labelWidth:{type:[String,Number],default:void 0},inputWidth:{type:[String,Number],default:void 0},direction:{type:String,default:void 0,validator:e=>!e||["horizontal","vertical"].includes(e)},labelAlign:{type:String,default:"right",validator:e=>["left","right","center"].includes(e)}},data(){return{t:Ht,isVue2:Rt,isVue3:It,getCompatSize:B,getDefaultSize:S,DATE_TYPES:vt,defaultValues:{}}},computed:{computedSearchForm:{get(){return this.searchForm},set(e){this.$emit("update:search-form",e)}},getLayoutProps(){return e=>{const i={};return e.labelWidth!==void 0?i.labelWidth=e.labelWidth:this.labelWidth!==void 0&&(i.labelWidth=this.labelWidth),e.inputWidth!==void 0?i.inputWidth=e.inputWidth:this.inputWidth!==void 0&&(i.inputWidth=this.inputWidth),e.direction!==void 0?i.direction=e.direction:this.direction!==void 0&&(i.direction=this.direction),e.labelAlign!==void 0?i.labelAlign=e.labelAlign:this.labelAlign!==void 0&&(i.labelAlign=this.labelAlign),i}}},mounted(){this.initDefaultValues()},methods:{isDateType(e){return this.DATE_TYPES.includes(e)},hasDefaultSlot(){const e=this.$slots.default;return e?this.isVue2?!!e:e()[0].children.length>0:!1},handleUpdate(e,i,l){const o=this.getFieldValue(e,l);o&&this.$emit("update:search-form",T(g({},this.computedSearchForm),{[o]:i}))},handleUpdateDate(e,i){const l=i||[],o=this.getFieldValue(e,"start"),n=this.getFieldValue(e,"end"),a=this.getFieldValue(e,"value"),r={};o&&(r[o]=l[0]),n&&(r[n]=l[1]),a&&(r[a]=l),this.$emit("update:search-form",g(g({},this.computedSearchForm),r))},getFieldValue(e,i){if(typeof e=="string")return e;if(e.fields&&i in e.fields){const l=e.fields[i];if(typeof l=="string")return l;if(Array.isArray(l))return l[0];if(l&&typeof l=="object")return l.name}},getFieldDefault(e,i){if(e.fields&&i in e.fields){const l=e.fields[i];if(Array.isArray(l)&&l.length>1)return l[1];if(l&&typeof l=="object"&&"default"in l)return l.default}},hasSearchSlot(e){const i="$slots";if(this[i][e])return!0;let o=this.$parent;for(;o;){const n=o[i];if(o.$options.name==="TmTable"&&(n!=null&&n[e]))return!0;o=o.$parent}return!1},initDefaultValues(){if(!this.searchColumns||!this.searchColumns.length)return;const e={};this.searchColumns.forEach(i=>{if(typeof i=="string"||!i.fields)return;const l=this.getFieldValue(i,"value"),o=this.getFieldValue(i,"label");if(i.type==="input"&&i.labelOptions&&i.labelOptions.length>0){const a=i.labelOptions[0];if(o)if(o in this.computedSearchForm)e[o]=this.computedSearchForm[o];else{const r=this.getFieldDefault(i,"label");r!==void 0?e[o]=r:a&&a.value!==void 0&&(e[o]=a.value)}l&&!(l in this.computedSearchForm)&&(e[l]="")}else if(this.isDateType(i.type)&&i.labelOptions&&i.labelOptions.length>0){const a=i.labelOptions[0];if(l&&!(l in this.computedSearchForm)&&(e[l]=[]),o)if(o in this.computedSearchForm)e[o]=this.computedSearchForm[o];else{const r=this.getFieldDefault(i,"label");r!==void 0?e[o]=r:a&&a.value!==void 0&&(e[o]=a.value)}}else if(i.type==="select"&&i.labelOptions&&i.labelOptions.length>0){const a=i.labelOptions[0];if(l&&!(l in this.computedSearchForm)&&(e[l]=i.multiple?[]:""),o)if(o in this.computedSearchForm)e[o]=this.computedSearchForm[o];else{const r=this.getFieldDefault(i,"label");r!==void 0?e[o]=r:a&&a.value!==void 0&&(e[o]=a.value)}}const n=this.getFieldDefault(i,"value");if(l&&n!==void 0&&!(l in this.computedSearchForm)?this.isDateType(i.type)&&!Array.isArray(n)?e[l]=[]:i.type==="checkbox"&&!Array.isArray(n)?e[l]=n?[n]:[]:i.type==="switch"&&typeof n!="boolean"?e[l]=!!n:e[l]=n:l&&!(l in this.computedSearchForm)&&(i.type==="checkbox"?e[l]=[]:i.type==="switch"&&(e[l]=!1)),this.isDateType(i.type)){const a=this.getFieldValue(i,"start"),r=this.getFieldValue(i,"end"),d=this.getFieldDefault(i,"start"),h=this.getFieldDefault(i,"end");a&&d!==void 0&&!(a in this.computedSearchForm)&&(e[a]=d),r&&h!==void 0&&!(r in this.computedSearchForm)&&(e[r]=h)}}),this.defaultValues=e,this.$emit("update:search-form",g(g({},e),this.computedSearchForm))},getSearchForm(){return this.computedSearchForm},handleSearch(){setTimeout(()=>{this.$emit("search",this.computedSearchForm)})},handleReset(){this.$emit("update:search-form",g({},this.defaultValues)),this.$emit("reset")}}},Wt={class:"search-content"},Ut={class:"search-actions"};function jt(e,i,l,o,n,a){const r=t.resolveComponent("dynamic-slot"),d=t.resolveComponent("tm-Input"),h=t.resolveComponent("tm-date"),u=t.resolveComponent("tm-select"),p=t.resolveComponent("tm-cascader"),_=t.resolveComponent("tm-radio"),k=t.resolveComponent("tm-checkbox"),O=t.resolveComponent("tm-switch"),D=t.resolveComponent("tm-textarea"),F=t.resolveComponent("el-button");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["table-search",`table-search--${n.isVue2?"v2":"v3"}`])},[t.createElementVNode("div",Wt,[a.hasDefaultSlot()?t.renderSlot(e.$slots,"default",{key:0},void 0,!0):l.searchColumns&&l.searchColumns.length?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(l.searchColumns,(s,z)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[typeof s=="string"?(t.openBlock(),t.createElementBlock("div",{key:`str-${s}-${z}`,class:"search-item"},[(t.openBlock(),t.createBlock(r,{name:`search-${s}`,"slot-props":{searchForm:l.searchForm},key:s},null,8,["name","slot-props"]))])):(t.openBlock(),t.createElementBlock("div",{key:`obj-${z}`,class:"search-item"},[s.fields?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[a.hasSearchSlot(`search-${a.getFieldValue(s,"value")}`)?(t.openBlock(),t.createBlock(r,{name:`search-${a.getFieldValue(s,"value")}`,"slot-props":{searchForm:l.searchForm,col:s},key:a.getFieldValue(s,"value")},null,8,["name","slot-props"])):(t.openBlock(),t.createElementBlock("div",{style:{display:"flex"},key:a.getFieldValue(s,"value")||`col-${z}`},[s.type==="input"?(t.openBlock(),t.createBlock(d,t.mergeProps({key:0,label:s.label,value:a.computedSearchForm[a.getFieldValue(s,"value")],field:a.computedSearchForm[a.getFieldValue(s,"label")],onValueChange:c=>a.handleUpdate(s,c,"value"),onFieldChange:c=>a.handleUpdate(s,c,"label"),multiple:s.multiple,labelOptions:s.labelOptions,placeholder:s.placeholder,onSearch:a.handleSearch},{ref_for:!0},a.getLayoutProps(s)),null,16,["label","value","field","onValueChange","onFieldChange","multiple","labelOptions","placeholder","onSearch"])):t.createCommentVNode("",!0),a.isDateType(s.type)?(t.openBlock(),t.createBlock(h,t.mergeProps({key:1,type:s.type,label:s.label,value:a.computedSearchForm[a.getFieldValue(s,"value")],field:a.computedSearchForm[a.getFieldValue(s,"label")],start:a.computedSearchForm[a.getFieldValue(s,"start")],end:a.computedSearchForm[a.getFieldValue(s,"end")],onFieldChange:c=>a.handleUpdate(s,c,"label"),onValueChange:c=>a.handleUpdateDate(s,c),onStartChange:c=>a.handleUpdateDate(s,c),onEndChange:c=>a.handleUpdateDate(s,c),labelOptions:s.labelOptions,"start-placeholder":s.startPlaceholder,"end-placeholder":s.endPlaceholder,placeholder:s.placeholder,"range-separator":s.rangeSeparator,disabled:s.disabled,clearable:s.clearable,readonly:s.readonly,editable:s.editable,align:s.align,"popper-class":s.popperClass,"default-value":s.defaultValue,"default-time":s.defaultTime,shortcuts:s.shortcuts,"past-only":s.pastOnly,format:s.format},{ref_for:!0},a.getLayoutProps(s)),null,16,["type","label","value","field","start","end","onFieldChange","onValueChange","onStartChange","onEndChange","labelOptions","start-placeholder","end-placeholder","placeholder","range-separator","disabled","clearable","readonly","editable","align","popper-class","default-value","default-time","shortcuts","past-only","format"])):t.createCommentVNode("",!0),s.type==="select"?(t.openBlock(),t.createBlock(u,t.mergeProps({key:2,label:s.label,modelValue:a.computedSearchForm[a.getFieldValue(s,"value")],"onUpdate:modelValue":c=>a.computedSearchForm[a.getFieldValue(s,"value")]=c,field:a.computedSearchForm[a.getFieldValue(s,"label")],options:s.options,labelOptions:s.labelOptions,placeholder:s.placeholder,multiple:s.multiple,"show-check-all":s.checkAll,"value-on-clear":s.valueOnClear,clearable:s.clearable,onFieldChange:c=>a.handleUpdate(s,c,"label")},{ref_for:!0},a.getLayoutProps(s)),null,16,["label","modelValue","onUpdate:modelValue","field","options","labelOptions","placeholder","multiple","show-check-all","value-on-clear","clearable","onFieldChange"])):t.createCommentVNode("",!0),s.type==="cascader"?(t.openBlock(),t.createBlock(p,t.mergeProps({key:3,modelValue:a.computedSearchForm[a.getFieldValue(s,"value")],"onUpdate:modelValue":c=>a.computedSearchForm[a.getFieldValue(s,"value")]=c,label:s.label,options:s.options,labelOptions:s.labelOptions,props:s.props,placeholder:s.placeholder,"show-check-all":s.checkAll},{ref_for:!0},a.getLayoutProps(s)),null,16,["modelValue","onUpdate:modelValue","label","options","labelOptions","props","placeholder","show-check-all"])):t.createCommentVNode("",!0),s.type==="radio"?(t.openBlock(),t.createBlock(_,t.mergeProps({key:4,modelValue:a.computedSearchForm[a.getFieldValue(s,"value")],"onUpdate:modelValue":c=>a.computedSearchForm[a.getFieldValue(s,"value")]=c,label:s.label,options:s.options,props:s.props},{ref_for:!0},a.getLayoutProps(s)),null,16,["modelValue","onUpdate:modelValue","label","options","props"])):t.createCommentVNode("",!0),s.type==="checkbox"?(t.openBlock(),t.createBlock(k,t.mergeProps({key:5,modelValue:a.computedSearchForm[a.getFieldValue(s,"value")],"onUpdate:modelValue":c=>a.computedSearchForm[a.getFieldValue(s,"value")]=c,label:s.label,options:s.options,props:s.props},{ref_for:!0},a.getLayoutProps(s)),null,16,["modelValue","onUpdate:modelValue","label","options","props"])):t.createCommentVNode("",!0),s.type==="switch"?(t.openBlock(),t.createBlock(O,t.mergeProps({key:6,modelValue:a.computedSearchForm[a.getFieldValue(s,"value")],"onUpdate:modelValue":c=>a.computedSearchForm[a.getFieldValue(s,"value")]=c,"active-text":s.activeText,"inactive-text":s.inactiveText,label:s.label,"active-color":s.activeColor,"inactive-color":s.inactiveColor},{ref_for:!0},a.getLayoutProps(s)),null,16,["modelValue","onUpdate:modelValue","active-text","inactive-text","label","active-color","inactive-color"])):t.createCommentVNode("",!0),s.type==="textarea"?(t.openBlock(),t.createBlock(D,t.mergeProps({key:7,modelValue:a.computedSearchForm[a.getFieldValue(s,"value")],"onUpdate:modelValue":c=>a.computedSearchForm[a.getFieldValue(s,"value")]=c,field:a.computedSearchForm[a.getFieldValue(s,"label")],label:s.label,labelOptions:s.labelOptions,placeholder:s.placeholder,autosize:s.autosize,maxlength:s.maxlength,minlength:s.minlength,"show-word-limit":s.showWordLimit,readonly:s.readonly,disabled:s.disabled,resize:s.resize,clearable:s.clearable,onFieldChange:c=>a.handleUpdate(s,c,"label")},{ref_for:!0},a.getLayoutProps(s)),null,16,["modelValue","onUpdate:modelValue","field","label","labelOptions","placeholder","autosize","maxlength","minlength","show-word-limit","readonly","disabled","resize","clearable","onFieldChange"])):t.createCommentVNode("",!0)]))],64)):(t.openBlock(),t.createElementBlock("div",{key:`error-${z}`,class:"search-error-message"}," 缺少 fields 配置,无法渲染此组件 "))]))],64))),256)):t.createCommentVNode("",!0),t.createElementVNode("div",Ut,[t.createVNode(F,{type:"primary",size:n.getDefaultSize(),onClick:a.handleSearch},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.t("query")),1)]),_:1},8,["size","onClick"]),t.createVNode(F,{size:n.getDefaultSize(),onClick:a.handleReset},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.t("reset")),1)]),_:1},8,["size","onClick"])])])],2)}const Z=b(Pt,[["render",jt],["__scopeId","data-v-be7a7198"]]),Jt=!1,Kt={name:"TablePagination",props:{current:{type:Number,default:1},small:{type:Boolean,default:!0},pageSize:{type:Number,default:20},total:{type:Number,default:0}},data(){return{isVue2:Jt,getCompatSize:B}},methods:{handleSizeChange(e){this.$emit("size-change",e)},handleCurrentChange(e){this.$emit("current-change",e)}}},Qt={class:"tm-pagination"};function qt(e,i,l,o,n,a){const r=t.resolveComponent("el-pagination");return t.openBlock(),t.createElementBlock("div",Qt,[t.createElementVNode("div",null,[t.renderSlot(e.$slots,"pagination-left",{},void 0,!0)]),t.createVNode(r,t.mergeProps(e.$attrs,t.toHandlers(n.isVue2?e.$listeners:{}),{style:{"text-align":"right"},"current-page":l.current,"page-size":l.pageSize,total:l.total,"page-sizes":[10,20,50,100,300,500,1e3,2e3],size:n.getCompatSize("mini"),layout:"total, sizes, prev, pager, next, jumper",onSizeChange:a.handleSizeChange,"onUpdate:currentPage":i[0]||(i[0]=d=>e.$emit("update:current",d)),"onUpdate:pageSize":i[1]||(i[1]=d=>e.$emit("update:pageSize",d)),onCurrentChange:a.handleCurrentChange}),null,16,["current-page","page-size","total","size","onSizeChange","onCurrentChange"])])}const Yt=b(Kt,[["render",qt],["__scopeId","data-v-ee768f31"]]),Gt={name:"TmTableMenu",props:{size:{type:String,default:"mini"}}},Xt={size:"small",class:"tm-table-menu",inline:""},Zt={class:"left"},$t={class:"right"};function el(e,i,l,o,n,a){return t.openBlock(),t.createElementBlock("div",Xt,[t.createElementVNode("div",Zt,[t.renderSlot(e.$slots,"left",{},void 0,!0)]),t.createElementVNode("div",$t,[t.renderSlot(e.$slots,"right",{},void 0,!0)])])}const tl=b(Gt,[["render",el],["__scopeId","data-v-579dd2c3"]]),I=e=>e?e.props||{}:{},$=(e,i)=>{e&&(e.props||(e.props={}),typeof i=="object"&&Object.assign(e.props,i))},v={getTableConfig(e){try{const i=localStorage.getItem(`tm-table-config-${e}`);return Promise.resolve({data:{code:200,data:i}})}catch(i){return Promise.reject(i)}},setTableConfig(e){try{return localStorage.setItem(`tm-table-config-${e.key}`,e.info),Promise.resolve({data:{code:200,message:"success"}})}catch(i){return Promise.reject(i)}}},ll=e=>v.getTableConfig(e.key),il=e=>v.setTableConfig(e),nl=e=>{e&&(typeof e.getTableConfig=="function"&&(v.getTableConfig=e.getTableConfig),typeof e.setTableConfig=="function"&&(v.setTableConfig=e.setTableConfig))},{t:al}=x(),ol=!1,sl=!0,rl={formatter:(e,i,l,o)=>[void 0,null,""].includes(l)?"-":l},dl={name:"TmColumnConfig",components:{MoveIcon:Fe,FixedLeftIcon:Le,FixedRightIcon:Be,UploadIcon:Ne,DownloadIcon:Ee,DeleteIcon:Oe,MenuIcon:we,tmEllipsisText:N},props:{columns:{type:Array,default:()=>[]},tableKey:{type:String,default:"",required:!0},defaultColumns:{type:Array,default:()=>[]},maxFixedLeftQuantity:{type:[Number,String],default:void 0},maxFixedRightQuantity:{type:[Number,String],default:void 0},ignoredColumnConfigTypes:{type:Array,default:()=>["selection"]}},data(){return{t:al,isVue2:ol,isVue3:sl,getDefaultSize:S,getCompatSize:B,buttonType:{link:!0,type:"primary"},afterOpenDelay:{"show-after":300},popoverVisible:!1,keyWord:"",sortedTableColumns:[],tableColumns:[],defaultColumnsConfig:[],columnMap:{},processedColumns:[],placement:"bottom",isDraggingFrozen:!1,isDraggingFrozenRight:!1,sortable:null,isConfigLoaded:!1,columnsCopy:[]}},computed:{filteredSortedTableColumns(){return this.keyWord?this.sortedTableColumns.filter(e=>this.getColumnLabel(e.prop).includes(this.keyWord)):this.sortedTableColumns},showFixedLimitTips(){return this.maxFixedLeftQuantity!==void 0||this.maxFixedRightQuantity!==void 0},isThanMaxFrozen(){return this.maxFixedLeftQuantity===void 0?!1:this.sortedTableColumns.filter(e=>e.fixed==="left").length>=this.maxFixedLeftQuantity},isThanMaxRightFrozen(){return this.maxFixedRightQuantity===void 0?!1:this.sortedTableColumns.filter(e=>e.fixed==="right").length>=this.maxFixedRightQuantity},computedTableKey(){if(this.tableKey)return this.tableKey;if(this.$route&&this.$route.path)return this.$route.path.slice(1).replace(/\//g,"-");throw new Error("tableKey is required")}},watch:{popoverVisible(e){e||this.handlePopoverHide()},columns:{handler(e){e&&e.length>0&&!this.isConfigLoaded&&this.initializeColumnConfig()},immediate:!0},tableColumns:{handler(e){e!=null&&e.length&&(this.initSortedTableColumns(),this.crateSortable(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)))},deep:!0}},methods:{findLastIndex(e,i){for(let l=e.length-1;l>=0;l--)if(i(e[l],l,e))return l;return-1},getColumnLabel(e){return!e||!this.columnMap[e]?e||"":I(this.columnMap[e]).label||e},initializeColumnConfig(){this.defaultColumns&&this.defaultColumns.length>0?this.defaultColumnsConfig=this.defaultColumns:this.processOriginalColumns(),this.loadColumnConfig()},processOriginalColumns(){const e=this.columns||[];let i={};this.defaultColumnsConfig=e.filter(l=>{const o=I(l);return!(!o.prop||this.ignoredColumnConfigTypes.includes(o.type))}).map((l,o)=>{const n=I(l),a=g(g({},rl),n);$(l,a),n.prop&&(i[n.prop]=l);const r=n.hasOwnProperty("visible")?n.visible!==!1:!0;return{prop:n.prop,fixed:n.fixed||"",sort:o,cancellable:n.hasOwnProperty("cancellable")?n.cancellable:!0,visible:r}}),this.columnMap=i},loadColumnConfig(){ll({key:this.computedTableKey}).then(e=>{var l;if(e.data.code!==200)return;let i=JSON.parse(((l=e.data)==null?void 0:l.data)||null)||{};i.columnsConfig&&JSON.stringify(this.defaultColumnsConfig)===JSON.stringify(i.defaultColumnsConfig)?this.tableColumns=i.columnsConfig.map(o=>g({},o)):this.tableColumns=this.defaultColumnsConfig.map(o=>g({},o)),this.processedColumns=this.applyColumnConfig(this.tableColumns),this.isConfigLoaded=!0,this.$emit("complete",{columns:this.processedColumns,config:this.tableColumns,isInitialLoad:!0})}).catch(()=>{this.tableColumns=this.defaultColumnsConfig.map(e=>g({},e)),this.processedColumns=this.applyColumnConfig(this.tableColumns),this.isConfigLoaded=!0,this.$emit("complete",{columns:this.processedColumns,isInitialLoad:!0})})},applyColumnConfig(e,i=!1){let l=this.columns.filter(n=>{const a=I(n);return this.ignoredColumnConfigTypes.includes(a.type)}),o=[];return[...e].sort((n,a)=>{const r=n.sort!==void 0?n.sort:1/0,d=a.sort!==void 0?a.sort:1/0;return r-d}).forEach(n=>{if(n.prop){let a=this.columnMap[n.prop];a&&($(a,{fixed:n.fixed||void 0,visible:n.visible}),(!i&&n.visible||i)&&o.push(a))}}),l.forEach(n=>{$(n,{visible:!0})}),[...l,...o]},crateSortable(){const e=this.$refs.sortListRef;if(!e)return;this.sortable&&(this.sortable.destroy(),this.sortable=null);const i=new f(e,{ghostClass:"blue-background-class",animation:150,easing:"cubic-bezier(1, 0, 0, 1)",handle:".row-title",draggable:".sort-item-wrapper",fallbackOnBody:!1,preventOnFilter:!0,removeCloneOnHide:!0,group:"columns",dragClass:"sortable-drag",onStart:({item:l})=>{const o=l.getAttribute("data-prop"),n=this.sortedTableColumns.find(a=>a.prop===o);this.isDraggingFrozen=n&&n.fixed==="left",this.isDraggingFrozenRight=n&&n.fixed==="right",this.draggedItemIndex=Array.from(e.children).indexOf(l),l.classList.add("sortable-drag")},onMove:l=>{const{target:o,related:n}=l;if(!o||!n)return!1;const a=n?n.getAttribute("data-prop"):null,r=a?this.sortedTableColumns.find(u=>u.prop===a):null,d=r&&r.fixed==="left",h=r&&r.fixed==="right";return this.isDraggingFrozen&&!d||this.isDraggingFrozenRight&&!h||!this.isDraggingFrozen&&!this.isDraggingFrozenRight&&(d||h)?(o.classList.add("no-drop-zone"),!1):(document.querySelectorAll(".no-drop-zone").forEach(u=>{u.classList.remove("no-drop-zone")}),!0)},onEnd:({item:l,newIndex:o,oldIndex:n})=>{if(o===void 0||n===void 0||o<0||n<0||o>=this.sortedTableColumns.length||n>=this.sortedTableColumns.length)return;document.querySelectorAll(".no-drop-zone").forEach(_=>{_.classList.remove("no-drop-zone")}),l.classList.remove("sortable-drag");const a=this.sortedTableColumns[n],r=a.fixed==="left",d=a.fixed==="right",h=o>0?this.sortedTableColumns[o-1]:null,u=o<this.sortedTableColumns.length-1?this.sortedTableColumns[o+1]:null;let p=!1;if(r?(h&&h.fixed!=="left"||u&&u.fixed==="right")&&(p=!0):d?(h&&h.fixed!=="right"||u&&u.fixed!=="right")&&(p=!0):(h&&h.fixed==="right"||u&&u.fixed==="left")&&(p=!0),p){this.rollbackSort();return}this.updateSortAfterDrag()}});this.sortable=i},rollbackSort(){this.sortedTableColumns=JSON.parse(JSON.stringify(this.columnsCopy))},updateSortAfterDrag(){const e=this.$refs.sortListRef;if(!e)return;Array.from(e.children||[]).filter(l=>l&&l.dataset&&l.dataset.prop).map(l=>l.dataset.prop).forEach((l,o)=>{this.sortedTableColumns.some(n=>n.prop===l?(n.sort=o,!0):!1)}),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)),this.$emit("on-sort-change",this.sortedTableColumns)},init(){this.tableColumns=Array.isArray(this.tableColumns)?[...this.tableColumns]:Array.isArray(this.defaultColumnsConfig)?[...this.defaultColumnsConfig]:[],this.initSortedTableColumns()},initSortedTableColumns(){this.tableColumns.forEach((e,i)=>{e.sort===void 0&&(e.sort=i)}),this.sortedTableColumns=[...this.tableColumns].sort((e,i)=>e.fixed==="left"&&i.fixed!=="left"?-1:e.fixed!=="left"&&i.fixed==="left"||e.fixed==="right"&&i.fixed!=="right"?1:e.fixed!=="right"&&i.fixed==="right"?-1:e.sort-i.sort)},setPlacement(){const i=this.$refs.operationRef.$el.getBoundingClientRect();(window.innerHeight||document.documentElement.clientHeight)-(i.bottom-window.scrollY)>512?this.placement="bottom":this.placement="left"},handleVisibleChange(e){this.popoverVisible=e},handlePopoverShow(){this.setPlacement(),this.init(),(()=>{try{document.removeEventListener("mouseup",window.sortableGlobalMouseUp),document.removeEventListener("mousemove",window.sortableGlobalMouseMove)}catch(i){}})(),this.$nextTick(()=>{this.crateSortable()})},handlePopoverHide(){this.sortable&&(this.sortable.destroy(),this.sortable=null);try{document.removeEventListener("mouseup",window.sortableGlobalMouseUp),document.removeEventListener("mousemove",window.sortableGlobalMouseMove),typeof f!="undefined"&&f.utils&&(document.removeEventListener("mousemove",f.utils.throttleCall),document.removeEventListener("mouseup",f.utils.throttleCall))}catch(e){}},handleSelectAll(){const e=this.tableColumns.some(i=>!i.visible);this.tableColumns.forEach(i=>{i.cancellable&&(i.visible=e)})},handleRestoreDefault(){this.tableColumns=JSON.parse(JSON.stringify(this.defaultColumnsConfig)),this.sortedTableColumns=[...this.tableColumns].sort((e,i)=>e.sort-i.sort)},canMoveTop(e,i){if(i===0)return!1;if(e.fixed==="left"){const l=this.sortedTableColumns[i-1];return l&&l.fixed==="left"}if(!e.fixed){const l=this.sortedTableColumns[i-1];return l&&l.fixed==="left"?!1:l&&!l.fixed}return e.fixed==="right"},moveTop(e,i){const l=this.sortedTableColumns,o=e.prop;if(e.fixed==="right"&&(e.fixed=""),e.fixed==="left")l.unshift(l.splice(i,1)[0]);else{const n=this.findLastIndex(this.sortedTableColumns,a=>a.fixed==="left");l.splice(n+1,0,l.splice(i,1)[0])}this.updateSortValues(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)),this.$emit("on-sort-change",this.sortedTableColumns),this.$nextTick(()=>{const n=this.$refs.sortListRef;if(n){const a=Array.from(n.children).find(r=>r.dataset&&r.dataset.prop===o);a&&a.scrollIntoView({behavior:"smooth",block:"nearest"})}})},frozenLeftHandle(e){const i=this.sortedTableColumns,l=i.splice(e,1)[0];if(l.fixed=l.fixed==="left"?"":"left",l.fixed==="left"){const o=this.findLastIndex(this.sortedTableColumns,n=>n.fixed==="left");i.splice(o+1,0,l)}else{const o=this.findLastIndex(this.sortedTableColumns,n=>n.fixed==="left");i.splice(o+1,0,l)}this.updateSortValues(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)),this.$emit("on-sort-change",this.sortedTableColumns)},frozenRightHandle(e){const i=this.sortedTableColumns,l=i.splice(e,1)[0];if(l.fixed=l.fixed==="right"?"":"right",l.fixed==="right"){const o=i.findIndex(n=>n.fixed==="right");o===-1?i.push(l):i.splice(o,0,l)}else{const o=i.findIndex(n=>n.fixed==="right");o===-1?i.push(l):i.splice(o,0,l)}this.updateSortValues(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)),this.$emit("on-sort-change",this.sortedTableColumns)},onSave(){var i;this.updateSortValues();const e=(i=this.tableColumns)==null?void 0:i.map(l=>{const o=this.sortedTableColumns.find(d=>d.prop===l.prop);o&&(l.sort=o.sort,l.fixed=o.fixed,l.visible=o.visible);const r=l,{label:n}=r;return be(r,["label"])});il({key:this.computedTableKey,info:JSON.stringify({columnsConfig:e,defaultColumnsConfig:this.defaultColumnsConfig})}).then(l=>{l.data.code===200&&(this.processedColumns=this.applyColumnConfig(e,!0),this.$emit("complete",{columns:this.processedColumns,config:e,isInitialLoad:!1}),this.$message.success(this.t("saveSuccess")),this.popoverVisible=!1)})},updateSortValues(){this.sortedTableColumns.forEach((e,i)=>{e.sort=i})}},mounted(){var e;(e=this.tableColumns)!=null&&e.length&&(this.initSortedTableColumns(),this.crateSortable(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)))},beforeDestroy(){this.sortable&&(this.sortable.destroy(),this.sortable=null);try{document.removeEventListener("mouseup",window.sortableGlobalMouseUp),document.removeEventListener("mousemove",window.sortableGlobalMouseMove),typeof f!="undefined"&&f.utils&&(document.removeEventListener("mousemove",f.utils.throttleCall),document.removeEventListener("mouseup",f.utils.throttleCall))}catch(e){}}},cl={key:0,class:"container"},hl={class:"main-container"},ul={class:"left-content"},ml={class:"title"},pl={class:"option-list"},fl={style:{height:"100%","overflow-y":"auto"}},gl={class:"right-content"},bl={class:"search-box"},yl={key:0,class:"tips"},Cl={class:"sort-list",ref:"sortListRef"},_l=["data-prop"],Sl={key:0,class:"sort-item"},xl={class:"row-title"},Vl={class:"operation-btns"},kl={class:"footer"},wl={class:"footer-left"},Tl={class:"footer-right"},Fl={style:{display:"inline-block","margin-left":"10px"}};function zl(e,i,l,o,n,a){const r=t.resolveComponent("el-button"),d=t.resolveComponent("TmEllipsisText"),h=t.resolveComponent("el-checkbox"),u=t.resolveComponent("el-input"),p=t.resolveComponent("MoveIcon"),_=t.resolveComponent("DeleteIcon"),k=t.resolveComponent("el-tooltip"),O=t.resolveComponent("UploadIcon"),D=t.resolveComponent("FixedLeftIcon"),F=t.resolveComponent("FixedRightIcon"),s=t.resolveComponent("MenuIcon"),z=t.resolveComponent("el-popover");return t.openBlock(),t.createBlock(z,t.mergeProps({"popper-class":"column-config-popover"},{[n.isVue3?"visible":"value"]:n.popoverVisible},t.toHandlers({[n.isVue3?"update:visible":"input"]:a.handleVisibleChange}),{width:680,"show-arrow":!1,placement:n.placement,trigger:"click",onShow:a.handlePopoverShow,onHide:a.handlePopoverHide}),{reference:t.withCtx(()=>[t.createElementVNode("div",Fl,[t.createVNode(k,t.mergeProps({content:n.t("columnSetting")},n.afterOpenDelay,{placement:"top"}),{default:t.withCtx(()=>[t.createVNode(r,{size:n.getDefaultSize(),ref:"operationRef",circle:""},{default:t.withCtx(()=>[t.createVNode(s)]),_:1},8,["size"])]),_:1},16,["content"])])]),default:t.withCtx(()=>[n.popoverVisible?(t.openBlock(),t.createElementBlock("div",cl,[t.createElementVNode("div",hl,[t.createElementVNode("div",ul,[t.createElementVNode("div",ml,[t.createElementVNode("span",null,t.toDisplayString(n.t("SelectableFields"))+"("+t.toDisplayString(n.tableColumns.length)+")",1),t.createVNode(r,t.mergeProps({style:{"margin-left":"10px"}},n.buttonType,{onClick:a.handleSelectAll}),{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.t("all")),1)]),_:1},16,["onClick"])]),t.createElementVNode("div",pl,[t.createElementVNode("div",fl,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.tableColumns,(c,L)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[c.prop?(t.openBlock(),t.createElementBlock("div",{style:{width:"110px",display:"inline-block"},key:L+c.prop},[t.createVNode(h,{disabled:!c.cancellable,class:"el-checkbox",modelValue:c.visible,"onUpdate:modelValue":A=>c.visible=A,label:c.prop,value:c.prop},{default:t.withCtx(()=>[t.createVNode(d,{width:"80px",text:a.getColumnLabel(c.prop)},null,8,["text"])]),_:2},1032,["disabled","modelValue","onUpdate:modelValue","label","value"])])):t.createCommentVNode("",!0)],64))),256))])])]),t.createElementVNode("div",gl,[t.createElementVNode("div",bl,[t.createVNode(u,{size:n.getCompatSize("small"),class:"search-input",clearable:"",placeholder:n.t("search"),modelValue:n.keyWord,"onUpdate:modelValue":i[0]||(i[0]=c=>n.keyWord=c)},null,8,["size","placeholder","modelValue"])]),a.showFixedLimitTips?(t.openBlock(),t.createElementBlock("div",yl)):t.createCommentVNode("",!0),t.createElementVNode("div",Cl,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.filteredSortedTableColumns,(c,L)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["sort-item-wrapper",[c.fixed==="left"?"frozen":"",c.fixed==="right"?"frozenRight":"",c.fixed?"":"noFrozen"]]),"data-prop":c.prop,key:c.prop},[c.visible?(t.openBlock(),t.createElementBlock("div",Sl,[t.createElementVNode("div",xl,[t.createVNode(p,{style:{"flex-shrink":"0"}}),t.createVNode(d,{text:a.getColumnLabel(c.prop)},null,8,["text"])]),t.createElementVNode("div",Vl,[c.cancellable?(t.openBlock(),t.createBlock(k,t.mergeProps({key:0,content:n.t("cancel"),placement:"top"},{ref_for:!0},n.afterOpenDelay),{default:t.withCtx(()=>[t.createVNode(r,t.mergeProps({ref_for:!0},n.buttonType,{size:n.getCompatSize("mini"),class:"iconfont-button delete-button",onClick:A=>c.visible=!1}),{default:t.withCtx(()=>[t.createVNode(_)]),_:2},1040,["size","onClick"])]),_:2},1040,["content"])):t.createCommentVNode("",!0),a.canMoveTop(c,L)?(t.openBlock(),t.createBlock(k,t.mergeProps({key:1,content:n.t("top"),placement:"top"},{ref_for:!0},n.afterOpenDelay),{default:t.withCtx(()=>[t.createVNode(r,t.mergeProps({ref_for:!0},n.buttonType,{size:n.getCompatSize("mini"),class:"iconfont-button top-button",onClick:A=>a.moveTop(c,L)}),{default:t.withCtx(()=>[t.createVNode(O)]),_:2},1040,["size","onClick"])]),_:2},1040,["content"])):t.createCommentVNode("",!0),c.fixed!=="right"?(t.openBlock(),t.createBlock(k,t.mergeProps({key:2,content:c.fixed==="left"?n.t("cancelLeftFixed"):n.t("leftFixed"),placement:"top"},{ref_for:!0},n.afterOpenDelay),{default:t.withCtx(()=>[t.createVNode(r,t.mergeProps({ref_for:!0},n.buttonType,{size:n.getCompatSize("mini"),class:["iconfont-button left-fixed-btn",{"active-fixed":c.fixed==="left"}],onClick:A=>a.frozenLeftHandle(L),disabled:c.fixed!=="left"&&a.isThanMaxFrozen}),{default:t.withCtx(()=>[t.createVNode(D)]),_:2},1040,["size","class","onClick","disabled"])]),_:2},1040,["content"])):t.createCommentVNode("",!0),c.fixed!=="left"?(t.openBlock(),t.createBlock(k,t.mergeProps({key:3,content:c.fixed==="right"?n.t("cancelRightFixed"):n.t("rightFixed"),placement:"top"},{ref_for:!0},n.afterOpenDelay),{default:t.withCtx(()=>[t.createVNode(r,t.mergeProps({ref_for:!0},n.buttonType,{size:n.getCompatSize("mini"),class:["iconfont-button right-fixed-btn",{"active-fixed":c.fixed==="right"}],onClick:A=>a.frozenRightHandle(L),disabled:c.fixed!=="right"&&a.isThanMaxRightFrozen}),{default:t.withCtx(()=>[t.createVNode(F)]),_:2},1040,["size","class","onClick","disabled"])]),_:2},1040,["content"])):t.createCommentVNode("",!0)])])):t.createCommentVNode("",!0)],10,_l))),128))],512)])]),t.createElementVNode("div",kl,[t.createElementVNode("div",wl,[t.createVNode(r,{size:n.getCompatSize("mini"),onClick:a.handleRestoreDefault},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.t("restoreDefault")),1)]),_:1},8,["size","onClick"])]),t.createElementVNode("div",Tl,[t.createVNode(r,{size:n.getCompatSize("mini"),onClick:i[1]||(i[1]=c=>n.popoverVisible=!1)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.t("cancel")),1)]),_:1},8,["size"]),t.createVNode(r,{size:n.getCompatSize("mini"),type:"primary",onClick:a.onSave},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.t("saveAndApply")),1)]),_:1},8,["size","onClick"])])])])):t.createCommentVNode("",!0)]),_:1},16,["placement","onShow","onHide"])}const Ll=b(dl,[["render",zl],["__scopeId","data-v-fc286487"]]),he=!1,ue=!0;function E(e){if(!Array.isArray(e))return e;const i=[];for(const l of e)if(l)if(typeof l.type=="symbol"&&l.children){let o=l.children;if(typeof o=="function")continue;if(Array.isArray(o)){const n=E(o);i.push(...n)}else{const n=E([o]);i.push(...n)}}else i.push(l);return i}const Bl={name:"TmTable",components:{TableSearch:Z,TablePagination:Yt,TableMenu:tl,ColumnConfig:Ll,RefreshIcon:Te,ColumnRenderer:{props:["vnode"],render(){return this.vnode}}},inheritAttrs:!1,props:{data:{type:[Array,Function],default:()=>[]},showSearch:{type:Boolean,default:!0},showMenu:{type:Boolean,default:!0},showPagination:{type:Boolean,default:!0},pagination:{type:Object,default:()=>({})},height:{type:[String,Number]},calcHeight:{type:Number,default:0},dataAdapter:{type:Function,default:null},columnSettingButton:{type:Boolean,default:!0},refreshButton:{type:Boolean,default:!0},tableKey:{type:String,default:""},firstLoad:{type:Boolean,default:!0},maxFixedLeftQuantity:{type:Number},maxFixedRightQuantity:{type:Number},border:{type:Boolean,default:!0},searchColumns:{type:Array,default:null},searchForm:{type:Object,default:()=>({})},labelWidth:{type:[String,Number],default:void 0},inputWidth:{type:[String,Number],default:void 0},direction:{type:String,default:void 0,validator:e=>!e||["horizontal","vertical"].includes(e)},labelAlign:{type:String,default:"right",validator:e=>["left","right","center"].includes(e)}},data(){return{getDefaultSize:S,getCompatSize:B,isVue3:ue,isVue2:he,t:x().t,tableData:[],tableLoading:!1,columnsLoading:!1,tableReload:1,tableHeight:null,selectedRows:[],paginationInfo:{current:1,pageSize:20,total:void 0},originalColumns:[],displayColumns:[],isColumnConfigLoaded:!1,savedColumnConfig:null,slotsUpdateTrigger:0,lastSlotsHash:null,afterOpenDelay:{"show-after":300}}},computed:{pageLoading(){return this.tableLoading||this.columnsLoading},computedTableKey(){if(this.tableKey)return this.tableKey;if(this.$route&&this.$route.path)return this.$route.path.slice(1).replace(/\//g,"-");throw new Error("tableKey is required")},computedShowPagination(){return this.showPagination&&typeof this.data=="function"},slotsHash(){{this.slotsUpdateTrigger;const e=this.$slots.default?this.$slots.default():[],i=E(e);return this.getColumnsHash(i)}}},watch:{data:{immediate:!0,handler(e){typeof e=="function"?!this.columnSettingButton||this.isColumnConfigLoaded&&!this.firstLoad?this.loadData():Array.isArray(e)&&(this.tableData=e):this.tableData=e}},height:{immediate:!0,handler(){this.getTableHeight()}},slotsHash:{handler(e,i){e&&e!==i&&this.$nextTick(()=>{this.checkAndUpdateColumns()})}}},created(){this.updateColumns()},mounted(){this.getTableHeight(),window.addEventListener("resize",this.getTableHeight)},beforeUpdate(){this.checkAndUpdateColumns()},updated(){this.$nextTick(()=>{this.checkAndUpdateColumns()})},beforeDestroy(){window.removeEventListener("resize",this.getTableHeight)},methods:{updateColumns(){{const e=this.$slots.default();this.originalColumns=E(e)}this.columnSettingButton?this.isColumnConfigLoaded||(this.columnsLoading=!0):(this.displayColumns=this.originalColumns,this.isColumnConfigLoaded=!0)},getColumnsHash(e){return e.map((i,l)=>{var o,n,a,r,d;return i?i.key||((n=(o=i.data)==null?void 0:o.attrs)==null?void 0:n.prop)||((r=(a=i.componentOptions)==null?void 0:a.propsData)==null?void 0:r.prop)||((d=i.props)==null?void 0:d.prop)||`index-${l}`:`null-${l}`}).join(",")},checkAndUpdateColumns(){var e,i;try{const l=he?this.$slots.default||[]:E(((i=(e=this.$slots).default)==null?void 0:i.call(e))||[]),o=this.getColumnsHash(l),n=this.lastSlotsHash||this.getColumnsHash(this.originalColumns);o!==n&&(ue&&this.slotsUpdateTrigger++,this.lastSlotsHash=o,this.originalColumns=l,!this.columnSettingButton||!this.isColumnConfigLoaded?this.displayColumns=this.originalColumns:this.reapplyColumnConfig(),this.$nextTick(()=>{this.$refs.table&&this.$refs.table.doLayout(),this.$forceUpdate()}))}catch(l){}},handleUpdateSearchForm(e){this.$emit("update:search-form",e)},handleColumnConfigComplete(e){Array.isArray(e.columns)?(this.displayColumns=[...e.columns],this.savedColumnConfig=e.config||null):(this.displayColumns=[...this.originalColumns],this.savedColumnConfig=null),e.isInitialLoad?(this.isColumnConfigLoaded=!0,this.columnsLoading=!1,this.firstLoad&&typeof this.data=="function"&&this.loadData()):this.reloadTable()},reapplyColumnConfig(){if(!this.columnSettingButton||!this.isColumnConfigLoaded||!this.savedColumnConfig)return;const e=n=>n.props||{},i={};this.originalColumns.forEach(n=>{const a=e(n);a.prop&&(i[a.prop]=n)});const l=[];this.originalColumns.forEach(n=>{e(n).type==="selection"&&l.push(n)}),[...this.savedColumnConfig].sort((n,a)=>{const r=n.sort!==void 0?n.sort:1/0,d=a.sort!==void 0?a.sort:1/0;return r-d}).forEach(n=>{n.prop&&i[n.prop]&&n.visible!==!1&&l.push(i[n.prop])}),this.originalColumns.forEach(n=>{const a=e(n),r=a.prop,d=a.type;if(r&&d!=="selection"){const h=this.savedColumnConfig.some(p=>p.prop===r),u=l.find(p=>e(p).prop===r);!h&&!u&&l.push(n)}}),this.displayColumns=l},isAutoHeight(){return this.height==="auto"},handleRefresh(){this.loadData()},async loadData(){if(Array.isArray(this.data))this.tableData=this.data;else if(typeof this.data=="function"){if(this.tableLoading)return;this.tableLoading=!0;try{const e=await this.data({paginationInfo:{pageSize:this.paginationInfo.pageSize,current:this.paginationInfo.current},params:this.searchForm}),{list:i,total:l,pageSize:o,current:n}=e;this.tableData=i;let a=g({},this.paginationInfo);l!==void 0&&(a.total=l),n!==void 0&&(a.current=n),o!==void 0&&(a.pageSize=o),this.paginationInfo=a}catch(e){}finally{this.tableLoading=!1}}},getTableHeight(){this.isAutoHeight()?this.$nextTick(()=>{const e=this.$refs.table,i=this.$refs.tmPagination;if(!e)return;const l=e.$el,o=i&&i.$el&&i.$el.offsetHeight||0;this.tableHeight=document.documentElement.clientHeight-l.offsetTop-o-this.calcHeight}):this.tableHeight=this.height,this.refreshTable()},search(){this.paginationInfo.current=1,this.loadData()},reset(){this.paginationInfo.current=1,this.$nextTick(()=>{this.loadData()})},handleSelectionChange(e){this.selectedRows=e,this.$emit("selection-change",e)},handleSizeChange(e){this.paginationInfo.pageSize=e,this.loadData(),this.$emit("size-change",e)},handleCurrentChange(e){this.paginationInfo.current=e,this.loadData(),this.$emit("current-change",e)},refreshTable(){this.$refs.table&&this.$refs.table.doLayout()},reloadTable(){this.tableReload++}}},Nl={class:"tm-table",ref:"tablePage"};function El(e,i,l,o,n,a){const r=t.resolveComponent("table-search"),d=t.resolveComponent("RefreshIcon"),h=t.resolveComponent("el-button"),u=t.resolveComponent("el-tooltip"),p=t.resolveComponent("ColumnConfig"),_=t.resolveComponent("table-menu"),k=t.resolveComponent("columnRenderer"),O=t.resolveComponent("el-table"),D=t.resolveComponent("table-pagination"),F=t.resolveDirective("loading");return t.openBlock(),t.createElementBlock("div",Nl,[l.searchColumns&&l.searchColumns.length>0?(t.openBlock(),t.createBlock(r,{key:0,ref:"search",onSearch:a.search,onReset:a.reset,"onUpdate:searchForm":a.handleUpdateSearchForm,disabled:a.pageLoading,"search-columns":l.searchColumns,"search-form":l.searchForm,"label-width":l.labelWidth,"input-width":l.inputWidth,direction:l.direction,"label-align":l.labelAlign},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"search",{},void 0,!0)]),_:3},8,["onSearch","onReset","onUpdate:searchForm","disabled","search-columns","search-form","label-width","input-width","direction","label-align"])):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"between-search-menu",{},void 0,!0),l.showMenu?(t.openBlock(),t.createBlock(_,{key:1},{left:t.withCtx(()=>[t.renderSlot(e.$slots,"menu-left",{},void 0,!0)]),right:t.withCtx(()=>[t.renderSlot(e.$slots,"menu-right",{},void 0,!0),l.refreshButton&&typeof l.data=="function"?(t.openBlock(),t.createBlock(u,t.mergeProps({key:0,content:n.t("refresh"),placement:"top"},n.afterOpenDelay),{default:t.withCtx(()=>[t.createVNode(h,{onClick:a.handleRefresh,circle:"",size:n.getDefaultSize()},{default:t.withCtx(()=>[t.createVNode(d)]),_:1},8,["onClick","size"])]),_:1},16,["content"])):t.createCommentVNode("",!0),l.columnSettingButton?(t.openBlock(),t.createBlock(p,{key:1,maxFixedLeftQuantity:l.maxFixedLeftQuantity,maxFixedRightQuantity:l.maxFixedRightQuantity,tableKey:a.computedTableKey,columns:n.originalColumns,onComplete:a.handleColumnConfigComplete},null,8,["maxFixedLeftQuantity","maxFixedRightQuantity","tableKey","columns","onComplete"])):t.createCommentVNode("",!0)]),_:3})):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"between-menu-table",{},void 0,!0),t.withDirectives((t.openBlock(),t.createBlock(O,t.mergeProps({ref:"table"},T(g({},e.$attrs),{border:l.border}),t.toHandlers(n.isVue2?e.$listeners:{}),{data:n.tableData,height:n.tableHeight,size:n.getCompatSize("mini"),onSelectionChange:a.handleSelectionChange,key:n.tableReload}),{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.displayColumns,s=>(t.openBlock(),t.createBlock(k,{vnode:s,key:`${n.isVue3?s.id:s.data.attrs.prop}-${n.slotsUpdateTrigger}`},null,8,["vnode"]))),128))]),_:1},16,["data","height","size","onSelectionChange"])),[[F,a.pageLoading]]),t.renderSlot(e.$slots,"between-table-pagination",{},void 0,!0),a.computedShowPagination?(t.openBlock(),t.createBlock(D,{key:2,ref:"tmPagination","page-size":n.paginationInfo.pageSize,current:n.paginationInfo.current,total:n.paginationInfo.total,disabled:n.tableLoading,onSizeChange:a.handleSizeChange,onCurrentChange:a.handleCurrentChange},{"pagination-left":t.withCtx(()=>[t.renderSlot(e.$slots,"pagination-left",{},void 0,!0)]),_:3},8,["page-size","current","total","disabled","onSizeChange","onCurrentChange"])):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"after-pagination",{},void 0,!0)],512)}const ee=b(Bl,[["render",El],["__scopeId","data-v-732947c2"]]),Ol=!1,Dl=!0,Al={name:"TmTableColumn",inheritAttrs:!1,computed:{isVisible(){return this.$attrs.visible!==!1},slots(){return this.$slots}},data(){return{isVue2:Ol,isVue3:Dl}},created(){this.$parent&&this.$parent.$emit&&this.$parent.$emit("column-initialized",{prop:this.$attrs.prop,visible:this.$attrs.visible!==!1})}};function Ml(e,i,l,o,n,a){const r=t.resolveComponent("el-table-column");return a.isVisible?(t.openBlock(),t.createBlock(r,t.mergeProps({key:0},e.$attrs,t.toHandlers(n.isVue2?e.$listeners:{})),t.createSlots({_:2},[t.renderList(a.slots,(d,h)=>({name:h,fn:t.withCtx(u=>[t.renderSlot(e.$slots,h,t.normalizeProps(t.guardReactiveProps(u)))])}))]),1040)):t.createCommentVNode("",!0)}const te=b(Al,[["render",Ml]]),{t:le}=x(),Hl={name:"TmAdvancedEllipsisText",components:{CopyIcon:ae},props:{rows:{type:Number,default:1},width:{type:String,default:"100%"},maxWidth:{type:String,default:""},showToolbar:{type:Boolean,default:!1},text:{type:String,default:""},showTooltip:{type:Boolean,default:!0},copyable:{type:Boolean,default:!1}},data(){return{isVue2:!1,originalText:"",isHovered:!1,lineHeight:0,containerWidth:0,resizeObserver:null,isCalculating:!1,frontLines:[],lastLineText:"",isLastLineEllipsis:!1,tableRowElement:null}},computed:{containerStyle(){const e={};return this.maxWidth?(e.maxWidth=this.maxWidth,e.width=this.width):e.width=this.width,e},hasToolbarSlot(){return this.$slots.toolbar?this.$slots.toolbar&&this.$slots.toolbar().length>0:!1},hasToolbarContent(){return this.copyable||this.hasToolbarSlot},shouldShowToolbar(){return this.showToolbar||this.isHovered&&this.hasToolbarContent}},mounted(){this.initComponent(),this.setupResizeObserver(),this.setupTableRowHover()},updated(){const e=this.getTextContent();e!==this.originalText&&(this.originalText=e,this.$nextTick(()=>{this.calculateLayout()}))},beforeDestroy(){this.cleanupResizeObserver(),this.cleanupTableRowHover()},beforeUnmount(){this.cleanupResizeObserver(),this.cleanupTableRowHover()},watch:{text:{handler(){this.$nextTick(()=>{this.originalText=this.getTextContent(),this.calculateLayout()})},immediate:!0},rows(){this.$nextTick(()=>{this.calculateLayout()})},shouldShowToolbar(){this.$nextTick(()=>{this.calculateLayout()})},"$slots.default":{handler(){this.$nextTick(()=>{this.originalText=this.getTextContent(),this.calculateLayout()})},deep:!0}},methods:{initComponent(){this.$nextTick(()=>{this.originalText=this.getTextContent(),this.calculateLineHeight(),this.$nextTick(()=>{this.calculateLayout()})})},handleCopy(){navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(this.originalText).then(()=>{this.$message.success(le("copySuccess"))}).catch(()=>{this.fallbackCopy()}):this.fallbackCopy()},fallbackCopy(){const e=document.createElement("textarea");e.value=this.originalText,e.style.position="fixed",e.style.left="-999999px",e.style.top="-999999px",document.body.appendChild(e),e.focus(),e.select();try{document.execCommand("copy"),this.$message.success(le("copySuccess"))}catch(i){this.$message.error(le("copyFailed"))}document.body.removeChild(e)},getTextContent(){if(this.$slots.default){const e=this.$slots.default;return e().map(i=>typeof i.children=="string"?i.children:Array.isArray(i.children)?i.children.map(l=>l.children||"").join(""):"").join("")}return this.text||""},calculateLineHeight(){const e=this.$refs.containerRef;if(!e)return;const i=window.getComputedStyle(e);this.containerWidth=e.offsetWidth;const l=this.$refs.measureRef;if(l){this.setMeasureElementStyle(l,{width:this.containerWidth+"px",wordBreak:"break-all",whiteSpace:"normal"}),l.textContent="测",l.offsetHeight;const o=l.offsetHeight;l.innerHTML="",this.lineHeight=o}else{const o=i.lineHeight;if(o&&o!=="normal")this.lineHeight=parseInt(o);else{const n=parseInt(i.fontSize);this.lineHeight=n*1.2}}},calculateLayout(){if(!this.isCalculating){if(!this.originalText||this.rows<=0){this.frontLines=[],this.lastLineText=this.originalText||"",this.isLastLineEllipsis=!1;return}this.isCalculating=!0,this.$nextTick(()=>{requestAnimationFrame(()=>{this.performLayoutCalculation()})})}},performLayoutCalculation(){const e=this.originalText;if(this.rows===1)this.frontLines=[],this.lastLineText=e,this.isLastLineEllipsis=this.checkIfTextOverflows(e);else{const i=this.lineHeight;if(this.getTextHeight(e)<=i)this.frontLines=[],this.lastLineText=e,this.isLastLineEllipsis=this.checkIfTextOverflows(e);else{const o=this.lineHeight*(this.rows-1),n=this.findTextForHeight(e,o);this.frontLines=this.splitTextToLines(n);const a=e.substring(n.length);this.lastLineText=a,this.isLastLineEllipsis=a.length>0&&this.checkIfTextOverflows(a)}}this.isCalculating=!1},findTextForHeight(e,i){if(this.getTextHeight(e)<=i)return e;let l=0,o=e.length,n="";for(;l<=o;){const a=Math.floor((l+o)/2),r=e.substring(0,a);this.getTextHeight(r)<=i?(n=r,l=a+1):o=a-1}return n},splitTextToLines(e){if(!e)return[];const i=[];let l=e;for(;l.length>0;){const o=this.findTextForHeight(l,this.lineHeight);if(o.length===0)break;i.push(o),l=l.substring(o.length)}return i},checkIfTextOverflows(e){if(!e)return!1;const i=this.getTextWidth(e),l=this.shouldShowToolbar&&this.hasToolbarContent?this.getToolbarWidth():0,o=this.containerWidth-l-5;return i>o},getToolbarWidth(){let e=0;return this.copyable&&(e+=20),this.hasToolbarSlot&&(e+=40),e},getTextHeight(e){return this.measureText(e,{width:this.containerWidth+"px",wordBreak:"break-all",whiteSpace:"normal"})},getTextWidth(e){return this.measureText(e,{whiteSpace:"nowrap"})},measureText(e,i={}){if(!this.$refs.containerRef||!this.$refs.measureRef)return 0;const l=this.$refs.measureRef,o=l.style.cssText;this.setMeasureElementStyle(l,i),l.textContent=e,l.offsetHeight;const n=i.whiteSpace==="nowrap"?l.offsetWidth:l.offsetHeight;return l.style.cssText=o,l.innerHTML="",n},setMeasureElementStyle(e,i={}){const l=window.getComputedStyle(this.$refs.containerRef);e.style.cssText="",e.style.position="absolute",e.style.left="-9999px",e.style.top="-9999px",e.style.visibility="hidden",e.style.pointerEvents="none",e.style.zIndex="-1",e.style.fontSize=l.fontSize,e.style.fontFamily=l.fontFamily,e.style.fontWeight=l.fontWeight,e.style.lineHeight=l.lineHeight,e.style.letterSpacing=l.letterSpacing,e.style.wordSpacing=l.wordSpacing,e.style.padding="0",e.style.margin="0",e.style.border="none",e.style.boxSizing="border-box",Object.entries(i).forEach(([o,n])=>{e.style[o]=n})},handleMouseEnter(){this.isHovered=!0},handleMouseLeave(){this.isHovered=!1},setupResizeObserver(){typeof ResizeObserver!="undefined"&&(this.resizeObserver=new ResizeObserver(e=>{const i=e[0];if(i){const l=i.contentRect.width;Math.abs(l-this.containerWidth)>1&&requestAnimationFrame(()=>{this.calculateLineHeight(),this.calculateLayout()})}}),this.$refs.containerRef&&this.resizeObserver.observe(this.$refs.containerRef))},cleanupResizeObserver(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)},setupTableRowHover(){let e=this.$el;for(;e&&e!==document.body;){if(e.classList&&e.classList.contains("el-table__row")){this.tableRowElement=e;break}e=e.parentElement}this.tableRowElement&&(this.tableRowElement.addEventListener("mouseenter",this.handleMouseEnter),this.tableRowElement.addEventListener("mouseleave",this.handleMouseLeave))},cleanupTableRowHover(){this.tableRowElement&&(this.tableRowElement.removeEventListener("mouseenter",this.handleMouseEnter),this.tableRowElement.removeEventListener("mouseleave",this.handleMouseLeave),this.tableRowElement=null)}}},Rl={class:"tm-ellipsis-text-wrapper"},Il=["innerHTML"],vl={class:"tm-ellipsis-last-line"},Pl=["innerHTML"],Wl={key:0,class:"tm-ellipsis-toolbar-part"},Ul={key:1,class:"tm-ellipsis-text-wrapper"},jl=["innerHTML"],Jl={class:"tm-ellipsis-last-line"},Kl=["innerHTML"],Ql={key:0,class:"tm-ellipsis-toolbar-part"},ql={ref:"measureRef",class:"tm-ellipsis-measure"};function Yl(e,i,l,o,n,a){const r=t.resolveComponent("CopyIcon"),d=t.resolveComponent("el-tooltip");return t.openBlock(),t.createElementBlock("div",{ref:"containerRef",style:t.normalizeStyle(a.containerStyle),class:"tm-ellipsis-text",onMouseenter:i[0]||(i[0]=(...h)=>a.handleMouseEnter&&a.handleMouseEnter(...h)),onMouseleave:i[1]||(i[1]=(...h)=>a.handleMouseLeave&&a.handleMouseLeave(...h))},[l.showTooltip&&n.isLastLineEllipsis?(t.openBlock(),t.createBlock(d,t.mergeProps({key:0,content:n.originalText,disabled:!l.showTooltip||!n.isLastLineEllipsis},{[n.isVue2?"open-delay":"show-after"]:300},{placement:"top"}),{default:t.withCtx(()=>[t.createElementVNode("div",Rl,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.frontLines,(h,u)=>(t.openBlock(),t.createElementBlock("div",{key:"front-"+u,class:"tm-ellipsis-line",innerHTML:h},null,8,Il))),128)),t.createElementVNode("div",vl,[t.createElementVNode("div",{class:"tm-ellipsis-text-part",innerHTML:n.lastLineText},null,8,Pl),a.shouldShowToolbar&&a.hasToolbarContent?(t.openBlock(),t.createElementBlock("div",Wl,[l.copyable?(t.openBlock(),t.createBlock(r,{key:0,class:"icon-item",onClick:a.handleCopy},null,8,["onClick"])):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"toolbar",{},void 0,!0)])):t.createCommentVNode("",!0)])])]),_:3},16,["content","disabled"])):(t.openBlock(),t.createElementBlock("div",Ul,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.frontLines,(h,u)=>(t.openBlock(),t.createElementBlock("div",{key:"front-"+u,class:"tm-ellipsis-line",innerHTML:h},null,8,jl))),128)),t.createElementVNode("div",Jl,[t.createElementVNode("div",{class:"tm-ellipsis-text-part",innerHTML:n.lastLineText},null,8,Kl),a.shouldShowToolbar&&a.hasToolbarContent?(t.openBlock(),t.createElementBlock("div",Ql,[l.copyable?(t.openBlock(),t.createBlock(r,{key:0,class:"icon-item",onClick:a.handleCopy},null,8,["onClick"])):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"toolbar",{},void 0,!0)])):t.createCommentVNode("",!0)])])),t.createElementVNode("div",ql,null,512)],36)}const ie=b(Hl,[["render",Yl],["__scopeId","data-v-14f27c2e"]]),me={install:{install(e,i={}){[ee,te,N,ie].forEach(l=>e.component(l.name,l)),i.tableConfigProvider&&nl(i.tableConfigProvider),i.lang&&H(i.lang||"zh-CN")}}.install,Table:ee,Column:te,Search:Z,Select:U,Input:j,Date:J,Cascader:K,Radio:Q,Checkbox:q,Switch:Y,Textarea:X,EllipsisText:N,AdvancedEllipsisText:ie,setLang:H,useLocale:x};typeof window!="undefined"&&window.Vue&&me.install(window.Vue),m.AdvancedEllipsisText=ie,m.Cascader=K,m.Checkbox=q,m.Column=te,m.Date=J,m.EllipsisText=N,m.Input=j,m.Radio=Q,m.Search=Z,m.Select=U,m.Switch=Y,m.Table=ee,m.Textarea=X,m.default=me,m.setLang=H,m.useLocale=x,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(m,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue"),require("@element-plus/icons-vue"),require("sortablejs")):typeof define=="function"&&define.amd?define(["exports","vue","@element-plus/icons-vue","sortablejs"],t):(m=typeof globalThis!="undefined"?globalThis:m||self,t(m.TmTable={},m.Vue,m.ElementPlusIconsVue,m.Sortable))})(this,function(m,t,y,f){"use strict";var Gl=Object.defineProperty,Xl=Object.defineProperties;var Zl=Object.getOwnPropertyDescriptors;var P=Object.getOwnPropertySymbols;var fe=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable;var pe=(m,t,y)=>t in m?Gl(m,t,{enumerable:!0,configurable:!0,writable:!0,value:y}):m[t]=y,g=(m,t)=>{for(var y in t||(t={}))fe.call(t,y)&&pe(m,y,t[y]);if(P)for(var y of P(t))ge.call(t,y)&&pe(m,y,t[y]);return m},T=(m,t)=>Xl(m,Zl(t));var be=(m,t)=>{var y={};for(var f in m)fe.call(m,f)&&t.indexOf(f)<0&&(y[f]=m[f]);if(m!=null&&P)for(var f of P(m))t.indexOf(f)<0&&ge.call(m,f)&&(y[f]=m[f]);return y};const ne={mini:"small",small:"small",default:"default",large:"large"},B=e=>ne[e]||ne.default,S=()=>"default",ye={"zh-CN":{today:"今天",yesterday:"昨天",last7days:"最近7天",last30days:"最近30天",thisMonth:"本月",lastMonth:"上月",checkAll:"全选",search:"搜索",query:"查询",reset:"重置",columnSetting:"列设置",refresh:"刷新",cancel:"取消",fixedLeft:"固定在左侧",fixedRight:"固定在右侧",top:"置顶",restoreDefault:"恢复默认",saveAndApply:"保存并应用",startDate:"开始日期",endDate:"结束日期",all:"全选",SelectableFields:"可选择字段",fixedColumns:"固定列",leftmost:"左侧最多",rightmost:"右侧最多",items:"项",accurateSearchTips:"每行一个,支持多个值",accurateSearchPlaceholder:"精确搜索,一行一项",selectPlaceholder:"请选择",clear:"清空",saveSuccess:"保存成功",cancelRightFixed:"取消右侧固定",rightFixed:"固定到右侧",cancelLeftFixed:"取消左侧固定",leftFixed:"固定到左侧",cancelTop:"取消置顶",copySuccess:"复制成功",copyFailed:"复制失败"},"en-US":{today:"Today",yesterday:"Yesterday",last7days:"Last 7 days",last30days:"Last 30 days",thisMonth:"This month",lastMonth:"Last month",checkAll:"Check all",search:"Search",query:"Search",reset:"Reset",columnSetting:"Column Setting",refresh:"Refresh",cancel:"Cancel",fixedLeft:"Fixed left",fixedRight:"Fixed right",top:"Top",restoreDefault:"Restore default",saveAndApply:"Save and apply",startDate:"Start date",endDate:"End date",all:"All",SelectableFields:"Fields",fixedColumns:"Fixed columns",leftmost:"Leftmost",rightmost:"Rightmost",items:"item(s)",accurateSearchTips:"One per line, supporting multiple values",accurateSearchPlaceholder:"Accurate search, one per line",selectPlaceholder:"Please select",clear:"Clear",saveSuccess:"Successfully saved",cancelRightFixed:"Cancel right fixed",rightFixed:"Fixed to right",cancelLeftFixed:"Cancel left fixed",leftFixed:"Fixed to left",cancelTop:"Cancel top",copySuccess:"Copy successfully",copyFailed:"Copy failed"}};let M={value:"zh-CN"};M=t.ref("zh-CN");const Ce=e=>{var i;return((i=ye[M.value])==null?void 0:i[e])||e},H=e=>{M.value=e},x=()=>({t:Ce,setLang:H,currentLang:M}),b=(e,i)=>{const l=e.__vccOpts||e;for(const[o,n]of i)l[o]=n;return l},_e={name:"BaseIcon",props:{path:{type:String},size:{type:[String,Number]},color:{type:String}},methods:{handleClick(){}}},Se=["width","height"],xe=["d"];function Ve(e,i,l,o,n,a){return t.openBlock(),t.createElementBlock("i",{class:"tm-icon",onClick:i[0]||(i[0]=(...r)=>a.handleClick&&a.handleClick(...r))},[(t.openBlock(),t.createElementBlock("svg",{width:l.size,height:l.size,style:t.normalizeStyle({color:l.color}),viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:l.path},null,8,xe)],12,Se))])}const ke=b(_e,[["render",Ve],["__scopeId","data-v-1c30ca93"]]),V=Object.entries({menu:"M160 448a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zM160 896a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32z",more:"M76.92892277 192.94787572h864.34120754c23.20379058 0 46.40758118-17.40284367 46.40758118-46.40758118s-23.20379058-46.40758118-46.40758118-46.40758116H76.92892277c-29.00473897 0-46.40758264 17.40284367-46.40758264 46.40758116s23.20379058 46.40758118 46.40758264 46.40758118zM941.27013031 465.59241882H76.92892277c-29.00473897 0-46.40758264 17.40284367-46.40758264 46.40758118s23.20379058 46.40758118 46.40758264 46.40758118h864.34120754c23.20379058 0 46.40758118-17.40284367 46.40758118-46.40758118s-23.20379058-46.40758118-46.40758118-46.40758118zM941.27013031 825.25117589H76.92892277c-29.00473897 0-46.40758264 17.40284367-46.40758264 46.40758118s23.20379058 46.40758118 46.40758264 46.40758264h864.34120754c23.20379058 0 46.40758118-17.40284367 46.40758118-46.40758264s-23.20379058-46.40758118-46.40758118-46.40758118z",refresh:"M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z",move:"M238.93333333 102.4a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m409.6 0a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0zM238.93333333 375.46666667a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m409.6 0a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m-409.6 273.06666666a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m409.6 0a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m-341.33333333 204.8a68.26666667 68.26666667 0 1 0 0 136.53333334 68.26666667 68.26666667 0 0 0 0-136.53333334z m341.33333333 68.26666667a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z","column-setting":"M436.05333334 18.36373333a109.22666667 109.22666667 0 0 1 109.22666666 0l345.56586667 199.54346667c33.792 19.52426667 54.61333333 55.56906667 54.61333333 94.54933333V580.26666667h-81.92V312.45653333a27.30666667 27.30666667 0 0 0-13.65333333-23.62026666L504.32 89.2928a27.30666667 27.30666667 0 0 0-27.30666666 0L131.44746667 288.83626667a27.30666667 27.30666667 0 0 0-13.65333333 23.62026666v399.08693334a27.30666667 27.30666667 0 0 0 13.65333333 23.62026666L477.01333334 934.7072a27.30666667 27.30666667 0 0 0 27.30666666 0l54.61333334-31.5392v94.54933333l-13.65333334 7.91893334a109.22666667 109.22666667 0 0 1-109.22666666 0l-345.56586667-199.54346667a109.22666667 109.22666667 0 0 1-54.61333333-94.54933333V312.45653333c0-38.98026667 20.82133333-75.09333333 54.61333333-94.54933333L436.05333334 18.36373333z","fixed-left":"M843.36363653 311.54545478l-53.18181827 1e-8-20.45454521 28.63636347-163.63636435 204.54545479-24.54545391 28.63636347 12.27272695 36.81818175c8.18181826 28.63636347 12.27272695 57.27272695 12.27272696 85.90909042 0 32.72727305-4.09090869 61.36363652-16.36363565 90-4.09090869 16.36363653-12.27272695 32.72727306-24.54545479 49.09090957l-163.63636347-163.63636347-40.90909131-40.90909132-12.27272695-12.27272695-163.63636348-163.63636347c28.63636347-16.36363653 61.36363652-28.63636347 94.09090869-32.72727305 45-8.18181826 90-4.09090869 134.99999999 8.18181826l36.81818175 12.27272695 28.63636347-24.54545391 204.54545479-163.63636435 28.63636347-16.36363564 0-32.72727305L712.45454521 184.72727305l130.90909132 126.81818173zM941.54545479 327.90909131c0-8.18181826-4.09090869-16.36363653-8.18181826-24.54545478L720.63636348 94.72727305c-12.27272695-16.36363653-36.81818174-12.27272695-49.09090869 4.0909087-20.45454521 28.63636347-28.63636347 65.45454521-28.63636348 98.18181825l0 4.09090869-204.54545478 163.63636436c-110.45454521-36.81818174-233.18181826-16.36363653-327.27272784 61.36363564-8.18181826 8.18181826-12.27272695 16.36363653-12.27272694 24.54545478 0 8.18181826 4.09090869 16.36363653 8.18181825 24.5454548l196.36363653 196.36363652-212.72727305 212.72727216c-4.09090869 4.09090869-8.18181826 12.27272695-8.18181826 20.4545461s4.09090869 16.36363653 8.18181826 20.4545452c12.27272695 12.27272695 32.72727306 12.27272695 45 1e-8L352.45454522 716.54545479l196.36363652 196.36363652c12.27272695 12.27272695 36.81818174 12.27272695 49.09090957-4.09090957C651.09090869 847.45454521 675.63636347 773.81818174 675.63636346 696.09090869c0-36.81818173-4.09090869-73.63636348-16.36363651-106.36363564l163.63636436-204.54545479c36.81818173 0 73.63636348-8.18181826 106.36363564-28.63636347C937.45454519 348.36363653 941.54545478 336.09090869 941.54545479 327.90909131z","fixed-right":"M311.54545479 180.63636347v53.18181827l28.63636347 20.45454521 204.54545479 163.63636436 28.63636347 24.5454539 36.81818174-12.27272695c28.63636347-8.18181826 57.27272695-12.27272695 85.90909043-12.27272695 32.72727305 0 61.36363652 4.09090869 90 16.36363564 16.36363653 4.09090869 32.72727305 12.27272695 49.09090957 24.54545479l-163.63636347 163.63636347-40.90909132 40.90909131-12.27272695 12.27272695-163.63636347 163.63636348c-16.36363653-28.63636347-28.63636347-61.36363652-32.72727305-94.09090869-8.18181826-45-4.09090869-90 8.18181826-135l12.27272695-36.81818174-24.5454539-28.63636347-163.63636436-204.54545479-16.36363564-28.63636347h-32.72727305H184.72727305l126.81818174-130.90909132zM327.90909131 82.45454521c-8.18181826 0-16.36363653 4.09090869-24.54545478 8.18181826L94.72727305 303.36363652c-16.36363653 12.27272695-12.27272695 36.81818174 4.09090869 49.09090869 28.63636347 20.45454521 65.45454521 28.63636347 98.18181826 28.63636348h4.09090869l163.63636436 204.54545478c-36.81818174 110.45454521-16.36363653 233.18181826 61.36363564 327.27272784 8.18181826 8.18181826 16.36363653 12.27272695 24.54545478 12.27272695 8.18181826 0 16.36363653-4.09090869 24.54545479-8.18181826l196.36363653-196.36363653 212.72727216 212.72727305c4.09090869 4.09090869 12.27272695 8.18181826 20.4545461 8.18181827s16.36363653-4.09090869 20.45454521-8.18181827c12.27272695-12.27272695 12.27272695-32.72727305 0-45L716.54545479 671.54545479l196.36363652-196.36363653c12.27272695-12.27272695 12.27272695-36.81818174-4.09090957-49.09090957C847.45454521 372.90909131 773.81818174 348.36363653 696.09090869 348.36363653c-36.81818174 0-73.63636348 4.09090869-106.36363564 16.36363652l-204.54545479-163.63636436c0-36.81818174-8.18181826-73.63636348-28.63636347-106.36363564C348.36363653 86.54545479 336.09090869 82.45454521 327.90909131 82.45454521z",upload:"M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248z",download:"M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64z",delete:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32",copy:"M128 320v576h576V320zm-32-64h640a32 32 0 0 1 32 32v640a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V288a32 32 0 0 1 32-32M960 96v704a32 32 0 0 1-32 32h-96v-64h64V128H384v64h-64V96a32 32 0 0 1 32-32h576a32 32 0 0 1 32 32M256 672h320v64H256zm0-192h320v64H256z"}).reduce((e,[i,l])=>{const o=`${i}Icon`,n={name:o,props:{path:{type:String,default:l},size:{type:[String,Number]},color:{type:String}},render(a){return t.h(ke,this.$props)}};return n.install=a=>{a.component(o,n)},e[i]=n,e},{}),we=V.menu,Te=V.refresh,Fe=V.move;V["column-setting"];const ze=V.more,Le=V["fixed-left"],Be=V["fixed-right"],Ne=V.upload,Oe=V.download,Ee=V.delete,ae=V.copy,{t:W}=x(),De=!1,Ae=!0,Me={name:"TmEllipsisText",components:{CopyIcon:ae},props:{text:{type:String,required:!0},width:{type:[String,Number],default:"auto"},maxWidth:{type:[String,Number],default:"100%"},lines:{type:Number,default:1},showTooltip:{type:Boolean,default:!0},lineHeight:{type:[String,Number]},copyable:{type:Boolean,default:!1},textAlign:{type:String,default:"left"}},data(){return{isVue2:De,isVue3:Ae,isOverflow:!1,currentLines:1,resizeObserver:null,checkingOverflow:!1,checkRetryCount:0}},computed:{tooltipDisabled(){return!this.showTooltip||!this.isOverflow},textStyle(){const e=typeof this.width=="number"?`${this.width}px`:this.width,i=typeof this.maxWidth=="number"?`${this.maxWidth}px`:this.maxWidth;return{width:e,maxWidth:i,lineHeight:this.lineHeight,display:"-webkit-inline-box",overflow:"hidden",WebkitBoxOrient:"vertical",WebkitLineClamp:this.lines,textAlign:this.textAlign}}},mounted(){this.checkOverflow(),this.setupResizeObserver()},beforeDestroy(){this.cleanupResizeObserver()},beforeUnmount(){this.cleanupResizeObserver()},watch:{text(){this.checkRetryCount=0,this.$nextTick(this.checkOverflow)}},methods:{checkOverflow(){!this.$refs.textEl||this.checkingOverflow||(this.checkingOverflow=!0,this.$nextTick(()=>{this.$nextTick(()=>{this.performOverflowCheck(),this.checkingOverflow=!1})}))},performOverflowCheck(){var u;const e=this.$refs.textEl;if(!e)return;const i=getComputedStyle(e);if(!i.width||i.width==="0px"){this.checkRetryCount<5?(this.checkRetryCount++,this.$nextTick(()=>{this.performOverflowCheck()})):(this.isOverflow=!1,this.currentLines=1,this.checkRetryCount=0);return}this.checkRetryCount=0;const l=e.scrollHeight,o=e.scrollWidth,n=e.clientHeight,a=e.clientWidth,r=1,d=l>n+r,h=o>a+r;if(d||h){this.isOverflow=!0;const p=parseFloat(i.lineHeight)||16;this.currentLines=Math.ceil(l/p)}else{const p=e.getBoundingClientRect(),_=(u=e.parentElement)==null?void 0:u.getBoundingClientRect();if(_){const k=p.height>_.height||p.width>_.width;this.isOverflow=k}else this.isOverflow=!1;this.currentLines=1}},setupResizeObserver(){window.ResizeObserver&&this.$nextTick(()=>{try{this.resizeObserver=new ResizeObserver(()=>{this.checkOverflow()});const e=this.$el;e&&e instanceof Element&&this.resizeObserver.observe(e)}catch(e){console.warn("Failed to setup ResizeObserver:",e)}})},cleanupResizeObserver(){if(this.resizeObserver)try{this.resizeObserver.disconnect()}catch(e){console.warn("Failed to disconnect ResizeObserver:",e)}finally{this.resizeObserver=null}},handleCopy(){navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(this.text).then(()=>{this.$message.success(W("copySuccess"))}).catch(()=>{this.fallbackCopy()}):this.fallbackCopy()},fallbackCopy(){const e=document.createElement("textarea");e.value=this.text,e.style.position="fixed",e.style.left="-999999px",e.style.top="-999999px",document.body.appendChild(e),e.focus(),e.select();try{document.execCommand("copy"),this.$message.success(W("copySuccess"))}catch(i){this.$message.error(W("copyFailed"))}document.body.removeChild(e)}}},He={class:"ellipsis-text-container"};function Re(e,i,l,o,n,a){const r=t.resolveComponent("CopyIcon"),d=t.resolveComponent("el-tooltip");return t.openBlock(),t.createBlock(d,t.mergeProps({disabled:a.tooltipDisabled,content:l.text,effect:"dark",placement:"top"},{[n.isVue2?"open-delay":"show-after"]:300}),{default:t.withCtx(()=>[t.createElementVNode("div",He,[t.createElementVNode("div",{ref:"textEl",class:"ellipsis-text",style:t.normalizeStyle(a.textStyle)},t.toDisplayString(l.text),5),t.createElementVNode("div",{class:t.normalizeClass(["toolbar",{multiline:n.currentLines>1&&l.lines>1}])},[l.copyable?(t.openBlock(),t.createBlock(r,{key:0,class:"icon-item",onClick:a.handleCopy},null,8,["onClick"])):t.createCommentVNode("",!0)],2)])]),_:1},16,["disabled","content"])}const N=b(Me,[["render",Re],["__scopeId","data-v-a18ee09f"]]);var ve=Object.defineProperty,Ie=Object.defineProperties,Pe=Object.getOwnPropertyDescriptors,oe=Object.getOwnPropertySymbols,We=Object.prototype.hasOwnProperty,Ue=Object.prototype.propertyIsEnumerable,se=(e,i,l)=>i in e?ve(e,i,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[i]=l,re=(e,i)=>{for(var l in i||(i={}))We.call(i,l)&&se(e,l,i[l]);if(oe)for(var l of oe(i))Ue.call(i,l)&&se(e,l,i[l]);return e},de=(e,i)=>Ie(e,Pe(i));const je={name:"RenderVue3",inheritAttrs:!1},Je=t.defineComponent(de(re({},je),{props:{renderFn:{type:Function},data:{}},setup(e){const i=e,l=t.useAttrs(),o=t.useSlots(),n=t.computed(()=>de(re({},i.data||{}),{$attrs:l,$slots:o})),a=t.computed(()=>{try{if(!i.renderFn||typeof i.renderFn!="function")return console.warn("[RenderComponent] renderFn must be a function"),null;const r=i.renderFn.toString(),d=/\(\s*h\s*[,)]/.test(r)||i.renderFn.length>=1;let h;return d?h=i.renderFn(t.h,n.value):h=i.renderFn(n.value),h}catch(r){return console.error("[RenderComponent] Error in render function:",r),null}});return(r,d)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(a.value)))}})),Ke=!1,Qe=!0,qe={name:"FormItemLayout",components:{EllipsisText:N,RenderComponent:Je},props:{direction:{type:String,default:"horizontal",validator:e=>["horizontal","vertical"].includes(e)},labelWidth:{type:[String,Number],default:120},inputWidth:{type:[String,Number],default:240},label:{type:[String,Function,Object,Array],default:""},labelOptions:{type:Array,default:()=>[]},field:{type:[String,Number],default:""},labelAlign:{type:String,default:"right",validator:e=>["left","right","center"].includes(e)}},data(){return{t:x().t,isVue2:Ke,isVue3:Qe,getDefaultSize:S}},computed:{hasLabel(){return this.labelOptions&&this.labelOptions.length||this.label},containerStyle(){const e={};if(this.direction==="horizontal"){const i=this.hasLabel?this.parsedLabelWidth+this.parsedInputWidth:this.parsedInputWidth;e.width=`${i}px`}else e.width=`${this.parsedInputWidth}px`;return e},labelStyle(){const e={};return this.direction==="horizontal"?e.width=`${this.parsedLabelWidth}px`:e.width=`${this.parsedInputWidth}px`,e},inputStyle(){return{width:`${this.parsedInputWidth}px`}},parsedLabelWidth(){return typeof this.labelWidth=="string"?parseInt(this.labelWidth):this.labelWidth},parsedInputWidth(){return typeof this.inputWidth=="string"?parseInt(this.inputWidth):this.inputWidth},fieldValue:{get(){return this.field},set(e){this.$emit("field-change",e)}}},watch:{labelOptions:{handler(e){e&&e.length>0&&!this.field&&this.$emit("field-change",e[0].value)},deep:!0,immediate:!0}},methods:{handleFieldChange(e){this.$emit("field-change",e)}}},Ye={key:0,class:"label-text"},Ge={key:1,class:"label-render"};function Xe(e,i,l,o,n,a){const r=t.resolveComponent("el-option"),d=t.resolveComponent("el-select"),h=t.resolveComponent("EllipsisText"),u=t.resolveComponent("RenderComponent");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["form-item-layout",{"form-item-layout--horizontal":l.direction==="horizontal","form-item-layout--vertical":l.direction==="vertical"}]),style:t.normalizeStyle(a.containerStyle)},[a.hasLabel?(t.openBlock(),t.createElementBlock("div",{key:0,class:"form-item-label",style:t.normalizeStyle(a.labelStyle)},[l.labelOptions&&l.labelOptions.length?(t.openBlock(),t.createBlock(d,{key:0,modelValue:a.fieldValue,"onUpdate:modelValue":i[0]||(i[0]=p=>a.fieldValue=p),placeholder:n.t("selectPlaceholder"),size:n.getDefaultSize(),class:"label-select",onChange:a.handleFieldChange},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.labelOptions,p=>(t.openBlock(),t.createBlock(r,{key:p.value,label:p.label,value:p.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","size","onChange"])):l.label?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[typeof l.label=="string"?(t.openBlock(),t.createElementBlock("div",Ye,[t.createVNode(h,{text:l.label,lines:2,width:l.labelWidth-4,"text-align":l.labelAlign},null,8,["text","width","text-align"])])):typeof l.label=="function"?(t.openBlock(),t.createElementBlock("div",Ge,[t.createVNode(u,{"render-fn":l.label},null,8,["render-fn"])])):t.createCommentVNode("",!0)],64)):t.createCommentVNode("",!0)],4)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"form-item-input",style:t.normalizeStyle(a.inputStyle)},[t.renderSlot(e.$slots,"default",{},void 0,!0)],4)],6)}const w=b(qe,[["render",Xe],["__scopeId","data-v-f423d1ed"]]),Ze=!1,$e=!0,R="modelValue",et="update:modelValue",tt={name:"TmSelectFilter",components:{FormItemLayout:w},props:{[R]:{type:[String,Number,Array],default:""},field:{type:[String,Number],default:""},options:{type:[Array,Function],default:()=>[]},labelOptions:{type:Array,default:()=>[]},label:{type:[String,Function,Object,Array],default:null},props:{type:Object,default:()=>({label:"label",value:"value"})},filterable:{type:Boolean,default:!0},clearable:{type:Boolean,default:!0},collapseTags:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},showCheckAll:{type:Boolean,default:!0},placeholder:{type:String,default:""},valueOnClear:{type:[String,Number,Boolean,Array,Function],default:void 0},labelWidth:{type:[String,Number],default:void 0},inputWidth:{type:[String,Number],default:void 0},direction:{type:String,default:void 0,validator:e=>!e||["horizontal","vertical"].includes(e)},labelAlign:{type:String,default:"right",validator:e=>["left","right","center"].includes(e)}},data(){return{t:x().t,isVue2:Ze,isVue3:$e,getDefaultSize:S,optionsList:[],loading:!1,indeterminate:!1,checkAll:!1}},computed:{computedValue:{get(){return this[R]},set(e){let i=e;if(this.multiple&&Array.isArray(e)&&e.length===0&&this.valueOnClear!==void 0){const l=this[R];Array.isArray(l)&&l.length>0&&(i=typeof this.valueOnClear=="function"?this.valueOnClear():this.valueOnClear)}this.$emit(et,i),this.$emit("change",i)}},propMap(){return{label:this.props.label||"label",value:this.props.value||"value"}}},watch:{[R](e){!this.multiple||!this.showCheckAll||(e.length===0?(this.checkAll=!1,this.indeterminate=!1):e.length===this.optionsList.length?(this.checkAll=!0,this.indeterminate=!1):this.indeterminate=!0)}},created(){this.initOptions()},methods:{handleFieldChange(e){this.$emit("field-change",e)},async initOptions(){if(Array.isArray(this.options))this.optionsList=this.options;else if(typeof this.options=="function")try{this.loading=!0;const e=await this.options();Array.isArray(e)&&(this.optionsList=e)}catch(e){console.error(e)}finally{this.loading=!1}},handleCheckAll(e){this.indeterminate=!1;let i=[];e&&(i=this.optionsList.map(l=>l[this.propMap.value])),this.computedValue=i},handleClear(){if(this.valueOnClear!==void 0){const e=typeof this.valueOnClear=="function"?this.valueOnClear():this.valueOnClear;this.$nextTick(()=>{this.computedValue=e})}}}},lt={key:0,class:"check-all-option"};function it(e,i,l,o,n,a){const r=t.resolveComponent("el-checkbox"),d=t.resolveComponent("el-option"),h=t.resolveComponent("el-select"),u=t.resolveComponent("FormItemLayout");return t.openBlock(),t.createBlock(u,{label:l.label,"label-options":l.labelOptions,field:l.field,onFieldChange:a.handleFieldChange,"label-width":l.labelWidth,"input-width":l.inputWidth,direction:l.direction,"label-align":l.labelAlign},{default:t.withCtx(()=>[t.createVNode(h,t.mergeProps({ref:"select",class:"select",onClear:a.handleClear,modelValue:a.computedValue,"onUpdate:modelValue":i[2]||(i[2]=p=>a.computedValue=p)},T(g({},e.$attrs),{size:n.getDefaultSize(),filterable:l.filterable,clearable:l.clearable,collapseTags:l.collapseTags,multiple:l.multiple,placeholder:l.placeholder,loading:n.loading}),t.toHandlers(n.isVue2?e.$listeners:{}),{loading:n.loading}),{header:t.withCtx(()=>[n.isVue3&&l.multiple&&l.showCheckAll?(t.openBlock(),t.createBlock(r,{key:0,modelValue:n.checkAll,"onUpdate:modelValue":i[1]||(i[1]=p=>n.checkAll=p),indeterminate:n.indeterminate,size:n.getDefaultSize(),onChange:a.handleCheckAll,style:{width:"100%",height:"20px","padding-left":"10px"}},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.t("all")),1)]),_:1},8,["modelValue","indeterminate","size","onChange"])):t.createCommentVNode("",!0)]),default:t.withCtx(()=>[n.isVue2&&l.multiple&&l.showCheckAll?(t.openBlock(),t.createElementBlock("div",lt,[t.createVNode(r,{style:{width:"100%"},modelValue:n.checkAll,"onUpdate:modelValue":i[0]||(i[0]=p=>n.checkAll=p),indeterminate:n.indeterminate,size:n.getDefaultSize(),onChange:a.handleCheckAll},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.t("all")),1)]),_:1},8,["modelValue","indeterminate","size","onChange"])])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.optionsList,p=>(t.openBlock(),t.createBlock(d,{key:p[a.propMap.value],label:p[a.propMap.label],value:p[a.propMap.value],disabled:p.disabled},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"option",{item:p},()=>[t.createTextVNode(t.toDisplayString(p[a.propMap.label]),1)],!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:3},16,["onClear","modelValue","loading"])]),_:3},8,["label","label-options","field","onFieldChange","label-width","input-width","direction","label-align"])}const U=b(tt,[["render",it],["__scopeId","data-v-ef8f7987"]]),nt={name:"TmInputFilter",components:{MoreIcon:ze,FormItemLayout:w},props:{label:{type:[String,Function,Object,Array],default:""},value:{type:String,default:""},field:{type:[String,Number],default:""},placeholder:{type:String,default:""},multiple:{type:Boolean,default:!1},labelOptions:{type:Array,default:()=>[]},labelWidth:{type:[String,Number],default:void 0},inputWidth:{type:[String,Number],default:void 0},direction:{type:String,default:void 0,validator:e=>!e||["horizontal","vertical"].includes(e)},labelAlign:{type:String,default:"right",validator:e=>["left","right","center"].includes(e)}},data(){return{t:x().t,getDefaultSize:S,getCompatSize:B,exactValue:"",inputValue:"",isExactMode:!1,currentOptionMultiple:!1}},computed:{shouldShowMultiple(){return this.currentOptionMultiple!==null?this.currentOptionMultiple:this.multiple},selectedOption(){return!this.labelOptions||!this.labelOptions.length||!this.field?null:this.labelOptions.find(e=>e.value===this.field)}},watch:{isExactMode(e){e?this.$emit("value-change",this.exactValue):this.$emit("value-change",this.inputValue)},exactValue(e){this.$emit("value-change",e)},inputValue(e){this.$emit("value-change",e)},value:{handler(e){this.isExactMode?this.exactValue=e:this.inputValue=e},immediate:!0}},methods:{handlePopoverClose(){document.activeElement&&document.activeElement.blur(),this.isExactMode=!1},handleVisibleChange(e){this.isExactMode=e},handlefieldChange(e){this.$emit("field-change",e),this.updateCurrentOptionMultiple()},updateCurrentOptionMultiple(){const e=this.selectedOption;e&&"multiple"in e?this.currentOptionMultiple=e.multiple:this.currentOptionMultiple=this.multiple},handleExactSearch(){this.$emit("value-change",this.exactValue),this.$emit("search",this.exactValue)},handleClear(){this.exactValue="",this.$emit("value-change","")},handleEnter(){this.$emit("search")}},created(){this.updateCurrentOptionMultiple()}},at={class:"popover-content"},ot={class:"popover-subtitle"},st={class:"popover-footer"};function rt(e,i,l,o,n,a){const r=t.resolveComponent("el-input"),d=t.resolveComponent("el-button"),h=t.resolveComponent("MoreIcon"),u=t.resolveComponent("el-popover"),p=t.resolveComponent("FormItemLayout");return t.openBlock(),t.createBlock(p,{label:l.label,"label-options":l.labelOptions,field:l.field,onFieldChange:a.handlefieldChange,"label-width":l.labelWidth,"input-width":l.inputWidth,direction:l.direction,"label-align":l.labelAlign},{default:t.withCtx(()=>[t.createVNode(r,{modelValue:n.inputValue,"onUpdate:modelValue":i[1]||(i[1]=_=>n.inputValue=_),size:n.getDefaultSize(),placeholder:l.placeholder,onKeyup:t.withKeys(a.handleEnter,["enter","native"]),clearable:"",class:"tm-input"},t.createSlots({_:2},[a.shouldShowMultiple?{name:"append",fn:t.withCtx(()=>[t.createVNode(u,{visible:n.isExactMode,placement:"bottom-end",width:260,trigger:"click","onUpdate:visible":a.handleVisibleChange},{reference:t.withCtx(()=>[t.createVNode(h,{style:{cursor:"pointer"}})]),default:t.withCtx(()=>[t.createElementVNode("div",at,[t.createElementVNode("p",ot,t.toDisplayString(n.t("accurateSearchTips")),1),t.createVNode(r,{size:n.getDefaultSize(),type:"textarea",rows:8,modelValue:n.exactValue,"onUpdate:modelValue":i[0]||(i[0]=_=>n.exactValue=_),placeholder:n.t("accurateSearchPlaceholder"),style:{"font-size":"12px"}},null,8,["size","modelValue","placeholder"]),t.createElementVNode("div",st,[t.createVNode(d,{style:{float:"left"},size:n.getCompatSize("mini"),onClick:a.handleClear},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.t("clear")),1)]),_:1},8,["size","onClick"]),t.createVNode(d,{size:n.getCompatSize("mini"),onClick:a.handlePopoverClose},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.t("cancel")),1)]),_:1},8,["size","onClick"]),t.createVNode(d,{type:"primary",size:n.getCompatSize("mini"),onClick:a.handleExactSearch},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.t("search")),1)]),_:1},8,["size","onClick"])])])]),_:1},8,["visible","onUpdate:visible"])]),key:"0"}:void 0]),1032,["modelValue","size","placeholder","onKeyup"])]),_:1},8,["label","label-options","field","onFieldChange","label-width","input-width","direction","label-align"])}const j=b(nt,[["render",rt],["__scopeId","data-v-90ce9bc0"]]),{t:C}=x(),dt=!1,ct=!0,ht="modelValue",ut={name:"TmDateFilter",components:{FormItemLayout:w},props:{value:{type:[Array,String,Date],default:()=>null},field:{type:[String,Number],default:""},start:{type:[String,Number],default:""},end:{type:[String,Number],default:""},size:{type:String,default:"mini"},labelOptions:{type:Array,default:()=>[]},label:{type:[String,Function,Object,Array],default:""},type:{type:String,default:"daterange",validator:e=>["date","daterange","datetime","datetimerange","year","month","dates","months","years","week","monthrange"].includes(e)},format:{type:String,default:""},startPlaceholder:{type:String,default:void 0},endPlaceholder:{type:String,default:void 0},placeholder:{type:String,default:void 0},rangeSeparator:{type:String,default:"-"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},readonly:{type:Boolean,default:!1},editable:{type:Boolean,default:!0},align:{type:String,default:"left"},popperClass:{type:String,default:""},defaultValue:{type:[Date,Array],default:null},defaultTime:{type:[Date,String,Array],default:null},shortcuts:{type:Array,default:()=>[]},pastOnly:{type:Boolean,default:!1},labelWidth:{type:[String,Number],default:void 0},inputWidth:{type:[String,Number],default:void 0},direction:{type:String,default:void 0,validator:e=>!e||["horizontal","vertical"].includes(e)},labelAlign:{type:String,default:"right",validator:e=>["left","right","center"].includes(e)}},computed:{isRangeType(){return["daterange","datetimerange","monthrange"].includes(this.type)},computedStartPlaceholder(){if(this.isRangeType)return this.startPlaceholder!==void 0?this.startPlaceholder:C("startDate")},computedEndPlaceholder(){if(this.isRangeType)return this.endPlaceholder!==void 0?this.endPlaceholder:C("endDate")},computedFormat(){const e="YYYY";return this.format?this.format:this.type==="year"?e:this.type==="month"?`${e}-MM`:this.type==="date"?`${e}-MM-DD`:this.type==="dates"?`${e}-MM-DD`:this.type==="months"?`${e}-MM`:this.type==="years"?e:this.type==="week"?`${e}-MM-WW`:this.type==="datetime"?`${e}-MM-DD HH:mm:ss`:this.type==="datetimerange"?`${e}-MM-DD HH:mm:ss`:this.type==="daterange"?`${e}-MM-DD`:this.type==="monthrange"?`${e}-MM`:""},computedPickerOptions(){const e={};if(this.pastOnly&&(e.disabledDate=i=>i.getTime()>Date.now()),["daterange","datetimerange"].includes(this.type)){const i=this.type==="datetimerange";e.shortcuts=this.shortcuts.length>0?this.shortcuts:[{text:C("today"),onClick(l){const o=new Date,n=new Date;i&&(n.setHours(0,0,0,0),o.setHours(23,59,59,999)),l.$emit("pick",[n,o])}},{text:C("yesterday"),onClick(l){const o=new Date,n=new Date;n.setTime(n.getTime()-3600*1e3*24),o.setTime(o.getTime()-3600*1e3*24),i&&(n.setHours(0,0,0,0),o.setHours(23,59,59,999)),l.$emit("pick",[n,o])}},{text:C("last7days"),onClick(l){const o=new Date,n=new Date;n.setTime(n.getTime()-3600*1e3*24*7),i&&(n.setHours(0,0,0,0),o.setHours(23,59,59,999)),l.$emit("pick",[n,o])}},{text:C("last30days"),onClick(l){const o=new Date,n=new Date;n.setTime(n.getTime()-3600*1e3*24*30),i&&(n.setHours(0,0,0,0),o.setHours(23,59,59,999)),l.$emit("pick",[n,o])}},{text:C("thisMonth"),onClick(l){const o=new Date,n=new Date;n.setDate(1),i&&(n.setHours(0,0,0,0),o.setHours(23,59,59,999)),l.$emit("pick",[n,o])}},{text:C("lastMonth"),onClick(l){const o=new Date,n=new Date;n.setMonth(n.getMonth()-1),n.setDate(1),o.setDate(0),i&&(n.setHours(0,0,0,0),o.setHours(23,59,59,999)),l.$emit("pick",[n,o])}}]}return e},computedShortcuts(){if(!["daterange","datetimerange"].includes(this.type))return[];if(this.shortcuts&&this.shortcuts.length>0)return this.shortcuts;const e=this.type==="datetimerange";return[{text:C("today"),value:()=>{const i=new Date,l=new Date;return e&&(l.setHours(0,0,0,0),i.setHours(23,59,59,999)),[l,i]}},{text:C("yesterday"),value:()=>{const i=new Date,l=new Date;return l.setTime(l.getTime()-3600*1e3*24),i.setTime(i.getTime()-3600*1e3*24),e&&(l.setHours(0,0,0,0),i.setHours(23,59,59,999)),[l,i]}},{text:C("last7days"),value:()=>{const i=new Date,l=new Date;return l.setTime(l.getTime()-3600*1e3*24*7),e&&(l.setHours(0,0,0,0),i.setHours(23,59,59,999)),[l,i]}},{text:C("last30days"),value:()=>{const i=new Date,l=new Date;return l.setTime(l.getTime()-3600*1e3*24*30),e&&(l.setHours(0,0,0,0),i.setHours(23,59,59,999)),[l,i]}},{text:C("thisMonth"),value:()=>{const i=new Date,l=new Date;return l.setDate(1),e&&(l.setHours(0,0,0,0),i.setHours(23,59,59,999)),[l,i]}},{text:C("lastMonth"),value:()=>{const i=new Date,l=new Date;return l.setMonth(l.getMonth()-1),l.setDate(1),i.setDate(0),e&&(l.setHours(0,0,0,0),i.setHours(23,59,59,999)),[l,i]}}]},computedDisabledDate(){return this.pastOnly?e=>e.getTime()>Date.now():null},computedDefaultTime(){let e=this.defaultTime;if(this.type==="datetimerange"&&!this.defaultTime&&(e=["00:00:00","23:59:59"]),this.isVue2)return e;if(e){if(this.type==="datetimerange"&&Array.isArray(e))return e.map(i=>{if(typeof i=="string"){const l=new Date,[o,n,a]=i.split(":").map(Number);return new Date(l.getFullYear(),l.getMonth(),l.getDate(),o,n,a||0)}return i});if(this.type==="datetime"&&typeof e=="string"){const i=new Date,[l,o,n]=e.split(":").map(Number);return new Date(i.getFullYear(),i.getMonth(),i.getDate(),l,o,n||0)}return e}},dateValue(){return this.isRangeType?this.start||this.end?[this.start,this.end]:this.value:this.value}},data(){return{t:C,isVue2:dt,isVue3:ct,getDefaultSize:S,valueField:ht}},methods:{handleFieldChange(e){this.$emit("field-change",e)},handleDateChange(e){this.isRangeType?(this.$emit("value-change",e),e&&Array.isArray(e)&&e.length===2?(this.$emit("start-change",e),this.$emit("end-change",e)):(this.$emit("start-change",[]),this.$emit("end-change",[]))):this.$emit("value-change",e)},handleBlur(e){this.$emit("blur",e)},handleFocus(e){this.$emit("focus",e)}}};function mt(e,i,l,o,n,a){const r=t.resolveComponent("el-date-picker"),d=t.resolveComponent("FormItemLayout");return t.openBlock(),t.createBlock(d,{label:l.label,"label-options":l.labelOptions,field:l.field,onFieldChange:a.handleFieldChange,"label-width":l.labelWidth,"input-width":l.inputWidth,direction:l.direction,"label-align":l.labelAlign},{default:t.withCtx(()=>[t.createVNode(r,{"model-value":a.dateValue,type:l.type,size:n.getDefaultSize(),"range-separator":l.rangeSeparator,"start-placeholder":a.computedStartPlaceholder,"end-placeholder":a.computedEndPlaceholder,placeholder:l.placeholder,shortcuts:a.computedShortcuts,"disabled-date":a.computedDisabledDate,class:"date-picker",format:a.computedFormat,"value-format":a.computedFormat,disabled:l.disabled,clearable:l.clearable,readonly:l.readonly,editable:l.editable,teleported:!1,"popper-class":l.popperClass,"default-value":l.defaultValue,"default-time":a.computedDefaultTime,"onUpdate:modelValue":a.handleDateChange,onChange:a.handleDateChange,onBlur:a.handleBlur,onFocus:a.handleFocus},null,8,["model-value","type","size","range-separator","start-placeholder","end-placeholder","placeholder","shortcuts","disabled-date","format","value-format","disabled","clearable","readonly","editable","popper-class","default-value","default-time","onUpdate:modelValue","onChange","onBlur","onFocus"])]),_:1},8,["label","label-options","field","onFieldChange","label-width","input-width","direction","label-align"])}const J=b(ut,[["render",mt],["__scopeId","data-v-cd8a2978"]]),pt=!1,ft={name:"TmCascaderFilter",components:{FormItemLayout:w},props:{value:{type:[String,Number,Array],default:""},options:{type:[Array,Function],default:()=>[]},label:{type:[String,Function,Object,Array],default:null},props:{type:Object,default:()=>({label:"label",value:"value",children:"children",expandTrigger:"hover"})},filterable:{type:Boolean,default:!0},clearable:{type:Boolean,default:!0},collapseTags:{type:Boolean,default:!0},collapseTagsTooltip:{type:Boolean,default:!0},placeholder:{type:String,default:""},labelWidth:{type:[String,Number],default:void 0},inputWidth:{type:[String,Number],default:void 0},direction:{type:String,default:void 0,validator:e=>!e||["horizontal","vertical"].includes(e)},labelAlign:{type:String,default:"right",validator:e=>["left","right","center"].includes(e)}},data(){return{isVue2:pt,getDefaultSize:S,selectedValue:this.value,optionsList:[],loading:!1}},computed:{propMap(){return{label:this.props.label||"label",value:this.props.value||"value",children:this.props.children||"children"}},cascaderProps(){return T(g({},this.props),{expandTrigger:this.props.expandTrigger||"hover"})}},watch:{value:{immediate:!0,handler(e){this.selectedValue=e}},options:{immediate:!0,handler(e){this.initOptions(e)}},selectedValue(e){this.$emit("input",e),this.$emit("change",e)}},methods:{async initOptions(e){if(typeof e=="function")try{this.loading=!0;const i=await e();Array.isArray(i)&&(this.optionsList=i)}catch(i){console.error(i)}finally{this.loading=!1}else Array.isArray(e)&&(this.optionsList=e)}}},gt={class:"cascader"};function bt(e,i,l,o,n,a){const r=t.resolveComponent("el-cascader"),d=t.resolveComponent("FormItemLayout");return t.openBlock(),t.createBlock(d,{label:l.label,"label-width":l.labelWidth,"input-width":l.inputWidth,direction:l.direction,"label-align":l.labelAlign},{default:t.withCtx(()=>[t.createElementVNode("div",gt,[t.createVNode(r,t.mergeProps({ref:"cascader",modelValue:n.selectedValue,"onUpdate:modelValue":i[0]||(i[0]=h=>n.selectedValue=h)},T(g({},e.$attrs),{size:n.getDefaultSize(),filterable:l.filterable,clearable:l.clearable,collapseTags:l.collapseTags,collapseTagsTooltip:l.collapseTagsTooltip,props:a.cascaderProps,placeholder:l.placeholder,options:n.optionsList,loading:n.loading}),t.toHandlers(n.isVue2?e.$listeners:{})),{default:t.withCtx(({node:h,data:u})=>[t.renderSlot(e.$slots,"default",{node:h,data:u},()=>[t.createElementVNode("span",null,t.toDisplayString(u[a.propMap.label]),1)],!0)]),_:3},16,["modelValue"])])]),_:3},8,["label","label-width","input-width","direction","label-align"])}const K=b(ft,[["render",bt],["__scopeId","data-v-7c915d17"]]),yt=!1,Ct=!0,_t={name:"TmRadioFilter",components:{FormItemLayout:w},props:{value:{type:[String,Number],default:""},options:{type:[Array,Function],default:()=>[]},props:{type:Object,default:()=>({label:"label",value:"value"})},size:{type:String,default:"mini"},width:{type:[String,Number],default:200},label:{type:[String,Function,Object,Array],default:null},labelWidth:{type:[String,Number],default:void 0},inputWidth:{type:[String,Number],default:void 0},direction:{type:String,default:void 0,validator:e=>!e||["horizontal","vertical"].includes(e)},labelAlign:{type:String,default:"right",validator:e=>["left","right","center"].includes(e)}},data(){return{isVue2:yt,isVue3:Ct,getDefaultSize:S,selectedValue:this.value,optionsList:[],loading:!1}},computed:{propMap(){return{label:this.props.label||"label",value:this.props.value||"value"}}},watch:{value:{immediate:!0,handler(e){this.selectedValue=e}},options:{immediate:!0,handler(e){this.$slots.default||this.initOptions(e)}},selectedValue(e){this.$emit("input",e),this.$emit("change",e)}},methods:{async initOptions(e){if(typeof e=="function")try{this.loading=!0;const i=await e();Array.isArray(i)&&(this.optionsList=i)}catch(i){console.error(i)}finally{this.loading=!1}else Array.isArray(e)&&(this.optionsList=e)}}};function St(e,i,l,o,n,a){const r=t.resolveComponent("el-radio-button"),d=t.resolveComponent("el-radio-group"),h=t.resolveComponent("FormItemLayout");return t.openBlock(),t.createBlock(h,{label:l.label,"label-width":l.labelWidth,"input-width":l.inputWidth,direction:l.direction,"label-align":l.labelAlign},{default:t.withCtx(()=>[t.createVNode(d,t.mergeProps({ref:"radioGroup",modelValue:n.selectedValue,"onUpdate:modelValue":i[0]||(i[0]=u=>n.selectedValue=u)},T(g({},e.$attrs),{size:n.getDefaultSize()}),{class:"radio-group"},t.toHandlers(n.isVue2?e.$listeners:{})),{default:t.withCtx(()=>[e.$slots.default?t.renderSlot(e.$slots,"default",{key:0},void 0,!0):(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(n.optionsList,u=>(t.openBlock(),t.createBlock(r,t.mergeProps({ref_for:!0},{[n.isVue3?"value":"label"]:u[a.propMap.value],disabled:u.disabled},{style:{flex:"1"},key:u[a.propMap.value]}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"option",{item:u},()=>[t.createTextVNode(t.toDisplayString(u[a.propMap.label]),1)],!0)]),_:2},1040))),128))]),_:3},16,["modelValue"])]),_:3},8,["label","label-width","input-width","direction","label-align"])}const Q=b(_t,[["render",St],["__scopeId","data-v-210a44fd"]]),xt=!1,Vt=!0,kt={name:"TmCheckboxFilter",components:{FormItemLayout:w},props:{value:{type:Array,default:()=>[]},options:{type:[Array,Function],default:()=>[]},props:{type:Object,default:()=>({label:"label",value:"value"})},size:{type:String,default:"mini"},label:{type:[String,Function,Object,Array],default:null},labelWidth:{type:[String,Number],default:void 0},inputWidth:{type:[String,Number],default:void 0},direction:{type:String,default:void 0,validator:e=>!e||["horizontal","vertical"].includes(e)},labelAlign:{type:String,default:"right",validator:e=>["left","right","center"].includes(e)}},data(){return{isVue2:xt,isVue3:Vt,getDefaultSize:S,selectedValue:this.value||[],optionsList:[],loading:!1}},computed:{propMap(){return{label:this.props.label||"label",value:this.props.value||"value"}}},watch:{value:{immediate:!0,handler(e){this.selectedValue=e||[]}},options:{immediate:!0,handler(e){this.$slots.default||this.initOptions(e)}},selectedValue(e){this.$emit("input",e),this.$emit("change",e)}},methods:{async initOptions(e){if(typeof e=="function")try{this.loading=!0;const i=await e();Array.isArray(i)&&(this.optionsList=i)}catch(i){console.error(i)}finally{this.loading=!1}else Array.isArray(e)&&(this.optionsList=e)}}},wt={class:"checkbox-content"};function Tt(e,i,l,o,n,a){const r=t.resolveComponent("el-checkbox-button"),d=t.resolveComponent("el-checkbox-group"),h=t.resolveComponent("FormItemLayout");return t.openBlock(),t.createBlock(h,{label:l.label,"label-width":l.labelWidth,"input-width":l.inputWidth,direction:l.direction,"label-align":l.labelAlign},{default:t.withCtx(()=>[t.createElementVNode("div",wt,[t.createVNode(d,t.mergeProps({ref:"checkboxGroup",modelValue:n.selectedValue,"onUpdate:modelValue":i[0]||(i[0]=u=>n.selectedValue=u)},T(g({},e.$attrs),{size:n.getDefaultSize()}),t.toHandlers(n.isVue2?e.$listeners:{})),{default:t.withCtx(()=>[e.$slots.default?t.renderSlot(e.$slots,"default",{key:0},void 0,!0):(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(n.optionsList,u=>(t.openBlock(),t.createBlock(r,t.mergeProps({key:u[a.propMap.value]},{ref_for:!0},{[n.isVue3?"value":"label"]:u[a.propMap.value],disabled:u.disabled},{style:{flex:"1"}}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"option",{item:u},()=>[t.createTextVNode(t.toDisplayString(u[a.propMap.label]),1)],!0)]),_:2},1040))),128))]),_:3},16,["modelValue"])])]),_:3},8,["label","label-width","input-width","direction","label-align"])}const q=b(kt,[["render",Tt],["__scopeId","data-v-39ef0641"]]),Ft=!1,zt={name:"TmSwitchFilter",components:{FormItemLayout:w},props:{value:{type:Boolean,default:!1},label:{type:[String,Function,Object,Array],default:""},labelWidth:{type:[String,Number],default:void 0},inputWidth:{type:[String,Number],default:void 0},direction:{type:String,default:void 0,validator:e=>!e||["horizontal","vertical"].includes(e)},labelAlign:{type:String,default:"right",validator:e=>["left","right","center"].includes(e)}},data(){return{isVue2:Ft,getDefaultSize:S,switchValue:this.value}},watch:{value:{immediate:!0,handler(e){this.switchValue=e}},switchValue(e){this.$emit("input",e),this.$emit("change",e)}}},Lt={class:"switch-content"};function Bt(e,i,l,o,n,a){const r=t.resolveComponent("el-switch"),d=t.resolveComponent("FormItemLayout");return t.openBlock(),t.createBlock(d,{label:l.label,"label-width":l.labelWidth,"input-width":l.inputWidth,direction:l.direction,"label-align":l.labelAlign},{default:t.withCtx(()=>[t.createElementVNode("div",Lt,[t.createVNode(r,t.mergeProps({ref:"switch",modelValue:n.switchValue,"onUpdate:modelValue":i[0]||(i[0]=h=>n.switchValue=h)},e.$attrs,t.toHandlers(n.isVue2?e.$listeners:{}),{size:n.getDefaultSize()}),null,16,["modelValue","size"])])]),_:1},8,["label","label-width","input-width","direction","label-align"])}const Y=b(zt,[["render",Bt],["__scopeId","data-v-7455db21"]]),Nt=!1,Ot=!0,ce="modelValue",G="update:modelValue",Et={name:"TmTextareaFilter",components:{FormItemLayout:w,CircleClose:y.CircleClose},props:{label:{type:[String,Function,Object,Array],default:""},[ce]:{type:String,default:""},field:{type:[String,Number],default:""},placeholder:{type:String,default:""},labelOptions:{type:Array,default:()=>[]},autosize:{type:[Boolean,Object],default:()=>({minRows:1,maxRows:10})},maxlength:{type:[String,Number],default:""},minlength:{type:[String,Number],default:""},showWordLimit:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},resize:{type:String,default:"vertical",validator:e=>["none","both","horizontal","vertical"].includes(e)},tabindex:{type:[String,Number],default:""},validateEvent:{type:Boolean,default:!0},clearable:{type:Boolean,default:!0},labelWidth:{type:[String,Number],default:void 0},inputWidth:{type:[String,Number],default:void 0},direction:{type:String,default:void 0,validator:e=>!e||["horizontal","vertical"].includes(e)},labelAlign:{type:String,default:"right",validator:e=>["left","right","center"].includes(e)}},data(){return{isVue2:Nt,isVue3:Ot,getDefaultSize:S,inputValue:this.value}},computed:{selectedOption(){return!this.labelOptions||!this.labelOptions.length||!this.field?null:this.labelOptions.find(e=>e.value===this.field)}},watch:{[ce]:{immediate:!0,handler(e){this.inputValue=e}},inputValue(e){this.$emit(G,e)}},methods:{handleInput(e){this.inputValue=e,this.$emit(G,e)},handleChange(e){this.$emit("change",e)},handleFocus(e){this.$emit("focus",e)},handleBlur(e){this.$emit("blur",e)},handleClear(){this.inputValue="",this.$emit(G,""),this.$emit("clear")},handleFieldChange(e){this.$emit("field-change",e)},focus(){this.$refs.textarea.focus()},blur(){this.$refs.textarea.blur()},select(){this.$refs.textarea.select()}}},Dt={class:"textarea"};function At(e,i,l,o,n,a){const r=t.resolveComponent("el-input"),d=t.resolveComponent("CircleClose"),h=t.resolveComponent("el-icon"),u=t.resolveComponent("FormItemLayout");return t.openBlock(),t.createBlock(u,{label:l.label,"label-options":l.labelOptions,field:l.field,onFieldChange:a.handleFieldChange,"label-width":l.labelWidth,"input-width":l.inputWidth,direction:l.direction,"label-align":l.labelAlign},{default:t.withCtx(()=>[t.createElementVNode("div",Dt,[t.createVNode(r,t.mergeProps({ref:"textarea",modelValue:n.inputValue,"onUpdate:modelValue":i[0]||(i[0]=p=>n.inputValue=p),size:n.getDefaultSize(),placeholder:l.placeholder,type:"textarea",autosize:l.autosize,maxlength:l.maxlength,minlength:l.minlength,"show-word-limit":l.showWordLimit,readonly:l.readonly,disabled:l.disabled,resize:l.resize,tabindex:l.tabindex,"validate-event":l.validateEvent},e.$attrs,t.toHandlers(n.isVue2?e.$listeners:{}),{onInput:a.handleInput,onChange:a.handleChange,onFocus:a.handleFocus,onBlur:a.handleBlur,onClear:a.handleClear,class:"textarea-input"}),null,16,["modelValue","size","placeholder","autosize","maxlength","minlength","show-word-limit","readonly","disabled","resize","tabindex","validate-event","onInput","onChange","onFocus","onBlur","onClear"]),l.clearable&&n.inputValue?(t.openBlock(),t.createBlock(h,{key:0,class:"textarea-clear-icon",onClick:a.handleClear},{default:t.withCtx(()=>[t.createVNode(d)]),_:1},8,["onClick"])):t.createCommentVNode("",!0)])]),_:1},8,["label","label-options","field","onFieldChange","label-width","input-width","direction","label-align"])}const X=b(Et,[["render",At],["__scopeId","data-v-9b0ae8e6"]]),Mt={name:"DynamicSlot",props:{name:{type:String,required:!0},slotProps:{type:Object,default:()=>({})}},render(e){var n;const i=a=>{var r;return a?(r=a.$slots)==null?void 0:r[this.name]:null},l=a=>{var r,d,h,u;return a?((d=(r=a.$)==null?void 0:r.type)==null?void 0:d.name)==="TmTable"||((u=(h=a.$)==null?void 0:h.type)==null?void 0:u.__name)==="TmTable":!1};let o=i(this.$parent);if(!o){let a=(n=this.$parent)==null?void 0:n.$parent;for(;a&&!o;){if(l(a)){o=i(a);break}a=a.$parent}}return o?typeof o=="function"?o(this.slotProps):o:null}},{t:Ht}=x(),Rt=!1,vt=!0,It=["date","daterange","datetime","datetimerange","year","month","dates","months","years","week","monthrange"],Pt={name:"TmTableSearch",components:{TmSelect:U,TmInput:j,TmDate:J,TmCascader:K,TmRadio:Q,TmCheckbox:q,TmSwitch:Y,TmTextarea:X,DynamicSlot:Mt},props:{disabled:{type:Boolean,default:!1},searchColumns:{type:Array,default:null},searchForm:{type:Object,default:()=>({})},labelWidth:{type:[String,Number],default:void 0},inputWidth:{type:[String,Number],default:void 0},direction:{type:String,default:void 0,validator:e=>!e||["horizontal","vertical"].includes(e)},labelAlign:{type:String,default:"right",validator:e=>["left","right","center"].includes(e)}},data(){return{t:Ht,isVue2:Rt,isVue3:vt,getCompatSize:B,getDefaultSize:S,DATE_TYPES:It,defaultValues:{}}},computed:{computedSearchForm:{get(){return this.searchForm},set(e){this.$emit("update:search-form",e)}},getLayoutProps(){return e=>{const i={};return e.labelWidth!==void 0?i.labelWidth=e.labelWidth:this.labelWidth!==void 0&&(i.labelWidth=this.labelWidth),e.inputWidth!==void 0?i.inputWidth=e.inputWidth:this.inputWidth!==void 0&&(i.inputWidth=this.inputWidth),e.direction!==void 0?i.direction=e.direction:this.direction!==void 0&&(i.direction=this.direction),e.labelAlign!==void 0?i.labelAlign=e.labelAlign:this.labelAlign!==void 0&&(i.labelAlign=this.labelAlign),i}}},mounted(){this.initDefaultValues()},methods:{isDateType(e){return this.DATE_TYPES.includes(e)},hasDefaultSlot(){const e=this.$slots.default;return e?this.isVue2?!!e:e()[0].children.length>0:!1},handleUpdate(e,i,l){const o=this.getFieldValue(e,l);o&&this.$emit("update:search-form",T(g({},this.computedSearchForm),{[o]:i}))},handleUpdateDate(e,i){const l=i||[],o=this.getFieldValue(e,"start"),n=this.getFieldValue(e,"end"),a=this.getFieldValue(e,"value"),r={};o&&(r[o]=l[0]),n&&(r[n]=l[1]),a&&(r[a]=l),this.$emit("update:search-form",g(g({},this.computedSearchForm),r))},getFieldValue(e,i){if(typeof e=="string")return e;if(e.fields&&i in e.fields){const l=e.fields[i];if(typeof l=="string")return l;if(Array.isArray(l))return l[0];if(l&&typeof l=="object")return l.name}},getFieldDefault(e,i){if(e.fields&&i in e.fields){const l=e.fields[i];if(Array.isArray(l)&&l.length>1)return l[1];if(l&&typeof l=="object"&&"default"in l)return l.default}},hasSearchSlot(e){const i="$slots";if(this[i][e])return!0;let o=this.$parent;for(;o;){const n=o[i];if(o.$options.name==="TmTable"&&(n!=null&&n[e]))return!0;o=o.$parent}return!1},initDefaultValues(){if(!this.searchColumns||!this.searchColumns.length)return;const e={};this.searchColumns.forEach(i=>{if(typeof i=="string"||!i.fields)return;const l=this.getFieldValue(i,"value"),o=this.getFieldValue(i,"label");if(i.type==="input"&&i.labelOptions&&i.labelOptions.length>0){const a=i.labelOptions[0];if(o)if(o in this.computedSearchForm)e[o]=this.computedSearchForm[o];else{const r=this.getFieldDefault(i,"label");r!==void 0?e[o]=r:a&&a.value!==void 0&&(e[o]=a.value)}l&&!(l in this.computedSearchForm)&&(e[l]="")}else if(this.isDateType(i.type)&&i.labelOptions&&i.labelOptions.length>0){const a=i.labelOptions[0];if(l&&!(l in this.computedSearchForm)&&(e[l]=[]),o)if(o in this.computedSearchForm)e[o]=this.computedSearchForm[o];else{const r=this.getFieldDefault(i,"label");r!==void 0?e[o]=r:a&&a.value!==void 0&&(e[o]=a.value)}}else if(i.type==="select"&&i.labelOptions&&i.labelOptions.length>0){const a=i.labelOptions[0];if(l&&!(l in this.computedSearchForm)&&(e[l]=i.multiple?[]:""),o)if(o in this.computedSearchForm)e[o]=this.computedSearchForm[o];else{const r=this.getFieldDefault(i,"label");r!==void 0?e[o]=r:a&&a.value!==void 0&&(e[o]=a.value)}}const n=this.getFieldDefault(i,"value");if(l&&n!==void 0&&!(l in this.computedSearchForm)?this.isDateType(i.type)&&!Array.isArray(n)?e[l]=[]:i.type==="checkbox"&&!Array.isArray(n)?e[l]=n?[n]:[]:i.type==="switch"&&typeof n!="boolean"?e[l]=!!n:e[l]=n:l&&!(l in this.computedSearchForm)&&(i.type==="checkbox"?e[l]=[]:i.type==="switch"&&(e[l]=!1)),this.isDateType(i.type)){const a=this.getFieldValue(i,"start"),r=this.getFieldValue(i,"end"),d=this.getFieldDefault(i,"start"),h=this.getFieldDefault(i,"end");a&&d!==void 0&&!(a in this.computedSearchForm)&&(e[a]=d),r&&h!==void 0&&!(r in this.computedSearchForm)&&(e[r]=h)}}),this.defaultValues=e,this.$emit("update:search-form",g(g({},e),this.computedSearchForm))},getSearchForm(){return this.computedSearchForm},handleSearch(){setTimeout(()=>{this.$emit("search",this.computedSearchForm)})},handleReset(){this.$emit("update:search-form",g({},this.defaultValues)),this.$emit("reset")}}},Wt={class:"search-content"},Ut={class:"search-actions"};function jt(e,i,l,o,n,a){const r=t.resolveComponent("dynamic-slot"),d=t.resolveComponent("tm-Input"),h=t.resolveComponent("tm-date"),u=t.resolveComponent("tm-select"),p=t.resolveComponent("tm-cascader"),_=t.resolveComponent("tm-radio"),k=t.resolveComponent("tm-checkbox"),E=t.resolveComponent("tm-switch"),D=t.resolveComponent("tm-textarea"),F=t.resolveComponent("el-button");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["table-search",`table-search--${n.isVue2?"v2":"v3"}`])},[t.createElementVNode("div",Wt,[a.hasDefaultSlot()?t.renderSlot(e.$slots,"default",{key:0},void 0,!0):l.searchColumns&&l.searchColumns.length?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(l.searchColumns,(s,z)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[typeof s=="string"?(t.openBlock(),t.createElementBlock("div",{key:`str-${s}-${z}`,class:"search-item"},[(t.openBlock(),t.createBlock(r,{name:`search-${s}`,"slot-props":{searchForm:l.searchForm},key:s},null,8,["name","slot-props"]))])):(t.openBlock(),t.createElementBlock("div",{key:`obj-${z}`,class:"search-item"},[s.fields?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[a.hasSearchSlot(`search-${a.getFieldValue(s,"value")}`)?(t.openBlock(),t.createBlock(r,{name:`search-${a.getFieldValue(s,"value")}`,"slot-props":{searchForm:l.searchForm,col:s},key:a.getFieldValue(s,"value")},null,8,["name","slot-props"])):(t.openBlock(),t.createElementBlock("div",{style:{display:"flex"},key:a.getFieldValue(s,"value")||`col-${z}`},[s.type==="input"?(t.openBlock(),t.createBlock(d,t.mergeProps({key:0,label:s.label,value:a.computedSearchForm[a.getFieldValue(s,"value")],field:a.computedSearchForm[a.getFieldValue(s,"label")],onValueChange:c=>a.handleUpdate(s,c,"value"),onFieldChange:c=>a.handleUpdate(s,c,"label"),multiple:s.multiple,labelOptions:s.labelOptions,placeholder:s.placeholder,onSearch:a.handleSearch},{ref_for:!0},a.getLayoutProps(s)),null,16,["label","value","field","onValueChange","onFieldChange","multiple","labelOptions","placeholder","onSearch"])):t.createCommentVNode("",!0),a.isDateType(s.type)?(t.openBlock(),t.createBlock(h,t.mergeProps({key:1,type:s.type,label:s.label,value:a.computedSearchForm[a.getFieldValue(s,"value")],field:a.computedSearchForm[a.getFieldValue(s,"label")],start:a.computedSearchForm[a.getFieldValue(s,"start")],end:a.computedSearchForm[a.getFieldValue(s,"end")],onFieldChange:c=>a.handleUpdate(s,c,"label"),onValueChange:c=>a.handleUpdateDate(s,c),onStartChange:c=>a.handleUpdateDate(s,c),onEndChange:c=>a.handleUpdateDate(s,c),labelOptions:s.labelOptions,"start-placeholder":s.startPlaceholder,"end-placeholder":s.endPlaceholder,placeholder:s.placeholder,"range-separator":s.rangeSeparator,disabled:s.disabled,clearable:s.clearable,readonly:s.readonly,editable:s.editable,align:s.align,"popper-class":s.popperClass,"default-value":s.defaultValue,"default-time":s.defaultTime,shortcuts:s.shortcuts,"past-only":s.pastOnly,format:s.format},{ref_for:!0},a.getLayoutProps(s)),null,16,["type","label","value","field","start","end","onFieldChange","onValueChange","onStartChange","onEndChange","labelOptions","start-placeholder","end-placeholder","placeholder","range-separator","disabled","clearable","readonly","editable","align","popper-class","default-value","default-time","shortcuts","past-only","format"])):t.createCommentVNode("",!0),s.type==="select"?(t.openBlock(),t.createBlock(u,t.mergeProps({key:2,label:s.label,modelValue:a.computedSearchForm[a.getFieldValue(s,"value")],"onUpdate:modelValue":c=>a.computedSearchForm[a.getFieldValue(s,"value")]=c,field:a.computedSearchForm[a.getFieldValue(s,"label")],options:s.options,labelOptions:s.labelOptions,placeholder:s.placeholder,multiple:s.multiple,"show-check-all":s.checkAll,"value-on-clear":s.valueOnClear,clearable:s.clearable,onFieldChange:c=>a.handleUpdate(s,c,"label")},{ref_for:!0},a.getLayoutProps(s)),null,16,["label","modelValue","onUpdate:modelValue","field","options","labelOptions","placeholder","multiple","show-check-all","value-on-clear","clearable","onFieldChange"])):t.createCommentVNode("",!0),s.type==="cascader"?(t.openBlock(),t.createBlock(p,t.mergeProps({key:3,modelValue:a.computedSearchForm[a.getFieldValue(s,"value")],"onUpdate:modelValue":c=>a.computedSearchForm[a.getFieldValue(s,"value")]=c,label:s.label,options:s.options,labelOptions:s.labelOptions,props:s.props,placeholder:s.placeholder,"show-check-all":s.checkAll},{ref_for:!0},a.getLayoutProps(s)),null,16,["modelValue","onUpdate:modelValue","label","options","labelOptions","props","placeholder","show-check-all"])):t.createCommentVNode("",!0),s.type==="radio"?(t.openBlock(),t.createBlock(_,t.mergeProps({key:4,modelValue:a.computedSearchForm[a.getFieldValue(s,"value")],"onUpdate:modelValue":c=>a.computedSearchForm[a.getFieldValue(s,"value")]=c,label:s.label,options:s.options,props:s.props},{ref_for:!0},a.getLayoutProps(s)),null,16,["modelValue","onUpdate:modelValue","label","options","props"])):t.createCommentVNode("",!0),s.type==="checkbox"?(t.openBlock(),t.createBlock(k,t.mergeProps({key:5,modelValue:a.computedSearchForm[a.getFieldValue(s,"value")],"onUpdate:modelValue":c=>a.computedSearchForm[a.getFieldValue(s,"value")]=c,label:s.label,options:s.options,props:s.props},{ref_for:!0},a.getLayoutProps(s)),null,16,["modelValue","onUpdate:modelValue","label","options","props"])):t.createCommentVNode("",!0),s.type==="switch"?(t.openBlock(),t.createBlock(E,t.mergeProps({key:6,modelValue:a.computedSearchForm[a.getFieldValue(s,"value")],"onUpdate:modelValue":c=>a.computedSearchForm[a.getFieldValue(s,"value")]=c,"active-text":s.activeText,"inactive-text":s.inactiveText,label:s.label,"active-color":s.activeColor,"inactive-color":s.inactiveColor},{ref_for:!0},a.getLayoutProps(s)),null,16,["modelValue","onUpdate:modelValue","active-text","inactive-text","label","active-color","inactive-color"])):t.createCommentVNode("",!0),s.type==="textarea"?(t.openBlock(),t.createBlock(D,t.mergeProps({key:7,modelValue:a.computedSearchForm[a.getFieldValue(s,"value")],"onUpdate:modelValue":c=>a.computedSearchForm[a.getFieldValue(s,"value")]=c,field:a.computedSearchForm[a.getFieldValue(s,"label")],label:s.label,labelOptions:s.labelOptions,placeholder:s.placeholder,autosize:s.autosize,maxlength:s.maxlength,minlength:s.minlength,"show-word-limit":s.showWordLimit,readonly:s.readonly,disabled:s.disabled,resize:s.resize,clearable:s.clearable,onFieldChange:c=>a.handleUpdate(s,c,"label")},{ref_for:!0},a.getLayoutProps(s)),null,16,["modelValue","onUpdate:modelValue","field","label","labelOptions","placeholder","autosize","maxlength","minlength","show-word-limit","readonly","disabled","resize","clearable","onFieldChange"])):t.createCommentVNode("",!0)]))],64)):(t.openBlock(),t.createElementBlock("div",{key:`error-${z}`,class:"search-error-message"}," 缺少 fields 配置,无法渲染此组件 "))]))],64))),256)):t.createCommentVNode("",!0),t.createElementVNode("div",Ut,[t.createVNode(F,{type:"primary",size:n.getDefaultSize(),onClick:a.handleSearch},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.t("query")),1)]),_:1},8,["size","onClick"]),t.createVNode(F,{size:n.getDefaultSize(),onClick:a.handleReset},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.t("reset")),1)]),_:1},8,["size","onClick"])])])],2)}const Z=b(Pt,[["render",jt],["__scopeId","data-v-8cd0172a"]]),Jt=!1,Kt={name:"TablePagination",props:{current:{type:Number,default:1},small:{type:Boolean,default:!0},pageSize:{type:Number,default:20},total:{type:Number,default:0}},data(){return{isVue2:Jt,getCompatSize:B}},methods:{handleSizeChange(e){this.$emit("size-change",e)},handleCurrentChange(e){this.$emit("current-change",e)}}},Qt={class:"tm-pagination"};function qt(e,i,l,o,n,a){const r=t.resolveComponent("el-pagination");return t.openBlock(),t.createElementBlock("div",Qt,[t.createElementVNode("div",null,[t.renderSlot(e.$slots,"pagination-left",{},void 0,!0)]),t.createVNode(r,t.mergeProps(e.$attrs,t.toHandlers(n.isVue2?e.$listeners:{}),{style:{"text-align":"right"},"current-page":l.current,"page-size":l.pageSize,total:l.total,"page-sizes":[10,20,50,100,300,500,1e3,2e3],size:n.getCompatSize("mini"),layout:"total, sizes, prev, pager, next, jumper",onSizeChange:a.handleSizeChange,"onUpdate:currentPage":i[0]||(i[0]=d=>e.$emit("update:current",d)),"onUpdate:pageSize":i[1]||(i[1]=d=>e.$emit("update:pageSize",d)),onCurrentChange:a.handleCurrentChange}),null,16,["current-page","page-size","total","size","onSizeChange","onCurrentChange"])])}const Yt=b(Kt,[["render",qt],["__scopeId","data-v-ee768f31"]]),Gt={name:"TmTableMenu",props:{size:{type:String,default:"mini"}}},Xt={size:"small",class:"tm-table-menu",inline:""},Zt={class:"left"},$t={class:"right"};function el(e,i,l,o,n,a){return t.openBlock(),t.createElementBlock("div",Xt,[t.createElementVNode("div",Zt,[t.renderSlot(e.$slots,"left",{},void 0,!0)]),t.createElementVNode("div",$t,[t.renderSlot(e.$slots,"right",{},void 0,!0)])])}const tl=b(Gt,[["render",el],["__scopeId","data-v-579dd2c3"]]),v=e=>e?e.props||{}:{},$=(e,i)=>{e&&(e.props||(e.props={}),typeof i=="object"&&Object.assign(e.props,i))},I={getTableConfig(e){try{const i=localStorage.getItem(`tm-table-config-${e}`);return Promise.resolve({data:{code:200,data:i}})}catch(i){return Promise.reject(i)}},setTableConfig(e){try{return localStorage.setItem(`tm-table-config-${e.key}`,e.info),Promise.resolve({data:{code:200,message:"success"}})}catch(i){return Promise.reject(i)}}},ll=e=>I.getTableConfig(e.key),il=e=>I.setTableConfig(e),nl=e=>{e&&(typeof e.getTableConfig=="function"&&(I.getTableConfig=e.getTableConfig),typeof e.setTableConfig=="function"&&(I.setTableConfig=e.setTableConfig))},{t:al}=x(),ol=!1,sl=!0,rl={formatter:(e,i,l,o)=>[void 0,null,""].includes(l)?"-":l},dl={name:"TmColumnConfig",components:{MoveIcon:Fe,FixedLeftIcon:Le,FixedRightIcon:Be,UploadIcon:Ne,DownloadIcon:Oe,DeleteIcon:Ee,MenuIcon:we,tmEllipsisText:N},props:{columns:{type:Array,default:()=>[]},tableKey:{type:String,default:"",required:!0},defaultColumns:{type:Array,default:()=>[]},maxFixedLeftQuantity:{type:[Number,String],default:void 0},maxFixedRightQuantity:{type:[Number,String],default:void 0},ignoredColumnConfigTypes:{type:Array,default:()=>["selection"]}},data(){return{t:al,isVue2:ol,isVue3:sl,getDefaultSize:S,getCompatSize:B,buttonType:{link:!0,type:"primary"},afterOpenDelay:{"show-after":300},popoverVisible:!1,keyWord:"",sortedTableColumns:[],tableColumns:[],defaultColumnsConfig:[],columnMap:{},processedColumns:[],placement:"bottom",isDraggingFrozen:!1,isDraggingFrozenRight:!1,sortable:null,isConfigLoaded:!1,columnsCopy:[]}},computed:{filteredSortedTableColumns(){return this.keyWord?this.sortedTableColumns.filter(e=>this.getColumnLabel(e.prop).includes(this.keyWord)):this.sortedTableColumns},showFixedLimitTips(){return this.maxFixedLeftQuantity!==void 0||this.maxFixedRightQuantity!==void 0},isThanMaxFrozen(){return this.maxFixedLeftQuantity===void 0?!1:this.sortedTableColumns.filter(e=>e.fixed==="left").length>=this.maxFixedLeftQuantity},isThanMaxRightFrozen(){return this.maxFixedRightQuantity===void 0?!1:this.sortedTableColumns.filter(e=>e.fixed==="right").length>=this.maxFixedRightQuantity},computedTableKey(){if(this.tableKey)return this.tableKey;if(this.$route&&this.$route.path)return this.$route.path.slice(1).replace(/\//g,"-");throw new Error("tableKey is required")}},watch:{popoverVisible(e){e||this.handlePopoverHide()},columns:{handler(e){e&&e.length>0&&!this.isConfigLoaded&&this.initializeColumnConfig()},immediate:!0},tableColumns:{handler(e){e!=null&&e.length&&(this.initSortedTableColumns(),this.crateSortable(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)))},deep:!0}},methods:{findLastIndex(e,i){for(let l=e.length-1;l>=0;l--)if(i(e[l],l,e))return l;return-1},getColumnLabel(e){return!e||!this.columnMap[e]?e||"":v(this.columnMap[e]).label||e},initializeColumnConfig(){this.defaultColumns&&this.defaultColumns.length>0?this.defaultColumnsConfig=this.defaultColumns:this.processOriginalColumns(),this.loadColumnConfig()},processOriginalColumns(){const e=this.columns||[];let i={};this.defaultColumnsConfig=e.filter(l=>{const o=v(l);return!(!o.prop||this.ignoredColumnConfigTypes.includes(o.type))}).map((l,o)=>{const n=v(l),a=g(g({},rl),n);$(l,a),n.prop&&(i[n.prop]=l);const r=n.hasOwnProperty("visible")?n.visible!==!1:!0;return{prop:n.prop,fixed:n.fixed||"",sort:o,cancellable:n.hasOwnProperty("cancellable")?n.cancellable:!0,visible:r}}),this.columnMap=i},loadColumnConfig(){ll({key:this.computedTableKey}).then(e=>{var l;if(e.data.code!==200)return;let i=JSON.parse(((l=e.data)==null?void 0:l.data)||null)||{};i.columnsConfig&&JSON.stringify(this.defaultColumnsConfig)===JSON.stringify(i.defaultColumnsConfig)?this.tableColumns=i.columnsConfig.map(o=>g({},o)):this.tableColumns=this.defaultColumnsConfig.map(o=>g({},o)),this.processedColumns=this.applyColumnConfig(this.tableColumns),this.isConfigLoaded=!0,this.$emit("complete",{columns:this.processedColumns,config:this.tableColumns,isInitialLoad:!0})}).catch(()=>{this.tableColumns=this.defaultColumnsConfig.map(e=>g({},e)),this.processedColumns=this.applyColumnConfig(this.tableColumns),this.isConfigLoaded=!0,this.$emit("complete",{columns:this.processedColumns,isInitialLoad:!0})})},applyColumnConfig(e,i=!1){let l=this.columns.filter(n=>{const a=v(n);return this.ignoredColumnConfigTypes.includes(a.type)}),o=[];return[...e].sort((n,a)=>{const r=n.sort!==void 0?n.sort:1/0,d=a.sort!==void 0?a.sort:1/0;return r-d}).forEach(n=>{if(n.prop){let a=this.columnMap[n.prop];a&&($(a,{fixed:n.fixed||void 0,visible:n.visible}),(!i&&n.visible||i)&&o.push(a))}}),l.forEach(n=>{$(n,{visible:!0})}),[...l,...o]},crateSortable(){const e=this.$refs.sortListRef;if(!e)return;this.sortable&&(this.sortable.destroy(),this.sortable=null);const i=new f(e,{ghostClass:"blue-background-class",animation:150,easing:"cubic-bezier(1, 0, 0, 1)",handle:".row-title",draggable:".sort-item-wrapper",fallbackOnBody:!1,preventOnFilter:!0,removeCloneOnHide:!0,group:"columns",dragClass:"sortable-drag",onStart:({item:l})=>{const o=l.getAttribute("data-prop"),n=this.sortedTableColumns.find(a=>a.prop===o);this.isDraggingFrozen=n&&n.fixed==="left",this.isDraggingFrozenRight=n&&n.fixed==="right",this.draggedItemIndex=Array.from(e.children).indexOf(l),l.classList.add("sortable-drag")},onMove:l=>{const{target:o,related:n}=l;if(!o||!n)return!1;const a=n?n.getAttribute("data-prop"):null,r=a?this.sortedTableColumns.find(u=>u.prop===a):null,d=r&&r.fixed==="left",h=r&&r.fixed==="right";return this.isDraggingFrozen&&!d||this.isDraggingFrozenRight&&!h||!this.isDraggingFrozen&&!this.isDraggingFrozenRight&&(d||h)?(o.classList.add("no-drop-zone"),!1):(document.querySelectorAll(".no-drop-zone").forEach(u=>{u.classList.remove("no-drop-zone")}),!0)},onEnd:({item:l,newIndex:o,oldIndex:n})=>{if(o===void 0||n===void 0||o<0||n<0||o>=this.sortedTableColumns.length||n>=this.sortedTableColumns.length)return;document.querySelectorAll(".no-drop-zone").forEach(_=>{_.classList.remove("no-drop-zone")}),l.classList.remove("sortable-drag");const a=this.sortedTableColumns[n],r=a.fixed==="left",d=a.fixed==="right",h=o>0?this.sortedTableColumns[o-1]:null,u=o<this.sortedTableColumns.length-1?this.sortedTableColumns[o+1]:null;let p=!1;if(r?(h&&h.fixed!=="left"||u&&u.fixed==="right")&&(p=!0):d?(h&&h.fixed!=="right"||u&&u.fixed!=="right")&&(p=!0):(h&&h.fixed==="right"||u&&u.fixed==="left")&&(p=!0),p){this.rollbackSort();return}this.updateSortAfterDrag()}});this.sortable=i},rollbackSort(){this.sortedTableColumns=JSON.parse(JSON.stringify(this.columnsCopy))},updateSortAfterDrag(){const e=this.$refs.sortListRef;if(!e)return;Array.from(e.children||[]).filter(l=>l&&l.dataset&&l.dataset.prop).map(l=>l.dataset.prop).forEach((l,o)=>{this.sortedTableColumns.some(n=>n.prop===l?(n.sort=o,!0):!1)}),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)),this.$emit("on-sort-change",this.sortedTableColumns)},init(){this.tableColumns=Array.isArray(this.tableColumns)?[...this.tableColumns]:Array.isArray(this.defaultColumnsConfig)?[...this.defaultColumnsConfig]:[],this.initSortedTableColumns()},initSortedTableColumns(){this.tableColumns.forEach((e,i)=>{e.sort===void 0&&(e.sort=i)}),this.sortedTableColumns=[...this.tableColumns].sort((e,i)=>e.fixed==="left"&&i.fixed!=="left"?-1:e.fixed!=="left"&&i.fixed==="left"||e.fixed==="right"&&i.fixed!=="right"?1:e.fixed!=="right"&&i.fixed==="right"?-1:e.sort-i.sort)},setPlacement(){const i=this.$refs.operationRef.$el.getBoundingClientRect();(window.innerHeight||document.documentElement.clientHeight)-(i.bottom-window.scrollY)>512?this.placement="bottom":this.placement="left"},handleVisibleChange(e){this.popoverVisible=e},handlePopoverShow(){this.setPlacement(),this.init(),(()=>{try{document.removeEventListener("mouseup",window.sortableGlobalMouseUp),document.removeEventListener("mousemove",window.sortableGlobalMouseMove)}catch(i){}})(),this.$nextTick(()=>{this.crateSortable()})},handlePopoverHide(){this.sortable&&(this.sortable.destroy(),this.sortable=null);try{document.removeEventListener("mouseup",window.sortableGlobalMouseUp),document.removeEventListener("mousemove",window.sortableGlobalMouseMove),typeof f!="undefined"&&f.utils&&(document.removeEventListener("mousemove",f.utils.throttleCall),document.removeEventListener("mouseup",f.utils.throttleCall))}catch(e){}},handleSelectAll(){const e=this.tableColumns.some(i=>!i.visible);this.tableColumns.forEach(i=>{i.cancellable&&(i.visible=e)})},handleRestoreDefault(){this.tableColumns=JSON.parse(JSON.stringify(this.defaultColumnsConfig)),this.sortedTableColumns=[...this.tableColumns].sort((e,i)=>e.sort-i.sort)},canMoveTop(e,i){if(i===0)return!1;if(e.fixed==="left"){const l=this.sortedTableColumns[i-1];return l&&l.fixed==="left"}if(!e.fixed){const l=this.sortedTableColumns[i-1];return l&&l.fixed==="left"?!1:l&&!l.fixed}return e.fixed==="right"},moveTop(e,i){const l=this.sortedTableColumns,o=e.prop;if(e.fixed==="right"&&(e.fixed=""),e.fixed==="left")l.unshift(l.splice(i,1)[0]);else{const n=this.findLastIndex(this.sortedTableColumns,a=>a.fixed==="left");l.splice(n+1,0,l.splice(i,1)[0])}this.updateSortValues(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)),this.$emit("on-sort-change",this.sortedTableColumns),this.$nextTick(()=>{const n=this.$refs.sortListRef;if(n){const a=Array.from(n.children).find(r=>r.dataset&&r.dataset.prop===o);a&&a.scrollIntoView({behavior:"smooth",block:"nearest"})}})},frozenLeftHandle(e){const i=this.sortedTableColumns,l=i.splice(e,1)[0];if(l.fixed=l.fixed==="left"?"":"left",l.fixed==="left"){const o=this.findLastIndex(this.sortedTableColumns,n=>n.fixed==="left");i.splice(o+1,0,l)}else{const o=this.findLastIndex(this.sortedTableColumns,n=>n.fixed==="left");i.splice(o+1,0,l)}this.updateSortValues(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)),this.$emit("on-sort-change",this.sortedTableColumns)},frozenRightHandle(e){const i=this.sortedTableColumns,l=i.splice(e,1)[0];if(l.fixed=l.fixed==="right"?"":"right",l.fixed==="right"){const o=i.findIndex(n=>n.fixed==="right");o===-1?i.push(l):i.splice(o,0,l)}else{const o=i.findIndex(n=>n.fixed==="right");o===-1?i.push(l):i.splice(o,0,l)}this.updateSortValues(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)),this.$emit("on-sort-change",this.sortedTableColumns)},onSave(){var i;this.updateSortValues();const e=(i=this.tableColumns)==null?void 0:i.map(l=>{const o=this.sortedTableColumns.find(d=>d.prop===l.prop);o&&(l.sort=o.sort,l.fixed=o.fixed,l.visible=o.visible);const r=l,{label:n}=r;return be(r,["label"])});il({key:this.computedTableKey,info:JSON.stringify({columnsConfig:e,defaultColumnsConfig:this.defaultColumnsConfig})}).then(l=>{l.data.code===200&&(this.processedColumns=this.applyColumnConfig(e,!0),this.$emit("complete",{columns:this.processedColumns,config:e,isInitialLoad:!1}),this.$message.success(this.t("saveSuccess")),this.popoverVisible=!1)})},updateSortValues(){this.sortedTableColumns.forEach((e,i)=>{e.sort=i})}},mounted(){var e;(e=this.tableColumns)!=null&&e.length&&(this.initSortedTableColumns(),this.crateSortable(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)))},beforeDestroy(){this.sortable&&(this.sortable.destroy(),this.sortable=null);try{document.removeEventListener("mouseup",window.sortableGlobalMouseUp),document.removeEventListener("mousemove",window.sortableGlobalMouseMove),typeof f!="undefined"&&f.utils&&(document.removeEventListener("mousemove",f.utils.throttleCall),document.removeEventListener("mouseup",f.utils.throttleCall))}catch(e){}}},cl={key:0,class:"container"},hl={class:"main-container"},ul={class:"left-content"},ml={class:"title"},pl={class:"option-list"},fl={style:{height:"100%","overflow-y":"auto"}},gl={class:"right-content"},bl={class:"search-box"},yl={key:0,class:"tips"},Cl={class:"sort-list",ref:"sortListRef"},_l=["data-prop"],Sl={key:0,class:"sort-item"},xl={class:"row-title"},Vl={class:"operation-btns"},kl={class:"footer"},wl={class:"footer-left"},Tl={class:"footer-right"},Fl={style:{display:"inline-block","margin-left":"10px"}};function zl(e,i,l,o,n,a){const r=t.resolveComponent("el-button"),d=t.resolveComponent("TmEllipsisText"),h=t.resolveComponent("el-checkbox"),u=t.resolveComponent("el-input"),p=t.resolveComponent("MoveIcon"),_=t.resolveComponent("DeleteIcon"),k=t.resolveComponent("el-tooltip"),E=t.resolveComponent("UploadIcon"),D=t.resolveComponent("FixedLeftIcon"),F=t.resolveComponent("FixedRightIcon"),s=t.resolveComponent("MenuIcon"),z=t.resolveComponent("el-popover");return t.openBlock(),t.createBlock(z,t.mergeProps({"popper-class":"column-config-popover"},{[n.isVue3?"visible":"value"]:n.popoverVisible},t.toHandlers({[n.isVue3?"update:visible":"input"]:a.handleVisibleChange}),{width:680,"show-arrow":!1,placement:n.placement,trigger:"click",onShow:a.handlePopoverShow,onHide:a.handlePopoverHide}),{reference:t.withCtx(()=>[t.createElementVNode("div",Fl,[t.createVNode(k,t.mergeProps({content:n.t("columnSetting")},n.afterOpenDelay,{placement:"top"}),{default:t.withCtx(()=>[t.createVNode(r,{size:n.getDefaultSize(),ref:"operationRef",circle:""},{default:t.withCtx(()=>[t.createVNode(s)]),_:1},8,["size"])]),_:1},16,["content"])])]),default:t.withCtx(()=>[n.popoverVisible?(t.openBlock(),t.createElementBlock("div",cl,[t.createElementVNode("div",hl,[t.createElementVNode("div",ul,[t.createElementVNode("div",ml,[t.createElementVNode("span",null,t.toDisplayString(n.t("SelectableFields"))+"("+t.toDisplayString(n.tableColumns.length)+")",1),t.createVNode(r,t.mergeProps({style:{"margin-left":"10px"}},n.buttonType,{onClick:a.handleSelectAll}),{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.t("all")),1)]),_:1},16,["onClick"])]),t.createElementVNode("div",pl,[t.createElementVNode("div",fl,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.tableColumns,(c,L)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[c.prop?(t.openBlock(),t.createElementBlock("div",{style:{width:"110px",display:"inline-block"},key:L+c.prop},[t.createVNode(h,{disabled:!c.cancellable,class:"el-checkbox",modelValue:c.visible,"onUpdate:modelValue":A=>c.visible=A,label:c.prop,value:c.prop},{default:t.withCtx(()=>[t.createVNode(d,{width:"80px",text:a.getColumnLabel(c.prop)},null,8,["text"])]),_:2},1032,["disabled","modelValue","onUpdate:modelValue","label","value"])])):t.createCommentVNode("",!0)],64))),256))])])]),t.createElementVNode("div",gl,[t.createElementVNode("div",bl,[t.createVNode(u,{size:n.getCompatSize("small"),class:"search-input",clearable:"",placeholder:n.t("search"),modelValue:n.keyWord,"onUpdate:modelValue":i[0]||(i[0]=c=>n.keyWord=c)},null,8,["size","placeholder","modelValue"])]),a.showFixedLimitTips?(t.openBlock(),t.createElementBlock("div",yl)):t.createCommentVNode("",!0),t.createElementVNode("div",Cl,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.filteredSortedTableColumns,(c,L)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["sort-item-wrapper",[c.fixed==="left"?"frozen":"",c.fixed==="right"?"frozenRight":"",c.fixed?"":"noFrozen"]]),"data-prop":c.prop,key:c.prop},[c.visible?(t.openBlock(),t.createElementBlock("div",Sl,[t.createElementVNode("div",xl,[t.createVNode(p,{style:{"flex-shrink":"0"}}),t.createVNode(d,{text:a.getColumnLabel(c.prop)},null,8,["text"])]),t.createElementVNode("div",Vl,[c.cancellable?(t.openBlock(),t.createBlock(k,t.mergeProps({key:0,content:n.t("cancel"),placement:"top"},{ref_for:!0},n.afterOpenDelay),{default:t.withCtx(()=>[t.createVNode(r,t.mergeProps({ref_for:!0},n.buttonType,{size:n.getCompatSize("mini"),class:"iconfont-button delete-button",onClick:A=>c.visible=!1}),{default:t.withCtx(()=>[t.createVNode(_)]),_:2},1040,["size","onClick"])]),_:2},1040,["content"])):t.createCommentVNode("",!0),a.canMoveTop(c,L)?(t.openBlock(),t.createBlock(k,t.mergeProps({key:1,content:n.t("top"),placement:"top"},{ref_for:!0},n.afterOpenDelay),{default:t.withCtx(()=>[t.createVNode(r,t.mergeProps({ref_for:!0},n.buttonType,{size:n.getCompatSize("mini"),class:"iconfont-button top-button",onClick:A=>a.moveTop(c,L)}),{default:t.withCtx(()=>[t.createVNode(E)]),_:2},1040,["size","onClick"])]),_:2},1040,["content"])):t.createCommentVNode("",!0),c.fixed!=="right"?(t.openBlock(),t.createBlock(k,t.mergeProps({key:2,content:c.fixed==="left"?n.t("cancelLeftFixed"):n.t("leftFixed"),placement:"top"},{ref_for:!0},n.afterOpenDelay),{default:t.withCtx(()=>[t.createVNode(r,t.mergeProps({ref_for:!0},n.buttonType,{size:n.getCompatSize("mini"),class:["iconfont-button left-fixed-btn",{"active-fixed":c.fixed==="left"}],onClick:A=>a.frozenLeftHandle(L),disabled:c.fixed!=="left"&&a.isThanMaxFrozen}),{default:t.withCtx(()=>[t.createVNode(D)]),_:2},1040,["size","class","onClick","disabled"])]),_:2},1040,["content"])):t.createCommentVNode("",!0),c.fixed!=="left"?(t.openBlock(),t.createBlock(k,t.mergeProps({key:3,content:c.fixed==="right"?n.t("cancelRightFixed"):n.t("rightFixed"),placement:"top"},{ref_for:!0},n.afterOpenDelay),{default:t.withCtx(()=>[t.createVNode(r,t.mergeProps({ref_for:!0},n.buttonType,{size:n.getCompatSize("mini"),class:["iconfont-button right-fixed-btn",{"active-fixed":c.fixed==="right"}],onClick:A=>a.frozenRightHandle(L),disabled:c.fixed!=="right"&&a.isThanMaxRightFrozen}),{default:t.withCtx(()=>[t.createVNode(F)]),_:2},1040,["size","class","onClick","disabled"])]),_:2},1040,["content"])):t.createCommentVNode("",!0)])])):t.createCommentVNode("",!0)],10,_l))),128))],512)])]),t.createElementVNode("div",kl,[t.createElementVNode("div",wl,[t.createVNode(r,{size:n.getCompatSize("mini"),onClick:a.handleRestoreDefault},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.t("restoreDefault")),1)]),_:1},8,["size","onClick"])]),t.createElementVNode("div",Tl,[t.createVNode(r,{size:n.getCompatSize("mini"),onClick:i[1]||(i[1]=c=>n.popoverVisible=!1)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.t("cancel")),1)]),_:1},8,["size"]),t.createVNode(r,{size:n.getCompatSize("mini"),type:"primary",onClick:a.onSave},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.t("saveAndApply")),1)]),_:1},8,["size","onClick"])])])])):t.createCommentVNode("",!0)]),_:1},16,["placement","onShow","onHide"])}const Ll=b(dl,[["render",zl],["__scopeId","data-v-fc286487"]]),he=!1,ue=!0;function O(e){if(!Array.isArray(e))return e;const i=[];for(const l of e)if(l)if(typeof l.type=="symbol"&&l.children){let o=l.children;if(typeof o=="function")continue;if(Array.isArray(o)){const n=O(o);i.push(...n)}else{const n=O([o]);i.push(...n)}}else i.push(l);return i}const Bl={name:"TmTable",components:{TableSearch:Z,TablePagination:Yt,TableMenu:tl,ColumnConfig:Ll,RefreshIcon:Te,ColumnRenderer:{props:["vnode"],render(){return this.vnode}}},inheritAttrs:!1,props:{data:{type:[Array,Function],default:()=>[]},showSearch:{type:Boolean,default:!0},showMenu:{type:Boolean,default:!0},showPagination:{type:Boolean,default:!0},pagination:{type:Object,default:()=>({})},height:{type:[String,Number]},calcHeight:{type:Number,default:0},dataAdapter:{type:Function,default:null},columnSettingButton:{type:Boolean,default:!0},refreshButton:{type:Boolean,default:!0},tableKey:{type:String,default:""},firstLoad:{type:Boolean,default:!0},maxFixedLeftQuantity:{type:Number},maxFixedRightQuantity:{type:Number},border:{type:Boolean,default:!0},searchColumns:{type:Array,default:null},searchForm:{type:Object,default:()=>({})},labelWidth:{type:[String,Number],default:void 0},inputWidth:{type:[String,Number],default:void 0},direction:{type:String,default:void 0,validator:e=>!e||["horizontal","vertical"].includes(e)},labelAlign:{type:String,default:"right",validator:e=>["left","right","center"].includes(e)}},data(){return{getDefaultSize:S,getCompatSize:B,isVue3:ue,isVue2:he,t:x().t,tableData:[],tableLoading:!1,columnsLoading:!1,tableReload:1,tableHeight:null,selectedRows:[],paginationInfo:{current:1,pageSize:20,total:void 0},originalColumns:[],displayColumns:[],isColumnConfigLoaded:!1,savedColumnConfig:null,slotsUpdateTrigger:0,lastSlotsHash:null,afterOpenDelay:{"show-after":300}}},computed:{pageLoading(){return this.tableLoading||this.columnsLoading},computedTableKey(){if(this.tableKey)return this.tableKey;if(this.$route&&this.$route.path)return this.$route.path.slice(1).replace(/\//g,"-");throw new Error("tableKey is required")},computedShowPagination(){return this.showPagination&&typeof this.data=="function"},slotsHash(){{this.slotsUpdateTrigger;const e=this.$slots.default?this.$slots.default():[],i=O(e);return this.getColumnsHash(i)}}},watch:{data:{immediate:!0,handler(e){typeof e=="function"?!this.columnSettingButton||this.isColumnConfigLoaded&&!this.firstLoad?this.loadData():Array.isArray(e)&&(this.tableData=e):this.tableData=e}},height:{immediate:!0,handler(){this.getTableHeight()}},slotsHash:{handler(e,i){e&&e!==i&&this.$nextTick(()=>{this.checkAndUpdateColumns()})}}},created(){this.updateColumns()},mounted(){this.getTableHeight(),window.addEventListener("resize",this.getTableHeight)},beforeUpdate(){this.checkAndUpdateColumns()},updated(){this.$nextTick(()=>{this.checkAndUpdateColumns()})},beforeDestroy(){window.removeEventListener("resize",this.getTableHeight)},methods:{updateColumns(){{const e=this.$slots.default();this.originalColumns=O(e)}this.columnSettingButton?this.isColumnConfigLoaded||(this.columnsLoading=!0):(this.displayColumns=this.originalColumns,this.isColumnConfigLoaded=!0)},getColumnsHash(e){return e.map((i,l)=>{var o,n,a,r,d;return i?i.key||((n=(o=i.data)==null?void 0:o.attrs)==null?void 0:n.prop)||((r=(a=i.componentOptions)==null?void 0:a.propsData)==null?void 0:r.prop)||((d=i.props)==null?void 0:d.prop)||`index-${l}`:`null-${l}`}).join(",")},checkAndUpdateColumns(){var e,i;try{const l=he?this.$slots.default||[]:O(((i=(e=this.$slots).default)==null?void 0:i.call(e))||[]),o=this.getColumnsHash(l),n=this.lastSlotsHash||this.getColumnsHash(this.originalColumns);o!==n&&(ue&&this.slotsUpdateTrigger++,this.lastSlotsHash=o,this.originalColumns=l,!this.columnSettingButton||!this.isColumnConfigLoaded?this.displayColumns=this.originalColumns:this.reapplyColumnConfig(),this.$nextTick(()=>{this.$refs.table&&this.$refs.table.doLayout(),this.$forceUpdate()}))}catch(l){}},handleUpdateSearchForm(e){this.$emit("update:search-form",e)},handleColumnConfigComplete(e){Array.isArray(e.columns)?(this.displayColumns=[...e.columns],this.savedColumnConfig=e.config||null):(this.displayColumns=[...this.originalColumns],this.savedColumnConfig=null),e.isInitialLoad?(this.isColumnConfigLoaded=!0,this.columnsLoading=!1,this.firstLoad&&typeof this.data=="function"&&this.loadData()):this.reloadTable()},reapplyColumnConfig(){if(!this.columnSettingButton||!this.isColumnConfigLoaded||!this.savedColumnConfig)return;const e=n=>n.props||{},i={};this.originalColumns.forEach(n=>{const a=e(n);a.prop&&(i[a.prop]=n)});const l=[];this.originalColumns.forEach(n=>{e(n).type==="selection"&&l.push(n)}),[...this.savedColumnConfig].sort((n,a)=>{const r=n.sort!==void 0?n.sort:1/0,d=a.sort!==void 0?a.sort:1/0;return r-d}).forEach(n=>{n.prop&&i[n.prop]&&n.visible!==!1&&l.push(i[n.prop])}),this.originalColumns.forEach(n=>{const a=e(n),r=a.prop,d=a.type;if(r&&d!=="selection"){const h=this.savedColumnConfig.some(p=>p.prop===r),u=l.find(p=>e(p).prop===r);!h&&!u&&l.push(n)}}),this.displayColumns=l},isAutoHeight(){return this.height==="auto"},handleRefresh(){this.loadData()},async loadData(){if(Array.isArray(this.data))this.tableData=this.data;else if(typeof this.data=="function"){if(this.tableLoading)return;this.tableLoading=!0;try{const e=await this.data({paginationInfo:{pageSize:this.paginationInfo.pageSize,current:this.paginationInfo.current},params:this.searchForm}),{list:i,total:l,pageSize:o,current:n}=e;this.tableData=i;let a=g({},this.paginationInfo);l!==void 0&&(a.total=l),n!==void 0&&(a.current=n),o!==void 0&&(a.pageSize=o),this.paginationInfo=a}catch(e){}finally{this.tableLoading=!1}}},getTableHeight(){this.isAutoHeight()?this.$nextTick(()=>{const e=this.$refs.table,i=this.$refs.tmPagination;if(!e)return;const l=e.$el,o=i&&i.$el&&i.$el.offsetHeight||0;this.tableHeight=document.documentElement.clientHeight-l.offsetTop-o-this.calcHeight}):this.tableHeight=this.height,this.refreshTable()},search(){this.paginationInfo.current=1,this.loadData()},reset(){this.paginationInfo.current=1,this.$nextTick(()=>{this.loadData()})},handleSelectionChange(e){this.selectedRows=e,this.$emit("selection-change",e)},handleSizeChange(e){this.paginationInfo.pageSize=e,this.loadData(),this.$emit("size-change",e)},handleCurrentChange(e){this.paginationInfo.current=e,this.loadData(),this.$emit("current-change",e)},refreshTable(){this.$refs.table&&this.$refs.table.doLayout()},reloadTable(){this.tableReload++}}},Nl={class:"tm-table",ref:"tablePage"};function Ol(e,i,l,o,n,a){const r=t.resolveComponent("table-search"),d=t.resolveComponent("RefreshIcon"),h=t.resolveComponent("el-button"),u=t.resolveComponent("el-tooltip"),p=t.resolveComponent("ColumnConfig"),_=t.resolveComponent("table-menu"),k=t.resolveComponent("columnRenderer"),E=t.resolveComponent("el-table"),D=t.resolveComponent("table-pagination"),F=t.resolveDirective("loading");return t.openBlock(),t.createElementBlock("div",Nl,[l.searchColumns&&l.searchColumns.length>0?(t.openBlock(),t.createBlock(r,{key:0,ref:"search",onSearch:a.search,onReset:a.reset,"onUpdate:searchForm":a.handleUpdateSearchForm,disabled:a.pageLoading,"search-columns":l.searchColumns,"search-form":l.searchForm,"label-width":l.labelWidth,"input-width":l.inputWidth,direction:l.direction,"label-align":l.labelAlign},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"search",{},void 0,!0)]),_:3},8,["onSearch","onReset","onUpdate:searchForm","disabled","search-columns","search-form","label-width","input-width","direction","label-align"])):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"between-search-menu",{},void 0,!0),l.showMenu?(t.openBlock(),t.createBlock(_,{key:1},{left:t.withCtx(()=>[t.renderSlot(e.$slots,"menu-left",{},void 0,!0)]),right:t.withCtx(()=>[t.renderSlot(e.$slots,"menu-right",{},void 0,!0),l.refreshButton&&typeof l.data=="function"?(t.openBlock(),t.createBlock(u,t.mergeProps({key:0,content:n.t("refresh"),placement:"top"},n.afterOpenDelay),{default:t.withCtx(()=>[t.createVNode(h,{onClick:a.handleRefresh,circle:"",size:n.getDefaultSize()},{default:t.withCtx(()=>[t.createVNode(d)]),_:1},8,["onClick","size"])]),_:1},16,["content"])):t.createCommentVNode("",!0),l.columnSettingButton?(t.openBlock(),t.createBlock(p,{key:1,maxFixedLeftQuantity:l.maxFixedLeftQuantity,maxFixedRightQuantity:l.maxFixedRightQuantity,tableKey:a.computedTableKey,columns:n.originalColumns,onComplete:a.handleColumnConfigComplete},null,8,["maxFixedLeftQuantity","maxFixedRightQuantity","tableKey","columns","onComplete"])):t.createCommentVNode("",!0)]),_:3})):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"between-menu-table",{},void 0,!0),t.withDirectives((t.openBlock(),t.createBlock(E,t.mergeProps({ref:"table"},T(g({},e.$attrs),{border:l.border}),t.toHandlers(n.isVue2?e.$listeners:{}),{data:n.tableData,height:n.tableHeight,size:n.getCompatSize("mini"),onSelectionChange:a.handleSelectionChange,key:n.tableReload}),{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.displayColumns,s=>(t.openBlock(),t.createBlock(k,{vnode:s,key:`${n.isVue3?s.id:s.data.attrs.prop}-${n.slotsUpdateTrigger}`},null,8,["vnode"]))),128))]),_:1},16,["data","height","size","onSelectionChange"])),[[F,a.pageLoading]]),t.renderSlot(e.$slots,"between-table-pagination",{},void 0,!0),a.computedShowPagination?(t.openBlock(),t.createBlock(D,{key:2,ref:"tmPagination","page-size":n.paginationInfo.pageSize,current:n.paginationInfo.current,total:n.paginationInfo.total,disabled:n.tableLoading,onSizeChange:a.handleSizeChange,onCurrentChange:a.handleCurrentChange},{"pagination-left":t.withCtx(()=>[t.renderSlot(e.$slots,"pagination-left",{},void 0,!0)]),_:3},8,["page-size","current","total","disabled","onSizeChange","onCurrentChange"])):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"after-pagination",{},void 0,!0)],512)}const ee=b(Bl,[["render",Ol],["__scopeId","data-v-cd1d8396"]]),El=!1,Dl=!0,Al={name:"TmTableColumn",inheritAttrs:!1,computed:{isVisible(){return this.$attrs.visible!==!1},slots(){return this.$slots}},data(){return{isVue2:El,isVue3:Dl}},created(){this.$parent&&this.$parent.$emit&&this.$parent.$emit("column-initialized",{prop:this.$attrs.prop,visible:this.$attrs.visible!==!1})}};function Ml(e,i,l,o,n,a){const r=t.resolveComponent("el-table-column");return a.isVisible?(t.openBlock(),t.createBlock(r,t.mergeProps({key:0},e.$attrs,t.toHandlers(n.isVue2?e.$listeners:{})),t.createSlots({_:2},[t.renderList(a.slots,(d,h)=>({name:h,fn:t.withCtx(u=>[t.renderSlot(e.$slots,h,t.normalizeProps(t.guardReactiveProps(u)))])}))]),1040)):t.createCommentVNode("",!0)}const te=b(Al,[["render",Ml]]),{t:le}=x(),Hl={name:"TmAdvancedEllipsisText",components:{CopyIcon:ae},props:{rows:{type:Number,default:1},width:{type:String,default:"100%"},maxWidth:{type:String,default:""},showToolbar:{type:Boolean,default:!1},text:{type:String,default:""},showTooltip:{type:Boolean,default:!0},copyable:{type:Boolean,default:!1}},data(){return{isVue2:!1,originalText:"",isHovered:!1,lineHeight:0,containerWidth:0,resizeObserver:null,isCalculating:!1,frontLines:[],lastLineText:"",isLastLineEllipsis:!1,tableRowElement:null}},computed:{containerStyle(){const e={};return this.maxWidth?(e.maxWidth=this.maxWidth,e.width=this.width):e.width=this.width,e},hasToolbarSlot(){return this.$slots.toolbar?this.$slots.toolbar&&this.$slots.toolbar().length>0:!1},hasToolbarContent(){return this.copyable||this.hasToolbarSlot},shouldShowToolbar(){return this.showToolbar||this.isHovered&&this.hasToolbarContent}},mounted(){this.initComponent(),this.setupResizeObserver(),this.setupTableRowHover()},updated(){const e=this.getTextContent();e!==this.originalText&&(this.originalText=e,this.$nextTick(()=>{this.calculateLayout()}))},beforeDestroy(){this.cleanupResizeObserver(),this.cleanupTableRowHover()},beforeUnmount(){this.cleanupResizeObserver(),this.cleanupTableRowHover()},watch:{text:{handler(){this.$nextTick(()=>{this.originalText=this.getTextContent(),this.calculateLayout()})},immediate:!0},rows(){this.$nextTick(()=>{this.calculateLayout()})},shouldShowToolbar(){this.$nextTick(()=>{this.calculateLayout()})},"$slots.default":{handler(){this.$nextTick(()=>{this.originalText=this.getTextContent(),this.calculateLayout()})},deep:!0}},methods:{initComponent(){this.$nextTick(()=>{this.originalText=this.getTextContent(),this.calculateLineHeight(),this.$nextTick(()=>{this.calculateLayout()})})},handleCopy(){navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(this.originalText).then(()=>{this.$message.success(le("copySuccess"))}).catch(()=>{this.fallbackCopy()}):this.fallbackCopy()},fallbackCopy(){const e=document.createElement("textarea");e.value=this.originalText,e.style.position="fixed",e.style.left="-999999px",e.style.top="-999999px",document.body.appendChild(e),e.focus(),e.select();try{document.execCommand("copy"),this.$message.success(le("copySuccess"))}catch(i){this.$message.error(le("copyFailed"))}document.body.removeChild(e)},getTextContent(){if(this.$slots.default){const e=this.$slots.default;return e().map(i=>typeof i.children=="string"?i.children:Array.isArray(i.children)?i.children.map(l=>l.children||"").join(""):"").join("")}return this.text||""},calculateLineHeight(){const e=this.$refs.containerRef;if(!e)return;const i=window.getComputedStyle(e);this.containerWidth=e.offsetWidth;const l=this.$refs.measureRef;if(l){this.setMeasureElementStyle(l,{width:this.containerWidth+"px",wordBreak:"break-all",whiteSpace:"normal"}),l.textContent="测",l.offsetHeight;const o=l.offsetHeight;l.innerHTML="",this.lineHeight=o}else{const o=i.lineHeight;if(o&&o!=="normal")this.lineHeight=parseInt(o);else{const n=parseInt(i.fontSize);this.lineHeight=n*1.2}}},calculateLayout(){if(!this.isCalculating){if(!this.originalText||this.rows<=0){this.frontLines=[],this.lastLineText=this.originalText||"",this.isLastLineEllipsis=!1;return}this.isCalculating=!0,this.$nextTick(()=>{requestAnimationFrame(()=>{this.performLayoutCalculation()})})}},performLayoutCalculation(){const e=this.originalText;if(this.rows===1)this.frontLines=[],this.lastLineText=e,this.isLastLineEllipsis=this.checkIfTextOverflows(e);else{const i=this.lineHeight;if(this.getTextHeight(e)<=i)this.frontLines=[],this.lastLineText=e,this.isLastLineEllipsis=this.checkIfTextOverflows(e);else{const o=this.lineHeight*(this.rows-1),n=this.findTextForHeight(e,o);this.frontLines=this.splitTextToLines(n);const a=e.substring(n.length);this.lastLineText=a,this.isLastLineEllipsis=a.length>0&&this.checkIfTextOverflows(a)}}this.isCalculating=!1},findTextForHeight(e,i){if(this.getTextHeight(e)<=i)return e;let l=0,o=e.length,n="";for(;l<=o;){const a=Math.floor((l+o)/2),r=e.substring(0,a);this.getTextHeight(r)<=i?(n=r,l=a+1):o=a-1}return n},splitTextToLines(e){if(!e)return[];const i=[];let l=e;for(;l.length>0;){const o=this.findTextForHeight(l,this.lineHeight);if(o.length===0)break;i.push(o),l=l.substring(o.length)}return i},checkIfTextOverflows(e){if(!e)return!1;const i=this.getTextWidth(e),l=this.shouldShowToolbar&&this.hasToolbarContent?this.getToolbarWidth():0,o=this.containerWidth-l-5;return i>o},getToolbarWidth(){let e=0;return this.copyable&&(e+=20),this.hasToolbarSlot&&(e+=40),e},getTextHeight(e){return this.measureText(e,{width:this.containerWidth+"px",wordBreak:"break-all",whiteSpace:"normal"})},getTextWidth(e){return this.measureText(e,{whiteSpace:"nowrap"})},measureText(e,i={}){if(!this.$refs.containerRef||!this.$refs.measureRef)return 0;const l=this.$refs.measureRef,o=l.style.cssText;this.setMeasureElementStyle(l,i),l.textContent=e,l.offsetHeight;const n=i.whiteSpace==="nowrap"?l.offsetWidth:l.offsetHeight;return l.style.cssText=o,l.innerHTML="",n},setMeasureElementStyle(e,i={}){const l=window.getComputedStyle(this.$refs.containerRef);e.style.cssText="",e.style.position="absolute",e.style.left="-9999px",e.style.top="-9999px",e.style.visibility="hidden",e.style.pointerEvents="none",e.style.zIndex="-1",e.style.fontSize=l.fontSize,e.style.fontFamily=l.fontFamily,e.style.fontWeight=l.fontWeight,e.style.lineHeight=l.lineHeight,e.style.letterSpacing=l.letterSpacing,e.style.wordSpacing=l.wordSpacing,e.style.padding="0",e.style.margin="0",e.style.border="none",e.style.boxSizing="border-box",Object.entries(i).forEach(([o,n])=>{e.style[o]=n})},handleMouseEnter(){this.isHovered=!0},handleMouseLeave(){this.isHovered=!1},setupResizeObserver(){typeof ResizeObserver!="undefined"&&(this.resizeObserver=new ResizeObserver(e=>{const i=e[0];if(i){const l=i.contentRect.width;Math.abs(l-this.containerWidth)>1&&requestAnimationFrame(()=>{this.calculateLineHeight(),this.calculateLayout()})}}),this.$refs.containerRef&&this.resizeObserver.observe(this.$refs.containerRef))},cleanupResizeObserver(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)},setupTableRowHover(){let e=this.$el;for(;e&&e!==document.body;){if(e.classList&&e.classList.contains("el-table__row")){this.tableRowElement=e;break}e=e.parentElement}this.tableRowElement&&(this.tableRowElement.addEventListener("mouseenter",this.handleMouseEnter),this.tableRowElement.addEventListener("mouseleave",this.handleMouseLeave))},cleanupTableRowHover(){this.tableRowElement&&(this.tableRowElement.removeEventListener("mouseenter",this.handleMouseEnter),this.tableRowElement.removeEventListener("mouseleave",this.handleMouseLeave),this.tableRowElement=null)}}},Rl={class:"tm-ellipsis-text-wrapper"},vl=["innerHTML"],Il={class:"tm-ellipsis-last-line"},Pl=["innerHTML"],Wl={key:0,class:"tm-ellipsis-toolbar-part"},Ul={key:1,class:"tm-ellipsis-text-wrapper"},jl=["innerHTML"],Jl={class:"tm-ellipsis-last-line"},Kl=["innerHTML"],Ql={key:0,class:"tm-ellipsis-toolbar-part"},ql={ref:"measureRef",class:"tm-ellipsis-measure"};function Yl(e,i,l,o,n,a){const r=t.resolveComponent("CopyIcon"),d=t.resolveComponent("el-tooltip");return t.openBlock(),t.createElementBlock("div",{ref:"containerRef",style:t.normalizeStyle(a.containerStyle),class:"tm-ellipsis-text",onMouseenter:i[0]||(i[0]=(...h)=>a.handleMouseEnter&&a.handleMouseEnter(...h)),onMouseleave:i[1]||(i[1]=(...h)=>a.handleMouseLeave&&a.handleMouseLeave(...h))},[l.showTooltip&&n.isLastLineEllipsis?(t.openBlock(),t.createBlock(d,t.mergeProps({key:0,content:n.originalText,disabled:!l.showTooltip||!n.isLastLineEllipsis},{[n.isVue2?"open-delay":"show-after"]:300},{placement:"top"}),{default:t.withCtx(()=>[t.createElementVNode("div",Rl,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.frontLines,(h,u)=>(t.openBlock(),t.createElementBlock("div",{key:"front-"+u,class:"tm-ellipsis-line",innerHTML:h},null,8,vl))),128)),t.createElementVNode("div",Il,[t.createElementVNode("div",{class:"tm-ellipsis-text-part",innerHTML:n.lastLineText},null,8,Pl),a.shouldShowToolbar&&a.hasToolbarContent?(t.openBlock(),t.createElementBlock("div",Wl,[l.copyable?(t.openBlock(),t.createBlock(r,{key:0,class:"icon-item",onClick:a.handleCopy},null,8,["onClick"])):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"toolbar",{},void 0,!0)])):t.createCommentVNode("",!0)])])]),_:3},16,["content","disabled"])):(t.openBlock(),t.createElementBlock("div",Ul,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.frontLines,(h,u)=>(t.openBlock(),t.createElementBlock("div",{key:"front-"+u,class:"tm-ellipsis-line",innerHTML:h},null,8,jl))),128)),t.createElementVNode("div",Jl,[t.createElementVNode("div",{class:"tm-ellipsis-text-part",innerHTML:n.lastLineText},null,8,Kl),a.shouldShowToolbar&&a.hasToolbarContent?(t.openBlock(),t.createElementBlock("div",Ql,[l.copyable?(t.openBlock(),t.createBlock(r,{key:0,class:"icon-item",onClick:a.handleCopy},null,8,["onClick"])):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"toolbar",{},void 0,!0)])):t.createCommentVNode("",!0)])])),t.createElementVNode("div",ql,null,512)],36)}const ie=b(Hl,[["render",Yl],["__scopeId","data-v-14f27c2e"]]),me={install:{install(e,i={}){[ee,te,N,ie].forEach(l=>e.component(l.name,l)),i.tableConfigProvider&&nl(i.tableConfigProvider),i.lang&&H(i.lang||"zh-CN")}}.install,Table:ee,Column:te,Search:Z,Select:U,Input:j,Date:J,Cascader:K,Radio:Q,Checkbox:q,Switch:Y,Textarea:X,EllipsisText:N,AdvancedEllipsisText:ie,setLang:H,useLocale:x};typeof window!="undefined"&&window.Vue&&me.install(window.Vue),m.AdvancedEllipsisText=ie,m.Cascader=K,m.Checkbox=q,m.Column=te,m.Date=J,m.EllipsisText=N,m.Input=j,m.Radio=Q,m.Search=Z,m.Select=U,m.Switch=Y,m.Table=ee,m.Textarea=X,m.default=me,m.setLang=H,m.useLocale=x,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tm-table",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.8",
|
|
4
4
|
"description": "A table component for Vue",
|
|
5
5
|
"main": "dist/vue2/tm-table.umd.js",
|
|
6
6
|
"module": "dist/vue2/tm-table.es.js",
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"require": "./dist/vue3/tm-table.umd.js",
|
|
28
28
|
"default": "./dist/vue3/tm-table.umd.js"
|
|
29
29
|
},
|
|
30
|
-
"./style": "./dist/vue2/tm-table.css"
|
|
30
|
+
"./style": "./dist/vue2/tm-table.css",
|
|
31
|
+
"./v3/style": "./dist/vue3/tm-table.css"
|
|
31
32
|
},
|
|
32
33
|
"dependencies": {
|
|
33
34
|
"sortablejs": "^1.15.6"
|