|
@@ -2,14 +2,14 @@
|
|
<div class="box">
|
|
<div class="box">
|
|
<div class="header">
|
|
<div class="header">
|
|
<el-row :gutter="20">
|
|
<el-row :gutter="20">
|
|
- <el-col v-for="item in 4" :key="item" :span="6">
|
|
|
|
|
|
+ <el-col v-for="(item, i) in iocnList" :key="i" :span="6">
|
|
<el-card class="box-card">
|
|
<el-card class="box-card">
|
|
<div class="card-flex">
|
|
<div class="card-flex">
|
|
<div class="flex-left">
|
|
<div class="flex-left">
|
|
- <i class="el-icon-s-order" :style="{ fontSize: '72px', color: color }"></i>
|
|
|
|
|
|
+ <i :class="[item.icon]" :style="{ fontSize: '72px', color: color }"></i>
|
|
</div>
|
|
</div>
|
|
<div class="flex-right">
|
|
<div class="flex-right">
|
|
- <p :style="{marginBottom: '8px', color: color}">今日报警总数</p>
|
|
|
|
|
|
+ <p :style="{marginBottom: '8px', color: color}">{{item.name}}</p>
|
|
<p>15</p>
|
|
<p>15</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -39,7 +39,8 @@
|
|
</div>
|
|
</div>
|
|
<x-form :formItems="formItems" :day="day" @setDay="setDay" @setChange="setChange" @onClickType="onClickType"></x-form>
|
|
<x-form :formItems="formItems" :day="day" @setDay="setDay" @setChange="setChange" @onClickType="onClickType"></x-form>
|
|
<div style="width: 100%; height: 400px">
|
|
<div style="width: 100%; height: 400px">
|
|
- <chart-wsd :data="TempAndHumList"></chart-wsd>
|
|
|
|
|
|
+ <chart-wsd v-if="TempAndHumList.humidities.length > 0" :data="TempAndHumList"></chart-wsd>
|
|
|
|
+ <el-empty v-else description="暂无数据" style="width: 100%;"></el-empty>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<br/>
|
|
<br/>
|
|
@@ -49,26 +50,28 @@
|
|
<el-button type="text" style="float: right; margin-right: 25px" @click="jump(2)">详情</el-button>
|
|
<el-button type="text" style="float: right; margin-right: 25px" @click="jump(2)">详情</el-button>
|
|
</div>
|
|
</div>
|
|
<x-form :formItems="formItems" :day="day" @setDay="setDay" @setChange="setChange" @onClickType="onClickType"></x-form>
|
|
<x-form :formItems="formItems" :day="day" @setDay="setDay" @setChange="setChange" @onClickType="onClickType"></x-form>
|
|
- <div class="pen-flex">
|
|
|
|
|
|
+ <div class="pen-flex" v-if="waterList.length > 0">
|
|
<div class="pen-left">
|
|
<div class="pen-left">
|
|
<div class="water">
|
|
<div class="water">
|
|
- <p>本月用水量</p>
|
|
|
|
- <p>10000t</p>
|
|
|
|
|
|
+ <p>上月用水量</p>
|
|
|
|
+ <p>{{monthWater}}t</p>
|
|
<p>
|
|
<p>
|
|
- <i class="el-icon-caret-top" style="color: red"></i>
|
|
|
|
- <span style="color: red">10%</span>
|
|
|
|
|
|
+ <i v-if="Number(monthWeekPercent) > 0" class="el-icon-caret-top" style="color: red"></i>
|
|
|
|
+ <i v-else class="el-icon-caret-bottom" style="color: #1ABC9C"></i>
|
|
|
|
+ <span :style="{color: Number(monthWeekPercent) > 0 ? 'red' : '#1ABC9C'}">{{monthWeekPercent}}%</span>
|
|
|
|
|
|
- <span style="font-size: 16px; color: #CFDBED">同比上月</span>
|
|
|
|
|
|
+ <span style="font-size: 16px; color: #CFDBED">环比上月</span>
|
|
</p>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<div class="water">
|
|
<div class="water">
|
|
- <p>本周用水量</p>
|
|
|
|
- <p>10000t</p>
|
|
|
|
|
|
+ <p>上周用水量</p>
|
|
|
|
+ <p>{{weekWater}}t</p>
|
|
<p>
|
|
<p>
|
|
- <i class="el-icon-caret-bottom" style="color: #1ABC9C"></i>
|
|
|
|
- <span style="color: #1ABC9C">10%</span>
|
|
|
|
|
|
+ <i v-if="Number(weekWeekPercent) > 0" class="el-icon-caret-top" style="color: red"></i>
|
|
|
|
+ <i v-else class="el-icon-caret-bottom" style="color: #1ABC9C"></i>
|
|
|
|
+ <span :style="{color: Number(weekWeekPercent) > 0 ? 'red' : '#1ABC9C'}">{{weekWeekPercent}}%</span>
|
|
|
|
|
|
- <span style="font-size: 16px; color: #CFDBED">同比上周</span>
|
|
|
|
|
|
+ <span style="font-size: 16px; color: #CFDBED">环比上周</span>
|
|
</p>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -76,6 +79,9 @@
|
|
<chart-water :dataValue="waterList" :room="waterRoom"></chart-water>
|
|
<chart-water :dataValue="waterList" :room="waterRoom"></chart-water>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div v-else>
|
|
|
|
+ <el-empty description="暂无数据" style="width: 100%;"></el-empty>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
<br/>
|
|
<br/>
|
|
<div class="pending">
|
|
<div class="pending">
|
|
@@ -93,7 +99,7 @@
|
|
<i class="el-icon-caret-top" style="color: red"></i>
|
|
<i class="el-icon-caret-top" style="color: red"></i>
|
|
<span style="color: red">10%</span>
|
|
<span style="color: red">10%</span>
|
|
|
|
|
|
- <span style="font-size: 16px; color: #CFDBED">同比上月</span>
|
|
|
|
|
|
+ <span style="font-size: 16px; color: #CFDBED">环比上月</span>
|
|
</p>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<div class="water">
|
|
<div class="water">
|
|
@@ -116,33 +122,35 @@
|
|
<div class="pending">
|
|
<div class="pending">
|
|
<div class="title" :style="{color: color}">
|
|
<div class="title" :style="{color: color}">
|
|
<span>卖猪统计</span>
|
|
<span>卖猪统计</span>
|
|
- <el-button type="text" style="float: right; margin-right: 25px">详情</el-button>
|
|
|
|
|
|
+ <el-button type="text" style="float: right; margin-right: 25px" @click="jump(4)">详情</el-button>
|
|
</div>
|
|
</div>
|
|
<div class="pen-flex">
|
|
<div class="pen-flex">
|
|
<div class="pen-left">
|
|
<div class="pen-left">
|
|
<div class="water">
|
|
<div class="water">
|
|
- <p>本月销售总量</p>
|
|
|
|
- <p>10000</p>
|
|
|
|
|
|
+ <p>上月销售总量</p>
|
|
|
|
+ <p>{{weekSales}}元</p>
|
|
<p>
|
|
<p>
|
|
- <i class="el-icon-caret-top" style="color: red"></i>
|
|
|
|
- <span style="color: red">10%</span>
|
|
|
|
|
|
+ <i v-if="Number(weekSalesChange) > 0" class="el-icon-caret-top" style="color: red"></i>
|
|
|
|
+ <i v-else class="el-icon-caret-bottom" style="color: #1ABC9C"></i>
|
|
|
|
+ <span :style="{color: Number(weekSalesChange) > 0 ? 'red' : '#1ABC9C'}">{{weekSalesChange}}%</span>
|
|
|
|
|
|
- <span style="font-size: 16px; color: #CFDBED">同比上月</span>
|
|
|
|
|
|
+ <span style="font-size: 16px; color: #CFDBED">环比上月</span>
|
|
</p>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<div class="water">
|
|
<div class="water">
|
|
- <p>本周用电量</p>
|
|
|
|
- <p>10000</p>
|
|
|
|
|
|
+ <p>上月销售量</p>
|
|
|
|
+ <p>{{ weekSalesVolume }}头</p>
|
|
<p>
|
|
<p>
|
|
- <i class="el-icon-caret-bottom" style="color: #1ABC9C"></i>
|
|
|
|
- <span style="color: #1ABC9C">10%</span>
|
|
|
|
|
|
+ <i v-if="Number(weekSalesVolumeChange) > 0" class="el-icon-caret-top" style="color: red"></i>
|
|
|
|
+ <i v-else class="el-icon-caret-bottom" style="color: #1ABC9C"></i>
|
|
|
|
+ <span :style="{color: Number(weekSalesVolumeChange) > 0 ? 'red' : '#1ABC9C'}">{{weekSalesVolumeChange}}%</span>
|
|
|
|
|
|
- <span style="font-size: 16px; color: #CFDBED">同比上周</span>
|
|
|
|
|
|
+ <span style="font-size: 16px; color: #CFDBED">环比上月</span>
|
|
</p>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div style="width: 85%; height: 400px">
|
|
<div style="width: 85%; height: 400px">
|
|
- <chart-pig></chart-pig>
|
|
|
|
|
|
+ <chart-pig :data="salesChartData"></chart-pig>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -158,6 +166,7 @@ import ChartWater from "./chart/ChartWater";
|
|
import ChartPig from "./chart/ChartPig";
|
|
import ChartPig from "./chart/ChartPig";
|
|
import { getByFloor, getByRoom, getListWater, getSchool, getUid} from "../../utils/api";
|
|
import { getByFloor, getByRoom, getListWater, getSchool, getUid} from "../../utils/api";
|
|
import {timeDate} from "../../utils";
|
|
import {timeDate} from "../../utils";
|
|
|
|
+import { getTheSales } from "../../utils/chenApi";
|
|
export default {
|
|
export default {
|
|
name: "dashboard",
|
|
name: "dashboard",
|
|
components: {
|
|
components: {
|
|
@@ -170,6 +179,24 @@ export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
dialogVisible: false,
|
|
dialogVisible: false,
|
|
|
|
+ iocnList: [
|
|
|
|
+ {
|
|
|
|
+ icon: 'el-icon-s-order',
|
|
|
|
+ name: '今日报警总数'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ icon: 'el-icon-shopping-bag-1',
|
|
|
|
+ name: '昨日卖猪总数'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ icon: 'el-icon-coin',
|
|
|
|
+ name: '昨日出栏总数'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ icon: 'el-icon-finished',
|
|
|
|
+ name: '近7天卖猪总数'
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
elements: [
|
|
elements: [
|
|
{
|
|
{
|
|
id: 1,
|
|
id: 1,
|
|
@@ -271,7 +298,15 @@ export default {
|
|
TempAndHumList: {},
|
|
TempAndHumList: {},
|
|
waterList: [],
|
|
waterList: [],
|
|
waterRoom: '',
|
|
waterRoom: '',
|
|
- rtsp: 'rtsp://36.26.62.70:9320/playback/pu/184?token=184'
|
|
|
|
|
|
+ weekWater: 0,
|
|
|
|
+ weekWeekPercent: 0,
|
|
|
|
+ monthWater: 0,
|
|
|
|
+ monthWeekPercent: 0,
|
|
|
|
+ weekSales: 0,
|
|
|
|
+ weekSalesChange: 0,
|
|
|
|
+ weekSalesVolume: 0,
|
|
|
|
+ weekSalesVolumeChange: 0,
|
|
|
|
+ salesChartData: {},
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -369,8 +404,24 @@ export default {
|
|
getListWater({type: 2}).then(res => {
|
|
getListWater({type: 2}).then(res => {
|
|
if(res.code === 10000) {
|
|
if(res.code === 10000) {
|
|
this.waterList = res.data.data;
|
|
this.waterList = res.data.data;
|
|
- console.log(this.waterList)
|
|
|
|
this.waterRoom = res.data.room;
|
|
this.waterRoom = res.data.room;
|
|
|
|
+ this.weekWater = res.data.weekWater;
|
|
|
|
+ this.weekWeekPercent = res.data.weekWeekPercent;
|
|
|
|
+ this.monthWater = res.data.monthWater;
|
|
|
|
+ this.monthWeekPercent = res.data.monthWeekPercent;
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ getTheSales({type: 2}).then(res => {
|
|
|
|
+ if (res.code === 10000) {
|
|
|
|
+ this.weekSales = res.data.money;
|
|
|
|
+ this.weekSalesChange = res.data.moneyPercent;
|
|
|
|
+ this.weekSalesVolume = res.data.quantity;
|
|
|
|
+ this.weekSalesVolumeChange = res.data.quantityPercent;
|
|
|
|
+ this.salesChartData = {
|
|
|
|
+ moneyList: res.data.moneyList,
|
|
|
|
+ quantityList: res.data.quantityList,
|
|
|
|
+ timeList: res.data.timeList,
|
|
|
|
+ };
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -379,6 +430,8 @@ export default {
|
|
this.$router.push('/pigHouseEnv');
|
|
this.$router.push('/pigHouseEnv');
|
|
} else if(num === 2) {
|
|
} else if(num === 2) {
|
|
this.$router.push('/drinkWater');
|
|
this.$router.push('/drinkWater');
|
|
|
|
+ } else if(num === 4) {
|
|
|
|
+ this.$router.push('/analysis');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|