import w from"./DeviceInfo.17037962789732.js";import{D as E}from"./DeviceImage.1703796278973.js";import J from"./EnvironmentalCurve.1703796278973.js";import M from"./WarningInfo.1703796278973.js";import S from"./DeviceRuningStatus.1703796278973.js";import{x as $}from"./system.1703796278973.js";import{a as B,c as K}from"./instance.1703796278973.js";import{g as P}from"./utils.1703796278973.js";import{m as Q}from"./map.17037962789732.js";import{d as C,k as c,p as R,o as j,x as q,z as n,b as d,u as f,F as A}from"./vue.1703796278973.js";import{_ as F}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 L={class:"page-top"},O={class:"page-top-left"},T={style:{height:"230px",width:"100%","margin-top":"16px"}},W={class:"page-top-right"},z={class:"page-top-right-top"},X={class:"page-top-right-bottom"},G={class:"page-bottom"},H=C({name:"KQJC"}),U=C({...H,props:{ndata:{type:Object,default:()=>{}}},setup(_){const l=_,r=c(),i=c({}),u=c({}),k=async()=>{var s,o;const e=await B(l.ndata.deviceId);e.status===200&&(r.value=e.result,i.value=JSON.parse(((s=r.value)==null?void 0:s.metadata)||"{}"),i.value.properties&&i.value.properties.forEach(a=>{u.value[a.id]=a}),N(),((o=i.value)==null?void 0:o.properties.length)>0&&h(i.value.properties[0]))};R(()=>{k()});const V=c(),D=c([]),N=()=>{var o,a,m,p,v,I;const e=`instance-info-property-${(o=r.value)==null?void 0:o.id}-${(a=r.value)==null?void 0:a.productId}-${(m=i==null?void 0:i.value)==null?void 0:m.properties.map(t=>t.id).join("-")}`,s=`/dashboard/device/${(p=r.value)==null?void 0:p.productId}/properties/realTime`;V.value=(I=$(e,s,{deviceId:(v=r.value)==null?void 0:v.id,properties:D.value.map(t=>t.id),history:1}))==null?void 0:I.pipe(Q(t=>t.payload)).subscribe(t=>{var b,x,y;u.value[(b=t==null?void 0:t.value)==null?void 0:b.property]&&(u.value[(x=t==null?void 0:t.value)==null?void 0:x.property]={...u.value[(y=t==null?void 0:t.value)==null?void 0:y.property],...t})})},g=c({}),h=async e=>{var a;const s=P("week"),o=await K(((a=r.value)==null?void 0:a.id)+"",{columns:[{property:e.id,alias:e.id,agg:"MAX"}],query:{interval:"1d",format:"yyyy-MM-dd",from:s[0],to:s[1]}});if(o.status===200){const m=[];o.result.forEach(p=>{m.push([p.time,Number(p[e.id])])}),m.sort((p,v)=>p[0]>v[0]?1:-1),g.value={title:"近期环境曲线 - "+e.name,propertyName:e.name,data:m}}};return(e,s)=>{var o;return j(),q(A,null,[n("div",L,[n("div",O,[d(E,{typeId:1411,devIns:f(r)},null,8,["devIns"]),n("div",T,[d(w,{ndata:_.ndata},null,8,["ndata"])])]),n("div",W,[n("div",z,[d(S,{propertyValue:f(u),onPropertyClick:h},null,8,["propertyValue"])]),n("div",X,[d(J,{cdata:f(g)},null,8,["cdata"])])])]),n("div",G,[d(M,{deviceId:(o=l==null?void 0:l.ndata)==null?void 0:o.deviceId},null,8,["deviceId"])])],64)}}});const Tt=F(U,[["__scopeId","data-v-10cfb16b"]]);export{Tt as default};
