@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" />
171 lines (168 loc) • 7.17 kB
JavaScript
import __vite_glob_0_0 from './images/abnormal-light.png.mjs';
import __vite_glob_0_1 from './images/abnormal.png.mjs';
import __vite_glob_0_2 from './images/bg-light.png.mjs';
import __vite_glob_0_3 from './images/bg.png.mjs';
import __vite_glob_0_4 from './images/enter-light.png.mjs';
import __vite_glob_0_5 from './images/enter.png.mjs';
import __vite_glob_0_6 from './images/leave-light.png.mjs';
import __vite_glob_0_7 from './images/leave.png.mjs';
import __vite_glob_0_8 from './images/locator-light.png.mjs';
import __vite_glob_0_9 from './images/locator.png.mjs';
import { defineComponent, ref, onMounted, openBlock, createElementBlock, createElementVNode, toDisplayString, createCommentVNode, Fragment, renderList, normalizeClass, unref } 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-vehicle-passage" };
const _hoisted_2 = {
key: 0,
class: "list"
};
const _hoisted_3 = { class: "box enter" };
const _hoisted_4 = { class: "value" };
const _hoisted_5 = /* @__PURE__ */ createElementVNode("div", { class: "name" }, " 今日入园 ", -1);
const _hoisted_6 = { class: "box leave" };
const _hoisted_7 = { class: "value" };
const _hoisted_8 = /* @__PURE__ */ createElementVNode("div", { class: "name" }, " 今日出园 ", -1);
const _hoisted_9 = {
key: 1,
class: "man-analysis"
};
const _hoisted_10 = { class: "personnel" };
const _hoisted_11 = /* @__PURE__ */ createElementVNode("div", { class: "label" }, " 入园车辆 ", -1);
const _hoisted_12 = { class: "number" };
const _hoisted_13 = /* @__PURE__ */ createElementVNode("div", { class: "divider" }, null, -1);
const _hoisted_14 = { class: "data-box" };
const _hoisted_15 = { class: "title" };
const _hoisted_16 = { class: "value" };
const _hoisted_17 = {
key: 2,
class: "bottom-panel"
};
const _hoisted_18 = { class: "locator" };
const _hoisted_19 = ["src"];
const _hoisted_20 = { class: "count" };
const _hoisted_21 = /* @__PURE__ */ createElementVNode("div", { class: "label" }, " 定位车辆 ", -1);
const _hoisted_22 = { class: "value" };
const _hoisted_23 = { class: "abnormal" };
const _hoisted_24 = ["src"];
const _hoisted_25 = { class: "count" };
const _hoisted_26 = /* @__PURE__ */ createElementVNode("div", { class: "label" }, " 异常车辆 ", -1);
const _hoisted_27 = { class: "value" };
const __default__ = {
name: "DvIpesVehiclePassage",
title: "车辆通行"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
...__default__,
props: {
showParkStatistics: { type: Boolean, default: true },
showParkInData: { type: Boolean, default: true },
showAbnormalData: { type: Boolean, default: true }
},
setup(__props) {
const props = __props;
const { isDark } = useThemeHook();
const getImg = (isDark2, key) => {
return new URL((/* #__PURE__ */ Object.assign({"./images/abnormal-light.png": __vite_glob_0_0,"./images/abnormal.png": __vite_glob_0_1,"./images/bg-light.png": __vite_glob_0_2,"./images/bg.png": __vite_glob_0_3,"./images/enter-light.png": __vite_glob_0_4,"./images/enter.png": __vite_glob_0_5,"./images/leave-light.png": __vite_glob_0_6,"./images/leave.png": __vite_glob_0_7,"./images/locator-light.png": __vite_glob_0_8,"./images/locator.png": __vite_glob_0_9}))[`./images/${key}${isDark2 ? "" : "-light"}.png`], self.location).href;
};
const countData = ref({
carTodayIn: null,
// 入园数量
carTodayOut: null,
// 出园数量
onParkNum: null,
// 园内车辆
gpsCar: null,
// 定位车辆
abnormalCar: null,
// 异常车辆
fixCar: null,
// 固定车
appointCar: null,
// 预约车
tempCar: null,
// 临时车
other: null
// 其他车
});
const commitmentInfos = ref([
{ title: "固定车", key: "fixCar" },
{ title: "临时车", key: "tempCar" },
{ title: "预约车", key: "appointCar" },
{ title: "其他车", key: "other" }
]);
let isInit = false;
async function getData() {
try {
const res = await requestControl({
method: "get",
url: "/ipes-pcip-server/api/v2/gis/stat-flow-car"
});
isInit = true;
countData.value = res?.data ?? {};
} catch (error) {
console.log(error);
}
}
function getShowData(value) {
return value === null && isInit ? "0" : value;
}
onMounted(() => {
getData();
});
setIntervalData(getData);
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1, [
props.showParkStatistics ? (openBlock(), createElementBlock("div", _hoisted_2, [
createElementVNode("div", _hoisted_3, [
createElementVNode("div", _hoisted_4, toDisplayString(getShowData(countData.value.carTodayIn)), 1),
_hoisted_5
]),
createElementVNode("div", _hoisted_6, [
createElementVNode("div", _hoisted_7, toDisplayString(getShowData(countData.value.carTodayOut)), 1),
_hoisted_8
])
])) : createCommentVNode("", true),
props.showParkInData ? (openBlock(), createElementBlock("div", _hoisted_9, [
createElementVNode("div", _hoisted_10, [
_hoisted_11,
createElementVNode("div", _hoisted_12, toDisplayString(getShowData(countData.value.onParkNum)), 1)
]),
_hoisted_13,
createElementVNode("div", _hoisted_14, [
(openBlock(true), createElementBlock(Fragment, null, renderList(commitmentInfos.value, (item) => {
return openBlock(), createElementBlock("div", {
key: item.key,
class: normalizeClass(["row", item.key])
}, [
createElementVNode("div", _hoisted_15, toDisplayString(item.title), 1),
createElementVNode("div", _hoisted_16, toDisplayString(getShowData(countData.value[item.key])), 1)
], 2);
}), 128))
])
])) : createCommentVNode("", true),
props.showAbnormalData ? (openBlock(), createElementBlock("div", _hoisted_17, [
createElementVNode("div", _hoisted_18, [
createElementVNode("img", {
src: getImg(unref(isDark), "locator")
}, null, 8, _hoisted_19),
createElementVNode("div", _hoisted_20, [
_hoisted_21,
createElementVNode("div", _hoisted_22, toDisplayString(getShowData(countData.value.gpsCar)), 1)
])
]),
createElementVNode("div", _hoisted_23, [
createElementVNode("img", {
src: getImg(unref(isDark), "abnormal")
}, null, 8, _hoisted_24),
createElementVNode("div", _hoisted_25, [
_hoisted_26,
createElementVNode("div", _hoisted_27, toDisplayString(getShowData(countData.value.abnormalCar)), 1)
])
])
])) : createCommentVNode("", true)
]);
};
}
});
export { _sfc_main as default };