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

204 lines (199 loc) 7.08 kB
'use strict'; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } }); const vue = require('vue'); const noData = require('./images/noData.svg.js'); const elementPlusExpand = require('@ued_fpi/element-plus-expand'); const core = require('@vueuse/core'); const Echarts_vue_vue_type_script_setup_true_lang = require('../common/Echarts.vue.js'); require('../common/Echarts.vue2.js'); const tools = require('../../utils/tools.js'); const _hoisted_1 = { class: "dv-ipes-OrdorControl" }; const _hoisted_2 = { class: "specific-site" }; const _hoisted_3 = { class: "site-name" }; const _hoisted_4 = { class: "site-title" }; const _hoisted_5 = { class: "time" }; const _hoisted_6 = ["title"]; const _hoisted_7 = { class: "right" }; const _hoisted_8 = { style: { color: "#00DEFF" } }; const _hoisted_9 = { key: 1, class: "nodata", style: { "height": "128px" } }; const _hoisted_10 = /* @__PURE__ */ vue.createElementVNode("img", { src: noData.default }, null, -1); const _hoisted_11 = [ _hoisted_10 ]; const _hoisted_12 = { class: "smell-number" }; const _hoisted_13 = { class: "head" }; const _hoisted_14 = /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, " 异味指数 ", -1); const _hoisted_15 = { key: 0, class: "unit" }; const _hoisted_16 = { key: 1, class: "nodata", style: { "height": "128px" } }; const _hoisted_17 = /* @__PURE__ */ vue.createElementVNode("img", { src: noData.default }, null, -1); const _hoisted_18 = [ _hoisted_17 ]; const __default__ = { name: "OdorControl", title: "异味管控" }; const _sfc_main = /* @__PURE__ */ vue.defineComponent({ ...__default__, props: { siteData: { type: Object, default: () => ({ siteCode: "JSYQ0432062300941000", siteName: "上风向空气超站(六参)", dataTime: "2023-06-30 10", siteFactorDatas: [ { factorCode: "a21001", factorName: "NH₃", factorValue: "0.0", factorStandardValue: "1.0", exceed: false } ] }) }, chartData: { type: Object, default: () => ({ xData: ["1月", "2月", "3月", "4月", "5月", "6月"], yData: ["0.72", "4.00", "4.30", "10.00", "5.00", "7.00"] }) } }, setup(__props) { const props = __props; const themeEl = vue.ref(null); const themeColor = core.useCssVar("--color", themeEl); const axisLabelEl = vue.ref(null); const axisLabelColor = core.useCssVar("--dv-color-text-primary", axisLabelEl); const splitLineEl = vue.ref(null); const splitLineElColor = core.useCssVar("--dv-color-border-light", splitLineEl); const echartsOptions = vue.reactive({ options: { color: tools.getCssValue("--dv-color-index"), grid: { left: 0, bottom: 0, right: 0, top: 10, containLabel: true }, tooltip: { trigger: "axis", padding: 8, background: tools.getCssValue("-dv-color-fill-base") }, xAxis: { type: "category", axisTick: { show: false }, axisLine: { show: false }, axisLabel: { color: axisLabelColor.value }, data: [] }, yAxis: { type: "value", splitNumber: 3, axisTick: { show: false }, axisLine: { show: false }, axisLabel: { show: true }, splitLine: { lineStyle: { color: splitLineElColor.value }, show: true } }, series: { type: "bar", barWidth: 10, itemStyle: { color: themeColor.value }, data: [] } }, init: false }); vue.watch(() => props.chartData, (newValue) => { echartsOptions.options.xAxis.data = newValue?.xData || []; echartsOptions.options.series.data = newValue?.yData || []; }, { deep: true, immediate: true }); return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [ vue.createElementVNode("div", _hoisted_2, [ vue.createElementVNode("div", _hoisted_3, [ vue.createElementVNode("div", _hoisted_4, vue.toDisplayString(__props.siteData.siteName || "--"), 1), vue.createElementVNode("div", _hoisted_5, vue.toDisplayString(__props.siteData.dataTime), 1) ]), vue.createVNode(vue.unref(elementPlusExpand.FpiElRolling), { class: "site-factor", direction: "y", time: __props.siteData.siteFactorDatas.length * 1 }, { default: vue.withCtx(() => [ __props.siteData.siteFactorDatas && __props.siteData.siteFactorDatas.length ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(__props.siteData.siteFactorDatas, (item) => { return vue.openBlock(), vue.createElementBlock("div", { key: item.factorCode, class: "item-factor" }, [ vue.createElementVNode("div", { class: "left", title: item.factorName }, vue.toDisplayString(item.factorName), 9, _hoisted_6), vue.createElementVNode("div", _hoisted_7, [ vue.createElementVNode("span", { style: vue.normalizeStyle({ color: item.exceed ? "rgb(248, 68, 57)" : "#15F3A3" }) }, vue.toDisplayString(item.factorValue), 5), vue.createElementVNode("span", { style: vue.normalizeStyle({ color: "rgba(255,255,255,.3)" }) }, vue.toDisplayString(` / `), 4), vue.createElementVNode("span", _hoisted_8, vue.toDisplayString(item.factorStandardValue), 1) ]) ]); }), 128)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_9, _hoisted_11)) ]), _: 1 }, 8, ["time"]), vue.createElementVNode("div", _hoisted_12, [ vue.createElementVNode("div", _hoisted_13, [ _hoisted_14, __props.chartData.yData.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_15, " % ")) : vue.createCommentVNode("", true) ]), __props.chartData.xData.length ? (vue.openBlock(), vue.createBlock(Echarts_vue_vue_type_script_setup_true_lang.default, { key: 0, id: "echarts", height: "120px", "full-options": echartsOptions, loading: false }, null, 8, ["full-options"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_16, _hoisted_18)) ]) ]) ]); }; } }); exports.default = _sfc_main;