Commit b3f15b9c by 姜雷

Merge branch 'develop' into test

parents 957ab368 bd56efbc
...@@ -52,5 +52,6 @@ export const baseFetch = (req: wx.RequestOption) => ...@@ -52,5 +52,6 @@ export const baseFetch = (req: wx.RequestOption) =>
fetch({ ...req, url: testUrl.BASE_SERVER_URL + req.url }); fetch({ ...req, url: testUrl.BASE_SERVER_URL + req.url });
export const operatorFetch = (req: wx.RequestOption) => export const operatorFetch = (req: wx.RequestOption) =>
fetch({ ...req, url: testUrl.OPERATOR_SERVER_URL + req.url }); fetch({ ...req, url: testUrl.OPERATOR_SERVER_URL + req.url });
export const deviceFetch = (req: wx.RequestOption) =>
fetch({ ...req, url: testUrl.DEVICE_SERVEL_URL + req.url });
export default fetch; export default fetch;
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
"pages/userGrowth/userGrowth", "pages/userGrowth/userGrowth",
"pages/areaSelect/areaSelect", "pages/areaSelect/areaSelect",
"pages/platformFee/platformFee", "pages/platformFee/platformFee",
"pages/platformFeeRecord/platformFeeRecord" "pages/platformFeeRecord/platformFeeRecord",
"pages/equipment/equipment",
"pages/equipmentReport/equipmentReport"
], ],
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",
......
...@@ -6,6 +6,7 @@ exports.devUrl = { ...@@ -6,6 +6,7 @@ exports.devUrl = {
CUSTOMER_SERVER_URL: 'https://ex-dev-customer-manage.168cad.top', CUSTOMER_SERVER_URL: 'https://ex-dev-customer-manage.168cad.top',
BASE_SERVER_URL: 'https://ex-dev-dcxy-base-manage.168cad.top', BASE_SERVER_URL: 'https://ex-dev-dcxy-base-manage.168cad.top',
OPERATOR_SERVER_URL: 'https://dev-op-man-serv.168cad.top', OPERATOR_SERVER_URL: 'https://dev-op-man-serv.168cad.top',
DEVICE_SERVEL_URL: 'https://in-dev-device-management-api.168cad.top',
}; };
exports.testUrl = { exports.testUrl = {
SYSTEM_SERVER_URL: 'https://ex-test-dcxy-system-manage.168cad.top', SYSTEM_SERVER_URL: 'https://ex-test-dcxy-system-manage.168cad.top',
...@@ -13,6 +14,7 @@ exports.testUrl = { ...@@ -13,6 +14,7 @@ exports.testUrl = {
CUSTOMER_SERVER_URL: 'https://ex-test-customer-manage.168cad.top', CUSTOMER_SERVER_URL: 'https://ex-test-customer-manage.168cad.top',
BASE_SERVER_URL: 'https://ex-test-dcxy-base-manage.168cad.top', BASE_SERVER_URL: 'https://ex-test-dcxy-base-manage.168cad.top',
OPERATOR_SERVER_URL: 'https://test-op-man-serv.168cad.top', OPERATOR_SERVER_URL: 'https://test-op-man-serv.168cad.top',
DEVICE_SERVEL_URL: 'https://in-test-device-management-api.168cad.top',
}; };
exports.masterUrl = { exports.masterUrl = {
SYSTEM_SERVER_URL: 'https://dcxy-system-manage.dcrym.com', SYSTEM_SERVER_URL: 'https://dcxy-system-manage.dcrym.com',
...@@ -23,4 +25,4 @@ exports.masterUrl = { ...@@ -23,4 +25,4 @@ exports.masterUrl = {
}; };
exports.successCode = 1000; exports.successCode = 1000;
exports.logoutode = -2; exports.logoutode = -2;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc3RhbnRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiY29uc3RhbnRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQWEsUUFBQSxNQUFNLEdBQUc7SUFDcEIsaUJBQWlCLEVBQUUsOENBQThDO0lBQ2pFLHFCQUFxQixFQUFFLGtEQUFrRDtJQUN6RSxtQkFBbUIsRUFBRSwyQ0FBMkM7SUFDaEUsZUFBZSxFQUFFLDRDQUE0QztJQUM3RCxtQkFBbUIsRUFBRSxvQ0FBb0M7Q0FDMUQsQ0FBQztBQUNXLFFBQUEsT0FBTyxHQUFHO0lBQ3JCLGlCQUFpQixFQUFFLCtDQUErQztJQUNsRSxxQkFBcUIsRUFBRSxtREFBbUQ7SUFDMUUsbUJBQW1CLEVBQUUsNENBQTRDO0lB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LW1hbmFnZS5kY3J5bS5jb20nLFxuICBTVEFUSVNUSUNTX1NFUlZFUl9VUkw6ICdodHRwczovL2RjeHktc3RhdGlzdGljcy1tYW5hZ2UuZGNyeW0uY29tJyxcbiAgQ1VTVE9NRVJfU0VSVkVSX1VSTDogJ2h0dHBzOi8vZGN4eS1jdXN0b21lci1tYW5hZ2UuZGNyeW0uY29tJyxcbiAgQkFTRV9TRVJWRVJfVVJMOiAnaHR0cHM6Ly9kY3h5LWJhc2UtbWFuYWdlLmRjcnltLmNvbScsXG4gIE9QRVJBVE9SX1NFUlZFUl9VUkw6ICdodHRwczovL29wLW1hbi1zZXJ2LmRjcnltLmNvbScsXG59O1xuXG5leHBvcnQgY29uc3Qgc3VjY2Vzc0NvZGUgPSAxMDAwO1xuZXhwb3J0IGNvbnN0IGxvZ291dG9kZSA9IC0yO1xuIl19
\ No newline at end of file \ No newline at end of file
...@@ -4,6 +4,7 @@ export const devUrl = { ...@@ -4,6 +4,7 @@ export const devUrl = {
CUSTOMER_SERVER_URL: 'https://ex-dev-customer-manage.168cad.top', CUSTOMER_SERVER_URL: 'https://ex-dev-customer-manage.168cad.top',
BASE_SERVER_URL: 'https://ex-dev-dcxy-base-manage.168cad.top', BASE_SERVER_URL: 'https://ex-dev-dcxy-base-manage.168cad.top',
OPERATOR_SERVER_URL: 'https://dev-op-man-serv.168cad.top', OPERATOR_SERVER_URL: 'https://dev-op-man-serv.168cad.top',
DEVICE_SERVEL_URL: 'https://in-dev-device-management-api.168cad.top',
}; };
export const testUrl = { export const testUrl = {
SYSTEM_SERVER_URL: 'https://ex-test-dcxy-system-manage.168cad.top', SYSTEM_SERVER_URL: 'https://ex-test-dcxy-system-manage.168cad.top',
...@@ -11,6 +12,7 @@ export const testUrl = { ...@@ -11,6 +12,7 @@ export const testUrl = {
CUSTOMER_SERVER_URL: 'https://ex-test-customer-manage.168cad.top', CUSTOMER_SERVER_URL: 'https://ex-test-customer-manage.168cad.top',
BASE_SERVER_URL: 'https://ex-test-dcxy-base-manage.168cad.top', BASE_SERVER_URL: 'https://ex-test-dcxy-base-manage.168cad.top',
OPERATOR_SERVER_URL: 'https://test-op-man-serv.168cad.top', OPERATOR_SERVER_URL: 'https://test-op-man-serv.168cad.top',
DEVICE_SERVEL_URL: 'https://in-test-device-management-api.168cad.top',
}; };
export const masterUrl = { export const masterUrl = {
SYSTEM_SERVER_URL: 'https://dcxy-system-manage.dcrym.com', SYSTEM_SERVER_URL: 'https://dcxy-system-manage.dcrym.com',
......
"use strict";
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
Component({
properties: {
colors: {
type: Array,
value: ['#6895fe'],
},
dataList: {
type: Array,
value: [],
observer: function (newVal) {
var maxnum = Math.ceil(Math.max.apply(Math, newVal.map(function (item) { return item.value; })) / 0.9);
var list = newVal.map(function (item) { return (__assign({}, item, { precent: Math.ceil((item.value / maxnum) * 100) })); });
this.setData({
list: list,
});
},
},
},
data: {
list: [],
},
methods: {},
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRXF1aXBtZW50Q2hhcnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFcXVpcG1lbnRDaGFydC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7QUFDQSxTQUFTLENBQUM7SUFJUixVQUFVLEVBQUU7UUFDVixNQUFNLEVBQUU7WUFDTixJQUFJLEVBQUUsS0FBSztZQUNYLEtBQUssRUFBRSxDQUFDLFNBQVMsQ0FBQztTQUNuQjtRQUNELFFBQVEsRUFBRTtZQUNSLElBQUksRUFBRSxLQUFLO1lBQ1gsS0FBSyxFQUFFLEVBQUU7WUFDVCxRQUFRLFlBQUMsTUFBTTtnQkFDYixJQUFJLE1BQU0sR0FBRyxJQUFJLENBQUMsSUFB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TWF0aC5tYXgoLi4ubmV3VmFsLm1hcChpdGVtID0+IGl0ZW0udmFsdWUpKSAvIDAuOSxcbiAgICAgICAgKTtcbiAgICAgICAgbGV0IGxpc3QgPSBuZXdWYWwubWFwKGl0ZW0gPT4gKHtcbiAgICAgICAgICAuLi5pdGVtLFxuICAgICAgICAgIHByZWNlbnQ6IE1hdGguY2VpbCgoaXRlbS52YWx1ZSAvIG1heG51bSkgKiAxMDApLFxuICAgICAgICB9KSk7XG4gICAgICAgIHRoaXMuc2V0RGF0YSh7XG4gICAgICAgICAgbGlzdCxcbiAgICAgICAgfSk7XG4gICAgICB9LFxuICAgIH0sXG4gIH0sXG5cbiAgLyoqXG4gICAqIOe7hOS7tueahOWIneWni+aVsOaNrlxuICAgKi9cbiAgZGF0YToge1xuICAgIGxpc3Q6IFtdLFxuICB9LFxuXG4gIC8qKlxuICAgKiDnu4Tku7bnmoTmlrnms5XliJfooahcbiAgICovXG4gIG1ldGhvZHM6IHt9LFxufSk7XG4iXX0=
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
// pages/components/EquipmentChart/EquipmentChart.js
Component({
/**
* 组件的属性列表
*/
properties: {
colors: {
type: Array,
value: ['#6895fe'],
},
dataList: {
type: Array,
value: [],
observer(newVal) {
let maxnum = Math.ceil(
Math.max(...newVal.map(item => item.value)) / 0.9,
);
let list = newVal.map(item => ({
...item,
precent: Math.ceil((item.value / maxnum) * 100),
}));
this.setData({
list,
});
},
},
},
/**
* 组件的初始数据
*/
data: {
list: [],
},
/**
* 组件的方法列表
*/
methods: {},
});
<!-- pages/components/EquipmentChart/EquipmentChart.wxml -->
<view class="EquipmentChart">
<view wx:for="{{list}}" wx:key="key" class="EquipmentChart-item">
<view class="EquipmentChart-name">{{item.key}}</view>
<view class="EquipmentChart-precent">
<view class="EquipmentChart-innerprecent" style="width: {{item.precent}}%;background-color: {{index < colors.length - 1 ? colors[index] : colors[index%colors.length]}}"></view>
</view>
<view class="EquipmentChart-count">{{item.value}}台</view>
</view>
</view>
\ No newline at end of file
/* pages/components/EquipmentChart/EquipmentChart.wxss */
.EquipmentChart {
padding-bottom: 20rpx;
}
.EquipmentChart-item {
display: flex;
align-items: center;
padding-bottom: 20rpx;
}
.EquipmentChart-name {
margin-right: 20rpx;
}
.EquipmentChart-precent,
.EquipmentChart-innerprecent {
width: 460rpx;
height: 12rpx;
border-radius: 12rpx;
}
.EquipmentChart-precent {
background-color: #f2f2f2;
}
.EquipmentChart-innerprecent {
width: 0;
background-color: #6f96f6;
}
.EquipmentChart-count {
flex: 1;
text-align: right;
}
{
"component": true,
"usingComponents": {
"c-select": "../Select/Select",
"price-and-count": "../components/PriceAndCount/PriceAndCount"
}
}
import { statisticsFetch } from '../../../api/fetch';
// pages/components/EquipmentOperationDetails/EquipmentOperationDetails.js
Component({
lifetimes: {
attached() {
this.fetchData();
this.refreshList();
},
},
/**
* 组件的属性列表
*/
properties: {
totalAmount: {
type: Array,
value: [],
observer(newVal) {
console.log('totalAmount', newVal);
},
},
},
/**
* 组件的初始数据
*/
data: {
sortTypeOptions: [
{ value: 'desc', label: '降序' },
{ value: 'asc', label: '升序' },
],
sortTypeIndex: '0',
sortType: 'desc',
timeType: 0,
comsumerData: {
title: '消费总额',
numberType: 'price',
count: 0,
},
countData: {
title: '消费笔数',
numberType: 'count',
count: 0,
},
pageNum: 1,
pageSize: 10,
dataList: [],
deviceType: 2, // (2:洗衣,3:饮水,4:吹风,5:洗浴)
},
/**
* 组件的方法列表
*/
methods: {
changeType(e) {
console.log(e);
const { timetype } = e.currentTarget.dataset;
if (timetype === this.data.timeType) return;
this.setData({
timeType: timetype,
});
this.fetchData();
this.refreshList();
},
fetchData() {
statisticsFetch({
url: '/boss/device/operation/data/summary',
method: 'POST',
data: {
areaId: this.data.areaId,
timeType: this.data.timeType,
},
})
.then(res => {
console.log(res);
const { totalConsumeAmount, totalConsumeCount } = res.data;
this.setData({
'comsumerData.count': totalConsumeAmount,
'countData.count': totalConsumeCount,
});
})
.catch(err => {
console.log(err);
});
},
fetchList(entity) {
return statisticsFetch({
url: '/boss/device/operation/data/detail/paging',
method: 'POST',
data: {
areaId: this.data.areaId,
timeType: this.data.timeType,
sortType: this.data.sortType,
deviceType: this.data.deviceType,
pageNum: this.data.pageNum,
pageSize: this.data.pageSize,
...entity,
},
});
},
refreshList() {
this.fetchList({
pageNum: 1,
})
.then(res => {
const { list } = res.data;
this.setData({
pageNum: 1,
dataList: list,
});
})
.catch(err => {
console.log(err);
});
},
getMoreListItem() {
this.fetchList({
pageNum: this.data.pageNum + 1,
})
.then(res => {
const { list } = res.data;
if (list && list.length) {
this.setData!({
dataList: [...this.data.dataList, ...list],
pageNum: this.data.pageNum + 1,
});
}
})
.catch(err => {
console.log(err);
});
},
changeSortType(e) {
const { value } = e.detail;
let item = this.data.sortTypeOptions[value];
console.log(item);
this.setData({
sortTypeIndex: value,
sortType: item.label,
});
this.refreshList();
},
changeDeviceType(e) {
console.log(e);
const { devicetype } = e.currentTarget.dataset;
if (devicetype === this.data.deviceType) return;
this.setData({
deviceType: devicetype,
});
this.refreshList();
},
},
});
<!-- pages/components/EquipmentOperationDetails/EquipmentOperationDetails.wxml -->
<view class="EquipmentOperationDetails">
<view class="EOperationDetails-filters">
<view class="EOperationDetails-filters-tiem">
<view class="EOperationDetails-filters-tiemItem {{timeType === 0?'checked':''}}" data-timetype="{{0}}" bind:tap="changeType">
本日
</view>
<view class="EOperationDetails-filters-tiemItem {{timeType === 1?'checked':''}}" data-timetype="{{1}}" bind:tap="changeType">
近七天
</view>
</view>
<view class="EOperationDetails-filters-type">
<c-select ex-class="EOperationDetails-filters-typeInput" mode="selector" value="{{sortTypeIndex}}" range="{{sortTypeOptions}}" rangeKey="label" bindchange="changeSortType" />
</view>
</view>
<view class="EOperationDetails-sumOrder">
<price-and-count tag-data="{{comsumerData}}" />
<price-and-count tag-data="{{countData}}" />
</view>
<view class="EOperationDetails-statebar">
<view wx:for="{{totalAmount}}" wx:key="key" class="EOperationDetails-statebarItem {{deviceType === item.type ? 'checked' : ''}}" data-devicetype="{{item.type}}" bind:tap="changeDeviceType">
<view class="EOperationDetails-statebarItem-name">{{item.key}}</view>
<view class="EOperationDetails-statebarItem-count">{{item.value}}台</view>
</view>
</view>
<view class="EOperationDetails-elist">
<scroll-view wx:if="{{dataList.length}}" class="EOperationDetails-list" scroll-y bindscrolltolower="getMoreListItem">
<view wx:for="{{dataList}}" class="EOperationDetails-elist-Item">
<view class="EOperationDetails-elist-ItemCode">{{item.deviceCode}}</view>
<view class="EOperationDetails-elist-ItemLocation">{{item.devicePos}}</view>
<view class="EOperationDetails-elist-ItemPrice">{{item.consumeAmount}}元</view>
</view>
</scroll-view>
</view>
</view>
\ No newline at end of file
/* pages/components/EquipmentOperationDetails/EquipmentOperationDetails.wxss */
.EquipmentOperationDetails {
display: flex;
flex-direction: column;
height: 100%;
}
.EOperationDetails-filters {
display: flex;
padding: 40rpx 0;
justify-content: space-between;
}
.EOperationDetails-filters-tiem {
display: flex;
justify-content: space-around;
align-items: center;
width: 328rpx;
height: 80rpx;
background-color: #ededed;
border-radius: 20rpx;
}
.EOperationDetails-filters-tiemItem {
width: 136rpx;
height: 60rpx;
line-height: 60rpx;
text-align: center;
font-size: 28rpx;
color: #666;
}
.EOperationDetails-filters-tiemItem.checked {
border-radius: 20rpx;
background-color: #fff;
color: #6a92ff;
}
.EOperationDetails-filters-type {
width: 194rpx;
}
.EOperationDetails-filters-typeInput {
height: 80rpx;
line-height: 80rpx;
border-radius: 20rpx;
background-color: #ededed;
}
.EOperationDetails-filters-typeInput .select-icon {
right: 20rpx;
top: 10rpx;
}
.EOperationDetails-sumOrder {
display: flex;
padding-bottom: 40rpx;
}
.EOperationDetails-statebar {
display: flex;
}
.EOperationDetails-statebarItem {
align-items: center;
width: 168rpx;
height: 128rpx;
text-align: center;
font-size: 28rpx;
color: #666;
border: 1px solid #eee;
border-right-width: 0;
}
.EOperationDetails-statebarItem:last-child {
border-right-width: 1px;
}
.EOperationDetails-statebarItem.checked {
background-color: #7094f7;
color: #fff;
}
.EOperationDetails-statebarItem-name {
margin: 24rpx 0 10rpx;
}
.EOperationDetails-statebarItem-count {
width: 100%;
font-size: 24rpx;
}
.EOperationDetails-elist {
flex: 1;
overflow: hidden;
}
.EOperationDetails-elist-Item {
display: flex;
height: 100rpx;
line-height: 100rpx;
font-size: 28rpx;
color: #333;
border-bottom: 1px solid #f0f0f0;
}
.EOperationDetails-elist-ItemLocation {
margin-left: 20rpx;
flex: 1;
}
.EOperationDetails-list {
height: 100%;
}
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
import { deviceFetch } from '../../../api/fetch';
// pages/components/EquipmentState/EquipmentState.js
Component({
lifetimes: {
attached() {},
},
/**
* 组件的属性列表
*/
properties: {
areaId: {
type: Number,
value: 0,
observer(newVal) {
this.fetchAll();
},
},
},
/**
* 组件的初始数据
*/
data: {
status: 'enable',
tabs: [],
pagination: {
enable: {
pageNum: 1,
pageSize: 10,
},
forbidden: {
pageNum: 1,
pageSize: 10,
},
online: {
pageNum: 1,
pageSize: 10,
},
offline: {
pageNum: 1,
pageSize: 10,
},
},
dataList: {
enable: [],
forbidden: [],
online: [],
offline: [],
},
},
/**
* 组件的方法列表
*/
methods: {
fetchAll() {
this.fetchData();
this.refreshList();
},
fetchData() {
deviceFetch({
url: `/device/report/deviceStautsCount/${this.data.areaId}`,
})
.then(res => {
console.log(res);
const list = res.data.map(item => {
let label = '';
switch (item.status) {
case 'enable':
label = '启用设备';
break;
case 'forbidden':
label = '禁用设备';
break;
case 'online':
label = '在线设备';
break;
case 'offline':
label = '离线设备';
break;
default:
break;
}
return {
...item,
label,
};
});
this.setData({
tabs: list,
});
})
.catch(err => {
console.log(err);
});
},
fetchList(entity) {
return deviceFetch({
url: `/device/report/status/${this.data.status}`,
data: {
areaId: this.data.areaId,
pageNum: this.data.pagination[this.data.status].pageNum,
pageSize: this.data.pagination[this.data.status].pageSize,
...entity,
},
});
},
refreshList() {
wx.showLoading({
title: '加载中',
});
this.fetchList()
.then(res => {
wx.hideLoading();
console.log(res);
if (res.data && res.data.length) {
this.setData({
['dataList.' + this.data.status]: res.data,
});
}
})
.catch(err => {
wx.hideLoading();
console.log(err);
});
},
getMoreListItem() {
wx.showLoading({
title: '加载中',
});
let nextPage = this.data.pagination[this.data.status].pageNum + 1;
this.fetchList({
pageNum: nextPage,
})
.then(res => {
wx.hideLoading();
console.log(res);
if (res.data && res.data.length) {
this.setData({
['dataList.' + this.data.status]: [
...this.data.dataList[this.data.status],
...res.data,
],
['pagination.' + this.data.status + '.pageNum']: nextPage,
});
}
})
.catch(err => {
wx.hideLoading();
console.log(err);
});
},
changeTab(e) {
const { status } = e.currentTarget.dataset;
console.log(e, status);
this.setData({
status,
});
if (!this.data.dataList[status].length) this.refreshList();
},
openEquipment(e) {
const { code, type } = e.currentTarget.dataset;
console.log(code);
deviceFetch({
url: `/device/${code}/${type}/enable`,
method: 'POST',
})
.then(res => {
wx.showToast({
title: res.msg || '操作成功',
});
this.refreshList();
})
.catch(err => {
console.log(err);
});
},
closeEquipment(e) {
const { code, type } = e.currentTarget.dataset;
console.log(code);
deviceFetch({
url: `/device/${code}/${type}/forbidden`,
method: 'POST',
})
.then(res => {
wx.showToast({
title: res.msg || '操作成功',
});
this.refreshList();
})
.catch(err => {
console.log(err);
});
},
},
});
<!-- pages/components/EquipmentState/EquipmentState.wxml -->
<view class="EquipmentState">
<view class="EquipmentState-statebar">
<view wx:for="{{tabs}}" wx:key="status" class="EquipmentState-statebarItem {{status === item.status ? 'checked':''}}" data-status="{{item.status}}" bind:tap="changeTab">
<view class="EquipmentState-statebarItem-name">{{item.label}}</view>
<view class="EquipmentState-statebarItem-count">{{item.amount}}台</view>
</view>
</view>
<view class="EquipmentState-elist">
<scroll-view class="EquipmentState-list" scroll-y bindscrolltolower="getMoreListItem">
<view wx:for="{{dataList[status]}}" wx:key="deviceCode" class="EquipmentState-elist-Item">
<view class="EquipmentState-elist-ItemCode">{{item.deviceCode}}</view>
<view class="EquipmentState-elist-ItemService">
{{item.deviceType === 2?'洗衣':item.deviceType === 3?'饮水':item.deviceType === 4?'吹风':item.deviceType === 5?'洗浴':item.deviceType}}
</view>
<view class="EquipmentState-elist-ItemLocation">{{item.position?item.position:'-'}}</view>
<view wx:if="{{status === 'forbidden'}}" class="EquipmentState-elist-ItemBtn Open" data-code="{{item.deviceCode}}" data-type="{{item.deviceType}}" bind:tap="openEquipment">
启用
</view>
<view wx:elif="{{status === 'enable'}}" class="EquipmentState-elist-ItemBtn Close" data-code="{{item.deviceCode}}" data-type="{{item.deviceType}}" bind:tap="closeEquipment">
禁用
</view>
</view>
</scroll-view>
</view>
</view>
\ No newline at end of file
/* pages/components/EquipmentState/EquipmentState.wxss */
.EquipmentState {
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
}
.EquipmentState-statebar {
display: flex;
margin: 40rpx 0 20rpx;
}
.EquipmentState-statebarItem {
align-items: center;
width: 168rpx;
height: 128rpx;
text-align: center;
font-size: 28rpx;
color: #666;
border: 1px solid #eee;
}
.EquipmentState-statebarItem.checked {
background-color: #7094f7;
color: #fff;
}
.EquipmentState-statebarItem-name {
margin: 24rpx 0 10rpx;
}
.EquipmentState-statebarItem-count {
width: 100%;
font-size: 24rpx;
}
.EquipmentState-elist {
flex: 1;
overflow: hidden;
}
.EquipmentState-list {
height: 100%;
}
.EquipmentState-elist-Item {
display: flex;
align-items: center;
height: 100rpx;
line-height: 100rpx;
font-size: 28rpx;
color: #333;
border-bottom: 1px solid #f0f0f0;
}
.EquipmentState-elist-ItemCode {
width: 150rpx;
}
.EquipmentState-elist-ItemService {
margin-left: 20rpx;
}
.EquipmentState-elist-ItemLocation {
margin-left: 20rpx;
flex: 1;
}
.EquipmentState-elist-ItemBtn {
width: 80rpx;
height: 60rpx;
line-height: 60rpx;
border-radius: 20rpx;
text-align: center;
font-size: 24rpx;
}
.EquipmentState-elist-ItemBtn.Open {
background-color: #e6f9ec;
color: #6edb8f;
}
.EquipmentState-elist-ItemBtn.Close {
background-color: #ffe5e5;
color: #fe6868;
}
{
"component": true,
"usingComponents": {
"c-select": "../components/Select/Select"
}
}
import { deviceFetch } from '../../../api/fetch';
// pages/components/EquipmentWarning/EquipmentWarning.js
Component({
lifetimes: {
attached() {
if (!this.data.warningTypeRange) {
this.fetchWarningLevelList();
}
},
},
/**
* 组件的属性列表
*/
properties: {
areaId: {
type: Number,
value: 0,
observer(newVal) {
this.refreshList();
},
},
},
/**
* 组件的初始数据
*/
data: {
warningLevelRange: [],
warnLevelIndex: '',
warnLevel: 0,
deviceLocation: '',
dataList: [],
pageNum: 1,
pageSize: 10,
},
/**
* 组件的方法列表
*/
methods: {
fetchWarningLevelList() {
deviceFetch({
url: '/device/warning/dict/illegalOperations',
})
.then(res => {
console.log(res);
this.setData({
warningLevelRange: res.data,
});
})
.catch(err => {
console.log(err);
});
},
changeWarningType(e) {
const index = e.detail.value;
if (index === this.data.warnLevelIndex) return;
const item = this.data.warningLevelRange[index];
console.log(item);
this.setData({
warnLevelIndex: index,
warnLevel: item.key,
});
this.refreshList();
},
changeLocation(e) {
const { value } = e.detail;
console.log(value);
this.setData({
deviceLocation: value,
});
this.refreshList();
},
fetchList(entity) {
if (this.data.warnLevel) {
entity.operation = this.data.warnLevel;
}
if (this.data.deviceLocation) {
entity.deviceLocation = this.data.deviceLocation;
}
return deviceFetch({
url: '/device/warning/paging',
method: 'POST',
data: {
areaId: this.data.areaId,
pageNum: this.data.pageNum,
pageSize: this.data.pageSize,
...entity,
},
});
},
refreshList() {
wx.showLoading({
title: '加载中',
});
this.fetchList()
.then(res => {
wx.hideLoading();
console.log(res);
const { list } = res.data;
if (list && list.length) {
this.setData({
dataList: list,
});
}
})
.catch(err => {
wx.hideLoading();
console.log(err);
});
},
getMoreListItem() {
wx.showLoading({
title: '加载中',
});
let nextPage = this.data.pageNum + 1;
this.fetchList({
pageNum: nextPage,
})
.then(res => {
wx.hideLoading();
console.log(res);
const { list, pageNum } = res.data;
if (list && list.length) {
this.setData({
dataList: [...this.data.dataList, ...list],
pageNum,
});
}
})
.catch(err => {
wx.hideLoading();
console.log(err);
});
},
closeEquipment(e) {
const { code, type } = e.currentTarget.dataset;
console.log(code);
deviceFetch({
url: `/device/${code}/${type}/forbidden`,
method: 'POST',
})
.then(res => {
wx.showToast({
title: res.msg || '操作成功',
});
this.refreshList();
})
.catch(err => {
console.log(err);
});
},
},
});
<!-- pages/components/EquipmentWarning/EquipmentWarning.wxml -->
<view class="EquipmentWarning">
<view class="EquipmentWarning-filters">
<view class="EquipmentWarning-type">
<c-select ex-class="EquipmentWarning-filters-levelInput" mode="selector" value="{{warningLevel}}" range="{{warningLevelRange}}" rangeKey="value" bindchange="changeWarningType" />
</view>
<view class="EquipmentWarning-location">
<input class="EquipmentWarning-location-input" type="text" placeholder="设备位置" bindconfirm="changeLocation" />
</view>
</view>
<view class="EquipmentWarning-elist">
<scroll-view class="EquipmentWarning-list" scroll-y bindscrolltolower="getMoreListItem">
<view wx:for="{{dataList}}" wx:key="id" class="EquipmentWarning-listItem">
<view class="EquipmentWarning-listItem-title">
<view class="EquipmentWarning-listItem-titleCode">{{item.deviceCode}}</view>
<view class="EquipmentWarning-listItem-titleLocation">{{item.deviceLocation}}</view>
<view class="EquipmentWarning-listItem-titleState" data-code="{{item.deviceCode}}" data-type="{{item.deviceType}}" bind:tap="closeEquipment">
禁用
</view>
</view>
<view class="EquipmentWarning-listItem-info">
<view class="EquipmentWarning-listItem-infoErr">{{item.operationName}}</view>
<view class="EquipmentWarning-listItem-infoTime">{{item.operTime}}</view>
</view>
</view>
</scroll-view>
</view>
</view>
\ No newline at end of file
/* pages/components/EquipmentWarning/EquipmentWarning.wxss */
.EquipmentWarning {
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
}
.EquipmentWarning-filters {
display: flex;
justify-content: space-between;
padding: 40rpx 0 60rpx;
}
.EquipmentWarning-type {
width: 246rpx;
height: 80rpx;
}
.EquipmentWarning-location {
width: 404rpx;
height: 80rpx;
}
.EquipmentWarning-location-input {
height: 80rpx;
line-height: 80rpx;
border-radius: 20rpx;
}
.EquipmentWarning-filters .EquipmentWarning-filters-levelInput {
height: 80rpx;
line-height: 80rpx;
border-radius: 20rpx;
background-color: #ededed;
}
.EquipmentWarning-elist {
padding: 20rpx 0;
flex: 1;
overflow: hidden;
}
.EquipmentWarning-list {
height: 100%;
}
.EquipmentWarning-listItem {
padding: 40rpx 0;
border-bottom: 1px solid #eee;
}
.EquipmentWarning-listItem:last-child {
border: 0;
}
.EquipmentWarning-listItem-title {
display: flex;
align-items: center;
font-size: 28rpx;
color: #666;
}
.EquipmentWarning-listItem-titleCode {
width: 150rpx;
}
.EquipmentWarning-listItem-titleLocation {
margin-left: 20rpx;
width: 300rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.EquipmentWarning-listItem-titleState {
text-align: center;
border-radius: 20rpx;
width: 80rpx;
height: 60rpx;
line-height: 60rpx;
background-color: #ffe5e5;
color: #fe6868;
margin-left: 120rpx;
}
.EquipmentWarning-listItem-info {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 28rpx;
color: #333;
margin-top: 20rpx;
}
.EquipmentWarning-listItem-infoErr {
width: 410rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.EquipmentWarning-listItem-infoTime {
font-size: 24rpx;
color: #999;
}
...@@ -16,6 +16,9 @@ Component({ ...@@ -16,6 +16,9 @@ Component({
if (numberType === 'price') { if (numberType === 'price') {
formatCount = util_1.formatPrice(count); formatCount = util_1.formatPrice(count);
} }
else {
formatCount = util_1.formatPrice(count).split('.')[0];
}
this.setData({ this.setData({
formatCount: formatCount, formatCount: formatCount,
}); });
...@@ -27,4 +30,4 @@ Component({ ...@@ -27,4 +30,4 @@ Component({
}, },
methods: {}, methods: {},
}); });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUHJpY2VBbmRDb3VudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3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YmVyVHlwZTogJycsXG4gICAgICAgIGNvdW50OiAwLFxuICAgICAgfSxcbiAgICAgIG9ic2VydmVyOiBmdW5jdGlvbihuZXdWYWwpIHtcbiAgICAgICAgY29uc3QgeyBjb3VudCwgbnVtYmVyVHlwZSB9ID0gbmV3VmFsO1xuICAgICAgICBsZXQgZm9ybWF0Q291bnQgPSBjb3VudC50b1N0cmluZygpO1xuICAgICAgICBpZiAobnVtYmVyVHlwZSA9PT0gJ3ByaWNlJykge1xuICAgICAgICAgIGZvcm1hdENvdW50ID0gZm9ybWF0UHJpY2UoY291bnQpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGZvcm1hdENvdW50ID0gZm9ybWF0UHJpY2UoY291bnQpLnNwbGl0KCcuJylbMF07XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5zZXREYXRhKHtcbiAgICAgICAgICBmb3JtYXRDb3VudCxcbiAgICAgICAgfSk7XG4gICAgICB9LFxuICAgIH0sXG4gIH0sXG4gIC8qKlxuICAgKiDnu4Tku7bnmoTliJ3lp4vmlbDmja5cbiAgICovXG4gIGRhdGE6IHtcbiAgICBmb3JtYXRDb3VudDogJzAnLFxuICB9LFxuXG4gIC8qKlxuICAgKiDnu4Tku7bnmoTmlrnms5XliJfooahcbiAgICovXG4gIG1ldGhvZHM6IHt9LFxufSk7XG4iXX0=
\ No newline at end of file \ No newline at end of file
...@@ -18,6 +18,8 @@ Component({ ...@@ -18,6 +18,8 @@ Component({
let formatCount = count.toString(); let formatCount = count.toString();
if (numberType === 'price') { if (numberType === 'price') {
formatCount = formatPrice(count); formatCount = formatPrice(count);
} else {
formatCount = formatPrice(count).split('.')[0];
} }
this.setData({ this.setData({
formatCount, formatCount,
......
"use strict"; "use strict";
Component({ Component({
externalClasses: ['ex-class'],
properties: { properties: {
placeholder: { placeholder: {
type: String, type: String,
...@@ -44,4 +45,4 @@ Component({ ...@@ -44,4 +45,4 @@ Component({
}, },
}, },
}); });
//# sourceMappingURL=data:application/json;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gIHR5cGU6IFN0cmluZyxcbiAgICAgIHZhbHVlOiAnJyxcbiAgICAgIG9ic2VydmVyKG5ld1ZhbCkge1xuICAgICAgICBjb25zb2xlLmxvZygnaW4gc2VsZWN0IG9iJywgbmV3VmFsKTtcbiAgICAgICAgdGhpcy5zZXREYXRhKHsgc2VsZWN0ZWQ6IG5ld1ZhbCB9KTtcbiAgICAgIH0sXG4gICAgfSxcbiAgfSxcbiAgZGF0YToge1xuICAgIHNlbGVjdGVkOiAnJyxcbiAgfSxcbiAgbWV0aG9kczoge1xuICAgIGJpbmRQaWNrZXJDaGFuZ2UoZSkge1xuICAgICAgY29uc3QgeyB2YWx1ZSB9ID0gZS5kZXRhaWw7XG4gICAgICBjb25zb2xlLmxvZyh2YWx1ZSk7XG4gICAgICB0aGlzLnNldERhdGEhKHtcbiAgICAgICAgc2VsZWN0ZWQ6IHZhbHVlLFxuICAgICAgfSk7XG4gICAgICB0aGlzLnRyaWdnZXJFdmVudCgnY2hhbmdlJywgeyB2YWx1ZSB9KTtcbiAgICB9LFxuICB9LFxufSk7XG4iXX0=
\ No newline at end of file \ No newline at end of file
Component({ Component({
externalClasses: ['ex-class'],
properties: { properties: {
placeholder: { placeholder: {
type: String, type: String,
......
<!-- pages/components/Select/Select.wxml --> <!-- pages/components/Select/Select.wxml -->
<view class="select-input"> <view class="select-input ex-class">
<picker class="select-picker" mode="{{mode}}" bindchange="bindPickerChange" value="{{selected}}" range="{{range}}" range-key="{{rangeKey}}" fields="{{fields}}"> <picker class="select-picker" mode="{{mode}}" bindchange="bindPickerChange" value="{{selected}}" range="{{range}}" range-key="{{rangeKey}}" fields="{{fields}}">
<view wx:if="{{selected && mode === 'date'}}" class="select-value">{{selected}}</view> <view wx:if="{{selected && mode === 'date'}}" class="select-value">{{selected}}</view>
<view wx:elif="{{selected}}" class="select-value">{{range[selected][rangeKey]}}</view> <view wx:elif="{{selected}}" class="select-value">{{range[selected][rangeKey]}}</view>
......
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var fetch_1 = require("../../api/fetch");
Page({
data: {
colors: ['#6895fe', '#fe6868', '#6ee18f', '#feae68'],
areaDeviceAmount: [],
statusAmount: [],
totalAmount: [],
total: 0,
},
onLoad: function (options) {
this.fetchList();
},
fetchList: function () {
var _this = this;
fetch_1.deviceFetch({
url: '/device/report/mainPage',
})
.then(function (res) {
console.log(res);
var _a = res.data, areaDeviceAmount = _a.areaDeviceAmount, statusAmount = _a.statusAmount, totalAmount = _a.totalAmount;
var total = totalAmount.reduce(function (count, item) { return count + item.value; }, 0);
_this.setData({
areaDeviceAmount: areaDeviceAmount,
statusAmount: statusAmount,
totalAmount: totalAmount,
total: total,
});
})
.catch(function (err) {
console.log(err);
});
},
goReportPage: function (e) {
var index = e.currentTarget.dataset.index;
var item = this.data.areaDeviceAmount[index];
wx.navigateTo({
url: "/pages/equipmentReport/equipmentReport?areaId=" + item.areaId + "&areaName=" + item.areaName,
success: function (res) {
res.eventChannel.emit('acceptDataFromOpenerPage', { data: item });
},
});
},
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXF1aXBtZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiZXF1aXBtZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEseUNBQThDO0FBRzlDLElBQUksQ0FBQztJQUlILElBQUksRUFBRTtRQUNKLE1BQU0sRUFBRSxDQUFDLFNBQVMsRUFBRSxTQUFTLEVBQUUsU0FBUyxFQUFFLFNBQVMsQ0FBQztRQUNwRCxnQkFBZ0IsRUFBRSxFQUFFO1FBQ3BCLFlBQVksRUFBRSxFQUFFO1FBQ2hCLFdBQVcsRUFBRSxFQUFFO1FBQ2YsS0FBSyxFQUFFLENBQUM7S0FDVDtJQUtELE1BQU0sRUFBRSxVQUFTLE9BQU87UUFDdEIsSUFBSSxDQUFDLFNBQVMsRUFBRSxDQUFDO0lBQ25CLENBQUM7SUFDRCx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PT4gY291bnQgKyBpdGVtLnZhbHVlLCAwKTtcbiAgICAgICAgdGhpcy5zZXREYXRhISh7XG4gICAgICAgICAgYXJlYURldmljZUFtb3VudCxcbiAgICAgICAgICBzdGF0dXNBbW91bnQsXG4gICAgICAgICAgdG90YWxBbW91bnQsXG4gICAgICAgICAgdG90YWwsXG4gICAgICAgIH0pO1xuICAgICAgfSlcbiAgICAgIC5jYXRjaChlcnIgPT4ge1xuICAgICAgICBjb25zb2xlLmxvZyhlcnIpO1xuICAgICAgfSk7XG4gIH0sXG4gIGdvUmVwb3J0UGFnZShlKSB7XG4gICAgY29uc3QgeyBpbmRleCB9ID0gZS5jdXJyZW50VGFyZ2V0LmRhdGFzZXQ7XG4gICAgY29uc3QgaXRlbSA9IHRoaXMuZGF0YS5hcmVhRGV2aWNlQW1vdW50W2luZGV4XTtcbiAgICB3eC5uYXZpZ2F0ZVRvKHtcbiAgICAgIHVybDogYC9wYWdlcy9lcXVpcG1lbnRSZXBvcnQvZXF1aXBtZW50UmVwb3J0P2FyZWFJZD0ke2l0ZW0uYXJlYUlkfSZhcmVhTmFtZT0ke2l0ZW0uYXJlYU5hbWV9YCxcbiAgICAgIHN1Y2Nlc3M6IGZ1bmN0aW9uKHJlcykge1xuICAgICAgICAvLyDpgJrov4dldmVudENoYW5uZWzlkJHooqvmiZPlvIDpobXpnaLkvKDpgIHmlbDmja5cbiAgICAgICAgcmVzLmV2ZW50Q2hhbm5lbC5lbWl0KCdhY2NlcHREYXRhRnJvbU9wZW5lclBhZ2UnLCB7IGRhdGE6IGl0ZW0gfSk7XG4gICAgICB9LFxuICAgIH0pO1xuICB9LFxufSk7XG4iXX0=
\ No newline at end of file
{
"navigationBarTitleText": "设备运营分析",
"usingComponents": {
"equipment-chart": "../components/EquipmentChart/EquipmentChart"
}
}
\ No newline at end of file
import { deviceFetch } from '../../api/fetch';
// miniprogram/pages/equipment/equipment.js
Page({
/**
* 页面的初始数据
*/
data: {
colors: ['#6895fe', '#fe6868', '#6ee18f', '#feae68'],
areaDeviceAmount: [],
statusAmount: [],
totalAmount: [],
total: 0,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.fetchList();
},
fetchList() {
deviceFetch({
url: '/device/report/mainPage',
})
.then(res => {
console.log(res);
const { areaDeviceAmount, statusAmount, totalAmount } = res.data;
let total = totalAmount.reduce((count, item) => count + item.value, 0);
this.setData!({
areaDeviceAmount,
statusAmount,
totalAmount,
total,
});
})
.catch(err => {
console.log(err);
});
},
goReportPage(e) {
const { index } = e.currentTarget.dataset;
const item = this.data.areaDeviceAmount[index];
wx.navigateTo({
url: `/pages/equipmentReport/equipmentReport?areaId=${item.areaId}&areaName=${item.areaName}`,
success: function(res) {
// 通过eventChannel向被打开页面传送数据
res.eventChannel.emit('acceptDataFromOpenerPage', { data: item });
},
});
},
});
<!-- miniprogram/pages/equipment/equipment.wxml -->
<view class="equipment">
<view class="equipment-block">
<view class="equipment-title">
<view class="equipment-title-color"></view>
<view class="equipment-title-text">设备总数({{total}}台)</view>
</view>
<view class="equipment-canvas autoheight">
<equipment-chart dataList="{{totalAmount}}" />
</view>
</view>
<view class="equipment-block">
<view class="equipment-title">
<view class="equipment-title-color"></view>
<view class="equipment-title-text">设备状态</view>
</view>
<view class="equipment-canvas autoheight">
<equipment-chart dataList="{{statusAmount}}" colors="{{colors}}" />
</view>
</view>
<view class="equipment-area">
<view wx:for="{{areaDeviceAmount}}" wx:key="areaId" class="equipment-areaitem">
<view class="equipment-areaitem-title">
<view>{{item.areaName}}</view>
<view class="equipment-areaitem-titleLink" data-index="{{index}}" bind:tap="goReportPage">
运营数据 >
</view>
</view>
<view class="equipment-areaitem-count">
<view wx:for="{{item.totalAmount}}" wx:key="key" class="equipment-areaitem-countItem">
{{item.key}}设备数:{{item.value}}
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
/* miniprogram/pages/equipment/equipment.wxss */
.equipment-block {
padding: 0 40rpx;
/* border-bottom: 8rpx solid #eef3fc; */
}
.equipment-title {
display: flex;
align-items: center;
padding: 50rpx 0 20rpx;
}
.equipment-title-color {
width: 12rpx;
height: 12rpx;
margin-right: 12rpx;
border-radius: 50%;
background-color: #6895fe;
}
.equipment-area {
padding: 40rpx 24rpx;
background-color: #f8f8f8;
}
.equipment-areaitem {
margin-bottom: 20rpx;
border-radius: 20rpx;
padding: 40rpx 32rpx 20rpx;
background-color: #fff;
border: 1rpx solid #eee;
}
.equipment-areaitem-title {
display: flex;
justify-content: space-between;
font-size: 32rpx;
color: #666;
margin-bottom: 40rpx;
}
.equipment-areaitem-titleLink {
font-size: 28rpx;
color: #6a92ff;
}
.equipment-areaitem-count {
display: flex;
flex-wrap: wrap;
font-size: 28rpx;
color: #333;
}
.equipment-areaitem-countItem {
width: 50%;
margin-bottom: 20rpx;
}
"use strict";
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
var fetch_1 = require("../../api/fetch");
Page({
data: {
areaId: null,
areaName: '',
type: 0,
timeType: 0,
totalAmount: [],
},
onLoad: function (options) {
var _this = this;
console.log(options);
var areaId = options.areaId, areaName = options.areaName;
var eventChannel = this.getOpenerEventChannel();
eventChannel.on('acceptDataFromOpenerPage', function (res) {
console.log(res);
_this.setData({
totalAmount: res.data.totalAmount.map(function (item) { return (__assign({}, item, { type: item.key === '饮水'
? 2
: item.key === '吹风'
? 3
: item.key === '洗浴'
? 4
: item.key === '洗衣'
? 5
: item.key })); }),
});
});
this.setData({
areaId: areaId,
areaName: areaName,
});
},
fetchWarningLevel: function () {
fetch_1.deviceFetch({
url: '/device/warning/dict/warningLevel',
})
.then(function (res) {
console.log(res);
})
.catch(function (err) {
console.log(err);
});
},
changeType: function (e) {
var type = e.currentTarget.dataset.type;
console.log(type);
if (type === this.data.type)
return;
this.setData({
type: type,
});
return false;
},
changeTimeType: function (e) {
var timeType = e.currentTarget.dataset.timeType;
console.log(timeType);
if (timeType === this.data.timeType)
return;
this.setData({
timeType: timeType,
});
return false;
},
fetchData: function () {
fetch_1.statisticsFetch({
url: '/boss/device/operation/data/summary',
method: 'POST',
data: {
areaId: this.data.areaId,
timeType: this.data.timeType,
},
})
.then(function (res) {
console.log(res);
})
.catch(function (err) {
console.log(err);
});
},
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXF1aXBtZW50UmVwb3J0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiZXF1aXBtZW50UmVwb3J0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7QUFBQSx5Q0FBK0Q7QUFHL0QsSUFBSSxDQUFDO0lBSUgsSUFBSSxFQUFFO1FBQ0osTUFBTSxFQUFFLElBQUk7UUFDWixRQUFRLEVBQUUsRUFBRTtRQUNaLElBQUksRUFBRSxDQUFDO1FBQ1AsUUFBUSxFQUFFLENBQUM7UUFDWCxXQUFXLEVBQUUsRUFBRTtLQUNoQjtJQUtELE1BQU0sRUFBRSxVQUFTLE9BQU87UUFBaEIsaUJBMkJQO1FBMUJDLE9BQU8sQ0FBQyxHQUFHLENBQUMsT0FBTyxDQUFDLENBQUM7UUFDYixJQUFBLHVCQUFNLEVBQUUsMkJBQVEsQ0FBYTtRQUNyQyxJQUFNLFlBQVksR0FBRyxJQUFJLENBQUMscUJBQXFCLEVBQUUsQ0FBQztRQUNsRCxZQUFZLENBQUMsRUFBRSxDQUFDLDBCQUEwQixFQUFFLFVBQUEsR0FBRztZQUM3QyxPQUFPLENBQUMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxDQUFDO1lBQ2pCLEtBQUksQ0FBQyxPQUFPLENBQUM7Z0JBQ1gsV0FBVyxFQUFFLEdBQUcsQ0FBQyxJQUFJLENBQUMsV0FBVyxDQUFDLEdBQUcsQ0FBQyxVQUFBL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y5kYXRhLnRpbWVUeXBlKSByZXR1cm47XG4gICAgdGhpcy5zZXREYXRhISh7XG4gICAgICB0aW1lVHlwZSxcbiAgICB9KTtcbiAgICByZXR1cm4gZmFsc2U7XG4gIH0sXG4gIGZldGNoRGF0YSgpIHtcbiAgICBzdGF0aXN0aWNzRmV0Y2goe1xuICAgICAgdXJsOiAnL2Jvc3MvZGV2aWNlL29wZXJhdGlvbi9kYXRhL3N1bW1hcnknLFxuICAgICAgbWV0aG9kOiAnUE9TVCcsXG4gICAgICBkYXRhOiB7XG4gICAgICAgIGFyZWFJZDogdGhpcy5kYXRhLmFyZWFJZCxcbiAgICAgICAgdGltZVR5cGU6IHRoaXMuZGF0YS50aW1lVHlwZSxcbiAgICAgIH0sXG4gICAgfSlcbiAgICAgIC50aGVuKHJlcyA9PiB7XG4gICAgICAgIGNvbnNvbGUubG9nKHJlcyk7XG4gICAgICB9KVxuICAgICAgLmNhdGNoKGVyciA9PiB7XG4gICAgICAgIGNvbnNvbGUubG9nKGVycik7XG4gICAgICB9KTtcbiAgfSxcbn0pO1xuIl19
\ No newline at end of file
{
"usingComponents": {
"equipment-operation-details": "../components/EquipmentOperationDetails/EquipmentOperationDetails",
"equipment-state": "../components/EquipmentState/EquipmentState",
"equipment-warning": "../components/EquipmentWarning/EquipmentWarning"
}
}
import { deviceFetch, statisticsFetch } from '../../api/fetch';
// miniprogram/pages/equipmentReport/equipmentReport.js
Page({
/**
* 页面的初始数据
*/
data: {
areaId: null,
areaName: '',
type: 0,
timeType: 0,
totalAmount: [],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
console.log(options);
const { areaId, areaName } = options;
const eventChannel = this.getOpenerEventChannel();
eventChannel.on('acceptDataFromOpenerPage', res => {
console.log(res);
this.setData({
totalAmount: res.data.totalAmount.map(item => ({
...item,
type:
item.key === '饮水'
? 2
: item.key === '吹风'
? 3
: item.key === '洗浴'
? 4
: item.key === '洗衣'
? 5
: item.key,
})),
});
});
this.setData!({
areaId,
areaName,
});
// this.fetchWarningLevel();
},
fetchWarningLevel() {
deviceFetch({
url: '/device/warning/dict/warningLevel',
})
.then(res => {
console.log(res);
})
.catch(err => {
console.log(err);
});
},
changeType(e) {
const { type } = e.currentTarget.dataset;
console.log(type);
if (type === this.data.type) return;
this.setData!({
type: type,
});
return false;
},
changeTimeType(e) {
const { timeType } = e.currentTarget.dataset;
console.log(timeType);
if (timeType === this.data.timeType) return;
this.setData!({
timeType,
});
return false;
},
fetchData() {
statisticsFetch({
url: '/boss/device/operation/data/summary',
method: 'POST',
data: {
areaId: this.data.areaId,
timeType: this.data.timeType,
},
})
.then(res => {
console.log(res);
})
.catch(err => {
console.log(err);
});
},
});
<!-- miniprogram/pages/equipmentReport/equipmentReport.wxml -->
<view class="equipmentReport">
<view class="equipmentReport-title">{{areaName}}</view>
<view class="home-title-type">
<view class="title-type-item" data-type="{{0}}" bindtap="changeType">
<view class="radio-box {{type === 0?'checked':''}}"></view>
运营明细
</view>
<view class="title-type-item" data-type="{{1}}" bindtap="changeType">
<view class="radio-box {{type === 1?'checked':''}}"></view>
设备状态
</view>
<view class="title-type-item" data-type="{{2}}" bindtap="changeType">
<view class="radio-box {{type === 2?'checked':''}}"></view>
设备告警
</view>
</view>
<view class="equipmentReport-content">
<equipment-operation-details wx:if="{{type === 0}}" timeType="{{timeType}}" totalAmount="{{totalAmount}}" />
<equipment-state wx:if="{{type === 1}}" areaId="{{areaId}}" />
<equipment-warning wx:if="{{type === 2}}" areaId="{{areaId}}" />
</view>
</view>
\ No newline at end of file
/* miniprogram/pages/equipmentReport/equipmentReport.wxss */
page {
height: 100%;
}
.equipmentReport {
display: flex;
flex-direction: column;
height: 100%;
padding: 0 40rpx;
}
.equipmentReport-title {
padding: 40rpx 0;
font-size: 40rpx;
color: #333;
}
.home-title-type,
.title-type-item {
display: flex;
align-items: center;
}
.title-type-item {
font-size: 28rpx;
margin-right: 20rpx;
}
.radio-box {
box-sizing: border-box;
width: 32rpx;
height: 32rpx;
border-radius: 50%;
border: 2px solid #9c9c9c;
margin-right: 8rpx;
}
.radio-box.checked {
border-color: #6895fe;
background-color: #6895fe;
}
.equipmentReport-content {
flex: 1;
overflow: hidden;
}
...@@ -103,6 +103,20 @@ ...@@ -103,6 +103,20 @@
"id": -1, "id": -1,
"name": "platformFeeRecord", "name": "platformFeeRecord",
"pathName": "pages/platformFeeRecord/platformFeeRecord", "pathName": "pages/platformFeeRecord/platformFeeRecord",
"query": "",
"scene": null
},
{
"id": -1,
"name": "equipment",
"pathName": "pages/equipment/equipment",
"scene": null
},
{
"id": 8,
"name": "equipmentReport",
"pathName": "pages/equipmentReport/equipmentReport",
"query": "areaId=15&areaName=多彩温江校区",
"scene": null "scene": null
} }
] ]
......
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