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

101 lines (96 loc) 3.61 kB
'use strict'; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } }); const vue = require('vue'); const request = require('../../service/request.js'); const hooks = require('../../utils/hooks.js'); const _hoisted_1 = { class: "dv-ipes-video-equipment" }; const _hoisted_2 = { class: "video-header" }; const _hoisted_3 = /* @__PURE__ */ vue.createElementVNode("div", { class: "video-title" }, " 视频设备 ", -1); const _hoisted_4 = /* @__PURE__ */ vue.createElementVNode("span", { class: "video-label" }, "总数", -1); const _hoisted_5 = { class: "video-value" }; const _hoisted_6 = { class: "video-box" }; const _hoisted_7 = { class: "item" }; const _hoisted_8 = /* @__PURE__ */ vue.createElementVNode("div", { class: "label flex flex-s" }, [ /* @__PURE__ */ vue.createElementVNode("div", { class: "dot online" }), /* @__PURE__ */ vue.createElementVNode("div", { class: "name" }, " 在线 ") ], -1); const _hoisted_9 = { class: "number" }; const _hoisted_10 = { class: "item" }; const _hoisted_11 = /* @__PURE__ */ vue.createElementVNode("div", { class: "label flex flex-s" }, [ /* @__PURE__ */ vue.createElementVNode("div", { class: "dot offline" }), /* @__PURE__ */ vue.createElementVNode("div", { class: "name" }, " 离线 ") ], -1); const _hoisted_12 = { class: "number" }; const __default__ = { name: "DvIpesVideoEquipment", title: "视频设备" }; const _sfc_main = /* @__PURE__ */ vue.defineComponent({ ...__default__, props: { siteCodeList: { default: () => [] }, isAccessPermission: { type: Boolean, default: false }, infoMap: { default: { totalNum: "onlineNum", onlineNum: "onlineNum", offlineNum: "" } } }, setup(__props) { const props = __props; const info = vue.ref({ onlineNum: 0, offlineNum: 0, totalNum: 0 }); const infoData = vue.computed(() => { return { totalNum: info.value[props.infoMap.totalNum] || 0, onlineNum: info.value[props.infoMap.onlineNum] || 0, offlineNum: info.value[props.infoMap.offlineNum] || 0 }; }); async function getInfoData() { try { const res = await request.default({ method: "post", url: "/bmp-video-control-server/api/v1/statistics/getOnlineResult", data: props }); info.value = res?.data || {}; console.log(info); } catch (error) { console.log(error); } } function getShowData(value) { return value == null ? "0" : value; } vue.onMounted(() => { getInfoData(); }); hooks.setIntervalData(getInfoData, 5 * 60 * 1e3); return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [ vue.createElementVNode("div", _hoisted_2, [ _hoisted_3, vue.createElementVNode("div", null, [ _hoisted_4, vue.createElementVNode("span", _hoisted_5, vue.toDisplayString(getShowData(infoData.value.totalNum)), 1) ]) ]), vue.createElementVNode("div", _hoisted_6, [ vue.createElementVNode("div", _hoisted_7, [ _hoisted_8, vue.createElementVNode("span", _hoisted_9, vue.toDisplayString(getShowData(infoData.value.onlineNum)), 1) ]), vue.createElementVNode("div", _hoisted_10, [ _hoisted_11, vue.createElementVNode("span", _hoisted_12, vue.toDisplayString(getShowData(infoData.value.offlineNum)), 1) ]) ]) ]); }; } }); exports.default = _sfc_main;