Ver Fonte

bug修复

ming há 3 anos atrás
pai
commit
0073b0823b

+ 6 - 0
pages/accountManage/success/success.vue

@@ -23,6 +23,12 @@
 
 			}
 		},
+		onBackPress(event) {
+			uni.reLaunch({
+				url: "/"
+			})
+			return true;
+		},
 		onLoad: function(option) {
 
 		},

+ 7 - 0
pages/alarmingList/alarmingList.vue

@@ -34,6 +34,13 @@
 
 			}
 		},
+		
+		onBackPress(event) {
+			uni.reLaunch({
+				url: "../index/index"
+			})
+			return true;
+		},
 		onLoad(option) {
 			this.getSiteType(uni.getStorageSync('selectedCode'))
 			this.companyCode=option.companyCode

+ 173 - 0
pages/deviceDetail/components/liquidChart.vue

@@ -0,0 +1,173 @@
+<template>
+	<view class="content">
+
+		<view @click="echarts.onClick" :prop="option" :change:prop="echarts.updateEcharts" id="echarts2"
+			class="echarts"></view>
+
+	</view>
+</template>
+
+<script>
+	var dwtype = "2";
+	var tes = '0';
+	var tes2 = '';
+	var tyss = "";
+	if (dwtype == 2) {
+		tes = '设备数值变化';
+		tes2 = '液位值';
+		tyss = "兆帕";
+	}
+	if (dwtype == 5) {
+		tes = '一周水位值变化 (m)';
+		tes2 = '液位值';
+		tyss = "米";
+		document.getElementById('dev_title_lab').innerHTML = '当前水位:';
+		document.getElementById('dev_title_unit').innerHTML = 'm';
+	}
+
+	export default {
+		props: {
+			bindData: {
+				type: Object,
+				default: ''
+			}
+		},
+		data() {
+			return {
+				option: {
+					title: {
+						x: 'center',
+						text: tes
+					},
+	
+					tooltip: {
+						trigger: 'axis',
+						axisPointer: {
+							type: 'cross',
+							animation: false,
+							label: {
+								backgroundColor: '#505765'
+							}
+						}
+					},
+
+					grid: {
+						left: '7%',
+						right: '15%',
+						bottom: '15%',
+						containLabel: true
+					},
+					toolbox: {
+						// feature: {
+						//     saveAsImage: {}
+						// }
+					},
+					legend: {
+						data: ['水压/水位(兆帕/米)', '电量/信号(%)'],
+						// left: 10
+					},
+					xAxis: {
+						type: 'category',
+						axisTick: {
+							alignWithLabel: true
+						},
+						data:this.bindData.stiem.map( function(value,index){
+							return `${value.substring(0,10)}\n${value.substring(11,20)}`
+						})
+					},
+					yAxis: [{
+						name: '液位',
+						type: 'value',
+						// max: 1
+					}, 
+					
+					],
+				
+
+					series: [{
+						name: tes2,
+						type: 'line',
+						stack: 'Pa',
+						animation: false,
+						data:this.bindData.water_data,
+						color: ['#2699fb'],
+						yAxisIndex: 0
+					},
+					
+					]
+				}
+			}
+		},
+		onLoad() {
+			
+
+		},
+		methods: {
+			changeOption() {
+				const data = this.option.series[0].data
+				// 随机更新示例数据
+				data.forEach((item, index) => {
+					data.splice(index, 1, Math.random() * 40)
+				})
+			},
+			onViewClick(options) {
+				console.log(options)
+			}
+		}
+	}
+</script>
+
+<script module="echarts" lang="renderjs">
+	let myChart
+	export default {
+		mounted() {
+			
+			console.log('this.bindData')
+			console.log(this.bindData)
+			
+			
+			if (typeof window.echarts === 'function') {
+				this.initEcharts()
+			} else {
+				// 动态引入较大类库避免影响页面展示
+				const script = document.createElement('script')
+				// view 层的页面运行在 www 根目录,其相对路径相对于 www 计算
+				script.src = 'static/echarts.min.js'
+				script.onload = this.initEcharts.bind(this)
+				document.head.appendChild(script)
+			}
+		},
+		methods: {
+			initEcharts() {
+				myChart = echarts.init(document.getElementById('echarts2'))
+				// 观测更新的数据在 view 层可以直接访问到
+				myChart.setOption(this.option)
+			},
+			updateEcharts(newValue, oldValue, ownerInstance, instance) {
+				// 监听 service 层数据变更
+				myChart.setOption(newValue)
+			},
+			onClick(event, ownerInstance) {
+				// 调用 service 层的方法
+				ownerInstance.callMethod('onViewClick', {
+					test: 'test'
+				})
+			}
+		}
+	}
+</script>
+
+<style>
+	.content {
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		justify-content: center;
+	}
+
+	.echarts {
+		width: 100%;
+		height: 500rpx;
+		margin-bottom: 70rpx;
+	}
+</style>

+ 23 - 5
pages/deviceDetail/deviceDetail.vue

@@ -70,9 +70,21 @@
 				</view>
 			</view>
 			<!-- 水系统图表end -->
+			
+			<!-- 液位 start -->
+			<view v-if="this.getData.dwtype==5" class="processStatus">
+				<view class="info-tit margin-left-xs">
+					<text class="cuIcon-titles margin-right-xs"></text>
+					图表
+				</view>
+				<view class="info-content noborder">
+					<liquid-chart :bindData="getData"></liquid-chart>
+				</view>
+			</view>
+			<!-- 液位 end-->
 
 
-			<view class="processStatus" v-if="this.getData.dwtype!=1&&this.getData.dwtype!=2">
+			<view class="processStatus" v-if="this.getData.dwtype!=1&&this.getData.dwtype!=2&&this.getData.dwtype!=5">
 				<view class="info-tit margin-left-xs">
 					<text class="cuIcon-titles margin-right-xs"></text>
 					表格
@@ -142,7 +154,7 @@
 				<view v-if="this.getData.dwtype==128" class="info-content noborder padding">
 					<table>
 						<tr>
-							<th>最后上传</th>
+							<th>最后上传状态</th>
 							<th>最后上传时间</th>
 						</tr>
 						<tr  v-for="(item,index) in this.mc_data" :key="index">
@@ -172,7 +184,7 @@
 				<!-- 消防栓 end -->
 				
 				<!-- 液位 start -->
-				<view v-if="this.getData.dwtype==5" class="info-content noborder padding">
+				<!-- <view v-if="this.getData.dwtype==5" class="info-content noborder padding">
 					<table>
 						<tr>
 							<th>液位水位值</th>
@@ -185,7 +197,11 @@
 							<td>{{this.getData.stime?this.getData.stime:'-'}}</td>
 						</tr>
 					</table>
-				</view>
+				</view> -->
+				
+				
+				
+				
 				<!-- 液位 end -->
 				
 				<!-- 电梯 start -->
@@ -227,13 +243,15 @@
 
 <script>
 	import chart from './components/chart.vue';
-	import waterChart from './components/waterChart.vue';
+	import waterChart from './components/waterChart.vue';  liquidChart
+	import liquidChart from './components/liquidChart.vue';
 	import tableDetail from './components/table-detail.vue';
 	import fireTable from './components/fireTable.vue';
 	export default {
 		components: {
 			chart,
 			waterChart,
+			liquidChart,
 			tableDetail,
 			fireTable
 

+ 0 - 3
pages/deviceManage/deviceAdd/deviceAdd.vue

@@ -476,7 +476,6 @@
 				queryParam.is_top = this.radioOne;
 				
 				if (this.type==1&&this.transfer_type=="4G") {
-					alert(1)
 					queryParam.owner_xh_a = this.owner_xh_a;
 					queryParam.owner_xh_b = this.owner_xh_b;
 					queryParam.owner_xh_c = this.owner_xh_c;
@@ -484,7 +483,6 @@
 					return;
 				}
 				if (this.transfer_type=='NB'&&(this.type==2||this.type==5)) {
-					alert(2)
 					queryParam.deviceType = this.deviceType;
 					queryParam.manufacturerName = this.manufacturerName;
 					queryParam.model = this.model;
@@ -495,7 +493,6 @@
 					return;
 				}
 				if (this.type==7&&this.transfer_type=='4G') {
-					alert(3)
 					queryParam.max_level = this.max_level;
 					queryParam.min_level = this.min_level;
 					queryParam.owner_bl = this.owner_bl;

+ 4 - 4
pages/index/components/chart2/chart2.vue

@@ -35,7 +35,7 @@
 					},
 
 					title: [{ //aa标题
-						text: '{val|' + (parseInt(this.bindData.alarm_count) + parseInt(this.bindData
+						text: '{val|' + (parseInt(this.bindData.hj) + parseInt(this.bindData
 								.event_count) + parseInt(this.bindData.hidden_danger_count)) + '}\n{name|' +
 							title + '}',
 						top: '27%',
@@ -82,7 +82,7 @@
 					series: [{
 						name: '访问来源',
 						type: 'pie',
-						radius: ['40%', '60%'],
+						radius: ['38%', '55%'],
 						center: ['50%', '35%'],
 						itemStyle: {
 							normal: {
@@ -94,8 +94,8 @@
 						},
 
 						data: [{
-								name: "警",
-								value: this.bindData.alarm_count
+								name: "警",
+								value: this.bindData.hj
 							},
 							{
 								name: "事件",

+ 6 - 1
pages/inspectList/processList/processList.vue

@@ -128,7 +128,12 @@
 				
 			}
 		},
-		
+		onBackPress(event) {
+			uni.reLaunch({
+				url: "/"
+			})
+			return true;
+		},
 		onLoad: function(option) {
 			this.type=option.type;
 			if(option.type==1){

+ 8 - 0
pages/processList/processList.vue

@@ -106,6 +106,14 @@
 				isLoadMore: false, //是否加载中
 			};
 		},
+		
+		onBackPress(event) {
+			uni.redirectTo({
+				url: '../alarmingList/alarmingList'
+			});
+			return true;
+		},
+		
 
 		onReachBottom() { //上拉触底函数
 			if (!this.isLoadMore) { //此处判断,上锁,防止重复请求

+ 1 - 1
pages/processedDetail/processedDetail.vue

@@ -39,7 +39,7 @@
 				<view class="info-content">
 					<view class="info-one-info ">
 						<text>是否误报:</text>
-						<text>{{getData.clwb?'是':'否'}}</text>
+						<text>{{getData.clwb!='0'?'是':'否'}}</text>
 					</view>
 					<view>
 						<text>处理人:</text>

+ 6 - 0
pages/repair/repair.vue

@@ -89,6 +89,12 @@
 			
 			};
 		},
+		onBackPress(event) {
+			uni.reLaunch({
+				url: "/"
+			})
+			return true;
+		},
 		onLoad:function(option){
 			this.goRepairList({'company_code':uni.getStorageSync('selectedCode')})
 		},

+ 21 - 17
pages/unprocessDetail/unprocessDetail.vue

@@ -16,11 +16,11 @@
 						<text>{{getData.device_name}}</text>
 					</view>
 
-					<view  class="info-one-info ">
+					<view class="info-one-info ">
 						<text>设备地址:</text>
 						<text>{{getData.unitinfo}}</text>
 					</view>
-					<view  class="info-one-info ">
+					<view class="info-one-info ">
 						<text>告警信息:</text>
 						<text>{{getData.alarm_information}}</text>
 					</view>
@@ -51,9 +51,11 @@
 
 						</view>
 						<view class="btn-area">
-							<button class="bg-orange round missReport margin-top" @click="$noMultipleClicks(alarmSubmit,1)" >误 报
+							<button class="bg-orange round missReport margin-top"
+								@click="$noMultipleClicks(alarmSubmit,1)">误 报
 							</button>
-							<button class="bg-blue round  missReport margin-top " @click="$noMultipleClicks(alarmSubmit,0)">非 误 报
+							<button class="bg-blue round  missReport margin-top "
+								@click="$noMultipleClicks(alarmSubmit,0)">非 误 报
 							</button>
 						</view>
 					</form>
@@ -70,23 +72,25 @@
 	export default {
 		data() {
 			return {
-				noClick:true,
+				noClick: true,
 				modalName: null,
 				reason: '',
 				type: 1,
 				textareaMsg: '',
 				getData: {},
 				radioOne: 0,
-				clzt:0
+				clzt: 0
 			}
 		},
+
+		
 		onLoad: function(option) {
 			this.type = option.type;
 			this.getDetailData({
 				"type": option.type,
 				"id": option.id
 			});
-			
+
 			let url = "";
 			switch (parseInt(option.type)) {
 				case 1:
@@ -126,10 +130,10 @@
 					break;
 			}
 			uni.setNavigationBarTitle({
-				title: url+'(未处理)'
+				title: url + '(未处理)'
 			});
-			
-			
+
+
 		},
 		methods: {
 			async getDetailData(params = {}) {
@@ -162,13 +166,13 @@
 
 			//误报 非误报
 			alarmSubmit(params) {
-				if (!this.textareaMsg.replace(/^\s*/g,'')) {
+				if (!this.textareaMsg.replace(/^\s*/g, '')) {
 					uni.showToast({
 						title: "请输入处理内容",
 						icon: "none"
 					});
 				} else {
-					
+
 					let queryParam = {};
 					queryParam.id = this.getData.id;
 					queryParam.type = this.getData.dwtype;
@@ -177,7 +181,7 @@
 					queryParam.clwb = params;
 					queryParam.ncmd = this.getData.ncmd;
 					queryParam.clnr = this.textareaMsg;
-					
+
 					if (this.getData.dwtype == 1) {
 						queryParam.data3 = this.getData.data3;
 						queryParam.data5 = this.getData.data5;
@@ -195,20 +199,20 @@
 						return;
 					}
 					if (this.getData.dwtype == 3) {
-						queryParam.data2=this.getData.data2;
+						queryParam.data2 = this.getData.data2;
 						this.powerSubmitRes(queryParam);
 						return;
 					}
 					if (this.getData.dwtype == 6) {
-						queryParam.data2=this.getData.data2;
-						queryParam.data4=this.getData.data4;
+						queryParam.data2 = this.getData.data2;
+						queryParam.data4 = this.getData.data4;
 						this.powerSubmitRes(queryParam);
 						return;
 					}
 					this.powerSubmitRes(queryParam)
 				}
 			},
-			
+
 
 			RadioChange(e) {
 				this.radioOne = e.detail.value;

+ 1 - 1
pages/weiBao/planDetailDone/planDetailDone.vue

@@ -40,7 +40,7 @@
 				</view>
 			
 				<!-- <img :src="`https://qhome.usky.cn${this.getData.report_photos}`" alt="" style="max-width:50%">  -->
-				<img :src="`${this.$BASE_URL}${this.getData.report_photos}`" alt="" style="max-width:50%">
+				<img :src="`${this.$websiteUrl}${this.getData.report_photos}`" alt="" style="max-width:50%">
 				
 			</view>
 			

+ 6 - 0
pages/weiBao/planInnerList/planInnerList.vue

@@ -49,6 +49,12 @@
 
 			};
 		},
+		onBackPress(event) {
+			uni.reLaunch({
+				url: "/"
+			})
+			return true;
+		},
 		onLoad:function(option){
 			this.getPlanList({'company_code':uni.getStorageSync('selectedCode'),"id":option.id})
 		},

+ 6 - 0
pages/xunJian/planInnerList/planInnerList.vue

@@ -46,6 +46,12 @@
 				planList: [],
 			};
 		},
+		onBackPress(event) {
+			uni.reLaunch({
+				url: "/"
+			})
+			return true;
+		},
 		onLoad: function(option) {
 			this.getPlanList({
 				'company_code': uni.getStorageSync('selectedCode'),