main
wangqiujuan0808 2023-12-04 21:35:21 +08:00
parent 44f628ce78
commit 8a5ab2fcb6
9 changed files with 21 additions and 19 deletions

View File

@ -1,7 +1,6 @@
import { createApp } from 'vue' import { createApp } from 'vue'
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
import "echarts-gl";
import ElementPlus from 'element-plus' import ElementPlus from 'element-plus'
import locale from 'element-plus/lib/locale/lang/zh-cn' // 中文语言 import locale from 'element-plus/lib/locale/lang/zh-cn' // 中文语言

View File

@ -112,23 +112,26 @@ const getPie3D = (pieData, internalDiameterRatio, rateName) => {
fontSize: 14 fontSize: 14
} }
}, },
// formatter: data => { formatter: data => {
// return data.value ? `{title|${data.data.name}}{rich|${data.value}}(次)\n{title|${rateName || '整改率'}}{rich|${data.data.rate}%}` : '' return data.value ? `{title|${data.data.name}}
// } // 值为0的就不展示默认的示例 {rich|${data.data.rate}%}` : ''
} // 值为0的就不展示默认的示例
}, },
tooltip: { tooltip: {
show: true, show: true,
formatter: params => { formatter: params => {
if (params.seriesName !== 'mouseoutSeries' && params.seriesName !== 'pie2d') { if (params.seriesName !== 'mouseoutSeries' && params.seriesName !== 'pie2d') {
console.log(option.series[params.seriesIndex].pieData) console.log(option.series[params.seriesIndex].pieData)
let bfb = ((option.series[params.seriesIndex].pieData.endRatio - option.series[params.seriesIndex].pieData.startRatio) * // let bfb = ((option.series[params.seriesIndex].pieData.endRatio - option.series[params.seriesIndex].pieData.startRatio) *
100).toFixed(2) // 100).toFixed(2)
if (bfb === 'NaN') { // if (bfb === 'NaN') {
bfb = 0 // bfb = 0
} // }
const rate = option.series[params.seriesIndex].pieData.rate;
return `${params.seriesName}: ${option.series[params.seriesIndex].pieData.value}<br/>` + return `${params.seriesName}: ${option.series[params.seriesIndex].pieData.value}<br/>` +
`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${params.color};"></span>占比:` + `<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${params.color};"></span>占比:` +
`${bfb}%` `${rate}%`
} }
} // hover示例 } // hover示例
}, },

View File

@ -43,7 +43,7 @@ const { buildInfo } = toRefs(data);
right: 10px; right: 10px;
// background: #0a1f2e; // background: #0a1f2e;
// border: 1px solid red; // border: 1px solid red;
width: 280px; width: 320px;
height: 340px; height: 340px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@ -69,7 +69,7 @@ const openDialog = () => {
position: absolute; position: absolute;
top: 410px; top: 410px;
right: 10px; right: 10px;
width: 280px; width: 360px;
// height: 460px; // height: 460px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@ -36,7 +36,7 @@ const { deviceInfo } = toRefs(data);
position: absolute; position: absolute;
top: 10px; top: 10px;
right: 10px; right: 10px;
width: 280px; width: 360px;
height: 340px; height: 340px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@ -34,7 +34,7 @@ const { optionsData } = toRefs(data);
const optionData = optionsData.value.map((item) => { const optionData = optionsData.value.map((item) => {
return { return {
...item, ...item,
rate: item.value / 181, rate: (item.value / 100) *100,
}; };
}); });
@ -69,8 +69,8 @@ const openDialog = () => {
position: absolute; position: absolute;
top: 410px; top: 410px;
right: 10px; right: 10px;
width: 280px; width: 360px;
height: 420px; height: 460px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;

View File

@ -38,7 +38,7 @@ const { equipmentInfo } = toRefs(data);
position: absolute; position: absolute;
top: 10px; top: 10px;
right: 10px; right: 10px;
width: 280px; width: 320px;
height: 340px; height: 340px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@ -63,7 +63,7 @@ const openDialog = () => {
position: absolute; position: absolute;
top: 410px; top: 410px;
right: 10px; right: 10px;
width: 280px; width: 320px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;

View File

@ -12,7 +12,7 @@ const props = defineProps({
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.top-div { .top-div {
width: 280px; width: 360px;
height: 56px; height: 56px;
background-size: 100% 100% !important; background-size: 100% 100% !important;
background: url(@/assets/images/top.png) no-repeat; background: url(@/assets/images/top.png) no-repeat;