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

87 lines (82 loc) 3.04 kB
'use strict'; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } }); const vue = require('vue'); const _hoisted_1 = { class: "dv-ipes-pollutant-source-manage" }; const _hoisted_2 = ["onClick"]; const _hoisted_3 = { class: "title" }; const _hoisted_4 = { class: "flex-c" }; const _hoisted_5 = { key: 0 }; const __default__ = { name: "DvIpesPollutantSourceManage", title: "污染源排放管理" }; const _sfc_main = /* @__PURE__ */ vue.defineComponent({ ...__default__, props: { statusData: { default: () => { return { wg: { abnormal: 0, normal: 0, offline: 0, total: 0 }, ww: { abnormal: 0, normal: 0, offline: 0, total: 0 } }; } } }, emits: ["openPopup"], setup(__props, { emit }) { const props = __props; const { statusData } = vue.toRefs(props); const activeCard = vue.ref(""); const cardList = vue.ref([ { title: "废气", key: "wg" }, { title: "废水", key: "ww" } ]); const statusOption = vue.ref([ { key: "normal", color: "#0EED9B" }, { key: "abnormal", color: "#F84439" }, { key: "offline", color: "#FFFFFF" } ]); const clickCard = (key, type) => { if (activeCard.value === key + type) activeCard.value = ""; else activeCard.value = key + type; emit("openPopup", key + type); }; return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(cardList.value, (item) => { return vue.openBlock(), vue.createElementBlock("div", { key: item.key, class: vue.normalizeClass(["card-box", { active: activeCard.value === `${item.key}Site` }]), onClick: ($event) => clickCard(item.key, "Site") }, [ vue.createElementVNode("div", _hoisted_3, vue.toDisplayString(item.title) + "排口 ", 1), vue.createElementVNode("div", _hoisted_4, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(statusOption.value, (option, index) => { return vue.openBlock(), vue.createElementBlock("div", { key: option.key, class: "status" }, [ vue.createElementVNode("div", { class: vue.normalizeClass(["value", [option.key]]) }, vue.toDisplayString(vue.unref(statusData) && vue.unref(statusData)[item.key] ? vue.unref(statusData)[item.key][option.key] : "--"), 3), index < statusOption.value.length - 1 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_5, "/")) : vue.createCommentVNode("", true) ]); }), 128)) ]) ], 10, _hoisted_2); }), 128)) ]); }; } }); exports.default = _sfc_main;