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

152 lines (149 loc) 5.84 kB
import { defineComponent, ref, onMounted, watch, openBlock, createElementBlock, createElementVNode, toDisplayString, unref, createCommentVNode } from 'vue'; import _imports_0 from './images/source-0.svg.mjs'; import _imports_1 from './images/source-1.svg.mjs'; import dayjs from 'dayjs'; import { pomsMonitor } from './api/index.mjs'; const _hoisted_1 = { class: "dv-wgms-source-monitor" }; const _hoisted_2 = { class: "dv-wgms-source-monitor-list dv-wgms-flex-left-center" }; const _hoisted_3 = { class: "dv-wgms-source-monitor-list-item" }; const _hoisted_4 = /* @__PURE__ */ createElementVNode("div", { class: "title" }, " 重点源企业 ", -1); const _hoisted_5 = { class: "content-box dv-wgms-flex-left-center" }; const _hoisted_6 = /* @__PURE__ */ createElementVNode("img", { src: _imports_0, alt: "" }, null, -1); const _hoisted_7 = { class: "right" }; const _hoisted_8 = { class: "value" }; const _hoisted_9 = { class: "online" }; const _hoisted_10 = /* @__PURE__ */ createElementVNode("span", { class: "split" }, "/", -1); const _hoisted_11 = { class: "total" }; const _hoisted_12 = { key: 0, class: "unit" }; const _hoisted_13 = { class: "percent" }; const _hoisted_14 = /* @__PURE__ */ createElementVNode("span", { class: "unit" }, "占比", -1); const _hoisted_15 = { class: "rate" }; const _hoisted_16 = { key: 0, class: "unit" }; const _hoisted_17 = { class: "dv-wgms-source-monitor-list-item" }; const _hoisted_18 = /* @__PURE__ */ createElementVNode("div", { class: "title" }, " 联网率 ", -1); const _hoisted_19 = { class: "content-box dv-wgms-flex-left-center" }; const _hoisted_20 = /* @__PURE__ */ createElementVNode("img", { src: _imports_1, alt: "" }, null, -1); const _hoisted_21 = { class: "right" }; const _hoisted_22 = { class: "value" }; const _hoisted_23 = { class: "online mgr4" }; const _hoisted_24 = { key: 0, class: "unit" }; const _hoisted_25 = { class: "percent" }; const _hoisted_26 = /* @__PURE__ */ createElementVNode("span", { class: "unit" }, "安装设备", -1); const _hoisted_27 = { class: "rate" }; const _hoisted_28 = { key: 0, class: "unit" }; const _sfc_main = /* @__PURE__ */ defineComponent({ ...{ name: "DvWgmsSourceMonitoring", title: "源监控(1.1)" }, __name: "index", props: { params: { type: Object, default: () => { return { treeId: 3301, treeType: 1, year: dayjs().format("YYYY") }; } }, data: { type: Object, default: () => { } }, isLazy: { type: Boolean, default: false } }, setup(__props, { expose: __expose }) { const props = __props; const pomsData = ref({ equipmentCount: null, mainCount: null, mainPerent: null, onlinePercent: null, totalCount: null }); const getResData = async () => { if (props.data && Reflect.ownKeys(props.data).length) { pomsData.value = props.data; return; } const { data: res } = await pomsMonitor(props.params); res && (pomsData.value = res); }; onMounted(() => { !props.isLazy && getResData(); }); watch([() => props.params, () => props.data, () => props.isLazy], () => { !props.isLazy && getResData(); }, { deep: true }); __expose({ reload: getResData }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", _hoisted_1, [ createElementVNode("div", _hoisted_2, [ createElementVNode("div", _hoisted_3, [ _hoisted_4, createElementVNode("div", _hoisted_5, [ _hoisted_6, createElementVNode("div", _hoisted_7, [ createElementVNode("div", _hoisted_8, [ createElementVNode("span", _hoisted_9, toDisplayString(unref(pomsData).mainCount === null ? "--" : unref(pomsData).mainCount), 1), _hoisted_10, createElementVNode("span", _hoisted_11, toDisplayString(unref(pomsData).totalCount === null ? "--" : unref(pomsData).totalCount), 1), unref(pomsData).totalCount !== null ? (openBlock(), createElementBlock("span", _hoisted_12, "家")) : createCommentVNode("", true) ]), createElementVNode("div", _hoisted_13, [ _hoisted_14, createElementVNode("span", _hoisted_15, toDisplayString(unref(pomsData).mainPerent === null ? "--" : unref(pomsData).mainPerent), 1), unref(pomsData).mainPerent !== null ? (openBlock(), createElementBlock("span", _hoisted_16, "%")) : createCommentVNode("", true) ]) ]) ]) ]), createElementVNode("div", _hoisted_17, [ _hoisted_18, createElementVNode("div", _hoisted_19, [ _hoisted_20, createElementVNode("div", _hoisted_21, [ createElementVNode("div", _hoisted_22, [ createElementVNode("span", _hoisted_23, toDisplayString(unref(pomsData).onlinePercent === null ? "--" : unref(pomsData).onlinePercent), 1), unref(pomsData).onlinePercent !== null ? (openBlock(), createElementBlock("span", _hoisted_24, "%")) : createCommentVNode("", true) ]), createElementVNode("div", _hoisted_25, [ _hoisted_26, createElementVNode("span", _hoisted_27, toDisplayString(unref(pomsData).equipmentCount === null ? "--" : unref(pomsData).equipmentCount), 1), unref(pomsData).equipmentCount !== null ? (openBlock(), createElementBlock("span", _hoisted_28, "家")) : createCommentVNode("", true) ]) ]) ]) ]) ]) ]); }; } }); export { _sfc_main as default };