@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" />
72 lines (69 loc) • 2.79 kB
JavaScript
import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, Fragment, renderList, normalizeClass, normalizeStyle, createTextVNode } from 'vue';
const _hoisted_1 = { class: "dv-ipes-alarm-statistics" };
const _hoisted_2 = { class: "dv-ipes-top-action dv-ipes-flex-bw-c" };
const _hoisted_3 = /* @__PURE__ */ createElementVNode("span", null, [
/* @__PURE__ */ createTextVNode("报警统计"),
/* @__PURE__ */ createElementVNode("span", null, "(本日)")
], -1);
const _hoisted_4 = { class: "dv-ipes-num" };
const _hoisted_5 = { class: "dv-ipes-middle-action dv-ipes-flex-bw-c" };
const _hoisted_6 = { class: "dv-ipes-bottom-action dv-ipes-flex-bw-c" };
const _hoisted_7 = { class: "dv-ipes-labels" };
const _hoisted_8 = { class: "dv-ipes-nums dv-ipes-flex-bw-c" };
const __default__ = {
name: "AlarmStatistics"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
...__default__,
props: {
// 数据
data: {
type: Array,
default: () => {
return [];
}
},
all: {
type: Number
}
},
setup(__props) {
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", null, [
createElementVNode("div", _hoisted_1, [
createElementVNode("div", _hoisted_2, [
_hoisted_3,
createElementVNode("div", _hoisted_4, toDisplayString(__props.all), 1)
]),
createElementVNode("div", _hoisted_5, [
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.data, (item) => {
return openBlock(), createElementBlock("div", {
key: item.code,
class: normalizeClass(["dv-ipes-rate", `dv-ipes-${item.code}`]),
style: normalizeStyle({ width: `${item.count / Number(__props.all) * 100}%` })
}, null, 6);
}), 128))
]),
createElementVNode("div", _hoisted_6, [
createElementVNode("div", _hoisted_7, [
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.data, (item) => {
return openBlock(), createElementBlock("span", {
key: item.code
}, toDisplayString(item.name), 1);
}), 128))
]),
createElementVNode("div", _hoisted_8, [
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.data, (item) => {
return openBlock(), createElementBlock("span", {
key: item.code,
class: normalizeClass(`dv-ipes-${item.code}-text`)
}, toDisplayString(item.count), 3);
}), 128))
])
])
])
]);
};
}
});
export { _sfc_main as default };