feat:inputs
This commit is contained in:
parent
a8beddd092
commit
80eec3b9a6
@ -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));
|
||||||
|
@ -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">
|
||||||
|
@ -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;
|
||||||
});
|
});
|
||||||
|
@ -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>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user