import A from"./DeviceInfo.17037962789732.js";import{D as T}from"./DeviceImage.1703796278973.js";import k from"./HumiditySensor.1703796278973.js";import w from"./TemperatureSensor.1703796278973.js";import N from"./EnvironmentalCurve.1703796278973.js";import E from"./WarningInfo.1703796278973.js";import J from"./DeviceStatus.1703796278973.js";import V from"./DeviceWarning.1703796278973.js";import{c as $,a as B}from"./instance.1703796278973.js";import{x as C}from"./system.1703796278973.js";import{g as K}from"./utils.1703796278973.js";import{m as W}from"./map.17037962789732.js";import{d as g,k as p,p as j,o as q,x as F,z as t,b as i,u as l,F as L}from"./vue.1703796278973.js";import{_ as O}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 P={class:"page-top"},R={class:"page-top-left"},X={class:"page-top-right"},z={class:"page-top-right-left"},H={class:"page-top-right-left-top"},G={style:{flex:"1",height:"283px","margin-right":"16px"}},Q={style:{flex:"1",height:"283px"}},U={style:{flex:"1",height:"242px","margin-top":"16px"}},Y={class:"page-top-right-right"},Z={class:"page-middle"},tt={class:"page-middle-left"},et={class:"page-middle-right"},ot={class:"page-bottom"},at=g({name:"JMKT"}),rt=g({...at,props:{ndata:{type:Object,default:()=>{}}},setup(f){const y=f,e=p(),m=p({}),b=p({}),x=async()=>{var a;const o=await B(y.ndata.deviceId);o.status===200&&(e.value=o.result,m.value=JSON.parse(((a=e.value)==null?void 0:a.metadata)||"{}"),m.value.properties&&m.value.properties.forEach(r=>{b.value[r.id]=r}))};j(async()=>{await x(),M(),S()});const I=p(),D=p([]),u=p({name:"AAA"}),M=()=>{var r,n,c,d,_,h;const o=`instance-info-property-${(r=e.value)==null?void 0:r.id}-${(n=e.value)==null?void 0:n.productId}-${(c=m==null?void 0:m.value)==null?void 0:c.properties.map(s=>s.id).join("-")}`,a=`/dashboard/device/${(d=e.value)==null?void 0:d.productId}/properties/realTime`;I.value=(h=C(o,a,{deviceId:(_=e.value)==null?void 0:_.id,properties:D.value.map(s=>s.id),history:1}))==null?void 0:h.pipe(W(s=>s.payload)).subscribe(s=>{u.value=s})},v=p({}),S=async()=>{var r;const o=K("week"),a=await $(((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 n=[{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(d=>{n[0].data.unshift(Number(d.temperature)),n[1].data.unshift(Number(d.humidity)),c.data.unshift(d.time)}),v.value={title:"近期环境曲线",series:n,xAxis:c,legend:["温度","湿度"],data:null}}};return(o,a)=>(q(),F(L,null,[t("div",P,[t("div",R,[i(T,{typeId:1921,devIns:l(e)},null,8,["devIns"])]),t("div",X,[t("div",z,[t("div",H,[t("div",G,[i(k,{propertyData:l(u)},null,8,["propertyData"])]),t("div",Q,[i(w,{propertyData:l(u)},null,8,["propertyData"])])]),t("div",U,[i(N,{cdata:l(v)},null,8,["cdata"])])]),t("div",Y,[i(J)])])]),t("div",Z,[t("div",tt,[i(A,{ndata:f.ndata},null,8,["ndata"])]),t("div",et,[i(V)])]),t("div",ot,[i(E)])],64))}});const ee=O(rt,[["__scopeId","data-v-8db93fb5"]]);export{ee as default};
