lijinlong
许宏杰 2 years ago
parent 74919782a0
commit cb0a0b32f5

@ -26,14 +26,14 @@
/>
<span>本级网评指令比例 </span>
<span style="margin-left: 20px; color: #71e8fb">
{{ sjNum }}%
{{ sjNum }}%
</span>
<div class="progress">
<div
:style="{
backgroundColor: '#71e8fb',
height: 9,
width: sjNum+'%',
width: sjNum + '%',
}"
></div>
</div>
@ -45,14 +45,14 @@
/>
<span>上级网评指令比例</span>
<span style="margin-left: 20px; color: #79ffd0">
{{ bjNum}}%
{{ bjNum }}%
</span>
<div class="progress">
<div
:style="{
backgroundColor: '#79ffd0',
height: 9,
width: bjNum+'%',
width: bjNum + '%',
}"
></div>
</div>
@ -69,15 +69,18 @@
</template>
<script>
import { getComplete } from '@/api/common'
import { networkAppraisercomplete ,networkAppraiser} from '@/api/zongzhi/st.js'
import { getComplete } from "@/api/common";
import {
networkAppraisercomplete,
networkAppraiser,
} from "@/api/zongzhi/st.js";
export default {
components: {},
filters: {
numFilter(value) {
const realVal = Number(value).toFixed(2)
return Number(realVal)
}
const realVal = Number(value).toFixed(2);
return Number(realVal);
},
},
data() {
return {
@ -87,42 +90,42 @@ export default {
percentageName: [],
percentageValue: [],
sjdata: null,
bjdata: null
}
bjdata: null,
};
},
computed: {},
watch: {},
created() {
const tableObject = require('./data.json')
this.tableData = tableObject['网评文章录用情况']
const tableObject = require("./data.json");
this.tableData = tableObject["网评文章录用情况"];
},
destroyed() { },
destroyed() {},
mounted() {
this.getpercentageData()
this.getNetworkAppraiser()
this.getpercentageData();
this.getNetworkAppraiser();
// this.sjdata = Math.round(this.sjNum)
// this.bjdata = Math.round(this.bjNum)
// this.inItCylinder()
},
methods: {
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()
})
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();
});
},
// data
getpercentageData() {
networkAppraisercomplete().then(res=>{
res.data.forEach(item=>{
this.percentageName.push(item.name)
this.percentageValue.push(item.pt)
this.inItBar()
})
})
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()
@ -137,33 +140,32 @@ export default {
// })
},
inItBar() {
const myChartBar = this.$echarts.init(document.getElementById('bar'))
const myChartBar = this.$echarts.init(document.getElementById("bar"));
const option = {
animation: true,
grid: {
top: '20%',
bottom: '10%',
left: '5%'
top: "20%",
bottom: "10%",
left: "5%",
},
tooltip: {
trigger: 'axis',
formatter: '{b} : {c}%',
trigger: "axis",
formatter: "{b} : {c}%",
textStyle: {
fontSize: 26,
fontWight: 'bold'
}
fontWight: "bold",
},
},
xAxis: {
data:this.percentageName,
data: this.percentageName,
axisLine: {
show: true, // X线
lineStyle: {
color: 'rgb(255,255,255,0.5)'
}
color: "rgb(255,255,255,0.5)",
},
},
axisTick: {
show: false // X线
show: false, // X线
},
axisLabel: {
interval: 0,
@ -171,13 +173,13 @@ export default {
margin: 12,
fontSize: 28,
textStyle: {
color: 'rgb(255,255,255,1)' // X
}
}
color: "rgb(255,255,255,1)", // X
},
},
},
yAxis: [
{
type: 'value',
type: "value",
gridIndex: 0,
min: 0,
max: 100,
@ -185,202 +187,202 @@ export default {
splitLine: {
show: true,
lineStyle: {
type: 'dashed',
color: 'rgba(77, 128, 254, 0.2)',
width: 1
}
type: "dashed",
color: "rgba(77, 128, 254, 0.2)",
width: 1,
},
},
axisTick: {
show: true
show: true,
},
axisLine: {
show: true,
lineStyle: {
color: 'rgba(77, 128, 254, 0)'
}
color: "rgba(77, 128, 254, 0)",
},
},
axisLabel: {
show: true,
margin: 14,
fontSize: 24,
textStyle: {
color: '#68cff9'
}
}
}
color: "#68cff9",
},
},
},
],
series: [
{
name: '网评员任务完成率',
type: 'bar',
name: "网评员任务完成率",
type: "bar",
barWidth: 25,
itemStyle: {
normal: {
color: '#39b3ff'
}
color: "#39b3ff",
},
},
data: this.percentageValue,
z: 10,
zlevel: 0
zlevel: 0,
},
{
name: '网评员任务完成率',
name: "网评员任务完成率",
//
type: 'pictorialBar',
type: "pictorialBar",
itemStyle: {
normal: {
color: '#0F375F'
}
color: "#0F375F",
},
},
symbolRepeat: 'fixed',
symbolRepeat: "fixed",
symbolMargin: 3,
symbol: 'rect',
symbol: "rect",
symbolClip: true,
symbolSize: [18, 7],
symbolPosition: 'start',
symbolPosition: "start",
symbolOffset: [-3, 1],
data: this.percentageValue,
width: 2,
z: 1,
zlevel: 1
zlevel: 1,
},
{
name: '外框',
type: 'bar',
barGap: '-130%', //
name: "外框",
type: "bar",
barGap: "-130%", //
data: [100, 100, 100, 100, 100, 100, 100, 100, 100],
barWidth: 40,
itemStyle: {
normal: {
color: 'rgba(14, 41, 78, 0.3)', //
barBorderColor: '#2b405b', //
color: "rgba(14, 41, 78, 0.3)", //
barBorderColor: "#2b405b", //
barBorderWidth: 1, //
label: {
//
show: false,
position: 'top'
}
}
position: "top",
},
},
},
z: 0
}
z: 0,
},
],
dataZoom: [
{
type: 'slider',
type: "slider",
show: false,
xAxisIndex: [0],
endValue: 6,
startValue: 0
}
]
}
if (option && typeof option === 'object') {
myChartBar.setOption(option, true)
startValue: 0,
},
],
};
if (option && typeof option === "object") {
myChartBar.setOption(option, true);
//
setInterval(() => {
if (option.dataZoom[0].endValue === this.percentageValue?.length) {
option.dataZoom[0].endValue = 6
option.dataZoom[0].startValue = 0
option.dataZoom[0].endValue = 6;
option.dataZoom[0].startValue = 0;
} else {
option.dataZoom[0].endValue = option.dataZoom[0].endValue + 1
option.dataZoom[0].startValue = option.dataZoom[0].startValue + 1
option.dataZoom[0].endValue = option.dataZoom[0].endValue + 1;
option.dataZoom[0].startValue = option.dataZoom[0].startValue + 1;
}
myChartBar.setOption(option, true)
}, 2000)
myChartBar.setOption(option, true);
}, 2000);
}
},
//
inItCylinder() {
const myChartCylinder = this.$echarts.init(
document.getElementById('cylinder')
)
document.getElementById("cylinder")
);
const option = {
grid: {
height: 280,
width: 130
width: 130,
},
xAxis: {
data: ['上级',],
show: false
data: ["上级"],
show: false,
},
yAxis: {
show: false,
type: 'value'
type: "value",
},
series: [
//
{
name: '',
type: 'pictorialBar',
name: "",
type: "pictorialBar",
symbolSize: [111, 30],
symbolOffset: [-9, 15],
z: 12,
data: [
{
name: '',
name: "",
value: this.sjdata,
itemStyle: {
normal: {
color: 'rgba(89,211,255,1)' //
}
}
}
]
color: "rgba(89,211,255,1)", //
},
},
},
],
},
//
{
name: '', //
type: 'pictorialBar',
name: "", //
type: "pictorialBar",
symbolSize: [111, 30],
symbolOffset: [-9, -15],
z: 12,
data: [
{
name: '',
name: "",
value: this.sjdata + this.sjdata / 2.4 + this.bjdata * 1.2,
symbolPosition: 'end',
symbolPosition: "end",
itemStyle: {
normal: {
color: 'rgba(57,119,119,1)' //
}
}
}
]
color: "rgba(57,119,119,1)", //
},
},
},
],
},
//
{
name: '',
type: 'pictorialBar',
name: "",
type: "pictorialBar",
symbolSize: [113, 40],
symbolOffset: [-10, -20],
z: 12,
data: [
{
name: '',
name: "",
value: this.sjdata * 1.4 - 2,
symbolPosition: 'end',
symbolPosition: "end",
itemStyle: {
normal: {
color: '#43bafe'
}
}
}
]
color: "#43bafe",
},
},
},
],
},
//
{
name: '',
type: 'bar',
name: "",
type: "bar",
barWidth: 250,
barGap: '-100%',
barGap: "-100%",
itemStyle: {
// lenged
color: 'rgba(56,117,168,0.2)'
color: "rgba(56,117,168,0.2)",
},
data: [
{
name: '',
name: "",
value: this.sjdata * 1.4,
itemStyle: {
normal: {
@ -389,60 +391,60 @@ export default {
y: 0,
x2: 0,
y2: 1,
type: 'linear',
type: "linear",
global: false,
colorStops: [
{
//
offset: 0,
color: 'rgba(56,117,168,0.3)'
color: "rgba(56,117,168,0.3)",
},
{
offset: 1,
color: '#43bafe'
}
]
}
}
}
}
color: "#43bafe",
},
],
},
},
},
},
],
label: {
show: true,
position: 'inside',
position: "inside",
offset: [-10, this.sjdata / 3],
color: '#70c1f9',
color: "#70c1f9",
fontSize: 20,
fontStyle: 'bold',
align: 'center',
formatter: '上级' + '\n' + this.sjdata + '%'
fontStyle: "bold",
align: "center",
formatter: "上级" + "\n" + this.sjdata + "%",
},
textStyle: {}
textStyle: {},
},
//
{
// value - 20
type: 'bar',
type: "bar",
barWidth: 250,
barGap: '-100%',
stack: '网评',
barGap: "-100%",
stack: "网评",
itemStyle: {
color: 'transparent'
color: "transparent",
},
data: [this.sjdata + this.sjdata / 2.4]
data: [this.sjdata + this.sjdata / 2.4],
},
//
{
name: '本级',
type: 'bar',
name: "本级",
type: "bar",
barWidth: 250,
barGap: '-100%',
stack: '网评',
barGap: "-100%",
stack: "网评",
//
data: [
{
name: '本级网评比例',
name: "本级网评比例",
value: this.bjdata * 1.2,
itemStyle: {
normal: {
@ -451,45 +453,45 @@ export default {
y: 0,
x2: 0,
y2: 1,
type: 'linear',
type: "linear",
global: false,
colorStops: [
{
offset: 0,
color: 'rgba(70,141,132,1)'
color: "rgba(70,141,132,1)",
},
{
offset: 1,
color: 'rgba(131,237,169,1)'
}
]
}
}
}
}
color: "rgba(131,237,169,1)",
},
],
},
},
},
},
],
label: {
show: true,
position: 'inside',
position: "inside",
offset: [-10, 10],
color: 'rgba(131,237,169,1)',
color: "rgba(131,237,169,1)",
fontSize: 20,
fontStyle: 'bold',
align: 'center',
formatter: '本级' + '\n' + this.bjdata + '%',
fontStyle: "bold",
align: "center",
formatter: "本级" + "\n" + this.bjdata + "%",
rich: {
a: {
color: '#fff'
}
}
}
}
]
}
myChartCylinder.setOption(option, true)
}
}
}
color: "#fff",
},
},
},
},
],
};
myChartCylinder.setOption(option, true);
},
},
};
</script>
<style lang="scss" scoped>
@ -532,7 +534,7 @@ export default {
.section-proportion {
width: 1229px;
height: 474px;
background: url('~@/assets/privateOrder/positiveEnergy/网评比例-bj.png')
background: url("~@/assets/privateOrder/positiveEnergy/网评比例-bj.png")
no-repeat;
background-size: 100% 100%;
.proportion-title {
@ -565,7 +567,7 @@ export default {
font-stretch: normal;
letter-spacing: 0px;
color: #ffffff;
background: url('~@/assets/privateOrder/positiveEnergy/bjsj网评.png')
background: url("~@/assets/privateOrder/positiveEnergy/bjsj网评.png")
no-repeat;
background-size: 100% 100%;
.progress {
@ -613,7 +615,7 @@ export default {
.setion-percentage {
width: 1229px;
height: 474px;
background: url('~@/assets/privateOrder/positiveEnergy/完成率-bj.png');
background: url("~@/assets/privateOrder/positiveEnergy/完成率-bj.png");
background-size: 100% 100%;
.percentage-title {
position: relative;

@ -86,7 +86,6 @@ export default {
init() {
const tags = document.querySelectorAll(".tag");
const wrap = document.querySelector(".tag-wrap");
const len = tags.length;
const valueList = Array.from(new Set(this.data.map((i) => i.count)));
const min = Math.min(...valueList);

Loading…
Cancel
Save