@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" />
89 lines (86 loc) • 3.37 kB
JavaScript
import __vite_glob_0_0 from './images/environment-light.png.mjs';
import __vite_glob_0_1 from './images/environment.png.mjs';
import __vite_glob_0_2 from './images/fireProtection-light.png.mjs';
import __vite_glob_0_3 from './images/fireProtection.png.mjs';
import __vite_glob_0_4 from './images/security-light.png.mjs';
import __vite_glob_0_5 from './images/security.png.mjs';
import __vite_glob_0_6 from './images/video-light.png.mjs';
import __vite_glob_0_7 from './images/video.png.mjs';
import { defineComponent, ref, onMounted, openBlock, createElementBlock, Fragment, renderList, createElementVNode, unref, toDisplayString, normalizeClass } from 'vue';
import requestControl from '../../service/request.mjs';
import { useThemeHook } from '../../../utils.mjs';
const _hoisted_1 = { class: "dv-ipes-operation-environment-monitor" };
const _hoisted_2 = ["src"];
const _hoisted_3 = { class: "label" };
const __default__ = {
name: "DvIpesOperationEnvironmentMonitor",
title: "运行环境监测"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
...__default__,
setup(__props) {
const { isDark } = useThemeHook();
const lits = [
{
name: "消防",
key: "fireProtection"
},
{
name: "安全",
key: "security"
},
{
name: "环保",
key: "environment"
},
{
name: "视频",
key: "video"
}
];
const info = ref({
fireProtection: "normal",
security: "normal",
environment: "normal",
video: "normal"
});
const getImg = (key, isDark2) => {
return new URL((/* #__PURE__ */ Object.assign({"./images/environment-light.png": __vite_glob_0_0,"./images/environment.png": __vite_glob_0_1,"./images/fireProtection-light.png": __vite_glob_0_2,"./images/fireProtection.png": __vite_glob_0_3,"./images/security-light.png": __vite_glob_0_4,"./images/security.png": __vite_glob_0_5,"./images/video-light.png": __vite_glob_0_6,"./images/video.png": __vite_glob_0_7}))[`./images/${key}${isDark2 ? "" : "-light"}.png`], self.location).href;
};
function getShowData(value) {
return value === "normal" ? "正常" : "异常";
}
async function getInfoData() {
try {
const res = await requestControl({
method: "get",
url: "/ipes-data-aggregation-server/api/v2/gis/public/panel/public-monitoring"
});
} catch (error) {
console.log(error);
}
}
onMounted(() => {
getInfoData();
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1, [
(openBlock(), createElementBlock(Fragment, null, renderList(lits, (item) => {
return createElementVNode("div", {
key: item.key,
class: "operation-box"
}, [
createElementVNode("img", {
src: getImg(item.key, unref(isDark))
}, null, 8, _hoisted_2),
createElementVNode("div", _hoisted_3, toDisplayString(item.name), 1),
createElementVNode("div", {
class: normalizeClass(["value", { abnormal: info.value[item.key] && info.value[item.key] === "abnormal" }])
}, toDisplayString(getShowData(info.value[item.key])), 3)
]);
}), 64))
]);
};
}
});
export { _sfc_main as default };