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() { function initCharts() {
if (props.option) { if (props.option) {
Object.assign(option, cloneDeep(props.option)); Object.assign(option, cloneDeep(props.option));

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

View File

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

View File

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