Files
aiot-platform-ui/apps/web-antd/dist/js/device-count-card-D-ByBxJQ.js
lzh 64681a9d55
Some checks failed
Web UI CI/CD / build-and-deploy (push) Has been cancelled
chore: build and deploy web-antd
2025-12-28 01:40:21 +08:00

2 lines
1.5 KiB
JavaScript

var m=(o,e,a)=>new Promise((d,s)=>{var r=t=>{try{n(a.next(t))}catch(l){s(l)}},c=t=>{try{n(a.throw(t))}catch(l){s(l)}},n=t=>t.done?d(t.value):Promise.resolve(t.value).then(r,c);n((a=a.apply(o,e)).next())});import{a as h}from"./chart-options-xTjDO5fl.js";import{u as v,_}from"./use-echarts-Nol39igS.js";import{bE as C,au as D,ac as g}from"./bootstrap-DZnIDovD.js";import{m as y,b9 as x,aa as k,w as b,v as w,ab as j,b2 as i,bJ as E,ad as f,j as p,u,n as B}from"../jse/index-index-DaIpbNAe.js";const O={key:0,class:"flex h-[300px] items-center justify-center"},R={key:1,class:"flex h-[300px] items-center justify-center"},I={key:2},J=y({name:"DeviceCountCard",__name:"device-count-card",props:{loading:{type:Boolean},statsData:{}},setup(o){const e=o,a=x(),{renderEcharts:d}=v(a),s=k(()=>e.statsData?Object.entries(e.statsData.productCategoryDeviceCounts||{}).length>0&&e.statsData.deviceCount!==0:!1);function r(){return m(this,null,function*(){if(!s.value)return;yield B();const c=Object.entries(e.statsData.productCategoryDeviceCounts).map(([n,t])=>({name:n,value:t}));yield d(h(c))})}return b(()=>e.statsData,()=>{r()},{deep:!0}),w(()=>{r()}),(c,n)=>(i(),j(u(D),{title:"设备数量统计",loading:o.loading,class:"h-full"},{default:E(()=>[o.loading&&!s.value?(i(),f("div",O,[p(u(C),{description:"加载中..."})])):s.value?(i(),f("div",I,[p(u(_),{ref_key:"deviceCountChartRef",ref:a,class:"h-[400px] w-full"},null,512)])):(i(),f("div",R,[p(u(C),{description:"暂无数据"})]))]),_:1},8,["loading"]))}}),$=g(J,[["__scopeId","data-v-48851095"]]);export{$ as default};