系统名称修改

This commit is contained in:
zhanghan11 2024-07-30 14:37:10 +08:00
parent 0c93b0686f
commit 400aedb4b6

View File

@ -1,121 +1,93 @@
<template> <template>
<div class="app-container home"> <div class="app-container home">
<el-row <el-row :gutter="10" class="firstrow">
:gutter="10"
class="firstrow"
>
<!-- 设备概览--> <!-- 设备概览-->
<el-col <el-col :span="16" class="eqinfo">
:span="16" <el-col :span="8" class="total">
class="eqinfo" <img src=""/>
> <span class="title">总设备</span>
<el-col <br/>
:span="8" <span class="vlaue">{{eqNumTotal}}</span>
class="total" </el-col>
> <el-col :span="8" class="run">
<img src="" /> <span class="title">运行中设备</span>
<span class="title">总设备</span> <br/>
<br /> <span class="vlaue">{{eqNumRunning}}</span>
<span class="vlaue">{{eqNumTotal}}</span> </el-col>
</el-col> <el-col :span="8" class="notrun">
<el-col <span class="title">停运设备</span>
:span="8" <br/>
class="run" <span class="vlaue">{{eqNumOff}}</span>
> </el-col>
<span class="title">运行中设备</span>
<br />
<span class="vlaue">{{eqNumRunning}}</span>
</el-col>
<el-col
:span="8"
class="notrun"
>
<span class="title">停运设备</span>
<br />
<span class="vlaue">{{eqNumOff}}</span>
</el-col>
</el-col> </el-col>
<!-- 欢迎--> <!-- 欢迎-->
<el-col <el-col :span="8" class="welcome">
:span="8" <el-col :span="24" class="title">
class="welcome"
>
<el-col
:span="24"
class="title"
>
<span class="title1">欢迎登录</span> <span class="title1">欢迎登录</span>
<br /> <br/>
<span class="vlaue">设备预测性维护系统</span> <span class="vlaue">设备健康管理系统</span>
</el-col> </el-col>
</el-col> </el-col>
</el-row> </el-row>
<el-row <el-row :gutter="20" class="secendrow">
:gutter="20" <el-col :span="16" class="chart1">
class="secendrow" <div class="echarts-body" ref="averageRunningTimeEcharts">
> {{ initAverageRunningTimeEcharts() }}
<el-col </div>
:span="24" </el-col>
class="chart1" <el-col :span="8" class="mytask">
> <div class="mytasktitle">
<el-card class="chart1"> <span style="font-weight: bold;font-size: 18px">我的待办</span>
<div <span style="float: right;cursor: pointer;" @click="goMyTask">更多</span>
class="echarts-body" </div>
ref="patrolChart" <el-table :data="taskList" :border="false" class="taskTable">
> <el-table-column label="流程名称" align="center" prop="processName" :show-overflow-tooltip="true" />
</div> <el-table-column label="任务名称" align="center" prop="taskName" :show-overflow-tooltip="true" />
</el-card> <el-table-column label="发起人" align="center" prop="starter" :show-overflow-tooltip="true" />
<el-table-column label="任务时间" align="center" prop="createTime" width="180" :show-overflow-tooltip="true" />
</el-table>
</el-col> </el-col>
</el-row> </el-row>
<el-row <el-row :gutter="20" class="thirdrow">
:gutter="20" <el-col :span="16" class="chart2">
class="thirdrow" <div class="echarts-body" ref="shutdownRateEcharts">
> {{ initShutdownRateEcharts() }}
<el-col </div>
:span="8"
class="chart2"
>
<el-card class="chart2">
<div
class="echarts-body"
ref="classChart"
>
</div>
</el-card>
</el-col> </el-col>
<el-col <el-col :span="8" class="notice">
:span="8" <div class="noticetitle">
class="chart2" <span style="font-weight: bold;font-size: 18px">公告信息</span>
> </div>
<el-card class="chart2"> <el-table :data="noticeList" :show-header="false">
<div <el-table-column
class="echarts-body" label="公告标题"
ref="locationChart" align="center"
> prop="noticeTitle"
</div> :show-overflow-tooltip="true"
</el-card> />
</el-col> <el-table-column label="公告类型" align="center" prop="noticeType" width="100">
<el-col <template slot-scope="scope">
:span="8" <dict-tag :options="dict.type.sys_notice_type" :value="scope.row.noticeType"/>
class="chart2" </template>
> </el-table-column>
<el-card class="chart2"> <el-table-column label="创建时间" align="center" prop="createTime" width="100">
<div <template slot-scope="scope">
class="echarts-body" <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
ref="fileChart" </template>
> </el-table-column>
</div> </el-table>
</el-card>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
</template> </template>
<script> <script>
import * as echarts from "echarts"; import * as echarts from 'echarts';
import { queryEqNum, loadChartsData } from "@/api/index"; import { listMytask } from "@/api/flowable/mytask";
import { listNotice } from "@/api/system/notice";
import { queryEqNum , loadChartsData} from "@/api/index";
export default { export default {
name: "Index", name: "Index",
dicts: ["sys_notice_type"], dicts: ['sys_notice_type'],
data() { data() {
return { return {
// //
@ -124,273 +96,284 @@ export default {
eqNumRunning: 0, eqNumRunning: 0,
// //
eqNumOff: 0, eqNumOff: 0,
//
taskList: [],
taskTotal: 0,
taskQueryParams:{
pageNum: 1,
pageSize: 6
},
noticeList: [],
noticeTotal: 0,
noticeQueryParams:{
pageNum: 1,
pageSize: 7
},
//
averageRunningTimeEchart:{},
shutdownRateEchart:{}
}; };
}, },
created() { created() {
this.getTaskList();
this.getEqInfo(); this.getEqInfo();
this.getNoticeList();
this.getChartsData(); this.getChartsData();
}, },
methods: { methods: {
getEqInfo() { getTaskList(){
queryEqNum().then((response) => { listMytask(this.taskQueryParams).then(response => {
this.taskList = response.rows;
this.taskTotal = response.total;
});
},
getNoticeList(){
listNotice(this.noticeQueryParams).then(response => {
this.noticeList = response.rows;
this.noticeTotal = response.total;
});
},
getEqInfo(){
queryEqNum().then(response => {
this.eqNumTotal = response.data.total; this.eqNumTotal = response.data.total;
this.eqNumRunning = response.data.run; this.eqNumRunning = response.data.run;
this.eqNumOff = response.data.notRun; this.eqNumOff = response.data.notRun;
}); });
}, },
getChartsData() { goMyTask(){
loadChartsData().then((response) => { this.$router.push({
this.initPatrolChart( path: '/flowable/flowmanage/mytask/index',
response.data.monthList,
response.data.dailyList,
response.data.meterReadingList,
response.data.professionalList
);
this.initClassChart(response.data.classList);
this.initLocationChart(response.data.locationList);
this.initFileChart(response.data.fileList);
}); });
}, },
initPatrolChart(monthList, dailyList, meterReadingList, professionalList) { initAverageRunningTimeEcharts(){
monthList = monthList.map((month) => month + "月"); let p = new Promise((resolve) => {
let chart = echarts.init(this.$refs.patrolChart); resolve()
let option = { })
title: { p.then(() => {
text: "近三月点巡检记录统计", this.averageRunningTimeEchart = echarts.init(this.$refs.averageRunningTimeEcharts)
left: "center", let option = {
}, title:{
legend: { text:"设备日平均运行时长"
orient: "vertical",
left: "left",
data: ["日常巡检", "抄表巡检", "专业巡检"],
},
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow",
}, },
}, xAxis: {
xAxis: [ type: 'category',
{ axisTick:{show:false},
type: "category", axisLabel:{interval: 0}
axisTick: { show: false }, // data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
data: monthList,
}, },
], //
yAxis: [ grid:{
{ top: '18%',
type: "value", left: '1%',
right: '1%',
bottom: '10%',
containLabel: true
}, },
], yAxis: {
series: [ name: 'min',
{ type: 'value',
name: "日常巡检", show: true,
type: "bar", axisLine:{show:false},//线
data: dailyList, splitLine:{
}, lineStyle: {
{ type:'dashed'//线
name: "抄表巡检",
type: "bar",
data: meterReadingList,
},
{
name: "专业巡检",
type: "bar",
data: professionalList,
},
],
};
chart.setOption(option);
},
initClassChart(data) {
let chart = echarts.init(this.$refs.classChart);
let option = {
title: {
text: "设备分类统计",
left: "center",
},
label: { formatter: " {b}{d}%" },
tooltip: {
trigger: "item",
},
legend: {
orient: "vertical",
left: "left",
},
series: [
{
name: "设备分类",
type: "pie",
radius: "50%",
data: data,
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: "rgba(0, 0, 0, 0.5)",
}, },
}, show:true
}
}, },
], series: [
}; {
chart.setOption(option); // data: [120, 200, 150, 80, 70, 110, 130],
}, type: 'bar',
initLocationChart(data) {
let chart = echarts.init(this.$refs.locationChart);
let option = {
title: {
text: "设备分布统计",
left: "center",
},
label: { formatter: " {b}{d}%" },
tooltip: {
trigger: "item",
},
legend: {
orient: "vertical",
left: "left",
},
series: [
{
name: "设备分布",
type: "pie",
radius: "50%",
data: data,
emphasis: {
itemStyle: { itemStyle: {
shadowBlur: 10, color: '#3E7BFA'
shadowOffsetX: 0, }
shadowColor: "rgba(0, 0, 0, 0.5)", }
}, ]
}, }
}, this.averageRunningTimeEchart.setOption(option);
], })
};
chart.setOption(option);
}, },
initFileChart(data) { initShutdownRateEcharts(){
let chart = echarts.init(this.$refs.fileChart); let p = new Promise((resolve) => {
let option = { resolve()
title: { })
text: "档案分类统计", p.then(() => {
left: "center", this.shutdownRateEchart = echarts.init(this.$refs.shutdownRateEcharts);
}, let option = {
label: { formatter: " {b}{d}%" }, title:{
tooltip: { text:"设备停机率"
trigger: "item", },
}, xAxis: {
legend: { type: 'category',
orient: "vertical", axisTick:{show:false},
left: "left", axisLabel:{interval: 0}
}, // data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
series: [ },
{ //
name: "档案分类", grid:{
type: "pie", top: '18%',
radius: "50%", left: '1%',
data: data, right: '1%',
emphasis: { bottom: '10%',
containLabel: true
},
yAxis: {
name: '%',
type: 'value',
show: true,
axisLine:{show:false},//线
splitLine:{
lineStyle: {
type:'dashed'//线
},
show:true
}
},
series: [
{
// data: [82, 93, 90, 93, 29, 33, 13],
type: 'line',
smooth: true,
itemStyle: { itemStyle: {
shadowBlur: 10, color: '#3E7BFA'
shadowOffsetX: 0,
shadowColor: "rgba(0, 0, 0, 0.5)",
}, },
}, areaStyle: {
}, color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
], {
}; offset: 0,
chart.setOption(option); color: 'rgba(62,123,250,0.3)'
},
{
offset: 1,
color: 'rgba(255,255,255,0.3)'
}
])
},
}
]
}
this.shutdownRateEchart.setOption(option);
})
}, },
}, getChartsData(){
loadChartsData().then(response => {
//
let option1 = {
xAxis: {
data: response.data.dateList
},
series: [
{
data: response.data.runTimeList
}
]
}
this.averageRunningTimeEchart.setOption(option1);
let option2 = {
xAxis: {
data: response.data.dateList
},
series: [
{
data: response.data.shutdownRateList
}
]
}
this.shutdownRateEchart.setOption(option2);
});
}
}
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.home { .home {
.firstrow { .firstrow{
height: 172px; height: 172px;
.eqinfo { .eqinfo{
height: 100%; height: 100%;
.total { .total{
height: 100%; height: 100%;
background: url(../assets/images/index/total.png) center no-repeat; background: url(../assets/images/index/total.png) center no-repeat;
background-size: 95% 100%; background-size: 95% 100%;
.title { .title{
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;
left: 50px; left: 50px;
top: 50px; top: 50px;
position: relative; position: relative;
} }
.vlaue { .vlaue{
font-size: 32px; font-size: 32px;
font-weight: bold; font-weight: bold;
color: #3e7bfa; color: #3E7BFA;
left: 70px; left: 70px;
top: 60px; top: 60px;
position: relative; position: relative;
} }
} }
.run { .run{
height: 100%; height: 100%;
background: url(../assets/images/index/run.png) center no-repeat; background: url(../assets/images/index/run.png) center no-repeat;
background-size: 95% 100%; background-size: 95% 100%;
.title { .title{
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;
left: 40px; left: 40px;
top: 50px; top: 50px;
position: relative; position: relative;
} }
.vlaue { .vlaue{
font-size: 32px; font-size: 32px;
font-weight: bold; font-weight: bold;
color: #06c270; color: #06C270;
left: 80px; left: 80px;
top: 60px; top: 60px;
position: relative; position: relative;
} }
} }
.notrun { .notrun{
height: 100%; height: 100%;
background: url(../assets/images/index/notRun.png) center no-repeat; background: url(../assets/images/index/notRun.png) center no-repeat;
background-size: 95% 100%; background-size: 95% 100%;
.title { .title{
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;
left: 40px; left: 40px;
top: 50px; top: 50px;
position: relative; position: relative;
} }
.vlaue { .vlaue{
font-size: 32px; font-size: 32px;
font-weight: bold; font-weight: bold;
color: #ff8800; color: #FF8800;
left: 70px; left: 70px;
top: 60px; top: 60px;
position: relative; position: relative;
} }
} }
} }
.welcome { .welcome{
height: 100%; height: 100%;
.title { .title{
height: 100%; height: 100%;
background: url(../assets/images/index/welcome.png) center no-repeat; background: url(../assets/images/index/welcome.png) center no-repeat;
background-size: 100% 130%; background-size: 100% 130%;
.title1 { .title1{
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;
color: #ffffff; color: #FFFFFF;
left: 40px; left: 40px;
top: 50px; top: 50px;
position: relative; position: relative;
float: left; float: left;
} }
.vlaue { .vlaue{
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;
color: #ffffff; color: #FFFFFF;
left: -40px; left: -40px;
top: 60px; top: 60px;
position: relative; position: relative;
@ -399,41 +382,35 @@ export default {
} }
} }
} }
.secendrow { .secendrow{
height: 383px; height: 383px;
margin-top: 20px; margin-top: 20px;
.chart1 { .chart1{
height: 100%; height: 100%;
.echarts-body { .echarts-body{
height: 100%; height: 100%;
width: 100%; width: 100%;
} }
} }
.mytask { .mytask{
.mytasktitle { .mytasktitle{
height: 35px; height: 35px;
padding-left: 5px; padding-left: 5px;
padding-right: 5px; padding-right: 5px;
} }
} }
} }
.thirdrow { .thirdrow{
height: 383px; height: 383px;
margin-top: 20px; .chart2{
.chart2 {
height: 100%; height: 100%;
.echarts-body { .echarts-body{
height: 100%; height: 100%;
width: 100%; width: 100%;
} }
} }
} }
} }
</style> </style>
<style>
.el-card__body {
height: 100%;
width: 100%;
}
</style>