@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" />
87 lines (82 loc) • 3.35 kB
JavaScript
'use strict';
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
const vue = require('vue');
const elementPlusExpand = require('@ued_fpi/element-plus-expand');
const request = require('../../service/request.js');
const hooks = require('../../utils/hooks.js');
const _hoisted_1 = { class: "dv-ipes-waste-gas" };
const _hoisted_2 = /* @__PURE__ */ vue.createElementVNode("div", { class: "gas-title flex" }, [
/* @__PURE__ */ vue.createElementVNode("span", null, "污染物"),
/* @__PURE__ */ vue.createElementVNode("span", null, "排放量/允许排放量")
], -1);
const _hoisted_3 = { class: "top" };
const _hoisted_4 = { class: "name" };
const _hoisted_5 = { class: "number" };
const _hoisted_6 = /* @__PURE__ */ vue.createElementVNode("div", { class: "divider" }, " / ", -1);
const _hoisted_7 = { class: "count" };
const _hoisted_8 = { class: "porgress" };
const __default__ = {
name: "DvIpesWasteGas",
title: "废气排放"
};
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
...__default__,
setup(__props) {
const factorList = vue.ref([]);
async function getData() {
try {
const { data } = await request.default({
method: "get",
url: "/ipes-data-aggregation-server/api/v1/env-protection/discharge"
});
const water = data.find((e) => e.name === "年度废气排放量");
if (water && water.factorList)
factorList.value = water.factorList;
} catch (error) {
console.log(error);
}
}
vue.onMounted(() => {
getData();
});
hooks.setIntervalData(getData, 5 * 60 * 1e3);
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
_hoisted_2,
vue.createVNode(vue.unref(elementPlusExpand.FpiElRolling), {
class: "box",
direction: "y",
time: 15
}, {
default: vue.withCtx(() => [
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(factorList), (item, index) => {
return vue.openBlock(), vue.createElementBlock("div", {
key: index,
class: "list"
}, [
vue.createElementVNode("div", _hoisted_3, [
vue.createElementVNode("div", _hoisted_4, vue.toDisplayString(item.factorName), 1),
vue.createElementVNode("div", _hoisted_5, [
vue.createElementVNode("div", {
class: vue.normalizeClass(["value", { over: item.exceed }])
}, vue.toDisplayString(item.factorValue), 3),
_hoisted_6,
vue.createElementVNode("div", _hoisted_7, vue.toDisplayString(item.targetValue), 1)
])
]),
vue.createElementVNode("div", _hoisted_8, [
vue.createElementVNode("div", {
class: vue.normalizeClass(["percent", { over: item.exceed }]),
style: vue.normalizeStyle({ width: item.percent > 100 ? "100%" : `${item.percent}%` })
}, null, 6)
])
]);
}), 128))
]),
_: 1
})
]);
};
}
});
exports.default = _sfc_main;