@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" />
67 lines (64 loc) • 2.03 kB
JavaScript
import { defineComponent, watch, ref, onMounted, openBlock, createElementBlock, Fragment, renderList, createElementVNode, toDisplayString } from 'vue';
import { situation } from './api/index.mjs';
const _hoisted_1 = { class: "dv-wgms-distribution-points" };
const _hoisted_2 = { class: "dv-wgms-distribution-font-box" };
const _hoisted_3 = { class: "dv-wgms-distribution-font-blue" };
const _hoisted_4 = { class: "dv-wgms-distribution-name" };
const _sfc_main = /* @__PURE__ */ defineComponent({
...{
name: "DvWgmsDistributionPoints",
title: "布点现状"
},
__name: "index",
props: {
treeId: {
type: [Number, String],
default: 3302
},
monitoringMethods: {
type: Number,
default: 0
},
isLazy: {
type: Boolean,
default: false
}
},
setup(__props, { expose: __expose }) {
const props = __props;
watch([props.monitoringMethods, props.treeId], () => {
!props.isLazy && getRankData();
});
const list = ref([]);
onMounted(() => {
!props.isLazy && getRankData();
});
const getRankData = async () => {
const params = {
monitorType: props.monitoringMethods,
treeId: props.treeId
};
const res = await situation(params);
list.value = res?.data || [];
};
__expose({
reload: getRankData
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1, [
(openBlock(true), createElementBlock(Fragment, null, renderList(list.value, (item, index) => {
return openBlock(), createElementBlock("div", {
key: index,
class: "dv-wgms-distribution-items"
}, [
createElementVNode("div", _hoisted_2, [
createElementVNode("div", _hoisted_3, toDisplayString(item.count), 1)
]),
createElementVNode("div", _hoisted_4, toDisplayString(item.name), 1)
]);
}), 128))
]);
};
}
});
export { _sfc_main as default };