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

93 lines (88 loc) 3.29 kB
'use strict'; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } }); const vue = require('vue'); 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-station-water-quality-statistics" }; const _sfc_main = /* @__PURE__ */ vue.defineComponent({ ...{ name: "DvWgmsStationWaterQualityStatistics", title: "站点水质统计(1.1)" }, __name: "index", props: { treeId: { default: "3301" }, treeType: { default: 1 }, year: { default: "2023" }, data: {}, isLazy: { type: Boolean, default: false } }, setup(__props, { expose: __expose }) { const props = __props; const option = vue.ref([ { label: "排名", key: "index", flex: 0.6, class: "table-number" }, { label: "站点", key: "siteName", flex: 1.4 }, { label: "数据时间", key: "dataTime", class: "table-number" }, { label: "水质类别", key: "level", class: "table-number" }, { label: "水质目标", key: "target", class: "table-number" }, { label: "同期水质", key: "yoyLevel", class: "table-number" } ]); const tableData = vue.ref([]); const getData = async () => { const params = { ...props }; const { data } = await index.waterQualityStatistic(params); tableData.value = (data || []).map((item, index) => { return { index: index + 1, ...item }; }); }; vue.watch([() => props.data, () => props.treeId, () => props.treeType, () => props.year, () => 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: option.value, data: tableData.value, "header-line-style": { padding: 0 }, "line-style": { padding: 0, height: "32px" } }, { level: vue.withCtx((scope) => [ vue.createElementVNode("span", { class: "tab-item", style: vue.normalizeStyle({ background: scope.row.levelColor }) }, vue.toDisplayString(scope.row.levelName), 5) ]), target: vue.withCtx((scope) => [ vue.createElementVNode("span", { class: "tab-item", style: vue.normalizeStyle({ background: scope.row.targetColor }) }, vue.toDisplayString(scope.row.targetName), 5) ]), yoyLevel: vue.withCtx((scope) => [ vue.createElementVNode("span", { class: "tab-item", style: vue.normalizeStyle({ background: scope.row.yoyLevelColor }) }, vue.toDisplayString(scope.row.yoyLevelName), 5) ]), _: 1 }, 8, ["option", "data"]) ]); }; } }); exports.default = _sfc_main;