Browse Source

修改bug

“yueshang” 1 year ago
parent
commit
fc18a5161a

+ 2 - 1
pagesA/fire/architecture/edit_architecture/edit_architecture.vue

@@ -323,7 +323,7 @@
 					.then(res => {
 						this.formData['status'] = 0;
 						if (this.formData.File.length != 0) {
-							this.formData.dwpmtzmc = this.formData.File[0].url.toString();
+							this.formData.dwpmtzmc = this.formData.File[0]?.url?.toString();
 						} else {
 							this.formData.dwpmtzmc = ''
 						}
@@ -343,6 +343,7 @@
 						});
 					})
 					.catch(err => {
+						console.log(err,'err');
 						uni.showToast({
 							icon: 'none',
 							title: '错误!' + err[0].message

+ 1 - 1
pagesA/fire/architecture/index.vue

@@ -45,7 +45,7 @@
 						</view>
 						<view style="display: flex;margin-bottom: 15rpx; color: #728f90;">
 							<text class="name-align-building">重点部位:</text>
-							<text class="conts max-width">{{ item.dafzr }}</text>
+							<text class="conts max-width">{{ item.zdbwpic }}</text>
 						</view>
 						<!-- 删除按钮 -->
 						<view class="an-niu" @click.native="showModal(item)">

+ 2 - 3
pagesA/fire/check_active/check_implement/check_implement.vue

@@ -57,7 +57,7 @@
 							<view style="color: #8C8C8C;">设备图片</view>
 							<view style="position: relative;width: 180rpx;float: left;margin: 40rpx;"
 								v-for="(items,indexs) in item.attUrl" :key="indexs"
-								@click="viewImageBig(items,item.attUrl)">
+							>
 								<image :src=" items" style="width: 160rpx;height: 160rpx;border-radius: 30rpx;float: left;">
 								</image>
 								<u-icon name="close" color="#4CB2B6" size="19" @click="closeImage(item,indexs,index)">
@@ -230,7 +230,7 @@
 					<view class="uni-grid-wraps">
 						<view style="position: relative;width: 180rpx;float: left;margin: 10rpx 15rpx 0 0rpx;"
 							v-for="(items,indexs) in item.attUrl" :key="indexs"
-							@click="viewImageBig(items,item.attUrl)">
+							>
 							<image :src="items" style="width: 160rpx;height: 160rpx;border-radius: 30rpx;float: left;">
 								<u-icon name="close" color="#4CB2B6" size="19" @click="closeImage(item,indexs,index)">
 								</u-icon>
@@ -498,7 +498,6 @@
 						this.insTypeData[0].dengerType = i.value
 					}
 				});
-				console.log(this.insTypeData[0].dengerType, 'this.insTypeData[0].dengerType');
 				this.description2 = this.checkedPopupDanger.toString()
 				if (this.description2.startsWith(',')) {
 					this.description2 = this.description2.slice(1);

+ 61 - 15
pagesA/fire/check_active/check_list/check_list.vue

@@ -4,9 +4,13 @@
 		<view class="bgTopImg">
 			<image slot="right" src="@/static/images/navBg@2x.png" class="bgTopImg"></image>
 		</view> -->
-		<view style="margin-bottom: 150rpx;">
+		<view style="margin-bottom: 150rpx;" class="time-main main-time">
 			<view>
-				<view class="nav" style="color:#4CB2B6;">主要信息</view>
+				<view class="nav par-time " style="color:#4CB2B6;">
+					<view class="time-axis">
+						主要信息
+					</view>
+				</view>
 				<view class="main">
 					<uni-row class="demo-uni-row">
 						<uni-col :span="10">
@@ -86,7 +90,9 @@
 				</view>
 			</view>
 			<view v-if="tableData.inspectInfo.length!=0" style="margin-top: 30rpx;">
-				<view class="nav" style="color:#4CB2B6;">处理详情</view>
+				<view class="nav par-time" style="color:#4CB2B6;">
+					<view class="time-axis">处理详情</view>
+				</view>
 				<view class="main" v-for="(item,index) in tableData.inspectInfo" :key="index"
 					style="margin-bottom: 40rpx;">
 					<uni-row class="demo-uni-row">
@@ -109,7 +115,8 @@
 						</uni-row>
 						<uni-row class="demo-uni-row tupian-flex">
 							<view v-for="(items,indexs) in item.inspectHisSubDOList">
-								<image v-if="items.imgUrl" :key="indexs" :src="items.imgUrl" class="image-size" @click="viewImageBig(items.imgUrl)"></image>
+								<image v-if="items.imgUrl" :key="indexs" :src="items.imgUrl" class="image-size"
+									@click="viewImageBig(items.imgUrl)"></image>
 							</view>
 
 						</uni-row>
@@ -156,9 +163,12 @@
 								</uni-col>
 							</uni-row>
 							<uni-row class="demo-uni-row tupian-flex">
-								<image v-if="items.imgUrl1!=null" :src="items.imgUrl1" class="image-size" @click="viewImageBig(items.imgUrl)"></image>
-								<image v-if="items.imgUrl2!=null" :src="items.imgUrl2" class="image-size" @click="viewImageBig(items.imgUrl)"></image>
-								<image v-if="items.imgUr3!=null" :src="items.imgUrl3" class="image-size" @click="viewImageBig(items.imgUrl)"></image>
+								<image v-if="items.imgUrl1!=null" :src="items.imgUrl1" class="image-size"
+									@click="viewImageBig(items.imgUrl)"></image>
+								<image v-if="items.imgUrl2!=null" :src="items.imgUrl2" class="image-size"
+									@click="viewImageBig(items.imgUrl)"></image>
+								<image v-if="items.imgUr3!=null" :src="items.imgUrl3" class="image-size"
+									@click="viewImageBig(items.imgUrl)"></image>
 							</uni-row>
 						</view>
 					</view>
@@ -196,7 +206,7 @@
 	export default {
 		data() {
 			return {
-				taskTypeDict:getDictDatas(DICT_TYPE.TASK_TYPE),
+				taskTypeDict: getDictDatas(DICT_TYPE.TASK_TYPE),
 				urls: baseUrlImg,
 				moren: `${baseUrlImg}/checkActive/moren.png`, //默认图片
 				zhengchang: `${baseUrlImg}/checkActive/zhengchang.png`,
@@ -230,8 +240,8 @@
 		},
 
 		methods: {
-			viewImageBig(item){
-				let imgList=[]
+			viewImageBig(item) {
+				let imgList = []
 				imgList.push(item)
 				uni.previewImage({
 					urls: imgList,
@@ -357,11 +367,11 @@
 					}).then(res => {
 						this.sender = res.data
 					})
-                     this.taskTypeDict.map(i=>{
-						 if(i.value==this.tableData?.taskInfo?.taskType){
-							 this.tableData.taskInfo.taskType=i.label
-						 }
-					 })
+					this.taskTypeDict.map(i => {
+						if (i.value == this.tableData?.taskInfo?.taskType) {
+							this.tableData.taskInfo.taskType = i.label
+						}
+					})
 				});
 			}
 		}
@@ -371,9 +381,11 @@
 	page {
 		background-color: #f5f7f9;
 	}
+
 	body {
 		background-color: #f5f7f9;
 	}
+
 	.container {
 		// border-radius: 30px 30px 0px 0px;
 		// background: #fff;
@@ -391,6 +403,7 @@
 			background-color: #f5f7f9;
 		}
 	}
+
 	.zhuangtai {
 		padding: 5rpx 20rpx;
 		border-radius: 2px;
@@ -481,4 +494,37 @@
 		color: #4CB2B6;
 		margin-bottom: 20rpx;
 	}
+	.main-time{
+		list-style: none;
+		position: relative;
+	}
+    .main-time::before{
+		  content: "";
+		      position: absolute;
+			  border:rgba(52, 145, 250, 0.4) 2px dashed;
+		      left: -43px;
+		      height: calc(100% - 20px);
+		      top: 20rpx;
+	}
+	.time-main {
+		width: 70%;
+		margin-left:15%;
+	}
+
+	.par-time {
+		position: relative;
+	}
+
+	//时间轴
+	.time-axis::before {
+		content: "";
+		position: absolute;
+		width: 18rpx;
+		height: 18rpx;
+		border-radius: 9rpx;
+		background: #21bfd0;
+		top: 50%;
+		transform: translateY(-50%);
+		left: -46px;
+	}
 </style>

+ 0 - 1
pagesA/fire/check_inspection/check_inspection.vue

@@ -697,7 +697,6 @@
 				}
 			},
 			checkPopupYinHuan() {
-				console.log(this.dengerType, 'this.dengerType');
 				this.handleMethod = "生成隐患" //生成隐患
 				// this.handleResult = "不正常"
 				this.handleResult = 2

+ 44 - 13
pagesA/fire/fire_device/add_device/add_device.vue

@@ -17,15 +17,18 @@
 					<u-form-item label="所在位置	" prop="fpdLocal">
 						<u-input v-model="formData.fpdLocal" placeholder="请输入所在位置" />
 					</u-form-item>
-		<!-- 			<u-form-item label="设备状态" @click="
+					<!-- 			<u-form-item label="设备状态" @click="
 							showSex4 = true;
 							hideKeyboard();
 						">
 						<u--input v-model="fpdStatus" disabled disabledColor="#ffffff" placeholder="请选择设备状态"></u--input>
 					</u-form-item> -->
 
-					<u-form-item label="所属建筑">
-						<u-input v-model="formData.buildingId" placeholder="请输入所属建筑" />
+					<u-form-item label="所属建筑" @click="
+							showBuilding = true;
+							hideKeyboard();
+						">
+						<u-input v-model="formData.buildingName" placeholder="请输入所属建筑" />
 					</u-form-item>
 					<u-form-item label="设施类别" prop="ywbnc" @click="
 							showSex = true;
@@ -78,6 +81,8 @@
 				@select="sexSelect4"></u-action-sheet>
 			<u-action-sheet :show="showSex5" :actions="actions5" title="请选择单位" @close="showSex5 = false"
 				@select="sexSelect5"></u-action-sheet>
+			<u-action-sheet :show="showBuilding" :actions="buildingData" title="请选择所属建筑" @close="showBuilding = false"
+				@select="buildingSelect"></u-action-sheet>
 			<!-- 加载中 -->
 			<!-- <isLodingModel></isLodingModel> -->
 		</view>
@@ -94,6 +99,9 @@
 		getOrgId
 	} from '@/api/fire_device';
 	import {
+		getArc, //获取建筑信息列表
+	} from '@/api/architecture';
+	import {
 		getAccessToken
 	} from '@/utils/auth'
 	import {
@@ -107,6 +115,8 @@
 	export default {
 		data() {
 			return {
+				showBuilding: false, //所属建筑
+				buildingData: [],
 				contentText: {
 					contentrefresh: '上传照片中',
 				},
@@ -139,7 +149,8 @@
 				formData: {
 					status: '0',
 					orgName: '',
-					picVOList: []
+					picVOList: [],
+					buildingId: ''
 				},
 				// 用于显示下拉确认内容,不作为提交
 				fpdStatus: '',
@@ -208,7 +219,21 @@
 		onReady() {
 			this.$refs.customForm.setRules(this.customRules);
 		},
-
+		onShow() {
+			this.buildingData = []
+			getArc({
+				pageNo: 1,
+				pageSize: 100,
+				orgId: this.formData.orgId,
+			}).then(response => {
+				response.data.records.map(v => {
+					this.buildingData.push({
+						id: v.id,
+						name: v.buildingName
+					});
+				});
+			});
+		},
 		methods: {
 			closeImage(val, index) {
 				this.formData.picVOList.splice(index, 1)
@@ -220,7 +245,7 @@
 					// sourceType: ['camera'], //实现拍照
 					count: 3,
 					sizeType: ['original', 'compressed'],
-					sourceType: ['album','camera'], //打开系统相册
+					sourceType: ['album', 'camera'], //打开系统相册
 					success(res) {
 						that.loading = true
 						if (Array.isArray(res.tempFilePaths)) { //从相册选择有三张的情况
@@ -258,7 +283,7 @@
 												},
 												fail: () => {
 													that.loading = false
-													
+
 												}
 											})
 											URL.revokeObjectURL(fileUrl);
@@ -286,7 +311,7 @@
 						})
 						var jsdata = JSON.stringify(this.formData);
 						createDevice(jsdata).then(response => {
-					
+
 							uni.showLoading({
 								title: response.data.msg
 							});
@@ -296,7 +321,7 @@
 						});
 					})
 					.catch(err => {
-						
+
 						uni.showToast({
 							icon: 'none',
 							title: '错误!' + err[0].message
@@ -312,22 +337,27 @@
 
 			// 类型
 			sexSelect2(e) {
-			
+
 				this.formData.fpdTypeName = e.label;
 				this.formData.fpdType = e.value;
-				
+
 			},
 			// 设备状态
 			sexSelect4(e) {
 				this.formData.fpdStatus = e.id;
 				this.fpdStatus = e.name;
-			
+
+			},
+			//所属建筑
+			buildingSelect(e) {
+				this.formData.buildingId = e.id;
+				this.formData.buildingName = e.name;
 			},
 			// 所属单位
 			sexSelect5(e) {
 				this.formData.orgId = e.id;
 				this.formData.orgName = e.name;
-				
+
 			},
 
 			// 生成隐患弹出层   //暂存为草稿箱弹出层
@@ -544,6 +574,7 @@
 	.example {
 		overflow-y: auto;
 	}
+
 	/deep/.u-action-sheet {
 		overflow-y: auto;
 		height: 1000rpx;

+ 26 - 4
pagesA/fire/fire_device/edit_device/edit_device.vue

@@ -32,8 +32,11 @@
 					<u-form-item label="所在位置	" prop="fpdLocal">
 						<u-input v-model="formData.fpdLocal" placeholder="请输入所在位置" />
 					</u-form-item>
-					<u-form-item label="所属建筑	">
-						<u-input v-model="formData.buildingId" placeholder="请输入所属建筑" />
+					<u-form-item label="所属建筑" @click="
+					showBuilding = true;
+					hideKeyboard();
+				">
+						<u-input v-model="formData.buildingName" placeholder="请输入所属建筑" />
 					</u-form-item>
 					<u-form-item label="设施类别" prop="fpdType" @click="
 							showSex = true;
@@ -82,6 +85,8 @@
 				@select="sexSelect4"></u-action-sheet>
 			<u-action-sheet :show="showSex5" :actions="actions5" title="请选择单位" @close="showSex5 = false"
 				@select="sexSelect5"></u-action-sheet>
+			<u-action-sheet :show="showBuilding" :actions="buildingData" title="请选择所属建筑" @close="showBuilding = false"
+				@select="buildingSelect"></u-action-sheet>
 			<!-- 加载中 -->
 			<!-- <isLodingModel></isLodingModel> -->
 		</view>
@@ -105,6 +110,9 @@
 	import {
 		getAccessToken
 	} from '@/utils/auth'
+	import {
+		getArc, //获取建筑信息列表
+	} from '@/api/architecture';
 	import loadImage from 'blueimp-load-image';
 	const baseUrlImg = config.baseUrlImg
 	const baseUrl = config.baseUrl
@@ -112,6 +120,8 @@
 	export default {
 		data() {
 			return {
+				showBuilding:false,
+				buildingData:[],
 				contentText: {
 					contentrefresh: '上传照片中',
 				},
@@ -181,6 +191,7 @@
 				i.name = i.label;
 				i.id = i.value;
 			});
+			this.buildingData=JSON.parse(option.buildingData)
 			this.loading = true
 			// 接收传值
 			var data = option.id;
@@ -190,14 +201,17 @@
 			}).then(res => {
 				this.formData = res.data
 				that.formData.orgName = res.data.orgDO.orgName
-
 				this.actions2.map(i => {
-
 					if (res.data.fpdType == i.id) {
 						this.formData.fpdTypeName = i.name
 						this.formData.fpdType = i.id
 					}
 				})
+				that.buildingData.map(v=>{
+					if(v.id==that.formData.buildingId){
+						that.formData.buildingName=v.name
+					}				
+				})
 
 
 			})
@@ -235,8 +249,16 @@
 		onReady() {
 			this.$refs.customForm.setRules(this.customRules);
 		},
+		onShow() {
 
+	
+		},
 		methods: {
+			//所属建筑
+			buildingSelect(e) {
+				this.formData.buildingId = e.id;
+				this.formData.buildingName = e.name;
+			},
 			viewImageBig(i) {
 				let imgList = []
 				imgList.push(i)

+ 20 - 2
pagesA/fire/fire_device/index.vue

@@ -131,6 +131,9 @@
 		DICT_TYPE,
 		getDictDatas
 	} from '@/utils/dict';
+	import {
+		getArc, //获取建筑信息列表
+	} from '@/api/architecture';
 	const baseUrlImg = config.baseUrlImg
 	export default {
 		data() {
@@ -168,7 +171,8 @@
 				},
 				show: false,
 				showtimeStart: false,
-				showtimeEnd: false
+				showtimeEnd: false,
+				buildingData:[]
 			};
 		},
 		// 在 vue页面,向起始页通过事件传递数据
@@ -177,6 +181,20 @@
 
 		},
 		onShow() {
+			this.buildingData = []
+			getArc({
+				pageNo: 1,
+				pageSize: 100,
+				orgId: this.formData.orgId,
+			}).then(response => {
+				response.data.records.map(v => {
+					this.buildingData.push({
+						id: v.id,
+						name: v.buildingName
+					});
+				});
+			
+			});
 			this.actions = []
 			getOrgId({
 				pageNo: this.pageNo,
@@ -355,7 +373,7 @@
 			onClick(val, orgName) {
 				this.isLoaded = false
 				uni.navigateTo({
-					url: '/pagesA/fire/fire_device/edit_device/edit_device?id=' + val.id + '&orgName=' + orgName,
+					url: `/pagesA/fire/fire_device/edit_device/edit_device?id=${val.id}&orgName=${orgName}&buildingData=${JSON.stringify(this.buildingData)}`,
 					events: {
 						// 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
 						acceptDataFromOpenedPage: function(val) {

+ 1 - 1
pagesA/fire/fire_station/index.vue

@@ -51,7 +51,7 @@
 						<view class="an-niu" @click.native="onClick(item,formData.orgName)" link><text
 								class="detail">查看详情</text></view>
 						<view class="an-niu" @click.native="onClickFireRun(item,formData.orgName)" link><text
-								class="operation">运行情况</text></view>
+								class="operation">出动记录</text></view>
 					</uni-card>
 				</view>
 			</view>

+ 20 - 49
utils/request.js

@@ -7,6 +7,7 @@ import {
 	getExpiresTime
 } from '@/utils/auth'
 import {
+	login,
 	refreshToken
 } from '@/api/login'
 import errorCode from '@/utils/errorCode'
@@ -33,8 +34,8 @@ const request = config => {
 	// 设置租户 TODO 芋艿:强制 1 先
 	config.header['tenant-id'] = '1';
 	// get请求映射params参数
-	if (config.params) {
-		let url = config.url + '?' + tansParams(config.params)
+	if (config.params && !requests.length) {
+		let url = config.url + '?' + tansParams(config.params);
 		url = url.slice(0, -1)
 		config.url = url
 	}
@@ -47,7 +48,7 @@ const request = config => {
 				// header: config.header,
 				header: config.header,
 				dataType: 'json'
-			}).then(async response => {
+			}).then(response => {
 				let [error, res] = response
 				if (error) {
 					toast('后端接口连接异常')
@@ -57,60 +58,30 @@ const request = config => {
 				const code = res.data.code || 200
 				const msg = errorCode[code] || res.data.msg || errorCode['default']
 				if (code === 401) {
-					//token无效或已过期
+					new Promise((reslove2) => {
+						requests.push(()=>resolve(request(config)))
+					})
 					if (!isRefreshing) {
-						// 是否已经执行刷新
-						isRefreshing = true
-						let token = getAccessToken(); // 获取到过期的token
-						try {
-							refreshToken({
-								refreshToken: getRefreshToken() // 刷新token的令牌存在token的对象里面,需要传给后端
-							}).then(reshRespore => {
-								console.log(reshRespore,
-									'reshResporereshResporereshRespore');
-								// 请求成功把新的token存到本地
-								setToken(reshRespore.data);
-								// 已经刷新了token,将所有队列中的请求进行重试
-								requests.forEach((item) => item(reshRespore.data
-									.accessToken))
-								requests = []
-								// 每个接口请求都要存入队列,等刷新完以后都需要执行
-								return new Promise((resolve) => {
-									// 将resolve放进队列,用一个函数形式来保存,等token刷新后直接执行
-									requests.push((token) => {
-										//这一步一定要有,刷新token,因为存入的信息是旧的token
-										response.config.header[
-												'Authorization'] =
-											'Bearer ' + token;
-										resolve(uni.$u.http.request(response
-											.config)) //执行请求
-
-									})
-								that.$forceUpdate()
-								})
-							})
-
-						} catch {
-							// 		uni.$u.toast('未知错误')
+					    // 正在刷新
+						isRefreshing = true;
+						return refreshToken({
+							refreshToken: getRefreshToken()
+						}).then((res) => {
+							setToken(res.data);
+							requests.forEach((wc) => wc(config));
+							requests = []
+							return 
+						}).catch(() => {
 							showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
 								if (res.confirm) {
 									uni.navigateTo({
 										url: '/pages/login'
 									})
 								}
-							});
-						} finally {
-							// 请求成功,开启刷新标识
+							})
+						}).finally(() => {
 							isRefreshing = false
-						}
-					} else {
-						showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
-							if (res.confirm) {
-								uni.navigateTo({
-									url: '/pages/login'
-								})
-							}
-						});
+						})
 					}
 				} else if (code === 500) {
 					toast(msg)