Commit 4319c15f authored by W_Y's avatar W_Y

parent 98e7c597
...@@ -35,3 +35,21 @@ export function findCountIdByPtype1CreateDate(query) { ...@@ -35,3 +35,21 @@ export function findCountIdByPtype1CreateDate(query) {
params: query params: query
}) })
} }
// 比例
export function findMoM(query) {
return request({
url: '/WeHomePage/findMoM',
method: 'get',
params: query
})
}
// 总接口
export function findControl(query) {
return request({
url: '/WeHomePage/findControl',
method: 'get',
params: query
})
}
src/assets/image/controlDown.png

265 Bytes | W: | H:

src/assets/image/controlDown.png

3.11 KB | W: | H:

src/assets/image/controlDown.png
src/assets/image/controlDown.png
src/assets/image/controlDown.png
src/assets/image/controlDown.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -5,74 +5,92 @@ ...@@ -5,74 +5,92 @@
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
<div> <div>
<div class="topTitle">本月注册用户</div> <div class="topTitle">本月化学品入库记录数</div>
<div class="TopBody"> <div class="TopBody">
<div> <div>
<img class="span_image" src="@/assets/image/controlIcon.png"> <img class="span_image" src="@/assets/image/controlIcon.png">
</div> </div>
<div>20</div> <div>{{this.hxNum}}</div>
</div> </div>
<div class="TopFooter"> <div class="TopFooter">
<div style="display: inline-block"></div> <div style="display: inline-block"></div>
<div style="display: inline-block"> <div style="display: inline-block">
<img style="color: red" class="arrows" src="@/assets/image/controlUp.png"> <img style="color: red" class="arrows" src="@/assets/image/controlUp.png" v-if="num1 >= 0">
<img style="color: red" class="arrows" src="@/assets/image/controlDown.png" v-else>
</div>
<div v-if="num1 >= 0" style="color: #DC1919; display: inline-block">
{{num1}}%
</div>
<div v-else style="color: #27dc19; display: inline-block">
{{-num1}}%
</div> </div>
<div style="color: #DC1919; display: inline-block">20%</div>
</div> </div>
</div> </div>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<div> <div>
<div class="topTitle">本月实名用户量(新增)</div> <div class="topTitle">本月化学品错误记录数量</div>
<div class="TopBody"> <div class="TopBody">
<div> <div>
<img class="span_image" src="@/assets/image/controlIcon2.png"> <img class="span_image" src="@/assets/image/controlIcon2.png">
</div> </div>
<div>10</div> <div>{{this.hxErrorNum}}</div>
</div> </div>
<div class="TopFooter"> <div class="TopFooter">
<div style="display: inline-block"></div> <div style="display: inline-block"></div>
<div style="display: inline-block"> <div style="display: inline-block">
<img style="color: red" class="arrows" src="@/assets/image/controlUp.png"> <img style="color: red" class="arrows" src="@/assets/image/controlUp.png" v-if="num2 >= 0">
<img style="color: red" class="arrows" src="@/assets/image/controlDown.png" v-else>
</div>
<div v-if="num2 >= 0" style="color: #DC1919; display: inline-block">
{{num2}}%
</div>
<div v-else style="color: #27dc19; display: inline-block">
{{-num2}}%
</div> </div>
<div style="color: #DC1919; display: inline-block">3%</div>
</div> </div>
</div> </div>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<div> <div>
<div class="topTitle">本月用户量(新增)</div> <div class="topTitle">本月网板入库记录数量</div>
<div class="TopBody"> <div class="TopBody">
<div> <div>
<img class="span_image" src="@/assets/image/controlIcon3.png"> <img class="span_image" src="@/assets/image/controlIcon3.png">
</div> </div>
<div>10</div> <div>{{this.wbNum}}</div>
</div> </div>
<div class="TopFooter"> <div class="TopFooter">
<div style="display: inline-block"></div> <div style="display: inline-block"></div>
<div style="display: inline-block"> <div style="display: inline-block">
<img style="color: red" class="arrows" src="@/assets/image/controlUp.png"> <img style="color: red" class="arrows" src="@/assets/image/controlUp.png" v-if="num3 >= 0">
<img style="color: red" class="arrows" src="@/assets/image/controlDown.png" v-else>
</div>
<div v-if="num3 >= 0" style="color: #DC1919; display: inline-block">
{{num3}}%
</div>
<div v-else style="color: #27dc19; display: inline-block">
{{-num3}}%
</div> </div>
<div style="color: #DC1919;display: inline-block">3%</div>
</div> </div>
</div> </div>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<div> <div>
<div class="topTitle">本月申请量(新增)</div> <div class="topTitle">网板实时在库数量</div>
<div class="TopBody"> <div class="TopBody">
<div> <div>
<img class="span_image" src="@/assets/image/controlIcon4.png"> <img class="span_image" src="@/assets/image/controlIcon4.png">
</div> </div>
<div>2</div> <div>{{this.realTime}}</div>
</div>
<div class="TopFooter">
<div style="display: inline-block"></div>
<div style="display: inline-block">
<img style="color: red" class="arrows" src="@/assets/image/controlUp.png">
</div>
<div style="color: #DC1919;display: inline-block">1%</div>
</div> </div>
<!-- <div class="TopFooter">-->
<!-- <div style="display: inline-block"></div>-->
<!-- <div style="display: inline-block">-->
<!-- <img style="color: red" class="arrows" src="@/assets/image/controlUp.png">-->
<!-- </div>-->
<!-- <div style="color: #DC1919;display: inline-block">1%</div>-->
<!-- </div>-->
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
...@@ -156,9 +174,7 @@ ...@@ -156,9 +174,7 @@
<script> <script>
import * as echarts from 'echarts' import * as echarts from 'echarts'
import judgeLeaveMessage from 'svg-sprite-loader/examples/custom-runtime-generator/build/main' import judgeLeaveMessage from 'svg-sprite-loader/examples/custom-runtime-generator/build/main'
// import { controlData } from './apis' import { findCountIdByUpdateDate, findCountIdByFqYy, findCountIdByPtype, findCountIdByPtype1CreateDate, findMoM, findControl } from '@/api/controlPlatform'
// import { judgeLeaveMessage } from '@/views/judgeMessageManage/apis'
import { findCountIdByUpdateDate, findCountIdByFqYy, findCountIdByPtype, findCountIdByPtype1CreateDate } from '@/api/controlPlatform'
export default { export default {
name: 'Control', name: 'Control',
...@@ -194,6 +210,20 @@ export default { ...@@ -194,6 +210,20 @@ export default {
value: '', value: '',
name: '' name: ''
}], }],
// 化学本月入库数量
hxNum: 0,
// 化学上月入库数量
lastHxNum: 0,
// 化学本月错误数量
hxErrorNum: 0,
// 化学上月错误数量
lastHxErrorNum: 0,
// 网版板月入库数量
wbNum: 0,
// 网板上月入库数量
lastWbNum: 0,
// 实时数量
realTime: 0,
isShow: true, isShow: true,
isShow2: false, isShow2: false,
judgeMessageData: 0, judgeMessageData: 0,
...@@ -262,6 +292,20 @@ export default { ...@@ -262,6 +292,20 @@ export default {
] ]
} }
}, },
computed: {
num1 () {
if ( this.lastHxNum === 0) return 0
return Math.ceil((this.hxNum - this.lastHxNum) / this.lastHxNum * 100) / 100
},
num2 () {
if ( this.lastHxErrorNum === 0) return 0
return Math.ceil((this.hxErrorNum - this.lastHxErrorNum) / this.lastHxErrorNum * 100) / 100
},
num3 () {
if ( this.lastWbNum === 0) return 0
return Math.ceil((this.wbNum - this.lastWbNum) / this.lastWbNum * 100) / 100
}
},
mounted() { mounted() {
this.handleGetCauseNum() this.handleGetCauseNum()
this.handleGetJudgeMessage() this.handleGetJudgeMessage()
...@@ -272,7 +316,9 @@ export default { ...@@ -272,7 +316,9 @@ export default {
this.handleGetJudgeMessageData() this.handleGetJudgeMessageData()
this.handleGetStatisticsData() this.handleGetStatisticsData()
this.startInterval() this.startInterval()
this.getUpdateList() // this.getUpdateList()
// this.getMom()
// this.getAll()
// 通过监听内容部分的宽度让图表resize // 通过监听内容部分的宽度让图表resize
var elementResizeDetectorMaker = require('element-resize-detector') var elementResizeDetectorMaker = require('element-resize-detector')
var erd = elementResizeDetectorMaker() var erd = elementResizeDetectorMaker()
...@@ -327,18 +373,20 @@ export default { ...@@ -327,18 +373,20 @@ export default {
methods: { methods: {
// 开始循环调用 // 开始循环调用
startInterval() { startInterval() {
this.getSumUpdateList() // 先立刻执行一次 // this.getSumUpdateList() // 先立刻执行一次
this.getSumList() // this.getSumList()
this.getPtypeList() // this.getPtypeList()
this.getUpdateList() // this.getUpdateList()
this.getAll()
this.intervalId = setInterval(() => { this.intervalId = setInterval(() => {
if (this.stopTimer === true) { if (this.stopTimer === true) {
clearInterval(this.intervalId) clearInterval(this.intervalId)
} else { } else {
this.getSumUpdateList() // this.getSumUpdateList()
this.getSumList() // this.getSumList()
this.getPtypeList() // this.getPtypeList()
this.getUpdateList() // this.getUpdateList()
this.getAll()
} }
}, 3000) // 间隔 2 秒调用一次,根据实际需求调整间隔时间 }, 3000) // 间隔 2 秒调用一次,根据实际需求调整间隔时间
}, },
...@@ -388,7 +436,6 @@ export default { ...@@ -388,7 +436,6 @@ export default {
// 饼图2 // 饼图2
getUpdateList() { getUpdateList() {
findCountIdByPtype1CreateDate().then(res => { findCountIdByPtype1CreateDate().then(res => {
console.log('---res---', res)
this.PtypeList1 = [] this.PtypeList1 = []
const renamedData1 = res.data.map(item => ({ const renamedData1 = res.data.map(item => ({
...item, ...item,
...@@ -396,10 +443,88 @@ export default { ...@@ -396,10 +443,88 @@ export default {
value: item.sum value: item.sum
})) }))
this.PtypeList1 = renamedData1 this.PtypeList1 = renamedData1
console.log('this.PtypeList1', this.PtypeList1)
this.updateVisitorData1() this.updateVisitorData1()
}) })
}, },
getMom() {
findMoM().then(res => {
// 本月化学数量
this.hxNum = res.data.num1ThisMonth
// 化学上月入库数量
this.lastHxNum = res.data.num1LastMonth
// 化学本月错误数量
this.hxErrorNum = res.data.num2ThisMonth
// 化学上月错误数量
this.lastHxErrorNum = res.data.num2LastMonth
// 网版板月入库数量
this.wbNum = res.data.num3ThisMonth
// 网板上月入库数量
this.lastWbNum = res.data.num3LastMonth
// 实时数量
this.realTime = res.data.num3All
})
},
// 总图
getAll() {
findControl().then( res => {
console.log('----全部数据----',res)
// 折线图
this.sumUpdateList = res.data.findCountIdByUpdateDate
this.numList = []
this.dataList = []
this.sumUpdateList.forEach(item => {
this.numList.push(item.sum)
this.dataList.push(item.time)
})
this.updateRegistrationTime()
// 柱状图
this.sumFqYyList = res.data.findCountIdByFqYy
this.YyList = []
this.FqNumList = []
this.sumFqYyList.forEach(item => {
this.YyList.push(item.fq_yy)
this.FqNumList.push(item.sum)
})
this.updateChartsLeaveMessage()
// 饼图1
this.PtypeList = []
const renamedData = res.data.findCountIdByPtype.map(item => ({
...item,
name: item.ptype === '1' ? '设备库' : (item.ptype === '2' ? '工序库' : item.ptype),
value: item.sum
}))
this.PtypeList = renamedData
this.updateVisitorData()
})
// 饼图2
this.PtypeList1 = []
const renamedData1 = res.data.findCountIdByPtype1CreateDate.map(item => ({
...item,
name: item.time,
value: item.sum
}))
this.PtypeList1 = renamedData1
this.updateVisitorData1()
// 月同比
// 本月化学数量
this.hxNum = res.data.findMoM.num1ThisMonth
// 化学上月入库数量
this.lastHxNum = res.data.findMoM.num1LastMonth
// 化学本月错误数量
this.hxErrorNum = res.data.findMoM.num2ThisMonth
// 化学上月错误数量
this.lastHxErrorNum = res.data.findMoM.num2LastMonth
// 网版板月入库数量
this.wbNum = res.data.findMoM.num3ThisMonth
// 网板上月入库数量
this.lastWbNum = res.data.findMoM.num3LastMonth
// 实时数量
this.realTime = res.data.findMoM.num3All
},
handleClick(row) { handleClick(row) {
this.$router.push({ this.$router.push({
path: '/sf/message/messageBack', path: '/sf/message/messageBack',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment