@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" />
59 lines (56 loc) • 1.77 kB
JavaScript
import { defineComponent, shallowRef, watch, openBlock, createElementBlock, createVNode } from 'vue';
import _sfc_main$1 from '../../utils/echarts/BaseECharts.vue.mjs';
import { getDizhouQualityAnalysisOption } from '../../utils/echarts/echartsOptions.mjs';
import { waterQualityAnalyze } from './api/index.mjs';
const _hoisted_1 = {
class: "dv-wgms-water-quality-states-analysis",
red: "barBox"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
...{
name: "DvWgmsWaterQualityStatesAnalysis",
title: "地州水质分析(1.1)"
},
__name: "index",
props: {
isLazy: { type: Boolean, default: false },
params: { default: () => {
return {
treeId: "3301",
timeType: "year",
startTime: 16725024e5,
endTime: 17040384e5
};
} }
},
setup(__props, { expose: __expose }) {
const props = __props;
const options = shallowRef();
const getData = async () => {
const { data } = await waterQualityAnalyze({ ...props.params });
const xData = [];
const goodList = [];
const badList = [];
data?.forEach((item) => {
xData.push(item.regionName);
goodList.push(item.excellentPercent);
badList.push(item.minorVPercent);
});
options.value = getDizhouQualityAnalysisOption(xData, goodList, badList);
};
watch([() => props.params, () => 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 };