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

135 lines (130 loc) 5.34 kB
'use strict'; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } }); const es = require('element-plus/es'); require('element-plus/es/components/base/style/css'); require('element-plus/es/components/icon/style/css'); const vue = require('vue'); const dayjs = require('dayjs'); const ProgressBar_vue_vue_type_script_setup_true_lang = require('./components/ProgressBar.vue.js'); require('./components/ProgressBar.vue2.js'); const index = require('./api/index.js'); const _hoisted_1 = { class: "dv-bmp-algae-monitoring-box" }; const _hoisted_2 = { class: "algae-monitoring-rate" }; const _hoisted_3 = /* @__PURE__ */ vue.createElementVNode("div", { class: "decorate-outer" }, null, -1); const _hoisted_4 = { class: "decorate-inner" }; const _hoisted_5 = { class: "total-warn" }; const _hoisted_6 = /* @__PURE__ */ vue.createElementVNode("div", { class: "total-warn-top" }, " 年累计 ", -1); const _hoisted_7 = { class: "total-warn-bottom" }; const _hoisted_8 = { class: "total-warn-done" }; const _hoisted_9 = /* @__PURE__ */ vue.createElementVNode("div", { class: "total-warn-separator" }, " / ", -1); const _hoisted_10 = { class: "total-warn-total" }; const _hoisted_11 = { class: "algae-monitoring-items" }; const _hoisted_12 = { class: "algae-monitoring-item" }; const _hoisted_13 = /* @__PURE__ */ vue.createElementVNode("span", { class: "algae-title" }, "今日预警数", -1); const _hoisted_14 = { class: "algae-num" }; const _hoisted_15 = { class: "algae-monitoring-item last-item" }; const _hoisted_16 = /* @__PURE__ */ vue.createElementVNode("span", { class: "algae-title algae-title-diff" }, "已处理", -1); const _hoisted_17 = { class: "algae-num" }; const _sfc_main = /* @__PURE__ */ vue.defineComponent({ __name: "index", props: { year: String, // 是否使用内置接口进行数据查询 isUseBuiltInApi: { type: Boolean, default: true }, // 不使用内部接口查询时,组件使用的数据 data: { type: Object, default: () => { } } }, setup(__props) { const props = __props; const todayWarnObj = vue.ref({ doing: 0, done: 0, total: 0, undone: 0 }); const totalWarnObj = vue.ref({ doing: 0, done: 0, total: 0, undone: 0 }); const getData = async (startTime, endTime) => { const params = { startTime, endTime, envTypeCodeList: ["water"], siteCodeList: [], alarmTypeCodeList: ["automonitor_wgmsCyanobacteria"] }; const res = await index.getAlgaeMonitoringWarning(params); return res?.data; }; vue.onMounted(async () => { if (props.isUseBuiltInApi) { todayWarnObj.value = await getData(dayjs().startOf("day").valueOf(), dayjs().valueOf()); totalWarnObj.value = await getData(dayjs().startOf("year").valueOf(), dayjs().valueOf()); } else { todayWarnObj.value = props.data.todayWarnObj; totalWarnObj.value = props.data.totalWarnObj; } }); return (_ctx, _cache) => { const _component_Bell = vue.resolveComponent("Bell"); const _component_el_icon = es.ElIcon; const _component_CircleCheck = vue.resolveComponent("CircleCheck"); return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [ vue.createElementVNode("div", _hoisted_2, [ _hoisted_3, vue.createVNode(ProgressBar_vue_vue_type_script_setup_true_lang.default, { rate: 0.75 }), vue.createElementVNode("div", _hoisted_4, [ (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(72, (item) => { return vue.createElementVNode("div", { key: item, class: "decorate-inner-item", style: vue.normalizeStyle({ transform: `rotate(${5 * item}deg)` }) }, null, 4); }), 64)) ]), vue.createElementVNode("div", _hoisted_5, [ _hoisted_6, vue.createElementVNode("div", _hoisted_7, [ vue.createElementVNode("div", _hoisted_8, vue.toDisplayString(totalWarnObj.value.done), 1), _hoisted_9, vue.createElementVNode("div", _hoisted_10, vue.toDisplayString(totalWarnObj.value.total), 1) ]) ]) ]), vue.createElementVNode("div", _hoisted_11, [ vue.createElementVNode("div", _hoisted_12, [ vue.createVNode(_component_el_icon, { class: "algae-icon" }, { default: vue.withCtx(() => [ vue.createVNode(_component_Bell) ]), _: 1 }), _hoisted_13, vue.createElementVNode("span", _hoisted_14, vue.toDisplayString(todayWarnObj.value.total), 1) ]), vue.createElementVNode("div", _hoisted_15, [ vue.createVNode(_component_el_icon, { class: "algae-icon" }, { default: vue.withCtx(() => [ vue.createVNode(_component_CircleCheck) ]), _: 1 }), _hoisted_16, vue.createElementVNode("span", _hoisted_17, vue.toDisplayString(todayWarnObj.value.done), 1) ]) ]) ]); }; } }); exports.default = _sfc_main;