lvc-ui 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,619 +0,0 @@
1
- (function(E,T){typeof exports=="object"&&typeof module<"u"?T(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],T):(E=typeof globalThis<"u"?globalThis:E||self,T(E.LvcUI={},E.Vue))})(this,function(E,T){"use strict";function R(t,e,i,r,n,s,a,l){var d=typeof t=="function"?t.options:t;return e&&(d.render=e,d.staticRenderFns=i,d._compiled=!0),{exports:t,options:d}}const Ie={name:"LvcButton",props:{type:{type:String,default:"default"},plain:{type:Boolean,default:!1},round:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},icon:{type:String,default:""}},methods:{handleClick(t){!this.disabled&&!this.loading&&this.$emit("click",t)}}};var Ne=function(){var e=this,i=e._self._c;return i("button",{staticClass:"lvc-button",class:["lvc-button--"+e.type,{"is-plain":e.plain,"is-round":e.round,"is-circle":e.circle,"is-disabled":e.disabled||e.loading}],attrs:{disabled:e.disabled||e.loading},on:{click:e.handleClick}},[e.loading?i("i",{staticClass:"lvc-icon-loading"}):e._e(),e.icon&&!e.loading?i("i",{class:e.icon}):e._e(),e.$slots.default?i("span",[e._t("default")],2):e._e()])},He=[],Be=R(Ie,Ne,He);const me=Be.exports,Fe={name:"LvcDialog",props:{visible:{type:Boolean,default:!1},title:{type:String,default:"提示"},content:{type:String,default:""},width:{type:String,default:"44.32vmin"},confirmText:{type:String,default:"确定"},cancelText:{type:String,default:"取消"},showCancel:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},showFooter:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0}},methods:{close(){this.$emit("update:visible",!1),this.$emit("close")},handleCancel(){this.$emit("cancel"),this.close()},handleConfirm(){this.$emit("confirm")},handleMaskClick(){this.closeOnClickModal&&this.close()}}};var ze=function(){var e=this,i=e._self._c;return i("transition",{attrs:{name:"lvc-dialog-fade"}},[e.visible?i("div",{staticClass:"lvc-dialog-mask",on:{click:function(r){return r.target!==r.currentTarget?null:e.handleMaskClick.apply(null,arguments)}}},[i("transition",{attrs:{name:"lvc-dialog-zoom"}},[e.visible?i("div",{staticClass:"lvc-dialog-box",style:{width:e.width}},[i("div",{staticClass:"lvc-dialog-header"},[i("span",{staticClass:"lvc-dialog-title"},[e._v(e._s(e.title))]),e.showClose?i("span",{staticClass:"lvc-dialog-close",on:{click:e.close}},[e._v("×")]):e._e()]),i("div",{staticClass:"lvc-dialog-body"},[e._t("default",function(){return[e._v(e._s(e.content))]})],2),e.showFooter?i("div",{staticClass:"lvc-dialog-footer"},[e.showCancel?i("button",{staticClass:"lvc-dialog-btn",on:{click:e.handleCancel}},[e._v(e._s(e.cancelText))]):e._e(),i("button",{staticClass:"lvc-dialog-btn lvc-dialog-btn-primary",on:{click:e.handleConfirm}},[e._v(e._s(e.confirmText))])]):e._e()]):e._e()])],1):e._e()])},We=[],Ve=R(Fe,ze,We);const Q=Ve.exports;let V=[],je=0;const Ke={name:"LvcSelect",props:{value:{type:[String,Number],default:""},options:{type:Array,default:()=>[]},placeholder:{type:String,default:"请选择"},clearable:{type:Boolean,default:!0}},data(){return{isOpen:!1,dropdownElement:null,overlayElement:null,selectId:`lvc-select-${++je}`}},computed:{selectedLabel(){const t=this.options.find(e=>e.value===this.value);return t?t.label:""}},methods:{toggleDropdown(){this.isOpen?this.closeDropdown():(this.closeOtherSelects(),this.openDropdown())},openDropdown(){this.isOpen=!0,V.push(this),this.$nextTick(()=>this.createDropdown())},closeDropdown(){this.isOpen=!1,V=V.filter(t=>t.selectId!==this.selectId),this.removeDropdown()},closeOtherSelects(){V.forEach(t=>{t.selectId!==this.selectId&&t.closeDropdown()})},createDropdown(){this.removeDropdown(),this.dropdownElement=document.createElement("div"),this.dropdownElement.className="lvc-select-dropdown";const t=document.createElement("ul");t.className="lvc-select-list",this.options.forEach(e=>{const i=document.createElement("li");i.className=`lvc-select-item ${e.value===this.value?"is-selected":""} ${e.disabled?"is-disabled":""}`,i.textContent=e.label,i.addEventListener("click",r=>{r.stopPropagation(),this.selectOption(e)}),t.appendChild(i)}),this.dropdownElement.appendChild(t),document.body.appendChild(this.dropdownElement),this.overlayElement=document.createElement("div"),this.overlayElement.style.cssText="position:fixed;top:0;left:0;right:0;bottom:0;z-index:9998;",document.body.appendChild(this.overlayElement),this.updateDropdownPosition(),this.addEventListeners(),setTimeout(()=>{this.dropdownElement&&(this.dropdownElement.style.opacity="1",this.dropdownElement.style.transform="translateY(0)")},10)},updateDropdownPosition(){const t=this.$el.querySelector(".lvc-select-wrapper");if(t&&this.dropdownElement){const e=t.getBoundingClientRect();this.dropdownElement.style.width=`${e.width}px`,this.dropdownElement.offsetHeight;const i=this.dropdownElement.getBoundingClientRect();let r=e.bottom+8,n=e.left;const s=window.innerHeight,a=window.innerWidth;r+i.height>s&&(r=e.top-i.height-8,r<0&&(r=e.bottom+8,this.dropdownElement.style.maxHeight=`${s-r-10}px`)),n+i.width>a&&(n=a-i.width-10,n<0&&(n=10,this.dropdownElement.style.width=`${a-20}px`)),this.dropdownElement.style.position="fixed",this.dropdownElement.style.top=`${Math.round(r)}px`,this.dropdownElement.style.left=`${Math.round(n)}px`}},addEventListeners(){this.handleScroll=this.updateDropdownPosition.bind(this),this.handleResize=this.updateDropdownPosition.bind(this),window.addEventListener("scroll",this.handleScroll,!0),window.addEventListener("resize",this.handleResize)},removeEventListeners(){this.handleScroll&&window.removeEventListener("scroll",this.handleScroll,!0),this.handleResize&&window.removeEventListener("resize",this.handleResize)},removeDropdown(){this.removeEventListeners(),this.overlayElement&&this.overlayElement.parentNode&&(document.body.removeChild(this.overlayElement),this.overlayElement=null),this.dropdownElement&&this.dropdownElement.parentNode&&(document.body.removeChild(this.dropdownElement),this.dropdownElement=null)},selectOption(t){t.disabled||(this.$emit("input",t),this.$emit("change",t),this.closeDropdown())},handleClear(){this.$emit("input",""),this.$emit("change",""),this.$emit("clear"),this.closeDropdown()},clickOutside(t){const e=this.$refs.selectContainer;e&&!e.contains(t.target)&&(!this.dropdownElement||!this.dropdownElement.contains(t.target))&&this.closeDropdown()},bindGlobalClickEvents(){if(window.top&&window.top!==window)try{const t=()=>this.closeDropdown();this._topHandler=t,window.top.document.addEventListener("click",t)}catch{}if(window.parent&&window.parent!==window)try{const t=()=>this.closeDropdown();this._parentHandler=t,window.parent.document.addEventListener("click",t)}catch{}},unbindGlobalClickEvents(){if(window.top&&window.top!==window&&this._topHandler)try{window.top.document.removeEventListener("click",this._topHandler)}catch{}if(window.parent&&window.parent!==window&&this._parentHandler)try{window.parent.document.removeEventListener("click",this._parentHandler)}catch{}}},mounted(){document.addEventListener("click",this.clickOutside),this.bindGlobalClickEvents()},beforeDestroy(){document.removeEventListener("click",this.clickOutside),this.unbindGlobalClickEvents(),this.closeDropdown()}};var qe=function(){var e=this,i=e._self._c;return i("div",{ref:"selectContainer",staticClass:"lvc-select"},[i("div",{staticClass:"lvc-select-wrapper",class:{"is-active":e.isOpen},on:{click:e.toggleDropdown}},[i("span",{staticClass:"lvc-select-label",class:{"lvc-select-placeholder":!e.selectedLabel}},[e._v(" "+e._s(e.selectedLabel||e.placeholder)+" ")]),i("div",{staticClass:"lvc-select-suffix",class:{"is-clearable":e.clearable&&e.value!==""&&e.value!==null}},[e.clearable?i("span",{staticClass:"lvc-icon-clear",on:{click:function(r){return r.stopPropagation(),e.handleClear.apply(null,arguments)}}},[e._v("✕")]):e._e(),i("span",{staticClass:"lvc-icon-arrow",style:{transform:e.isOpen?"rotate(180deg)":"none"}},[e._v("▼")])])])])},Ue=[],Ge=R(Ke,qe,Ue);const fe=Ge.exports,Xe={name:"LvcSwitch",props:{value:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},width:{type:Number,default:34},height:{type:Number,default:18},activeColor:{type:String,default:"#42A3D6"},inactiveColor:{type:String,default:"#395E7C"},dotColor:{type:String,default:"#ffffff"}},computed:{dotSize(){return this.height-4},switchStyle(){return{width:this.width+"px",height:this.height+"px",borderRadius:this.height/2+"px",background:this.value?this.activeColor:this.inactiveColor,position:"relative",cursor:this.disabled?"not-allowed":"pointer",transition:"0.3s"}},dotStyle(){const t=this.value?this.width-this.height+2:2;return{width:this.dotSize+"px",height:this.dotSize+"px",background:this.dotColor,borderRadius:"50%",position:"absolute",top:"2px",left:t+"px",transition:"0.3s"}}},methods:{toggle(){this.disabled||(this.$emit("input",!this.value),this.$emit("change",!this.value))}}};var Qe=function(){var e=this,i=e._self._c;return i("div",{staticClass:"lvc-switch",class:{"is-disabled":e.disabled},style:e.switchStyle,on:{click:e.toggle}},[i("div",{staticClass:"lvc-dot",style:e.dotStyle})])},Je=[],Ze=R(Xe,Qe,Je);const ve=Ze.exports,et={name:"LvcTable",props:{data:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]},stripe:{type:Boolean,default:!0},selection:{type:Boolean,default:!1}},data(){return{selectedRows:[],sortProp:"",sortOrder:""}},computed:{processedData(){let t=[...this.data];return this.sortProp&&this.sortOrder&&t.sort((e,i)=>{const r=e[this.sortProp],n=i[this.sortProp];if(r===n)return 0;const s=r>n?1:-1;return this.sortOrder==="asc"?s:-s}),t},isAllSelected(){return this.data.length>0&&this.selectedRows.length===this.data.length}},methods:{toggleRowSelection(t){const e=this.selectedRows.findIndex(i=>i===t);e>-1?this.selectedRows.splice(e,1):this.selectedRows.push(t),this.$emit("selection-change",[...this.selectedRows])},toggleAllSelection(){this.isAllSelected?this.selectedRows=[]:this.selectedRows=[...this.data],this.$emit("selection-change",[...this.selectedRows])},handleSort(t){t.sortable&&(this.sortProp!==t.prop?(this.sortProp=t.prop,this.sortOrder="asc"):this.sortOrder==="asc"?this.sortOrder="desc":this.sortOrder==="desc"&&(this.sortOrder="",this.sortProp=""),this.$emit("sort-change",{prop:this.sortProp,order:this.sortOrder}))}}};var tt=function(){var e=this,i=e._self._c;return i("div",{staticClass:"lvc-table-container"},[i("div",{staticClass:"lvc-table-header-wrapper"},[i("table",{staticClass:"lvc-table"},[i("colgroup",[e.selection?i("col",{attrs:{width:"50"}}):e._e(),e._l(e.columns,function(r){return i("col",{key:r.prop,attrs:{width:r.width||""}})})],2),i("thead",[i("tr",[e.selection?i("th",{staticStyle:{"text-align":"center"}},[i("div",{staticClass:"lvc-checkbox",class:{checked:e.isAllSelected},on:{click:e.toggleAllSelection}})]):e._e(),e._l(e.columns,function(r){return i("th",{key:r.prop,class:[r.align?"lvc-table-column-"+r.align:"",{"is-sortable":r.sortable},e.sortProp===r.prop?"sorting-"+e.sortOrder:""],on:{click:function(n){return e.handleSort(r)}}},[e.$scopedSlots["header-"+r.prop.toLowerCase()]?e._t("header-"+r.prop.toLowerCase(),null,{column:r}):[e._v(e._s(r.label))],r.sortable?i("span",{staticClass:"lvc-sort-box"},[i("i",{staticClass:"lvc-sort-caret lvc-sort-up"}),i("i",{staticClass:"lvc-sort-caret lvc-sort-down"})]):e._e()],2)})],2)])])]),i("div",{staticClass:"lvc-table-body-wrapper"},[i("table",{staticClass:"lvc-table",class:{"lvc-table-stripe":e.stripe}},[i("colgroup",[e.selection?i("col",{attrs:{width:"50"}}):e._e(),e._l(e.columns,function(r){return i("col",{key:r.prop,attrs:{width:r.width||""}})})],2),i("tbody",e._l(e.processedData,function(r,n){return i("tr",{key:n,class:{"is-selected":e.selectedRows.includes(r)}},[e.selection?i("td",{staticStyle:{"text-align":"center"}},[i("div",{staticClass:"lvc-checkbox",class:{checked:e.selectedRows.includes(r)},on:{click:function(s){return e.toggleRowSelection(r)}}})]):e._e(),e._l(e.columns,function(s){return i("td",{key:s.prop,class:s.align?"lvc-table-column-"+s.align:""},[e.$scopedSlots[s.prop.toLowerCase()]?e._t(s.prop.toLowerCase(),null,{row:r,index:n}):[e._v(e._s(r[s.prop]))]],2)})],2)}),0)]),!e.data||e.data.length===0?i("div",{staticClass:"lvc-table-empty"},[e._v("暂无数据")]):e._e()])])},it=[],nt=R(et,tt,it);const ge=nt.exports,st={name:"LvcTimePicker",props:{value:{type:String,default:"00:00"},disabled:{type:Boolean,default:!1}},data(){return{isPanelOpen:!1,tempHour:"00",tempMinute:"00",overlayElement:null}},computed:{hours(){const t=[];for(let e=0;e<=24;e++)t.push(String(e).padStart(2,"0"));return t},minutes(){const t=[];for(let e=0;e<60;e++)t.push(String(e).padStart(2,"0"));return t}},watch:{value:{immediate:!0,handler(t){const e=t||"00:00",[i,r]=e.split(":");this.tempHour=i||"00",this.tempMinute=r||"00"}}},methods:{togglePanel(){this.isPanelOpen=!this.isPanelOpen,this.isPanelOpen?(this.createOverlay(),this.$nextTick(()=>{this.updatePosition(),this.scrollToSelected()})):this.removeOverlay()},closePanel(){this.isPanelOpen=!1,this.removeOverlay()},createOverlay(){this.overlayElement||(this.overlayElement=document.createElement("div"),this.overlayElement.style.cssText="position:fixed;top:0;left:0;right:0;bottom:0;z-index:999998;",document.body.appendChild(this.overlayElement))},removeOverlay(){this.overlayElement&&this.overlayElement.parentNode&&(this.overlayElement.parentNode.removeChild(this.overlayElement),this.overlayElement=null)},selectHour(t){this.tempHour=t,t==="24"&&(this.tempMinute="00")},selectMinute(t){this.tempHour!=="24"&&(this.tempMinute=t)},handleConfirm(){const t=`${this.tempHour}:${this.tempMinute}`;this.$emit("input",t),this.$emit("change",t),this.closePanel()},scrollToSelected(){const t=this.$refs.panel.querySelectorAll(".hour-column .lvc-time-item"),e=this.$refs.panel.querySelectorAll(".minute-column .lvc-time-item"),i=Array.from(t).find(n=>n.dataset.val===this.tempHour),r=Array.from(e).find(n=>n.dataset.val===this.tempMinute);i&&i.scrollIntoView({block:"center",behavior:"auto"}),r&&r.scrollIntoView({block:"center",behavior:"auto"})},updatePosition(){if(!this.isPanelOpen||!this.$refs.panel||!this.$refs.inputWrapper)return;const t=this.$refs.inputWrapper.getBoundingClientRect(),e=this.$refs.panel,i=e.offsetHeight||window.innerHeight*.25,r=8,n=window.innerHeight-t.bottom,s=t.top;n<i&&s>n?e.style.top=`${t.top-i-r}px`:e.style.top=`${t.bottom+r}px`,e.style.left=`${t.left}px`},handleOutsideClick(t){const e=this.$refs.inputWrapper&&this.$refs.inputWrapper.contains(t.target),i=this.$refs.panel&&this.$refs.panel.contains(t.target);!e&&!i&&this.closePanel()},handleScroll(){this.isPanelOpen&&this.updatePosition()}},mounted(){this.$refs.panel&&document.body.appendChild(this.$refs.panel),document.addEventListener("click",this.handleOutsideClick),window.addEventListener("scroll",this.handleScroll,!0),window.addEventListener("resize",this.updatePosition)},beforeDestroy(){this.$refs.panel&&this.$refs.panel.parentNode&&this.$refs.panel.parentNode.removeChild(this.$refs.panel),document.removeEventListener("click",this.handleOutsideClick),window.removeEventListener("scroll",this.handleScroll,!0),window.removeEventListener("resize",this.updatePosition)}};var rt=function(){var e=this,i=e._self._c;return i("div",{staticClass:"lvc-time-picker"},[i("div",{ref:"inputWrapper",staticClass:"lvc-time-input-wrapper",class:{"is-active":e.isPanelOpen&&!e.disabled},on:{click:function(r){return r.stopPropagation(),e.togglePanel.apply(null,arguments)}}},[i("span",{staticClass:"lvc-time-value"},[e._v(e._s(e.value))]),i("span",{staticClass:"lvc-time-icon"},[e._v("▼")])]),i("div",{directives:[{name:"show",rawName:"v-show",value:e.isPanelOpen&&!e.disabled,expression:"isPanelOpen && !disabled"}],ref:"panel",staticClass:"lvc-time-panel",on:{click:function(r){r.stopPropagation()}}},[i("div",{staticClass:"lvc-time-spinner"},[i("div",{staticClass:"lvc-time-column hour-column"},e._l(e.hours,function(r){return i("div",{key:"h"+r,staticClass:"lvc-time-item",class:{"is-selected":e.tempHour===r},attrs:{"data-val":r},on:{click:function(n){return e.selectHour(r)}}},[e._v(e._s(r))])}),0),i("div",{staticClass:"lvc-time-column minute-column"},e._l(e.minutes,function(r){return i("div",{key:"m"+r,staticClass:"lvc-time-item",class:{"is-selected":e.tempMinute===r,"is-disabled":e.tempHour==="24"&&r!=="00"},attrs:{"data-val":r},on:{click:function(n){return e.selectMinute(r)}}},[e._v(e._s(r))])}),0)]),i("div",{staticClass:"lvc-time-footer"},[i("button",{staticClass:"lvc-btn lvc-btn-cancel",on:{click:e.closePanel}},[e._v("取消")]),i("button",{staticClass:"lvc-btn lvc-btn-confirm",on:{click:e.handleConfirm}},[e._v("确定")])])])])},at=[],lt=R(st,rt,at);const ye=lt.exports,ot={name:"LvcLoadMore",props:{loading:{type:Boolean,default:!1},finished:{type:Boolean,default:!1},distance:{type:String,default:"0px"},container:{type:String,default:""},loadingText:{type:String,default:"正在加载更多..."},finishedText:{type:String,default:"没有更多数据了"}},data(){return{observer:null}},mounted(){this.initObserver()},beforeDestroy(){this.observer&&(this.observer.disconnect(),this.observer=null)},methods:{initObserver(){const e={root:this.container?document.querySelector(this.container):null,rootMargin:`0px 0px ${this.distance} 0px`,threshold:0};this.observer=new IntersectionObserver(i=>{i[0].isIntersecting&&this.handleIntersect()},e),this.observer.observe(this.$el)},handleIntersect(){this.loading||this.finished||this.$emit("load")}},watch:{loading(t){!t&&!this.finished&&this.$nextTick(()=>{this.observer&&this.$el&&(this.observer.unobserve(this.$el),this.observer.observe(this.$el))})}}};var ct=function(){var e=this,i=e._self._c;return i("div",{staticClass:"lvc-load-more"},[e.loading?[i("div",{staticClass:"lvc-load-more-spinner"}),i("span",{staticClass:"lvc-load-more-text"},[e._v(e._s(e.loadingText))])]:e.finished?[i("span",{staticClass:"lvc-load-more-text lvc-load-more-disabled"},[e._v(e._s(e.finishedText))])]:void 0],2)},ht=[],dt=R(ot,ct,ht);const be=dt.exports;let j=[],pt=0;const ut={name:"LvcDatePicker",props:{value:{type:[String,Array],default:""},type:{type:String,default:"date"},rangeSeparator:{type:String,default:"至"},singlePanel:{type:Boolean,default:!1}},data(){const t=new Date;return{isPanelOpen:!1,activeTimePop:null,timeState:{start:{h:"00",m:"00"},end:{h:"00",m:"00"}},selectingRangePart:"start",calendars:[{year:t.getFullYear(),month:t.getMonth()},{year:t.getFullYear(),month:t.getMonth()+1>11?0:t.getMonth()+1}],panelElement:null,overlayElement:null,datePickerId:`lvc-date-picker-${++pt}`,hoverDate:null}},computed:{isRangeMode(){return this.type.includes("range")},showDoubleInput(){return this.type.includes("range")||this.type==="datetimestartorend"},supportTime(){return this.type.includes("time")},displayValues(){return Array.isArray(this.value)?[this.value[0]||"",this.value[1]||""]:["",""]},visibleCalendars(){return this.singlePanel&&(this.type==="daterange"||this.type==="datetimerange")?[this.calendars[0]]:this.isRangeMode?this.calendars:[this.calendars[0]]}},methods:{formatPad(t){return String(t).padStart(2,"0")},handleTogglePanel(){this.isPanelOpen?this.closePanel():(this.closeOtherDatePickers(),this.openPanel())},openPanel(){this.isPanelOpen=!0,j.push(this),this.syncInternalStateFromValue(),this.$nextTick(()=>this.createPanel())},closePanel(){this.isPanelOpen=!1,this.selectingRangePart="start",j=j.filter(t=>t.datePickerId!==this.datePickerId),this.removePanel()},closeOtherDatePickers(){j.forEach(t=>{t.datePickerId!==this.datePickerId&&t.closePanel()})},createPanel(){if(this.panelElement&&document.body.contains(this.panelElement)){this.updatePanelContent(),this.updatePanelPosition();return}this.removePanel(),this.panelElement=document.createElement("div"),this.panelElement.className="lvc-picker-panel",this.panelElement.style.position="fixed",this.panelElement.style.zIndex="9999",this.panelElement.style.opacity="0",this.panelElement.style.transform="translateY(1.662vmin) scale(0.98)",this.panelElement.style.transition="opacity 0.25s cubic-bezier(0.23, 1, 0.32, 1), transform 0.25s cubic-bezier(0.23, 1, 0.32, 1)",this.panelElement.style.background="#0b1a2a",this.panelElement.style.border="1px solid #12bbed",this.panelElement.style.boxShadow="0 1.385vmin 4.1551vmin rgba(0, 0, 0, 0.7)",this.panelElement.style.borderRadius="1.108vmin",this.panelElement.style.padding="2.0776vmin",this.panelElement.addEventListener("click",t=>{t.stopPropagation(),this.activeTimePop=null}),this.panelElement.innerHTML=this.generatePanelContent(),document.body.appendChild(this.panelElement),this.overlayElement=document.createElement("div"),this.overlayElement.style.cssText="position:fixed;top:0;left:0;right:0;bottom:0;z-index:9998;",this.overlayElement.addEventListener("click",()=>{}),document.body.appendChild(this.overlayElement),this.updatePanelPosition(),this.addEventListeners(),setTimeout(()=>{this.panelElement.style.opacity="1",this.panelElement.style.transform="translateY(0) scale(1)"},10),this.bindPanelEvents()},updatePanelContent(){this.panelElement&&(this.panelElement.innerHTML=this.generatePanelContent(),this.bindPanelEvents())},generatePanelContent(){const t=this.showDoubleInput?["start","end"]:["start"],e=this.visibleCalendars;let i="";this.supportTime&&(i=`
2
- <div class="lvc-time-bar">
3
- ${t.map(s=>`
4
- <div class="lvc-time-slot" data-mode="${s}">
5
- <div class="lvc-time-btn ${this.activeTimePop===s?"is-active":""}">
6
- <span class="lvc-label">${s==="start"?this.showDoubleInput?"起始":"时间":"结束"}</span>
7
- <span class="lvc-time-val">${this.timeState[s].h}:${this.timeState[s].m}</span>
8
- </div>
9
- ${this.activeTimePop===s?this.generateTimeDropdownHTML(s):""}
10
- </div>`).join("")}
11
- </div>`);let r=`
12
- <div class="lvc-calendars-wrap">
13
- ${e.map((s,a)=>`
14
- <div class="lvc-calendar-box" data-idx="${a}">
15
- <div class="lvc-cal-head">
16
- <span class="lvc-nav-btn" data-direction="-1">❮</span>
17
- <strong>${s.year}年 ${s.month+1}月</strong>
18
- <span class="lvc-nav-btn" data-direction="1">❯</span>
19
- </div>
20
- <div class="lvc-cal-week">
21
- ${["日","一","二","三","四","五","六"].map(l=>`<div>${l}</div>`).join("")}
22
- </div>
23
- <div class="lvc-cal-days">
24
- ${Array.from({length:this.getMonthOffset(s)},()=>'<div class="lvc-day is-empty"></div>').join("")}
25
- ${Array.from({length:this.getDaysCount(s)},(l,d)=>{const c=d+1,h=`${s.year}-${this.formatPad(s.month+1)}-${this.formatPad(c)}`,p=this.getDayStateClass(s,c);return`<div class="lvc-day ${Object.entries(p).filter(([S,$])=>$).map(([S])=>S).join(" ")}" data-date="${h}">${c}</div>`}).join("")}
26
- </div>
27
- </div>`).join("")}
28
- </div>`;return i+r+`
29
- <div class="lvc-panel-footer">
30
- <span class="lvc-action-link" data-action="clear">清空</span>
31
- <div class="lvc-right-actions">
32
- <span class="lvc-action-btn is-outline" data-action="setToNow">此刻</span>
33
- <span class="lvc-action-btn is-primary" data-action="confirm">确定</span>
34
- </div>
35
- </div>`},generateTimeDropdownHTML(t){return`
36
- <div class="lvc-time-dropdown">
37
- <div class="lvc-scroll-col" data-part="h">
38
- <ul>
39
- ${Array.from({length:24},(e,i)=>{const r=this.formatPad(i);return`<li class="${r===this.timeState[t].h?"is-selected":""}" data-value="${r}">${r}</li>`}).join("")}
40
- </ul>
41
- </div>
42
- <div class="lvc-time-divider">:</div>
43
- <div class="lvc-scroll-col" data-part="m">
44
- <ul>
45
- ${Array.from({length:60},(e,i)=>{const r=this.formatPad(i);return`<li class="${r===this.timeState[t].m?"is-selected":""}" data-value="${r}">${r}</li>`}).join("")}
46
- </ul>
47
- </div>
48
- </div>`},bindPanelEvents(){if(!this.panelElement)return;this.panelElement.querySelectorAll(".lvc-time-slot").forEach(s=>{const a=s.dataset.mode,l=s.querySelector(".lvc-time-btn");l&&l.addEventListener("click",d=>{d.stopPropagation(),this.handleToggleTimePop(a)})}),this.panelElement.querySelectorAll(".lvc-nav-btn").forEach(s=>{const a=parseInt(s.dataset.direction),l=s.closest(".lvc-calendar-box");if(l){const d=parseInt(l.dataset.idx);s.addEventListener("click",c=>{c.stopPropagation(),this.handleMonthNav(d,a)})}}),this.panelElement.querySelectorAll(".lvc-day:not(.is-empty)").forEach(s=>{const a=s.dataset.date;if(a){const[l,d,c]=a.split("-").map(Number),h={year:l,month:d-1};s.addEventListener("click",p=>{p.stopPropagation(),this.handleDateSelection(h,c)}),this.isRangeMode&&(s.addEventListener("mouseenter",()=>{this.selectingRangePart==="end"&&this.value[0]&&(this.hoverDate=a,this.updateHoverRangeStyle())}),s.addEventListener("mouseleave",()=>{this.hoverDate&&(this.hoverDate=null,this.clearHoverRangeStyle())}))}}),this.panelElement.querySelectorAll(".lvc-action-link, .lvc-action-btn").forEach(s=>{const a=s.dataset.action;s.addEventListener("click",l=>{l.stopPropagation(),a==="clear"?this.handleClear():a==="setToNow"?this.handleSetToNow():a==="confirm"&&this.handleConfirm()})}),this.panelElement.querySelectorAll(".lvc-time-dropdown").forEach(s=>{s.addEventListener("click",l=>l.stopPropagation()),s.querySelectorAll(".lvc-scroll-col").forEach(l=>{const d=l.dataset.part,c=l.closest(".lvc-time-slot");if(c){const h=c.dataset.mode;l.querySelectorAll("li").forEach(v=>{v.addEventListener("click",S=>{S.stopPropagation(),this.handleSelectTime(h,d,v.dataset.value)})})}})})},updatePanelPosition(){const t=this.$el.querySelector(".lvc-input-wrapper");if(t&&this.panelElement){const e=t.getBoundingClientRect();let i=e.bottom+.1385,r=e.left;const n=window.innerHeight,s=window.innerWidth,a=this.panelElement.getBoundingClientRect();i+a.height>n&&(i=e.top-a.height-.1385,i<0&&(i=e.bottom+.1385,this.panelElement.style.maxHeight=`${n-i-.1731}px`)),r+a.width>s&&(r=s-a.width-.1731,r<0&&(r=.1731,this.panelElement.style.width=`${s-.3463}px`)),this.panelElement.style.top=`${i}px`,this.panelElement.style.left=`${r}px`}},addEventListeners(){this.handleScroll=this.updatePanelPosition.bind(this),this.handleResize=this.updatePanelPosition.bind(this),window.addEventListener("scroll",this.handleScroll,!0),window.addEventListener("resize",this.handleResize)},removeEventListeners(){this.handleScroll&&window.removeEventListener("scroll",this.handleScroll,!0),this.handleResize&&window.removeEventListener("resize",this.handleResize)},removePanel(){this.removeEventListeners(),this.overlayElement&&this.overlayElement.parentNode&&(document.body.removeChild(this.overlayElement),this.overlayElement=null),this.panelElement&&this.panelElement.parentNode&&(document.body.removeChild(this.panelElement),this.panelElement=null)},handleToggleTimePop(t){this.activeTimePop===t?this.activeTimePop=null:this.activeTimePop=t,this.isPanelOpen&&this.$nextTick(()=>this.updatePanelContent())},autoScrollTime(){},handleSelectTime(t,e,i){this.timeState[t][e]=i,this.emitInternalChange(),this.isPanelOpen&&this.$nextTick(()=>this.updatePanelContent())},handleMonthNav(t,e){const i=this.calendars[t],r=new Date(i.year,i.month+e,1);if(i.year=r.getFullYear(),i.month=r.getMonth(),this.isRangeMode){const n=t===0?1:0,s=t===0?1:-1,a=new Date(i.year,i.month+s,1);this.calendars[n].year=a.getFullYear(),this.calendars[n].month=a.getMonth()}this.isPanelOpen&&this.$nextTick(()=>this.updatePanelContent())},getMonthOffset(t){return new Date(t.year,t.month,1).getDay()},getDaysCount(t){return new Date(t.year,t.month+1,0).getDate()},handleDateSelection(t,e){const i=`${t.year}-${this.formatPad(t.month+1)}-${this.formatPad(e)}`;if(this.hoverDate=null,this.type==="datetimestartorend"){const r=this.supportTime?`${i} ${this.timeState.start.h}:${this.timeState.start.m}`:i,n=this.supportTime?`${i} ${this.timeState.end.h}:${this.timeState.end.m}`:i;this.$emit("input",[r,n]),this.isPanelOpen&&this.$nextTick(()=>this.updatePanelContent())}else if(this.isRangeMode){let r=Array.isArray(this.value)?[...this.value]:["",""];const n=!!r[0],s=!!r[1];if(n&&s)r[0]=this.supportTime?`${i} ${this.timeState.start.h}:${this.timeState.start.m}`:i,r[1]="",this.selectingRangePart="end";else if(this.selectingRangePart==="start")r[0]=this.supportTime?`${i} ${this.timeState.start.h}:${this.timeState.start.m}`:i,r[1]&&r[0]>r[1]&&(r[1]=""),this.selectingRangePart="end";else{if(r[1]=this.supportTime?`${i} ${this.timeState.end.h}:${this.timeState.end.m}`:i,r[1]<r[0]){const a=r[0];r[0]=r[1],r[1]=a}this.selectingRangePart="start"}this.$emit("input",r),this.isPanelOpen&&this.$nextTick(()=>this.updatePanelContent())}else{const r=this.supportTime?`${i} ${this.timeState.start.h}:${this.timeState.start.m}`:i;this.$emit("input",r),this.isPanelOpen&&this.$nextTick(()=>this.updatePanelContent())}},getDayStateClass(t,e){const i=`${t.year}-${this.formatPad(t.month+1)}-${this.formatPad(e)}`,r=new Date,n=`${r.getFullYear()}-${this.formatPad(r.getMonth()+1)}-${this.formatPad(r.getDate())}`;let s={"is-today":i===n};if(!this.value)return s;if(this.type==="datetimestartorend"){const a=Array.isArray(this.value)&&this.value[0]?this.value[0].slice(0,10):"";return{...s,"is-active":a===i}}if(this.isRangeMode){const a=(this.value[0]||"").slice(0,10),l=(this.value[1]||"").slice(0,10),d={...s,"is-active":a&&i===a||l&&i===l,"is-in-range":a&&l&&i>a&&i<l};if(this.selectingRangePart==="end"&&a&&this.hoverDate){const c=this.hoverDate,h=a<c?a:c,p=a<c?c:a;i>h&&i<p&&(d["is-in-hover-range"]=!0)}return d}return{...s,"is-active":typeof this.value=="string"&&this.value.slice(0,10)===i}},updateHoverRangeStyle(){if(!this.panelElement||!this.hoverDate||!this.value[0])return;const t=(this.value[0]||"").slice(0,10),e=this.hoverDate,i=t<e?t:e,r=t<e?e:t;this.panelElement.querySelectorAll(".lvc-day:not(.is-empty)").forEach(s=>{const a=s.dataset.date;a&&a>i&&a<r?s.classList.add("is-in-hover-range"):s.classList.remove("is-in-hover-range")})},clearHoverRangeStyle(){if(!this.panelElement)return;this.panelElement.querySelectorAll(".lvc-day.is-in-hover-range").forEach(e=>e.classList.remove("is-in-hover-range"))},syncInternalStateFromValue(){if(this.showDoubleInput){const t=Array.isArray(this.value)?this.value:["",""];this.timeState.start=this.splitTime(t[0]),this.timeState.end=this.splitTime(t[1])}else this.timeState.start=this.splitTime(this.value)},splitTime(t){if(t&&t.includes(" ")){const e=t.split(" ")[1].split(":");return{h:e[0]||"00",m:e[1]||"00"}}return{h:"00",m:"00"}},emitInternalChange(){if(this.value)if(this.showDoubleInput){let t=Array.isArray(this.value)?[...this.value]:["",""];t[0]&&(t[0]=t[0].slice(0,10)+` ${this.timeState.start.h}:${this.timeState.start.m}`),t[1]&&(t[1]=t[1].slice(0,10)+` ${this.timeState.end.h}:${this.timeState.end.m}`),this.$emit("input",t)}else{let t=this.value.slice(0,10)+` ${this.timeState.start.h}:${this.timeState.start.m}`;this.$emit("input",t)}},handleClear(){this.$emit("input",this.showDoubleInput?["",""]:""),this.activeTimePop=null,this.selectingRangePart="start",this.isPanelOpen&&this.$nextTick(()=>this.updatePanelContent())},handleSetToNow(){const t=new Date,e=`${t.getFullYear()}-${this.formatPad(t.getMonth()+1)}-${this.formatPad(t.getDate())}`,i=this.formatPad(t.getHours()),r=this.formatPad(t.getMinutes()),n=this.supportTime?`${e} ${i}:${r}`:e;if(this.type==="datetimestartorend")this.timeState.start={h:i,m:r},this.timeState.end={h:i,m:r},this.$emit("input",[n,n]);else if(this.isRangeMode){let s=Array.isArray(this.value)?[...this.value]:["",""];const a=this.selectingRangePart;if(this.timeState[a]={h:i,m:r},a==="start")!s[0]&&!s[1]?(s[0]=n,this.timeState.start={h:i,m:r}):n<s[1]?(s[0]=n,this.timeState.start={h:i,m:r}):n>s[1]?(s[1]=n,this.timeState.end={h:i,m:r}):s[1]&&s[0]>s[1]&&(s[1]="");else if(n>s[0])s[1]=n,this.timeState.end={h:i,m:r};else if(n<s[0]){const l=s[0];s[1]=l,s[0]=n,this.timeState.start={h:i,m:r},this.timeState.end={h:"00",m:"00"}}else s[0]&&s[1]<s[0]&&(s[0]=n,this.timeState.start={h:i,m:r});this.$emit("input",s)}else this.timeState.start={h:i,m:r},this.$emit("input",n);this.activeTimePop=null,this.isPanelOpen&&this.$nextTick(()=>this.updatePanelContent())},handleConfirm(){this.closePanel(),this.$emit("confirm",this.value)},clickOutside(t){const e=this.$refs.pickerContainer;e&&!e.contains(t.target)&&(!this.panelElement||!this.panelElement.contains(t.target))&&(this.closePanel(),this.activeTimePop=null)}},mounted(){document.addEventListener("click",this.clickOutside)},beforeDestroy(){document.removeEventListener("click",this.clickOutside),this.closePanel()}};var mt=function(){var e=this,i=e._self._c;return i("div",{ref:"pickerContainer",staticClass:"lvc-date-picker"},[i("div",{staticClass:"lvc-input-wrapper",class:{"is-active":e.isPanelOpen},on:{click:e.handleTogglePanel}},[e.showDoubleInput?[i("input",{staticClass:"lvc-inner-input",attrs:{readonly:"",placeholder:"开始时间"},domProps:{value:e.displayValues[0]}}),i("span",{staticClass:"lvc-separator"},[e._v(e._s(e.rangeSeparator))]),i("input",{staticClass:"lvc-inner-input",attrs:{readonly:"",placeholder:"结束时间"},domProps:{value:e.displayValues[1]}})]:[i("input",{staticClass:"lvc-inner-input",attrs:{readonly:"",placeholder:"请选择日期时间"},domProps:{value:e.value}})],i("span",{staticClass:"lvc-icon-arrow",style:{transform:e.isPanelOpen?"rotate(180deg)":"none"}},[e._v("▼")])],2)])},ft=[],vt=R(ut,mt,ft);const we=vt.exports;(function(){var t,e,i,r,n,s,a,l,d,c,h,p,v,S,$,M,Pe,O,te,$e,H,ie,ne,se,B,re,ae,Me,le,oe,Le,Te,Re=[].slice;Pe='<span class="odometer-value"></span>',S='<span class="odometer-ribbon"><span class="odometer-ribbon-inner">'+Pe+"</span></span>",r='<span class="odometer-digit"><span class="odometer-digit-spacer">8</span><span class="odometer-digit-inner">'+S+"</span></span>",a='<span class="odometer-formatting-mark"></span>',i="(,ddd).dd",l=/^\(?([^)]*)\)?(?:(.)(d+))?$/,d=30,s=2e3,t=20,c=2,n=.5,h=1e3/d,e=1e3/t,$="transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd",B=document.createElement("div").style,M=B.transition!=null||B.webkitTransition!=null||B.mozTransition!=null||B.oTransition!=null,ne=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,p=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,te=function(m){var o;return o=document.createElement("div"),o.innerHTML=m,o.children[0]},ie=function(m,o){return m.className=m.className.replace(new RegExp("(^| )"+o.split(" ").join("|")+"( |$)","gi")," ")},O=function(m,o){return ie(m,o),m.className+=" "+o},re=function(m,o){var u;if(document.createEvent!=null)return u=document.createEvent("HTMLEvents"),u.initEvent(o,!0,!0),m.dispatchEvent(u)},H=function(){var m,o;return(m=(o=window.performance)!=null&&typeof o.now=="function"?o.now():void 0)!=null?m:+new Date},se=function(m,o){return o==null&&(o=0),o?(m*=Math.pow(10,o),m+=.5,m=Math.floor(m),m/=Math.pow(10,o)):Math.round(m)},ae=function(m){return m<0?Math.ceil(m):Math.floor(m)},$e=function(m){return m-se(m)},le=!1,(Me=function(){var m,o,u,f,g;if(!le&&window.jQuery!=null){for(le=!0,f=["html","text"],g=[],o=0,u=f.length;o<u;o++)m=f[o],g.push(function(y){var b;return b=window.jQuery.fn[y],window.jQuery.fn[y]=function(w){var k;return w==null||((k=this[0])!=null?k.odometer:void 0)==null?b.apply(this,arguments):this[0].odometer.update(w)}}(m));return g}})(),setTimeout(Me,0),v=function(){function m(o){var u,f,g,y,b,w,k,x,P,_=this;if(this.options=o,this.el=this.options.el,this.el.odometer!=null)return this.el.odometer;this.el.odometer=this,k=m.options;for(u in k)g=k[u],this.options[u]==null&&(this.options[u]=g);(y=this.options).duration==null&&(y.duration=s),this.animationCount=0,this.MAX_VALUES=this.options.duration/h/c|0,this.resetFormat(),this.value=this.cleanValue((x=this.options.value)!=null?x:""),this.renderInside(),this.render();try{for(P=["innerHTML","innerText","textContent"],b=0,w=P.length;b<w;b++)f=P[b],this.el[f]!=null&&function(C){return Object.defineProperty(_.el,C,{get:function(){var L;return C==="innerHTML"?_.inside.outerHTML:(L=_.inside.innerText)!=null?L:_.inside.textContent},set:function(L){return _.update(L)}})}(f)}catch{this.watchForMutations()}}return m.prototype.renderInside=function(){return this.inside=document.createElement("div"),this.inside.className="odometer-inside",this.el.innerHTML="",this.el.appendChild(this.inside)},m.prototype.watchForMutations=function(){var o=this;if(p!=null)try{return this.observer==null&&(this.observer=new p(function(u){var f;return f=o.el.innerText,o.renderInside(),o.render(o.value),o.update(f)})),this.watchMutations=!0,this.startWatchingMutations()}catch{}},m.prototype.startWatchingMutations=function(){if(this.watchMutations)return this.observer.observe(this.el,{childList:!0})},m.prototype.stopWatchingMutations=function(){var o;return(o=this.observer)!=null?o.disconnect():void 0},m.prototype.cleanValue=function(o){var u;return typeof o=="string"&&(o=o.replace((u=this.format.radix)!=null?u:".","<radix>"),o=o.replace(/[.,]/g,""),o=o.replace("<radix>","."),o=parseFloat(o,10)||0),se(o,this.format.precision)},m.prototype.bindTransitionEnd=function(){var o,u,f,g,y,b,w=this;if(!this.transitionEndBound){for(this.transitionEndBound=!0,u=!1,y=$.split(" "),b=[],f=0,g=y.length;f<g;f++)o=y[f],b.push(this.el.addEventListener(o,function(){return u||(u=!0,setTimeout(function(){return w.animationCount++,w.render(),u=!1,re(w.el,"odometerdone")},0)),!0},!1));return b}},m.prototype.resetFormat=function(){var o,u,f,g,y,b,w,k;if(o=(w=this.options.format)!=null?w:i,o||(o="d"),f=l.exec(o),!f)throw new Error("Odometer: Unparsable digit format");return k=f.slice(1,4),b=k[0],y=k[1],u=k[2],g=(u!=null?u.length:void 0)||0,this.format={repeating:b,radix:y,precision:g}},m.prototype.render=function(o){var u,f,g,y,b,w,k,x,P,_,C,L;for(o==null&&(o=this.value),this.stopWatchingMutations(),this.resetFormat(),this.inside.innerHTML="",w=this.options.theme,u=this.el.className.split(" "),b=[],x=0,_=u.length;x<_;x++)if(f=u[x],!!f.length){if(y=/^odometer-theme-(.+)$/.exec(f)){w=y[1];continue}/^odometer(-|$)/.test(f)||b.push(f)}for(b.push("odometer"),M||b.push("odometer-no-transitions"),w?b.push("odometer-theme-"+w):b.push("odometer-auto-theme"),this.el.className=b.join(" "),this.ribbons={},this.digits=[],k=!this.format.precision||!$e(o)||!1,L=o.toString().split("").reverse(),P=0,C=L.length;P<C;P++)g=L[P],g==="."&&(k=!0),this.addDigit(g,k);return this.startWatchingMutations()},m.prototype.update=function(o){var u,f=this;if(o=this.cleanValue(o),!!(u=o-this.value)){if(f.animationCount>=f.options.maxAnimations){f.value=o,f.render();return}return ie(this.el,"odometer-animating-up odometer-animating-down odometer-animating"),u>0?O(this.el,"odometer-animating-up"):O(this.el,"odometer-animating-down"),this.stopWatchingMutations(),this.animate(o),this.startWatchingMutations(),setTimeout(function(){return f.el.offsetHeight,O(f.el,"odometer-animating")},0),this.value=o}},m.prototype.renderDigit=function(){return te(r)},m.prototype.insertDigit=function(o,u){return u!=null?this.inside.insertBefore(o,u):this.inside.children.length?this.inside.insertBefore(o,this.inside.children[0]):this.inside.appendChild(o)},m.prototype.addSpacer=function(o,u,f){var g;return g=te(a),g.innerHTML=o,f&&O(g,f),this.insertDigit(g,u)},m.prototype.addDigit=function(o,u){var f,g,y,b;if(u==null&&(u=!0),o==="-")return this.addSpacer(o,null,"odometer-negation-mark");if(o===".")return this.addSpacer((b=this.format.radix)!=null?b:".",null,"odometer-radix-mark");if(u)for(y=!1;;){if(!this.format.repeating.length){if(y)throw new Error("Bad odometer format without digits");this.resetFormat(),y=!0}if(f=this.format.repeating[this.format.repeating.length-1],this.format.repeating=this.format.repeating.substring(0,this.format.repeating.length-1),f==="d")break;this.addSpacer(f)}return g=this.renderDigit(),g.querySelector(".odometer-value").innerHTML=o,this.digits.push(g),this.insertDigit(g)},m.prototype.animate=function(o){return!M||this.options.animation==="count"?this.animateCount(o):this.animateSlide(o)},m.prototype.animateCount=function(o){var u,f,g,y,b,w=this;if(f=+o-this.value)return y=g=H(),u=this.value,(b=function(){var k,x,P;if(H()-y>w.options.duration){w.animationCount++,w.value=o,w.render(),re(w.el,"odometerdone");return}return k=H()-g,k>e&&(g=H(),P=k/w.options.duration,x=f*P,u+=x,w.render(Math.round(u))),ne!=null?ne(b):setTimeout(b,e)})()},m.prototype.getDigitCount=function(){var o,u,f,g,y,b;for(g=1<=arguments.length?Re.call(arguments,0):[],o=y=0,b=g.length;y<b;o=++y)f=g[o],g[o]=Math.abs(f);return u=Math.max.apply(Math,g),Math.ceil(Math.log(u+1)/Math.log(10))},m.prototype.getFractionalDigitCount=function(){var o,u,f,g,y,b,w;for(y=1<=arguments.length?Re.call(arguments,0):[],u=/^\-?\d*\.(\d*?)0*$/,o=b=0,w=y.length;b<w;o=++b)g=y[o],y[o]=g.toString(),f=u.exec(y[o]),f==null?y[o]=0:y[o]=f[1].length;return Math.max.apply(Math,y)},m.prototype.resetDigits=function(){return this.digits=[],this.ribbons=[],this.inside.innerHTML="",this.resetFormat()},m.prototype.animateSlide=function(o){var u,f,g,y,b,w,k,x,P,_,C,L,F,X,I,A,N,Ye,z,ce,he,Oe,Ae,De,de,pe,ue;if(A=this.value,x=this.getFractionalDigitCount(A,o),x&&(o=o*Math.pow(10,x),A=A*Math.pow(10,x)),!!(g=o-A)){for(this.bindTransitionEnd(),y=this.getDigitCount(A,o),b=[],u=0,C=z=0;0<=y?z<y:z>y;C=0<=y?++z:--z){if(N=ae(A/Math.pow(10,y-C-1)),k=ae(o/Math.pow(10,y-C-1)),w=k-N,Math.abs(w)>this.MAX_VALUES){for(_=[],L=w/(this.MAX_VALUES+this.MAX_VALUES*u*n),f=N;w>0&&f<k||w<0&&f>k;)_.push(Math.round(f)),f+=L;_[_.length-1]!==k&&_.push(k),u++}else _=(function(){ue=[];for(var W=N;N<=k?W<=k:W>=k;N<=k?W++:W--)ue.push(W);return ue}).apply(this);for(C=ce=0,Oe=_.length;ce<Oe;C=++ce)P=_[C],_[C]=Math.abs(P%10);b.push(_)}for(this.resetDigits(),pe=b.reverse(),C=he=0,Ae=pe.length;he<Ae;C=++he)for(_=pe[C],this.digits[C]||this.addDigit(" ",C>=x),(Ye=this.ribbons)[C]==null&&(Ye[C]=this.digits[C].querySelector(".odometer-ribbon-inner")),this.ribbons[C].innerHTML="",g<0&&(_=_.reverse()),F=de=0,De=_.length;de<De;F=++de)P=_[F],I=document.createElement("div"),I.className="odometer-value",I.innerHTML=P,this.ribbons[C].appendChild(I),F===_.length-1&&O(I,"odometer-last-value"),F===0&&O(I,"odometer-first-value");if(o<0&&this.addDigit("-"),X=this.inside.querySelector(".odometer-radix-mark"),X!=null&&X.parent.removeChild(X),x)return this.addSpacer(this.format.radix,this.digits[x-1],"odometer-radix-mark")}},m}(),v.options=(Le=window.odometerOptions)!=null?Le:{},v.options.maxAnimations=1/0,setTimeout(function(){var m,o,u,f,g;if(window.odometerOptions){f=window.odometerOptions,g=[];for(m in f)o=f[m],g.push((u=v.options)[m]!=null?(u=v.options)[m]:u[m]=o);return g}},0),v.init=function(){var m,o,u,f,g,y;if(document.querySelectorAll!=null){for(o=document.querySelectorAll(v.options.selector||".odometer"),y=[],u=0,f=o.length;u<f;u++)m=o[u],y.push(m.odometer=new v({el:m,value:(g=m.innerText)!=null?g:m.textContent}));return y}},((Te=document.documentElement)!=null?Te.doScroll:void 0)!=null&&document.createEventObject!=null?(oe=document.onreadystatechange,document.onreadystatechange=function(){return document.readyState==="complete"&&v.options.auto!==!1&&v.init(),oe!=null?oe.apply(this,arguments):void 0}):document.addEventListener("DOMContentLoaded",function(){if(v.options.auto!==!1)return v.init()},!1),window.Odometer=v}).call(void 0);const gt={name:"LvcOdometer",props:{value:{type:Number,default:0},duration:{type:Number,default:1e3},maxAnimations:{type:Number,default:1/0},unit:{type:String,default:""},unitSize:{type:String,default:"inherit"},unitPosition:{type:String,default:"right"}},data(){return{od:null}},mounted(){this.od=new window.Odometer({el:this.$refs.odo,value:this.value,duration:this.duration,maxAnimations:this.maxAnimations})},watch:{value(t){this.od&&this.od.update(t)}}};var yt=function(){var e=this,i=e._self._c;return i("div",{staticClass:"lvc-odometer"},[e._t("unit-left",function(){return[e.unit&&e.unitPosition==="left"?i("span",{staticClass:"odometer-unit odometer-unit-left",style:{fontSize:e.unitSize}},[e._v(e._s(e.unit))]):e._e()]}),i("span",{ref:"odo",staticClass:"odometer-value"}),e._t("unit-right",function(){return[e.unit&&e.unitPosition==="right"?i("span",{staticClass:"odometer-unit",style:{fontSize:e.unitSize}},[e._v(e._s(e.unit))]):e._e()]})],2)},bt=[],wt=R(gt,yt,bt);const ke=wt.exports;typeof window<"u"&&!window.Vue&&(window.Vue=T),function(){const t=document.createElement("style");t.id="lvc-tree-style",t.textContent=[".lvc-tree { user-select: none; overflow-y: auto; }",".lvc-tree::-webkit-scrollbar { width: 0.4vmin; }",".lvc-tree::-webkit-scrollbar-track { background: rgba(10, 22, 40, 0.3); }",".lvc-tree::-webkit-scrollbar-thumb { background: #1e3a5f; border-radius: 0.2vmin; }",".lvc-tree::-webkit-scrollbar-thumb:hover { background: #22a6b3; }",".lvc-tree-node { }",".lvc-tree-node-content { display: flex; align-items: stretch; }",".lvc-tree-node-left { display: inline-flex; align-items: center; flex-shrink: 0; }",".lvc-tree-node-right { display: flex; align-items: center; flex: 1; padding: 0.6vmin 0.8vmin; cursor: pointer; border-radius: 0.4vmin; transition: background 0.2s; font-size: 1.2vmin; color: #cfefff; min-width: 0; }",".lvc-tree-node-right:hover { background: rgba(34, 166, 179, 0.15); }",".lvc-tree-node-right.selected { background: rgba(34, 166, 179, 0.25); color: #22a6b3; }",".lvc-tree-node-arrow { width: 2vmin; font-size: 1.2vmin; color: #8ab4d4; transition: transform 0.2s; display: inline-block; text-align: center; flex-shrink: 0; }",".lvc-tree-node-arrow.expanded { transform: rotate(90deg); }",".lvc-tree-node-arrow-placeholder { width: 1.5vmin; display: inline-block; flex-shrink: 0; }",".lvc-tree-node-icon { width: 1.5vmin; height: 1.5vmin; margin-right: 0.8vmin; display: inline-flex; align-items: center; justify-content: center; font-size: 1.2vmin; flex-shrink: 0; }",'.lvc-tree-node-icon.folder::before { content: "\\1F4C1"; }','.lvc-tree-node-icon.meter::before { content: "\\1F4CA"; }','.lvc-tree-node-icon.data::before { content: "\\1F4C8"; }','.lvc-tree-node-icon.device::before { content: "\\2699\\FE0F"; }','.lvc-tree-node-icon.default::before { content: "\\1F4C4"; }',".lvc-tree-node-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }",".lvc-tree-node-children { padding-left: 1.5vmin; }",".lvc-tree-checkbox { display: inline-flex; align-items: center; margin-right: 0.6vmin;margin-left: 0.6vmin; flex-shrink: 0; cursor: pointer; }",".lvc-tree-checkbox input { display: none; }",".lvc-tree-checkbox .checkbox-box { width: 1.4vmin; height: 1.4vmin; border: 0.15vmin solid #4a7899; border-radius: 0.2vmin; display: inline-flex; align-items: center; justify-content: center; transition: all 0.2s; background: transparent; position: relative; }",".lvc-tree-checkbox:hover .checkbox-box { border-color: #22a6b3; }",".lvc-tree-checkbox.checked .checkbox-box { background: #22a6b3; border-color: #22a6b3; }",'.lvc-tree-checkbox.checked .checkbox-box::after { content: ""; width: 0.4vmin; height: 0.7vmin; border: 0.15vmin solid #fff; border-top: none; border-left: none; transform: rotate(45deg) translate(-0.05vmin, -0.1vmin); }',".lvc-tree-checkbox.indeterminate .checkbox-box { background: #22a6b3; border-color: #22a6b3; }",'.lvc-tree-checkbox.indeterminate .checkbox-box::after { content: ""; width: 0.7vmin; height: 0.15vmin; background: #fff; border-radius: 0.1vmin; }'].join(`
49
- `),document.getElementById("lvc-tree-style")||document.head.appendChild(t);function e(n,s){if(n.indexOf(s.id)!==-1)return!0;if(!s.children||s.children.length===0)return!1;for(let a=0;a<s.children.length;a++)if(e(n,s.children[a]))return!0;return!1}const r={name:"LvcTree",components:{"lvc-tree-node":{name:"LvcTreeNode",props:{node:{type:Object,required:!0},selectedId:{type:[String,Number],default:null},defaultExpandAll:{type:Boolean,default:!1},showCheckbox:{type:Boolean,default:!1},checkedKeys:{type:Array,default:()=>[]},filterText:{type:String,default:""},filterNodeMethod:{type:Function,default:null},autoExpandOnFilter:{type:Boolean,default:!0},isRoot:{type:Boolean,default:!1}},data(){return{expanded:this.node.expanded!==void 0?this.node.expanded:this.defaultExpandAll}},watch:{filterText:{handler(n){this.autoExpandOnFilter&&n&&this.hasChildren?this._nodeMatchesFilter(this.node)&&(this.expanded=!0):this.expanded=this.isRoot},immediate:!1}},template:['<div class="lvc-tree-node" v-show="isVisible">',' <div class="lvc-tree-node-content">',' <span class="lvc-tree-node-left">',' <span v-if="hasChildren" class="lvc-tree-node-arrow" :class="{ expanded: expanded }" @click.stop="handleToggle">▶</span>',' <span v-else class="lvc-tree-node-arrow-placeholder"></span>',' <span v-if="showCheckbox" class="lvc-tree-checkbox" :class="checkboxClass" @click.stop.prevent="handleCheck">',' <span class="checkbox-box"></span>'," </span>"," </span>",' <span class="lvc-tree-node-right" :class="{ selected: node.id === selectedId }" @click="handleClick">',' <span v-if="nodeIcon" class="lvc-tree-node-icon" :class="nodeIcon"></span>',' <span class="lvc-tree-node-label" :title="node.label">{{ node.label }}</span>'," </span>"," </div>",' <div v-if="expanded && hasChildren" class="lvc-tree-node-children">',` <lvc-tree-node v-for="child in node.children" :key="child.id" :node="child" :selected-id="selectedId" :default-expand-all="defaultExpandAll" :show-checkbox="showCheckbox" :checked-keys="checkedKeys" :filter-text="filterText" :filter-node-method="filterNodeMethod" :auto-expand-on-filter="autoExpandOnFilter" @select="$emit('select', $event)" @toggle="$emit('toggle', $event)" @check-change="$emit('check-change', $event)"></lvc-tree-node>`," </div>","</div>"].join(`
50
- `),computed:{hasChildren(){return this.node.children&&this.node.children.length>0},nodeIcon(){return this.node.icon||""},isChecked(){return this.checkedKeys.indexOf(this.node.id)!==-1},childCheckedCount(){if(!this.hasChildren)return 0;let n=0;for(let s=0;s<this.node.children.length;s++){const a=this.node.children[s];(this.checkedKeys.indexOf(a.id)!==-1||e(this.checkedKeys,a))&&n++}return n},isIndeterminate(){if(!this.hasChildren)return!1;const n=this.childCheckedCount;return n>0&&n<this.node.children.length},checkboxClass(){return this.isChecked?"checked":this.isIndeterminate?"indeterminate":""},isVisible(){return!this.filterText||!this.filterNodeMethod||this.filterNodeMethod(this.filterText,this.node)?!0:this.hasChildren?this._hasVisibleChild(this.node.children):!1}},methods:{handleClick(){try{this.showCheckbox?this.handleCheck():this.$emit("select",this.node)}catch(n){console.error("[LvcTree] click event error:",n)}},handleToggle(){try{this.expanded=!this.expanded,this.$emit("toggle",{node:this.node,expanded:this.expanded})}catch(n){console.error("[LvcTree] toggle event error:",n)}},handleCheck(){try{let n;this.isIndeterminate?n=!1:n=!this.isChecked;const s=this._collectVisibleDescendantIds(this.node),d=(this.filterText&&this.filterNodeMethod?this.filterNodeMethod(this.filterText,this.node):!0)?[this.node.id,...s]:s;this.$emit("check-change",{node:this.node,checked:n,indeterminate:!1,affectedIds:d})}catch(n){console.error("[LvcTree] check event error:",n)}},_collectDescendantIds(n){const s=[];if(n.children&&n.children.length>0)for(let a=0;a<n.children.length;a++){const l=n.children[a];s.push(l.id),s.push(...this._collectDescendantIds(l))}return s},_collectVisibleDescendantIds(n){const s=[];if(!n.children||n.children.length===0)return s;for(let a=0;a<n.children.length;a++){const l=n.children[a];this._isNodeVisible(l)&&((!(this.filterText&&this.filterNodeMethod)||this.filterNodeMethod(this.filterText,l))&&s.push(l.id),s.push(...this._collectVisibleDescendantIds(l)))}return s},_isNodeVisible(n){if(!this.filterText||!this.filterNodeMethod||this.filterNodeMethod(this.filterText,n))return!0;if(n.children&&n.children.length>0){for(let s=0;s<n.children.length;s++)if(this._isNodeVisible(n.children[s]))return!0}return!1},_hasVisibleChild(n){if(!n||n.length===0)return!1;for(let s=0;s<n.length;s++){const a=n[s];if(this.filterNodeMethod(this.filterText,a)||a.children&&a.children.length>0&&this._hasVisibleChild(a.children))return!0}return!1},_nodeMatchesFilter(n){if(!this.filterText||!this.filterNodeMethod)return!1;if(this.filterNodeMethod(this.filterText,n))return!0;if(n.children&&n.children.length>0){for(let s=0;s<n.children.length;s++)if(this._nodeMatchesFilter(n.children[s]))return!0}return!1}}}},props:{data:{type:Array,default:()=>[]},selectedId:{type:[String,Number],default:null},defaultExpandAll:{type:Boolean,default:!1},showCheckbox:{type:Boolean,default:!1},defaultCheckedKeys:{type:Array,default:()=>[]},maxCheck:{type:Number,default:0},filterNodeMethod:{type:Function,default:null},autoExpandOnFilter:{type:Boolean,default:!0}},data(){return{checkedKeys:this.defaultCheckedKeys.slice(),filterText:""}},watch:{defaultCheckedKeys:{handler(n){this.checkedKeys=n.slice()},deep:!0},filterText(n){this.$emit("filter-change",n)}},template:['<div class="lvc-tree">',` <lvc-tree-node v-for="node in data" :key="node.id" :node="node" :selected-id="selectedId" :default-expand-all="defaultExpandAll" :show-checkbox="showCheckbox" :checked-keys="checkedKeys" :filter-text="filterText" :filter-node-method="filterNodeMethod" :auto-expand-on-filter="autoExpandOnFilter" :is-root="true" @select="$emit('select', $event)" @toggle="$emit('toggle', $event)" @check-change="onCheckChange"></lvc-tree-node>`,' <div v-if="!data || data.length === 0" class="lvc-tree-empty" style="text-align:center;color:#8ab4d4;padding:2vmin 0;font-size:1.2vmin;">暂无数据</div>',"</div>"].join(`
51
- `),methods:{filter(n){this.checkedKeys.length>0&&(this.checkedKeys=[],this.$emit("check-change",{node:null,checked:!1,indeterminate:!1,checkedKeys:[],checkedNodes:[]})),this.filterText=n},onCheckChange(n){try{const s=n.node.id,a=n.checked,l=n.affectedIds||[];if(a)for(let h=0;h<l.length;h++)this.checkedKeys.indexOf(l[h])===-1&&this.checkedKeys.push(l[h]);else for(let h=l.length-1;h>=0;h--){const p=this.checkedKeys.indexOf(l[h]);p!==-1&&this.checkedKeys.splice(p,1)}this._updateAncestors(this.data,s);const d=this._countCheckedLeaves(this.data);if(this.maxCheck>0&&d>this.maxCheck){const h=this._collectLimitedKeys(this.maxCheck);this.checkedKeys=h,this._updateAllAncestors(),this.$emit("max-check-exceeded",{max:this.maxCheck,actual:d})}const c=this._collectCheckedNodesWithAncestors(this.data);this.$emit("check-change",{node:n.node,checked:a,indeterminate:!1,checkedKeys:this.checkedKeys.slice(),checkedNodes:c})}catch(s){console.error("[LvcTree] check-change handler error:",s)}},_updateAncestors(n,s){const a=this._getParentChain(this.data,s);for(let l=0;l<a.length;l++){const d=a[l];let c=!0;for(let h=0;h<d.children.length;h++){const p=d.children[h];if(!this._isNodeFullyChecked(p)){c=!1;break}}if(c&&d.children.length>0)this.checkedKeys.indexOf(d.id)===-1&&this.checkedKeys.push(d.id);else{const h=this.checkedKeys.indexOf(d.id);h!==-1&&this.checkedKeys.splice(h,1)}}},_getParentChain(n,s,a){a=a||[];for(let l=0;l<n.length;l++){const d=n[l];if(d.children&&d.children.length>0){for(let h=0;h<d.children.length;h++)if(d.children[h].id===s)return a.unshift(d),this._getParentChain(this.data,d.id,a),a;const c=this._getParentChain(d.children,s,a);if(c.length>0)return c}}return a},_isNodeFullyChecked(n){if(this.checkedKeys.indexOf(n.id)===-1)return!1;if(!n.children||n.children.length===0)return!0;for(let s=0;s<n.children.length;s++)if(!this._isNodeFullyChecked(n.children[s]))return!1;return!0},_isDescendant(n,s){if(!n.children||n.children.length===0)return!1;for(let a=0;a<n.children.length;a++){const l=n.children[a];if(l.id===s||this._isDescendant(l,s))return!0}return!1},getCheckedKeys(){return this.checkedKeys.slice()},setCheckedKeys(n){this.checkedKeys=n.slice()},getHalfCheckedKeys(){const n=[];return this._collectHalfChecked(this.data,n),n},_collectHalfChecked(n,s){for(let a=0;a<n.length;a++){const l=n[a];if(l.children&&l.children.length>0){let d=0;for(let c=0;c<l.children.length;c++)this.checkedKeys.indexOf(l.children[c].id)!==-1&&d++;d>0&&d<l.children.length&&s.push(l.id),this._collectHalfChecked(l.children,s)}}},_isNodeVisible(n){if(!this.filterText||!this.filterNodeMethod||this.filterNodeMethod(this.filterText,n))return!0;if(n.children&&n.children.length>0){for(let s=0;s<n.children.length;s++)if(this._isNodeVisible(n.children[s]))return!0}return!1},_countCheckedLeaves(n){n=n||this.data;let s=0;for(let a=0;a<n.length;a++){const l=n[a];this._isNodeVisible(l)&&(l.children&&l.children.length>0?s+=this._countCheckedLeaves(l.children):this.checkedKeys.indexOf(l.id)!==-1&&s++)}return s},_collectLimitedKeys(n){const s=new Set;let a=0;const l=(d,c)=>{for(let h=0;h<d.length;h++){const p=d[h];if(a>=n)return;if(this._isNodeVisible(p)){if(p.children&&p.children.length>0)if(this.checkedKeys.indexOf(p.id)!==-1)l(p.children,c.concat(p.id));else for(let v=0;v<p.children.length;v++){if(a>=n)return;const S=p.children[v];(this.checkedKeys.indexOf(S.id)!==-1||this._hasCheckedDescendant(S))&&l([S],c.concat(p.id))}else if(this.checkedKeys.indexOf(p.id)!==-1){a++;for(let v=0;v<c.length;v++)s.add(c[v]);s.add(p.id)}}}};return l(this.data,[]),Array.from(s)},_hasCheckedDescendant(n){if(!n.children||n.children.length===0)return!1;for(let s=0;s<n.children.length;s++){const a=n.children[s];if(this.checkedKeys.indexOf(a.id)!==-1||this._hasCheckedDescendant(a))return!0}return!1},_updateAllAncestors(){const n=s=>{for(let a=0;a<s.length;a++){const l=s[a];if(l.children&&l.children.length>0){n(l.children);let d=!0;for(let c=0;c<l.children.length;c++)if(!this._isNodeFullyChecked(l.children[c])){d=!1;break}if(d&&l.children.length>0)this.checkedKeys.indexOf(l.id)===-1&&this.checkedKeys.push(l.id);else{const c=this.checkedKeys.indexOf(l.id);c!==-1&&this.checkedKeys.splice(c,1)}}}};n(this.data)},_collectCheckedNodesWithAncestors(n){const s=[];for(let a=0;a<n.length;a++){const l=n[a];if(this.checkedKeys.indexOf(l.id)!==-1)s.push(this._deepCopyNode(l));else if(l.children&&l.children.length>0&&e(this.checkedKeys,l)){const c=this._collectCheckedNodesWithAncestors(l.children);if(c.length>0){const h=Object.assign({},l);h.children=c,s.push(h)}}}return s},_deepCopyNode(n){const s=Object.assign({},n);return n.children&&n.children.length>0?s.children=n.children.map(a=>this._deepCopyNode(a)):s.children=[],s}}};typeof Vue<"u"&&Vue.component("lvc-tree",r)}();const kt=T.options.components["lvc-tree"];(function(){const t=document.createElement("style");t.id="lvc-month-picker-style",t.textContent=`
52
- .lvc-month-picker {
53
- position: relative;
54
- display: inline-block;
55
- font-size: 1.8vmin;
56
- color: #fff;
57
- user-select: none;
58
- height: 100%;
59
- }
60
-
61
- .lvc-month-input-wrapper {
62
- background: #0d2339;
63
- border: 1px solid #1e4469;
64
- border-radius: 0.8vmin;
65
- padding: 0.6vmin 1vmin;
66
- cursor: pointer;
67
- display: flex;
68
- align-items: center;
69
- gap: 0.8vmin;
70
- min-width: 14vmin;
71
- transition: all 0.3s;
72
- height: 100%;
73
- }
74
-
75
- .lvc-month-separator {
76
- color: #5d758c;
77
- font-size: 1.385vmin;
78
- flex-shrink: 0;
79
- }
80
-
81
- .lvc-month-input-wrapper:hover,
82
- .lvc-month-input-wrapper.is-active {
83
- border-color: #12bbed;
84
- box-shadow: 0 0 1.2vmin rgba(18, 187, 237, 0.3);
85
- }
86
-
87
- .lvc-month-inner-input {
88
- background: transparent;
89
- border: none;
90
- color: #fff;
91
- outline: none;
92
- width: 100%;
93
- text-align: center;
94
- cursor: pointer;
95
- font-size: 1.3vmin;
96
- }
97
-
98
- .lvc-month-icon-arrow {
99
- color: #12bbed;
100
- font-size: 1.385vmin;
101
- transition: transform 0.3s;
102
- }
103
-
104
- .lvc-month-panel {
105
- position: absolute;
106
- top: 5vmin;
107
- left: 50%;
108
- transform: translateX(-50%);
109
- background: #0b1a2a;
110
- border: 1px solid #12bbed;
111
- box-shadow: 0 1.2vmin 3.5vmin rgba(0, 0, 0, 0.7);
112
- border-radius: 1vmin;
113
- padding: 1.5vmin;
114
- z-index: 9999;
115
- min-width: 28vmin;
116
- }
117
-
118
- .lvc-month-panel-header {
119
- display: flex;
120
- justify-content: space-between;
121
- align-items: center;
122
- margin-bottom: 1vmin;
123
- color: #12bbed;
124
- font-size: 1.6vmin;
125
- }
126
-
127
- .lvc-month-nav-btn {
128
- cursor: pointer;
129
- padding: 0.3vmin 0.8vmin;
130
- font-size: 1.4vmin;
131
- color: #12bbed;
132
- transition: color 0.2s;
133
- }
134
-
135
- .lvc-month-nav-btn:hover {
136
- color: #fff;
137
- }
138
-
139
- .lvc-month-grid {
140
- display: grid;
141
- grid-template-columns: repeat(4, 1fr);
142
- }
143
-
144
- .lvc-month-cell {
145
- position: relative;
146
- height: 4.5vmin;
147
- line-height: 4.5vmin;
148
- text-align: center;
149
- font-size: 1.662vmin;
150
- cursor: pointer;
151
- border-radius: 0.5vmin;
152
- color: #8ab4d4;
153
- transition: all 0.2s;
154
- }
155
-
156
- .lvc-month-cell:hover {
157
- background: rgba(18, 187, 237, 0.2);
158
- color: #fff;
159
- }
160
-
161
- .lvc-month-cell.is-active {
162
- background: #12bbed;
163
- color: #fff;
164
- font-weight: bold;
165
- }
166
-
167
- .lvc-month-cell.is-in-range {
168
- background: rgba(18, 187, 237, 0.15);
169
- color: #12bbed;
170
- border-radius: 0;
171
- }
172
-
173
- .lvc-month-cell.is-in-hover-range {
174
- background: rgba(18, 187, 237, 0.25);
175
- color: #fff;
176
- border-radius: 0;
177
- }
178
-
179
- .lvc-month-cell.is-range-end {
180
- border-top-right-radius: 0.5vmin;
181
- border-bottom-right-radius: 0.5vmin;
182
- }
183
-
184
- .lvc-month-cell.is-range-start {
185
- border-top-left-radius: 0.5vmin;
186
- border-bottom-left-radius: 0.5vmin;
187
- }
188
-
189
- .lvc-month-cell.is-current::after {
190
- content: "";
191
- position: absolute;
192
- bottom: 0.5vmin;
193
- left: 50%;
194
- width: 0.6vmin;
195
- height: 0.6vmin;
196
- background: #12bbed;
197
- border-radius: 50%;
198
- transform: translateX(-50%);
199
- }
200
-
201
- .lvc-month-panel-footer {
202
- border-top: 1px solid rgba(255, 255, 255, 0.05);
203
- margin-top: 1vmin;
204
- padding-top: 1vmin;
205
- display: flex;
206
- justify-content: space-between;
207
- align-items: center;
208
- gap: 1vmin;
209
- }
210
-
211
- .lvc-month-right-actions {
212
- display: flex;
213
- gap: 1vmin;
214
- }
215
-
216
- .lvc-month-action-btn {
217
- font-size: 1.662vmin;
218
- cursor: pointer;
219
- padding: 0.554vmin 1.662vmin;
220
- border-radius: 0.5vmin;
221
- transition: all 0.2s;
222
- }
223
-
224
- .lvc-month-action-btn.is-outline {
225
- border: 1px solid #1e4469;
226
- color: #8ab4d4;
227
- }
228
-
229
- .lvc-month-action-btn.is-outline:hover {
230
- border-color: #12bbed;
231
- color: #12bbed;
232
- }
233
-
234
- .lvc-month-action-btn.is-primary {
235
- background: #12bbed;
236
- color: #fff;
237
- }
238
-
239
- .lvc-month-action-btn.is-primary:hover {
240
- background: #0ea8d4;
241
- }
242
-
243
- .lvc-month-fade-enter-active,
244
- .lvc-month-fade-leave-active {
245
- transition: opacity 0.25s cubic-bezier(0.23, 1, 0.32, 1), transform 0.25s cubic-bezier(0.23, 1, 0.32, 1);
246
- }
247
-
248
- .lvc-month-fade-enter,
249
- .lvc-month-fade-leave-to {
250
- opacity: 0;
251
- transform: translateY(1.662vmin) scale(0.98);
252
- }
253
- `,document.getElementById("lvc-month-picker-style")||document.head.appendChild(t)})();const Et=`
254
- <div class="lvc-month-picker" ref="pickerContainer">
255
- <div class="lvc-month-input-wrapper" :class="{ 'is-active': isPanelOpen }" @click="handleTogglePanel">
256
- <template v-if="isRangeMode">
257
- <input class="lvc-month-inner-input" readonly :value="displayValues[0]" :placeholder="startPlaceholder" />
258
- <span class="lvc-month-separator">{{ rangeSeparator }}</span>
259
- <input class="lvc-month-inner-input" readonly :value="displayValues[1]" :placeholder="endPlaceholder" />
260
- </template>
261
- <template v-else>
262
- <input class="lvc-month-inner-input" readonly :value="displayValue" :placeholder="singlePlaceholder" />
263
- </template>
264
- <span class="lvc-month-icon-arrow" :style="{ transform: isPanelOpen ? 'rotate(180deg)' : 'none' }">▼</span>
265
- </div>
266
- </div>
267
- `;let K=[],St=0;const _t={name:"lvcMonthPicker",props:{value:{type:[String,Array],default:""},type:{type:String,default:"month"},rangeSeparator:{type:String,default:"至"},singlePlaceholder:{type:String,default:"请选择月份"},startPlaceholder:{type:String,default:"开始月份"},endPlaceholder:{type:String,default:"结束月份"}},template:Et,data(){const t=new Date,e=this.type==="monthrange";let i,r;if(this.value)if(e){const n=Array.isArray(this.value)?this.value:["",""];if(n[0]){const s=new Date(n[0]);i=s.getFullYear(),r=s.getMonth()+1}else i=t.getFullYear(),r=t.getMonth()+1}else{const n=new Date(this.value);i=n.getFullYear(),r=n.getMonth()+1}else i=t.getFullYear(),r=t.getMonth()+1;return{isPanelOpen:!1,currentYear:i,currentYearNow:t.getFullYear(),currentMonth:t.getMonth()+1,selectedYear:i,selectedMonth:r,tempYear:i,tempMonth:r,tempStartYear:i,tempStartMonth:r,tempEndYear:i,tempEndMonth:r,selectingRangePart:"start",hoverMonth:null,panelElement:null,overlayElement:null,monthPickerId:`lvc-month-picker-${++St}`}},watch:{value(t){if(this.isRangeMode){const e=Array.isArray(t)?t:["",""];if(e[0]){const i=new Date(e[0]);this.tempStartYear=i.getFullYear(),this.tempStartMonth=i.getMonth()+1}if(e[1]){const i=new Date(e[1]);this.tempEndYear=i.getFullYear(),this.tempEndMonth=i.getMonth()+1}}else if(t){const e=new Date(t),i=e.getFullYear(),r=e.getMonth()+1;this.tempYear=i,this.tempMonth=r,this.selectedYear=i,this.selectedMonth=r}}},computed:{isRangeMode(){return this.type==="monthrange"},displayValue(){return this.value||""},displayValues(){return Array.isArray(this.value)?[this.value[0]||"",this.value[1]||""]:["",""]}},mounted(){this._onDocClick=t=>{this.clickOutside(t)},document.addEventListener("click",this._onDocClick)},beforeDestroy(){document.removeEventListener("click",this._onDocClick),this.closePanel()},methods:{_parseValue(t){if(!t){const i=new Date;return{year:i.getFullYear(),month:i.getMonth()+1}}const e=t.split("-");return{year:parseInt(e[0]),month:parseInt(e[1])}},handleTogglePanel(){this.isPanelOpen?this.closePanel():(this.closeOtherMonthPickers(),this.openPanel())},openPanel(){this.isPanelOpen=!0,K.push(this),this.syncInternalStateFromValue(),this.$nextTick(()=>{this.createPanel()})},syncInternalStateFromValue(){if(this.isRangeMode){const t=Array.isArray(this.value)?this.value:["",""];if(t[0]){const e=new Date(t[0]);this.tempStartYear=e.getFullYear(),this.tempStartMonth=e.getMonth()+1,this.currentYear=this.tempStartYear}else{const e=new Date;this.tempStartYear=e.getFullYear(),this.tempStartMonth=e.getMonth()+1,this.currentYear=this.tempStartYear}if(t[1]){const e=new Date(t[1]);this.tempEndYear=e.getFullYear(),this.tempEndMonth=e.getMonth()+1}else this.tempEndYear=this.tempStartYear,this.tempEndMonth=this.tempStartMonth;this.selectingRangePart="start"}else{const t=this._parseValue(this.value);this.tempYear=t.year,this.tempMonth=t.month,this.currentYear=this.tempYear,this.selectedYear=this.tempYear,this.selectedMonth=this.tempMonth}},closePanel(){this.isPanelOpen=!1,K=K.filter(t=>t.monthPickerId!==this.monthPickerId),this.removePanel()},closeOtherMonthPickers(){K.forEach(t=>{t.monthPickerId!==this.monthPickerId&&t.closePanel()})},createPanel(){if(this.panelElement&&document.body.contains(this.panelElement)){this.updatePanelContent(),this.updatePanelPosition();return}this.removePanel(),this.panelElement=document.createElement("div"),this.panelElement.className="lvc-month-panel",this.panelElement.style.position="fixed",this.panelElement.style.zIndex="9999",this.panelElement.style.opacity="0",this.panelElement.style.transform="translateX(-50%) translateY(1.662vmin) scale(0.98)",this.panelElement.style.transition="opacity 0.25s cubic-bezier(0.23, 1, 0.32, 1), transform 0.25s cubic-bezier(0.23, 1, 0.32, 1)",this.panelElement.style.background="#0b1a2a",this.panelElement.style.border="1px solid #12bbed",this.panelElement.style.boxShadow="0 1.2vmin 3.5vmin rgba(0, 0, 0, 0.7)",this.panelElement.style.borderRadius="1vmin",this.panelElement.style.padding="1.5vmin",this.panelElement.style.minWidth="28vmin",this.panelElement.addEventListener("click",t=>{t.stopPropagation()}),this.panelElement.innerHTML=this.generatePanelContent(),document.body.appendChild(this.panelElement),this.overlayElement=document.createElement("div"),this.overlayElement.style.cssText="position:fixed;top:0;left:0;right:0;bottom:0;z-index:9998;",this.overlayElement.addEventListener("click",()=>{this.closePanel()}),document.body.appendChild(this.overlayElement),this.updatePanelPosition(),this.addEventListeners(),setTimeout(()=>{this.panelElement.style.opacity="1",this.panelElement.style.transform="translateX(-50%) translateY(0) scale(1)"},10),this.bindPanelEvents()},updatePanelContent(){this.panelElement&&(this.panelElement.innerHTML=this.generatePanelContent(),this.bindPanelEvents())},generatePanelContent(){return`
268
- <div class="lvc-month-panel-header">
269
- <span class="lvc-month-nav-btn" data-direction="-1">◀</span>
270
- <span>${this.currentYear}年</span>
271
- <span class="lvc-month-nav-btn" data-direction="1">▶</span>
272
- </div>
273
- <div class="lvc-month-grid">
274
- ${Array.from({length:12},(t,e)=>{const i=e+1,r=this.getMonthCellClasses(i);return`<span class="${Object.entries(r).filter(([s,a])=>a).map(([s,a])=>s).join(" ")}" data-month="${i}">${i}月</span>`}).join("")}
275
- </div>
276
- <div class="lvc-month-panel-footer">
277
- <span class="lvc-month-action-btn is-outline" data-action="clear">清空</span>
278
- <div class="lvc-month-right-actions">
279
- <span class="lvc-month-action-btn is-outline" data-action="cancel">取消</span>
280
- <span class="lvc-month-action-btn is-primary" data-action="confirm">确定</span>
281
- </div>
282
- </div>
283
- `},getMonthCellClasses(t){let i={"lvc-month-cell":!0,"is-current":t===this.currentMonth&&this.currentYear===this.currentYearNow};if(this.isRangeMode){const r=`${this.tempStartYear}-${String(this.tempStartMonth).padStart(2,"0")}`,n=`${this.tempEndYear}-${String(this.tempEndMonth).padStart(2,"0")}`,s=`${this.currentYear}-${String(t).padStart(2,"0")}`,a=this.tempStartYear!==null,l=this.tempEndYear!==null;i["is-active"]=a&&s===r||l&&s===n,i["is-in-range"]=a&&l&&s>r&&s<n,i["is-range-start"]=a&&s===r,i["is-range-end"]=l&&s===n}else i["is-active"]=this.tempMonth===t&&this.currentYear===this.tempYear;return i},bindPanelEvents(){if(!this.panelElement)return;this.panelElement.querySelectorAll(".lvc-month-nav-btn").forEach(r=>{const n=parseInt(r.dataset.direction);r.addEventListener("click",s=>{s.stopPropagation(),n===-1?this.prevYear():this.nextYear()})}),this.panelElement.querySelectorAll(".lvc-month-cell").forEach(r=>{const n=parseInt(r.dataset.month);r.addEventListener("click",s=>{s.stopPropagation(),this.selectMonth(n)}),this.isRangeMode&&(r.addEventListener("mouseenter",s=>{this.selectingRangePart==="end"&&this.tempStartYear&&(this.hoverMonth=`${this.currentYear}-${String(n).padStart(2,"0")}`,this.updateHoverRangeStyle())}),r.addEventListener("mouseleave",s=>{this.hoverMonth&&(this.hoverMonth=null,this.clearHoverRangeStyle())}))}),this.panelElement.querySelectorAll(".lvc-month-action-btn").forEach(r=>{const n=r.dataset.action;r.addEventListener("click",s=>{switch(s.stopPropagation(),n){case"clear":this.handleClear();break;case"cancel":this.handleCancel();break;case"confirm":this.handleConfirm();break}})})},updatePanelPosition(){const t=this.$el.querySelector(".lvc-month-input-wrapper");if(t&&this.panelElement){const e=t.getBoundingClientRect();let i=e.bottom+.1385,r=e.left+e.width/2;const n=window.innerHeight,s=window.innerWidth,a=this.panelElement.getBoundingClientRect();i+a.height>n&&(i=e.top-a.height-.1385,i<0&&(i=e.bottom+.1385,this.panelElement.style.maxHeight=`${n-i-.1731}px`));const l=a.width/2;r-l<0?r=l+.1731:r+l>s&&(r=s-l-.1731),this.panelElement.style.top=`${i}px`,this.panelElement.style.left=`${r}px`}},updateHoverRangeStyle(){if(!this.panelElement||!this.hoverMonth||!this.tempStartYear)return;const t=`${this.tempStartYear}-${String(this.tempStartMonth).padStart(2,"0")}`,e=this.hoverMonth,i=t<e?t:e,r=t<e?e:t;this.panelElement.querySelectorAll(".lvc-month-cell").forEach(s=>{const a=parseInt(s.dataset.month),l=`${this.currentYear}-${String(a).padStart(2,"0")}`;l>i&&l<r?s.classList.add("is-in-hover-range"):s.classList.remove("is-in-hover-range")})},clearHoverRangeStyle(){if(!this.panelElement)return;this.panelElement.querySelectorAll(".lvc-month-cell.is-in-hover-range").forEach(e=>e.classList.remove("is-in-hover-range"))},addEventListeners(){this.handleScroll=this.updatePanelPosition.bind(this),this.handleResize=this.updatePanelPosition.bind(this),window.addEventListener("scroll",this.handleScroll,!0),window.addEventListener("resize",this.handleResize)},removeEventListeners(){this.handleScroll&&window.removeEventListener("scroll",this.handleScroll,!0),this.handleResize&&window.removeEventListener("resize",this.handleResize)},removePanel(){this.removeEventListeners(),this.overlayElement&&this.overlayElement.parentNode&&(document.body.removeChild(this.overlayElement),this.overlayElement=null),this.panelElement&&this.panelElement.parentNode&&(document.body.removeChild(this.panelElement),this.panelElement=null)},prevYear(){this.currentYear--,this.updatePanelContent()},nextYear(){this.currentYear++,this.updatePanelContent()},selectMonth(t){if(this.hoverMonth=null,this.isRangeMode){const e=`${this.currentYear}-${String(t).padStart(2,"0")}`,i=this.tempStartYear?`${this.tempStartYear}-${String(this.tempStartMonth).padStart(2,"0")}`:"",r=!!this.tempStartYear,n=!!this.tempEndYear;if(this.selectingRangePart==="start"||r&&n?(this.tempStartYear=this.currentYear,this.tempStartMonth=t,this.tempEndYear=null,this.tempEndMonth=null,this.selectingRangePart="end"):(e<i?(this.tempEndYear=this.tempStartYear,this.tempEndMonth=this.tempStartMonth,this.tempStartYear=this.currentYear,this.tempStartMonth=t):(this.tempEndYear=this.currentYear,this.tempEndMonth=t),this.selectingRangePart="start"),this.tempStartYear&&this.tempEndYear){const s=`${this.tempStartYear}-${String(this.tempStartMonth).padStart(2,"0")}`,a=`${this.tempEndYear}-${String(this.tempEndMonth).padStart(2,"0")}`;this.$emit("input",[s,a])}else if(this.tempStartYear){const s=`${this.tempStartYear}-${String(this.tempStartMonth).padStart(2,"0")}`;this.$emit("input",[s,""])}}else{this.tempMonth=t,this.tempYear=this.currentYear;const e=String(this.tempMonth).padStart(2,"0"),i=`${this.tempYear}-${e}`;this.$emit("input",i)}this.updatePanelContent()},handleClear(){this.isRangeMode?(this.$emit("input",["",""]),this.tempStartYear=null,this.tempStartMonth=null,this.tempEndYear=null,this.tempEndMonth=null,this.selectingRangePart="start"):(this.$emit("input",""),this.tempYear=null,this.tempMonth=null),this.isPanelOpen&&this.updatePanelContent()},handleCancel(){this.closePanel()},handleConfirm(){if(this.isRangeMode){if(this.tempStartYear&&this.tempEndYear){const t=`${this.tempStartYear}-${String(this.tempStartMonth).padStart(2,"0")}`,e=`${this.tempEndYear}-${String(this.tempEndMonth).padStart(2,"0")}`;this.$emit("input",[t,e]),this.$emit("confirm",[t,e])}}else{const t=String(this.tempMonth).padStart(2,"0"),e=`${this.tempYear}-${t}`;this.$emit("input",e),this.$emit("confirm",e)}this.closePanel()},clickOutside(t){const e=this.$refs.pickerContainer;e&&!e.contains(t.target)&&(!this.panelElement||!this.panelElement.contains(t.target))&&this.closePanel()}}};Vue.component("lvc-month-picker",_t);const Ct=T.options.components["lvc-month-picker"];(function(){const t=document.createElement("style");t.id="lvc-year-picker-style",t.textContent=`
284
- .lvc-year-picker {
285
- position: relative;
286
- display: inline-block;
287
- font-size: 1.8vmin;
288
- color: #fff;
289
- user-select: none;
290
- height: 100%;
291
- }
292
-
293
- .lvc-year-input-wrapper {
294
- background: #0d2339;
295
- border: 1px solid #1e4469;
296
- border-radius: 0.8vmin;
297
- padding: 0.6vmin 1vmin;
298
- cursor: pointer;
299
- display: flex;
300
- align-items: center;
301
- gap: 0.8vmin;
302
- min-width: 10vmin;
303
- transition: all 0.3s;
304
- height: 100%;
305
- }
306
-
307
- .lvc-year-separator {
308
- color: #5d758c;
309
- font-size: 1.385vmin;
310
- flex-shrink: 0;
311
- }
312
-
313
- .lvc-year-input-wrapper:hover,
314
- .lvc-year-input-wrapper.is-active {
315
- border-color: #12bbed;
316
- box-shadow: 0 0 1.2vmin rgba(18, 187, 237, 0.3);
317
- }
318
-
319
- .lvc-year-inner-input {
320
- background: transparent;
321
- border: none;
322
- color: #fff;
323
- outline: none;
324
- width: 100%;
325
- text-align: center;
326
- cursor: pointer;
327
- font-size: 1.3vmin;
328
- }
329
-
330
- .lvc-year-icon-arrow {
331
- color: #12bbed;
332
- font-size: 1.385vmin;
333
- transition: transform 0.3s;
334
- }
335
-
336
- .lvc-year-panel {
337
- position: absolute;
338
- top: 5vmin;
339
- left: 50%;
340
- transform: translateX(-50%);
341
- background: #0b1a2a;
342
- border: 1px solid #12bbed;
343
- box-shadow: 0 1.2vmin 3.5vmin rgba(0, 0, 0, 0.7);
344
- border-radius: 1vmin;
345
- padding: 1.5vmin;
346
- z-index: 9999;
347
- min-width: 24vmin;
348
- }
349
-
350
- .lvc-year-panel-header {
351
- display: flex;
352
- justify-content: space-between;
353
- align-items: center;
354
- margin-bottom: 1vmin;
355
- color: #12bbed;
356
- font-size: 1.6vmin;
357
- }
358
-
359
- .lvc-year-nav-btn {
360
- cursor: pointer;
361
- padding: 0.3vmin 0.8vmin;
362
- font-size: 1.4vmin;
363
- color: #12bbed;
364
- transition: color 0.2s;
365
- }
366
-
367
- .lvc-year-nav-btn:hover {
368
- color: #fff;
369
- }
370
-
371
- .lvc-year-grid {
372
- display: grid;
373
- grid-template-columns: repeat(4, 1fr);
374
- }
375
-
376
- .lvc-year-cell {
377
- position: relative;
378
- height: 4.5vmin;
379
- width: 6.5vmin;
380
- line-height: 4.5vmin;
381
- text-align: center;
382
- font-size: 1.662vmin;
383
- cursor: pointer;
384
- border-radius: 0.5vmin;
385
- color: #8ab4d4;
386
- transition: all 0.2s;
387
- }
388
-
389
- .lvc-year-cell:hover {
390
- background: rgba(18, 187, 237, 0.2);
391
- color: #fff;
392
- }
393
-
394
- .lvc-year-cell.is-active {
395
- background: #12bbed;
396
- color: #fff;
397
- font-weight: bold;
398
- }
399
-
400
- .lvc-year-cell.is-in-range {
401
- background: rgba(18, 187, 237, 0.15);
402
- color: #12bbed;
403
- border-radius: 0;
404
- }
405
-
406
- .lvc-year-cell.is-in-hover-range {
407
- background: rgba(18, 187, 237, 0.25);
408
- color: #fff;
409
- border-radius: 0;
410
- }
411
-
412
- .lvc-year-cell.is-current::after {
413
- content: "";
414
- position: absolute;
415
- bottom: 0.5vmin;
416
- left: 50%;
417
- width: 0.6vmin;
418
- height: 0.4vmin;
419
- background: #12bbed;
420
- border-radius: 50%;
421
- transform: translateX(-50%);
422
- }
423
-
424
- .lvc-year-panel-footer {
425
- border-top: 1px solid rgba(255, 255, 255, 0.05);
426
- margin-top: 1vmin;
427
- padding-top: 1vmin;
428
- display: flex;
429
- justify-content: space-between;
430
- align-items: center;
431
- gap: 1vmin;
432
- }
433
-
434
- .lvc-year-right-actions {
435
- display: flex;
436
- gap: 1vmin;
437
- }
438
-
439
- .lvc-year-action-btn {
440
- font-size: 1.662vmin;
441
- cursor: pointer;
442
- padding: 0.554vmin 1.662vmin;
443
- border-radius: 0.5vmin;
444
- transition: all 0.2s;
445
- }
446
-
447
- .lvc-year-action-btn.is-outline {
448
- border: 1px solid #1e4469;
449
- color: #8ab4d4;
450
- }
451
-
452
- .lvc-year-action-btn.is-outline:hover {
453
- border-color: #12bbed;
454
- color: #12bbed;
455
- }
456
-
457
- .lvc-year-action-btn.is-primary {
458
- background: #12bbed;
459
- color: #fff;
460
- }
461
-
462
- .lvc-year-action-btn.is-primary:hover {
463
- background: #0ea8d4;
464
- }
465
-
466
- .lvc-year-fade-enter-active,
467
- .lvc-year-fade-leave-active {
468
- transition: opacity 0.25s cubic-bezier(0.23, 1, 0.32, 1), transform 0.25s cubic-bezier(0.23, 1, 0.32, 1);
469
- }
470
-
471
- .lvc-year-fade-enter,
472
- .lvc-year-fade-leave-to {
473
- opacity: 0;
474
- transform: translateY(1.662vmin) scale(0.98);
475
- }
476
- `,document.getElementById("lvc-year-picker-style")||document.head.appendChild(t)})();const xt=`
477
- <div class="lvc-year-picker" ref="pickerContainer">
478
- <div class="lvc-year-input-wrapper" :class="{ 'is-active': isPanelOpen }" @click="handleTogglePanel">
479
- <template v-if="isRangeMode">
480
- <input class="lvc-year-inner-input" readonly :value="displayValues[0]" placeholder="开始年份" />
481
- <span class="lvc-year-separator">{{ rangeSeparator }}</span>
482
- <input class="lvc-year-inner-input" readonly :value="displayValues[1]" placeholder="结束年份" />
483
- </template>
484
- <template v-else>
485
- <input class="lvc-year-inner-input" readonly :value="displayValue" placeholder="请选择年份" />
486
- </template>
487
- <span class="lvc-year-icon-arrow" :style="{ transform: isPanelOpen ? 'rotate(180deg)' : 'none' }">▼</span>
488
- </div>
489
- </div>
490
- `;let q=[],Pt=0;const $t={name:"lvcYearPicker",props:{value:{type:[String,Array],default:""},yearRange:{type:Number,default:5},type:{type:String,default:"year"},rangeSeparator:{type:String,default:"至"}},template:xt,data(){const t=new Date,e=this.type==="yearrange";let i;if(this.value)if(e){const r=Array.isArray(this.value)?this.value:["",""];i=r[0]?parseInt(r[0]):t.getFullYear()}else i=parseInt(this.value);else i=t.getFullYear();return{isPanelOpen:!1,currentYear:i,currentYearNow:t.getFullYear(),tempYear:i,rangeStart:i-this.yearRange,tempStartYear:i,tempEndYear:i,selectingRangePart:"start",hoverYear:null,panelElement:null,overlayElement:null,yearPickerId:`lvc-year-picker-${++Pt}`}},computed:{isRangeMode(){return this.type==="yearrange"},displayValue(){return this.value||""},displayValues(){return Array.isArray(this.value)?[this.value[0]||"",this.value[1]||""]:["",""]},yearList(){const t=[];for(let e=0;e<this.yearRange*2+1;e++)t.push(this.rangeStart+e);return t},displayRange(){const t=this.rangeStart,e=this.rangeStart+this.yearRange*2;return`${t} - ${e}`}},mounted(){this._onDocClick=t=>{this.clickOutside(t)},document.addEventListener("click",this._onDocClick)},beforeDestroy(){document.removeEventListener("click",this._onDocClick),this.closePanel()},watch:{value(t){if(this.isRangeMode){const e=Array.isArray(t)?t:["",""];e[0]&&(this.tempStartYear=parseInt(e[0])),e[1]&&(this.tempEndYear=parseInt(e[1]))}else t&&(this.tempYear=parseInt(t))}},methods:{handleTogglePanel(){this.isPanelOpen?this.closePanel():(this.closeOtherYearPickers(),this.openPanel())},openPanel(){this.isPanelOpen=!0,q.push(this),this.syncInternalStateFromValue(),this.$nextTick(()=>{this.createPanel()})},syncInternalStateFromValue(){if(this.isRangeMode){const t=Array.isArray(this.value)?this.value:["",""];t[0]?this.tempStartYear=parseInt(t[0]):this.tempStartYear=new Date().getFullYear(),t[1]?this.tempEndYear=parseInt(t[1]):this.tempEndYear=this.tempStartYear,this.currentYear=this.tempStartYear,this.rangeStart=this.currentYear-this.yearRange,this.selectingRangePart="start"}else{const t=this.value?parseInt(this.value):new Date().getFullYear();this.tempYear=t,this.currentYear=this.tempYear,this.rangeStart=this.currentYear-this.yearRange}},closePanel(){this.isPanelOpen=!1,q=q.filter(t=>t.yearPickerId!==this.yearPickerId),this.removePanel()},closeOtherYearPickers(){q.forEach(t=>{t.yearPickerId!==this.yearPickerId&&t.closePanel()})},createPanel(){if(this.panelElement&&document.body.contains(this.panelElement)){this.updatePanelContent(),this.updatePanelPosition();return}this.removePanel(),this.panelElement=document.createElement("div"),this.panelElement.className="lvc-year-panel",this.panelElement.style.position="fixed",this.panelElement.style.zIndex="9999",this.panelElement.style.opacity="0",this.panelElement.style.transform="translateX(-50%) translateY(1.662vmin) scale(0.98)",this.panelElement.style.transition="opacity 0.25s cubic-bezier(0.23, 1, 0.32, 1), transform 0.25s cubic-bezier(0.23, 1, 0.32, 1)",this.panelElement.style.background="#0b1a2a",this.panelElement.style.border="1px solid #12bbed",this.panelElement.style.boxShadow="0 1.2vmin 3.5vmin rgba(0, 0, 0, 0.7)",this.panelElement.style.borderRadius="1vmin",this.panelElement.style.padding="1.5vmin",this.panelElement.style.minWidth="24vmin",this.panelElement.addEventListener("click",t=>{t.stopPropagation()}),this.panelElement.innerHTML=this.generatePanelContent(),document.body.appendChild(this.panelElement),this.overlayElement=document.createElement("div"),this.overlayElement.style.cssText="position:fixed;top:0;left:0;right:0;bottom:0;z-index:9998;",this.overlayElement.addEventListener("click",()=>{this.closePanel()}),document.body.appendChild(this.overlayElement),this.updatePanelPosition(),this.addEventListeners(),setTimeout(()=>{this.panelElement.style.opacity="1",this.panelElement.style.transform="translateX(-50%) translateY(0) scale(1)"},10),this.bindPanelEvents()},updatePanelContent(){this.panelElement&&(this.panelElement.innerHTML=this.generatePanelContent(),this.bindPanelEvents())},generatePanelContent(){return`
491
- <div class="lvc-year-panel-header">
492
- <span class="lvc-year-nav-btn" data-direction="-1">◀</span>
493
- <span>${this.displayRange}</span>
494
- <span class="lvc-year-nav-btn" data-direction="1">▶</span>
495
- </div>
496
- <div class="lvc-year-grid">
497
- ${this.yearList.map(t=>{const e=this.getYearCellClasses(t);return`<span class="${Object.entries(e).filter(([r,n])=>n).map(([r,n])=>r).join(" ")}" data-year="${t}">${t}</span>`}).join("")}
498
- </div>
499
- <div class="lvc-year-panel-footer">
500
- <span class="lvc-year-action-btn is-outline" data-action="clear">清空</span>
501
- <div class="lvc-year-right-actions">
502
- <span class="lvc-year-action-btn is-outline" data-action="cancel">取消</span>
503
- <span class="lvc-year-action-btn is-primary" data-action="confirm">确定</span>
504
- </div>
505
- </div>
506
- `},getYearCellClasses(t){let i={"lvc-year-cell":!0,"is-current":t===this.currentYearNow};if(this.isRangeMode){const r=this.tempStartYear!==null,n=this.tempEndYear!==null;i["is-active"]=r&&t===this.tempStartYear||n&&t===this.tempEndYear,i["is-in-range"]=r&&n&&t>this.tempStartYear&&t<this.tempEndYear}else i["is-active"]=this.tempYear===t;return i},bindPanelEvents(){if(!this.panelElement)return;this.panelElement.querySelectorAll(".lvc-year-nav-btn").forEach(r=>{const n=parseInt(r.dataset.direction);r.addEventListener("click",s=>{s.stopPropagation(),n===-1?this.prevRange():this.nextRange()})}),this.panelElement.querySelectorAll(".lvc-year-cell").forEach(r=>{const n=parseInt(r.dataset.year);r.addEventListener("click",s=>{s.stopPropagation(),this.selectYear(n)}),this.isRangeMode&&(r.addEventListener("mouseenter",s=>{this.selectingRangePart==="end"&&this.tempStartYear&&(this.hoverYear=n,this.updateHoverRangeStyle())}),r.addEventListener("mouseleave",s=>{this.hoverYear&&(this.hoverYear=null,this.clearHoverRangeStyle())}))}),this.panelElement.querySelectorAll(".lvc-year-action-btn").forEach(r=>{const n=r.dataset.action;r.addEventListener("click",s=>{switch(s.stopPropagation(),n){case"clear":this.handleClear();break;case"cancel":this.handleCancel();break;case"confirm":this.handleConfirm();break}})})},updatePanelPosition(){const t=this.$el.querySelector(".lvc-year-input-wrapper");if(t&&this.panelElement){const e=t.getBoundingClientRect();let i=e.bottom+.1385,r=e.left+e.width/2;const n=window.innerHeight,s=window.innerWidth,a=this.panelElement.getBoundingClientRect();i+a.height>n&&(i=e.top-a.height-.1385,i<0&&(i=e.bottom+.1385,this.panelElement.style.maxHeight=`${n-i-.1731}px`));const l=a.width/2;r-l<0?r=l+.1731:r+l>s&&(r=s-l-.1731),this.panelElement.style.top=`${i}px`,this.panelElement.style.left=`${r}px`}},updateHoverRangeStyle(){if(!this.panelElement||this.hoverYear===null||this.tempStartYear===null)return;const t=this.tempStartYear,e=this.hoverYear,i=Math.min(t,e),r=Math.max(t,e);this.panelElement.querySelectorAll(".lvc-year-cell").forEach(s=>{const a=parseInt(s.dataset.year);a>i&&a<r?s.classList.add("is-in-hover-range"):s.classList.remove("is-in-hover-range")})},clearHoverRangeStyle(){if(!this.panelElement)return;this.panelElement.querySelectorAll(".lvc-year-cell.is-in-hover-range").forEach(e=>e.classList.remove("is-in-hover-range"))},addEventListeners(){this.handleScroll=this.updatePanelPosition.bind(this),this.handleResize=this.updatePanelPosition.bind(this),window.addEventListener("scroll",this.handleScroll,!0),window.addEventListener("resize",this.handleResize)},removeEventListeners(){this.handleScroll&&window.removeEventListener("scroll",this.handleScroll,!0),this.handleResize&&window.removeEventListener("resize",this.handleResize)},removePanel(){this.removeEventListeners(),this.overlayElement&&this.overlayElement.parentNode&&(document.body.removeChild(this.overlayElement),this.overlayElement=null),this.panelElement&&this.panelElement.parentNode&&(document.body.removeChild(this.panelElement),this.panelElement=null)},prevRange(){this.rangeStart-=this.yearRange*2+1,this.updatePanelContent()},nextRange(){this.rangeStart+=this.yearRange*2+1,this.updatePanelContent()},selectYear(t){if(this.hoverYear=null,this.isRangeMode){const e=this.tempStartYear!==null,i=this.tempEndYear!==null;this.selectingRangePart==="start"||e&&i?(this.tempStartYear=t,this.tempEndYear=null,this.selectingRangePart="end"):(t<this.tempStartYear?(this.tempEndYear=this.tempStartYear,this.tempStartYear=t):this.tempEndYear=t,this.selectingRangePart="start"),this.tempStartYear&&this.tempEndYear?this.$emit("input",[String(this.tempStartYear),String(this.tempEndYear)]):this.tempStartYear&&this.$emit("input",[String(this.tempStartYear),""])}else{this.tempYear=t;const e=String(this.tempYear);this.$emit("input",e)}this.updatePanelContent()},handleClear(){this.isRangeMode?(this.$emit("input",["",""]),this.tempStartYear=null,this.tempEndYear=null,this.selectingRangePart="start"):(this.$emit("input",""),this.tempYear=null),this.isPanelOpen&&this.updatePanelContent()},handleCancel(){this.closePanel()},handleConfirm(){if(this.isRangeMode){if(this.tempStartYear&&this.tempEndYear){const t=String(this.tempStartYear),e=String(this.tempEndYear);this.$emit("input",[t,e]),this.$emit("confirm",[t,e]),this.$emit("change",[t,e])}}else{const t=String(this.tempYear);this.$emit("input",t),this.$emit("confirm",t),this.$emit("change",t)}this.closePanel()},clickOutside(t){const e=this.$refs.pickerContainer;e&&!e.contains(t.target)&&(!this.panelElement||!this.panelElement.contains(t.target))&&this.closePanel()}}};Vue.component("lvc-year-picker",$t);const Mt=T.options.components["lvc-year-picker"],U={show(t={}){typeof t=="string"&&(t={content:t});const e=document.createElement("div");return document.body.appendChild(e),new T({el:e,data(){return{visible:!1,title:t.title??"提示",content:t.content??"",width:t.width??"44.32vmin",confirmText:t.confirmText??"确定",cancelText:t.cancelText??"取消",showCancel:t.showCancel??!0,showClose:t.showClose??!0,showFooter:t.showFooter??!0,closeOnClickModal:t.closeOnClickModal??!0}},template:`
507
- <lvc-dialog
508
- :visible.sync="visible"
509
- :title="title"
510
- :content="content"
511
- :width="width"
512
- :confirm-text="confirmText"
513
- :cancel-text="cancelText"
514
- :show-cancel="showCancel"
515
- :show-close="showClose"
516
- :show-footer="showFooter"
517
- :close-on-click-modal="closeOnClickModal"
518
- @confirm="onConfirmAction"
519
- @cancel="onCancelAction"
520
- @close="destroy">
521
- </lvc-dialog>
522
- `,components:{LvcDialog:Q},methods:{async onConfirmAction(){t.onConfirm&&await t.onConfirm()===!1||(this.visible=!1)},onCancelAction(){t.onCancel&&t.onCancel()},destroy(){setTimeout(()=>{this.$destroy(),this.$el&&this.$el.parentNode&&this.$el.parentNode.removeChild(this.$el)},500)}},mounted(){this.visible=!0}})}};function Lt(t){t.prototype.$lvcDialog=U,typeof window<"u"&&(window.lvcDialog=U)}const Tt=`
523
- .lvc-message-container {
524
- position: fixed;
525
- top: 3vmin;
526
- left: 50%;
527
- transform: translateX(-50%);
528
- display: flex;
529
- flex-direction: column;
530
- align-items: center;
531
- gap: 1.5vmin;
532
- z-index: 9999999;
533
- pointer-events: none;
534
- }
535
- .lvc-message {
536
- display: flex;
537
- align-items: center;
538
- gap: 1vmin;
539
- padding: 1vmin 2.5vmin;
540
- border-radius: 0.5vmin;
541
- text-align: center;
542
- font-size: 1.6vmin;
543
- color: #e0f2fe;
544
- background: #0d2339;
545
- border: 1px solid #1e4469;
546
- box-shadow: 0 0.5vmin 1.5vmin rgba(0, 0, 0, 0.5);
547
- pointer-events: auto;
548
- transition: all 0.3s ease-in-out;
549
- transform: translateY(0);
550
- opacity: 1;
551
- user-select: none;
552
- }
553
- .lvc-message--info { border-color: #12bbed; }
554
- .lvc-message--success { border-color: #10b981; color: #10b981; }
555
- .lvc-message--warning { border-color: #f59e0b; color: #f59e0b; }
556
- .lvc-message--error { border-color: #ef4444; color: #ef4444; }
557
- .lvc-message-icon { font-size: 1.6vmin; display: inline-block; }
558
- .lvc-message-text { color: #e0f2fe; font-weight: 500; }
559
- .lvc-message-enter,
560
- .lvc-message-leave { opacity: 0; transform: translateY(-2vmin); }
561
- `;function Rt(){if(typeof document>"u"||document.getElementById("lvc-message-style"))return;const t=document.createElement("style");t.id="lvc-message-style",t.textContent=Tt,document.head.appendChild(t)}const Y=function(t){typeof t=="string"&&(t={message:t});const e=t.type||"info",i=t.message||"",r=t.duration!==void 0?t.duration:2e3;Rt();const n=Y._container=Y._container||(()=>{const l=document.createElement("div");return l.className="lvc-message-container",document.body.appendChild(l),l})(),s=document.createElement("div"),a={info:"ℹ",success:"✔",warning:"⚠",error:"✖"};s.innerHTML=`
562
- <span class="lvc-message-icon">${a[e]}</span>
563
- <span class="lvc-message-text">${i}</span>
564
- `,s.className=`lvc-message lvc-message--${e} lvc-message-enter`,n.appendChild(s),requestAnimationFrame(()=>s.classList.remove("lvc-message-enter")),r>0&&setTimeout(()=>{s.classList.add("lvc-message-leave");const l=()=>{s.parentNode&&s.parentNode.removeChild(s),s.removeEventListener("transitionend",l)};s.addEventListener("transitionend",l),setTimeout(()=>{s.parentNode&&s.parentNode.removeChild(s)},400)},r)};["success","warning","info","error"].forEach(t=>{Y[t]=e=>(typeof e=="string"&&(e={message:e}),e.type=t,Y(e))});function Yt(t){t.prototype.$lvcMessage=Y,typeof window<"u"&&(window.LvcMessage=Y)}const Ot=`
565
- .lvc-loading-mask {
566
- position: fixed;
567
- top: 0; left: 0; right: 0; bottom: 0;
568
- background-color: rgba(6, 23, 39, 0.8);
569
- backdrop-filter: blur(2px);
570
- z-index: 9999998;
571
- display: flex;
572
- flex-direction: column;
573
- align-items: center;
574
- justify-content: center;
575
- opacity: 0;
576
- transition: opacity 0.3s ease-in-out;
577
- user-select: none;
578
- }
579
- .lvc-loading-mask.is-visible { opacity: 1; }
580
- .lvc-loading-spinner {
581
- position: relative;
582
- width: 6vmin;
583
- height: 6vmin;
584
- margin-bottom: 2vmin;
585
- }
586
- .lvc-loading-spinner::before {
587
- content: "";
588
- position: absolute;
589
- top: 0; left: 0; right: 0; bottom: 0;
590
- border-radius: 50%;
591
- border: 0.3vmin solid transparent;
592
- border-top-color: #12bbed;
593
- border-bottom-color: #12bbed;
594
- animation: lvc-spin 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
595
- }
596
- .lvc-loading-spinner::after {
597
- content: "";
598
- position: absolute;
599
- top: 1vmin; left: 1vmin; right: 1vmin; bottom: 1vmin;
600
- border-radius: 50%;
601
- border: 0.3vmin solid transparent;
602
- border-left-color: #7dd3fc;
603
- border-right-color: #7dd3fc;
604
- animation: lvc-spin-reverse 1s linear infinite;
605
- }
606
- .lvc-loading-text {
607
- color: #12bbed;
608
- font-size: 1.6vmin;
609
- letter-spacing: 0.2vmin;
610
- font-weight: bold;
611
- text-shadow: 0 0 0.5vmin rgba(18, 187, 237, 0.5);
612
- animation: lvc-pulse 2s ease-in-out infinite;
613
- }
614
- @keyframes lvc-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
615
- @keyframes lvc-spin-reverse { 0% { transform: rotate(0deg); } 100% { transform: rotate(-360deg); } }
616
- @keyframes lvc-pulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
617
- `;function At(){if(typeof document>"u"||document.getElementById("lvc-loading-style"))return;const t=document.createElement("style");t.id="lvc-loading-style",t.textContent=Ot,document.head.appendChild(t)}const D={show(t={}){typeof t=="string"&&(t={text:t});const e=t.text||"加载中...";if(this._instance)return this._instance.setText(e),this._instance;At();const i=document.createElement("div");i.className="lvc-loading-mask";const r=document.createElement("div");r.className="lvc-loading-spinner";const n=document.createElement("div");n.className="lvc-loading-text",n.textContent=e,i.appendChild(r),i.appendChild(n),document.body.appendChild(i),requestAnimationFrame(()=>i.classList.add("is-visible"));const s={setText(a){n.textContent=a},close(){if(!i.parentNode)return;i.classList.remove("is-visible");const a=()=>{i.parentNode&&i.parentNode.removeChild(i),i.removeEventListener("transitionend",a),D._instance=null};i.addEventListener("transitionend",a),setTimeout(()=>{i.parentNode&&i.parentNode.removeChild(i),D._instance=null},400)}};return this._instance=s,s},close(){this._instance&&this._instance.close()}};function Dt(t){t.prototype.$lvcLoading=D,typeof window<"u"&&(window.LvcLoading=D)}function It(){try{if(window.top&&window.top.location.origin===window.location.origin)return window.top}catch{}return window}const Ee=function(t){const e=It();if(e.__BUS__)return t.$Bus=e.__BUS__,e.__BUS__;const i={},r={},n=Math.random().toString(36).slice(2),s="lvc-bus",a="BroadcastChannel"in t?new BroadcastChannel(s):null;function l(h,p,v){(i[h]||[]).forEach(S=>{try{S(p,v)}catch{}})}function d(h){if(t===e){l(h.event,h.data);for(let p=0;p<e.frames.length;p++)try{e.frames[p].postMessage(h,"*")}catch{}}else e.postMessage(h,"*")}const c={on(h,p){(i[h]||(i[h]=[])).push(p)},off(h,p){p?i[h]=(i[h]||[]).filter(v=>v!==p):delete i[h]},once(h,p){const v=S=>{p(S),c.off(h,v)};c.on(h,v)},emit(h,p){const v={__bus:1,event:h,data:p,tab:n};l(h,p),a&&a.postMessage(v);try{localStorage.setItem(s,JSON.stringify({...v,t:Date.now()}))}catch{}d(v)},request(h,p,v=5e3){const S=Date.now()+Math.random();return new Promise(($,M)=>{r[S]=$,c.emit("__bus_req__",{id:S,event:h,data:p}),setTimeout(()=>{r[S]&&(delete r[S],M("timeout"))},v)})}};return c.on("__bus_req__",async({id:h,event:p,data:v})=>{var M;const S=(M=i[p])==null?void 0:M[0];if(!S)return;const $=await S(v);c.emit("__bus_res__",{id:h,res:$})}),c.on("__bus_res__",({id:h,res:p})=>{const v=r[h];v&&(v(p),delete r[h])}),a&&(a.onmessage=h=>{const p=h.data;p&&p.__bus&&p.tab!==n&&l(p.event,p.data)}),t.addEventListener("storage",h=>{if(h.key!==s)return;const p=JSON.parse(h.newValue||"{}");p.__bus&&p.tab!==n&&l(p.event,p.data)}),t.addEventListener("message",h=>{const p=h.data;!p||!p.__bus||(t===e&&d(p),l(p.event,p.data))}),e.__BUS__=c,t.$Bus=c,c}(typeof window<"u"?window:globalThis);class Se{constructor(e,i={}){this.url=e,this.options={heartbeatInterval:3e4,reconnectInterval:5e3,maxReconnectAttempts:5,pingMessage:"ping",...i},this.socket=null,this.reconnectAttempts=0,this.isManualClose=!1,this.messageQueue=[],this.listeners=new Map,this.heartbeatTimer=null,this.serverTimeoutTimer=null,this.connect()}connect(){if(!(this.socket&&(this.socket.readyState===WebSocket.OPEN||this.socket.readyState===WebSocket.CONNECTING)))try{this.socket=new WebSocket(this.url),this.initEvents()}catch(e){console.error("WebSocket 建立失败:",e),this.reconnect()}}initEvents(){this.socket.onopen=e=>{console.log("WebSocket 连接成功"),this.reconnectAttempts=0,this.isManualClose=!1,this.startHeartbeat(),this.flushQueue(),this.emit("open",e)},this.socket.onmessage=e=>{this.resetHeartbeat();let i=e.data;try{i=JSON.parse(e.data)}catch{}const r=i.topic||i.type;r&&this.emit(r,i),this.emit("message",i)},this.socket.onclose=e=>{this.stopHeartbeat(),this.emit("close",e),this.isManualClose||this.reconnect()},this.socket.onerror=e=>{console.error("WebSocket 异常"),this.emit("error",e)}}send(e){const i=typeof e=="object"?JSON.stringify(e):e;this.socket&&this.socket.readyState===WebSocket.OPEN?this.socket.send(i):(console.warn("WebSocket 未连接,消息已进入队列"),this.messageQueue.push(i))}flushQueue(){for(;this.messageQueue.length>0&&this.socket.readyState===WebSocket.OPEN;){const e=this.messageQueue.shift();this.socket.send(e)}}reconnect(){if(this.options.maxReconnectAttempts!==-1&&this.reconnectAttempts>=this.options.maxReconnectAttempts){console.error("WebSocket 重连次数达到上限");return}this.reconnectAttempts++,console.log(`WebSocket 正在尝试第 ${this.reconnectAttempts} 次重连...`);let e=this.options.reconnectInterval*Math.pow(1.5,this.reconnectAttempts-1);e=Math.min(e,6e4),setTimeout(()=>this.connect(),e)}startHeartbeat(){this.heartbeatTimer=setInterval(()=>{this.send(this.options.pingMessage),this.serverTimeoutTimer=setTimeout(()=>{console.warn("WebSocket 心跳超时,主动断开重连"),this.socket.close()},this.options.heartbeatInterval/2)},this.options.heartbeatInterval)}resetHeartbeat(){clearTimeout(this.serverTimeoutTimer)}stopHeartbeat(){clearInterval(this.heartbeatTimer),clearTimeout(this.serverTimeoutTimer)}close(){this.isManualClose=!0,this.stopHeartbeat(),this.socket&&this.socket.close()}on(e,i){this.listeners.has(e)||this.listeners.set(e,[]),this.listeners.get(e).push(i)}off(e,i){if(!this.listeners.has(e))return;if(!i){this.listeners.delete(e);return}const r=this.listeners.get(e),n=r.indexOf(i);n!==-1&&r.splice(n,1),r.length===0&&this.listeners.delete(e)}emit(e,i){const r=this.listeners.get(e);r&&r.forEach(n=>n(i))}}class J{constructor(e={}){this.options=Object.assign({lightIcon:"light.png",closeLightIcon:"closeLight.png"},e),this.currentWebview=null,this.barcode=null,this.backVew=null,this.scanTip=null,this.mask=null,this.openLight=null,this.isOpenLight=!1,this._scanReject=null,this._backButtonHandler=this._backButtonHandler.bind(this),this._plusReadyHandler=this._plusReadyHandler.bind(this),this._webviewCloseHandler=this.destroy.bind(this),window.plus?this._plusReadyHandler():document.addEventListener("plusready",this._plusReadyHandler,!1)}_plusReadyHandler(){this.currentWebview=plus.webview.currentWebview(),this.currentWebview.addEventListener("close",this._webviewCloseHandler),this.initStaticViews()}initStaticViews(){window.plus&&plus.key.hideSoftKeybord&&plus.key.hideSoftKeybord(),this.currentWebview&&(this.mask||(this.drawMask(),this.currentWebview.append(this.mask)),this.backVew||(this.drawBackView(),this.currentWebview.append(this.backVew)),this.scanTip||(this.drawScanTip(),this.currentWebview.append(this.scanTip)),this.openLight||(this.drawOpenLight(),this.emitOpenLight(),this.currentWebview.append(this.openLight)))}drawBarcode(){this.barcode=plus.barcode.create("barcode","",{top:"0px",left:"0px",width:"100%",height:"100%",position:"static"},!0)}drawMask(){this.mask=new plus.nativeObj.View("mask",{top:"0px",left:"0px",height:"100%",width:"100%"},[{tag:"rect",id:"rect",color:"rgba(0,0,0,0)",position:{top:"0px",left:"0px",width:"100%",height:"100%"}}]),this.mask.interceptTouchEvent(!0)}drawBackView(){this.backVew=new plus.nativeObj.View("backVew",{top:"22px",left:"86%",height:"20px",width:"40px"},[{tag:"font",id:"center",text:"取消",textStyles:{size:"18px",color:"#ffffff",fontWeight:"bold"},position:{top:"0px",left:"0px"}}]),this.backVew.interceptTouchEvent(!0),this.backVew.addEventListener("click",()=>this.cancelScan(),!1)}drawScanTip(){this.scanTip=new plus.nativeObj.View("scanTip",{top:"73%",left:"0px",height:"40px",width:"100%"},[{tag:"font",id:"center2",text:"请把扫描区对准二维码/一维码",textStyles:{size:"16px",color:"#ffffff",align:"center"},position:{top:"0px",left:"0px",width:"100%",height:"wrap_content"}}])}drawOpenLight(){this.openLight=new plus.nativeObj.View("openLight",{top:"58%",left:"40%",height:"10%",width:"20%"},this._getLightViewState(this.options.lightIcon,"轻触照亮")),this.openLight.interceptTouchEvent(!0)}emitOpenLight(){this.openLight.addEventListener("click",()=>{this.isOpenLight=!this.isOpenLight,this.resetDrawOpenLight(),this.barcode&&this.barcode.setFlash(this.isOpenLight)},!1)}resetDrawOpenLight(){this.openLight&&(this.isOpenLight?this.openLight.draw(this._getLightViewState(this.options.closeLightIcon,"轻触关闭")):this.openLight.draw(this._getLightViewState(this.options.lightIcon,"轻触照亮")))}_getLightViewState(e,i){return[{tag:"img",id:"openLight",src:e,position:{width:"28%",left:"36%",height:"30%"}},{tag:"font",id:"lightfont",text:i,textStyles:{size:"10px",color:"#ffffff"},position:{width:"80%",left:"10%"}}]}_backButtonHandler(){this.barcode?this.cancelScan():this.currentWebview&&this.currentWebview.back()}emitBackButton(){window.plus&&(plus.key.removeEventListener("backbutton",this._backButtonHandler),plus.key.addEventListener("backbutton",this._backButtonHandler))}startScanCode(){return new Promise((e,i)=>{window.plus&&plus.key.hideSoftKeybord&&plus.key.hideSoftKeybord(),this.initStaticViews(),this.barcode||(this.drawBarcode(),this.currentWebview.append(this.barcode),this.mask&&this.currentWebview.append(this.mask),this.scanTip&&this.currentWebview.append(this.scanTip),this.backVew&&this.currentWebview.append(this.backVew),this.openLight&&this.currentWebview.append(this.openLight)),this.emitBackButton(),this.resetDrawOpenLight(),this.barcode&&this.mask?(this._scanReject=i,this.barcode.start(),this.mask.show(),this.scanTip.show(),this.backVew.show(),this.openLight.show(),this.barcode.onmarked=(r,n,s)=>{this._scanReject=null,this.closeScan(),e({type:r,result:n,file:s})},this.barcode.onerror=r=>{this._scanReject=null,this.closeScan(),i(r)}):i(new Error("原生扫描组件加载失败"))})}cancelScan(){this._scanReject&&(this._scanReject(new Error("USER_CANCEL")),this._scanReject=null),this.closeScan()}closeScan(){window.plus&&plus.key.removeEventListener("backbutton",this._backButtonHandler),this.barcode&&(this.barcode.setFlash(!1),this.barcode.cancel(),this.barcode.close(),this.barcode=null),this.isOpenLight=!1,this.backVew&&this.backVew.hide(),this.scanTip&&this.scanTip.hide(),this.openLight&&this.openLight.hide(),this.mask&&this.mask.hide()}destroy(){this.cancelScan(),this.backVew&&(this.backVew.close(),this.backVew=null),this.scanTip&&(this.scanTip.close(),this.scanTip=null),this.openLight&&(this.openLight.close(),this.openLight=null),this.mask&&(this.mask.close(),this.mask=null),this.currentWebview&&(this.currentWebview.removeEventListener("close",this._webviewCloseHandler),this.currentWebview=null),document.removeEventListener("plusready",this._plusReadyHandler,!1)}}const Z={isAndroid:()=>navigator.userAgent.toLowerCase().indexOf("android")!==-1,isIOS:()=>!!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),isApp:()=>{try{return JSON.parse(localStorage.getItem("isapp")||"false")}catch{return!1}},getQuery:t=>{const e=new RegExp("(^|&)"+t+"=([^&]*)(&|$)"),i=window.location.search.substr(1).match(e);return i!=null?decodeURIComponent(i[2]):null},throttle:(t,e=2500)=>{let i=null;return function(...r){const n=+new Date;(!i||n-i>e)&&(t.apply(this,r),i=n)}}};typeof window<"u"&&(window.scanBind={ScanCode:J,...Z});class _e{constructor(e,i,r=1280){this.canvas=document.getElementById(e),this.container=document.querySelector(i),this.ctx=this.canvas.getContext("2d"),this.baseWidth=r,this.scale=1,this.imgCache={},this.dpr=window.devicePixelRatio||1,this.init()}init(){const e=this.container.clientWidth,i=this.container.clientHeight;this.scale=Math.max(.5,e/this.baseWidth),this.canvas.width=e*this.dpr,this.canvas.height=i*this.dpr,this.canvas.style.width=e+"px",this.canvas.style.height=i+"px",this.ctx.setTransform(1,0,0,1,0,0),this.ctx.scale(this.dpr,this.dpr)}s(e){return e*this.scale}clear(){this.ctx.clearRect(0,0,this.canvas.width/this.dpr,this.canvas.height/this.dpr)}_buildPath(e){const i=this.ctx;if(!(!e||e.length===0)){i.beginPath(),i.moveTo(this.s(e[0][0]),this.s(e[0][1]));for(let r=1;r<e.length;r++){const n=e[r];n.length===2?i.lineTo(this.s(n[0]),this.s(n[1])):n.length===4?i.quadraticCurveTo(this.s(n[0]),this.s(n[1]),this.s(n[2]),this.s(n[3])):n.length===6&&i.bezierCurveTo(this.s(n[0]),this.s(n[1]),this.s(n[2]),this.s(n[3]),this.s(n[4]),this.s(n[5]))}}}drawDashLine(e,i={}){const{color:r="rgba(255,255,255,0.2)",width:n=2,dash:s=[4,4]}=i,a=this.ctx;a.save(),this._buildPath(e),a.setLineDash(s.map(l=>this.s(l))),a.lineWidth=this.s(n),a.strokeStyle=r,a.stroke(),a.restore()}drawFlowLine(e,i={}){const{color:r="#00e5ff",width:n=2,dash:s=[10,20],offset:a=0,shadowBlur:l=8,shadowColor:d="#00e5ff"}=i,c=this.ctx;c.save(),this._buildPath(e),c.setLineDash(s.map(h=>this.s(h))),c.lineDashOffset=-this.s(a),c.lineWidth=this.s(n),c.strokeStyle=r,c.shadowBlur=this.s(l),c.shadowColor=d,c.stroke(),c.restore()}drawImage(e,i,r,n,s,a=!0){this.imgCache[e]||(this.imgCache[e]=new Image,this.imgCache[e].src=e);const l=this.imgCache[e];if(l.complete){const d=this.s(n),c=this.s(s),h=a?this.s(i)-d/2:this.s(i),p=a?this.s(r)-c/2:this.s(r);this.ctx.drawImage(l,h,p,d,c)}}drawText(e,i,r,n={}){const{fontSize:s=12,color:a="#fff",align:l="center",baseline:d="top",fontWeight:c="normal"}=n,h=this.ctx;h.save(),h.font=`${c} ${Math.round(this.s(s))}px "PingFang SC", "Microsoft YaHei", Arial`,h.fillStyle=a,h.textAlign=l,h.textBaseline=d,h.fillText(e,this.s(i),this.s(r)),h.restore()}drawNodeImgText(e){const{url:i,x:r,y:n,w:s,h:a,text:l,fontSize:d=12,textColor:c="#fff",gap:h=5}=e;if(this.drawImage(i,r,n,s,a,!0),l){const p=n+a/2+h;this.drawText(l,r,p,{fontSize:d,color:c})}}drawCircle(e,i,r,n={}){const{fillStyle:s,strokeStyle:a,lineWidth:l=2,shadowBlur:d=0,shadowColor:c="transparent"}=n,h=this.ctx;h.save(),h.beginPath(),h.arc(this.s(e),this.s(i),this.s(r),0,Math.PI*2),d>0&&(h.shadowBlur=this.s(d),h.shadowColor=c),s&&(h.fillStyle=s,h.fill()),a&&(h.lineWidth=this.s(l),h.strokeStyle=a,h.stroke()),h.restore()}drawPolygon(e,i={}){const{fillStyle:r,strokeStyle:n,lineWidth:s=2}=i;if(!e||e.length<2)return;const a=this.ctx;a.save(),a.beginPath(),a.moveTo(this.s(e[0][0]),this.s(e[0][1]));for(let l=1;l<e.length;l++)a.lineTo(this.s(e[l][0]),this.s(e[l][1]));a.closePath(),r&&(a.fillStyle=r,a.fill()),n&&(a.lineWidth=this.s(s),a.strokeStyle=n,a.stroke()),a.restore()}drawNode(e,i,r,n,s,a=!1,l=15,d=12){const c=this.ctx,h=this.s(e),p=this.s(i),v=this.s(r),S=this.s(l);c.save(),c.shadowBlur=this.s(15),c.shadowColor=n,c.beginPath(),c.arc(h,p,v,0,Math.PI*2),c.fillStyle="#26455C",c.fill(),c.strokeStyle=n,c.lineWidth=this.s(2),c.stroke(),c.shadowBlur=0,c.beginPath(),c.arc(h,p,v*.6,0,Math.PI*2),c.fillStyle=n,c.fill(),c.textAlign="center",c.textBaseline="middle";const $=a?this.s(d):this.s(d+2);if(c.font=`${$}px sans-serif`,a&&s.includes(`
618
- `)){const M=s.split(`
619
- `);c.fillStyle="#fff",c.fillText(M[0],h,p+v+S),c.fillStyle=n,c.font=`bold ${$+1}px sans-serif`,c.fillText(M[1],h,p+v+S*2)}else c.fillStyle="#fff",c.fillText(s,h,p-v-S);c.restore()}drawFlowCurve(e,i,r){const n=this.ctx,s=Math.atan2(i.y-e.y,i.x-e.x),a=this.s(e.x+Math.cos(s)*e.r),l=this.s(e.y+Math.sin(s)*e.r),d=this.s(i.x-Math.cos(s)*i.r),c=this.s(i.y-Math.sin(s)*i.r),h={x:(a+d)/2,y:(l+c)/2-this.s(10)};n.save(),n.beginPath(),n.moveTo(a,l),n.quadraticCurveTo(h.x,h.y,d,c),n.strokeStyle="#26455C",n.lineWidth=this.s(2),n.stroke(),n.setLineDash([this.s(8),this.s(8)]),n.lineDashOffset=-this.s(r),n.strokeStyle="rgba(0, 243, 255, 1)",n.stroke(),n.restore()}}const Ce={px2Echarts(t,e=1280,i=800,r=!0){if(typeof window>"u")return t;if(r&&Math.abs(t)===1)return 1;const n=Math.min(window.innerWidth,window.innerHeight),s=Math.min(e,i),a=n/s;return parseFloat((t*a).toFixed(2))}};function xe(t={}){return{vm:null,routes:t.routes||{},default:t.default||"",beforeHooks:[],current:"",parent:t.parent||"",level:t.level||1,isResolving:!1,errorPage:t.errorPage||(t.level===1?"./404.html":"../../404.html"),loginPage:t.loginPage||(t.level===1?"./login.html":"../../login.html"),getRootWindow(){try{if(window.top&&window.top.location.origin===window.location.origin)return window.top}catch{}return window},init(i){this.vm=i;const r=this.getRootWindow();typeof r.__isGoLogin__>"u"&&(r.__isGoLogin__=!1),this.beforeEach((s,a,l)=>{var c;const d=localStorage.getItem("emstoken");if((c=s.meta)!=null&&c.requiresAuth){if(d)l();else{if(r.__isGoLogin__){l(!1);return}r.__isGoLogin__=!0,l(!1),r.confirm("您的登录授权已到期,是否前往登录页面?")&&r.location.replace(this.loginPage)}return}l()}),this._listener=()=>this.resolve();const n=r;n.addEventListener("hashchange",this._listener),window.addEventListener("beforeunload",()=>{n.removeEventListener("hashchange",this._listener)}),this.resolve()},getRouteConfig(i){const r=this.routes[i];return r?typeof r=="string"?{path:r,meta:{}}:{path:r.path,meta:r.meta||{}}:null},resolve(){if(this.isResolving)return;this.isResolving=!0;const i=this.getRootWindow(),n=(i.location.hash||"").replace(/^#\/?/,"").split("/").filter(Boolean);if(this.parent&&n[0]!==this.parent){this.isResolving=!1;return}let s=n[this.level-1];if(!s&&this.default){s=this.default,n[this.level-1]=s;const d="/"+n.join("/");if(i.location.hash.replace(/^#\/?/,"")!==d.replace(/^\//,"")){i.location.hash=d,this.isResolving=!1;return}}const a=this.getRouteConfig(s);if(!a){if(s){if(s==="login"||s==="login.html"){console.warn(`[Router] login: 层级 ${this.level} 路由 ${s}`),i.location.replace(this.loginPage),this.isResolving=!1;return}console.warn(`[Router] 404: 层级 ${this.level} 找不到路由 ${s}`),i.location.replace(this.errorPage)}this.isResolving=!1;return}if(this.current===s){this.isResolving=!1;return}const l=this.current;this.runBeforeHooks({name:s,meta:a.meta},l,d=>{if(this.isResolving=!1,d===!1){l?this.push(l):i.__isGoLogin__||i.location.replace(this.loginPage);return}if(typeof d=="string"){this.push(d);return}this.current=s,this.vm&&(this.vm.navPath=a.path,this.vm.activeMenu=s)})},push(i){const r=this.getRootWindow();let s=(r.location.hash||"").replace(/^#\/?/,"").split("/").filter(Boolean);s[this.level-1]=i,s=s.slice(0,this.level),r.location.hash="/"+s.join("/")},beforeEach(i){this.beforeHooks.push(i)},runBeforeHooks(i,r,n){let s=0;const a=l=>{if(l===!1||typeof l=="string"){n(l);return}if(s>=this.beforeHooks.length){n();return}const d=this.beforeHooks[s++];d(i,r,a)};a()}}}const ee={LvcButton:me,LvcDialog:Q,LvcSelect:fe,LvcSwitch:ve,LvcTable:ge,LvcTimePicker:ye,LvcLoadMore:be,LvcDatePicker:we,LvcOdometer:ke,LvcTree:kt,LvcMonthPicker:Ct,LvcYearPicker:Mt},Nt={LvcButton:"lvc-button",LvcDialog:"lvc-dialog",LvcSelect:"lvc-select",LvcSwitch:"lvc-switch",LvcTable:"lvc-table",LvcTimePicker:"lvc-time-picker",LvcLoadMore:"lvc-load-more",LvcDatePicker:"lvc-date-picker",LvcOdometer:"lvc-odometer",LvcTree:"lvc-tree",LvcMonthPicker:"lvc-month-picker",LvcYearPicker:"lvc-year-picker"},G=t=>{G.installed||(G.installed=!0,Object.keys(ee).forEach(e=>{t.component(Nt[e]||e,ee[e])}),Lt(t),Yt(t),Dt(t))},Ht={version:"0.1.0",install:G,...ee,Dialog:U,Message:Y,Loading:D,Bus:Ee,SocketClient:Se,ScanCode:J,scanUtils:Z,CanvasTopologyUtils:_e,px2EchartsUrils:Ce,createRouter:xe};E.Bus=Ee,E.CanvasTopologyUtils=_e,E.Dialog=U,E.Loading=D,E.LvcButton=me,E.LvcDatePicker=we,E.LvcDialog=Q,E.LvcLoadMore=be,E.LvcOdometer=ke,E.LvcSelect=fe,E.LvcSwitch=ve,E.LvcTable=ge,E.LvcTimePicker=ye,E.Message=Y,E.ScanCode=J,E.SocketClient=Se,E.createRouter=xe,E.default=Ht,E.install=G,E.px2EchartsUrils=Ce,E.scanUtils=Z,Object.defineProperties(E,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});