空白格 3 лет назад
Родитель
Сommit
ee0740da9d

+ 2 - 2
App.vue

@@ -69,7 +69,7 @@
 							uni.showModal({
 								title: '',
 								content: '下载成功,确定现在更新吗?',
-								confirmText: '更新',
+								confirmText: '安装',
 								confirmColor: '#EE8F57',
 								success: function(res) {
 									if (res.confirm) {
@@ -82,7 +82,7 @@
 												uni.navigateBack()
 											},
 											function(e) {
-												utils.showToast('更新失败');
+												utils.showToast('安装失败');
 											}
 										);
 									}

+ 1 - 1
common/config.js

@@ -1,4 +1,4 @@
 export const config = {
 	baseUrl: 'https://wx.hw.hongweisoft.com/parking/',
-	version: '0.1.2'
+	version: '0.1.5'
 }

+ 2 - 2
components/pieChart.vue

@@ -23,9 +23,9 @@
 				type: Object,
 				default: () => {
 					return {
-						dataLabel: false,
+						dataLabel: true,
 						legend: {
-							position: 'right',
+							position: 'bottom',
 							lineHeight: 20
 						}
 					}

+ 65 - 28
pages/dataOverview/operationalAnalysis/components/arrearsAnalysis.vue

@@ -2,7 +2,7 @@
 <template>
 	<view class="arrears">
 		<view class="arrears-line">
-			<LineChart v-if="chartData.series[0].data.length" :chartData="chartData" :title="title" :opts="opts"/>
+			<LineChart v-if="hasData" :chartData="chartData" :title="title" :opts="opts" />
 			<view class="empty" v-else>
 				<u-empty></u-empty>
 			</view>
@@ -40,7 +40,7 @@
 							}]
 						},
 						legend: {
-							show: false
+							show: true
 						},
 						dataLabel: false,
 						padding: [10, 0, 10, 0],
@@ -57,32 +57,38 @@
 			return {
 				chartData: {
 					categories: [],
-					series: [{
-						name: '路段',
-						data: []
-					}, {
-						name: '停车场',
-						data: []
-					}]
-				}
+					series: []
+				},
+				hasData: false
 			}
 		},
 		methods: {
-			getData({ reportType, queryDate }) {
-				this.reportType = reportType
-				this.queryDate = queryDate
-				this.getArrearsData()
-			},
-			getArrearsData() {
+			getData({
+				reportType,
+				queryDate
+			}) {
+				this.hasData = false
 				this.chartData.categories = []
-				this.chartData.series[0].data = []
-				this.chartData.series[1].data = []
+				this.chartData.series = []
+				this.getRoadData({
+					reportType,
+					queryDate
+				})
+			},
+			getRoadData({
+				reportType,
+				queryDate
+			}) {
 				uni.$u.api.operationalAnalysisApi.getArrearsDataApi({
-					reportType: this.reportType,
-					queryDate: this.queryDate
+					reportType,
+					queryDate
 				}).then(res => {
 					if (res.code === 200) {
 						if (res.data.itemList && res.data.itemList.length) {
+							this.chartData.series[0] = {
+								name: '路段',
+								data: []
+							}
 							this.chartData.categories = res.data.itemList.map(item => {
 								return item.statisTime
 							})
@@ -90,20 +96,50 @@
 								return item.amt
 							})
 						}
+						this.getParkingData({
+							reportType,
+							queryDate
+						})
 					}
 				})
+			},
+			getParkingData({
+				reportType,
+				queryDate
+			}) {
 				uni.$u.api.operationalAnalysisApi.getParkingArrearsDataApi({
-					reportType: this.reportType,
-					queryDate: this.queryDate
+					reportType,
+					queryDate
 				}).then(res => {
 					if (res.code === 200) {
 						if (res.data.itemList && res.data.itemList.length) {
-							this.chartData.categories = res.data.itemList.map(item => {
-								return item.statisTime
-							})
-							this.chartData.series[1].data = res.data.itemList.map(item => {
-								return item.amt
-							})
+							if (this.chartData.series.length) {
+								this.chartData.series[1] = {
+									name: '停车场',
+									data: []
+								}
+								this.chartData.series[1].data = res.data.itemList.map(item => {
+									return item.amt
+								})
+							} else {
+								this.chartData.series[0] = {
+									name: '停车场',
+									data: []
+								}
+								this.chartData.series[0].data = res.data.itemList.map(item => {
+									return item.amt
+								})
+							}
+							if (!this.chartData.categories.length) {
+								this.chartData.categories = res.data.itemList.map(item => {
+									return item.statisTime
+								})
+							}
+							this.hasData = true
+						} else if (this.chartData.series.length === 1) {
+							this.hasData = true
+						} else if (!this.chartData.series.length) {
+							this.hasData = false
 						}
 					}
 				})
@@ -116,6 +152,7 @@
 	.arrears {
 		background-color: #fff;
 		border-radius: 5px;
+
 		.empty {
 			padding: 15px;
 		}

+ 54 - 25
pages/dataOverview/operationalAnalysis/components/revenueAnalysis.vue

@@ -3,7 +3,7 @@
 	<view class="revenue">
 		<template v-if="type === 'line'">
 			<view class="revenue-line">
-				<LineChart v-if="chartData.series[0].data.length || chartData.series[1].data.length"
+				<LineChart v-if="hasData"
 					:chartData="chartData" :title="title" :opts="opts" />
 				<view class="empty" v-else>
 					<u-empty></u-empty>
@@ -12,7 +12,7 @@
 		</template>
 		<template v-else>
 			<view class="revenue-line">
-				<ColumnChart v-if="chartData.series[0].data.length || chartData.series[1].data.length"
+				<ColumnChart v-if="hasData"
 					:chartData="chartData" :title="title" :opts="opts" />
 				<view class="empty" v-else>
 					<u-empty></u-empty>
@@ -48,17 +48,14 @@
 			return {
 				chartData: {
 					categories: [],
-					series: [{
-						name: '路段',
-						data: []
-					}, {
-						name: '停车场',
-						data: []
-					}]
+					series: []
 				},
-				loading: false,
+				hasData: false,
 				opts: {
 					enableScroll: true,
+					tooltip: {
+						trigger: 'axis'
+					},
 					xAxis: {
 						rotateLabel: true,
 						scrollShow: true,
@@ -73,10 +70,10 @@
 						}]
 					},
 					legend: {
-						show: false
+						show: true
 					},
 					dataLabel: false,
-					padding: [10, 0, 10, 0],
+					padding: [10, 10, 10, 10],
 					extra: {
 						column: {
 							width: 20
@@ -93,17 +90,25 @@
 				reportType,
 				queryDate
 			}) {
-				this.loading = true
+				this.hasData = false
 				this.chartData.categories = []
-				this.chartData.series[0].data = []
-				this.chartData.series[1].data = []
-				// 路段数据
+				this.chartData.series = []
+				this.getRoadData({ reportType, queryDate })
+			},
+			/**
+			 * 路段数据
+			 */
+			getRoadData({ reportType, queryDate }) {
 				uni.$u.api.operationalAnalysisApi.getRevenueDataApi({
 					reportType,
 					queryDate
 				}).then(res => {
 					if (res.code === 200) {
 						if (res.data.itemList && res.data.itemList.length) {
+							this.chartData.series[0] = {
+								name: '路段',
+								data: []
+							}
 							this.chartData.categories = res.data.itemList.map(item => {
 								return item.statisTime
 							})
@@ -112,24 +117,48 @@
 							})
 						}
 					}
-					this.loading = false
+					this.getParkingData({ reportType, queryDate })
 				})
-				// 停车场数据
+			},
+			/**
+			 * 停车场数据
+			 */
+			getParkingData({ reportType, queryDate }) {
 				uni.$u.api.operationalAnalysisApi.getParkingRevenueDataApi({
 					reportType,
 					queryDate
 				}).then(res => {
 					if (res.code === 200) {
 						if (res.data.itemList && res.data.itemList.length) {
-							this.chartData.categories = res.data.itemList.map(item => {
-								return item.statisTime
-							})
-							this.chartData.series[1].data = res.data.itemList.map(item => {
-								return item.amt
-							})
+							if (this.chartData.series.length) {
+								this.chartData.series[1] = {
+									name: '停车场',
+									data: []
+								}
+								this.chartData.series[1].data = res.data.itemList.map(item => {
+									return item.amt
+								})
+							} else {
+								this.chartData.series[0] = {
+									name: '停车场',
+									data: []
+								}
+								this.chartData.series[0].data = res.data.itemList.map(item => {
+									return item.amt
+								})
+							}
+							if (!this.chartData.categories.length) {
+								this.chartData.categories = res.data.itemList.map(item => {
+									return item.statisTime
+								})
+							}
+							this.hasData = true
+						} else if (this.chartData.series.length === 1) {
+							this.hasData = true
+						} else if (!this.chartData.series.length) {
+							this.hasData = false
 						}
 					}
-					this.loading = false
 				})
 			}
 		}

+ 65 - 31
pages/dataOverview/operationalAnalysis/components/sourceOfPayment.vue

@@ -2,7 +2,7 @@
 <template>
 	<view class="revenue">
 		<view class="revenue-line">
-			<LineChart v-if="chartData.series[0].data.length || chartData.series[1].data.length" :chartData="chartData" :title="title" :opts="opts"/>
+			<LineChart v-if="hasData" :chartData="chartData" :title="title" :opts="opts" />
 			<view class="empty" v-else>
 				<u-empty></u-empty>
 			</view>
@@ -54,44 +54,50 @@
 				paySourceList: [],
 				chartData: {
 					categories: [],
-					series: [{
-						name: '路段',
-						data: []
-					}, {
-						name: '停车场',
-						data: []
-					}]
+					series: []
 				},
-				reportType: '',
-				queryDate: ''
+				hasData: false
 			}
 		},
 		created() {
 			this.getDict()
 		},
 		methods: {
-			getData({ reportType, queryDate }) {
-				this.reportType = reportType
-				this.queryDate = queryDate
-				this.getPaySourceData()
+			getData({
+				reportType,
+				queryDate
+			}) {
+				this.hasData = false
+				this.chartData.categories = []
+				this.chartData.series = []
+				this.getPaySourceData({
+					reportType,
+					queryDate
+				})
 			},
 			getDict() {
-				uni.$u.api.getDictApi({ type: 'pay_platform' }).then(res => {
+				uni.$u.api.getDictApi({
+					type: 'pay_platform'
+				}).then(res => {
 					if (res.code === 200) {
 						this.paySourceList = res.data
 					}
 				})
 			},
-			getPaySourceData() {
-				this.chartData.categories = []
-				this.chartData.series[0].data = []
-				this.chartData.series[1].data = []
+			getPaySourceData({
+				reportType,
+				queryDate
+			}) {
 				uni.$u.api.operationalAnalysisApi.getPaySourceDataApi({
-					reportType: this.reportType,
-					queryDate: this.queryDate
+					reportType,
+					queryDate
 				}).then(res => {
 					if (res.code === 200) {
 						if (res.data.itemList && res.data.itemList.length) {
+							this.chartData.series[0] = {
+								name: '路段',
+								data: []
+							}
 							let cateList = []
 							res.data.itemList.forEach(item => {
 								cateList.push(this.getDictLabel(item.payPlatform))
@@ -101,22 +107,49 @@
 								return item.amt
 							})
 						}
+						this.getParkingData({ reportType, queryDate })
 					}
 				})
+			},
+			getParkingData({
+				reportType,
+				queryDate
+			}) {
 				uni.$u.api.operationalAnalysisApi.getParkingPaySourceDataApi({
-					reportType: this.reportType,
-					queryDate: this.queryDate
+					reportType,
+					queryDate
 				}).then(res => {
 					if (res.code === 200) {
 						if (res.data.itemList && res.data.itemList.length) {
-							let cateList = []
-							res.data.itemList.forEach(item => {
-								cateList.push(this.getDictLabel(item.payPlatform))
-							})
-							this.chartData.categories = cateList
-							this.chartData.series[1].data = res.data.itemList.map(item => {
-								return item.amt
-							})
+							if (this.chartData.series.length) {
+								this.chartData.series[1] = {
+									name: '停车场',
+									data: []
+								}
+								this.chartData.series[1].data = res.data.itemList.map(item => {
+									return item.amt
+								})
+							} else {
+								this.chartData.series[0] = {
+									name: '停车场',
+									data: []
+								}
+								this.chartData.series[0].data = res.data.itemList.map(item => {
+									return item.amt
+								})
+							}
+							if (!this.chartData.categories.length) {
+								let cateList = []
+								res.data.itemList.forEach(item => {
+									cateList.push(this.getDictLabel(item.payPlatform))
+								})
+								this.chartData.categories = cateList
+							}
+							this.hasData = true
+						} else if (this.chartData.series.length === 1) {
+							this.hasData = true
+						} else if (!this.chartData.series.length) {
+							this.hasData = false
 						}
 					}
 				})
@@ -139,6 +172,7 @@
 	.revenue {
 		background-color: #fff;
 		border-radius: 5px;
+
 		.empty {
 			padding: 15px;
 		}

+ 9 - 11
pages/dataOverview/operationalAnalysis/components/tollCollectorPerformance.vue

@@ -75,7 +75,7 @@
 						show: false
 					},
 					dataLabel: false,
-					padding: [10, 0, 10, 0],
+					padding: [10, 10, 10, 10],
 					extra: {
 						column: {
 							width: 20
@@ -86,22 +86,20 @@
 		},
 		methods: {
 			getData({ reportType, queryDate }) {
-				this.reportType = reportType
-				this.queryDate = queryDate
 				if (this.type === 'table') {
 					this.tableData.current = 1
-					this.getTableData()
+					this.getTableData({ reportType, queryDate })
 				} else {
-					this.getChartData()
+					this.getChartData({ reportType, queryDate })
 				}
 			},
-			getTableData() {
+			getTableData({ reportType, queryDate }) {
 				this.loading = true
 				uni.$u.api.operationalAnalysisApi.getTollCollectorPerformanceApi({
 					pageNum: this.tableData.current,
 					pageSize: 10,
-					reportType: this.reportType,
-					queryDate: this.queryDate
+					reportType,
+					queryDate
 				}).then(res => {
 					if (res.code === 200) {
 						this.tableData.list = res.rows
@@ -112,10 +110,10 @@
 					this.loading = false
 				})
 			},
-			getChartData() {
+			getChartData({ reportType, queryDate }) {
 				uni.$u.api.operationalAnalysisApi.getTollCollectorPerformanceApi({
-					reportType: this.reportType,
-					queryDate: this.queryDate
+					reportType,
+					queryDate
 				}).then(res => {
 					if (res.code === 200) {
 						if (res.rows && res.rows.length) {

+ 62 - 22
pages/dataOverview/operationalAnalysis/components/trafficFlow.vue

@@ -2,7 +2,7 @@
 <template>
 	<view class="revenue">
 		<view class="revenue-line">
-			<LineChart v-if="chartData.series[0].data.length || chartData.series[1].data.length" :chartData="chartData" :title="title" :opts="opts"/>
+			<LineChart v-if="hasData" :chartData="chartData" :title="title" :opts="opts" />
 			<view class="empty" v-else>
 				<u-empty></u-empty>
 			</view>
@@ -40,10 +40,10 @@
 							}]
 						},
 						legend: {
-							show: false
+							show: true
 						},
 						dataLabel: false,
-						padding: [10, 0, 10, 0],
+						padding: [10, 10, 10, 10],
 						extra: {
 							column: {
 								width: 20
@@ -57,24 +57,36 @@
 			return {
 				chartData: {
 					categories: [],
-					series: [{
-						name: '路段',
-						data: []
-					}, {
-						name: '停车场',
-						data: []
-					}]
-				}
+					series: []
+				},
+				reportType: '',
+				queryDate: '',
+				hasData: false
 			}
 		},
 		methods: {
-			getData({ reportType, queryDate }) {
+			getData({
+				reportType,
+				queryDate
+			}) {
 				this.chartData.categories = []
-				this.chartData.series[0].data = []
-				this.chartData.series[1].data = []
-				uni.$u.api.operationalAnalysisApi.getTrafficFlowDataApi({ reportType, queryDate }).then(res => {
+				this.chartData.series = []
+				this.reportType = reportType
+				this.queryDate = queryDate
+				this.hasData = false;
+				this.getRoadData({ reportType, queryDate });
+			},
+			getRoadData({ reportType, queryDate }) {
+				uni.$u.api.operationalAnalysisApi.getTrafficFlowDataApi({
+					reportType,
+					queryDate
+				}).then(res => {
 					if (res.code === 200) {
 						if (res.data.itemList && res.data.itemList.length) {
+							this.chartData.series[0] = {
+								name: '路段',
+								data: []
+							}
 							this.chartData.categories = res.data.itemList.map(item => {
 								return item.statisTime
 							})
@@ -83,16 +95,43 @@
 							})
 						}
 					}
+					this.getParkingData({ reportType, queryDate });
 				})
-				uni.$u.api.operationalAnalysisApi.getParkingTrafficFlowDataApi({ reportType, queryDate }).then(res => {
+			},
+			getParkingData({ reportType, queryDate }) {
+				uni.$u.api.operationalAnalysisApi.getParkingTrafficFlowDataApi({
+					reportType,
+					queryDate
+				}).then(res => {
 					if (res.code === 200) {
 						if (res.data.itemList && res.data.itemList.length) {
-							this.chartData.categories = res.data.itemList.map(item => {
-								return item.statisTime
-							})
-							this.chartData.series[1].data = res.data.itemList.map(item => {
-								return item.vehicleCount
-							})
+							if (this.chartData.series.length) {
+								this.chartData.series[1] = {
+									name: '停车场',
+									data: []
+								}
+								this.chartData.series[1].data = res.data.itemList.map(item => {
+									return item.vehicleCount
+								})
+							} else {
+								this.chartData.series[0] = {
+									name: '停车场',
+									data: []
+								}
+								this.chartData.series[0].data = res.data.itemList.map(item => {
+									return item.vehicleCount
+								})
+							}
+							if (!this.chartData.categories.length) {
+								this.chartData.categories = res.data.itemList.map(item => {
+									return item.statisTime
+								})
+							}
+							this.hasData = true
+						} else if (this.chartData.series.length === 1) {
+							this.hasData = true
+						} else if (!this.chartData.series.length) {
+							this.hasData = false
 						}
 					}
 				})
@@ -105,6 +144,7 @@
 	.revenue {
 		background-color: #fff;
 		border-radius: 5px;
+
 		.empty {
 			padding: 15px;
 		}

+ 1 - 1
pages/dataOverview/statisticalReport/components/report.scss

@@ -59,7 +59,7 @@
 	color: #CADDFC;
 	margin-top: 24px;
 	text-align: center;
-	font-size: 12px;
+	font-size: 14px;
 	line-height: 17px;
 	text {
 		color: #fff;

+ 13 - 0
pages/patrolManagement/deviceAbnormalRecords/deviceAbnormalRecords.scss

@@ -17,6 +17,19 @@
 					color: #1767F2;
 					font-size: 15px;
 				}
+				.not-red {
+					position: relative;
+					&::after {
+						content: '';
+						position: absolute;
+						top: 10px;
+						right: -15px;
+						width: 7px;
+						height: 7px;
+						background-color: #f00;
+						border-radius: 50%;
+					}
+				}
 			}
 			&-content {
 				color: #616161;

+ 4 - 4
pages/patrolManagement/deviceAbnormalRecords/deviceAbnormalRecords.vue

@@ -4,7 +4,7 @@
 		<view class="records-list" v-if="recordList.length">
 			<view class="records-list-item" v-for="(item, index) in recordList" :key="index" @click="recordClick(item)">
 				<view class="records-list-item-header">
-					<view>{{ item.roadName }}</view>
+					<view :class="{'not-red': Number(item.isRed) === 0}">{{ item.roadName }}</view>
 					<view>{{ item.createBy }}</view>
 				</view>
 				<view class="records-list-item-content">
@@ -29,12 +29,12 @@
 			return {
 				recordList: [],
 				status: 'loadmore',
-				page: 1,
-				loading: false
+				page: 1
 			}
 		},
 		onShow() {
-			// this.recordList = []
+			this.page = 1
+			this.recordList = []
 			this.getRecordList();
 		},
 		methods: {

+ 14 - 4
pages/patrolManagement/deviceAbnormalRecords/recordsDetails/recordsDetails.vue

@@ -1,5 +1,6 @@
 <template>
 	<view class="details">
+		<!-- <u-loading-page :loading="loading"></u-loading-page> -->
 		<view class="details-content" v-if="detailsInfo.id">
 			<view class="details-content-road">
 				<view class="details-content-road-name">{{ detailsInfo.roadName }}</view>
@@ -25,7 +26,8 @@
 		data() {
 			return {
 				id: undefined,
-				detailsInfo: {}
+				detailsInfo: {},
+				loading: false
 			}
 		},
 		onLoad(page) {
@@ -51,20 +53,28 @@
 							this.updateDeviceAbnormalInfo(this.id);
 						}
 					}
+					this.loading = false
+				}).catch(e => {
+					this.loading = false
 				})
 			},
 			/**
 			 * 设置消息已读
-			 * @param {Object} id
+			 * @param { String } id
 			 */
 			updateDeviceAbnormalInfo(id) {
 				uni.$u.api.deviceAbnormalApi.updateDeviceAbnormalInfoApi({
 					id
 				}).then(res => {
-					console.log('已读:', res)
+					console.log('已读:', id)
 				})
 			},
-			previewImage(list, current) {
+			/**
+			 * 预览图片
+			 * @param { Array } list
+			 * @param { Number } current
+			 */
+			previewImage(list, current = 0) {
 				uni.previewImage({
 					urls: list,
 					current