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

58 lines (55 loc) 2.08 kB
import { defineComponent, ref, openBlock, createElementBlock, Fragment, renderList, createElementVNode, toDisplayString } from 'vue'; import requestControl from '../../service/request.mjs'; import { setIntervalData } from '../../utils/hooks.mjs'; const _hoisted_1 = { class: "dv-ipes-start-stop-major-maintenance" }; const _hoisted_2 = { class: "title" }; const _hoisted_3 = { class: "info-box-count" }; const _hoisted_4 = { class: "value" }; const _hoisted_5 = { class: "unit" }; const __default__ = { name: "DvIpesStartStopMajorMaintenance", title: "开停车和大检修" }; const _sfc_main = /* @__PURE__ */ defineComponent({ ...__default__, setup(__props) { const basicInfoData = ref({ toDayCarCount: 0, toDay0verhaulCount: 0 }); const basicInfos = ref([ { title: "今日开停车", key: "toDayCarCount", unit: "个" }, { title: "今日大检修", key: "toDay0verhaulCount", unit: "个" } ]); async function getBasicInfo() { try { const res = await requestControl({ method: "get", url: "/ipes-srip-server/api/v1/vehicle-statistical/car-today" }); basicInfoData.value = res.data; } catch (error) { console.log(error); } } getBasicInfo(); setIntervalData(getBasicInfo, 5 * 60 * 1e3); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", _hoisted_1, [ (openBlock(true), createElementBlock(Fragment, null, renderList(basicInfos.value, (item) => { return openBlock(), createElementBlock("div", { key: item.key, class: "info-box" }, [ createElementVNode("span", _hoisted_2, toDisplayString(item.title), 1), createElementVNode("div", _hoisted_3, [ createElementVNode("span", _hoisted_4, toDisplayString(basicInfoData.value[item.key]), 1), createElementVNode("span", _hoisted_5, toDisplayString(item.unit), 1) ]) ]); }), 128)) ]); }; } }); export { _sfc_main as default };