Merge branch 'main' of git.zdool.com:xs/ggfwjsc

This commit is contained in:
duanxiaohai 2024-06-14 09:41:19 +08:00
commit ec382403c9
11 changed files with 853 additions and 418 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

View File

@ -27,22 +27,22 @@ axios.interceptors.response.use(
}, },
(error) => { (error) => {
if (error.response) { if (error.response) {
// if (error.response.status == 401) { if (error.response.status == 401) {
// ElMessage.error("请重新登录!"); ElMessage.error("请重新登录!");
// // window.location.href = '/#/login?returnURL=' + window.location.href // window.location.href = '/#/login?returnURL=' + window.location.href
// window.location.href = window.location.href =
// 'http://220.191.238.50:996/api/login?returnURL=' + 'http://220.191.238.50:996/api/login?returnURL=' +
// window.location.href window.location.href
// } else if (error.response.status == 404) { } else if (error.response.status == 404) {
// ElMessage.error("Status:404正在请求不存在的服务器记录"); ElMessage.error("Status:404正在请求不存在的服务器记录");
// } else if (error.response.status == 500) { } else if (error.response.status == 500) {
// ElMessage.error({ ElMessage.error({
// title: '请求错误', title: '请求错误',
// message: "Status:500服务器发生错误" message: "Status:500服务器发生错误"
// }); });
// } else { } else {
// ElMessage.error(`Status:${error.response.status},未知错误!`); ElMessage.error(`Status:${error.response.status},未知错误!`);
// } }
} else { } else {
ElMessage.error("请求服务器无响应!"); ElMessage.error("请求服务器无响应!");
} }

View File

@ -1,462 +1,330 @@
<template> <template>
<div class="module"> <div class="module">
<div class="module_left"> <div class="displayFlex left_bg">
<div class="displayFlex">
<div class="flex1"> <div class="flex1">
<div class="yd_title"> <div class="yd_title left_1">
<span class="text">助乡兴趣点</span> <div class="animate-border">
<i></i>
<i></i>
</div> </div>
<ePie></ePie> </div>
</div>
</div>
<div class="displayFlex center_bg">
<div class="flex1">
<div class="yd_title center_0">
<div class="animate-border">
<i></i>
<i></i>
</div>
</div>
</div> </div>
<div class="flex1"> <div class="flex1">
<div class="yd_title"> <div class="yd_title center_1">
<span class="text">基本信息</span> <div class="animate-border">
</div> <i></i>
<div class="basicInformation"> <i></i>
<div class="basicInformation_item">
<img class="icon" src="../assets/img_01.png" alt="" />
<div class="right">
<div class="label">
<span>学历</span>
</div>
<p>浙江大学研究生</p>
</div>
</div>
<div class="basicInformation_item">
<img class="icon" src="../assets/img_01.png" alt="" />
<div class="right">
<div class="label">
<span>性格</span>
</div>
<p>沉稳</p>
</div>
</div>
<div class="basicInformation_item">
<img class="icon" src="../assets/img_01.png" alt="" />
<div class="right">
<div class="label">
<span>分类</span>
</div>
<p>乡贤代表</p>
</div>
</div>
<div class="basicInformation_item">
<img class="icon" src="../assets/img_01.png" alt="" />
<div class="right">
<div class="label">
<span>所属行业</span>
</div>
<p>计算机<br />应用专家</p>
</div>
</div>
<div class="basicInformation_item">
<img class="icon" src="../assets/img_01.png" alt="" />
<div class="right">
<div class="label">
<span>家属情况</span>
</div>
<p>父母去世姨妈 在象</p>
</div>
</div>
<div class="basicInformation_item">
<img class="icon" src="../assets/img_01.png" alt="" />
<div class="right">
<div class="label">
<span>对乡情感</span>
</div>
<p>积极参与</p>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> <div class="displayFlex right_bg">
<div class="displayFlex">
<div class="flex1"> <div class="flex1">
<div class="yd_title"> <div class="yd_title right_1">
<span class="text">活动数据分析</span> <div class="animate-border">
</div> <i></i>
<eGraph></eGraph> <i></i>
</div>
<div class="flex1">
<div class="yd_title">
<span class="text">走访日志</span>
</div>
<div class="visitLog">
<div class="visitLog_item">
<img
src="../assets/img_02.png"
width="48px"
height="51px"
alt=""
/>
<div class="visitLog_item_box">
<h4>故居走访</h4>
<p>走访人员陈思思</p>
<p>走访时间2023-03-19 09:00:03</p>
</div>
<span class="check">点击查看</span>
</div>
<div class="visitLog_item">
<img
src="../assets/img_02.png"
width="48px"
height="51px"
alt=""
/>
<div class="visitLog_item_box">
<h4>节日走访</h4>
<p>走访人员陈思思</p>
<p>走访时间2023-03-19 09:00:03</p>
</div>
<span class="check">点击查看</span>
</div>
<div class="visitLog_item">
<img
src="../assets/img_02.png"
width="48px"
height="51px"
alt=""
/>
<div class="visitLog_item_box">
<h4>新年走访</h4>
<p>走访人员陈思思</p>
<p>走访时间2023-03-19 09:00:03</p>
</div>
<span class="check">点击查看</span>
</div>
</div>
</div>
</div>
<div class="displayFlex">
<div class="flex1">
<div class="yd_title">
<span class="text">个人经历</span>
</div>
<div class="history">
<p>2002年至2009年担任浙江大学计算机学院和软件学院院长</p>
<p>1984年获得浙江大学计算机应用专业硕士学位之后留校任教</p>
<p>1990年获得浙江大学计算机应用专业博士学位</p>
<p>1994年至1996年担任浙江大学计算机系副系主任</p>
<p>1997年至2002年担任浙江大学计算机系系主任</p>
<p>2002年至2009年担任浙江大学计算机学院和软件学院院长</p>
</div>
</div>
<div class="flex1">
<div class="yd_title">
<span class="text">职位</span>
</div>
<eBubble></eBubble>
</div>
</div>
<div></div>
</div>
<!-- <div class="module_right">
<div class="flex1">
<div class="yd_title">
<span class="text">关注标签</span>
</div>
<div class="concernLabel">
<span>计算机</span>
<span>大数据</span>
<span>互联网</span>
</div>
</div>
<div class="flex1">
<div class="yd_title">
<span class="text">助乡属性</span>
</div>
<div class="property">
<div class="property_box">
<h5>助乡方式</h5>
<p>科技助乡</p>
</div>
<div class="property_box">
<h5>助乡意向</h5>
<p>积极</p>
</div>
</div>
<div class="activity">
<h5>助乡活动</h5>
<div class="activity_content">
<div class="activity_box">
<p>
2021.2象山县委统战部和象山电视台工作人员前往杭州浙江大学拍摄天南地北象山人
</p>
</div>
<div class="activity_box">
<p>
2020.8.29陈纯院士参加在象山举办的浙江省海外高层次人才联谊会并作院士报告
</p>
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="flex1"> <div class="flex1">
<div class="yd_title"> <div class="yd_title right_2">
<span class="text">信息监测</span> <div class="animate-border">
</div> <i></i>
<div class="monitor"> <i></i>
<div class="monitor_box">
<img src="../assets/img_10.png" alt="" />
<div class="monitor_box_text">
<h4>智汇青春 有梦当燃这场全国大赛决赛在西子湖畔收官</h4>
<p>2023-03-18</p>
</div> </div>
</div> </div>
<div class="monitor_box"> </div>
<img src="../assets/img_09.png" alt="" /> <div class="flex1">
<div class="monitor_box_text"> <div class="yd_title right_3">
<h4>智汇青春 有梦当燃这场全国大赛决赛在西子湖畔收官</h4> <div class="animate-border">
<p>2023-03-18</p> <i></i>
<i></i>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> -->
</div> </div>
</template> </template>
<script setup> <script setup>
// import eBubble from "./echarts/bubble.vue"; import { ref, reactive, onMounted, onBeforeMount, computed } from "vue";
// import ePie from "./echarts/pie.vue"; import http from "@/utils/request.js";
// import ePie2 from "./echarts/pie2.vue";
// import eGraph from "./echarts/graph.vue"; onMounted(() => {
});
onBeforeMount(() => {
});
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.displayFlex { .displayFlex {
box-sizing: border-box;
height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 100%; // flex: 1;
} width: 30%;
.flex1 {
flex: 1;
padding: 0 38px;
box-sizing: border-box;
}
.module {
display: flex;
.module_left {
display: flex;
}
// .module_right {
// flex: 0 0 25%;
// }
} }
.yd_title { .flex1 {
background-image: url(@/assets/img_04.png); flex: 1;
// padding: 0 28px;
box-sizing: border-box;
}
.module {
display: flex;
width: 100%;
}
.left_bg {
width: 642px;
// height: 100%;
box-sizing: border-box;
padding-left: 50px;
padding-right: 20px;
margin-right: 28px;
background-image: url(@/assets/images/left_bg.png);
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
}
.center_bg {
width: 582px;
box-sizing: border-box; box-sizing: border-box;
width: 100%; padding-left: 10px;
height: 36px; padding-right: 10px;
background-image: url(@/assets/images/center_bg.png);
background-repeat: no-repeat;
background-size: 100% 100%;
}
.right_bg {
width: 642px;
box-sizing: border-box;
padding-right: 50px;
padding-left: 20px;
margin-left: 28px;
background-image: url(@/assets/images/right_bg.png);
background-repeat: no-repeat;
background-size: 100% 100%;
}
.left_1 {
background-image: url(@/assets/images/sjfx/lnrsjfx.png);
background-repeat: no-repeat;
background-size: 100% 100%;
}
.center_0 {
background-image: url(@/assets/images/sjfx/bft.png);
background-repeat: no-repeat;
background-size: 100% 100%;
}
.center_1 {
background-image: url(@/assets/images/sjfx/ymt.png);
background-repeat: no-repeat;
background-size: 100% 100%;
}
.right_1 {
background-image: url(@/assets/images/sjfx/wjybry.png);
background-repeat: no-repeat;
background-size: 100% 100%;
}
.right_2 {
background-image: url(@/assets/images/sjfx/xxts.png);
background-repeat: no-repeat;
background-size: 100% 100%;
}
.right_3 {
background-image: url(@/assets/images/sjfx/jtzk.png);
background-repeat: no-repeat;
background-size: 100% 100%;
}
.yd_title {
box-sizing: border-box;
width: 98%;
height: 42px;
position: relative; position: relative;
overflow: hidden;
.text { .text {
display: flex;
position: absolute;
font-size: 16px; font-size: 16px;
font-family: SourceHanSansCN; font-family: SourceHanSansCN;
font-weight: bold; font-weight: bold;
color: #ffffff; color: #ffffff;
position: absolute; position: absolute;
left: 33px; right: 5px;
top: 3px; top: 3px;
} } /* 利用伪元素和两个i元素产生4条线 */
} .animate-border {
position: absolute;
.basicInformation { top: 0px;
display: flex; width: 100%;
flex-direction: row;
flex-wrap: wrap;
padding-top: 22px;
.basicInformation_item {
flex: 0 0 50%;
padding: 0 2px;
margin-bottom: 10px;
margin-top: 10px;
box-sizing: border-box;
display: flex;
align-items: center;
.icon {
width: 79px;
height: 47px;
}
.right {
margin-left: 4px;
.label {
background-image: url(@/assets/img_11.png);
background-size: 100%;
background-repeat: no-repeat;
background-position: bottom;
margin-bottom: 4px;
span {
font-size: 12px;
font-weight: 400;
color: #eff0f1;
line-height: 19px;
margin-left: 2px;
}
}
p {
font-size: 16px;
font-weight: bold;
color: #6acbff;
line-height: 24px;
}
}
}
}
.visitLog {
.visitLog_item {
display: flex;
align-items: center;
background-image: url(@/assets/img_12.png);
background-size: 100% 100%;
margin-top: 16px;
padding: 15px 8px;
box-sizing: border-box;
img {
display: inline-block;
margin-right: 10px;
}
.visitLog_item_box {
flex: auto;
h4 {
font-size: 18px;
font-family: MicrosoftYaHei;
font-weight: bold;
color: #0096ff;
margin-bottom: 2px;
}
p {
font-size: 12px;
font-family: SourceHanSansCN;
font-weight: 400;
color: #ffffff;
margin-top: 6px;
}
}
.check {
font-size: 12px;
font-family: SourceHanSansCN;
font-weight: 400;
color: #0096ff;
line-height: 20px;
}
}
}
.history {
padding-top: 12px;
p {
margin-top: 12px;
font-size: 12px;
font-weight: 400;
color: #ffffff;
line-height: 28px;
border-bottom: 13px solid rgba(57, 59, 109, 1);
}
}
.concernLabel {
display: flex;
align-items: center;
justify-content: center;
margin: 12px 0 20px;
span {
text-align: center;
background: rgba(0, 89, 130, 0.73);
border-radius: 10px;
width: 118px;
height: 49px;
line-height: 49px;
font-size: 18px;
font-weight: 400;
color: #ffffff;
margin: 0 10px;
}
}
.property {
display: flex;
padding: 14px 0 10px;
.property_box {
background-image: url(@/assets/img_05.png);
background-size: 100% 100%;
background-repeat: no-repeat;
width: 179px;
height: 91px;
margin: 0 12px;
text-align: center;
h5 {
font-size: 14px;
font-weight: 400;
color: #ffffff;
margin: 9px 0 16px;
}
p {
font-size: 21px;
font-weight: bold;
color: #48ece7;
}
}
}
.activity {
h5 {
font-size: 14px;
font-weight: bold;
color: rgba(0, 164, 250, 0.8);
line-height: 47px;
border-bottom: 2px solid rgba(0, 164, 250, 1);
margin-bottom: 17px;
}
.activity_content {
margin: 0 -6px 12px;
display: flex;
.activity_box {
width: 50%;
display: inline-block;
margin: 0 6px;
box-sizing: border-box;
background-color: rgba(15, 28, 54, 1);
padding: 12px 12px 19px;
p {
font-size: 14px;
font-weight: 400;
color: #ffffff;
line-height: 27px;
height: 100%; height: 100%;
&::before,
&::after {
content: "";
position: absolute;
width: 100%;
height: 2px;
}
i {
position: absolute;
display: inline-block;
height: 100%;
width: 2px;
}
&::before {
top: 0;
left: -100%;
background-image: linear-gradient(
90deg,
transparent,
#03e9f4,
transparent
);
animation: one 4s linear infinite;
}
i:nth-child(1) {
top: -100%;
right: 0;
background-image: linear-gradient(
180deg,
transparent,
#03e9f4,
transparent
);
/* 动画名称 动画持续时间 动画渲染函数 动画延迟时间 动画执行次数 */
animation: two 4s linear 1s infinite;
}
&::after {
bottom: 0;
right: -100%;
background-image: linear-gradient(
-90deg,
transparent,
#03e9f4,
transparent
);
animation: three 4s linear 2s infinite;
}
i:nth-child(2) {
bottom: -100%;
left: 0;
background-image: linear-gradient(
360deg,
transparent,
#03e9f4,
transparent
);
animation: four 4s linear 3s infinite;
} }
} }
} }
@keyframes one {
0% {
left: -100%;
} }
.monitor { 50%,
.monitor_box { 100% {
display: flex; left: 100%;
padding: 8px 0;
border-bottom: 2px solid rgba(255, 255, 255, 0.67);
img {
width: 115px;
height: 84px;
margin-right: 21px;
}
.monitor_box_text {
display: flex;
flex-direction: column;
justify-content: space-between;
h4 {
font-size: 14px;
font-weight: 400;
color: #ffffff;
line-height: 20px;
}
p {
font-size: 14px;
font-weight: 400;
color: #818181;
line-height: 23px;
} }
} }
@keyframes two {
0% {
top: -100%;
} }
50%,
100% {
top: 100%;
}
}
@keyframes three {
0% {
right: -100%;
}
50%,
100% {
right: 100%;
}
}
@keyframes four {
0% {
bottom: -100%;
}
50%,
100% {
bottom: 100%;
}
}
.mechanism {
background-image: url(@/assets/YLTitle/titleImg10.png);
background-repeat: no-repeat;
background-size: 100% 100%;
}
.flex11 {
padding: 12px 0;
}
/* 滚动条整体部分 */
.rolling::-webkit-scrollbar {
width: 5px;
// height: 10px;
}
/* 滚动槽 */
.rolling::-webkit-scrollbar-track {
border-radius: 1px;
background: rgba(0, 128, 231, 0.56);
-webkit-box-shadow: inset 0 0 6px rgba(139, 139, 139, 0.3);
}
/* 滚动条滑块样式 */
.rolling::-webkit-scrollbar-thumb {
background-clip: content-box;
border-radius: 6px;
background: rgba(0, 162, 231, 1);
-webkit-box-shadow: inset 0 0 6px rgba(20, 20, 20, 0.3);
} }
</style> </style>

View File

@ -0,0 +1,567 @@
<template>
<div
ref="chart"
style="width: 100%; height: 250px"
></div>
</template>
<script setup>
import {
onMounted,
onBeforeMount,
ref,
reactive,
defineProps,
nextTick,
} from "vue";
// echarts
import * as echarts from "echarts";
import "echarts-gl";
const props = defineProps({
list: {
type: Array,
default: () => {
return [];
},
},
});
const chart = ref(); // DOM
const data = reactive({
list: [],
// pieData: [
// {
// name: "61-70", //
// value: "", //
// },
// {
// name: "71-80",
// value: "",
// },
// {
// name: "81-90",
// value: "",
// },
// {
// name: "91-100",
// value: "",
// },
// {
// name: "100",
// value: "",
// },
// ],
option: {},
});
const colorList = [
"#FFE35F",
"#0081FF",
"#8ABEDB",
"#25B9C8",
"#30EB92",
"rgba(69, 244, 245)",
"rgba(7, 166, 255)",
"rgba(255, 208, 118)",
"rgba(109, 168, 198)",
"rgba(255, 255, 255)",
];
const pieData = reactive([
{
name: "高血压", //
value: 0, //
},
{
name: "非高血压",
value: 0,
},
]);
// const serData = pieData.map((dItem, index) => {
// return {
// ...dItem,
// value: Number(dItem.value),
// itemStyle: {
// color: colorList[index],
// },
// };
// });
//
// const option = getPie3D(serData, 0.8);
const getOption = () => {
const serData = pieData.map((dItem, index) => {
return {
...dItem,
value: Number(dItem.value),
itemStyle: {
color: colorList[index],
},
};
});
data.option = getPie3D(serData, 0.8);
};
// 3D
function getPie3D(pieData, internalDiameterRatio) {
let series = [];
let sumValue = 0;
let startValue = 0;
let endValue = 0;
let legendData = [];
let k =
typeof internalDiameterRatio !== "undefined"
? (1 - internalDiameterRatio) / (1 + internalDiameterRatio)
: 1 / 3;
// series-surface
for (let i = 0; i < pieData.length; i++) {
sumValue += pieData[i].value;
let seriesItem = {
name:
typeof pieData[i].name === "undefined" ? `series${i}` : pieData[i].name,
type: "surface",
parametric: true,
wireframe: {
show: false,
},
pieData: pieData[i],
pieStatus: {
selected: false,
hovered: false,
k: 1 / 10,
},
};
if (typeof pieData[i].itemStyle != "undefined") {
let itemStyle = {};
typeof pieData[i].itemStyle.color != "undefined"
? (itemStyle.color = pieData[i].itemStyle.color)
: null;
typeof pieData[i].itemStyle.opacity != "undefined"
? (itemStyle.opacity = pieData[i].itemStyle.opacity)
: null;
seriesItem.itemStyle = itemStyle;
}
series.push(seriesItem);
}
// 使 sumValue getParametricEquation
// series-surface series-surface.parametricEquation
for (let i = 0; i < series.length; i++) {
endValue = startValue + series[i].pieData.value;
series[i].pieData.startRatio = startValue / sumValue;
series[i].pieData.endRatio = endValue / sumValue;
series[i].parametricEquation = getParametricEquation(
series[i].pieData.startRatio,
series[i].pieData.endRatio,
false,
false,
k,
series[i].pieData.value
);
startValue = endValue;
legendData.push(series[i].name);
}
// //
// series.push({
// name: 'mouseoutSeries',
// type: 'surface',
// parametric: true,
// wireframe: {
// show: false,
// },
// width: '30px',
// itemStyle: {
// opacity: 0.7,
// color: '#fff',
// },
// parametricEquation: {
// u: {
// min: 0,
// max: Math.PI * 2,
// step: Math.PI / 20,
// },
// v: {
// min: 0,
// max: Math.PI ,
// step: Math.PI / 20,
// },
// x: function (u, v) {
// return ((Math.sin(v) * Math.sin(u) + Math.sin(u)) / Math.PI);
// },
// y: function (u, v) {
// return ((Math.sin(v) * Math.cos(u) + Math.cos(u)) / Math.PI) ;
// },
// z: function (u, v) {
// return Math.cos(v) > 0 ? -6 : -7;
// },
// },
// });
// legendDataseries
let option = {
//animation: false,
//
legend: {
data: legendData,
color: [
"#8FD7FC",
"#466BE7",
"#F4BB29",
"#49C384",
"#8FD7FC",
"#466BE7",
"#F4BB29",
"#49C384",
],
width: "40%",
//
orient: "vertical",
right: 20,
top: "center",
//
itemGap: 10,
show: false,
icon: "rect",
itemHeight: 10,
itemWidth: 25,
textStyle: {
//
fontSize: 16,
color: "#FFFFFF",
lineHeight: 20,
},
//
formatter: function (name) {
var target;
for (var i = 0, l = pieData.length; i < l; i++) {
if (pieData[i].name == name) {
target = pieData[i].value;
}
}
if (name == "91-100岁") {
return ` ${name} ${target}`;
} else if (name == "100岁以上") {
return ` ${name} ${target}`;
} else {
return ` ${name} ${target}`;
}
},
},
//
tooltip: {
backgroundColor: "rgba(18, 55, 85, 0.8);",
borderColor: "transparent",
formatter: (params) => {
if (
params.seriesName !== "mouseoutSeries" &&
params.seriesName !== "pie2d"
) {
let bfb = (
(option.series[params.seriesIndex].pieData.endRatio -
option.series[params.seriesIndex].pieData.startRatio) *
100
).toFixed(2);
const value = option.series[params.seriesIndex].pieData.value;
return (
`<div style='color:#FFFFFF;'>` +
`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${params.color};"></span>` +
`${params.seriesName}<br/>` +
`<span style='margin-right:20px'>${value}人</span>` +
`<span >${bfb}%</span>` +
`</div>`
);
}
},
},
xAxis3D: {},
yAxis3D: {},
zAxis3D: {},
grid3D: {
viewControl: {
autoRotate: true,
rotateSensitivity: 0, //0
zoomSensitivity: 0, //0
panSensitivity: 0, //0
alpha: 25, //( )
distance: 100, //zoom()
},
top: "-30",
left: "-120",
width: "100%",
show: false,
boxHeight: 20,
},
series: series,
};
return option;
}
// series-surface.parametricEquation
function getParametricEquation(
startRatio,
endRatio,
isSelected,
isHovered,
k,
h
) {
//
let midRatio = (startRatio + endRatio) / 2;
let startRadian = startRatio * Math.PI * 2;
let endRadian = endRatio * Math.PI * 2;
let midRadian = midRatio * Math.PI * 2;
//
if (startRatio === 0 && endRatio === 1) {
isSelected = false;
}
// / k 1/3
k = typeof k !== "undefined" ? k : 1 / 3;
// x y 0
let offsetX = isSelected ? Math.cos(midRadian) * 0.1 : 0;
let offsetY = isSelected ? Math.sin(midRadian) * 0.1 : 0;
// 1
let hoverRate = isHovered ? 1.05 : 1;
//
return {
u: {
min: -Math.PI,
max: Math.PI * 3,
step: Math.PI / 32,
},
v: {
min: 0,
max: Math.PI * 2,
step: Math.PI / 20,
},
x: function (u, v) {
if (u < startRadian) {
return (
offsetX + Math.cos(startRadian) * (1 + Math.cos(v) * k) * hoverRate
);
}
if (u > endRadian) {
return (
offsetX + Math.cos(endRadian) * (1 + Math.cos(v) * k) * hoverRate
);
}
return offsetX + Math.cos(u) * (1 + Math.cos(v) * k) * hoverRate;
},
y: function (u, v) {
if (u < startRadian) {
return (
offsetY + Math.sin(startRadian) * (1 + Math.cos(v) * k) * hoverRate
);
}
if (u > endRadian) {
return (
offsetY + Math.sin(endRadian) * (1 + Math.cos(v) * k) * hoverRate
);
}
return offsetY + Math.sin(u) * (1 + Math.cos(v) * k) * hoverRate;
},
z: function (u, v) {
if (u < -Math.PI * 0.5) {
return Math.sin(u);
}
if (u > Math.PI * 2.5) {
return Math.sin(u) * h * 0.1;
}
return Math.sin(v) > 0 ? 1 * h * 0.1 : -1;
},
};
}
//
function bindListen(myChart) {
let selectedIndex = "";
let hoveredIndex = "";
//
myChart.on("click", function (params) {
// option.series
let isSelected = !option.series[params.seriesIndex].pieStatus.selected;
let isHovered = option.series[params.seriesIndex].pieStatus.hovered;
let k = option.series[params.seriesIndex].pieStatus.k;
let startRatio = option.series[params.seriesIndex].pieData.startRatio;
let endRatio = option.series[params.seriesIndex].pieData.endRatio;
// option
if (selectedIndex !== "" && selectedIndex !== params.seriesIndex) {
option.series[selectedIndex].parametricEquation = getParametricEquation(
option.series[selectedIndex].pieData.startRatio,
option.series[selectedIndex].pieData.endRatio,
false,
false,
k,
option.series[selectedIndex].pieData.value
);
option.series[selectedIndex].pieStatus.selected = false;
}
// / option
option.series[params.seriesIndex].parametricEquation =
getParametricEquation(
startRatio,
endRatio,
isSelected,
isHovered,
k,
option.series[params.seriesIndex].pieData.value
);
option.series[params.seriesIndex].pieStatus.selected = isSelected;
// seriesIndex
isSelected ? (selectedIndex = params.seriesIndex) : null;
// 使 option
myChart.setOption(option);
});
// mouseover
myChart.on("mouseover", function (params) {
//
let isSelected;
let isHovered;
let startRatio;
let endRatio;
let k;
// mouseover
if (hoveredIndex === params.seriesIndex) {
return;
//
} else {
// option
if (hoveredIndex !== "") {
// option.series false
isSelected = option.series[hoveredIndex].pieStatus.selected;
isHovered = false;
startRatio = option.series[hoveredIndex].pieData.startRatio;
endRatio = option.series[hoveredIndex].pieData.endRatio;
k = option.series[hoveredIndex].pieStatus.k;
// option
option.series[hoveredIndex].parametricEquation = getParametricEquation(
startRatio,
endRatio,
isSelected,
isHovered,
k,
option.series[hoveredIndex].pieData.value
);
option.series[hoveredIndex].pieStatus.hovered = isHovered;
// seriesIndex
hoveredIndex = "";
}
// mouseover option
if (
params.seriesName !== "mouseoutSeries" &&
params.seriesName !== "pie2d"
) {
// option.series true
isSelected = option.series[params.seriesIndex].pieStatus.selected;
isHovered = true;
startRatio = option.series[params.seriesIndex].pieData.startRatio;
endRatio = option.series[params.seriesIndex].pieData.endRatio;
k = option.series[params.seriesIndex].pieStatus.k;
// option
option.series[params.seriesIndex].parametricEquation =
getParametricEquation(
startRatio,
endRatio,
isSelected,
isHovered,
k,
option.series[params.seriesIndex].pieData.value + 5
);
option.series[params.seriesIndex].pieStatus.hovered = isHovered;
// seriesIndex
hoveredIndex = params.seriesIndex;
}
// 使 option
myChart.setOption(option);
}
});
// bug
myChart.on("globalout", function () {
//
let isSelected;
let isHovered;
let startRatio;
let endRatio;
let k;
if (hoveredIndex !== "") {
// option.series true
isSelected = option.series[hoveredIndex].pieStatus.selected;
isHovered = false;
k = option.series[hoveredIndex].pieStatus.k;
startRatio = option.series[hoveredIndex].pieData.startRatio;
endRatio = option.series[hoveredIndex].pieData.endRatio;
// option
option.series[hoveredIndex].parametricEquation = getParametricEquation(
startRatio,
endRatio,
isSelected,
isHovered,
k,
option.series[hoveredIndex].pieData.value
);
option.series[hoveredIndex].pieStatus.hovered = isHovered;
// seriesIndex
hoveredIndex = "";
}
// 使 option
myChart.setOption(option);
});
}
// 使
// onMounted(() => {
// // domecharts
// // var myChart = echarts.init(document.getElementById('main'));
// // Vue3
// var myChart = echarts.init(chart.value);
// //
// // bindListen(myChart)
// // init(); // vue3.2this
// // 使
// myChart.setOption(option);
// // :
// window.addEventListener("resize", () => {
// myChart.resize();
// });
// });
const setChart = () => {
var myChart = echarts.init(chart.value);
myChart.setOption(data.option);
// :
window.addEventListener("resize", () => {
myChart.resize();
});
};
// 使
onBeforeMount(() => {
setTimeout(() => {
// data.list = props.list;
data.list = {
gxy:"1500",
notGxy:"1610",
}
pieData[0].value = data.list.gxy;
pieData[1].value = data.list.notGxy;
getOption();
setChart();
}, 600);
});
</script>
<style scoped></style>