1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-a1ee0466"],{"0500":function(e,t,c){"use strict";var o=c("7a23"),n={id:"map",style:{width:"100%",height:"100%"}},a={class:"space-main",id:"spaceMain"},l=["id","onClick"],i=["src"],r=["src"],s={key:0,style:{"font-size":"12px"}},d={class:"map-toolbar"},u=["src"],p={class:"text-hidden"},f={class:"text-hidden"},m=["onClick"],g=["onClick"],b={style:{width:"100%",height:"100%"}};c("99af"),c("d81d"),c("4057"),c("a9e3");var h=c("5530"),v=c("d257"),O=c("d399"),j=(c("e7e5"),c("2241")),S=(c("e17f"),c("459d")),I={class:"ignore_com-top"},y={class:"page-search content-box ptheader"},C={action:"/"},k={class:"search-box"},w={class:"top"},N=function(e){return Object(o.pushScopeId)("data-v-44b481c8"),e=e(),Object(o.popScopeId)(),e}((function(){return Object(o.createElementVNode)("div",null,"最近查找",-1)})),B=["onClick"],D=["src"],A=["onClick"],x=["src"],E={style:{width:"100%",height:"100%"}},M=c("d961"),V=(c("5852"),c("6c02")),P=c("0613"),F={class:"ignore_com-top"},T={class:"page-search content-box ptheader"},L={class:"search-box"},X=["onClick"],Y=["src"],H=Object(o.defineComponent)({emits:["closeMetting"],props:{projectId:{type:String,default:function(){return""}}},components:{VanSearch:M.a},setup:function(e,t){var c=P.a.state.user,n=Object(o.reactive)({parseImgUrl:v.y,spaceName:"",userInfo:c,searchData:[],goBack:function(){t.emit("closeMetting",null)},triggerSearchSpace:function(e){t.emit("closeMetting",e)},getSpaceLike:function(){var e={criteria:{projectId:c.projectId,localName:{$like:"%".concat(n.spaceName,"%")}}};Object(S.u)(e).then((function(e){"success"===e.result?n.searchData=null!=(e=null==e?void 0:e.content)?e:[]:n.searchData=[]}))}});return Object(o.onBeforeMount)((function(){n.getSpaceLike()})),Object(h.a)({},Object(o.toRefs)(n))}}),R=(c("b3aa"),c("e4cb"),c("6b0d")),q=(R=c.n(R),H=R()(H,[["render",function(e,t,c,n,a,l){var i=Object(o.resolveComponent)("VanIcon");return Object(o.openBlock)(),Object(o.createElementBlock)(o.Fragment,null,[Object(o.createElementVNode)("div",F,[Object(o.createElementVNode)("div",{class:"header-return",onClick:t[0]||(t[0]=function(){return e.goBack&&e.goBack.apply(e,arguments)})},[Object(o.createVNode)(i,{name:"arrow-left"})])]),Object(o.createElementVNode)("div",T,[Object(o.createElementVNode)("div",L,[Object(o.createElementVNode)("div",null,[e.searchData&&e.searchData.length?(Object(o.openBlock)(!0),Object(o.createElementBlock)(o.Fragment,{key:0},Object(o.renderList)(e.searchData,(function(t){return Object(o.openBlock)(),Object(o.createElementBlock)("div",{class:"space-item",onClick:function(c){return e.triggerSearchSpace(t)}},[Object(o.createElementVNode)("img",{src:e.parseImgUrl("search-icon","icon_meetingroom.svg"),alt:""},null,8,Y),Object(o.createElementVNode)("p",null,Object(o.toDisplayString)(t.localName),1)],8,X)})),256)):Object(o.createCommentVNode)("",!0)])])])],64)}],["__scopeId","data-v-1406cd06"]]),H=Object(o.defineComponent)({emits:["closeSearch"],props:{projectId:{type:String,default:function(){return""}}},components:{VanSearch:M.a,SpaceMetting:H},setup:function(e,t){Object(V.d)();var c=P.a.state.user,n=Object(o.reactive)({parseImgUrl:v.y,showMetting:!1,spaceName:"",userInfo:c,searchData:[],historySearchData:[],goBack:function(){t.emit("closeSearch",null)},closeMetting:function(e){n.showMetting=!1,t.emit("closeSearch",e)},onSearch:function(){n.spaceName&&n.getSpaceLike()},onCancel:function(){n.searchData=[],n.getHistorySearch()},clearHistorySearch:function(){n.historySearchData=[]},getHistorySearch:function(){n.historySearchData=Object(v.j)()},triggerSearchSpace:function(e){Object(v.A)(e),t.emit("closeSearch",e)},getSpaceLike:function(){var e={criteria:{projectId:c.projectId,localName:{$like:"%".concat(n.spaceName,"%")}}};Object(S.u)(e).then((function(e){"success"===e.result?n.searchData=null!=(e=null==e?void 0:e.content)?e:[]:n.searchData=[]}))},goMetting:function(){n.showMetting=!0}});return Object(o.onMounted)((function(){n.historySearchData=Object(v.j)()})),Object(h.a)({},Object(o.toRefs)(n))}}),H=(c("3dfb"),c("fcad"),R()(H,[["render",function(e,t,c,n,a,l){var i=Object(o.resolveComponent)("VanIcon"),r=Object(o.resolveComponent)("van-search"),s=Object(o.resolveComponent)("space-metting"),d=Object(o.resolveComponent)("van-popup");return Object(o.openBlock)(),Object(o.createElementBlock)(o.Fragment,null,[Object(o.createElementVNode)("div",I,[Object(o.createElementVNode)("div",{class:"header-return",onClick:t[0]||(t[0]=function(){return e.goBack&&e.goBack.apply(e,arguments)})},[Object(o.createVNode)(i,{name:"arrow-left"})])]),Object(o.createElementVNode)("div",y,[Object(o.createElementVNode)("form",C,[Object(o.createVNode)(r,{modelValue:e.spaceName,"onUpdate:modelValue":[t[1]||(t[1]=function(t){return e.spaceName=t}),e.onSearch],onFocus:e.clearHistorySearch,onBlur:e.getHistorySearch,onClear:e.onCancel,placeholder:"输入地点"},null,8,["modelValue","onUpdate:modelValue","onFocus","onBlur","onClear"])]),Object(o.createElementVNode)("div",k,[Object(o.createElementVNode)("div",w,[N,Object(o.createElementVNode)("div",null,[Object(o.createElementVNode)("span",{onClick:t[2]||(t[2]=function(){return e.goMetting&&e.goMetting.apply(e,arguments)})},"查看所有会议室")])]),e.searchData&&e.searchData.length?(Object(o.openBlock)(!0),Object(o.createElementBlock)(o.Fragment,{key:0},Object(o.renderList)(e.searchData,(function(t){return Object(o.openBlock)(),Object(o.createElementBlock)("div",{class:"space-item",onClick:function(c){return e.triggerSearchSpace(t)}},[Object(o.createElementVNode)("img",{src:e.parseImgUrl("search-icon","icon_location.svg"),alt:""},null,8,D),Object(o.createElementVNode)("p",null,Object(o.toDisplayString)(t.localName),1)],8,B)})),256)):(Object(o.openBlock)(!0),Object(o.createElementBlock)(o.Fragment,{key:1},Object(o.renderList)(e.historySearchData,(function(t){return Object(o.openBlock)(),Object(o.createElementBlock)("div",{class:"space-item",onClick:function(c){return e.triggerSearchSpace(t)}},[Object(o.createElementVNode)("img",{src:e.parseImgUrl("search-icon","icon_location.svg"),alt:""},null,8,x),Object(o.createElementVNode)("p",null,Object(o.toDisplayString)(t.localName),1)],8,A)})),256))])]),Object(o.createVNode)(d,{show:e.showMetting,"onUpdate:show":t[3]||(t[3]=function(t){return e.showMetting=t}),teleport:"body",class:"buiding-box",style:{width:"100%",height:"100%"},position:"right"},{default:Object(o.withCtx)((function(){return[Object(o.createElementVNode)("div",E,[Object(o.createVNode)(s,{onCloseMetting:e.closeMetting},null,8,["onCloseMetting"])])]})),_:1},8,["show"])],64)}],["__scopeId","data-v-44b481c8"]])),{id:"myCanvas",class:"canvas-dom"});c("cb29"),c("d3b7"),c("3ca3"),c("ddb0");var U=c("6a79");M=Object(o.defineComponent)({props:{mapData:{type:Object,default:function(){}}},components:{VanSearch:M.a},setup:function(e,t){var n=Object(o.reactive)({mapData:e.mapData,iconData:[],parseImgUrl:v.y,canvasImageArr:{},ctx:{},setSpaceIcon:function(e){var t;e.canClick?(t=Object(U.a)(e.roomFuncType),e.icon=U.c[t].icon,e.selectIcon=U.c[t].selectIcon,e.backgroundColor=U.c[t].backgroundColor,e.bg=U.c[t].bg,e.icon=Object(v.y)("map-new-icon",e.icon),e.selectIcon=Object(v.y)("map-new-icon",e.selectIcon)):e.icon=""},scaleCanvas:function(e){n.mapData=e,document.querySelectorAll(".load-icon"),n.canvasImageArr={},n.initCanvas(1)},initCanvas:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,t=document.querySelector("#myCanvas"),o=t.getContext("2d");n.ctx=o,n.drawDpiBegin(t,o,n.mapData.width,n.mapData.height,e),(n.mapData&&n.mapData.spaceList||[]).map((function(t){var a,l,i,r;t.canClick?(r=t.circlePointArr,o.beginPath(),o.fillStyle=t.fillColor,a=[],l=[],t.pointArr.map((function(e,t){e.left=e.left,e.top=e.top,0==t?o.moveTo(e.left,e.top):o.lineTo(e.left,e.top),a.push(e.left),l.push(e.top)})),o.fill(),o.closePath(),o.beginPath(),r&&r.length&&(o.fillStyle=t.fillColor,o.lineTo(r[3].left,r[3].top),o.bezierCurveTo(r[2].left,r[2].top,r[1].left,r[1].top,r[0].left,r[0].top)),o.fill(),o.closePath(),n.MaxAndMin(a)[1],n.MaxAndMin(a)[0],n.MaxAndMin(l)[1],n.MaxAndMin(l)[0],o.beginPath(),o.font="12px serif",o.textAlign="center",o.fillStyle="#fff"===t.fillColor?"#000":"#8995BA",t.localName&&t.localName.length,o.fillText(t.localName,t.logoPointArr[0].left,t.logoPointArr[0].top,50),t.icon&&n.addIcon(t,1,{left:t.logoPointArr[0].left-25+15,top:+t.logoPointArr[0].top+5}),o.closePath()):(o.beginPath(),(i=new Image).src=c("2b48"),0==e?i.onload=function(){t.pointArr.map((function(e,t){0===t?o.moveTo(e.left,e.top):o.lineTo(e.left,e.top)}));var e=o.createPattern(i,"repeat");o.fillStyle=e,o.fill(),o.closePath(),o.lineWidth=2,o.strokeStyle="#DFE3ED",o.stroke()}:(t.pointArr.map((function(e,t){0===t?o.moveTo(e.left,e.top):o.lineTo(e.left,e.top)})),r=o.createPattern(i,"repeat"),o.fillStyle=r,o.fill(),o.closePath(),o.lineWidth=2,o.strokeStyle="#DFE3ED",o.stroke()))})),n.drawIcon(o,e),n.drawDpiEnd(t,o)},MaxAndMin:function(e){return[Math.min.apply(null,e),Math.max.apply(null,e)]},bindEvent:function(){document.querySelector("#myCanvas").addEventListener("click",n.detect)},drawDpiBegin:function(e,t,c,o){t.save(),t.clearRect(0,0,c,o);var n=window.devicePixelRatio;e.setAttribute("width",c*n),e.setAttribute("height",o*n),e.style.width=c+"px",e.style.height=o+"px",t.scale(n,n)},drawDpiEnd:function(e,t){t.restore()},detect:function(e){for(var c=document.querySelector("#myCanvas"),o=e.clientX-c.getBoundingClientRect().left,a=e.clientY-c.getBoundingClientRect().top,l=n.mapData&&n.mapData.spaceList||[],i=0;i<l.length;i++){var r=l[i],s=r.devicePointArr,d=r.pointArr,u=!1;if(s.map((function(e,t){o>=e.left&&o<=e.left+20&&a>=e.top&&a<e.top+20&&(u=!0)})),u)break;if(s={x:o,y:a},d.map((function(e){e.x=e.left,e.y=e.top})),n.queryPtInPolygon(s,d)){t.emit("checkSpace",r);break}}},queryPtInPolygon:function(e,t){for(var c=e,o={x:1e12,y:e.y},n=0,a=0;a<t.length-1;a++)1==l(c,o,t[a],t[a+1])&&n++;return 1==l(c,o,t[t.length-1],t[0])&&n++,n%2!=0;function l(e,t,c,o){var n={x:e.x-c.x,y:e.y-c.y},a={x:t.x-c.x,y:t.y-c.y},l=i(n,r={x:o.x-c.x,y:o.y-c.y})*i(a,r),r=(n={x:c.x-e.x,y:c.y-e.y},a={x:o.x-e.x,y:o.y-e.y},{x:t.x-e.x,y:t.y-e.y});return l<=0&&i(n,r)*i(a,r)<=0}function i(e,t){return e.x*t.y-e.y*t.x}},loadAllImages:function(e){return Promise.all(function(e){for(var t=[],c=0,o=e.length;c<o;c++)t.push(function(e){var t=new Image;return t.src=e,t.setAttribute("crossOrigin","Anonymous"),new Promise((function(e,c){t.onload=function(){e(t)}}))}(e[c]));return t}(e))},addIcon:function(e,t,c){t=e.spaceId+""+t,n.canvasImageArr[t]?n.canvasImageArr[t].iconPerstion=c:(e={url:e.icon,iconPerstion:c},n.canvasImageArr[t]=e)},drawIcon:function(e){var t,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,o=n.canvasImageArr,a=[],l=[];for(t in o){var i=o[t];a.push(i.url),l.push(i.iconPerstion)}0==c?n.loadAllImages(a).then((function(t){(n.iconData=t).map((function(t,c){c=l[c],c.width=25,c.height=15,e.drawImage(t,c.left,c.top,c.width,c.height)}))})):n.iconData.map((function(t,c){c=l[c],c.width=25,c.height=15,e.drawImage(t,c.left,c.top,c.width,c.height)}))},init:function(e){n.mapData=e,n.initCanvas(),n.bindEvent()}});return Object(o.onMounted)((function(){})),Object(h.a)({},Object(o.toRefs)(n))}}),c("8c22"),M=R()(M,[["render",function(e,t,c,n,a,l){return Object(o.openBlock)(),Object(o.createElementBlock)("canvas",q)}],["__scopeId","data-v-74cb39ba"]]),H=Object(o.defineComponent)({props:{projectId:{type:String,default:function(){return""}},spaceData:{type:Array,default:function(){return[]}},spaceInfo:{type:Object,default:function(){}},isSetSpace:{type:Boolean,default:function(){return!1}},floorId:{type:String,default:function(){return""}},buildingId:{type:String,default:function(){return""}},mapType:{type:Number,default:function(){return 1}}},components:{SpaceSearch:H,CanvasBox:M},setup:function(e,t){Object(V.d)();var c={},n=window.document,a={screenWidth:n.body.clientWidth,screenHeight:n.body.clientHeight},l=Object(o.ref)(null),i=Object(o.reactive)({parseImgUrl:v.y,mapType:e.mapType,spaceInfo:null,isSetSpace:e.isSetSpace,widthMapScale:1,tempScale:.8,comMapScale:.8,heightScale:1,showSearch:!1,isSetSearchSpace:!1,showBuilding:!1,showFloor:!1,buildingItem:{buildingId:"",localName:""},floorData:[],floorItem:{},buildingData:[],mapData:c,copyMapDaata:c,selectArea:{},displacement:{scale:1,pageX:0,pageX2:0,originScale:0,moveable:!1},screenInfo:a,transformData:{},clearPreStyle:function(){var e=n.querySelector("#map");e.scrollLeft=0,e.scrollTop=0,e=n.querySelector("#spaceMain");i.displacement.scale=1,e&&(e.style.left="0px",e.style.top="0px")},swipe:function(e,t){function c(){}var o,n,a=!1,l=0,r=0,s=0,d=0,u={swipeLeft:c,swipeRight:c,swipeDown:c,swipeUp:c,drag:c};Object.assign(u,t),e.addEventListener("touchstart",(function(t){l=t.touches[0].pageX,r=t.touches[0].pageY,s=l-e.offsetLeft,d=r-e.offsetTop}),{passive:!0}),e.addEventListener("touchmove",(function(t){var c;i.displacement.moveable||(a=!0,o=t.touches[0].pageX,n=t.touches[0].pageY,t.mation={startX:l,startY:r,moveX:o,moveY:n,disX:s,disY:d},u.drag.call(e,t),a&&(c=Math.abs(o-l),(Math.abs(n-r)<c?0<o-l?u.swipeRight:u.swipeLeft:0<n-l?u.swipeDown:u.swipeUp).call(e,t)))}),{passive:!0}),e.addEventListener("touchend",(function(e){a=!1}))},mapScroll:function(){var e=n.querySelector("#spaceMain"),t=n.querySelector("#houseDes"),c=t?t.offsetHeight:0;i.swipe(e,{swipeLeft:function(t){i.displacement.moveable||e.offsetWidth<i.screenInfo.screenWidth||(e.offsetWidth-Math.abs(t.touches[0].pageX-t.mation.disX)<i.screenInfo.screenWidth?e.style.left=-(e.offsetWidth-i.screenInfo.screenWidth)+"px":e.style.left=t.touches[0].pageX-t.mation.disX+"px")},swipeRight:function(t){i.displacement.moveable||e.offsetWidth<i.screenInfo.screenWidth||(0<t.touches[0].pageX-t.mation.disX?e.style.left="0px":e.style.left=t.touches[0].pageX-t.mation.disX+"px")},swipeDown:function(t){var o;i.displacement.moveable||(o=i.screenInfo.screenHeight-c-20,e.offsetHeight<o||0<t.touches[0].pageY-t.mation.disY?e.style.top="0px":e.style.top=t.touches[0].pageY-t.mation.disY+"px")},swipeUp:function(t){var c,o,a;i.displacement.moveable||(c=(c=n.querySelector("#houseDes"))?c.offsetHeight:0,c=i.screenInfo.screenHeight-c-20,o=e.offsetHeight,a=t.touches[0].pageY-t.mation.disY,o<c?e.style.top="0px":o-Math.abs(a)<c/2?e.style.top=-(o-c/2)+"px":e.style.top=t.touches[0].pageY-t.mation.disY+"px")},drag:function(e){}})},closeSearch:function(e){i.showSearch=!1,e?(i.isSetSearchSpace=!0,i.loadingStart(),e={buildingId:e.buildingId,buildingName:"",floorId:e.floorId,floorName:"",spaceId:e.id},i.init(e)):i.isSetSearchSpace=!1},goSearch:function(){i.showSearch=!0},setSelectSpacePosition:function(e){setTimeout((function(){i.setScrollLeft(e),i.scrollTop(e)}))},setScrollLeft:function(e){var t=n.querySelector("#spaceMain"),c=0;0<(c=e.left+e.width>=i.screenInfo.screenWidth/2?~(c=e.left-i.screenInfo.screenWidth/2+e.width/2):0)&&(c=0),Math.abs(c)>t.offsetWidth-i.screenInfo.screenWidth&&(c=-(t.offsetWidth-i.screenInfo.screenWidth)),t.style.left=c+"px"},scrollTop:function(e){n.querySelector("#map");var t=n.querySelector("#spaceMain"),c=n.querySelector("#houseDes"),o=(c=c?c.offsetHeight:0,0);o=e.top+e.width>(i.screenInfo.screenHeight-c-20)/2?e.top-(i.screenInfo.screenHeight-c)/2+e.height/2:0;t.style.top=(o=0<(o=~o)?0:o)+"px"},checkSpace:function(e){e.disabled?Object(O.a)("该空间和平板没绑定,暂不支持查看"):(i.isSetSearchSpace=!1,e&&e.canClick?(1==i.mapType&&i.setSelectSpacePosition(e),i.selectArea=e,i.selectArea.buildingId=i.buildingItem.buildingId,i.setLocalSpaceInfo(),t.emit("changeSpace",i.selectArea)):Object(O.a)("不可选区域"))},comfirSetSpace:function(c){(c.spaceId===e.spaceInfo.spaceId?j.a.confirm({title:"取消常驻空间",confirmButtonColor:"#000000",cancelButtonColor:"#4D5262",message:"\n 是否取消常驻空间设置 ? "}).then((function(){t.emit("delPermanentSpace")})):j.a.confirm({title:"设置常驻空间",confirmButtonColor:"#000000",cancelButtonColor:"#4D5262",message:"是否将常驻空间设置为".concat(c.localName,"?")}).then((function(){i.selectArea=c,t.emit("changeSpaceId",i.selectArea.spaceId)}))).catch((function(){}))},setLocalSpaceInfo:function(){Object(v.w)(i.buildingItem.buildingId,i.floorItem.id,i.selectArea.spaceId);var e={buildingId:i.buildingItem.buildingId,buildingName:i.buildingItem.localName,floorId:i.floorItem.id,floorName:i.floorItem.localName,spaceId:i.selectArea.spaceId};Object(v.z)(e)},getDistance:function(e,t){return Math.hypot(t.x-e.x,t.y-e.y)},formateMapData:function(){var t=e.spaceData,c=i.mapData;if(c){i.setSpaceScale(),i.setTempScale(),c.width<3e3&&(i.comMapScale=.8),"Pj1101020007"==e.projectId&&(i.comMapScale=1.5),c.width=c.width*i.comMapScale,c.height=c.height*i.comMapScale;for(var o,n=null!=(o=null==c?void 0:c.spaceList)?o:[],a=0;a<n.length;a++){for(var l=n[a],r=(l.width=l.width*i.comMapScale,l.height=l.height*i.comMapScale,l.top=l.top*i.comMapScale,l.rotate=+l.rotate+"deg","Pj1101020007"==e.projectId?l.left=(l.left-120)*i.comMapScale:l.left=l.left*i.comMapScale,l.borderRadius=l.borderRadius?JSON.parse(l.borderRadius):"",!0),s=0;s<t.length;s++)if(l.spaceId===t[s].spaceId){r=!1;break}r&&(l.disabled=!0),i.setSpaceIcon(l)}i.copyMapDaata=JSON.parse(JSON.stringify(c))}},formateSpecialMapData:function(){var e=i.mapData;e&&(e.width=e.width*i.comMapScale,e.height=e.height*i.comMapScale,(e.spaceList||[]).map((function(e){var t=e.remark;t&&(t=JSON.parse(t),e.roomFuncType="300",e.fillColor="#fff",e.canClick=t.canClick,e.localName=t.localName,e.pointArr=t.pointArr,e.logoPointArr=t.logoPointArr,e.circlePointArr=t.circlePointArr,e.detailPointArr=t.detailPointArr,e.devicePointArr=t.devicePointArr,i.setSpaceIcon(e),e.pointArr.map((function(e){e.left=e.left*i.comMapScale,e.top=e.top*i.comMapScale})),e.logoPointArr.map((function(e){e.left=e.left*i.comMapScale,e.top=(+e.top-15)*i.comMapScale})),e.circlePointArr.map((function(e){e.left=e.left*i.comMapScale,e.top=e.top*i.comMapScale})))})),i.copyMapDaata=JSON.parse(JSON.stringify(e)))},formateSpecialMapScale:function(e){var t=JSON.parse(JSON.stringify(i.copyMapDaata));t&&(t.width=t.width*e,t.height=t.height*e,(t.spaceList||[]).map((function(t){t.pointArr.map((function(t){t.left=t.left*e,t.top=t.top*e})),t.logoPointArr.map((function(t){t.left=t.left*e,t.top=t.top*e})),t.circlePointArr.map((function(t){t.left=t.left*e,t.top=t.top*e}))})),i.mapData=t)},setSpaceScale:function(){var e,t=i.mapData;t&&(t=null!=(t=null==t?void 0:t.spaceList)?t:[],e=(e=(e=Math.min.apply(null,t.map((function(e){return e.height}))))<(t=Math.min.apply(null,t.map((function(e){return e.width}))))?e:t)||30,i.comMapScale=30/e)},setTempScale:function(){var e,t;i.tempScale=.4,i.mapData&&(t=i.mapData.width,(e=i.mapData.height)<t?(t=Math.ceil(t/i.screenInfo.screenWidth),i.tempScale=t<10?.4:t<20?.3:.25):(t=Math.ceil(e/i.screenInfo.screenHeight),i.tempScale=t<10?.4:t<20?.3:.25))},setMapBoxStyle:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,t=n.querySelector("#spaceMain");i.mapData&&i.mapData.width&&(t.style.width=i.mapData.width+"px",t.style.height=i.mapData.height+"px"),2==i.mapType&&(0==e?l.value.init(i.mapData):l.value.scaleCanvas(i.mapData))},setSpaceIcon:function(e){var t;e.canClick?(t=Object(U.a)(e.roomFuncType),e.icon=U.c[t].icon,e.selectIcon=U.c[t].selectIcon,e.backgroundColor=U.c[t].backgroundColor,e.bg=U.c[t].bg,e.icon=Object(v.y)("map-new-icon",e.icon),e.selectIcon=Object(v.y)("map-new-icon",e.selectIcon)):e.icon=""},midpoint:function(e,t,c,o){return[e+(c-e)/2,t+(o-t)/2]},updateMapStyle:function(){if(1==i.mapType){var e=JSON.parse(JSON.stringify(i.copyMapDaata));if(e){var t,c=null!=(t=null==e?void 0:e.spaceList)?t:[];e.width=e.width*i.displacement.scale,e.height=e.height*i.displacement.scale;for(var o=0;o<c.length;o++){var n=c[o];n.width=n.width*i.displacement.scale,n.height=n.height*i.displacement.scale,n.top=n.top*i.displacement.scale,n.left=n.left*i.displacement.scale}i.mapData=e}}else i.formateSpecialMapScale(i.displacement.scale);i.setMapBoxStyle(1)},updateMapPositon:function(e,t){var c=i.displacement.scaleCenter[0]-i.displacement.scaleCenter[0]*i.displacement.scale,o=i.displacement.scaleCenter[1]-i.displacement.scaleCenter[1]*i.displacement.scale;0<e&&i.displacement.scale<1&&(0<c&&(c=~c),0<o&&(o=~o)),e=i.displacement.top*i.displacement.scale+o,o=i.displacement.left*i.displacement.scale+c;t.offsetWidth<i.screenInfo.screenWidth&&(o=0),t.style.left=0<o?"0px":o+"px",t.offsetHeight<i.screenInfo.screenHeight?t.style.top=0:t.style.top=0<e?0:e+"px"},mapScale:function(){var e=n.querySelector("#spaceMain");e.addEventListener("touchstart",(function(t){t=t.touches;var c,o,n=t[0];t=t[1];i.displacement.pageX=n.pageX,i.displacement.pageY=n.pageY,i.displacement.moveable=!0,i.displacement.originScale=i.displacement.scale||1,t?(i.displacement.pageX2=t.pageX,i.displacement.pageY2=t.pageY,c=isNaN(parseInt(e.style.left))?0:parseInt(e.style.left),o=isNaN(parseInt(e.style.top))?0:parseInt(e.style.top),i.displacement.center=i.midpoint(n.pageX,n.pageY,t.pageX,t.pageY),i.displacement.left=c/i.displacement.scale,i.displacement.top=o/i.displacement.scale,i.displacement.scaleCenter=[i.displacement.center[0]/i.displacement.scale,i.displacement.center[1]/i.displacement.scale],i.displacement.scaleTranslateProportion=[i.displacement.scaleCenter[0]/(e.offsetWidth/i.displacement.scale),i.displacement.scaleCenter[1]/(e.offsetHeight/i.displacement.scale)],i.displacement.oldSize=[e.offsetWidth/i.displacement.scale,e.offsetHeight/i.displacement.scale]):i.displacement.moveable=!1}),{passive:!0}),e.addEventListener("touchmove",(function(t){var c;i.displacement.moveable&&(c=(t=t.touches)[0],(t=t[1])&&(i.displacement.pageX2||(i.displacement.pageX2=t.pageX),i.displacement.pageY2||(i.displacement.pageY2=t.pageY),c=i.getDistance({x:c.pageX,y:c.pageY},{x:t.pageX,y:t.pageY})/i.getDistance({x:i.displacement.pageX,y:i.displacement.pageY},{x:i.displacement.pageX2,y:i.displacement.pageY2}),c=(t=1.5<(t=(t=i.displacement.originScale*c)<i.tempScale?i.tempScale:t)?1.5:t)-i.displacement.scale,i.displacement.scale=t,0!=c&&(i.updateMapPositon(c,e),i.updateMapStyle())))}),{passive:!0}),e.addEventListener("touchend",(function(){i.displacement.moveable=!0}))},getBuildingList:function(){var t={criteria:{projectId:e.projectId},orders:[{asc:!0,column:"localId"}]};Object(S.e)(t).then((function(e){"success"===e.result&&(e=null!=(e=null==e?void 0:e.content)?e:[],i.buildingData=e,i.setBuildingName())}))},checkBuilding:function(){i.showBuilding=!0},checkFloor:function(){i.showFloor=!0},comfirmFloor:function(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];"4555556"==e?(i.floorItem={id:"4555556"},i.mapType=2):(i.floorItem=e,i.mapType=1),i.showFloor=!1,i.loadingStart(),i.getMapInfo(t),Object(v.v)(i.buildingItem.buildingId,i.floorItem.id)},comfirmBuilding:function(e){i.showBuilding=!1,i.buildingItem.buildingId=e.id,i.buildingItem.localName=e.localName,i.loadingStart(),i.getFloorList()},loadingStart:function(){O.a.loading({duration:0,forbidClick:!0,message:"加载中..."})},loadinngEnd:function(){O.a.clear()},getFloorList:function(){var t,c=!(0<arguments.length&&void 0!==arguments[0])||arguments[0];i.buildingItem.buildingId&&(t={criteria:{projectId:e.projectId,buildingId:i.buildingItem.buildingId},orders:[{asc:!0,column:"localId"}]},Object(S.j)(t).then((function(e){var t=e;"success"===e.result?(i.floorData=null!=(e=null==t?void 0:t.content)?e:[],i.setFloorName()):i.floorData=[],c&&i.floorData.length&&(i.getHistorySelectFloor(),i.getMapInfo()),i.loadinngEnd()})).catch((function(){i.loadinngEnd()})))},getMapInfo:function(){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,c={projectId:e.projectId,floorId:i.floorItem.id};Object(S.l)(c).then((function(e){"success"===e.result&&(i.mapData=null!=(e=null==e?void 0:e.data)?e:null,i.clearPreStyle(),2===i.mapType?i.formateSpecialMapData():i.formateMapData(),t&&(e=i.getFirstSelectSpace(t))&&(i.selectArea=e),i.setSelectSpacePosition(i.selectArea),Object(o.nextTick)((function(){i.setMapBoxStyle(),i.mapScale(),i.mapScroll()})))})).catch((function(){i.loadinngEnd()}))},getHistorySelectFloor:function(){var e=Object(v.k)(),t=!1,c=e[i.buildingItem.buildingId];i.floorData.map((function(e){e.id===c&&(t=!0,i.floorItem=e)})),t||(i.floorItem=i.floorData[0])},getHistorySpace:function(){var e=i.mapData,t=Object(v.q)();if(e){var c=!1,o=null!=(e=null==e?void 0:e.spaceList)?e:[],n=t["".concat(i.buildingItem.buildingId,",").concat(i.floorItem.id)];if(n&&o.map((function(e){n===e.spaceId&&(i.selectArea=e,c=!0)})),!c)for(var a=0;a<o.length;a++)if(o[a].canClick){i.selectArea=o[a];break}}},getFirstSelectSpace:function(e){var t=null,c=i.mapData;if(c&&e)for(var o=null!=(c=null==c?void 0:c.spaceList)?c:[],n=0;n<o.length;n++)if(o[n].spaceId===e.spaceId){t=o[n];break}return t},setDefaultSpace:function(e){e&&(i.buildingItem.buildingId=e.buildingId,i.buildingItem.localName=e.buildingName||"",i.floorItem={id:e.floorId,localName:e.floorName||""})},init:function(e){e&&i.setDefaultSpace(e),i.getBuildingList(),i.getFloorList(!1),i.getMapInfo(!1,e)},setBuildingName:function(){i.buildingItem.buildingId?i.buildingData.map((function(e){e.id===i.buildingItem.buildingId&&(i.buildingItem.localName=e.localName)})):i.buildingItem={buildingId:i.buildingData[0].id,localName:i.buildingData[0].localName}},setFloorName:function(){i.floorItem.id?i.floorData.map((function(e){e.id===i.floorItem.id&&(i.floorItem.localName=e.localName)})):i.floorItem=i.floorData[0]}});return Object(o.watch)(e,(function(e){}),{deep:!1,immediate:!0}),Object(o.onMounted)((function(){i.spaceInfo=e.spaceInfo,i.buildingItem.buildingId=e.buildingId,i.floorItem.id=e.floorId,i.spaceInfo.buildingId=e.buildingId,i.spaceInfo.floorId=e.floorId,i.selectArea.spaceId=e.spaceInfo.spaceId,i.init(i.spaceInfo)})),Object(h.a)({canvasRef:l},Object(o.toRefs)(i))}});c("e108"),t.a=R()(H,[["render",function(e,t,c,h,v,O){var j=Object(o.resolveComponent)("canvas-box"),S=Object(o.resolveComponent)("van-popup"),I=Object(o.resolveComponent)("space-search");return Object(o.openBlock)(),Object(o.createElementBlock)("div",n,[Object(o.createElementVNode)("div",a,[1==e.mapType?(Object(o.openBlock)(!0),Object(o.createElementBlock)(o.Fragment,{key:0},Object(o.renderList)(e.mapData.spaceList,(function(t,c){return Object(o.openBlock)(),Object(o.createElementBlock)("div",{class:"space-box",style:Object(o.normalizeStyle)({width:t.width+"px",height:t.height+"px",top:t.top+"px",left:t.left+"px",transform:"rotate("+t.rotate+")",borderRadius:t.borderRadius[0]+"px "+t.borderRadius[1]+"px "+t.borderRadius[2]+"px "+t.borderRadius[3]+"px"}),key:"map"+c},[Object(o.createElementVNode)("div",{class:Object(o.normalizeClass)(["space",[t.canClick?"":"click-disable",e.selectArea.spaceId===t.spaceId?t.disabled?"select-disable":"select":"",e.isSetSpace?"use-select":"",t.disabled?"space-disable-box":"space-box-bg"]]),id:"space"+t.id,onClick:Object(o.withModifiers)((function(c){return e.checkSpace(t)}),["stop"]),style:Object(o.normalizeStyle)({backgroundColor:t.backgroundColor||""})},[Object(o.withDirectives)(Object(o.createElementVNode)("div",{class:Object(o.normalizeClass)(["device",e.selectArea.spaceId===t.spaceId?"select-device":""])},[e.selectArea.spaceId!==t.spaceId&&t.icon?(Object(o.openBlock)(),Object(o.createElementBlock)("img",{key:0,src:t.icon},null,8,i)):(Object(o.openBlock)(),Object(o.createElementBlock)("img",{key:1,src:t.selectIcon,class:"select-icon",alt:""},null,8,r)),t.localName?(Object(o.openBlock)(),Object(o.createElementBlock)(o.Fragment,{key:2},[80<t.height&&12*t.localName.length<t.width||e.selectArea.spaceId===t.spaceId?(Object(o.openBlock)(),Object(o.createElementBlock)("span",s,Object(o.toDisplayString)(t.localName),1)):Object(o.createCommentVNode)("",!0)],64)):Object(o.createCommentVNode)("",!0)],2),[[o.vShow,24<t.width*e.displacement.scale&&24<t.height*e.displacement.scale]])],14,l)],4)})),128)):(Object(o.openBlock)(),Object(o.createBlock)(j,{key:1,class:"canvasBox",ref:"canvasRef",mapData:e.mapData,onCheckSpace:e.checkSpace},null,8,["mapData","onCheckSpace"]))]),Object(o.createElementVNode)("div",d,[Object(o.createElementVNode)("img",{src:e.parseImgUrl("map-icon","icon-search-big.svg"),onClick:t[0]||(t[0]=Object(o.withModifiers)((function(){return e.goSearch&&e.goSearch.apply(e,arguments)}),["stop"])),class:"icon-search",alt:""},null,8,u),Object(o.createElementVNode)("div",{class:"toolbar-item",onClick:t[1]||(t[1]=Object(o.withModifiers)((function(){return e.checkFloor&&e.checkFloor.apply(e,arguments)}),["stop"]))},[Object(o.createElementVNode)("span",p,Object(o.toDisplayString)(e.floorItem.localName),1)]),Object(o.createElementVNode)("div",{class:"toolbar-item",onClick:t[2]||(t[2]=Object(o.withModifiers)((function(){return e.checkBuilding&&e.checkBuilding.apply(e,arguments)}),["stop"]))},[Object(o.createElementVNode)("span",f,Object(o.toDisplayString)(e.buildingItem.localName),1)])]),Object(o.createVNode)(S,{show:e.showBuilding,"onUpdate:show":t[3]||(t[3]=function(t){return e.showBuilding=t}),teleport:"body",class:"buiding-box",style:{width:"40%",height:"100%",padding:"20px"},position:"right"},{default:Object(o.withCtx)((function(){return[(Object(o.openBlock)(!0),Object(o.createElementBlock)(o.Fragment,null,Object(o.renderList)(e.buildingData,(function(t){return Object(o.openBlock)(),Object(o.createElementBlock)("div",{class:Object(o.normalizeClass)(["buiding-item",e.buildingItem.buildingId===t.id?"active":""]),key:t.id+"X",onClick:Object(o.withModifiers)((function(c){return e.comfirmBuilding(t)}),["stop"])},Object(o.toDisplayString)(t.localName),11,m)})),128))]})),_:1},8,["show"]),Object(o.createVNode)(S,{show:e.showFloor,"onUpdate:show":t[4]||(t[4]=function(t){return e.showFloor=t}),teleport:"body",class:"buiding-box",style:{width:"40%",height:"100%",padding:"20px"},position:"right"},{default:Object(o.withCtx)((function(){return[(Object(o.openBlock)(!0),Object(o.createElementBlock)(o.Fragment,null,Object(o.renderList)(e.floorData,(function(t){return Object(o.openBlock)(),Object(o.createElementBlock)("div",{class:Object(o.normalizeClass)(["buiding-item",e.floorItem.id===t.id?"active":""]),key:t.id,onClick:Object(o.withModifiers)((function(c){return e.comfirmFloor(t)}),["stop"])},Object(o.toDisplayString)(t.localName),11,g)})),128))]})),_:1},8,["show"]),Object(o.createVNode)(S,{show:e.showSearch,"onUpdate:show":t[5]||(t[5]=function(t){return e.showSearch=t}),teleport:"body",class:"buiding-box",style:{width:"100%",height:"100%"},position:"right"},{default:Object(o.withCtx)((function(){return[Object(o.createElementVNode)("div",b,[Object(o.createVNode)(I,{onCloseSearch:e.closeSearch},null,8,["onCloseSearch"])])]})),_:1},8,["show"])])}],["__scopeId","data-v-4cb6d436"]])},1703:function(e,t,c){},2241:function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var o=c("75e6").a},"2b48":function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAA3SURBVHgBzcmxDQAgCAVRPxO5ipM6ko0xxkYnQKUHaq654iEZ9bUzMSo8ZLpFxTFPk4dAycXfA1ISQWorFT5NAAAAAElFTkSuQmCC"},"2fcb":function(e,t,c){},"36e1":function(e,t,c){e.exports={menuBg:"#fff",menuText:"#162b64",menuActiveText:"#435ebe"}},"3dfb":function(e,t,c){"use strict";c("7a89")},4057:function(e,t,c){c=c("23e7");var o=Math.hypot,n=Math.abs,a=Math.sqrt;c({target:"Math",stat:!0,forced:!!o&&o(1/0,NaN)!==1/0},{hypot:function(e,t){for(var c,o,l=0,i=0,r=arguments.length,s=0;i<r;)s<(c=n(arguments[i++]))?(l=l*(o=s/c)*o+1,s=c):l+=0<c?(o=c/s)*o:c;return s===1/0?1/0:s*a(l)}})},5852:function(e,t,c){"use strict";c("68ef"),c("cb51"),c("3743"),c("1a04"),c("1146"),c("f032")},5899:function(e,t){e.exports="\t\n\v\f\r \u2028\u2029\ufeff"},"58a8":function(e,t,c){function o(e){return function(t){return t=String(n(t)),1&e&&(t=t.replace(a,"")),2&e?t.replace(l,""):t}}var n=c("1d80"),a=(c="["+c("5899")+"]",RegExp("^"+c+c+"*")),l=RegExp(c+c+"*$");e.exports={start:o(1),end:o(2),trim:o(3)}},"5ac8":function(e,t,c){},"5c09":function(e,t,c){},"6a79":function(e,t,c){"use strict";c.d(t,"c",(function(){return o})),c.d(t,"a",(function(){return n})),c.d(t,"b",(function(){return a}));var o={"公共区域":{backgroundColor:"#DFE3ED",icon:"storeroom.svg",selectIcon:"storeroomselected.svg"},"卫生间":{backgroundColor:"#fff",selectIcon:"toiletSelect.svg",icon:"toilet.svg"},"走廊":{icon:"passage.svg",backgroundColor:"#fff",selectIcon:"passageselected.svg"},"母婴室":{backgroundColor:"#fff",icon:"baby.svg",selectIcon:"babyselected.svg"},"电梯厅":{icon:"elevator.svg",selectIcon:"elevatoSelect.svg",backgroundColor:"#DFE3ED"},"楼梯间":{backgroundColor:"#DFE3ED",icon:"stairsx.svg",selectIcon:"stairsxselected.svg"},"打印":{backgroundColor:"#DFE3ED",icon:"print.svg",selectIcon:"printselected.svg"},"休闲活动区":{icon:"coffee.svg",backgroundColor:"#DFE3ED",selectIcon:"coffeeselected.svg"},"普通办公区":{icon:"officeroom.svg",selectIcon:"officeroomselected.svg",backgroundColor:"#fff",circleColor:"#7582B0"},"办公室":{backgroundColor:"#fff",circleColor:"#7582B0",icon:"officeroom.svg",selectIcon:"officeroomselected.svg"},"会议室":{backgroundColor:"#fff",circleColor:"#F2918E",icon:"mroom.svg",selectIcon:"mroomSelect.svg"},"多功能厅":{backgroundColor:"#fff",circleColor:"#7582B0",icon:"vector.svg",selectIcon:"vectorSelect.svg"},"接待室":{backgroundColor:"#fff",circleColor:"#7582B0",icon:"jiedaiqu.svg",selectIcon:"jiedaiquSelect.svg"},"门厅":{backgroundColor:"#DFE3ED",circleColor:"#7582B0",icon:"jiedaiqu.svg",selectIcon:"jiedaiquSelect.svg"},"档案库":{backgroundColor:"#fff",circleColor:"#7582B0",icon:"chucang.svg",selectIcon:"chucangshiSelect.svg"},"更衣室":{backgroundColor:"#fff",circleColor:"#7582B0",icon:"gengyishi.svg",selectIcon:"gengyishiSelect.svg"},"厨房":{backgroundColor:"#fff",circleColor:"#7582B0",icon:"chufang.svg",selectIcon:"chufangSelect.svg"},"餐饮区":{backgroundColor:"#DFE3ED",circleColor:"#7582B0",icon:"canyin.svg",selectIcon:"canyinSelect.svg"},"设备间":{backgroundColor:"#fff",circleColor:"#7582B0",icon:"deviceroom.svg",selectIcon:"deviceroomselected.svg"},"健身房":{backgroundColor:"#DFE3ED",circleColor:"#7582B0",icon:"jianshenfang.svg",selectIcon:"jianshenfangSelect.svg"},"体育管":{backgroundColor:"#DFE3ED",circleColor:"#7582B0",icon:"tiyuguan.svg",selectIcon:"tiyuguanSelect.svg"},"游泳馆":{backgroundColor:"#DFE3ED",circleColor:"#7582B0",icon:"youyong.svg",selectIcon:"youyongSelect.svg"},"图书馆":{backgroundColor:"#DFE3ED",circleColor:"#7582B0",icon:"tushuguan.svg",selectIcon:"tushuguanSelect.svg"},"活动区":{backgroundColor:"#DFE3ED",circleColor:"#7582B0",icon:"huodongqu.svg",selectIcon:"huodongquSelect.svg"},"实验室":{backgroundColor:"#fff",circleColor:"#7582B0",icon:"shiyanqu.svg",selectIcon:"shiyanquSelect.svg"},"值班室":{backgroundColor:"#fff",circleColor:"#7582B0",icon:"zhibanshi.svg",selectIcon:"zhibanshiSelect.svg"},"收费室":{backgroundColor:"#fff",circleColor:"#7582B0",icon:"finance.svg",selectIcon:"financeselected.svg"},"护士站":{backgroundColor:"#DFE3ED",circleColor:"#7582B0",icon:"nurse.svg",selectIcon:"nurseSelect.svg"}},n=function(e){return"100"===e||"1A0"===e||"0"===e||"443"===e||"453"===e?"公共区域":"111"===e?"卫生间":"113"===e?"母婴室":"120"===e?"走廊":"130"===e?"电梯厅":"140"===e?"楼梯间":"170"===e||"600"===e||"223"===e||"930"===e?"休闲活动区":"300"===e||"313"===e||"314"===e||"315"===e||"330"===e?"普通办公区":"312"===e||"311"===e||"310"===e?"办公室":"310"===e||"321"===e||"322"===e||"320"===e?"会议室":"490"===e||"323"===e||"931"===e?"多功能厅":"331"===e?"接待室":"160"===e?"门厅":"333"===e||"250"===e||"253"===e?"档案库":"112"===e?"更衣室":"220"===e||"221"===e?"餐饮区":"430"===e||"410"===e||"400"===e||"4B0"===e||"441"===e||"442"===e||"451"===e||"452"===e||"461"===e||"462"===e||"471"===e||"472"===e||"733"===e||"440"===e||"450"===e?"厨房":"252"===e||"246"===e||"1B5"===e||"234"===e||"231"===e||"230"===e||"233"===e||"232"===e||"234"===e||"235"===e||"236"===e||"237"===e||"241"===e||"242"===e||"244"===e||"245"===e||"251"===e||"254"===e||"211"===e||"212"===e||"222"===e?"设备间":"690"===e?"健身房":"932"===e||"934"===e||"933"===e||"6A0"===e?"体育管":"935"===e?"图书馆":"936"===e||"937"===e||"938"===e||"915"===e?"活动区":"921"===e||"922"===e||"923"===e||"920"===e||"926"===e||"924"===e||"925"===e||"926"===e?"实验室":"243"===e||"332"===e?"值班室":"334"===e?"收费室":"335"===e?"护士站":"公共区域"},a=function(e){return"312"===e||"311"===e||"310"===e?"个人":"320"===e||"321"===e||"322"===e||"323"===e?"会议室":"开放"}},"75e6":function(e,t,c){"use strict";c.d(t,"a",(function(){return E}));var o=c("7a23"),n=c("f344"),a=(t=c("c199"),c("1da4")),l=c("fe7e"),i=c("f691"),r=c("7e3e"),s=c("8da3"),d=c("b1d2"),u=c("8405"),p=c("f827"),f=c("e41f"),m=c("b650"),g=c("f465");const[b,h]=Object(l.a)("action-bar"),v=Symbol(b);var O={safeAreaInsetBottom:i.g};O=Object(o.defineComponent)({name:b,props:O,setup(e,{slots:t}){const c=Object(g.f)(v)["linkChildren"];return c(),()=>{var c;return Object(o.createVNode)("div",{class:[h(),{"van-safe-area-bottom":e.safeAreaInsetBottom}]},[null==(c=t.default)?void 0:c.call(t)])}}});const j=Object(t.a)(O);var S=c("4eda"),I=c("b070");const[y,C]=Object(l.a)("action-bar-button");O=Object(n.a)({},I.b,{type:String,text:String,icon:String,color:String,loading:Boolean,disabled:Boolean}),c=Object(o.defineComponent)({name:y,props:O,setup(e,{slots:t}){const c=Object(I.c)(),{parent:n,index:a}=Object(g.k)(v),l=Object(o.computed)(()=>{var e;if(n)return!((e=n.children[a.value-1])&&"isButton"in e)}),i=Object(o.computed)(()=>{var e;if(n)return!((e=n.children[a.value+1])&&"isButton"in e)});return Object(S.a)({isButton:!0}),()=>{const{type:n,icon:a,text:r,color:s,loading:d,disabled:u}=e;return Object(o.createVNode)(m.a,{class:C([n,{last:i.value,first:l.value}]),size:"large",type:n,icon:a,color:s,loading:d,disabled:u,onClick:c},{default:()=>[t.default?t.default():r]})}}});const k=Object(t.a)(c),[w,N,B]=Object(l.a)("dialog");O=Object(n.a)({},p.b,{title:String,theme:String,width:i.f,message:[String,Function],callback:Function,allowHtml:Boolean,className:i.h,transition:Object(i.e)("van-dialog-bounce"),messageAlign:String,closeOnPopstate:i.g,showCancelButton:Boolean,cancelButtonText:String,cancelButtonColor:String,confirmButtonText:String,confirmButtonColor:String,showConfirmButton:i.g,closeOnClickOverlay:Boolean});const D=[...p.a,"transition","closeOnPopstate"];var A=Object(o.defineComponent)({name:w,props:O,emits:["confirm","cancel","keydown","update:show"],setup(e,{emit:t,slots:c}){const a=Object(o.ref)(),l=Object(o.reactive)({confirm:!1,cancel:!1}),i=e=>t("update:show",e),p=t=>{var c;i(!1),null!=(c=e.callback)&&c.call(e,t)};var g=c=>()=>{e.show&&(t(c),e.beforeClose?(l[c]=!0,Object(r.a)(e.beforeClose,{args:[c],done(){p(c),l[c]=!1},canceled(){l[c]=!1}})):p(c))};const b=g("cancel"),h=g("confirm"),v=Object(o.withKeys)(c=>{var o;if(c.target===(null==(o=null==(o=a.value)?void 0:o.popupRef)?void 0:o.value)){const o={Enter:e.showConfirmButton?h:n.d,Escape:e.showCancelButton?b:n.d};o[c.key](),t("keydown",c)}},["enter","esc"]),O=()=>{if(c.default)return Object(o.createVNode)("div",{class:N("content")},[c.default()]);var{title:t,message:n,allowHtml:a}=e;return n?(n=!(!t&&!c.title),Object(o.createVNode)("div",{key:a?1:0,class:N("content",{isolated:!n})},[(t=>{const{message:c,allowHtml:n,messageAlign:a}=e;t=N("message",{"has-title":t,[a]:a});var l=Object(s.c)(c)?c():c;return n&&"string"==typeof l?Object(o.createVNode)("div",{class:t,innerHTML:l},null):Object(o.createVNode)("div",{class:t},[l])})(n)])):void 0},S=()=>c.footer?c.footer():"round-button"===e.theme?Object(o.createVNode)(j,{class:N("footer")},{default:()=>[e.showCancelButton&&Object(o.createVNode)(k,{type:"warning",text:e.cancelButtonText||B("cancel"),class:N("cancel"),color:e.cancelButtonColor,loading:l.cancel,onClick:b},null),e.showConfirmButton&&Object(o.createVNode)(k,{type:"danger",text:e.confirmButtonText||B("confirm"),class:N("confirm"),color:e.confirmButtonColor,loading:l.confirm,onClick:h},null)]}):Object(o.createVNode)("div",{class:[d.c,N("footer")]},[e.showCancelButton&&Object(o.createVNode)(m.a,{size:"large",text:e.cancelButtonText||B("cancel"),class:N("cancel"),style:{color:e.cancelButtonColor},loading:l.cancel,onClick:b},null),e.showConfirmButton&&Object(o.createVNode)(m.a,{size:"large",text:e.confirmButtonText||B("confirm"),class:[N("confirm"),{[d.a]:e.showCancelButton}],style:{color:e.confirmButtonColor},loading:l.confirm,onClick:h},null)]);return()=>{var{width:t,title:l,theme:r,message:s,className:d}=e;return Object(o.createVNode)(f.a,Object(o.mergeProps)({ref:a,role:"dialog",class:[N([r]),d],style:{width:Object(u.b)(t)},tabindex:0,"aria-labelledby":l||s,onKeydown:v,"onUpdate:show":i},Object(n.e)(e,D)),{default:()=>[(()=>{var t=c.title?c.title():e.title;if(t)return Object(o.createVNode)("div",{class:N("header",{isolated:!e.message&&!c.default})},[t])})(),O(),S()]})}}});let x;function E(e){return n.c?new Promise((t,c)=>{var l;x||(l={setup(){const{state:e,toggle:t}=Object(a.b)();return()=>Object(o.createVNode)(A,Object(o.mergeProps)(e,{"onUpdate:show":t}),null)}},({instance:x}=Object(a.a)(l))),x.open(Object(n.a)({},E.currentOptions,e,{callback:e=>{("confirm"===e?t:c)(e)}}))}):Promise.resolve()}E.defaultOptions={title:"",width:"",theme:null,message:"",overlay:!0,callback:null,teleport:"body",className:"",allowHtml:!1,lockScroll:!0,transition:void 0,beforeClose:null,overlayClass:"",overlayStyle:void 0,messageAlign:"",cancelButtonText:"",cancelButtonColor:null,confirmButtonText:"",confirmButtonColor:null,showConfirmButton:!0,showCancelButton:!1,closeOnPopstate:!0,closeOnClickOverlay:!1},E.currentOptions=Object(n.a)({},E.defaultOptions),(E.alert=E).confirm=e=>E(Object(n.a)({showCancelButton:!0},e)),E.close=()=>{x&&x.toggle(!1)},E.setDefaultOptions=e=>{Object(n.a)(E.currentOptions,e)},E.resetDefaultOptions=()=>{E.currentOptions=Object(n.a)({},E.defaultOptions)},E.Component=Object(t.a)(A),E.install=e=>{e.use(E.Component),e.config.globalProperties.$dialog=E}},"7a89":function(e,t,c){},"81d5":function(e,t,c){"use strict";var o=c("7b0b"),n=c("23cb"),a=c("50c4");e.exports=function(e){for(var t=o(this),c=a(t.length),l=arguments.length,i=n(1<l?arguments[1]:void 0,c),r=(l=2<l?arguments[2]:void 0,void 0===l?c:n(l,c));i<r;)t[i++]=e;return t}},"8c22":function(e,t,c){"use strict";c("5ac8")},a9e3:function(e,t,c){"use strict";function o(e){var t,c,o,n,a,l,i,r=u(e,!1);if("string"==typeof r&&2<r.length)if(43===(e=(r=h(r)).charCodeAt(0))||45===e){if(88===(t=r.charCodeAt(2))||120===t)return NaN}else if(48===e){switch(r.charCodeAt(1)){case 66:case 98:c=2,o=49;break;case 79:case 111:c=8,o=55;break;default:return+r}for(a=(n=r.slice(2)).length,l=0;l<a;l++)if((i=n.charCodeAt(l))<48||o<i)return NaN;return parseInt(n,c)}return+r}var n=c("83ab"),a=c("da84"),l=c("94ca"),i=c("6eeb"),r=c("5135"),s=c("c6b6"),d=c("7156"),u=c("c04e"),p=c("d039"),f=c("7c73"),m=c("241c").f,g=c("06cf").f,b=c("9bf2").f,h=c("58a8").trim,v="Number",O=a[v],j=O.prototype,S=s(f(j))==v;if(l(v,!O(" 0o1")||!O("0b1")||O("+0x1"))){for(var I,y=function(e){e=arguments.length<1?0:e;var t=this;return t instanceof y&&(S?p((function(){j.valueOf.call(t)})):s(t)!=v)?d(new O(o(e)),t,y):o(e)},C=n?m(O):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,fromString,range".split(","),k=0;C.length>k;k++)r(O,I=C[k])&&!r(y,I)&&b(y,I,g(O,I));(y.prototype=j).constructor=y,i(a,v,y)}},b3aa:function(e,t,c){"use strict";c("fee7")},cb29:function(e,t,c){var o=c("23e7"),n=c("81d5");c=c("44d2");o({target:"Array",proto:!0},{fill:n}),c("fill")},d4ef:function(e,t,c){},d916:function(e,t,c){e.exports={menuBg:"#fff",menuText:"#162b64",menuActiveText:"#435ebe"}},d961:function(e,t,c){"use strict";c.d(t,"a",(function(){return g}));t=c("c199");var o=c("7a23"),n=c("fe7e"),a=c("f344"),l=c("f691"),i=c("4a89"),r=c("d1ba"),s=c("1f4d"),d=c("4eda"),u=c("565f");const[p,f,m]=Object(n.a)("search");c=Object(a.a)({},r.b,{label:String,shape:Object(l.e)("square"),leftIcon:Object(l.e)("search"),clearable:l.g,actionText:String,background:String,showAction:Boolean}),n=Object(o.defineComponent)({name:p,props:c,emits:["blur","focus","clear","search","cancel","click-input","click-left-icon","click-right-icon","update:modelValue"],setup(e,{emit:t,slots:c,attrs:n}){const l=Object(s.a)(),p=Object(o.ref)(),g=()=>{c.action||(t("update:modelValue",""),t("cancel"))},b=c=>{13===c.keyCode&&(Object(i.e)(c),t("search",e.modelValue))},h=()=>e.id||l+"-input",v=e=>t("blur",e),O=e=>t("focus",e),j=e=>t("clear",e),S=e=>t("click-input",e),I=e=>t("click-left-icon",e),y=e=>t("click-right-icon",e),C=Object.keys(r.b);return Object(d.a)({focus:()=>{var e;return null==(e=p.value)?void 0:e.focus()},blur:()=>{var e;return null==(e=p.value)?void 0:e.blur()}}),()=>{var l;return Object(o.createVNode)("div",{class:f({"show-action":e.showAction}),style:{background:e.background}},[null==(l=c.left)?void 0:l.call(c),Object(o.createVNode)("div",{class:f("content",e.shape)},[(()=>{if(c.label||e.label)return Object(o.createVNode)("label",{class:f("label"),for:h()},[c.label?c.label():e.label])})(),(l=Object(a.a)({},n,Object(a.e)(e,C),{id:h()}),Object(o.createVNode)(u.a,Object(o.mergeProps)({ref:p,type:"search",class:f("field"),border:!1,onBlur:v,onFocus:O,onClear:j,onKeypress:b,"onClick-input":S,"onClick-left-icon":I,"onClick-right-icon":y,"onUpdate:modelValue":e=>t("update:modelValue",e)},l),Object(a.e)(c,["left-icon","right-icon"])))]),(()=>{var t;if(e.showAction)return t=e.actionText||m("cancel"),Object(o.createVNode)("div",{class:f("action"),role:"button",tabindex:0,onClick:g},[c.action?c.action():t])})()])}}});var g=Object(t.a)(n)},e108:function(e,t,c){"use strict";c("5c09")},e17f:function(e,t,c){"use strict";c("68ef"),c("d4ef"),c("cb51"),c("3743"),c("e3b3"),c("bc1b"),c("1703"),c("a71a"),c("4d75"),c("2fcb")},e4cb:function(e,t,c){"use strict";c("36e1")},f032:function(e,t,c){},fcad:function(e,t,c){"use strict";c("d916")},fee7:function(e,t,c){}}]);
|