import w from"./DeviceInfo.17037962789732.js";import{D as k}from"./DeviceImage.1703796278973.js";import M from"./HumiditySensor.1703796278973.js";import N from"./TemperatureSensor.1703796278973.js";import W from"./EnvironmentalCurve.1703796278973.js";import E from"./WarningInfo.1703796278973.js";import{c as J,a as V}from"./instance.1703796278973.js";import{x as $}from"./system.1703796278973.js";import{g as B}from"./utils.1703796278973.js";import{m as C}from"./map.17037962789732.js";import{d as h,k as p,p as T,o as j,x as q,z as t,b as d,u as l,F}from"./vue.1703796278973.js";import{_ as L}from"./_plugin-vue_export-helper.1703796278973.js";import"./dev.1703796278973.js";import"./comm.1703796278973.js";import"./index.17037962789732.js";import"./index.17037962789733.js";import"./dayjs.min.1703796278973.js";import"./isArray.1703796278973.js";import"./editor.api.1703796278973.js";import"./preload-helper.1703796278973.js";import"./monaco.contribution.1703796278973.js";import"./index.170379627897332.js";import"./index.170379627897315.js";import"./index.170379627897333.js";import"./index.170379627897334.js";import"./default.1703796278973.js";import"./permission.1703796278973.js";import"./consts.1703796278973.js";import"./404.1703796278973.js";import"./index.1703796278973314.js";import"./index.1703796278973305.js";import"./index.170379627897317.js";import"./index.1703796278973301.js";import"./index.1703796278973302.js";import"./index.1703796278973303.js";import"./index.170379627897339.js";import"./index.170379627897316.js";import"./index.170379627897314.js";import"./index.1703796278973304.js";import"./index.170379627897335.js";import"./config.1703796278973.js";import"./log.17037962789732.js";import"./alarm.1703796278973.js";import"./WarningHandler.vue_vue_type_script_setup_true_lang.1703796278973.js";import"./index.170379627897337.js";import"./index.170379627897318.js";import"./index.170379627897319.js";import"./moment.1703796278973.js";const O={class:"page-top"},P={class:"page-top-left"},R={style:{height:"280px",width:"100%","margin-top":"16px"}},X={class:"page-top-right"},z={class:"page-top-right-top"},H={style:{flex:"1",height:"383px","margin-right":"16px"}},G={style:{flex:"1",height:"383px"}},K={style:{flex:"1",height:"439px","margin-top":"16px"}},Q={class:"page-bottom"},U=h({name:"WSJ"}),Y=h({...U,props:{ndata:{type:Object,default:()=>{}}},setup(f){const g=f,e=p(),s=p({}),x=p({}),b=async()=>{var a;const o=await V(g.ndata.deviceId);o.status===200&&(e.value=o.result,s.value=JSON.parse(((a=e.value)==null?void 0:a.metadata)||"{}"),s.value.properties&&s.value.properties.forEach(r=>{x.value[r.id]=r}))};T(async()=>{await b(),D(),A()});const I=p(),S=p([]),u=p({name:"AAA"}),D=()=>{var r,m,c,n,y,_;const o=`instance-info-property-${(r=e.value)==null?void 0:r.id}-${(m=e.value)==null?void 0:m.productId}-${(c=s==null?void 0:s.value)==null?void 0:c.properties.map(i=>i.id).join("-")}`,a=`/dashboard/device/${(n=e.value)==null?void 0:n.productId}/properties/realTime`;I.value=(_=$(o,a,{deviceId:(y=e.value)==null?void 0:y.id,properties:S.value.map(i=>i.id),history:1}))==null?void 0:_.pipe(C(i=>i.payload)).subscribe(i=>{u.value=i})},v=p({}),A=async()=>{var r;const o=B("week"),a=await J(((r=e.value)==null?void 0:r.id)+"",{columns:[{property:"temperature",alias:"temperature",agg:"MAX"},{property:"humidity",alias:"humidity",agg:"MAX"}],query:{interval:"1d",format:"yyyy-MM-dd",from:o[0],to:o[1]}});if(a.status===200){const m=[{name:"温度",code:"temperature",data:[]},{name:"湿度",code:"humidity",data:[],type:"line",smooth:.6,symbol:"none",areaStyle:{colorList:["rgba(84, 255, 159, 0.8)","rgba(217, 217, 217, 0)"]},lineStyle:{width:2}}],c={data:[]};a.result.forEach(n=>{m[0].data.unshift(Number(n.temperature)),m[1].data.unshift(Number(n.humidity)),c.data.unshift(n.time)}),v.value={title:"近期环境曲线",series:m,xAxis:c,legend:["温度","湿度"],data:null}}};return(o,a)=>(j(),q(F,null,[t("div",O,[t("div",P,[d(k,{typeId:1421,devIns:l(e)},null,8,["devIns"]),t("div",R,[d(w,{ndata:f.ndata},null,8,["ndata"])])]),t("div",X,[t("div",z,[t("div",H,[d(M,{propertyData:l(u)},null,8,["propertyData"])]),t("div",G,[d(N,{propertyData:l(u)},null,8,["propertyData"])])]),t("div",K,[d(W,{cdata:l(v)},null,8,["cdata"])])])]),t("div",Q,[d(E)])],64))}});const Ht=L(Y,[["__scopeId","data-v-e3d2bfa3"]]);export{Ht as default};
