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

This commit is contained in:
姚宇浩 2024-06-14 10:52:55 +08:00
commit 033a408622
5 changed files with 692 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -18,6 +18,14 @@
<i></i> <i></i>
</div> </div>
</div> </div>
<div class="minTopTitle"></div>
<div class="minTopNum">
<div class="numItem" v-for="(item,inex) in minData.minTop" :key="index">{{ item }}</div>
</div>
<!-- <div class="minPie">
<Pie3dMt :list="minData.minPieData1"></Pie3dMt>
</div> -->
</div> </div>
<div class="flex1"> <div class="flex1">
<div class="yd_title center_1"> <div class="yd_title center_1">
@ -62,11 +70,36 @@
</template> </template>
<script setup> <script setup>
import Pie3dMt from "./echart_analyze/pie3dMt.vue";
import { ref, reactive, onMounted, onBeforeMount, computed } from "vue"; import { ref, reactive, onMounted, onBeforeMount, computed } from "vue";
import right2 from "./echart_analyze/right2.vue"; import right2 from "./echart_analyze/right2.vue";
import right1 from "./echart_analyze/right1.vue"; import right1 from "./echart_analyze/right1.vue";
import http from "@/utils/request.js"; import http from "@/utils/request.js";
const minData = reactive({
minTop: ['4','9','1','6','2','人'],
minPieData1: {
wfgz:"1500",
xstp:"1610",
skym:"1610",
xxdc:"1610",
dzzh:"1610",
zq:"1610",
}
})
const minData = reactive({
minTop: ['4','9','1','6','2','人'],
minPieData1: {
wfgz:"1500",
xstp:"1610",
skym:"1610",
xxdc:"1610",
dzzh:"1610",
zq:"1610",
}
})
onMounted(() => {}); onMounted(() => {});
onBeforeMount(() => {}); onBeforeMount(() => {});
@ -284,6 +317,7 @@ onBeforeMount(() => {});
} }
} }
.mechanism { .mechanism {
background-image: url(@/assets/YLTitle/titleImg10.png); background-image: url(@/assets/YLTitle/titleImg10.png);
background-repeat: no-repeat; background-repeat: no-repeat;
@ -323,4 +357,57 @@ onBeforeMount(() => {});
background: rgba(0, 162, 231, 1); background: rgba(0, 162, 231, 1);
-webkit-box-shadow: inset 0 0 6px rgba(20, 20, 20, 0.3); -webkit-box-shadow: inset 0 0 6px rgba(20, 20, 20, 0.3);
} }
.minTopTitle {
width: 100%;
height: 28px;
background-image: url(@/assets/images/sjfx/yjj.png);
background-repeat: no-repeat;
background-size: 100% 100%;
margin: 4px auto;
margin-top: 13px;
}
.minTopNum {
width: 100%;
height: 120px;
display: flex;
align-items: center;
justify-content: center;
.numItem {
width: 72px;
height: 114px;
text-align: center;
line-height: 114px;
font-weight: 400;
font-size: 60px;
margin: 0 3px;
color: #ffffff;
text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.5);
background-image: url(@/assets/images/sjfx/mtNum.png);
background-repeat: no-repeat;
background-size: 100% 100%;
}
.numItem:last-child {
width: 72px;
height: 114px;
text-align: center;
line-height: 114px;
font-weight: 400;
font-size: 36px;
margin: 0 3px;
color: #ffffff;
text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.5);
background-image: url(@/assets/images/sjfx/mtNum2.png);
background-repeat: no-repeat;
background-size: 100% 100%;
}
}
.minPie{
width: 100%;
position: relative;
margin: -10px 0;
.minPieImg{
}
}
</style> </style>

View File

@ -0,0 +1,582 @@
<template>
<div
ref="chart"
style="width: 100%; height: 240px"
></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: Object,
},
});
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, //
per: 2,
},
{
name: "下山脱贫",
value: 0,
per: 8,
},
{
name: "水库移民",
value: 0,
per: 10,
},
{
name: "小县大城",
value: 0,
per: 43,
},
{
name: "地质灾害",
value: 0,
per: 15,
},
{
name: "征迁",
value: 0,
per: 22,
},
]);
// 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%",
height: '40%',
//
orient: "vertical",
right: 20,
top: "center",
//
itemGap: 10,
show: true,
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].per;
}
}
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: 20, //( )
distance: 100, //zoom()
},
top: "-10",
left: "-160",
width: "100%",
show: false,
boxHeight: 16,
},
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;
pieData[0].value = data.list.wfgz;
pieData[1].value = data.list.xstp;
pieData[2].value = data.list.skym;
pieData[3].value = data.list.xxdc;
pieData[4].value = data.list.dzzh;
pieData[5].value = data.list.zq;
getOption();
setChart();
}, 600);
});
</script>
<style scoped></style>

View File

@ -254,14 +254,14 @@
</div> </div>
<div class="dailyActivity" v-if="choose == '1'"> <div class="dailyActivity" v-if="choose == '1'">
<div class="dailyActivityBox"> <div class="dailyActivityBox">
<div class="dailyActivitybootm"> <div class="dailyActivitybottom">
<img src="../assets/images/sy/dropDown.png" /> <img src="../assets/images/sy/dropDown.png" />
<span>浙里办平均日活</span> <span>浙里办平均日活</span>
</div> </div>
<span style="margin-right: 20px;">8135</span> <span style="margin-right: 20px;">8135</span>
</div> </div>
<div class="dailyActivityBox"> <div class="dailyActivityBox">
<div class="dailyActivitybootm"> <div class="dailyActivitybottom">
<img src="../assets/images/sy/dropDown.png" /> <img src="../assets/images/sy/dropDown.png" />
<span>龙游通平均日活</span> <span>龙游通平均日活</span>
</div> </div>
@ -270,7 +270,7 @@
</div> </div>
<el-table <el-table
:data="data.tableData" :data="data.tableData"
style="width: 100%; height: 248px" style="width: 100%; height: 244px"
class="table_border" class="table_border"
:row-style="rowState" :row-style="rowState"
:header-cell-style="tableHeaderColor" :header-cell-style="tableHeaderColor"
@ -884,6 +884,24 @@ const data = reactive({
highFrequencyApp1: "公共自行车", highFrequencyApp1: "公共自行车",
monthlyVisits1: "20702", monthlyVisits1: "20702",
}, },
{
highFrequencyApp: "民政为民",
monthlyVisits: "14307",
highFrequencyApp1: "小奔通",
monthlyVisits1: "20415",
},
{
highFrequencyApp: "随手拍",
monthlyVisits: "2234",
highFrequencyApp1: "商城积分",
monthlyVisits1: "14595",
},
{
highFrequencyApp: "龙游通",
monthlyVisits: "1431",
highFrequencyApp1: "商户入口",
monthlyVisits1: "3864",
},
], ],
jysyList: [ jysyList: [
{ {
@ -2380,6 +2398,7 @@ const showTab = (val) => {
height: 40px; height: 40px;
background: rgba(60, 144, 255, 0.08); background: rgba(60, 144, 255, 0.08);
border: 1px solid #7aceff; border: 1px solid #7aceff;
border-bottom: 0px solid #7aceff;
border-radius: 2px 2px 0px 0px; border-radius: 2px 2px 0px 0px;
box-sizing: border-box; box-sizing: border-box;
padding: 6px; padding: 6px;
@ -2388,10 +2407,9 @@ const showTab = (val) => {
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
width: 50%; width: 50%;
.dailyActivitybootm{ .dailyActivitybottom{
display: flex; display: flex;
align-items: center; align-items: center;
} }
img { img {
width: 20px; width: 20px;