瀏覽代碼

测报灯 害虫分析 图片列表增加模型切换

zhangsijie 1 年之前
父節點
當前提交
5323aedd67
共有 2 個文件被更改,包括 112 次插入18 次删除
  1. 32 4
      pages/cb/cbd/equip-set/analyse.vue
  2. 80 14
      pages/cb/cbd/equip-set/imgpage.vue

+ 32 - 4
pages/cb/cbd/equip-set/analyse.vue

@@ -2,6 +2,15 @@
 	<view class="anabox">
 		<view class="timebox">
 			<view class="schedulebox">
+				<view class="schedule" @click="modelPicker=!modelPicker">
+					<p class="schedule_value">{{modelList[identify_model].label}}</p>
+					<!-- {{titletext[indexone]}} -->
+					<p class="schedule_icon">
+						<u-icon name="arrow-down"></u-icon>
+					</p>
+				</view>
+				<u-select v-model="modelPicker" mode="single-column" @confirm="confirmModel" :default-value="[identify_model]"
+					:list="modelList"></u-select>
 				<view class="schedule" @click="pickertfone=!pickertfone">
 					<p class="schedule_value">{{yservalue}}</p>
 					<!-- {{titletext[indexone]}} -->
@@ -141,6 +150,15 @@
 	export default {
 		data() {
 			return {
+				modelPicker: false,
+				identify_model: 1,
+				modelList:[{
+					value: 'A',
+					label: '模型A'
+				},{
+					value: 'B',
+					label: '模型B'
+				}],
 				d_id: "",
 				oldtime: "",
 				newtime: "",
@@ -389,6 +407,16 @@
 			}
 		},
 		methods: {
+			// 切换模型
+			confirmModel(e) {
+				this.modelList.forEach((item, index) => {
+					if(e[0].value == item.value) {
+						this.identify_model = index;
+					}
+				})
+				this.getyear()
+				// console.log(e)
+			},
 			getyear() {
 				var Year = new Date().getFullYear();
 				var num = Year - 2019;
@@ -404,7 +432,7 @@
 					url: '/api/api_gateway?method=forecast.worm_lamp.pest_raise_info',
 					data: {
 						d_ids: this.d_id,
-						identify_model: 'A',
+						identify_model: this.modelList[this.identify_model].value,
 						year: this.yservalue,
 					}
 				})
@@ -445,7 +473,7 @@
 					url: '/api/api_gateway?method=forecast.worm_lamp.pest_statistics_char_new',
 					data: {
 						d_ids: this.d_id,
-						identify_model: 'A',
+						identify_model: this.modelList[this.identify_model].value,
 						start_time: this.oldtime,
 						end_time: this.newtime,
 						sp_hour_st: this.sp_hour_st,
@@ -706,7 +734,7 @@
 					url: '/api/api_gateway?method=forecast.worm_lamp.pest_image_source',
 					data: {
 						d_ids: this.d_id,
-						identify_model: 'A',
+						identify_model: this.modelList[this.identify_model].value,
 						start_time: this.oldtime,
 						end_time: this.newtime,
 						sp_hour_st: this.sp_hour_st,
@@ -728,7 +756,7 @@
 					url: '/api/api_gateway?method=forecast.worm_lamp.pest_base_data',
 					data: {
 						d_ids: this.d_id,
-						identify_model: 'A',
+						identify_model: this.modelList[this.identify_model].value,
 						start_time: this.oldtime,
 						end_time: this.newtime,
 						page: this.page

+ 80 - 14
pages/cb/cbd/equip-set/imgpage.vue

@@ -7,6 +7,15 @@
 					@clickRight="clickRight"></uni-nav-bar>
 			</view>
 			<p class="tishi" v-if="tishi">暂无数据</p>
+			<u-select v-model="modelPicker" mode="single-column" @confirm="confirmModel"
+				:default-value="[identify_model]" :list="modelList"></u-select>
+			<view class="schedule" @click="modelPicker=!modelPicker">
+				<p class="schedule_value">{{modelList[identify_model].label}}</p>
+				<!-- {{titletext[indexone]}} -->
+				<p class="schedule_icon">
+					<u-icon name="arrow-down"></u-icon>
+				</p>
+			</view>
 			<view class="selecttimes" @click="tiemshow=!tiemshow">
 				<view class="timesbox">
 					<image
@@ -30,8 +39,7 @@
 						<view class="icon_box" @click="delimg(item.id)">
 							<p class="iconfont icon-shanchu">删除</p>
 						</view>
-						<view class="icon_box" @click="shibie(item.id,item.addr)"
-							v-if="disable==1 && device_type!=7">
+						<view class="icon_box" @click="shibie(item.id,item.addr)" v-if="disable==1 && device_type!=7">
 							<p class="iconfont icon-shibie">识别</p>
 						</view>
 						<view class="icon_box" v-else-if="disable==2 && device_type!=7">
@@ -53,6 +61,15 @@
 	export default {
 		data() {
 			return {
+				modelPicker: false,
+				identify_model: 1,
+				modelList: [{
+					value: 'A',
+					label: '模型A'
+				}, {
+					value: 'B',
+					label: '模型B'
+				}],
 				page: 1,
 				imglists: [],
 				tishi: true,
@@ -77,18 +94,31 @@
 				tiemshow: false, //时间选择器
 				disable: "",
 				device_type: "",
-				myuid:""
+				myuid: ""
 			}
 		},
 		methods: {
+			// 切换模型
+			confirmModel(e) {
+				this.modelList.forEach((item, index) => {
+					if (e[0].value == item.value) {
+						this.identify_model = index;
+					}
+				})
+				this.imglists=[];
+				this.imglistdata(parseInt(this.timestate), parseInt(this.timeend))
+				// console.log(e)
+			},
 			//forecast.forecast_system.equip_photofo
 			async imglistdata(time_begin, time_end) { //获取图片列表
 				const res = await this.$myRequest({
-					url: '/api/api_gateway?method=forecast.forecast_system.equip_photo',
+					url: '/api/api_gateway?method=forecast.forecast_system.device_photo_list',
 					data: {
 						device_id: this.device_id,
 						page: this.page,
-						ret: "list",
+						status: "no",
+						page_number: 12,
+						identify_model: this.modelList[this.identify_model].value,
 						time_begin: time_begin, //开始时间
 						time_end: time_end, //结束时间
 					}
@@ -234,8 +264,8 @@
 		},
 		onLoad(option) {
 			uni.getStorage({
-				key:"myuid",
-				success:(res)=> {
+				key: "myuid",
+				success: (res) => {
 					this.myuid = res.data
 					console.log(this.myuid)
 				}
@@ -272,26 +302,62 @@
 <style lang="scss">
 	.tishi {
 		position: absolute;
-		top: 104px;
+		top: 114px;
 		width: 95%;
 		left: 2.5%;
 		text-align: center;
 		font-size: 40rpx;
 	}
 
+	.schedule {
+		position: fixed;
+		top: 85px;
+		left: 10rpx;
+		padding: 5rpx 0;
+		// left: 50%;
+		// transform: translateX(-50%);
+		z-index: 100;
+		display: flex;
+		width: 220rpx;
+		margin: 0 auto;
+		height: 50rpx;
+		// border: 2rpx solid #F0F0F0;
+		background-color: #Fff;
+		// border-radius: 25px;
+		box-shadow: 0 0 10rpx #bcb9ca;
+
+		.schedule_value {
+			width: 70%;
+			text-align: center;
+			line-height: 50rpx;
+			font-size: 24rpx;
+		}
+
+		.schedule_icon {
+			width: 30%;
+			// background-color: #F2F2F2;
+			text-align: center;
+			line-height: 50rpx;
+
+			/deep/.u-icon__icon {
+				color: rgba(0, 0, 0, 0.3);
+			}
+		}
+	}
+
 	.selecttimes {
-		width: 100%;
+		width: 65%;
 		position: fixed;
 		top: 85px;
-		left: 0;
+		right: 10rpx;
 		z-index: 100;
 		background-color: #fff;
-		padding-top: 30rpx;
+		// padding-top: 30rpx;
 
 		.timesbox {
 			display: flex;
-			width: 95%;
-			margin: 0 auto;
+			width: 100%;
+			// margin: 0 auto;
 			justify-content: space-around;
 			box-shadow: 0 0 10rpx #bcb9ca;
 			padding: 10rpx 20rpx;
@@ -430,4 +496,4 @@
 			height: 100rpx;
 		}
 	}
-</style>
+</style>