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

114 lines (111 loc) 3.61 kB
import { defineComponent, reactive, watch, onMounted, toRefs, openBlock, createElementBlock, createElementVNode, toDisplayString, unref } from 'vue'; import dayjs from 'dayjs'; import { portToRiver } from './api/index.mjs'; const _hoisted_1 = { class: "dv-wgms-pollution-source", style: { "width": "auto" } }; const _hoisted_2 = { class: "dv-wgms-statistic-content" }; const _hoisted_3 = { class: "dv-wgms-statistic-box" }; const _hoisted_4 = /* @__PURE__ */ createElementVNode("div", { class: "dv-wgms-text" }, " 入河排污口 ", -1); const _hoisted_5 = { class: "dv-wgms-port-list" }; const _hoisted_6 = { class: "dv-wgms-port-one" }; const _hoisted_7 = /* @__PURE__ */ createElementVNode("div", { class: "dv-wgms-name" }, " 氮超标 ", -1); const _hoisted_8 = { class: "dv-wgms-value" }; const _hoisted_9 = /* @__PURE__ */ createElementVNode("span", null, "个", -1); const _hoisted_10 = { class: "dv-wgms-port-one" }; const _hoisted_11 = /* @__PURE__ */ createElementVNode("div", { class: "dv-wgms-name" }, " 磷超标 ", -1); const _hoisted_12 = { class: "dv-wgms-value" }; const _hoisted_13 = /* @__PURE__ */ createElementVNode("span", null, "个", -1); const _sfc_main = /* @__PURE__ */ defineComponent({ ...{ name: "DvWgmsPollutionSourceControlOutlets", title: "污染源管控-入河排污口" }, __name: "index", props: { params: { type: Object, default: () => { return { distance: 5e3, startTime: dayjs().startOf("year").valueOf(), endTime: dayjs().endOf("year").valueOf(), latitude: 30, longitude: 120, timeType: "day" }; } }, isLazy: { type: Boolean, default: false }, data: { type: Object, default: void 0 } }, setup(__props, { expose: __expose }) { const props = __props; const outletData = reactive({ nh3OverNum: 0, tpOverNum: 0 }); watch([ () => props.params, () => props.data, () => props.isLazy ], () => { if (props.isLazy) return; getPortData(); }); onMounted(() => { if (props.isLazy) return; getPortData(); }); const getPortData = async () => { let resData; if (props.data) { resData = props.data; } else { const res = await portToRiver(props.params); resData = res.data; } outletData.nh3OverNum = resData?.noverCount ?? 0; outletData.tpOverNum = resData?.poverCount ?? 0; }; const { nh3OverNum, tpOverNum } = toRefs(outletData); __expose({ reload: getPortData }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", _hoisted_1, [ createElementVNode("div", _hoisted_2, [ createElementVNode("div", _hoisted_3, [ _hoisted_4, createElementVNode("div", _hoisted_5, [ createElementVNode("div", _hoisted_6, [ _hoisted_7, createElementVNode("div", _hoisted_8, [ createElementVNode("span", null, toDisplayString(unref(nh3OverNum)), 1), _hoisted_9 ]) ]), createElementVNode("div", _hoisted_10, [ _hoisted_11, createElementVNode("div", _hoisted_12, [ createElementVNode("span", null, toDisplayString(unref(tpOverNum)), 1), _hoisted_13 ]) ]) ]) ]) ]) ]); }; } }); export { _sfc_main as default };