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

175 lines (170 loc) 7.33 kB
'use strict'; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } }); const abnormalLight = require('./images/abnormal-light.png.js'); const abnormal = require('./images/abnormal.png.js'); 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 locatorLight = require('./images/locator-light.png.js'); const locator = require('./images/locator.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-vehicle-passage" }; const _hoisted_2 = { key: 0, class: "list" }; const _hoisted_3 = { class: "box enter" }; const _hoisted_4 = { class: "value" }; const _hoisted_5 = /* @__PURE__ */ vue.createElementVNode("div", { class: "name" }, " 今日入园 ", -1); const _hoisted_6 = { class: "box leave" }; const _hoisted_7 = { class: "value" }; const _hoisted_8 = /* @__PURE__ */ vue.createElementVNode("div", { class: "name" }, " 今日出园 ", -1); const _hoisted_9 = { key: 1, class: "man-analysis" }; const _hoisted_10 = { class: "personnel" }; const _hoisted_11 = /* @__PURE__ */ vue.createElementVNode("div", { class: "label" }, " 入园车辆 ", -1); const _hoisted_12 = { class: "number" }; const _hoisted_13 = /* @__PURE__ */ vue.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__ */ vue.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__ */ vue.createElementVNode("div", { class: "label" }, " 异常车辆 ", -1); const _hoisted_27 = { class: "value" }; const __default__ = { name: "DvIpesVehiclePassage", title: "车辆通行" }; const _sfc_main = /* @__PURE__ */ vue.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 } = utils.useThemeHook(); const getImg = (isDark2, key) => { return new URL((/* #__PURE__ */ Object.assign({"./images/abnormal-light.png": abnormalLight.default,"./images/abnormal.png": abnormal.default,"./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/locator-light.png": locatorLight.default,"./images/locator.png": locator.default}))[`./images/${key}${isDark2 ? "" : "-light"}.png`], self.location).href; }; const countData = vue.ref({ carTodayIn: null, // 入园数量 carTodayOut: null, // 出园数量 onParkNum: null, // 园内车辆 gpsCar: null, // 定位车辆 abnormalCar: null, // 异常车辆 fixCar: null, // 固定车 appointCar: null, // 预约车 specialCar: null, // 特殊车 other: null // 其他车 }); const commitmentInfos = vue.ref([ { title: "固定车", key: "fixCar" }, { title: "特殊车", key: "specialCar" }, { title: "预约车", key: "appointCar" }, { title: "其他车", key: "other" } ]); let isInit = false; async function getData() { try { const res = await request.default({ 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; } vue.onMounted(() => { getData(); }); hooks.setIntervalData(getData); return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [ props.showParkStatistics ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [ vue.createElementVNode("div", _hoisted_3, [ vue.createElementVNode("div", _hoisted_4, vue.toDisplayString(getShowData(countData.value.carTodayIn)), 1), _hoisted_5 ]), vue.createElementVNode("div", _hoisted_6, [ vue.createElementVNode("div", _hoisted_7, vue.toDisplayString(getShowData(countData.value.carTodayOut)), 1), _hoisted_8 ]) ])) : vue.createCommentVNode("", true), props.showParkInData ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9, [ vue.createElementVNode("div", _hoisted_10, [ _hoisted_11, vue.createElementVNode("div", _hoisted_12, vue.toDisplayString(getShowData(countData.value.onParkNum)), 1) ]), _hoisted_13, vue.createElementVNode("div", _hoisted_14, [ (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_15, vue.toDisplayString(item.title), 1), vue.createElementVNode("div", _hoisted_16, vue.toDisplayString(getShowData(countData.value[item.key])), 1) ], 2); }), 128)) ]) ])) : vue.createCommentVNode("", true), props.showAbnormalData ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_17, [ vue.createElementVNode("div", _hoisted_18, [ vue.createElementVNode("img", { src: getImg(vue.unref(isDark), "locator") }, null, 8, _hoisted_19), vue.createElementVNode("div", _hoisted_20, [ _hoisted_21, vue.createElementVNode("div", _hoisted_22, vue.toDisplayString(getShowData(countData.value.gpsCar)), 1) ]) ]), vue.createElementVNode("div", _hoisted_23, [ vue.createElementVNode("img", { src: getImg(vue.unref(isDark), "abnormal") }, null, 8, _hoisted_24), vue.createElementVNode("div", _hoisted_25, [ _hoisted_26, vue.createElementVNode("div", _hoisted_27, vue.toDisplayString(getShowData(countData.value.abnormalCar)), 1) ]) ]) ])) : vue.createCommentVNode("", true) ]); }; } }); exports.default = _sfc_main;