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

119 lines (114 loc) 3.94 kB
'use strict'; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } }); const vue = require('vue'); const _1 = require('./images/-1.svg.js'); const _1$1 = require('./images/1.svg.js'); const _0 = require('./images/0.svg.js'); const popupTable_vue_vue_type_script_setup_true_name_BadVRiverPopup_lang = require('../common/popup-table.vue.js'); require('../common/popup-table.vue2.js'); const index = require('./api/index.js'); const _hoisted_1 = { class: "dv-wgms-regional-quality-analysis" }; const _hoisted_2 = { key: 0, src: _1.default, alt: "" }; const _hoisted_3 = { key: 1, src: _1$1.default, alt: "" }; const _hoisted_4 = { key: 2, src: _0.default, alt: "" }; const _sfc_main = /* @__PURE__ */ vue.defineComponent({ ...{ name: "DvWgmsRegionalQualityAnalysis", title: "区域水质分析(1.1)" }, __name: "index", props: { treeId: {}, timeType: {}, startTime: {}, endTime: {}, data: { default: null }, isLazy: { type: Boolean, default: false }, params: { default: () => { return { treeId: "3301", timeType: "year", startTime: 16725024e5, endTime: 17040384e5 }; } } }, setup(__props, { expose: __expose }) { const props = __props; const option = [ { label: "排名", key: "index", flex: 0.6, class: "table-number" }, { label: "区域", key: "regionName", flex: 1.4 }, { label: "本期", key: "currentPeriod", class: "table-number" }, { label: "同期", key: "yoyPeriod", class: "table-number" }, { label: "变化率", key: "changePercent", class: "table-number" } ]; const classObj = { "1": "up-num", "-1": "down-num", "0": "same-num" }; const tableData = vue.ref([]); const getData = async () => { const params = { ...props.params }; const { data } = await index.synthesisIndex(params); tableData.value = (data || []).map((item, index) => { const { changePercent } = item; return { index: index + 1, type: changePercent > 0 ? "1" : changePercent < 0 ? "-1" : "0", ...item }; }); }; vue.watch([() => props.data, () => props.params, () => props.isLazy], () => { if (props.isLazy) return; if (props.data) { tableData.value = props.data; return; } getData(); }, { immediate: true }); __expose({ reload: getData }); return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [ vue.createVNode(popupTable_vue_vue_type_script_setup_true_name_BadVRiverPopup_lang.default, { option, data: tableData.value, "header-line-style": { padding: 0 }, "line-style": { padding: 0, height: "32px" } }, { changePercent: vue.withCtx((scope) => [ vue.createElementVNode("span", { style: { "margin-right": "4px" }, class: vue.normalizeClass(scope.row.changePercent !== null ? classObj[scope.row.type] : "") }, vue.toDisplayString(scope.row.changePercent === null ? "--" : scope.row.changePercent), 3), scope.row.changePercent !== null ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [ scope.row.type === "-1" ? (vue.openBlock(), vue.createElementBlock("img", _hoisted_2)) : vue.createCommentVNode("", true), scope.row.type === "1" ? (vue.openBlock(), vue.createElementBlock("img", _hoisted_3)) : vue.createCommentVNode("", true), scope.row.type === "0" ? (vue.openBlock(), vue.createElementBlock("img", _hoisted_4)) : vue.createCommentVNode("", true) ], 64)) : vue.createCommentVNode("", true) ]), _: 1 }, 8, ["data"]) ]); }; } }); exports.default = _sfc_main;