| 1 |
- import{I as C}from"./index-ff835fad.js";import{P as O,B as P}from"./index-3572efc1.js";/* empty css */import{S as B}from"./index-ccc543e3.js";import{C as V}from"./index-9645362a.js";import{d as F,r as d,o as J,b as u,e as v,f as o,c as r,L as R,h,u as T,t as p,F as E,k as L,n as M,y as z}from"./index-3383364a.js";import{p as b}from"./index-cc4d5747.js";import{_ as D}from"./CusNavigation-0f5ab82a.js";import{t as A}from"./index-9c8b4e4e.js";import{s as U}from"./function-call-40112d3e.js";import"./index-924210d5.js";import"./use-expose-0933a92c.js";import"./on-popup-reopen-c4f039c8.js";import"./axios-9cbf0d09.js";import"./index-62b3a6c4.js";const q={style:{display:"flex","flex-direction":"column",height:"100vh"}},G={style:{padding:"10px"}},H={class:"container",style:{"overflow-y":"auto","flex-grow":"1","background-color":"#F7F8FA"}},K={style:{"text-align":"left"}},Q={style:{display:"flex","justify-content":"space-between","margin-bottom":"5px"}},W={style:{color:"#000","font-weight":"bold","font-size":"1.1rem"}},X=o("div",{style:{"font-size":"0.9rem"}},"设备编号",-1),Y={style:{display:"flex","justify-content":"space-between"}},Z={style:{"font-weight":"bold","font-size":"0.9rem",height:"31px"}},$={style:{"text-align":"left"}},ee={style:{display:"flex","justify-content":"space-between","margin-bottom":"5px"}},oe={style:{color:"#000","font-weight":"bold","font-size":"1.1rem"}},te={key:0,style:{"margin-left":"5px"}},se=o("span",null,"(",-1),ne=o("span",null,")",-1),ae={style:{"font-size":"0.9rem"}},le={style:{display:"flex","justify-content":"space-between"}},ie={style:{"font-weight":"bold","font-size":"0.9rem"}},re={style:{display:"flex",color:"#000"}},ce=o("div",{style:{"margin-left":"3px","font-size":"1rem"}},"查看数据",-1),de={key:0},ue={key:1,style:{"text-align":"center",padding:"20px",color:"#ccc"}},pe=o("span",null,"暂无数据",-1),me=[pe],Oe=F({__name:"Index",setup(_e){const j=e=>{console.log("jjj"),console.log(e),y.value=e,k()},m=d(!1),S=()=>{console.log("onrefresh..."),console.log(m.value),w(),m.value=!1},i=d(),c=d(),_=d([]),I=e=>{var a;const t=(a=c.value)==null?void 0:a.model;for(let n=0;n<t.length;n++){const l=t[n];if(e==l.title)return l}},y=d(""),k=function(){var t,a;console.log((t=c.value)==null?void 0:t.model),_.value=[];const e=(a=i.value)==null?void 0:a.data;for(const n in e){const l=I(n);if(Object.prototype.hasOwnProperty.call(e,n)&&l){const g=e[n],f={name:l.name,value:g.value,date:A(g.time),model:l};y.value?JSON.stringify(f).includes(y.value)&&_.value.push(f):_.value.push(f)}}},w=async()=>{await b({url:"/device/search",data:{size:200,page:1,sort:"createtime",order:"desc",keyWord:x.value}}).then(e=>e.data[0].data?(i.value=e.data[0],i.value.data=JSON.parse(e.data[0].data),console.log(i.value),Promise.resolve(i.value)):(i.value={data:[]},Promise.reject("ok"))).then(e=>(console.log(e.productId),c.value?(console.log("else..........."),Promise.reject("ok")):(c.value={id:"",name:e.productName,model:[]},b({url:"/model/search",data:{size:200,page:1,sort:"code",order:"asc",productId:e.productId}})))).then(e=>(console.log(e),e.data.forEach(t=>{t.define=JSON.parse(t.define),c.value.model.push(t)}),b({url:"/model/searchCommon",data:{size:200,page:1,sort:"code",order:"asc"}}))).then(e=>{console.log(e),e.data.forEach(t=>{t.define=JSON.parse(t.define),c.value.model.push(t)})}).catch(e=>{e!="ok"&&(console.log(e),U(e))}),k()},N=T(),x=d("");return J(()=>{console.log("deviceDetail onMounted"),x.value=N.currentRoute.value.params.deviceId,w()}),(e,t)=>{const a=V,n=B,l=C,g=O,f=P;return u(),v("div",q,[o("div",G,[r(R(D),{gobackabled:"",title:"设备详情",searchabled:"",onOnSearch:j})]),o("div",H,[r(g,{style:{"min-height":"100%"},modelValue:m.value,"onUpdate:modelValue":t[0]||(t[0]=s=>m.value=s),onRefresh:S},{default:h(()=>[r(n,{style:{"background-color":"#fff","margin-bottom":"10px"}},{default:h(()=>[r(a,{clickable:""},{default:h(()=>{var s;return[o("div",K,[o("div",Q,[o("div",W,[o("span",null,p(x.value),1)]),X]),o("div",Y,[o("div",Z,[o("span",null,p((s=i.value)==null?void 0:s.modifytime),1)])])])]}),_:1})]),_:1}),(u(!0),v(E,null,L(_.value,s=>(u(),M(n,{style:{"background-color":"#fff","margin-bottom":"10px"}},{default:h(()=>[r(a,{clickable:""},{default:h(()=>[o("div",$,[o("div",ee,[o("div",oe,[o("span",null,p(s.value),1),s.model.type=="enum"?(u(),v("span",te,[se,o("span",null,p(s.model.define.range[s.value]),1),ne])):z("",!0)]),o("div",ae,p(s.name),1)]),o("div",le,[o("div",ie,[o("span",null,p(s.date),1)]),o("div",re,[o("div",null,[r(l,{name:"static/images/icon-check.png",size:"1.5rem"})]),ce])])])]),_:2},1024)]),_:2},1024))),256)),o("div",null,[m.value?(u(),v("div",de)):_.value.length==0?(u(),v("div",ue,me)):z("",!0)])]),_:1},8,["modelValue"]),r(f,{target:".container",right:"5vw",bottom:"80px"})])])}}});export{Oe as default};
|