|
@@ -2,13 +2,14 @@
|
|
<view>
|
|
<view>
|
|
<view class="head">
|
|
<view class="head">
|
|
<view class="company">
|
|
<view class="company">
|
|
- <font style="color: #F76260;">申泽棉花糖后台</font>
|
|
|
|
|
|
+ <font style="color: #F76260;">申泽智能物联</font>
|
|
</view>
|
|
</view>
|
|
<view class="pname">
|
|
<view class="pname">
|
|
<font class="wenzi" style="color: #F76260;text-align:right">用户:{{pname}}</font>
|
|
<font class="wenzi" style="color: #F76260;text-align:right">用户:{{pname}}</font>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="qiun-title-bar color">
|
|
<view class="qiun-title-bar color">
|
|
|
|
+ <view class="qiun-title-dot-light1"><font style="color: #FFFFFF;">总投放机器数量: {{machineTotalNum}} 工作机器数量:{{machineUseNum}}</font></view>
|
|
<view class="qiun-title-dot-light1"><font style="color: #FFFFFF;">今日收入总额: {{dayTotalMoney}} 销售数量:{{dayTotalNum}}</font></view>
|
|
<view class="qiun-title-dot-light1"><font style="color: #FFFFFF;">今日收入总额: {{dayTotalMoney}} 销售数量:{{dayTotalNum}}</font></view>
|
|
<view class="qiun-title-dot-light1"><font style="color: #FFFFFF;">本周收入总额: {{weekTotalMoney}} 销售数量:{{weekTotalNum}}</font></view>
|
|
<view class="qiun-title-dot-light1"><font style="color: #FFFFFF;">本周收入总额: {{weekTotalMoney}} 销售数量:{{weekTotalNum}}</font></view>
|
|
<view class="qiun-title-dot-light1"><font style="color: #FFFFFF;">本月收入总额: {{monthTotalMoney}} 销售数量:{{monthTotalNum}}</font></view>
|
|
<view class="qiun-title-dot-light1"><font style="color: #FFFFFF;">本月收入总额: {{monthTotalMoney}} 销售数量:{{monthTotalNum}}</font></view>
|
|
@@ -77,6 +78,7 @@
|
|
import { mapState, mapActions, mapMutations } from 'vuex';
|
|
import { mapState, mapActions, mapMutations } from 'vuex';
|
|
import uCharts from '@/components/u-charts/u-charts.js';
|
|
import uCharts from '@/components/u-charts/u-charts.js';
|
|
import {dateUtils} from '@/common/util.js';
|
|
import {dateUtils} from '@/common/util.js';
|
|
|
|
+
|
|
var _self;
|
|
var _self;
|
|
var canvaColumn1=null;
|
|
var canvaColumn1=null;
|
|
var canvaColumn2=null;
|
|
var canvaColumn2=null;
|
|
@@ -91,6 +93,8 @@
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
pname:'',
|
|
pname:'',
|
|
|
|
+ machineTotalNum:0,
|
|
|
|
+ machineUseNum:0,
|
|
dayTotalMoney:0,
|
|
dayTotalMoney:0,
|
|
dayTotalNum:0,
|
|
dayTotalNum:0,
|
|
weekTotalMoney:0,
|
|
weekTotalMoney:0,
|
|
@@ -134,23 +138,27 @@
|
|
this.init();
|
|
this.init();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- ...mapActions('chart', ['getStatistics','getMainStatistics']),
|
|
|
|
|
|
+ ...mapActions('chart', ['getStatistics','getMainStatistics','getMachineNum']),
|
|
async init(){
|
|
async init(){
|
|
console.log("adminId:" + this.adminId)
|
|
console.log("adminId:" + this.adminId)
|
|
console.log("equipmentId:" + this.equipmentId)
|
|
console.log("equipmentId:" + this.equipmentId)
|
|
_self = this;
|
|
_self = this;
|
|
- this.cWidth = uni.upx2px(750);
|
|
|
|
- this.cHeight = uni.upx2px(500);
|
|
|
|
-
|
|
|
|
|
|
+ //图表中图
|
|
|
|
+ this.cWidth = uni.upx2px(600);
|
|
|
|
+ this.cHeight = uni.upx2px(430);
|
|
|
|
+
|
|
await this.getMainStatisticsData();
|
|
await this.getMainStatisticsData();
|
|
|
|
|
|
await this.initDateRang(new Date(),'day');
|
|
await this.initDateRang(new Date(),'day');
|
|
await this.initDateRang(new Date(),'week');
|
|
await this.initDateRang(new Date(),'week');
|
|
await this.initDateRang(new Date(),'month');
|
|
await this.initDateRang(new Date(),'month');
|
|
await this.initDateRang(new Date(),'year');
|
|
await this.initDateRang(new Date(),'year');
|
|
|
|
+
|
|
//初次登陆跳转后,把test变成2
|
|
//初次登陆跳转后,把test变成2
|
|
uni.setStorageSync('test', '2');
|
|
uni.setStorageSync('test', '2');
|
|
|
|
+
|
|
},
|
|
},
|
|
|
|
+
|
|
initDateRang(day,chartType) {
|
|
initDateRang(day,chartType) {
|
|
const daystr = dateUtils.formateDate(day, 'yyyy/MM/dd');
|
|
const daystr = dateUtils.formateDate(day, 'yyyy/MM/dd');
|
|
if(chartType === 'day'){
|
|
if(chartType === 'day'){
|
|
@@ -242,6 +250,7 @@
|
|
if (this.equipmentId) {
|
|
if (this.equipmentId) {
|
|
param['equipmentId'] = this.equipmentId;
|
|
param['equipmentId'] = this.equipmentId;
|
|
}
|
|
}
|
|
|
|
+
|
|
return this.getStatistics(param)
|
|
return this.getStatistics(param)
|
|
.then(data => {
|
|
.then(data => {
|
|
uni.stopPullDownRefresh();
|
|
uni.stopPullDownRefresh();
|
|
@@ -257,6 +266,7 @@
|
|
if(param['chartType']=='year'){
|
|
if(param['chartType']=='year'){
|
|
canvaColumn4 = this.initChart('canvaColumn4',data);
|
|
canvaColumn4 = this.initChart('canvaColumn4',data);
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
, _ => {
|
|
, _ => {
|
|
uni.stopPullDownRefresh();
|
|
uni.stopPullDownRefresh();
|
|
@@ -283,7 +293,7 @@
|
|
type: 'column',
|
|
type: 'column',
|
|
legend: true,
|
|
legend: true,
|
|
fontSize: 11,
|
|
fontSize: 11,
|
|
- background: '#E5FDC3',
|
|
|
|
|
|
+ background: '#E5FDC3',//y轴颜色
|
|
pixelRatio: 1,
|
|
pixelRatio: 1,
|
|
animation: true,
|
|
animation: true,
|
|
categories: chartData.categories,
|
|
categories: chartData.categories,
|
|
@@ -294,8 +304,8 @@
|
|
itemCount: 5, //x轴单屏显示数据的数量,默认为5个
|
|
itemCount: 5, //x轴单屏显示数据的数量,默认为5个
|
|
scrollShow: true, //新增是否显示滚动条,默认false
|
|
scrollShow: true, //新增是否显示滚动条,默认false
|
|
scrollAlign: 'left', //滚动条初始位置
|
|
scrollAlign: 'left', //滚动条初始位置
|
|
- scrollBackgroundColor: '#F7F7FF', //默认为 #EFEBEF
|
|
|
|
- scrollColor: '#DEE7F7', //默认为 #A6A6A6
|
|
|
|
|
|
+ scrollBackgroundColor: '#F7F7FF', //默认为 #EFEBEF 滚动条颜色底色
|
|
|
|
+ scrollColor: '#DEE7F7', //默认为 #A6A6A6 滚动条颜色
|
|
// disableGrid:true,
|
|
// disableGrid:true,
|
|
},
|
|
},
|
|
yAxis: {
|
|
yAxis: {
|
|
@@ -322,7 +332,23 @@
|
|
if (this.equipmentId) {
|
|
if (this.equipmentId) {
|
|
param['equipmentId'] = this.equipmentId;
|
|
param['equipmentId'] = this.equipmentId;
|
|
}
|
|
}
|
|
- console.log('getMainStatisticsData:{}',param)
|
|
|
|
|
|
+ console.log('getMainStatisticsData:{}',param);
|
|
|
|
+ var adminId = param.adminId;
|
|
|
|
+ var equipmentId = this.equipmentId;
|
|
|
|
+ var serverurl = this.serverurl;
|
|
|
|
+ uni.request({
|
|
|
|
+ url: serverurl+'/TEquipment/getMachineNum',
|
|
|
|
+ data:{
|
|
|
|
+ "adminId":adminId,
|
|
|
|
+ "equipmentId":equipmentId
|
|
|
|
+ },
|
|
|
|
+ method:"POST",
|
|
|
|
+ success: (res) => {
|
|
|
|
+ var list = res.data.data;
|
|
|
|
+ this.machineTotalNum = list[0];
|
|
|
|
+ this.machineUseNum = list[1];
|
|
|
|
+ }
|
|
|
|
+ });
|
|
return this.getMainStatistics(param)
|
|
return this.getMainStatistics(param)
|
|
.then(data => {
|
|
.then(data => {
|
|
for (let bean of data) {
|
|
for (let bean of data) {
|
|
@@ -347,6 +373,7 @@
|
|
}
|
|
}
|
|
, _ => void uni.stopPullDownRefresh());
|
|
, _ => void uni.stopPullDownRefresh());
|
|
},
|
|
},
|
|
|
|
+
|
|
touchLine1(e) {
|
|
touchLine1(e) {
|
|
if(canvaColumn1){
|
|
if(canvaColumn1){
|
|
canvaColumn1.scrollStart(e);
|
|
canvaColumn1.scrollStart(e);
|
|
@@ -492,6 +519,7 @@
|
|
width: 100%;
|
|
width: 100%;
|
|
/* padding: 10upx 2%; */
|
|
/* padding: 10upx 2%; */
|
|
flex-wrap: nowrap;
|
|
flex-wrap: nowrap;
|
|
|
|
+ border-radius: 15upx;
|
|
}
|
|
}
|
|
.color{
|
|
.color{
|
|
background:#56de9e;
|
|
background:#56de9e;
|