UNPKG

@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" />

88 lines (85 loc) 3.33 kB
import __vite_glob_0_0 from './images/bg-light.png.mjs'; import __vite_glob_0_1 from './images/bg.png.mjs'; import { defineComponent, ref, onMounted, openBlock, createElementBlock, createElementVNode, unref, toDisplayString } from 'vue'; import requestControl from '../../service/request.mjs'; import { useThemeHook } from '../../../utils.mjs'; import { setIntervalData } from '../../utils/hooks.mjs'; const _hoisted_1 = { class: "dv-ipes-major-risk" }; const _hoisted_2 = { class: "risk-box" }; const _hoisted_3 = ["src"]; const _hoisted_4 = { class: "info" }; const _hoisted_5 = /* @__PURE__ */ createElementVNode("div", { class: "label" }, " 未销警数量 ", -1); const _hoisted_6 = { class: "value" }; const _hoisted_7 = { class: "number" }; const _hoisted_8 = /* @__PURE__ */ createElementVNode("span", { class: "unit" }, "个", -1); const _hoisted_9 = { class: "risk-box" }; const _hoisted_10 = ["src"]; const _hoisted_11 = { class: "info" }; const _hoisted_12 = /* @__PURE__ */ createElementVNode("div", { class: "label" }, " 年度预警数量 ", -1); const _hoisted_13 = { class: "value" }; const _hoisted_14 = { class: "number" }; const _hoisted_15 = /* @__PURE__ */ createElementVNode("span", { class: "unit" }, "个", -1); const __default__ = { name: "DvIpesMajorRiskManagement", title: "重大风险管控" }; const _sfc_main = /* @__PURE__ */ defineComponent({ ...__default__, setup(__props) { const { isDark } = useThemeHook(); const info = ref({ notRecovery: 0, yearCount: 0 }); const getImg = (isDark2) => { return new URL((/* #__PURE__ */ Object.assign({"./images/bg-light.png": __vite_glob_0_0,"./images/bg.png": __vite_glob_0_1}))[`./images/bg${isDark2 ? "" : "-light"}.png`], self.location).href; }; async function getInfoData() { try { const res = await requestControl({ method: "get", url: "/ipes-srip-server/api/v3/gis/panel/hazard-control" }); info.value = res?.data || {}; } catch (error) { console.log(error); } } function getShowData(value) { return value == null ? "0" : value; } onMounted(() => { getInfoData(); }); setIntervalData(getInfoData, 5 * 60 * 1e3); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", _hoisted_1, [ createElementVNode("div", _hoisted_2, [ createElementVNode("img", { src: getImg(unref(isDark)) }, null, 8, _hoisted_3), createElementVNode("div", _hoisted_4, [ _hoisted_5, createElementVNode("div", _hoisted_6, [ createElementVNode("span", _hoisted_7, toDisplayString(getShowData(info.value.notRecovery)), 1), _hoisted_8 ]) ]) ]), createElementVNode("div", _hoisted_9, [ createElementVNode("img", { src: getImg(unref(isDark)) }, null, 8, _hoisted_10), createElementVNode("div", _hoisted_11, [ _hoisted_12, createElementVNode("div", _hoisted_13, [ createElementVNode("span", _hoisted_14, toDisplayString(getShowData(info.value.yearCount)), 1), _hoisted_15 ]) ]) ]) ]); }; } }); export { _sfc_main as default };