|
@@ -44,46 +44,18 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <!-- <div class="justify-end monitor-center w-300px">
|
|
|
- <div class="flex">
|
|
|
- <Pie
|
|
|
- class="w-50% text-center"
|
|
|
- :option="chartOption"
|
|
|
- :chart-data="[
|
|
|
- {
|
|
|
- value: 70,
|
|
|
- name: 'A',
|
|
|
- },
|
|
|
- {
|
|
|
- value: 30,
|
|
|
- name: 'B',
|
|
|
- },
|
|
|
- ]"
|
|
|
- height="100px"
|
|
|
- />
|
|
|
- <Pie
|
|
|
- class="w-50% text-center"
|
|
|
- :option="chartOption"
|
|
|
- :chart-data="[
|
|
|
- {
|
|
|
- value: 70,
|
|
|
- name: 'A',
|
|
|
- },
|
|
|
- {
|
|
|
- value: 30,
|
|
|
- name: 'B',
|
|
|
- },
|
|
|
- ]"
|
|
|
- height="100px"
|
|
|
- />
|
|
|
+ <div class="monitor-center flex flex-wrap w-240px ml-166px">
|
|
|
+ <div v-for="(item, i) in chartOptions" :key="`vhccmc-${i}`" class="w-100px m-10px">
|
|
|
+ <Chart class="w-100% m-auto" height="100px" :option="item.option" />
|
|
|
+ <div class="monitor-center__chart_title">{{ item.title }}</div>
|
|
|
</div>
|
|
|
- </div> -->
|
|
|
+ </div>
|
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
|
import { onMounted, ref } from 'vue';
|
|
|
import { list as cfgList } from '@/views/vent/deviceManager/configurationTable/configuration.api';
|
|
|
import { list } from '@/views/vent/deviceManager/deviceTable/device.api';
|
|
|
- import Pie from '/@/components/chart/Pie.vue';
|
|
|
+ import Chart from '/@/components/chart/Chart.vue';
|
|
|
import { EChartsOption } from 'echarts';
|
|
|
// import mapComponent from './components/3Dmap/index.vue';
|
|
|
|
|
@@ -128,28 +100,131 @@
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- // 图标相关
|
|
|
- const chartOption: EChartsOption = {
|
|
|
- series: [
|
|
|
+ // 图表相关
|
|
|
+ const chartOptions = [
|
|
|
+ { title: '外部漏风率', option: getChartOption(40) },
|
|
|
+ { title: '有效风量率', option: getChartOption(30) },
|
|
|
+ { title: '灵敏度A', option: getChartOption(20) },
|
|
|
+ { title: '灵敏度B', option: getChartOption(50) },
|
|
|
+ ];
|
|
|
+
|
|
|
+ function getChartOption(percent: number): EChartsOption {
|
|
|
+ const data = [
|
|
|
+ // 最下面的一环
|
|
|
{
|
|
|
- type: 'pie',
|
|
|
- radius: ['50%', '75%'],
|
|
|
- center: ['50%', '55%'],
|
|
|
- data: [],
|
|
|
- labelLine: { show: false },
|
|
|
+ // 中间展示数据的一环
|
|
|
+ name: 'root',
|
|
|
+ value: 100,
|
|
|
+ // itemStyle: item1,
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ value: percent,
|
|
|
+ name: 'node-0',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ name: 'leaf-0-0',
|
|
|
+ value: percent,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'node-1',
|
|
|
+ value: 100 - percent,
|
|
|
+ itemStyle: {
|
|
|
+ color: 'transparent',
|
|
|
+ },
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ name: 'leaf-1-0',
|
|
|
+ value: 100 - percent,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ];
|
|
|
+
|
|
|
+ return {
|
|
|
+ title: {
|
|
|
+ text: percent + '%',
|
|
|
+ left: 'center',
|
|
|
+ top: 'center',
|
|
|
+ textStyle: {
|
|
|
+ color: '#0afff0',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ grid: {
|
|
|
+ show: false,
|
|
|
+ },
|
|
|
+ xAxis: { show: false },
|
|
|
+ yAxis: { show: false },
|
|
|
+ series: {
|
|
|
+ startAngle: 270,
|
|
|
+ // radius: ['60%', '90%'],
|
|
|
+ nodeClick: false,
|
|
|
+ type: 'sunburst',
|
|
|
+ sort: undefined,
|
|
|
+ emphasis: {
|
|
|
+ focus: 'none',
|
|
|
+ },
|
|
|
label: {
|
|
|
show: false,
|
|
|
- // formatter: '{b} \n ({d}%)',
|
|
|
- // color: '#B1B9D3',
|
|
|
},
|
|
|
+ labelLine: { show: false },
|
|
|
+ levels: [
|
|
|
+ {},
|
|
|
+ {
|
|
|
+ radius: ['60%', '65%'],
|
|
|
+ // 最靠内测的第一层
|
|
|
+ itemStyle: {
|
|
|
+ color: '#0afff0',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ radius: ['70%', '90%'],
|
|
|
+ itemStyle: {
|
|
|
+ color: {
|
|
|
+ type: 'linear',
|
|
|
+ x: 0,
|
|
|
+ y: 0,
|
|
|
+ x2: 0,
|
|
|
+ y2: 1,
|
|
|
+ colorStops: [
|
|
|
+ {
|
|
|
+ offset: 0,
|
|
|
+ color: '#55fdbf', // 0% 处的颜色
|
|
|
+ },
|
|
|
+ {
|
|
|
+ offset: 0.6,
|
|
|
+ color: '#4bcbff', // 0% 处的颜色
|
|
|
+ },
|
|
|
+ {
|
|
|
+ offset: 1,
|
|
|
+ color: '#56e6ff', // 100% 处的颜色
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ borderWidth: 0,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ radius: ['95%', '100%'],
|
|
|
+ itemStyle: {
|
|
|
+ color: '#0afff0',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
itemStyle: {
|
|
|
- shadowBlur: 20,
|
|
|
- shadowColor: '#259bcf',
|
|
|
+ borderWidth: 0,
|
|
|
+ },
|
|
|
+ tooltip: {
|
|
|
+ show: false,
|
|
|
},
|
|
|
+ silent: true,
|
|
|
+ data,
|
|
|
},
|
|
|
- ],
|
|
|
- color: ['#d9a1ff', '#00d1ff', '#82fe78'],
|
|
|
- };
|
|
|
+ };
|
|
|
+ }
|
|
|
|
|
|
onMounted(() => {
|
|
|
fetchConfig();
|
|
@@ -196,4 +271,10 @@
|
|
|
flex-basis: 20%;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .monitor-center__chart_title {
|
|
|
+ width: 100%;
|
|
|
+ text-align: center;
|
|
|
+ border-bottom: 1px solid @vent-configurable-home-light-border;
|
|
|
+ }
|
|
|
</style>
|