@ued_fpi/data-visual
Version:
<br /> <br /> <div style="text-align:center"> <b style="font-size:30px">@ued_fpi/data-visual</b> <p>基于Vite4+TypeScript的Vue3大屏组件库开发框架</p> <img style="display:inline" src="https://img.shields.io/npm/v/@ued_fpi/data-visual" />
66 lines (63 loc) • 2.12 kB
JavaScript
import { defineComponent, ref, openBlock, createElementBlock, createElementVNode, Fragment, renderList, toDisplayString, normalizeStyle } from 'vue';
import requestControl from '../../service/request.mjs';
const _hoisted_1 = { class: "dv-ipes-air-quality" };
const _hoisted_2 = { class: "year-air-quality" };
const _hoisted_3 = { class: "row-body1" };
const _hoisted_4 = { class: "row-body3" };
const __default__ = {
name: "DvIpesAirQuality",
title: "空气质量"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
...__default__,
props: {
width: { default: "100%" },
height: { default: 96 }
},
setup(__props) {
const factorList = ref([]);
async function getAqmsManage() {
try {
const res = await requestControl({
method: "get",
url: "/ipes-monitor-server/api/v2/special-analysis/aqms/area-aqi-real-data"
});
const {
factor
} = res.data;
factorList.value = factor.map((item) => {
const { NAME, color, factorValue, UNIT } = item;
return {
NAME,
factorValue,
UNIT,
color
};
});
} catch (error) {
console.log(error);
}
}
getAqmsManage();
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1, [
createElementVNode("div", _hoisted_2, [
(openBlock(true), createElementBlock(Fragment, null, renderList(factorList.value, (item, index) => {
return openBlock(), createElementBlock("div", {
key: index,
class: "table-col-body"
}, [
createElementVNode("div", _hoisted_3, toDisplayString(item.NAME), 1),
createElementVNode("div", {
class: "row-body2",
style: normalizeStyle({ color: item.color })
}, toDisplayString(item.factorValue), 5),
createElementVNode("div", _hoisted_4, toDisplayString(item.UNIT), 1)
]);
}), 128))
])
]);
};
}
});
export { _sfc_main as default };