@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" />
153 lines (148 loc) • 6.33 kB
JavaScript
'use strict';
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
const bgLight = require('./images/bg-light.png.js');
const bg = require('./images/bg.png.js');
const enterLight = require('./images/enter-light.png.js');
const enter = require('./images/enter.png.js');
const leaveLight = require('./images/leave-light.png.js');
const leave = require('./images/leave.png.js');
const onParkNumBg = require('./images/onParkNum-bg.png.js');
const vue = require('vue');
const request = require('../../service/request.js');
const utils = require('../../../utils.js');
const hooks = require('../../utils/hooks.js');
const _hoisted_1 = { class: "dv-ipes-transport-vehicle" };
const _hoisted_2 = { class: "vehicle-box" };
const _hoisted_3 = { class: "park" };
const _hoisted_4 = /* @__PURE__ */ vue.createElementVNode("div", { class: "name" }, " 园内危化品车 ", -1);
const _hoisted_5 = { class: "value" };
const _hoisted_6 = { class: "car-right" };
const _hoisted_7 = { class: "leave" };
const _hoisted_8 = { class: "label" };
const _hoisted_9 = ["src"];
const _hoisted_10 = { class: "value" };
const _hoisted_11 = /* @__PURE__ */ vue.createElementVNode("div", { class: "name" }, " 今日入园 ", -1);
const _hoisted_12 = { class: "num carIn" };
const _hoisted_13 = { class: "enter" };
const _hoisted_14 = { class: "label" };
const _hoisted_15 = ["src"];
const _hoisted_16 = { class: "value" };
const _hoisted_17 = /* @__PURE__ */ vue.createElementVNode("div", { class: "name" }, " 今日出园 ", -1);
const _hoisted_18 = { class: "num" };
const _hoisted_19 = /* @__PURE__ */ vue.createElementVNode("div", { class: "forewarning" }, [
/* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, " 车辆违规报警 ")
], -1);
const _hoisted_20 = { class: "month-num" };
const _hoisted_21 = /* @__PURE__ */ vue.createElementVNode("div", { class: "label" }, " 今日报警 ", -1);
const _hoisted_22 = { class: "value" };
const _hoisted_23 = { class: "bottom-panel" };
const _hoisted_24 = { class: "title" };
const _hoisted_25 = { class: "value" };
const __default__ = {
name: "DvIpesTransportVehicleManagement",
title: "危化品运输车辆管理"
};
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
...__default__,
setup(__props) {
const { isDark } = utils.useThemeHook();
const getImg = (key) => {
return new URL((/* #__PURE__ */ Object.assign({"./images/bg-light.png": bgLight.default,"./images/bg.png": bg.default,"./images/enter-light.png": enterLight.default,"./images/enter.png": enter.default,"./images/leave-light.png": leaveLight.default,"./images/leave.png": leave.default,"./images/onParkNum-bg.png": onParkNumBg.default}))[`./images/${key}.png`], self.location).href;
};
const countData = vue.ref({
carIn: 0,
// 本月入园
carOut: 0,
// 本月出园
onParkNum: 0,
// 园内车辆
alarmNum: 0,
// 本月预警
alarmMom: 0,
// 预警环比
overSpeed: 0,
// 车辆超速
illegalStay: 0,
// 违规停留
offRoute: 0,
// 偏离路线
forbiddenPeriod: 0
// 禁行时段
});
const commitmentInfos = vue.ref([
{ title: "超速行驶", key: "overSpeed" },
{ title: "违规停留", key: "illegalStay" },
{ title: "禁行时段", key: "forbiddenPeriod" },
{ title: "车道偏离", key: "offRoute" }
]);
async function getData() {
try {
const res = await request.default({
method: "get",
url: "/ipes-pcip-server/api/v2/gis/stat-chemical-car"
});
countData.value = res?.data ?? {};
} catch (error) {
console.log(error);
}
}
function getShowData(value) {
return value == null ? "0" : value;
}
vue.onMounted(() => {
getData();
});
hooks.setIntervalData(getData);
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
vue.createElementVNode("div", _hoisted_2, [
vue.createElementVNode("div", _hoisted_3, [
_hoisted_4,
vue.createElementVNode("div", _hoisted_5, vue.toDisplayString(getShowData(countData.value.onParkNum)), 1)
]),
vue.createElementVNode("div", _hoisted_6, [
vue.createElementVNode("div", _hoisted_7, [
vue.createElementVNode("div", _hoisted_8, [
vue.createElementVNode("img", {
src: getImg(vue.unref(isDark) ? "enter" : "enter-light")
}, null, 8, _hoisted_9)
]),
vue.createElementVNode("div", _hoisted_10, [
_hoisted_11,
vue.createElementVNode("div", _hoisted_12, vue.toDisplayString(getShowData(countData.value.carIn)), 1)
])
]),
vue.createElementVNode("div", _hoisted_13, [
vue.createElementVNode("div", _hoisted_14, [
vue.createElementVNode("img", {
src: getImg(vue.unref(isDark) ? "leave" : "leave-light")
}, null, 8, _hoisted_15)
]),
vue.createElementVNode("div", _hoisted_16, [
_hoisted_17,
vue.createElementVNode("div", _hoisted_18, vue.toDisplayString(getShowData(countData.value.carOut)), 1)
])
])
])
]),
_hoisted_19,
vue.createElementVNode("div", _hoisted_20, [
_hoisted_21,
vue.createElementVNode("div", _hoisted_22, vue.toDisplayString(getShowData(countData.value.alarmNum)), 1)
]),
vue.createElementVNode("div", _hoisted_23, [
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(commitmentInfos.value, (item) => {
return vue.openBlock(), vue.createElementBlock("div", {
key: item.key,
class: vue.normalizeClass(["row", item.key])
}, [
vue.createElementVNode("div", _hoisted_24, vue.toDisplayString(item.title), 1),
vue.createElementVNode("div", _hoisted_25, vue.toDisplayString(getShowData(countData.value[item.key])), 1)
], 2);
}), 128))
])
]);
};
}
});
exports.default = _sfc_main;