@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" />
52 lines (49 loc) • 1.66 kB
JavaScript
import { defineComponent, shallowRef, watch, openBlock, createElementBlock, createVNode } from 'vue';
import _sfc_main$1 from '../../utils/echarts/BaseECharts.vue.mjs';
import { comprehensiveWaterQualityOption } from '../../utils/echarts/echartsOptions.mjs';
import { synthesisIndexChange } from './api/index.mjs';
const _hoisted_1 = {
class: "dv-wgms-water-quality-regional-comprehensive",
red: "barBox"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
...{
name: "DvWgmsWaterQualityRegionalComprehensive",
title: "区域水质综合指数变化(1.1)"
},
__name: "index",
props: {
treeId: { default: "3301" },
treeType: { default: 1 },
year: { default: "2023" },
isLazy: { type: Boolean, default: false }
},
setup(__props, { expose: __expose }) {
const props = __props;
const options = shallowRef();
const getData = async () => {
const { data } = await synthesisIndexChange({ ...props });
const yData = [];
const xData = [];
data?.forEach((item) => {
yData.push(item.synthesisIndex);
xData.push(item.time);
});
options.value = comprehensiveWaterQualityOption(xData, yData);
};
watch([() => props.treeId, () => props.treeType, () => props.year, () => props.isLazy], () => {
if (props.isLazy)
return;
getData();
}, { immediate: true });
__expose({
reload: getData
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1, [
createVNode(_sfc_main$1, { options: options.value }, null, 8, ["options"])
]);
};
}
});
export { _sfc_main as default };