feat;styles

This commit is contained in:
wangzenghua 2025-04-25 09:59:34 +01:00
parent 61e562e66d
commit a8beddd092
7 changed files with 40 additions and 25 deletions

View File

@ -8,3 +8,7 @@
flex-direction: column; flex-direction: column;
} }
} }
.custom-echarts-tips {
color: #fff;
}

View File

@ -2,13 +2,16 @@
<custom-echart-pie-3d :chart-data="state.data" height="100%" :option="state.option" @click="handleClick" /> <custom-echart-pie-3d :chart-data="state.data" height="100%" :option="state.option" @click="handleClick" />
</template> </template>
<script setup> <script setup>
import { reactive, ref, onMounted } from 'vue'; import { reactive, ref, onMounted, computed } from 'vue';
const state = reactive({ const state = reactive({
option: {}, option: {},
data: [], data: [],
text: '',
}); });
const currentText = computed(() => state.text);
const pieData = [ const pieData = [
{ value: 530, name: '种源企业', itemStyle: { color: '#8fd7fce8' } }, { value: 530, name: '种源企业', itemStyle: { color: '#8fd7fce8' } },
{ value: 1215, name: '肥料厂家', itemStyle: { color: '#466BE7e8' } }, { value: 1215, name: '肥料厂家', itemStyle: { color: '#466BE7e8' } },
@ -178,7 +181,7 @@ function getPie3D(pieData, internalDiameterRatio) {
legend: { legend: {
data: legendData, data: legendData,
color: ['#8FD7FC', '#466BE7', '#F4BB29', '#49C384', '#8FD7FC', '#466BE7', '#F4BB29', '#49C384'], color: ['#8FD7FC', '#466BE7', '#F4BB29', '#49C384', '#8FD7FC', '#466BE7', '#F4BB29', '#49C384'],
bottom: 20, bottom: 10,
itemGap: 20, itemGap: 20,
show: true, show: true,
icon: 'rect', icon: 'rect',
@ -199,24 +202,24 @@ function getPie3D(pieData, internalDiameterRatio) {
// return `${name} ${target}`; // return `${name} ${target}`;
// }, // },
}, },
title: { // title: {
text: `{a|45%}{c|\n肥料厂家}`, // text: `{a|45%}{c|\n}`,
x: 'center', // x: 'center',
y: 'center', // y: 'center',
textStyle: { // textStyle: {
rich: { // rich: {
a: { // a: {
fontSize: 20, // fontSize: 20,
color: '#fff', // color: '#fff',
}, // },
c: { // c: {
fontSize: 12, // fontSize: 12,
color: '#fff', // color: '#fff',
padding: [15, 0], // padding: [15, 0],
}, // },
}, // },
}, // },
}, // },
tooltip: { tooltip: {
show: false, show: false,
backgroundColor: 'rgba(18, 55, 85, 0.8);', backgroundColor: 'rgba(18, 55, 85, 0.8);',
@ -252,10 +255,10 @@ function getPie3D(pieData, internalDiameterRatio) {
show: false, show: false,
boxHeight: boxHeight, boxHeight: boxHeight,
left: 0, left: 0,
top: -10, top: -30,
viewControl: { viewControl: {
alpha: 45, //( ) alpha: 45, //( )
distance: 180, //zoom() distance: 150, //zoom()
rotateSensitivity: 1, //0 rotateSensitivity: 1, //0
zoomSensitivity: 1, //0 zoomSensitivity: 1, //0
panSensitivity: 0, //0 panSensitivity: 0, //0
@ -269,7 +272,8 @@ function getPie3D(pieData, internalDiameterRatio) {
const handleClick = (params) => { const handleClick = (params) => {
console.log(270, params); console.log(270, params);
// console.log(270, params.seriesName, params.dataIndex); // state.text = `{a|${params.dataIndex}%}{c|\n${params.seriesName}}`;
// currentText.value =
}; };
onMounted(() => { onMounted(() => {

View File

@ -82,6 +82,7 @@ const state = reactive({
justify-content: space-between; justify-content: space-between;
em { em {
color: #02fd94; color: #02fd94;
font-style: normal;
} }
} }
} }

View File

@ -18,6 +18,8 @@ const state = reactive({
axisPointer: { axisPointer: {
type: 'shadow', type: 'shadow',
}, },
backgroundColor: 'rgba(18, 55, 85, 0.8);',
borderColor: '#35d0c0',
formatter: (data) => { formatter: (data) => {
const params = data[0]; const params = data[0];
let str = `<div class="custom-echarts-tips"> let str = `<div class="custom-echarts-tips">

View File

@ -11,14 +11,14 @@
<div class="left-charts-item"> <div class="left-charts-item">
<customBack top-title="投入品检测监管" :top-postion="'left'"> <customBack top-title="投入品检测监管" :top-postion="'left'">
<template #back> <template #back>
<!-- <inputsTwo /> --> <inputsTwo />
</template> </template>
</customBack> </customBack>
</div> </div>
<div class="left-charts-item"> <div class="left-charts-item">
<customBack top-title="投入品金额对比" :top-postion="'left'"> <customBack top-title="投入品金额对比" :top-postion="'left'">
<template #back> <template #back>
<!-- <inputsThere /> --> <inputsThere />
</template> </template>
</customBack> </customBack>
</div> </div>

View File

@ -18,6 +18,8 @@ const state = reactive({
axisPointer: { axisPointer: {
type: 'shadow', type: 'shadow',
}, },
backgroundColor: 'rgba(18, 55, 85, 0.8);',
borderColor: '#35d0c0',
formatter: (data) => { formatter: (data) => {
const params = data[0]; const params = data[0];
let str = `<div class="custom-echarts-tips"> let str = `<div class="custom-echarts-tips">

View File

@ -26,6 +26,8 @@ const state = reactive({
axisPointer: { axisPointer: {
type: 'shadow', type: 'shadow',
}, },
backgroundColor: 'rgba(18, 55, 85, 0.8);',
borderColor: '#35d0c0',
formatter: (data) => { formatter: (data) => {
const params = data[0]; const params = data[0];
let str = `<div class="custom-echarts-tips"> let str = `<div class="custom-echarts-tips">