UNPKG

hw-ui-vue

Version:

hw-ui, vue3

4 lines (3 loc) 33.4 kB
(function($,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):($=typeof globalThis<"u"?globalThis:$||self,e($["hw-ui-vue"]={},$.Vue))})(this,function($,e){"use strict";const Z=e.defineComponent({name:"IHB_Alert",props:{isShow:{type:Boolean,default:!1},title:{type:String,default:"\u6D88\u606F\u63D0\u793A\u6846"},iconStyle:{type:Object,default:{}},btnOkStyle:{type:Object,default:{}},btnCancleStyle:{type:Object,default:{}},bgVisible:{type:Boolean,default:!0}},emits:["ok"],setup(t,{emit:a}){return{closeIconHandler:function(){a("ok")}}}}),Sl="",B=(t,a)=>{const o=t.__vccOpts||t;for(const[r,s]of a)o[r]=s;return o},x=t=>(e.pushScopeId("data-v-eebdf232"),t=t(),e.popScopeId(),t),ee={class:"hw-alert-flex"},te={class:"hw-alert-box"},le={class:"hw-alert-header"},ae={class:"hw-alert-text"},ne=x(()=>e.createElementVNode("div",{class:"hw-alert-body"},null,-1)),oe={class:"hw-alert-footer"};function se(t,a,o,r,s,m){return t.isShow?(e.openBlock(),e.createElementBlock("div",{key:0,"data-attr":"ibh-alert",class:e.normalizeClass(["hw-box-wrapper"]),style:e.normalizeStyle(t.bgVisible?{}:{background:"none"})},[e.createElementVNode("div",ee,[e.createElementVNode("div",te,[e.createElementVNode("div",le,[e.createElementVNode("p",null,[e.createElementVNode("span",{class:e.normalizeClass(["hw-alert-icon"]),style:e.normalizeStyle(t.iconStyle)},"!",4),e.createElementVNode("span",ae,e.toDisplayString(t.title),1)]),e.createElementVNode("p",null,[e.createElementVNode("span",{class:"hw-alert-close",onClick:a[0]||(a[0]=(...l)=>t.closeIconHandler&&t.closeIconHandler(...l))},"\xD7")])]),ne,e.createElementVNode("div",oe,[e.createElementVNode("p",null,[e.createElementVNode("button",{type:"button",onClick:a[1]||(a[1]=(...l)=>t.closeIconHandler&&t.closeIconHandler(...l)),style:e.normalizeStyle(t.btnCancleStyle)},"\u53D6\u6D88",4)]),e.createElementVNode("p",null,[e.createElementVNode("button",{type:"button",onClick:a[2]||(a[2]=(...l)=>t.closeIconHandler&&t.closeIconHandler(...l)),style:e.normalizeStyle(t.btnOkStyle)},"\u786E\u8BA4",4)])])])])],4)):e.createCommentVNode("",!0)}const M=B(Z,[["render",se],["__scopeId","data-v-eebdf232"]]);M.install=function(t){t.component(M.name,M)};const re=e.defineComponent({name:"IHB_Button",props:{ibh_type:{type:String,default:"ibh-btn-default"},ibh_label_text:{type:String,default:"Button"},ibh_btn_class:{type:Object,default:{}},disabled:{type:Boolean,default:!1},ibh_btn_icon:{type:String,default:""}},emit:[""],setup(t,{emit:a}){const o=e.ref(t.ibh_btn_icon);return{handlerEvent:()=>{a("handler",t)},ibh_icon:o}}}),Fl="",ie=["disabled"];function de(t,a,o,r,s,m){return e.openBlock(),e.createElementBlock("button",{"data-attr":"ibh-button",type:"button",class:e.normalizeClass([t.ibh_type,t.ibh_icon?`ibh-icon-lib ${t.ibh_icon}`:""]),style:e.normalizeStyle(t.ibh_btn_class),disabled:t.disabled,onClick:a[0]||(a[0]=(...l)=>t.handlerEvent&&t.handlerEvent(...l))},e.toDisplayString(t.ibh_label_text),15,ie)}const z=B(re,[["render",de],["__scopeId","data-v-270cbb91"]]);z.install=function(t){t.component(z.name,z)};const ce=e.defineComponent({name:"IHB_Input",props:{data:{type:Object,default:{}}},emits:["inputHandler"],setup(t,{emit:a}){return{handerinputEvent:r=>{t.data.currentVal=r.target.value}}}}),wl="",me={"data-attr":"ibh-input",class:"ibh-form-input-box"},pe=["disabled","value"];function be(t,a,o,r,s,m){return e.openBlock(),e.createElementBlock("div",me,[e.createElementVNode("input",{class:e.normalizeClass(["ibh-form-input",t.data.disabled?"ibh-form-input-disabled":""]),type:"text",disabled:t.data.disabled,value:t.data.currentVal,name:"",onInput:a[0]||(a[0]=(...l)=>t.handerinputEvent&&t.handerinputEvent(...l))},null,42,pe)])}const Y=B(ce,[["render",be],["__scopeId","data-v-aa5f57ca"]]);Y.install=function(t){t.component(Y.name,Y)};const he=e.defineComponent({name:"IHB_Select",props:{data:{type:Object,dafault:{}}},emits:["emitChange"],setup(t,{emit:a}){return{selectHandler:r=>{t.data.currentVal=r.target.value}}}}),Hl="",ue=t=>(e.pushScopeId("data-v-2484a954"),t=t(),e.popScopeId(),t),ye={"data-attr":"ibh-select",class:"ibh-form-select-box"},fe=["disabled"],Ee=ue(()=>e.createElementVNode("option",{value:"-1"},"\u8BF7\u9009\u62E9",-1)),ke=["value"];function _e(t,a,o,r,s,m){return e.openBlock(),e.createElementBlock("div",ye,[e.createElementVNode("select",{class:e.normalizeClass(["ibh-form-select",t.data.disabled?"ibh-form-select-disabled":""]),disabled:t.data.disabled,name:"",value:"-1",onChange:a[0]||(a[0]=(...l)=>t.selectHandler&&t.selectHandler(...l))},[Ee,(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data.data,(l,n)=>(e.openBlock(),e.createElementBlock("option",{value:l.val,key:n},e.toDisplayString(l.text),9,ke))),128))],42,fe)])}const U=B(he,[["render",_e],["__scopeId","data-v-2484a954"]]);U.install=function(t){t.component(U.name,U)};const ge=e.defineComponent({name:"IHB_TextBox",props:{data:{type:Object,dafault:{}}},emits:[""],setup(t,{emit:a}){return{textareaHandler:r=>{t.data.currentVal=r.target.value}}}}),Ml="",$e={"data-attr":"ibh-form-textarea",class:"ibh-form-textarea-box"},Be=["disabled"];function Ve(t,a,o,r,s,m){return e.openBlock(),e.createElementBlock("div",$e,[e.createElementVNode("textarea",{size:"15",class:e.normalizeClass(["ibh-form-textarea",t.data.disabled?"ibh-form-textarea-disabled":""]),name:"",disabled:t.data.disabled,onInput:a[0]||(a[0]=(...l)=>t.textareaHandler&&t.textareaHandler(...l))},`\r `+e.toDisplayString(t.data.currentVal)+`\r `,43,Be)])}const j=B(ge,[["render",Ve],["__scopeId","data-v-da730420"]]);j.install=function(t){t.component(j.name,j)};const Ne=e.defineComponent({name:"IHB_Switch",props:{data:{type:Object,default:{}},textTitle:{type:Array,default:["\u5F00\u542F","\u5173\u95ED"]}},emits:["emitSwitch"],setup(t,{emit:a}){return{switchHandler:()=>{t.data.disabled||(t.data.currentVal=!t.data.currentVal)}}}}),zl="",De={"data-attr":"ibh-switch",class:"ibh-form-radius-box"},Ie=["disabled"],Te={class:"ibh-switch-text1"},Ce={class:"ibh-switch-text2"};function Se(t,a,o,r,s,m){return e.openBlock(),e.createElementBlock("div",De,[e.createElementVNode("div",{class:e.normalizeClass([t.data.currentVal?"ibh-form-radius-switched":"ibh-form-radius",t.data.disabled?"ibh-form-radius-switched-disabled":""]),disabled:t.data.disabled,onClick:a[0]||(a[0]=(...l)=>t.switchHandler&&t.switchHandler(...l))},[e.createElementVNode("div",Te,e.toDisplayString(t.textTitle[0]),1),e.createTextVNode(" \xA0 "),e.createElementVNode("div",Ce,e.toDisplayString(t.textTitle[1]),1)],10,Ie)])}const P=B(Ne,[["render",Se],["__scopeId","data-v-be8755bb"]]);P.install=function(t){t.component(P.name,P)};const Fe=e.defineComponent({name:"IHB_File",props:{data:{type:Object,default:{}}},emits:["inputHandler"],setup(t,{emit:a}){const o=e.ref(null);return{handerFileEvent:m=>{console.log(m.target.value)},mockFileHandler:m=>{t.data.disabled||o.value.click()},fileRefUpload:o}}}),Al="",we={"data-attr":"ibh-file",class:"ibh-form-file-box"};function He(t,a,o,r,s,m){return e.openBlock(),e.createElementBlock("div",we,[e.createElementVNode("input",{ref:"fileRefUpload",class:"ibh-form-file",type:"file",onChange:a[0]||(a[0]=(...l)=>t.handerFileEvent&&t.handerFileEvent(...l)),name:"file"},null,544),e.createElementVNode("div",{class:e.normalizeClass(["ibh-form-file-mock",t.data.disabled?"ibh-form-file-mock-disabled":""]),onClick:a[1]||(a[1]=(...l)=>t.mockFileHandler&&t.mockFileHandler(...l))},"+",2)])}const R=B(Fe,[["render",He],["__scopeId","data-v-4de0e419"]]);R.install=function(t){t.component(R.name,R)};const Me=e.defineComponent({name:"IHB_Modal",components:{IHB_Input:Y,IHB_Select:U,IHB_TextBox:j,IHB_Switch:P,IHB_File:R},props:{attrFlag:{type:Object,default:{formFileds:{type:Array,default:[]},footer:{type:Boolean,default:!0}}}},emits:["callCancleEvent","callOKEvent"],setup(t,{emit:a}){return{ibhCancle:s=>{a("callCancleEvent")},ibhOk:s=>{a("callOKEvent")}}}}),Ol="",ze=t=>(e.pushScopeId("data-v-cfc7e5cd"),t=t(),e.popScopeId(),t),Ae={key:0,"data-attr":"ibh-modal",class:"ibh-modal-box"},Oe={class:"ibh-wrapper"},Le={class:"ibh-modal-header"},Ye={class:"header-text"},Ue=ze(()=>e.createElementVNode("div",{class:"ibh-line"},null,-1)),je={for:""},Pe={class:"ibh-label-tag"},Re={class:"ibh-view-left"},qe={for:""},Ke={class:"ibh-label-tag"},We={class:"ibh-view-right"},ve={class:"ibh-line"},Ge={class:"ibh-modal-footer"},Je={class:"footer-cancle"},Qe={class:"footer-confirm"};function Xe(t,a,o,r,s,m){const l=e.resolveComponent("IHB_Input"),n=e.resolveComponent("IHB_Select"),i=e.resolveComponent("IHB_TextBox"),u=e.resolveComponent("IHB_Switch"),f=e.resolveComponent("IHB_File");return t.attrFlag.visible?(e.openBlock(),e.createElementBlock("div",Ae,[e.createElementVNode("div",Oe,[e.createElementVNode("div",Le,[e.createElementVNode("div",Ye,e.toDisplayString(t.attrFlag.title),1),e.createElementVNode("div",{class:"header-close",onClick:a[0]||(a[0]=(...d)=>t.ibhCancle&&t.ibhCancle(...d))},"\xD7")]),Ue,e.createElementVNode("div",{class:e.normalizeClass(["ibh-modal-body",t.attrFlag.title=="VIEW"?"ibh-modal-body-view":""])},[t.attrFlag.title!="VIEW"?e.renderSlot(t.$slots,"content",{key:0},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.attrFlag.formFileds,(d,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["ibh-filed-item",d.type=="textBox"?"ibh-textarea-box":""]),key:c},[e.createElementVNode("div",{class:e.normalizeClass(["ibh-label",d.type=="fileUpload"?"ibh-file-upload-text":""])},[e.createElementVNode("label",je,[e.createElementVNode("span",Pe,e.toDisplayString(d.require?"*":""),1),e.createTextVNode(" "+e.toDisplayString(d.label)+":",1)])],2),e.createElementVNode("div",{class:e.normalizeClass(["ibh-form-item",d.type=="fileUpload"?"ibh-file-upload":""])},[d.type=="input"?(e.openBlock(),e.createBlock(l,{key:0,data:d},null,8,["data"])):e.createCommentVNode("",!0),d.type=="select"?(e.openBlock(),e.createBlock(n,{key:1,data:d},null,8,["data"])):e.createCommentVNode("",!0),d.type=="textBox"?(e.openBlock(),e.createBlock(i,{key:2,data:d},null,8,["data"])):e.createCommentVNode("",!0),d.type=="radiusSwitch"?(e.openBlock(),e.createBlock(u,{key:3,data:d,textTitle:d.text},null,8,["data","textTitle"])):e.createCommentVNode("",!0),d.type=="fileUpload"?(e.openBlock(),e.createBlock(f,{key:4,data:d},null,8,["data"])):e.createCommentVNode("",!0)],2)],2))),128))],!0):e.createCommentVNode("",!0),t.attrFlag.title=="VIEW"?e.renderSlot(t.$slots,"content",{key:1},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.attrFlag.formFileds,(d,c)=>(e.openBlock(),e.createElementBlock("div",{class:"ibh-view-box-wrapper",key:c},[e.createElementVNode("div",Re,[e.createElementVNode("label",qe,[e.createElementVNode("span",Ke,e.toDisplayString(d.require?"*":""),1),e.createTextVNode(" "+e.toDisplayString(d.label)+":",1)])]),e.createElementVNode("div",We,e.toDisplayString(d.currentVal),1)]))),128))],!0):e.createCommentVNode("",!0)],2),e.withDirectives(e.createElementVNode("div",ve,null,512),[[e.vShow,t.attrFlag.footer]]),e.withDirectives(e.createElementVNode("div",Ge,[e.createElementVNode("div",Je,[e.createElementVNode("button",{type:"button",name:"button",onClick:a[1]||(a[1]=(...d)=>t.ibhCancle&&t.ibhCancle(...d))},"\u53D6\u6D88")]),e.createElementVNode("div",Qe,[e.createElementVNode("button",{type:"button",name:"button",onClick:a[2]||(a[2]=(...d)=>t.ibhOk&&t.ibhOk(...d))},"\u786E\u8BA4")])],512),[[e.vShow,t.attrFlag.footer]])])])):e.createCommentVNode("",!0)}const A=B(Me,[["render",Xe],["__scopeId","data-v-cfc7e5cd"]]);A.install=function(t){t.component(A.name,A)};const Ze=e.defineComponent({name:"IHB_FileUpload",props:{ibh_visible:{type:Boolean,default:!1}},emits:["fileCallBack"],setup(t,{emit:a}){const o=e.ref(!1),r=e.ref(""),s=e.reactive([]),m=e.ref(null);return{visible:o,closeIconLoad:()=>{o.value=!o.value,a("fileCallBack",o.value),s.length=0,r.value=""},fileLoadingImg:m,ibhSelectEvent:()=>{m.value.click()},ibhLoadFileImg:b=>{let y=m.value.files.length;if(y>0&&y<=5)for(let T=0;T<y;T++){let k=m.value.files[T],N=new FileReader;N.readAsDataURL(k),N.onload=E=>{s.push({name:k.name,size:`${(k.size/1024).toFixed(2)}Kb`,status:0,pathImage:N.result})}}else r.value="\u4E00\u6B21\u6700\u591A\u90095\u5F20";b.target.value=""},nameFileTips:r,imageFileArray:s,startUploadFile:()=>{s.map(b=>{b.status=2})},deleteUploadFile:b=>{s.splice(b,1)},saveHandler:()=>{if(s.length==0){r.value="\u6CA1\u6709\u6587\u4EF6\u6570\u636E";return}a("fileCallBack",o.value),s.length=0},cancleIconImage:()=>{s.length=0,r.value=""}}}}),Ll="",D=t=>(e.pushScopeId("data-v-709e042a"),t=t(),e.popScopeId(),t),xe={key:0,"data-attr":"fileLoader",class:e.normalizeClass(["hw-fileloading-box"])},et={class:"ibh-loading-wrapper"},tt={class:"ibh-file-load-header"},lt=D(()=>e.createElementVNode("p",null,[e.createElementVNode("span",null,"\u4E0A\u4F20")],-1)),at=D(()=>e.createElementVNode("div",{class:"ibh-file-load-line"},null,-1)),nt={class:"ibh-file-load-body"},ot={class:"ibh-file-tips"},st=D(()=>e.createElementVNode("span",{class:"ibh-loading-icon-tips"},"\u5355\u4E2A\u6587\u4EF6\u4E0D\u8D85\u8FC720M",-1)),rt={class:"ibh-tips-message"},it={class:"ibh-file-table"},dt={border:"0",cellpadding:"0",cellspacing:"0"},ct=D(()=>e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[e.createElementVNode("td",null,"\u7F29\u7565\u56FE"),e.createElementVNode("td",null,"\u6587\u4EF6\u540D"),e.createElementVNode("td",null,"\u6587\u4EF6\u5927\u5C0F"),e.createElementVNode("td",null,"\u72B6\u6001"),e.createElementVNode("td",null,"\u64CD\u4F5C")])],-1)),mt={class:"ibh-file-image"},pt=["src"],bt={class:"ibh-file-loading-name"},ht={class:"ibh-file-name-box ibh-file-success-tips"},ut={key:0,class:"ibh-loading-img-name-wait"},yt={key:1,class:"ibh-loading-img-name-success"},ft={key:2,class:"ibh-loading-img-name-fail"},Et={key:3},kt=[D(()=>e.createElementVNode("span",{class:"ibh-loading-line-wait"},null,-1))],_t={key:4},gt=[D(()=>e.createElementVNode("span",{class:"ibh-loading-line-success"},null,-1))],$t={key:5},Bt=[D(()=>e.createElementVNode("span",{class:"ibh-loading-line-fail"},null,-1))],Vt={key:0,class:"ibh-loading-status-wait"},Nt={key:1,class:"ibh-loading-status-success"},Dt={key:2,class:"ibh-loading-status-fail"},It=["onClick"],Tt={key:0},Ct=[D(()=>e.createElementVNode("td",{colSpan:"5"},"\u6682\u65E0\u6587\u4EF6",-1))],St=D(()=>e.createElementVNode("div",{class:"ibh-file-load-line"},null,-1)),Ft={class:"ibh-file-load-footer"};function wt(t,a,o,r,s,m){return t.ibh_visible?(e.openBlock(),e.createElementBlock("div",xe,[e.createElementVNode("div",et,[e.createElementVNode("div",tt,[lt,e.createElementVNode("p",null,[e.createElementVNode("span",{onClick:a[0]||(a[0]=(...l)=>t.closeIconLoad&&t.closeIconLoad(...l)),style:{cursor:"pointer"}},"\xD7")])]),at,e.createElementVNode("div",nt,[e.createElementVNode("div",ot,[e.createElementVNode("p",null,[st,e.createTextVNode(" \xA0 "),e.createElementVNode("span",rt,e.toDisplayString(t.nameFileTips),1)]),e.createElementVNode("p",null,[e.createElementVNode("button",{class:"ibh-loading-btn",type:"button",name:"",onClick:a[1]||(a[1]=(...l)=>t.ibhSelectEvent&&t.ibhSelectEvent(...l))},"\u9009\u62E9\u6587\u4EF6")])]),e.createElementVNode("div",it,[e.createElementVNode("table",dt,[ct,e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.imageFileArray,(l,n)=>(e.openBlock(),e.createElementBlock("tr",{key:n},[e.createElementVNode("td",null,[e.createElementVNode("div",mt,[e.createElementVNode("img",{src:l.pathImage,alt:"404"},null,8,pt)])]),e.createElementVNode("td",null,[e.createElementVNode("div",bt,[e.createElementVNode("div",ht,[l.status==0?(e.openBlock(),e.createElementBlock("p",ut,e.toDisplayString(l.name),1)):e.createCommentVNode("",!0),l.status==1?(e.openBlock(),e.createElementBlock("p",yt,e.toDisplayString(l.name),1)):e.createCommentVNode("",!0),l.status==2?(e.openBlock(),e.createElementBlock("p",ft,e.toDisplayString(l.name),1)):e.createCommentVNode("",!0),l.status==0?(e.openBlock(),e.createElementBlock("p",Et,kt)):e.createCommentVNode("",!0),l.status==1?(e.openBlock(),e.createElementBlock("p",_t,gt)):e.createCommentVNode("",!0),l.status==2?(e.openBlock(),e.createElementBlock("p",$t,Bt)):e.createCommentVNode("",!0)])])]),e.createElementVNode("td",null,e.toDisplayString(l.size),1),e.createElementVNode("td",null,[l.status==0?(e.openBlock(),e.createElementBlock("span",Vt,"\u7B49\u5F85\u4E0A\u4F20")):e.createCommentVNode("",!0),l.status==1?(e.openBlock(),e.createElementBlock("span",Nt,"\u4E0A\u4F20\u6210\u529F")):e.createCommentVNode("",!0),l.status==2?(e.openBlock(),e.createElementBlock("span",Dt,"\u4E0A\u4F20\u5931\u8D25")):e.createCommentVNode("",!0)]),e.createElementVNode("td",null,[e.createElementVNode("span",{class:"ibh-delete-file",onClick:i=>t.deleteUploadFile(n)},"\u5220\u9664",8,It)])]))),128)),t.imageFileArray.length==0?(e.openBlock(),e.createElementBlock("tr",Tt,Ct)):e.createCommentVNode("",!0)])])])]),St,e.createElementVNode("div",Ft,[e.createElementVNode("p",null,[e.createElementVNode("input",{ref:"fileLoadingImg",class:"ibhViewFileLoad",type:"file",multiple:"multiple",name:"file",onChange:a[2]||(a[2]=(...l)=>t.ibhLoadFileImg&&t.ibhLoadFileImg(...l))},null,544)]),e.createElementVNode("button",{type:"button",name:"button",onClick:a[3]||(a[3]=(...l)=>t.cancleIconImage&&t.cancleIconImage(...l))},"\u53D6\u6D88"),e.createElementVNode("button",{type:"button",name:"button",onClick:a[4]||(a[4]=(...l)=>t.startUploadFile&&t.startUploadFile(...l))},"\u5F00\u59CB\u4E0A\u4F20"),e.createElementVNode("button",{type:"button",name:"button",onClick:a[5]||(a[5]=(...l)=>t.saveHandler&&t.saveHandler(...l))},"\u4FDD\u5B58")])])])):e.createCommentVNode("",!0)}const O=B(Ze,[["render",wt],["__scopeId","data-v-709e042a"]]);O.install=function(t){t.component(O.name,O)};const Ht=function(){return["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"]},V=function(t){return t<10?"0"+t:t},q=function(t,a,o,r,s,m,l){let n=`${a}-${o}-${r}`;switch(t){case"YYYY":n=`${a}`;break;case"MM":n=V(o);break;case"YYYY-MM":n=`${a}-${V(o)}`;break;case"YYYY-MM-DD":let i=V(o),u=V(r);n=`${a}-${i}-${u}`;break;case"YYYY-MM-DD hh":n=`${a}-${V(o)}-${V(r)} ${s}`;break;case"YYYY-MM-DD hh:mm":n=`${a}-${V(o)}-${V(r)} ${s}:${m}`;break;case"YYYY-MM-DD hh:mm:ss":let f=V(o),d=V(r);n=`${a}-${f}-${d} ${s}:${m}:${l}`;break}return n},Mt=function(t){let a=t.getFullYear(),o=t.getMonth()+1;return{yearibh:a,monthibh:o,resultibh:`${a} / ${o} \u6708`}},K=function(t){let a=new Date(t),o=a.getMonth()+1;return a.setMonth(o),a.setDate(0),a.getDate()},zt=function(t,a,o,r){for(let s=0;s<t;s++)o.unshift({number:r--,isToday:!1,cellpre:!0,eventDisable:!1,selected:!1});for(let s=1;s<=a;s++)o.push({number:s,isToday:!1,cellpre:!0,eventDisable:!1,selected:!1});return o},At=function(t,a){let o=[],r=[];return t.forEach(s=>{r.push(s),r.length==a&&(o.push(r),r=[])}),r.length&&o.push(r),o},Ot=function(t){let a=new Date,o=a.getMonth()+1,r=a.getFullYear(),s=a.getDate(),m=t.getFullYear(),l=t.getMonth()+1,n=t.getDate(),i=K(t),u=K(new Date(`${m}-${l-1}-01`)),d=new Date(m,l-1,1).getDay(),c=[];const y=42-i;c[1]=i;let T=[];for(let E=1;E<=i;E++)T.push({number:E,cellpre:!1,eventDisable:!0,selected:!1,isToday:E==n&&o==l&&r==m&&s==n});switch(d){case 0:c[0]=0,c[2]=y-0;break;case 1:c[0]=1,c[2]=y-1;break;case 2:c[0]=2,c[2]=y-2;break;case 3:c[0]=3,c[2]=y-3;break;case 4:c[0]=4,c[2]=y-4;break;case 5:c[0]=5,c[2]=y-5;break;case 6:c[0]=6,c[2]=y-6;break}let k=zt(c[0],c[2],T,u);return At(k,7)},Lt=function(){let t=[],a=[],o=[],r=[];for(let s=0;s<24;s++)t.push(s>=10?s+"":"0"+s);for(let s=0;s<60;s++)a.push(s>=10?s:"0"+s),o.push(s>=10?s:"0"+s);return r[0]=[...t],r[1]=[...a],r[2]=[...o],r},S=function(t=new Date){let a=Ht(),o=Mt(t),r=K(t),s=Ot(t);return{weekTitle:a,currentMonth:o,currentDays:r,getTableSoft:s,timerData:Lt()}},Yt=e.defineComponent({name:"IHB_DateTime",props:{formate:{type:String,default:"YY-MM-DD"},showTimer:{type:Boolean,default:!1},themStyle:{type:Object,default:{}},inputStyle:{type:Object,default:{}},placeholderText:{type:String,default:"\u8BF7\u9009\u62E9\u65E5\u671F"},disPlayFlex:{type:String,default:"col"},ranger:{type:Boolean,default:!1},size:{type:String,default:"small"},nextMonth:{type:Boolean,default:!1}},setup(t){let a=t.ranger;e.ref([]);let{weekTitle:o,currentMonth:r,getTableSoft:s,timerData:m}=S();e.ref(r.resultibh);let l=e.ref(r.monthibh),n=e.ref(r.yearibh),i=e.ref(s),u=e.ref("00"),f=e.ref("00"),d=e.ref("00"),c=e.ref(t.showTimer),b=e.ref(""),y=e.ref("activeItemDay"),T=new Date().getDate();b.value=T;let k=e.ref([]),N=e.ref(`${b.value}\u65E5-`),E=e.ref([]);const F=e.ref(!1),C=e.ref(""),W=e.ref(t.themStyle),hl={backgroundColor:W.value.titleColor},ul={backgroundColor:W.value.titleColor,borderRadius:"50%",color:"rgba(255,255,255,1)"};let yl=e.ref(!1),fl=e.ref(!1);e.ref([]);let v=e.ref(!1);const El=()=>{F.value=!0},kl=()=>{},_l=()=>{l.value==1?(l.value=12,n.value--):l.value--;let p=new Date().getDate(),{getTableSoft:h}=S(new Date(`${n.value}-${l.value}-${p}`));i.value=h},gl=()=>{l.value==12?(l.value=1,n.value++):l.value++;let p=new Date().getDate(),{getTableSoft:h}=S(new Date(`${n.value}-${l.value}-${p}`));i.value=h},$l=()=>{n.value--;let{getTableSoft:p}=S(new Date(`${n.value}-${l.value}-01`));i.value=p},Bl=()=>{n.value++;let{getTableSoft:p}=S(new Date(`${n.value}-${l.value}-01`));i.value=p},Vl=()=>{let p=new Date,h=p.getFullYear(),_=p.getMonth()+1,w=p.getDate();n.value=h,l.value=_;let{getTableSoft:H}=S(new Date(`${h}-${_}-${w}`));if(i.value=H,c.value){b.value=w,y.value="activeItemDay",N.value=b.value+"\u65E5-",u.value="00",f.value="00",d.value="00";return}if(a){b.value=w,y.value="activeItemDay",N.value=b.value+"\u65E5-",u.value="00",f.value="00",d.value="00";return}C.value=q(t.formate,`${h}`,`${_}`,`${w}`),F.value=!1},Nl=(p,h)=>{let _=h.target.innerText;p==0&&(u.value=_),p==1&&(f.value=_),p==2&&(d.value=_,a&&c.value&&(v.value?E.value[1]=`${n.value}-${l.value}-${k.value[1]} ${u.value}:${f.value}:${d.value}`:(v.value=!0,N.value=k.value[1]+"\u65E5-",E.value[0]=`${n.value}-${l.value}-${b.value} ${u.value}:${f.value}:${d.value}`,u.value="00",f.value="00",d.value="00")))},Dl=()=>{F.value=!1},Il=()=>{if(a){if(c.value){if(E.value[0]==null||E.value[1]==null)return;console.log(E.value),C.value=`${E.value[0]} - ${E.value[1]}`,E.value=[],u.value="00",f.value="00",d.value="00",X()}}else C.value=q(t.formate,`${n.value}`,`${l.value}`,`${b.value}`,`${u.value}`,`${f.value}`,`${d.value}`);F.value=!1},X=()=>{let p=i.value.length;for(let h=0;h<p;h++)for(let _=0;_<7;_++)i.value[h][_].selected=!1};return{isVisibale:F,focusEventInput:El,blurEventInput:kl,weekTitle:o,yearibh:n,monthibh:l,dataTime:i,monthPreEventHander:_l,monthNextEventHander:gl,yearPreEvent:$l,yearNextEvent:Bl,timerData:m,ibh_hours:u,ibh_minitus:f,ibh_second:d,timeHoursEvent:Nl,ibhTodayaEvent:Vl,inputText:C,closeOpenDate:Dl,confirmTimeBtn:Il,timerhms:c,tdsEventItems:(p,h,_,w)=>{if(k.value=[],k.value.push(h),k.value.push(b.value),p&&(b.value=h,y.value="activeItemDay",c.value||(C.value=q(t.formate,`${n.value}`,`${l.value}`,`${b.value}`),F.value=!1),a&&p)){let H=k.value.sort((g,I)=>g-I),G=[];X();for(let g=H[0];g<=H[1];g++)G.push(g);let Tl=i.value.length,Cl=G.length;for(let g=0;g<Tl;g++)for(let I=0;I<7;I++)if(i.value[g][I].eventDisable&&i.value[g][I].number)for(let J=0;J<Cl;J++)i.value[g][I].eventDisable&&G[J]==i.value[g][I].number&&(i.value[g][I].selected=!0);E.value=[],c.value?(v.value=!1,N.value=k.value[0]+"\u65E5-"):C.value=`${n.value}-${l.value}-${H[0]} ${n.value}-${l.value}-${H[1]}`}},isActiveToday:b,activeItemDay:y,themStyleColor:W,clearInputText:()=>{C.value=""},tdsMouseOverEvent:(p,h,_,w)=>{a&&p&&b.value},tdStyleThemPre:yl,tdStyleThemNext:fl,dayView:N,styleLintThem:hl,styleSelectRanger:ul}}}),Rl="",Ut={class:"ibh-date-input"},jt={class:"ibh-span-input-wrapper"},Pt=["placeholder","value"],Rt={class:"ibh-time-table"},qt={class:"ihb-dataTime-grid"},Kt={class:"dataTime-left-box"},Wt={class:""},vt={class:""},Gt={class:""},Jt={class:"ibh-table-box"},Qt={width:"100%",border:"0",cellpadding:"0",cellspacing:"0"},Xt={valign:"middle",align:"center"},Zt=["data-key","onMouseover","onClick"],xt=["data-key","onMouseover","onClick"],el=["data-key","onMouseover","onClick"],tl=["data-key","onMouseover","onClick"],ll=["data-key","onMouseover","onClick"],al=["data-key","onMouseover","onClick"],nl={class:"dataTime-right-box"},ol={class:"ibh-dataTime-header"},sl={class:"ibh-dataTime-body"},rl={class:"ibh-hour-item"},il={class:"ibh-hour-item"},dl={class:"ibh-hour-item"},cl={class:"ibh-dataTime-footer"};function ml(t,a,o,r,s,m){return e.openBlock(),e.createElementBlock("div",{"data-attr":"time",class:"ibh-dataTime-box",style:e.normalizeStyle({display:t.disPlayFlex=="row"?"inline-block":"block"})},[e.createElementVNode("div",Ut,[e.renderSlot(t.$slots,"ibh-time-input",{},()=>[e.createElementVNode("span",jt,[e.createElementVNode("input",{readonly:"readonly",placeholder:t.placeholderText,class:"ibh-input-box",type:"text",name:"",value:t.inputText,onFocus:a[0]||(a[0]=(...l)=>t.focusEventInput&&t.focusEventInput(...l)),onBlur:a[1]||(a[1]=(...l)=>t.blurEventInput&&t.blurEventInput(...l)),style:e.normalizeStyle(t.inputStyle)},null,44,Pt),e.createElementVNode("span",{class:"clearText",onClick:a[2]||(a[2]=(...l)=>t.clearInputText&&t.clearInputText(...l))},"\xD7")])],!0),e.withDirectives(e.createElementVNode("div",{class:"ibh-fixed-box-time",onClick:a[3]||(a[3]=(...l)=>t.closeOpenDate&&t.closeOpenDate(...l))},null,512),[[e.vShow,t.isVisibale]]),e.withDirectives(e.createElementVNode("div",Rt,[e.createElementVNode("div",qt,[e.createElementVNode("div",Kt,[e.createElementVNode("div",{class:e.normalizeClass(["ibh-dataTime-header",t.showTimer?"":"ibhborderItem"])},[e.createElementVNode("div",Wt,[e.createElementVNode("span",{class:"spacilTextIcon",onClick:a[4]||(a[4]=(...l)=>t.yearPreEvent&&t.yearPreEvent(...l))},"\xAB"),e.createTextVNode("\xA0"),e.createElementVNode("span",{class:"spacilTextIcon",onClick:a[5]||(a[5]=(...l)=>t.monthPreEventHander&&t.monthPreEventHander(...l))},"\u2039")]),e.createElementVNode("div",vt,[e.createElementVNode("span",{class:e.normalizeClass(["ibh-current-time"]),style:e.normalizeStyle({color:t.themStyleColor.titleColor})},e.toDisplayString(t.yearibh)+" / "+e.toDisplayString(t.monthibh)+" \u6708",5)]),e.createElementVNode("div",Gt,[e.createElementVNode("span",{class:"spacilTextIcon",onClick:a[6]||(a[6]=(...l)=>t.monthNextEventHander&&t.monthNextEventHander(...l))},"\u203A"),e.createTextVNode("\xA0"),e.createElementVNode("span",{class:"spacilTextIcon",onClick:a[7]||(a[7]=(...l)=>t.yearNextEvent&&t.yearNextEvent(...l))},"\xBB")])],2),e.createElementVNode("div",{class:e.normalizeClass(["ibh-dataTime-body",t.showTimer?"":"ibhborderItem"])},[e.createElementVNode("div",Jt,[e.createElementVNode("table",Qt,[e.createElementVNode("tbody",Xt,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.weekTitle,(l,n)=>(e.openBlock(),e.createElementBlock("td",{class:"timerTitleBox",key:n},e.toDisplayString(l),1))),128))]),e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.dataTime[0],(l,n)=>(e.openBlock(),e.createElementBlock("td",{key:n},[e.createElementVNode("span",{"data-key":l.number,onMouseover:i=>t.tdsMouseOverEvent(l.eventDisable,l.number,n,i),onClick:i=>t.tdsEventItems(l.eventDisable,l.number,n,i),class:e.normalizeClass([l.isToday?"tdToday":"",l.cellpre?"tdPreToday":"",l.number==t.isActiveToday&&l.eventDisable?t.activeItemDay:""]),style:e.normalizeStyle(l.number==t.isActiveToday&&l.eventDisable?t.styleLintThem:l.eventDisable&&l.selected?t.styleSelectRanger:{})},e.toDisplayString(l.number),47,Zt)]))),128))]),e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.dataTime[1],(l,n)=>(e.openBlock(),e.createElementBlock("td",{key:n},[e.createElementVNode("span",{"data-key":l.number,onMouseover:i=>t.tdsMouseOverEvent(l.eventDisable,l.number,n,i),onClick:i=>t.tdsEventItems(l.eventDisable,l.number,n,i),class:e.normalizeClass([l.isToday?"tdToday":"",l.cellpre?"tdPreToday":"",l.number==t.isActiveToday&&l.eventDisable?t.activeItemDay:""]),style:e.normalizeStyle(l.number==t.isActiveToday&&l.eventDisable?t.styleLintThem:l.eventDisable&&l.selected?t.styleSelectRanger:{})},e.toDisplayString(l.number),47,xt)]))),128))]),e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.dataTime[2],(l,n)=>(e.openBlock(),e.createElementBlock("td",{key:n},[e.createElementVNode("span",{"data-key":l.number,onMouseover:i=>t.tdsMouseOverEvent(l.eventDisable,l.number,n,i),onClick:i=>t.tdsEventItems(l.eventDisable,l.number,n,i),class:e.normalizeClass([l.isToday?"tdToday":"",l.cellpre?"tdPreToday":"",l.number==t.isActiveToday&&l.eventDisable?t.activeItemDay:""]),style:e.normalizeStyle(l.number==t.isActiveToday&&l.eventDisable?t.styleLintThem:l.eventDisable&&l.selected?t.styleSelectRanger:{})},e.toDisplayString(l.number),47,el)]))),128))]),e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.dataTime[3],(l,n)=>(e.openBlock(),e.createElementBlock("td",{key:n},[e.createElementVNode("span",{"data-key":l.number,onMouseover:i=>t.tdsMouseOverEvent(l.eventDisable,l.number,n,i),onClick:i=>t.tdsEventItems(l.eventDisable,l.number,n,i),class:e.normalizeClass([l.isToday?"tdToday":"",l.cellpre?"tdPreToday":"",l.number==t.isActiveToday&&l.eventDisable?t.activeItemDay:""]),style:e.normalizeStyle(l.number==t.isActiveToday&&l.eventDisable?t.styleLintThem:l.eventDisable&&l.selected?t.styleSelectRanger:{})},e.toDisplayString(l.number),47,tl)]))),128))]),e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.dataTime[4],(l,n)=>(e.openBlock(),e.createElementBlock("td",{key:n},[e.createElementVNode("span",{"data-key":l.number,onMouseover:i=>t.tdsMouseOverEvent(l.eventDisable,l.number,n,i),onClick:i=>t.tdsEventItems(l.eventDisable,l.number,n,i),class:e.normalizeClass([l.isToday?"tdToday":"",l.cellpre?"tdPreToday":"",l.number==t.isActiveToday&&l.eventDisable?t.activeItemDay:""]),style:e.normalizeStyle(l.number==t.isActiveToday&&l.eventDisable?t.styleLintThem:l.eventDisable&&l.selected?t.styleSelectRanger:{})},e.toDisplayString(l.number),47,ll)]))),128))]),e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.dataTime[5],(l,n)=>(e.openBlock(),e.createElementBlock("td",{key:n},[e.createElementVNode("span",{"data-key":l.number,onMouseover:i=>t.tdsMouseOverEvent(l.eventDisable,l.number,n,i),onClick:i=>t.tdsEventItems(l.eventDisable,l.number,n,i),class:e.normalizeClass([l.isToday?"tdToday":"",l.cellpre?"tdPreToday":"",l.number==t.isActiveToday&&l.eventDisable?t.activeItemDay:""]),style:e.normalizeStyle(l.number==t.isActiveToday&&l.eventDisable?t.styleLintThem:l.eventDisable&&l.selected?t.styleSelectRanger:{})},e.toDisplayString(l.number),47,al)]))),128))])])])])],2),e.createElementVNode("div",{class:e.normalizeClass(["ibh-dataTime-footer",t.showTimer?"":"ibhborderItem"])},[e.createElementVNode("span",{onClick:a[8]||(a[8]=(...l)=>t.ibhTodayaEvent&&t.ibhTodayaEvent(...l)),style:e.normalizeStyle({color:t.themStyle.titleColor})},"\u4ECA\u5929",4)],2)]),e.withDirectives(e.createElementVNode("div",nl,[e.createElementVNode("div",ol,[e.createElementVNode("div",{class:"ibh-dateTime-right-top",style:e.normalizeStyle({color:t.themStyle.titleColor})},e.toDisplayString(t.dayView)+e.toDisplayString(t.ibh_hours)+":"+e.toDisplayString(t.ibh_minitus)+":"+e.toDisplayString(t.ibh_second),5)]),e.createElementVNode("div",sl,[e.createElementVNode("div",rl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.timerData[0],(l,n)=>(e.openBlock(),e.createElementBlock("span",{onClick:a[9]||(a[9]=i=>t.timeHoursEvent(0,i)),key:n},e.toDisplayString(l),1))),128))]),e.createElementVNode("div",il,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.timerData[1],(l,n)=>(e.openBlock(),e.createElementBlock("span",{onClick:a[10]||(a[10]=i=>t.timeHoursEvent(1,i)),key:n},e.toDisplayString(l),1))),128))]),e.createElementVNode("div",dl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.timerData[2],(l,n)=>(e.openBlock(),e.createElementBlock("span",{onClick:a[11]||(a[11]=i=>t.timeHoursEvent(2,i)),key:n},e.toDisplayString(l),1))),128))])]),e.createElementVNode("div",cl,[e.createElementVNode("button",{onClick:a[12]||(a[12]=(...l)=>t.confirmTimeBtn&&t.confirmTimeBtn(...l)),class:"timeBtnConfirm",type:"`button`",name:"button",style:e.normalizeStyle({backgroundColor:t.themStyle.titleColor})},"\u786E\u5B9A",4)])],512),[[e.vShow,t.timerhms]])])],512),[[e.vShow,t.isVisibale]])])],4)}const L=B(Yt,[["render",ml],["__scopeId","data-v-eda11fe9"]]);L.install=function(t){t.component(L.name,L)};const pl={IHB_Alert:M,IHB_Button:z,IHB_Modal:A,IHB_FileUpload:O,IHB_DateTime:L},Q=function(t){Object.values(pl).forEach(a=>{t.component(a.name,a)})};typeof window<"u"&&window.Vue&&Q(window.Vue);const bl={install:Q};$.IHB_Alert=M,$.IHB_Button=z,$.IHB_DateTime=L,$.IHB_FileUpload=O,$.IHB_Modal=A,$.default=bl,Object.defineProperties($,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});