feat:inputs

This commit is contained in:
wangzenghua 2025-04-25 10:39:07 +01:00
parent a8beddd092
commit 80eec3b9a6
4 changed files with 40 additions and 30 deletions

View File

@ -52,6 +52,16 @@ export default {
}
);
watch(
() => props.option,
() => {
initCharts();
},
{
immediate: true,
}
);
function initCharts() {
if (props.option) {
Object.assign(option, cloneDeep(props.option));

View File

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

View File

@ -10,13 +10,11 @@ const state = reactive({
text: '',
});
const currentText = computed(() => state.text);
const pieData = [
{ value: 530, name: '种源企业', itemStyle: { color: '#8fd7fce8' } },
{ value: 1215, name: '肥料厂家', itemStyle: { color: '#466BE7e8' } },
{ value: 2312, name: '农药厂家', itemStyle: { color: '#F4BB29e8' } },
{ value: 916, name: '其他', itemStyle: { color: '#FF8329' } },
{ value: 33, name: '种源企业', itemStyle: { color: '#8fd7fce8' } },
{ value: 45, name: '肥料厂家', itemStyle: { color: '#466BE7e8' } },
{ value: 22, name: '农药厂家', itemStyle: { color: '#F4BB29e8' } },
{ value: 9, name: '其他', itemStyle: { color: '#FF8329' } },
];
// series-surface.parametricEquation
@ -202,24 +200,24 @@ function getPie3D(pieData, internalDiameterRatio) {
// return `${name} ${target}`;
// },
},
// title: {
// text: `{a|45%}{c|\n}`,
// x: 'center',
// y: 'center',
// textStyle: {
// rich: {
// a: {
// fontSize: 20,
// color: '#fff',
// },
// c: {
// fontSize: 12,
// color: '#fff',
// padding: [15, 0],
// },
// },
// },
// },
title: {
text: '',
x: 'center',
y: 'center',
textStyle: {
rich: {
a: {
fontSize: 20,
color: '#fff',
},
c: {
fontSize: 12,
color: '#fff',
padding: [15, 0],
},
},
},
},
tooltip: {
show: false,
backgroundColor: 'rgba(18, 55, 85, 0.8);',
@ -260,7 +258,7 @@ function getPie3D(pieData, internalDiameterRatio) {
alpha: 45, //( )
distance: 150, //zoom()
rotateSensitivity: 1, //0
zoomSensitivity: 1, //0
zoomSensitivity: 0, //0
panSensitivity: 0, //0
autoRotate: true, //
},
@ -271,13 +269,13 @@ function getPie3D(pieData, internalDiameterRatio) {
}
const handleClick = (params) => {
console.log(270, params);
// state.text = `{a|${params.dataIndex}%}{c|\n${params.seriesName}}`;
// currentText.value =
state.option.title.text = `{a|${params.dataIndex}%}{c|\n${params.seriesName}}`;
};
onMounted(() => {
const option = getPie3D(pieData, 0.8);
const { name, value } = option.series[0].pieData;
option.title.text = `{a|${value}%}{c|\n${name}}`;
state.option = option;
state.data = option.series;
});

View File

@ -57,14 +57,14 @@
@command="handleCommand"
>
<template #back>
<!-- <inputsFive ref="fiveRef" /> -->
<inputsFive ref="fiveRef" />
</template>
</customBack>
</div>
<div class="right-charts-item">
<customBack top-title="投入品白名单/黑名单" :top-postion="'right'">
<template #back>
<!-- <inputsSix /> -->
<inputsSix />
</template>
</customBack>
</div>