You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

635 lines
16 KiB

2 years ago
<!--
* @Author: lough
* @Date: 2021-12-17 10:07:07
* @LastEditors: lough
* @LastEditTime: 2022-11-15 14:16:58
* @Description:
-->
<template>
<div class="container">
<div class="module-container">
<div class="section-proportion">
<span class="proportion-title">本级上级网评指令比例</span>
<div>
<!-- 圆柱 -->
<div id="cylinder" />
<img
src="@/assets/privateOrder/positiveEnergy/底座3.png"
alt=""
class="cylinderBottom"
/>
<div class="proportion-ratio">
<div class="proportion-ratio-bl">
<img
src="@/assets/privateOrder/positiveEnergy/本级网评指令比例.png"
alt=""
/>
<span>本级网评指令比例 </span>
<span style="margin-left: 20px; color: #71e8fb">
2 years ago
{{ sjNum }}%
2 years ago
</span>
<div class="progress">
<div
:style="{
backgroundColor: '#71e8fb',
height: 9,
2 years ago
width: sjNum + '%',
2 years ago
}"
></div>
</div>
</div>
<div class="proportion-ratio-bl">
<img
src="@/assets/privateOrder/positiveEnergy/上级网评指令比例.png"
alt=""
/>
<span>上级网评指令比例</span>
<span style="margin-left: 20px; color: #79ffd0">
2 years ago
{{ bjNum }}%
2 years ago
</span>
<div class="progress">
<div
:style="{
backgroundColor: '#79ffd0',
height: 9,
2 years ago
width: bjNum + '%',
2 years ago
}"
></div>
</div>
</div>
</div>
</div>
</div>
<div class="setion-percentage">
<span class="percentage-title">网评员任务完成率</span>
<div id="bar" />
</div>
</div>
</div>
</template>
<script>
2 years ago
import { getComplete } from "@/api/common";
import {
networkAppraisercomplete,
networkAppraiser,
} from "@/api/zongzhi/st.js";
2 years ago
export default {
components: {},
filters: {
numFilter(value) {
2 years ago
const realVal = Number(value).toFixed(2);
return Number(realVal);
},
2 years ago
},
data() {
return {
sjNum: 0,
bjNum: 0,
2 years ago
percentageList: null,
percentageName: [],
percentageValue: [],
2 years ago
sjdata: null,
2 years ago
bjdata: null,
};
2 years ago
},
computed: {},
watch: {},
created() {
2 years ago
const tableObject = require("./data.json");
this.tableData = tableObject["网评文章录用情况"];
2 years ago
},
2 years ago
destroyed() {},
2 years ago
mounted() {
2 years ago
this.getpercentageData();
this.getNetworkAppraiser();
// this.sjdata = Math.round(this.sjNum)
// this.bjdata = Math.round(this.bjNum)
// this.inItCylinder()
2 years ago
},
methods: {
2 years ago
getNetworkAppraiser() {
networkAppraiser().then((res) => {
this.sjNum = res.data[0].pt;
this.bjNum = res.data[1].pt;
this.sjdata = Math.round(this.bjNum);
this.bjdata = Math.round(this.sjNum);
this.inItCylinder();
});
},
2 years ago
// 获取任务完成率data
getpercentageData() {
2 years ago
networkAppraisercomplete().then((res) => {
res.data.forEach((item) => {
this.percentageName.push(item.name);
this.percentageValue.push(item.pt);
this.inItBar();
});
});
// this.percentageName = ['陆渡街道', '港区', '浮桥镇', '编办', '老干部局', '党校', '档案馆']
// this.percentageValue = [80, 90, 60, 90, 90, 70, 50]
// this.inItBar()
2 years ago
// getComplete().then((res) => {
// this.percentageName = res['T_DEPT_COMPLETE[]'].map(e => {
// return e.dept_name
// })
// this.percentageValue = res['T_DEPT_COMPLETE[]'].map((e) => {
// return e.dept_completion_rate
// })
// this.inItBar()
// })
},
inItBar() {
2 years ago
const myChartBar = this.$echarts.init(document.getElementById("bar"));
2 years ago
const option = {
animation: true,
grid: {
2 years ago
top: "20%",
bottom: "10%",
left: "5%",
2 years ago
},
tooltip: {
2 years ago
trigger: "axis",
formatter: "{b} : {c}%",
2 years ago
textStyle: {
fontSize: 26,
2 years ago
fontWight: "bold",
},
2 years ago
},
xAxis: {
2 years ago
data: this.percentageName,
2 years ago
axisLine: {
show: true, // 隐藏X轴轴线
lineStyle: {
2 years ago
color: "rgb(255,255,255,0.5)",
},
2 years ago
},
axisTick: {
2 years ago
show: false, // 隐藏X轴轴线
2 years ago
},
axisLabel: {
interval: 0,
show: true,
margin: 12,
fontSize: 28,
textStyle: {
2 years ago
color: "rgb(255,255,255,1)", // X轴文字颜色
},
},
2 years ago
},
yAxis: [
{
2 years ago
type: "value",
2 years ago
gridIndex: 0,
min: 0,
max: 100,
interval: 20,
splitLine: {
show: true,
lineStyle: {
2 years ago
type: "dashed",
color: "rgba(77, 128, 254, 0.2)",
width: 1,
},
2 years ago
},
axisTick: {
2 years ago
show: true,
2 years ago
},
axisLine: {
show: true,
lineStyle: {
2 years ago
color: "rgba(77, 128, 254, 0)",
},
2 years ago
},
axisLabel: {
show: true,
margin: 14,
fontSize: 24,
textStyle: {
2 years ago
color: "#68cff9",
},
},
},
2 years ago
],
series: [
{
2 years ago
name: "网评员任务完成率",
type: "bar",
2 years ago
barWidth: 25,
itemStyle: {
normal: {
2 years ago
color: "#39b3ff",
},
2 years ago
},
data: this.percentageValue,
z: 10,
2 years ago
zlevel: 0,
2 years ago
},
{
2 years ago
name: "网评员任务完成率",
2 years ago
// 分隔
2 years ago
type: "pictorialBar",
2 years ago
itemStyle: {
normal: {
2 years ago
color: "#0F375F",
},
2 years ago
},
2 years ago
symbolRepeat: "fixed",
2 years ago
symbolMargin: 3,
2 years ago
symbol: "rect",
2 years ago
symbolClip: true,
symbolSize: [18, 7],
2 years ago
symbolPosition: "start",
2 years ago
symbolOffset: [-3, 1],
data: this.percentageValue,
width: 2,
z: 1,
2 years ago
zlevel: 1,
2 years ago
},
{
2 years ago
name: "外框",
type: "bar",
barGap: "-130%", // 设置外框粗细
2 years ago
data: [100, 100, 100, 100, 100, 100, 100, 100, 100],
barWidth: 40,
itemStyle: {
normal: {
2 years ago
color: "rgba(14, 41, 78, 0.3)", // 填充色
barBorderColor: "#2b405b", // 边框色
2 years ago
barBorderWidth: 1, // 边框宽度
label: {
// 标签显示位置
show: false,
2 years ago
position: "top",
},
},
2 years ago
},
2 years ago
z: 0,
},
2 years ago
],
dataZoom: [
{
2 years ago
type: "slider",
2 years ago
show: false,
xAxisIndex: [0],
endValue: 6,
2 years ago
startValue: 0,
},
],
};
if (option && typeof option === "object") {
myChartBar.setOption(option, true);
2 years ago
// 定时自动滚动
setInterval(() => {
if (option.dataZoom[0].endValue === this.percentageValue?.length) {
2 years ago
option.dataZoom[0].endValue = 6;
option.dataZoom[0].startValue = 0;
2 years ago
} else {
2 years ago
option.dataZoom[0].endValue = option.dataZoom[0].endValue + 1;
option.dataZoom[0].startValue = option.dataZoom[0].startValue + 1;
2 years ago
}
2 years ago
myChartBar.setOption(option, true);
}, 2000);
2 years ago
}
},
// 初始化圆柱
inItCylinder() {
const myChartCylinder = this.$echarts.init(
2 years ago
document.getElementById("cylinder")
);
2 years ago
const option = {
grid: {
height: 280,
2 years ago
width: 130,
2 years ago
},
xAxis: {
2 years ago
data: ["上级"],
show: false,
2 years ago
},
yAxis: {
show: false,
2 years ago
type: "value",
2 years ago
},
series: [
// 最下面的圆片
{
2 years ago
name: "",
type: "pictorialBar",
2 years ago
symbolSize: [111, 30],
symbolOffset: [-9, 15],
z: 12,
data: [
{
2 years ago
name: "",
2 years ago
value: this.sjdata,
itemStyle: {
normal: {
2 years ago
color: "rgba(89,211,255,1)", // 最下圆
},
},
},
],
2 years ago
},
// 上最面圆片
{
2 years ago
name: "", // 头部
type: "pictorialBar",
2 years ago
symbolSize: [111, 30],
symbolOffset: [-9, -15],
z: 12,
data: [
{
2 years ago
name: "",
2 years ago
value: this.sjdata + this.sjdata / 2.4 + this.bjdata * 1.2,
2 years ago
symbolPosition: "end",
2 years ago
itemStyle: {
normal: {
2 years ago
color: "rgba(57,119,119,1)", // 最上面的圆
},
},
},
],
2 years ago
},
// 中部的圆
{
2 years ago
name: "",
type: "pictorialBar",
2 years ago
symbolSize: [113, 40],
symbolOffset: [-10, -20],
z: 12,
data: [
{
2 years ago
name: "",
2 years ago
value: this.sjdata * 1.4 - 2,
2 years ago
symbolPosition: "end",
2 years ago
itemStyle: {
normal: {
2 years ago
color: "#43bafe",
},
},
},
],
2 years ago
},
// 下半截柱状图
{
2 years ago
name: "",
type: "bar",
2 years ago
barWidth: 250,
2 years ago
barGap: "-100%",
2 years ago
itemStyle: {
// lenged文本
2 years ago
color: "rgba(56,117,168,0.2)",
2 years ago
},
data: [
{
2 years ago
name: "",
2 years ago
value: this.sjdata * 1.4,
itemStyle: {
normal: {
color: {
x: 0,
y: 0,
x2: 0,
y2: 1,
2 years ago
type: "linear",
2 years ago
global: false,
colorStops: [
{
// 第一节下面
offset: 0,
2 years ago
color: "rgba(56,117,168,0.3)",
2 years ago
},
{
offset: 1,
2 years ago
color: "#43bafe",
},
],
},
},
},
},
2 years ago
],
label: {
show: true,
2 years ago
position: "inside",
2 years ago
offset: [-10, this.sjdata / 3],
2 years ago
color: "#70c1f9",
2 years ago
fontSize: 20,
2 years ago
fontStyle: "bold",
align: "center",
formatter: "上级" + "\n" + this.sjdata + "%",
2 years ago
},
2 years ago
textStyle: {},
2 years ago
},
// 。。。中下??
{
// 替代柱状图 默认不显示颜色是最下方柱图的value值 - 20
2 years ago
type: "bar",
2 years ago
barWidth: 250,
2 years ago
barGap: "-100%",
stack: "网评",
2 years ago
itemStyle: {
2 years ago
color: "transparent",
2 years ago
},
2 years ago
data: [this.sjdata + this.sjdata / 2.4],
2 years ago
},
// 上半部
{
2 years ago
name: "本级",
type: "bar",
2 years ago
barWidth: 250,
2 years ago
barGap: "-100%",
stack: "网评",
2 years ago
// 上班截开始
data: [
{
2 years ago
name: "本级网评比例",
2 years ago
value: this.bjdata * 1.2,
itemStyle: {
normal: {
color: {
x: 0,
y: 0,
x2: 0,
y2: 1,
2 years ago
type: "linear",
2 years ago
global: false,
colorStops: [
{
offset: 0,
2 years ago
color: "rgba(70,141,132,1)",
2 years ago
},
{
offset: 1,
2 years ago
color: "rgba(131,237,169,1)",
},
],
},
},
},
},
2 years ago
],
label: {
show: true,
2 years ago
position: "inside",
2 years ago
offset: [-10, 10],
2 years ago
color: "rgba(131,237,169,1)",
2 years ago
fontSize: 20,
2 years ago
fontStyle: "bold",
align: "center",
formatter: "本级" + "\n" + this.bjdata + "%",
2 years ago
rich: {
a: {
2 years ago
color: "#fff",
},
},
},
},
],
};
myChartCylinder.setOption(option, true);
},
},
};
2 years ago
</script>
<style lang="scss" scoped>
//圆柱
#cylinder {
position: absolute;
left: 25px;
top: 186px;
width: 123px;
height: 390px;
}
// //进度条
// #progress {
// position: relative;
// top: -8px;
// left: 31px;
// display: inline-block;
// width: 799px;
// height: 10px;
// }
//任务完成率
#bar {
width: 1200px;
height: 380px;
position: relative;
left: 60px;
top: 10px;
}
.container {
width: 100%;
height: 100%;
.module-container {
width: 1229px;
height: 971px;
margin: 130px 0 0 -50px;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-content: space-between;
.section-proportion {
width: 1229px;
height: 474px;
2 years ago
background: url("~@/assets/privateOrder/positiveEnergy/网评比例-bj.png")
2 years ago
no-repeat;
background-size: 100% 100%;
.proportion-title {
position: relative;
left: 389px;
top: 50px;
font-family: PangMenZhengDao;
font-size: 38px;
font-weight: normal;
font-stretch: normal;
letter-spacing: 0px;
color: #ffffff;
}
.cylinderBottom {
position: absolute;
top: 432px;
left: -6px;
}
.proportion-ratio {
position: relative;
left: 250px;
top: 90px;
.proportion-ratio-bl {
margin-bottom: 40px;
width: 910px;
height: 127px;
font-family: SourceHanSansCN-Regular;
font-size: 36px;
font-weight: normal;
font-stretch: normal;
letter-spacing: 0px;
color: #ffffff;
2 years ago
background: url("~@/assets/privateOrder/positiveEnergy/bjsj网评.png")
2 years ago
no-repeat;
background-size: 100% 100%;
.progress {
position: relative;
top: 21px;
left: 102px;
width: 799px;
height: 8px;
background-color: #3a5270;
div {
height: 8px;
display: inline-block;
position: absolute;
}
}
}
div:nth-child(1) {
position: relative;
img {
position: absolute;
top: 40px;
left: 32px;
}
span {
display: inline-block;
margin-top: 35px;
margin-left: 120px;
}
}
div:nth-child(2) {
position: relative;
img {
position: absolute;
top: 40px;
left: 32px;
}
span {
display: inline-block;
margin-top: 35px;
margin-left: 120px;
}
}
}
}
.setion-percentage {
width: 1229px;
height: 474px;
2 years ago
background: url("~@/assets/privateOrder/positiveEnergy/完成率-bj.png");
2 years ago
background-size: 100% 100%;
.percentage-title {
position: relative;
left: 473px;
top: 47px;
font-family: PangMenZhengDao;
font-size: 38px;
font-weight: normal;
font-stretch: normal;
letter-spacing: 0px;
color: #ffffff;
}
}
}
}
</style>