You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
maotu-webtopo/webVue/assets/view_index-ed158ebd.js

2 lines
6.2 KiB
JavaScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import{d as E,aO as q,as as u,o as l,a as h,F as k,A as j,i as s,w as t,b as S,t as O,g as c,aQ as y,h as p,aR as D,p as f,a0 as z,aS as P,aC as $,_ as F,r as N,Z as Q,aT as A,x as B,aU as X,$ as Z,at as J,aV as K,aW as Y,P as ee,S as le,aX as te,q as ne}from"./index-9847718b.js";const ae={class:"main"},oe=["onClick"],ie={name:"doCreateMenu"},se=E({...ie,props:{menuList:{},isCollapse:{type:Boolean,default:!1}},setup(I){function v(r){console.log("routeName"),P.includes(r)&&$.emit("getStairRoute",r)}const d=q();function m(r){v(r.index),d.push({name:r.index,query:{screen:r.index}})}function b(r){v(r.name),d.push({name:r.name,query:{screen:r.name}})}return(r,M)=>{const i=u("el-icon"),n=u("el-menu-item"),g=u("menuDoCreateMenu",!0),x=u("el-sub-menu");return l(),h("div",ae,[(l(!0),h(k,null,j(I.menuList,e=>(l(),h(k,{key:e.path},[e.children?f("",!0):(l(),h(k,{key:0},[!e.children&&e.meta.hidden!==!0?(l(),s(n,{key:0,index:e.name,onClick:m},{title:t(()=>[S("span",null,O(e.meta.title),1)]),default:t(()=>[c(i,null,{default:t(()=>[e.meta.menuIcon?(l(),s(y(e.meta.menuIcon),{key:0})):(l(),s(y(p(D)),{key:1}))]),_:2},1024)]),_:2},1032,["index"])):f("",!0)],64)),e.children&&e.children.length===1?(l(),h(k,{key:1},[e.children&&e.children.length===1&&e.children[0].meta.hidden!==!0?(l(),s(n,{key:0,index:e.children[0].name,onClick:m},{title:t(()=>[S("span",null,O(e.children[0].meta.title),1)]),default:t(()=>[c(i,null,{default:t(()=>[e.meta.menuIcon?(l(),s(y(e.meta.menuIcon),{key:0})):(l(),s(y(p(D)),{key:1}))]),_:2},1024)]),_:2},1032,["index"])):f("",!0)],64)):f("",!0),e.children&&e.children.length>1&&e.children[0].name=="homeOverview"?(l(),h(k,{key:2},[e.children&&e.children.length>1&&e.children[0].meta.hidden!==!0?(l(),s(n,{key:0,index:e.children[0].name,onClick:m},{title:t(()=>[S("span",null,O(e.children[0].meta.title),1)]),default:t(()=>[c(i,null,{default:t(()=>[e.children[0].meta.menuIcon?(l(),s(y(e.children[0].meta.menuIcon),{key:0})):(l(),s(y(p(D)),{key:1}))]),_:2},1024)]),_:2},1032,["index"])):f("",!0)],64)):f("",!0),e.children&&e.children.length>1&&e.children[0].name!="homeOverview"?(l(),h(k,{key:3},[e.children&&e.children.length>1?(l(),s(x,{key:0,index:e.children[0].name},{title:t(()=>[c(i,null,{default:t(()=>[e.children[0].meta.menuIcon?(l(),s(y(e.children[0].meta.menuIcon),{key:0})):(l(),s(y(p(D)),{key:1}))]),_:2},1024),I.isCollapse?f("",!0):(l(),h("span",{key:0,onClick:z(C=>b(e.children[0]),["stop"])},O(e.children[0].meta.title),9,oe))]),default:t(()=>[c(g,{menuList:e.children},null,8,["menuList"])]),_:2},1032,["index"])):f("",!0)],64)):f("",!0)],64))),128))])}}}),ce=F(se,[["__scopeId","data-v-e2fcc64d"]]),re=E({__name:"menuIndex",props:{isCollapse:{type:Boolean,default:!1}},emits:["getMenuList"],setup(I,{emit:v}){let d=[];const m=N([]);function b(M,i){M.forEach(n=>{var g,x,e,C,o,_,a,w;if(!n.children&&!((g=n.meta)!=null&&g.bottomHidden)&&i.push({id:n.name,label:(x=n.meta)==null?void 0:x.title}),n.children&&((e=n.children)==null?void 0:e.length)===1&&!((C=n.meta)!=null&&C.bottomHidden)&&i.push({id:n.children[0].name,label:(o=n.children[0].meta)==null?void 0:o.title}),n.children&&((_=n.children)==null?void 0:_.length)>1&&!((a=n.meta)!=null&&a.bottomHidden)){const L={id:n.children[0].name,label:(w=n.children[0].meta)==null?void 0:w.title,children:[]};b(n.children,L.children),i.push(L)}})}const r=v;return Q(()=>{b(A.options.routes,d),m.value=Array.from(A.options.routes),r("getMenuList",d)}),(M,i)=>(l(),h("div",null,[c(ce,{menuList:m.value,"is-collapse":I.isCollapse},null,8,["menuList","is-collapse"])]))}}),de={class:"common-layout"},ue={class:"el-main-core"},he={key:0,class:"footer-navigation"},_e=E({__name:"view_index",setup(I){let v=[{id:"homeGlobalMessage",label:"全站报文"},{id:"homeExceedMessage",label:"越限信息"},{id:"homeExceptionFacility",label:"异常设备"},{id:"fireControlIndex",label:"消防系统"},{id:"securityIndex",label:"安全防范"},{id:"monitoringIndex",label:"在线监测"},{id:"waterSupply",label:"给排水系统"},{id:"environmentIndex",label:"环境监控"},{id:"lightingIndex",label:"照明控制"},{id:"testOverview",label:"智能锁控"},{id:"testOverview",label:"智能联动"}];const d=N(!1),m=N("20%");function b(){d.value=!d.value,m.value=d.value?"4%":"20%"}const r=q();function M(o){d.value=!0,m.value="4%",console.log("url:",o),r.push({name:o,query:{screen:o}})}let i=B([]);function n(o){i=o,console.log("父类拿到treeData:",i)}X(()=>i,o=>{console.log("treeData:",o)});let g=[],x=N();$.on("getStairRoute",o=>{console.log("楼梯路由11",o,i),x.value=o;const _=o;i&&i.length>0&&_&&i.forEach(a=>{if(a.id===_){if(a.children&&a.children.length>0&&_!="homeOverview"){g=[],a.children.forEach(w=>{g.push(w)}),console.log("buttonNames:",g),e.length=0,C(g,e),console.log("targetArr:",e);return}else if(a.children&&a.children.length>0&&_=="homeOverview"){e.length=0,Object.assign(e,v),console.log("targetArr:",e);return}if(!a.children&&a.id=="homeOverview"){e.length=0,Object.assign(e,v),console.log("targetArr:",e);return}}})});let e=B([]);Object.assign(e,v);function C(o,_){o.forEach(a=>{a.children&&a.children.length>0?C(a.children,_):_.push(a)})}return Z(()=>{$.off("getStairRoute")}),(o,_)=>{const a=u("el-icon"),w=u("el-menu"),L=u("el-scrollbar"),H=u("el-aside"),T=u("el-main"),V=u("el-container"),U=u("el-button"),G=u("el-footer"),W=J("loading");return l(),h("div",de,[c(V,null,{default:t(()=>[c(V,null,{default:t(()=>[(l(),s(H,{key:0,class:"el-aside",style:ee({width:m.value})},{default:t(()=>[S("div",{class:"toggle-button",onClick:b},[d.value?(l(),s(a,{key:1},{default:t(()=>[c(p(Y))]),_:1})):(l(),s(a,{key:0},{default:t(()=>[c(p(K))]),_:1}))]),c(L,{class:"el-scrollbar"},{default:t(()=>[c(w,{collapse:d.value,"collapse-transition":!1,"default-active":o.$route.name},{default:t(()=>[c(re,{"is-collapse":d.value,onGetMenuList:n},null,8,["is-collapse"])]),_:1},8,["collapse","default-active"])]),_:1})]),_:1},8,["style"])),le((l(),s(T,{class:"el-main"},{default:t(()=>[c(L,null,{default:t(()=>[S("div",ue,[c(p(te))])]),_:1})]),_:1})),[[W,!1]])]),_:1}),c(G,{class:"el-footer"},{default:t(()=>[p(e)&&p(e).length>0?(l(),h("div",he,[(l(!0),h(k,null,j(p(e),R=>(l(),s(U,{onClick:me=>M(R.id),key:R.id,plain:"",class:"nav-item flex-1"},{default:t(()=>[ne(O(R.label),1)]),_:2},1032,["onClick"]))),128))])):f("",!0)]),_:1})]),_:1})])}}}),pe=F(_e,[["__scopeId","data-v-65c426ec"]]);export{pe as default};