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

140 lines (135 loc) 3.98 kB
'use strict'; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } }); const vue = require('vue'); const Echarts_vue_vue_type_script_setup_true_lang = require('../common/Echarts.vue.js'); require('../common/Echarts.vue2.js'); const tools = require('../../utils/tools.js'); const _hoisted_1 = { class: "emergencyManage" }; const _hoisted_2 = /* @__PURE__ */ vue.createElementVNode("div", { class: "chartBg" }, null, -1); const __default__ = { name: "DvIpesEmergencyManage", title: "应急管理 or 应急事件" }; const _sfc_main = /* @__PURE__ */ vue.defineComponent({ ...__default__, props: { emergencyData: { type: Array, default: () => { return []; } } }, setup(__props) { const props = __props; const total = props.emergencyData.reduce((accumulator, current) => accumulator + current.value, 0); const chartOption = vue.reactive({ options: { title: { show: true, text: total, textStyle: { color: tools.getCssValue("--dv-color-text-primary"), fontSize: 24, fontFamily: tools.getFontFamily("--dv-font-family-number"), fontWeight: 400 }, top: "17%", left: "19%", textAlign: "center" }, tooltip: { confine: true, // 不让超出显示 trigger: "item", formatter: (item) => { return `<div class="tool-tips__row">${item.percent.toFixed(1)}%</div>`; } }, legend: { selectedMode: true, // 图例点击事件 left: "40%", top: "4%", icon: "circle", itemWidth: 12, itemHeight: 12, itemGap: 8, // 图例之间的间距 formatter: (value) => { const flag = props.emergencyData.find((items) => { return items.name === value; }); let arr = []; arr = [`{a|${value}}`, `{b|${flag?.value}}`]; return arr.join(""); }, textStyle: { rich: { a: { width: 100, fontSize: 14, color: tools.getCssValue("--dv-color-text-primary") }, b: { width: 24, fontSize: 14, color: tools.getCssValue("--dv-color-index"), fontFamily: tools.getFontFamily("--dv-font-family-number"), align: "left" } } } }, series: [ { type: "pie", radius: ["46px", "58px"], center: ["20%", "22%"], data: props.emergencyData, animationEasing: "cubicInOut", animationDuration: 1e3, itemStyle: { borderRadius: 3, borderColor: "rgba(6,37,56,0.6)", borderWidth: 0 }, color: [ "#0AAEFF", "#A162F7", "#34EAE3", "#E9BB1D", "#C0C4CC", "#5470c6", "#91cc75", "#fac858", "#ee6666", "#73c0de", "#3ba272", "#fc8452", "#9a60b4", "#ea7ccc" ], labelLine: { show: false }, label: { show: false } } ] } }); return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [ vue.createVNode(Echarts_vue_vue_type_script_setup_true_lang.default, { class: "echartsBox", "full-options": vue.unref(chartOption), loading: false }, null, 8, ["full-options"]), _hoisted_2 ]); }; } }); exports.default = _sfc_main;