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

2470 lines
66 KiB
Vue

<template>
<v-scale-screen width="1920" height="1080" :fullScreen="false">
<div class="app-container home" style="">
<div class="head">
<div class="head-content">
<div class="title">榄菊质量管理平台</div>
</div>
<div class="head-logo">
<img src="../../../assets/images/logo.png" alt="" />
</div>
<div class="back">
<el-button
@click="back()"
type="primary"
icon="el-icon-s-home"
></el-button>
</div>
</div>
<div class="content-top">
<div class="factory">
<div class="selectborder">
<select
v-model="selectxt"
class="select1"
@change="selectline(selectxt)"
>
<option
:key="index"
:value="x.parentName"
v-for="(x, index) in getLineList"
>
{{ x.deptName }}
</option>
</select>
</div>
<div class="selectborder selectborder1" v-show="false">
<select
v-model="selectxtclasses"
class="select1"
@change="selectline2(selectxtclasses)"
>
<option
:key="index"
:value="x.ymdType"
v-for="(x, index) in dictDatatype"
>
{{ x.ymdTypeName }}
</option>
</select>
</div>
</div>
<div class="timebox">
<div class="time">
{{ gettimedata }}
</div>
</div>
</div>
<div class="content">
<div class="itemtop">
<div class="item-table item-table1">
<div class="titlebox" style="margin-bottom: 14px">
<div class="titlename">检验统计</div>
</div>
<div class="equipmentinfobox">
<div class="box">
<div class="number">
<span class="number1">
{{ Statistics.todayPro }}
</span>
</div>
<div class="name2">今日产量(PC)</div>
</div>
<div class="box">
<div class="number">
<span class="number1" style="color: #66ffff">
{{ Statistics.todaySample }}
</span>
</div>
<div class="name2">今日抽检数量(PC)</div>
</div>
<div class="box">
<div class="number">
<span class="number1" style="color: #ff4d4f">
{{ Statistics.todayNoOk }}
</span>
</div>
<div class="name2">今日不良数(PC)</div>
</div>
</div>
<div class="equipmentinfobox1">
<div class="box">
<div class="number">
<span class="number1">
{{ Statistics.monthPro }}
</span>
</div>
<div class="name2">本月产量(PC)</div>
</div>
<div class="box">
<div class="number">
<span class="number1" style="color: #ff4d4f">
{{ Statistics.monthNoOk }}
</span>
</div>
<div class="name2">本月不良数(PC)</div>
</div>
</div>
<div class="bigechartbox">
<div
class="echartbox"
id="echart1"
style="
margin: auto;
margin-top: 10px;
width: 128px;
height: 128px;
"
></div>
<div
class="echartbox"
id="echart4"
style="
margin: auto;
margin-top: 10px;
width: 128px;
height: 128px;
"
></div>
<div class="title1">今日合格率</div>
<div class="title2">本月合格率</div>
</div>
</div>
<div class="item-table item-table1" style="position: relative">
<div class="titlebox" style="margin-bottom: 14px">
<div class="titlename">质量异常信息</div>
<el-date-picker
style="
position: absolute;
margin-left: 10px;
background-color: rgb(20, 41, 69);
color: rgb(255, 255, 255);
right: 13px;
width: 207px;
top: 28px;
font-size: 5px;
"
v-model="ymdArray1"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
value-format="yyyy-MM-dd"
end-placeholder="结束日期"
@change="noOkTimeChange"
>
</el-date-picker>
</div>
<vue-seamless-scroll
:step="0.1"
:data="Qualitylist"
class="wrapscroll"
:class-option="classOption"
style="height: 400px"
>
<div class="table-tbody">
<div
class="item"
:class="[index % 2 == 1 ? 'active1' : 'active2']"
style="height: 48px"
:key="index"
v-for="(n, index) in Qualitylist"
>
<div class="icon"></div>
<div class="itemname1" style="max-width: 210px">
{{ n.projectName }}
</div>
<div class="itemname2">
{{ n.checkManName }} {{ n.checkTime }}|{{ n.className }}|{{ n.defectSubclass }}
</div>
</div>
</div>
</vue-seamless-scroll>
</div>
<div class="item-table item-table1" style="position: relative">
<div class="titlebox" style="margin-bottom: 14px; po">
<div class="titlename">不良类型占比</div>
<el-date-picker
style="
position: absolute;
margin-left: 10px;
background-color: rgb(20, 41, 69);
color: rgb(255, 255, 255);
right: 13px;
width: 207px;
top: 28px;
font-size: 5px;
"
v-model="ymdArray2"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
value-format="yyyy-MM-dd"
end-placeholder="结束日期"
@change="noOkRadioTimeChange"
>
</el-date-picker>
</div>
<div
id="echart2"
style="margin: auto; width: 425px; height: 410.26px; top: -10px"
></div>
</div>
<div class="item-table item-table1">
<div class="titlebox" style="margin-bottom: 14px">
<div class="titlename">本年各月产品不合格数量对比</div>
</div>
<div
id="echart3"
style="margin: auto; width: 395px; height: 400.26px"
></div>
</div>
</div>
<div class="itembottom">
<div class="item-table item-table1">
<div class="titlebox" style="margin-bottom: 14px">
<div class="titlename">本月每日线体异常趋势</div>
</div>
<div
id="echart5"
style="margin: auto; width: 900px; height: 304.15px"
></div>
</div>
<div class="item-table item-table1">
<div class="titlebox" style="margin-bottom: 14px">
<div class="titlename">产品不合格率同期对比</div>
</div>
<div id="echart6"
style="margin: auto; width: 900px; height: 304.15px"
></div>
</div>
</div>
</div>
<!-- <div class="item"></div> -->
<!-- <div class="item"></div> -->
</div>
</v-scale-screen>
</template>
<script>
import {
getBoardFactory,
getProduceStaticInfo,
getProduceNoOkList,
getCheckProjectsPie,
getProMonthNoOk,
getLineDayNoOk,
getMonthOfYearContrast,
getDictData,
2 years ago
} from "@/api/kanban/quality";
import { getDeviceRefreshTime } from "@/api/kanban/equipment";
import * as echarts from "echarts";
import moment from "moment";
// import Echarts3D from "./echarts3d.vue";
// import Echarts3D2 from "./echarts3d2.vue";
export default {
name: "Index",
components: {},
data() {
return {
classOption: {
direction: 1,
hoverstop: true,
step: 0.1,
openNatch: true,
limitMoveNum: 7,
},
gettimedata: "",
selectxt: null,
selectxtclasses: null,
getLineList: [],
classesList: [],
number1: 0,
number2: 0,
number3: 0,
number4: 0,
nameList: [
"成型机一",
"成型机二",
"成型机三",
"成型机四",
"成型机五",
"成型机六",
"成型机五",
"成型机六",
],
valueList: [1639, 1422, 1306, 1131, 1040, 732, 1040, 732],
optionDatalist2: [],
optionDatalist3: [],
optionDatalist4: [],
colorlist: ["#005aff", "#f8b551"],
datetime: null,
time1: null,
repairlist: [],
equipmentlist: [],
equipmentrepairlist: [],
equipmentstabilizelist: [],
equipmentinfo: [],
Statistics: {},
Qualitylist: [],
seriesmyChart5: [],
dictDatatype: [],
RefreshTime: null,
yearShow: false,
monthShow: true,
dateShow: false,
ymdArray1: [],
ymdStart1: null,
ymdEnd1: null,
ymdArray2: [],
ymdStart2: null,
ymdEnd2: null,
};
},
created() {
this.getDate();
},
destroyed() {
clearInterval(this.time1);
this.time1 = null;
},
mounted() {
this.selectFactorylist();
this.gettime();
},
methods: {
/**获取默认查询时间段**/
getDate() {
let start = this.Fungetdate(0);
let end = this.Fungetdate(0);
this.ymdArray1.push(start, end);
this.ymdArray2.push(start, end);
this.optionDatalist1 = [];
this.optionDatalist2 = [];
this.optionDatalist3 = [];
this.optionDatalist4 = [];
this.ymdStart1 = moment(this.ymdArray1[0]).format("YYYY-MM-DD");
this.ymdEnd1 = moment(this.ymdArray1[1]).format("YYYY-MM-DD");
this.ymdStart2 = moment(this.ymdArray2[0]).format("YYYY-MM-DD");
this.ymdEnd2 = moment(this.ymdArray2[1]).format("YYYY-MM-DD");
this.getdatalist();
this.initChart1();
},
Fungetdate(num) {
var dd = new Date();
dd.setDate(dd.getDate() + num);
var y = dd.getFullYear();
var m = dd.getMonth() + 1; //获取当前月份的日期
var d = dd.getDate();
return y + "-" + m + "-" + d;
},
back() {
this.$router.push({ path: "/index" });
},
gettime() {
this.gettimedata = moment().format("YYYY-MM-DD HH:mm:ss ");
setInterval(() => {
this.gettimedata = moment().format("YYYY-MM-DD HH:mm:ss ");
}, 1000);
},
selectFactorylist() {
const _this = this;
getBoardFactory({
factory: null,
}).then((response) => {
if (response.data) {
_this.getLineList = response.data;
_this.selectxt = _this.getLineList[0].parentName;
//this.getDictData()
this.getDeviceRefreshTime();
}
});
},
getDeviceRefreshTime() {
const _this = this;
getDeviceRefreshTime().then((response) => {
if (response.data) {
// console.log(response.data)
this.RefreshTime = response.data;
this.time1 = setInterval(() => {
_this.getdatalist();
_this.initChart1();
}, 1000 * 60 * this.RefreshTime);
}
});
},
// getDictData() {
// const _this = this;
// getDictData(
// {
// dictType: 'static_dims',
// }
// ).then((response) => {
// if (response) {
// // console.log(response)
// this.dictDatatype = response
// _this.selectxtclasses = _this.dictDatatype[1].ymdType;
// this.getDeviceRefreshTime()
// this.getdatalist()
// this.initChart1()
// }
// });
// },
noOkTimeChange(){
this.ymdStart1 = moment(this.ymdArray1[0]).format("YYYY-MM-DD");
this.ymdEnd1 = moment(this.ymdArray1[1]).format("YYYY-MM-DD");
//质量异常信息
getProduceNoOkList({
typeCode: "produce",
ymdType: this.selectxtclasses,
productDateStart: this.ymdStart1,
productDateEnd: this.ymdEnd1,
factoryCode: "ds_" + this.selectxt,
}).then((response) => {
if (response) {
this.Qualitylist = response;
}
});
},
noOkRadioTimeChange(){
this.ymdStart2 = moment(this.ymdArray2[0]).format("YYYY-MM-DD");
this.ymdEnd2 = moment(this.ymdArray2[1]).format("YYYY-MM-DD");
//不良类型占比
getCheckProjectsPie({
typeCode: "produce",
ymdType: this.selectxtclasses,
productDateStart: this.ymdStart2,
productDateEnd: this.ymdEnd2,
factoryCode: "ds_" + this.selectxt,
}).then((response) => {
if (response) {
this.optionDatalist2 = [];
response.forEach((item) => {
let a = {};
a.name = item.projectName;
a.value = item.quality;
this.optionDatalist2.push(a);
});
this.initChart3();
}
});
},
getdatalist() {
const _this = this;
//检验统计
getProduceStaticInfo({
ymdType: _this.selectxtclasses,
typeCode: "produce",
factoryCode: "ds_" + _this.selectxt,
}).then((response) => {
if (response) {
_this.Statistics = response;
_this.equipmentinfo = response;
this.initChart2();
}
});
//质量异常信息
getProduceNoOkList({
typeCode: "produce",
ymdType: _this.selectxtclasses,
productDateStart: this.ymdStart1,
productDateEnd: this.ymdEnd1,
factoryCode: "ds_" + _this.selectxt,
}).then((response) => {
if (response) {
_this.Qualitylist = response;
}
});
//不良类型占比
getCheckProjectsPie({
typeCode: "produce",
ymdType: _this.selectxtclasses,
productDateStart: this.ymdStart2,
productDateEnd: this.ymdEnd2,
factoryCode: "ds_" + _this.selectxt,
}).then((response) => {
if (response) {
_this.optionDatalist2 = [];
response.forEach((item) => {
let a = {};
a.name = item.projectName;
a.value = item.quality;
_this.optionDatalist2.push(a);
});
this.initChart3();
}
});
},
initChart1() {
const _this = this;
var myChart3 = echarts.init(document.querySelector("#echart3"));
var option3 = {
grid: {
left: "60",
right: "10%",
top: "5%",
bottom: "1%",
containLabel: true,
},
tooltip: {
trigger: "axis",
show: true,
axisPointer: {
type: "none",
},
formatter: function (e) {
return `${e[0].data.name}\n${e[0].marker}${e[0].data.value} PC`;
},
},
xAxis: {
name: "数量",
// max: total,
splitLine: {
show: false,
},
axisLine: {
show: true,
},
axisLabel: {
show: true,
},
axisTick: {
show: true,
},
},
yAxis: [
{
type: "category",
inverse: false,
data: ["1", "2", "3", "4"],
axisLine: {
show: true,
},
axisTick: {
show: false,
},
axisLabel: {
show: false,
},
},
],
series: [
{
type: "pictorialBar",
symbol: "rect",
// symbolRepeat: "fixed",
// symbolMargin: "2",
// symbolClip: true,
// symbolSize: [5, 20],
barWidth: 20,
data: [],
label: {
normal: {
formatter: "{b}",
textStyle: {
color: "#D0DEEE",
fontSize: 14,
2 years ago
},
position: "left",
distance: 10, //
show: true,
},
},
z: 10,
},
{
type: "bar",
itemStyle: {
color: "#141A27",
},
label: {
normal: {
formatter: "{b}",
textStyle: {
color: "#D0DEEE",
fontSize: 14,
},
position: "right",
distance: 10, //
show: true,
}
},
data: [], // value鍊<65>
tooltip: {
show: false,
},
barWidth: 30,
},
],
};
myChart3.setOption(option3);
// console.log(_this.selectxt)
getProMonthNoOk({
typeCode: "produce",
factoryCode: "ds_" + _this.selectxt,
}).then((response) => {
if (response) {
let numberlist = [];
let dataoption = [];
let totalArr = [];
_this.optionDatalist3 = [];
// console.log(response)
for (let index = 0; index < response.month.length; index++) {
let a = {};
response.month[index] = moment(response.month[index]).format("MM");
a.name = response.month[index] + "月";
a.value = response.monthData[index];
a.code = response.monthData[index];
dataoption.push(a);
numberlist.push(response.monthData[index]);
}
// dataoption.sort((a, b) => {
// return a.value - b.value;
// });
dataoption = dataoption.reverse();
let max = Math.max(...numberlist);
max = max + 100;
dataoption.forEach((item) => {
totalArr.push(max);
});
// console.log(dataoption, numberlist)
// response = [{ name: "1月", code: "100", value: '100', }]
// if (response.length > 0) {
option3 = {
yAxis: [
{
data: dataoption,
},
],
series: [
{
data: dataoption,
itemStyle: {
normal: {
color: function (params) {
var index_num = params.value;
for (var i = 0; i < dataoption.length; i++) {
//判断数据是否大于1
if (index_num > 1131) {
//var colorList = ['#ff7f50', '#87cefa', '#da70d6', '#32cd32', '#6495ed', '#ff69b4', '#ba55d3', '#cd5c5c', '#ffa500', '#40e0d0'];
//return colorList[params.dataIndex];
return new echarts.graphic.LinearGradient(
0,
0,
1,
0,
[
{ offset: 0, color: "#FFB742" },
{ offset: 1, color: "#FFB742" },
]
);
} else {
//var colorList = ['blue'];
//return colorList[params.dataIndex];
return new echarts.graphic.LinearGradient(
0,
0,
1,
0,
[
{ offset: 0, color: "#005954" },
{ offset: 1, color: "#66E1DF" },
]
);
}
}
2 years ago
},
},
},
},
{
data: totalArr,
},
],
};
myChart3.setOption(option3);
// }
}
});
var myChart5 = echarts.init(document.querySelector("#echart5"));
var fontColor = "#D0DEEE";
var option5 = {
grid: {
left: "2%",
right: "4%",
top: "15%",
bottom: "2%",
containLabel: true,
},
tooltip: {
show: true,
trigger: "item",
formatter: function(params) {
const value = parseInt(params.value) || params.value;
return `${params.seriesName}<br/>${params.name}: ${value} PC`;
}
},
legend: {
show: true,
x: "center",
y: "0",
icon: "stack",
itemWidth: 10,
itemHeight: 10,
textStyle: {
color: "#D0DEEE",
},
// nameTextStyle:{
// color: '#D0DEEE'
// },
data: ["已采纳", "已发布", "浏览量"],
},
xAxis: [
{
type: "category",
boundaryGap: true,
axisLabel: {
color: fontColor,
},
axisLine: {
show: true,
lineStyle: {
color: "#397cbc",
},
},
axisTick: {
show: false,
},
splitLine: {
show: true,
lineStyle: {
color: "#2B3241",
},
},
data: [],
},
],
yAxis: [
{
type: "value",
name: "",
nameTextStyle: {
color: "#D0DEEE",
},
min: 0,
max: 1000,
axisLabel: {
formatter: "{value} PC",
textStyle: {
color: "#D0DEEE",
},
},
axisLine: {
lineStyle: {
color: "#27b4c2",
},
},
axisTick: {
show: false,
},
splitLine: {
show: true,
lineStyle: {
color: "#2B3241",
},
},
},
],
series: [],
};
myChart5.setOption(option5);
getLineDayNoOk({
typeCode: "produce",
factoryCode: "ds_" + _this.selectxt,
}).then((response) => {
if (response) {
let seriesmyChart5 = [];
let legenddata = [];
let dataoption = response.series;
let xAxisdata = response.dayStr;
let yAxismax = [];
let yAxismaxall = 0;
dataoption.forEach((n) => {
if (n.data) {
// console.log(Math.max(...n.data), n.data)
yAxismax.push(Math.max(...n.data));
}
var item = {
name: n.machineName,
data: n.data,
emphasis: {
focus: "series",
},
type: "bar",
stack: n.machineName,
2 years ago
};
legenddata.push(n.machineName);
seriesmyChart5.push(item);
});
yAxismaxall = Math.max(...yAxismax) + 5;
option5 = {
xAxis: [
{
data: xAxisdata,
},
],
legend: {
data: legenddata,
},
yAxis: [
{
max: yAxismaxall,
},
],
series: seriesmyChart5,
};
// console.log(seriesmyChart5,'111111111111111')
myChart5.setOption(option5);
}
});
var myChart6 = echarts.init(document.querySelector("#echart6"));
var option6 = {
grid: {
left: "2%",
right: "4%",
top: "15%",
bottom: "2%",
containLabel: true,
},
tooltip: {
trigger: "axis",
axisPointer: {
type: "cross",
crossStyle: {
color: "#999",
},
}
},
legend: {
show: true,
x: "center",
y: "0",
icon: "stack",
itemWidth: 10,
itemHeight: 10,
textStyle: {
color: "#D0DEEE",
},
// nameTextStyle:{
// color: '#D0DEEE'
// },
data: [],
},
xAxis: [
{
type: "category",
boundaryGap: true,
axisLabel: {
color: fontColor,
},
axisLine: {
show: true,
lineStyle: {
color: "#397cbc",
},
},
axisTick: {
show: false,
},
splitLine: {
show: false,
lineStyle: {
color: "#2B3241",
},
},
data: [],
},
],
yAxis: [
{
type: "value",
name: "数量",
nameTextStyle: {
color: "#D0DEEE",
},
min: 0,
max: 1000,
axisLabel: {
formatter: "{value} PC",
textStyle: {
color: "#D0DEEE",
},
},
axisLine: {
lineStyle: {
color: "#27b4c2",
},
},
axisTick: {
show: false,
},
splitLine: {
show: true,
lineStyle: {
color: "#2B3241",
},
},
},
{
type: "value",
name: "比例",
nameTextStyle: {
color: "#D0DEEE",
},
min: 0,
max: 100,
axisLabel: {
formatter: "{value} %",
textStyle: {
color: "#D0DEEE",
},
},
axisLine: {
lineStyle: {
color: "#27b4c2",
},
},
axisTick: {
show: false,
},
splitLine: {
show: true,
lineStyle: {
color: "#2B3241",
},
},
},
],
series: [
{
name: "去年不合格率(%)",
type: "line",
stack: "无",
symbol: "circle",
symbolSize: 8,
yAxisIndex: 1,
itemStyle: {
normal: {
color: "#5260CE",
lineStyle: {
color: "#5260CE",
width: 1,
2 years ago
},
},
},
//label: {
// show: true, // 开启显示
// position: "top", // 显示位置,可以是'top', 'bottom', 'left', 'right'等
// formatter: "{c}", // {c} 表示系列中的当前数据值
//},
data: [],
},
{
name: "本年不合格率(%)",
type: "line",
stack: "无",
symbol: "circle",
symbolSize: 8,
yAxisIndex: 1,
itemStyle: {
normal: {
color: "#88E4E3",
lineStyle: {
color: "#88E4E3",
width: 1,
2 years ago
},
},
},
//label: {
// show: true, // 开启显示
// position: "bottom", // 显示位置,可以是'top', 'bottom', 'left', 'right'等
// formatter: "{c}", // {c} 表示系列中的当前数据值
//},
data: [],
},
{
name: "去年不合格数量(PC)",
data: [],
type: "bar",
label: { // 在柱顶显示数值
show: true,
position: 'top', // 位置在柱顶
formatter: function(params) {// 显示数据值
const value = parseInt(params.value) || params.value;
return `${value} PC`;
}
},
showBackground: true,
backgroundStyle: {
color: "rgba(180, 180, 180, 0.2)",
},
itemStyle: {
normal: {
barBorderRadius: 5,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: "#586AF2" },
{ offset: 1, color: "#1C293A" },
]),
},
},
},
{
name: "本年不合格数量(PC)",
data: [],
type: "bar",
label: { // 在柱顶显示数值
show: true,
position: 'top', // 位置在柱顶
formatter: function(params) {// 显示数据值
const value = parseInt(params.value) || params.value;
return `${value} PC`;
}
},
showBackground: true,
backgroundStyle: {
color: "rgba(180, 180, 180, 0.2)",
},
itemStyle: {
normal: {
barBorderRadius: 5,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: "#66E1DF" },
{ offset: 1, color: "#005954" },
]),
},
},
},
],
};
myChart6.setOption(option6);
getMonthOfYearContrast({
typeCode: "produce",
factoryCode: "ds_" + _this.selectxt,
}).then((response) => {
if (response) {
let seriesdata1 = response[0].dataBarArrays;
let seriesdata2 = response[0].dataLineArrays;
let xAxisdata = response[0].dayStr;
let seriesdata3 = response[1].dataBarArrays;
let seriesdata4 = response[1].dataLineArrays;
let max1 = Math.max(...seriesdata1) + 5;
let max2 = Math.max(...seriesdata3) + 5;
let max3 = Math.max(...seriesdata2) + 5;
let max4 = Math.max(...seriesdata4) + 5;
let legenddata = [];
legenddata.push("去年不合格数量(PC)");
legenddata.push("本年不合格数量(PC)");
legenddata.push("去年不合格率(%)");
legenddata.push("本年不合格率(%)");
let yAxismax1 = 0;
let yAxismax2 = 0;
if (max1 > max2) {
yAxismax1 = max1;
} else {
yAxismax1 = max2;
}
if (max3 > max4) {
yAxismax2 = max3;
} else {
yAxismax2 = max4;
}
option6 = {
xAxis: [
{
data: xAxisdata,
},
],
yAxis: [
{
max: yAxismax1,
},
{
max: yAxismax2,
},
],
series: [
{
data: seriesdata2,
},
{
data: seriesdata4,
},
{
data: seriesdata1,
},
{
data: seriesdata3,
},
],
legend: {
data: legenddata,
},
};
myChart6.setOption(option6);
}
});
},
initChart2() {
const _this = this;
// "todayOkRate":今日合格率","monthOkRate":"当月合理率"
let intactRate = 0;
let numberAngle = 360;
let intactRate1 = 0;
let numberAngle1 = 360;
if (_this.equipmentinfo.todayOkRate) {
intactRate = parseFloat(_this.equipmentinfo.todayOkRate);
numberAngle = (100 - parseInt(_this.equipmentinfo.todayOkRate)) * 3.6;
}
if (_this.equipmentinfo.monthOkRate) {
intactRate1 = parseFloat(_this.equipmentinfo.monthOkRate);
numberAngle1 = (100 - parseInt(_this.equipmentinfo.monthOkRate)) * 3.6;
}
var myChart1 = echarts.init(document.querySelector("#echart1"));
var option1 = {
//提示框组件。开发实际中去掉了指针,提示框可以不用设置。
tooltip: {
formatter: "{a} <br/>{b} : {c}%",
},
grid: {},
//下面属性才是仪表盘的核心!!反正我是这么认为的!!!
series: [
{
//类型
splitNumber: 4, //刻度数量
type: "gauge",
//半径
radius: 60,
//起始角度。圆心 正右手侧为0度正上方为90度正左手侧为180度。
startAngle: 360,
//结束角度。
endAngle: 0,
center: ["50%", "50%"],
//仪表盘轴线相关配置。
name: "内层盘",
type: "gauge",
axisLine: {
lineStyle: {
width: 10,
color: [
[
1,
new echarts.graphic.LinearGradient(0, 0, 1, 0, [
{
offset: 0,
color: "#334046",
},
{
offset: 1,
color: "#334046",
},
]),
],
2 years ago
],
},
},
axisTick: {
lineStyle: {
color: "#fff",
width: 1,
},
length: 6,
splitNumber: 1,
show: false,
},
splitLine: {
show: false,
},
axisLabel: {
show: false,
},
pointer: {
show: false,
},
data: [
{
show: false,
value: "0",
},
],
detail: {
show: 0,
},
},
{
//类型
splitNumber: 4, //刻度数量
type: "gauge",
//半径
radius: 60,
//起始角度。圆心 正右手侧为0度正上方为90度正左手侧为180度。
startAngle: 360,
//结束角度。
endAngle: numberAngle,
center: ["50%", "50%"],
//仪表盘轴线相关配置。
name: "内层盘",
type: "gauge",
axisLine: {
lineStyle: {
width: 10,
color: [
[
1,
new echarts.graphic.LinearGradient(0, 0, 1, 0, [
{
offset: 0,
color: "#4789E1",
},
{
offset: 1,
color: "#4789E1",
},
]),
],
2 years ago
],
},
},
axisTick: {
lineStyle: {
color: "#fff",
width: 1,
},
length: 6,
splitNumber: 1,
show: false,
},
splitLine: {
show: false,
},
axisLabel: {
show: false,
},
pointer: {
show: false,
},
data: [
{
show: false,
value: "0",
},
],
detail: {
show: 0,
},
},
{
//类型
splitNumber: 4, //刻度数量
type: "gauge",
//半径
radius: 40,
//起始角度。圆心 正右手侧为0度正上方为90度正左手侧为180度。
startAngle: 360,
//结束角度。
endAngle: 0,
center: ["50%", "50%"],
//仪表盘轴线相关配置。
name: "内层盘",
type: "gauge",
axisLine: {
lineStyle: {
width: 5,
color: [
[
1,
new echarts.graphic.LinearGradient(0, 0, 1, 0, [
{
offset: 0.1,
color: "#334046",
},
{
offset: 0.6,
color: "#334046",
},
{
offset: 1,
color: "#334046",
},
]),
],
2 years ago
],
},
},
axisTick: {
lineStyle: {
color: "#334046",
width: 1,
},
length: 4,
splitNumber: 1,
distance: 0,
show: true,
},
splitLine: {
show: false,
},
axisLabel: {
show: false,
},
pointer: {
show: false,
},
axisLabel: {
show: false,
},
detail: {
show: true,
valueAnimation: true,
formatter: "{value}%",
offsetCenter: [0, "10%"],
textStyle: {
color: "#fff",
fontSize: 25,
},
},
data: [
{
value: intactRate,
},
],
},
],
};
myChart1.setOption(option1);
var myChart4 = echarts.init(document.querySelector("#echart4"));
var option4 = {
//提示框组件。开发实际中去掉了指针,提示框可以不用设置。
tooltip: {
formatter: "{a} <br/>{b} : {c}%",
2 years ago
},
grid: {},
//下面属性才是仪表盘的核心!!反正我是这么认为的!!!
series: [
{
//类型
splitNumber: 4, //刻度数量
type: "gauge",
//半径
radius: 60,
//起始角度。圆心 正右手侧为0度正上方为90度正左手侧为180度。
startAngle: 360,
//结束角度。
endAngle: 0,
center: ["50%", "50%"],
//仪表盘轴线相关配置。
name: "内层盘",
type: "gauge",
axisLine: {
lineStyle: {
width: 10,
color: [
[
1,
new echarts.graphic.LinearGradient(0, 0, 1, 0, [
{
offset: 0,
color: "#334046",
},
{
offset: 1,
color: "#334046",
},
]),
],
],
},
},
axisTick: {
lineStyle: {
color: "#fff",
width: 1,
},
length: 6,
splitNumber: 1,
show: false,
},
splitLine: {
show: false,
},
axisLabel: {
show: false,
},
pointer: {
show: false,
},
data: [
{
show: false,
value: "0",
},
],
detail: {
show: 0,
},
},
{
//类型
splitNumber: 4, //刻度数量
type: "gauge",
//半径
radius: 60,
//起始角度。圆心 正右手侧为0度正上方为90度正左手侧为180度。
startAngle: 360,
//结束角度。
endAngle: numberAngle1,
center: ["50%", "50%"],
//仪表盘轴线相关配置。
name: "内层盘",
type: "gauge",
axisLine: {
lineStyle: {
width: 10,
color: [
[
1,
new echarts.graphic.LinearGradient(0, 0, 1, 0, [
{
offset: 0,
color: "#89F7F6",
},
{
offset: 1,
color: "#89F7F6",
},
]),
],
2 years ago
],
},
},
axisTick: {
lineStyle: {
color: "#fff",
width: 1,
},
length: 6,
splitNumber: 1,
show: false,
},
splitLine: {
show: false,
},
axisLabel: {
show: false,
},
pointer: {
show: false,
},
data: [
{
show: false,
value: "0",
},
],
detail: {
show: 0,
},
},
{
//类型
splitNumber: 4, //刻度数量
type: "gauge",
//半径
radius: 40,
//起始角度。圆心 正右手侧为0度正上方为90度正左手侧为180度。
startAngle: 360,
//结束角度。
endAngle: 0,
center: ["50%", "50%"],
//仪表盘轴线相关配置。
name: "内层盘",
type: "gauge",
axisLine: {
lineStyle: {
width: 5,
color: [
[
1,
new echarts.graphic.LinearGradient(0, 0, 1, 0, [
{
offset: 0.1,
color: "#334046",
},
{
offset: 0.6,
color: "#334046",
},
{
offset: 1,
color: "#334046",
},
]),
],
],
},
},
axisTick: {
lineStyle: {
color: "#334046",
width: 1,
},
length: 4,
splitNumber: 1,
distance: 0,
show: true,
},
splitLine: {
show: false,
},
axisLabel: {
show: false,
},
pointer: {
show: false,
},
axisLabel: {
show: false,
},
detail: {
show: true,
valueAnimation: true,
formatter: "{value}%",
offsetCenter: [0, "10%"],
textStyle: {
color: "#fff",
fontSize: 25,
},
},
data: [
{
value: intactRate1,
},
],
},
],
};
myChart4.setOption(option4);
},
initChart3() {
const _this = this;
var colorList = [
"#2D6ACA",
"#72C6B5",
"#F0D766",
"#80B5F4",
"#FD866A",
"#9E87FF",
"#58D5FF",
];
var data = _this.optionDatalist2;
var myChart2 = echarts.init(document.querySelector("#echart2"));
var option2 = {
//提示框组件。开发实际中去掉了指针,提示框可以不用设置。
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b} : {c}PC"
},
grid: {
top: "60",
},
legend: {
bottom: "10",
// itemGap: 40,
icon: "pin",
textStyle: {
rich: {
a: {
color: "#FFFFFF",
width: 70,
fontSize: 13,
},
b: {
color: "#FFFFFF",
fontSize: 13,
padding: [0, 30, 0, 40],
},
b0: {
color: "#73DDFF",
fontSize: 20,
padding: [0, 30, 0, 40],
},
},
},
formatter: function (name) {
let title = "";
var total = 0;
var target;
var index;
for (var i = 0, l = data.length; i < l; i++) {
if (data[i].name == name) {
target = data[i].value+"PC";
title = data[i].label;
index = i < 6 ? i : 5;
}
}
return `{a| ${name}}{b| ${target}}`;
},
},
//下面属性才是仪表盘的核心!!反正我是这么认为的!!!
series: [
{
//类型
splitNumber: 4, //刻度数量
type: "gauge",
//半径
radius: 150,
//起始角度。圆心 正右手侧为0度正上方为90度正左手侧为180度。
startAngle: 360,
//结束角度。
endAngle: 0,
center: ["50%", "40%"],
//仪表盘轴线相关配置。
type: "gauge",
axisLine: {
lineStyle: {
width: 50,
color: [
[
1,
new echarts.graphic.LinearGradient(0, 0, 1, 0, [
{
offset: 0.1,
color: "#1C2738",
},
{
offset: 0.6,
color: "#1C2738",
},
{
offset: 1,
color: "#1C2738",
},
]),
],
],
},
},
axisTick: {
lineStyle: {
color: "#070E19",
width: 3,
},
length: 50,
splitNumber: 2,
distance: -50,
show: true,
},
splitLine: {
show: false,
},
axisLabel: {
show: false,
},
pointer: {
show: false,
},
axisLabel: {
show: false,
},
detail: {
show: false,
valueAnimation: true,
formatter: "{value}%",
offsetCenter: [0, "10%"],
textStyle: {
color: "#fff",
fontSize: 25,
},
},
data: [
{
value: 80,
show: false,
},
],
},
{
type: "pie",
radius: ["44%", "63%"],
center: ["50%", "40%"],
roseType: "radius",
//label: {
// formatter: function(params) {
// // params 包含数据项信息
// return `${params.name}: ${params.value}PC (${params.percent}%)`;
// }
//},
label: {
show: false,
},
tooltip: {
trigger: 'item', // 触发类型,饼图使用'item'
formatter: '{b}: {c}PC ({d}%)' // 默认格式
},
emphasis: {
label: {
show: false,
},
},
data: data,
},
{
//类型
splitNumber: 4, //刻度数量
type: "gauge",
//半径
radius: 140,
//起始角度。圆心 正右手侧为0度正上方为90度正左手侧为180度。
startAngle: 360,
//结束角度。
endAngle: 0,
center: ["50%", "40%"],
//仪表盘轴线相关配置。
type: "gauge",
axisLine: {
lineStyle: {
width: 1,
color: [
[
1,
new echarts.graphic.LinearGradient(0, 0, 1, 0, [
{
offset: 0.1,
color: "#619e9d",
},
{
offset: 0.6,
color: "#619e9d",
},
{
offset: 1,
color: "#619e9d",
},
]),
],
],
},
},
axisTick: {
lineStyle: {
color: "#070E19",
width: 3,
},
length: 50,
splitNumber: 2,
distance: -50,
show: false,
},
splitLine: {
show: false,
},
axisLabel: {
show: false,
},
pointer: {
show: false,
},
axisLabel: {
show: false,
},
detail: {
show: false,
valueAnimation: true,
formatter: "{value}%",
offsetCenter: [0, "10%"],
textStyle: {
color: "#fff",
fontSize: 25,
},
},
data: [
{
value: 80,
show: false,
},
],
},
{
//类型
splitNumber: 4, //刻度数量
type: "gauge",
//半径
radius: 80,
//起始角度。圆心 正右手侧为0度正上方为90度正左手侧为180度。
startAngle: 360,
//结束角度。
endAngle: 0,
center: ["50%", "40%"],
//仪表盘轴线相关配置。
type: "gauge",
axisLine: {
lineStyle: {
width: 1,
color: [
[
1,
new echarts.graphic.LinearGradient(0, 0, 1, 0, [
{
offset: 0.1,
color: "#619e9d",
},
{
offset: 0.6,
color: "#619e9d",
},
{
offset: 1,
color: "#619e9d",
},
]),
],
],
},
},
axisTick: {
lineStyle: {
color: "#070E19",
width: 3,
},
length: 50,
splitNumber: 2,
distance: -50,
show: false,
},
splitLine: {
show: false,
},
axisLabel: {
show: false,
},
pointer: {
show: false,
},
axisLabel: {
show: false,
},
detail: {
show: false,
valueAnimation: true,
formatter: "{value}%",
offsetCenter: [0, "10%"],
textStyle: {
color: "#fff",
fontSize: 25,
},
},
data: [
{
value: 80,
show: false,
},
],
},
{
//类型
splitNumber: 4, //刻度数量
type: "gauge",
//半径
radius: 60,
//起始角度。圆心 正右手侧为0度正上方为90度正左手侧为180度。
startAngle: 360,
//结束角度。
endAngle: 0,
center: ["50%", "40%"],
//仪表盘轴线相关配置。
type: "gauge",
axisLine: {
lineStyle: {
width: 1,
color: [
[
1,
new echarts.graphic.LinearGradient(0, 0, 1, 0, [
{
offset: 0.1,
color: "#619e9d",
},
{
offset: 0.6,
color: "#619e9d",
},
{
offset: 1,
color: "#619e9d",
},
]),
],
],
},
},
axisTick: {
lineStyle: {
color: "#070E19",
width: 3,
},
length: 50,
splitNumber: 2,
distance: -50,
show: false,
},
splitLine: {
show: false,
},
axisLabel: {
show: false,
},
pointer: {
show: false,
},
axisLabel: {
show: false,
},
detail: {
show: false,
valueAnimation: true,
formatter: "{value}%",
offsetCenter: [0, "10%"],
textStyle: {
color: "#fff",
fontSize: 25,
},
},
data: [
{
value: 80,
show: false,
},
],
},
],
};
myChart2.setOption(option2);
},
selectline() {
const _this = this;
this.optionDatalist1 = [];
this.optionDatalist2 = [];
this.optionDatalist3 = [];
this.optionDatalist4 = [];
this.getdatalist();
this.initChart1();
},
selectline2(ymd) {
if (ymd == "yyyy") {
this.yearShow = true;
this.monthShow = false;
this.dateShow = false;
} else if (ymd == "mm") {
this.yearShow = false;
this.monthShow = true;
this.dateShow = false;
} else if (ymd == "dd") {
this.yearShow = false;
this.monthShow = false;
this.dateShow = true;
}
},
//左侧第一个选择类型下拉框 回调函数
},
};
</script>
<style lang="scss" scoped>
.app-container {
padding: 0px 24px;
}
.wrapscroll {
overflow: hidden;
}
.home {
width: 100%;
height: 100vh;
background: url("../../../assets/images/bg-body.png") no-repeat;
background-size: 100% 100%;
background-color: #050711;
.head {
width: 100%;
height: 74px;
position: relative;
.head-content {
height: 74px;
background-image: url("../../../assets/images/bg-head.png");
background-repeat: no-repeat;
background-size: 100% 100%;
text-align: center;
.title {
font-size: 42px;
font-weight: 400;
color: #ffffff;
}
}
.head-logo {
position: absolute;
left: 0px;
top: 1px;
img {
height: 38px;
// width: ;
}
}
.back {
position: absolute;
right: 0px;
top: 5px;
}
}
.content-top {
display: flex;
justify-content: space-between;
position: relative;
.factory {
width: 600px;
height: 60px;
background: url("../../../assets/images/bg- border1.png") no-repeat;
background-size: 100% 100%;
text-align: center;
position: absolute;
top: -17px;
left: 0px;
}
.timebox {
width: 480px;
height: 60px;
background: url("../../../assets/images/bg-border2.png") no-repeat;
background-size: 100% 100%;
text-align: center;
position: absolute;
top: -17px;
right: 0px;
.time {
font-size: 30px;
font-weight: 400;
color: #ffffff;
line-height: 71px;
}
}
}
.content {
margin-top: 63px;
.itemtop {
display: flex;
justify-content: space-between;
align-items: center;
.item-table {
width: 455px;
height: 492px;
background: url("../../../assets/images/equipment/bg-border1.png")
no-repeat;
background-size: 100% 100%;
padding: 27px 21px 30px 25px;
box-sizing: border-box;
box-sizing: border-box;
.equipmentinfobox {
margin-top: 27px;
display: flex;
align-items: center;
justify-content: space-around;
.box {
width: 128px;
height: 96px;
background: url("../../../assets/images/equipment/number.png")
no-repeat;
background-size: 100% 100%;
text-align: center;
padding-top: 30px;
box-sizing: border-box;
.number {
.number1 {
font-size: 30px;
font-weight: 500;
color: #66ffff;
line-height: 10px;
}
}
.name2 {
margin-top: 3px;
font-size: 16px;
font-weight: bold;
color: #ffffff;
}
}
}
.equipmentinfobox1 {
margin-top: 22px;
display: flex;
align-items: center;
justify-content: space-between;
.box {
width: 199px;
height: 96px;
background: url("../../../assets/images/equipment/number.png")
no-repeat;
background-size: 100% 100%;
text-align: center;
padding-top: 30px;
box-sizing: border-box;
.number {
.number1 {
font-size: 30px;
font-weight: 500;
color: #66ffff;
line-height: 10px;
}
}
.name2 {
margin-top: 3px;
font-size: 16px;
font-weight: bold;
color: #ffffff;
}
}
}
.table-tbody {
.item {
width: 412px;
height: 44px;
display: flex;
align-items: center;
justify-content: space-between;
padding-left: 15px;
padding-right: 10px;
margin-bottom: 14px;
position: relative;
.icon {
position: absolute;
transform: rotate(45deg);
top: -2px;
left: 0px;
width: 0;
height: 0;
border-right: 6px solid #3be8ff;
border-top: 6px solid transparent;
border-bottom: 6px solid transparent;
}
.itemname1 {
font-size: 16px;
color: #66e1df;
}
.itemname2 {
font-size: 14px;
color: #d0deee;
}
}
}
.bigechartbox {
display: flex;
position: relative;
.title1 {
font-size: 18px;
font-weight: 400;
color: #99b3c8;
position: absolute;
bottom: -26px;
left: 52px;
}
.title2 {
position: absolute;
font-size: 18px;
font-weight: 400;
color: #99b3c8;
bottom: -26px;
right: 58px;
}
}
}
}
.itembottom {
margin-top: 19px;
display: flex;
justify-content: space-around;
.item-table {
width: 929px;
height: 403px;
background: url("../../../assets/images/equipment/bg-border1.png")
no-repeat;
background-size: 100% 100%;
padding: 27px 21px 30px 25px;
box-sizing: border-box;
box-sizing: border-box;
.table-thead {
width: 100%;
height: 44px;
margin: auto;
background: #0a1a33;
td {
font-size: 19px;
font-family: NotoSansHans-Medium, NotoSansHans;
font-weight: 500;
color: #159aff;
text-align: center;
white-space: nowrap;
}
}
.table-tbody {
height: 192px;
// width: 1775px;
margin: auto;
overflow-y: scroll;
table {
width: 100%;
tbody {
width: 100%;
td {
font-size: 19px;
font-family: NotoSansHans-Medium, NotoSansHans;
font-weight: 500;
color: #ffffff;
text-align: center;
border-bottom: 1px dashed #6c8097;
}
}
}
}
}
.item-table1:first-child {
margin-right: 10px;
}
.item-table1 {
flex: 1;
margin-top: 20px;
padding-top: 19px;
// .table-thead {
// width: 565.01px;
// }
.table-tbody {
height: 144px;
}
}
}
}
}
.titlebox {
width: 431px;
height: 38px;
background: url("../../../assets/images/bg-title.png") no-repeat;
background-size: 100% 100%;
// text-align: center;
font-size: 20px;
font-weight: bold;
color: #ffffff;
line-height: 38px;
letter-spacing: 2px;
text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.5);
padding-left: 60px;
// .titlename{
// position: relative;
// left: 24px;
// }
}
.factory {
display: flex;
// justify-content: space-around;
}
.selectborder {
background-color: transparent;
border-radius: 4px;
// border: 2px solid #27408c;
position: relative;
display: flex;
align-items: center;
justify-content: space-around;
width: 280px;
margin-left: 50px;
}
.selectborder1 {
background-color: transparent;
border-radius: 4px;
// border: 2px solid #27408c;
position: relative;
display: flex;
align-items: center;
justify-content: space-around;
width: 66px;
margin-left: 25px;
}
.selectborder select {
/*清除select的边框样式*/
border: none;
/*清除select聚焦时候的边框颜色*/
outline: none;
background-color: transparent;
/*将select的宽高等于div的宽高*/
width: 100%;
height: 50px;
/*隐藏select的下拉图标*/
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
font-size: 25px;
font-weight: 400;
color: #ffffff;
line-height: 42px;
}
.selectborder option {
/*清除select的边框样式*/
border: none;
/*清除select聚焦时候的边框颜色*/
outline: none;
background-color: transparent;
/*将select的宽高等于div的宽高*/
width: 100%;
height: 50px;
/*隐藏select的下拉图标*/
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
padding-left: 20px;
font-size: 25px;
font-weight: 500;
color: #3fa2ff;
border-radius: 0%;
}
.selectborder1 option {
/*清除select的边框样式*/
border: none;
/*清除select聚焦时候的边框颜色*/
outline: none;
background-color: transparent;
/*将select的宽高等于div的宽高*/
width: 200px;
height: 50px;
/*隐藏select的下拉图标*/
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
padding-left: 20px;
font-size: 25px;
font-weight: 500;
color: #3fa2ff;
border-radius: 0%;
}
.selectborder:after {
content: "";
width: 24px;
height: 24px;
background: url(../../../assets/images/xiala.png) no-repeat center;
/*通过定位将图标放在合适的位置*/
position: absolute;
right: 0px;
top: 25%;
/*给自定义的图标实现点击下来功能*/
pointer-events: none;
}
.selectborder1:after {
content: "";
width: 24px;
height: 24px;
background: url(../../../assets/images/xiala.png) no-repeat center;
/*通过定位将图标放在合适的位置*/
position: absolute;
right: 0px;
top: 25%;
/*给自定义的图标实现点击下来功能*/
pointer-events: none;
}
::v-deep .el-button--primary {
color: #ffffff;
background-color: #325e82;
border-color: #0a0f19;
}
.active1 {
background-color: #0a162a;
}
.active2 {
background-color: #101f2c;
}
::-webkit-scrollbar {
width: 3px;
height: 0px;
background-color: #0c0642;
}
/*定义滚动条轨道 内阴影+圆角*/
::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
border-radius: 8px;
background-color: #07356a;
}
/*定义滑块 内阴影+圆角*/
::-webkit-scrollbar-thumb {
border-radius: 8px;
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
background-color: #0091ff;
// opacity: 0.1;
}
::v-deep .el-range-editor--medium .el-range-input {
font-size: 12px;
}
</style>