Ming 4 yıl önce
ebeveyn
işleme
acbc6eb29b

+ 12 - 5
pages/deviceManage/component/exportModal.vue

@@ -12,9 +12,9 @@
 				<view style="margin:20rpx 0">已导出文件,是否打开?</view>
 			</view>
 			<view class="cu-bar operate bg-white" style="min-height: 100rpx;">
-				<view class="action margin-0   " @tap="hideModal2">
+				<view class="action margin-0   " @tap="saveAs">
 					另存为</view>
-				<view class="action margin-0  solid-left text-blue" @tap="hideModal2">打开</view>
+				<view class="action margin-0  solid-left text-blue" @tap="cancel">取消</view>
 			</view>
 		</view>
 	</view>
@@ -29,9 +29,16 @@
 			}
 		},
 		methods: {
-			hideModal2() {
-			        this.$emit('fatherHideModal');
-			      }
+			saveAs() {
+				// alert(1)
+			        // this.$emit('fatherHideModal');
+					this.$emit('fSaveAsData')
+			 },
+			 cancel(){
+				 alert(1)
+				  this.$emit('fatherHideModal');
+				 
+			 }
 		}
 	}
 	

+ 22 - 15
pages/deviceManage/deviceManage.vue

@@ -45,7 +45,7 @@
 			<view class="processList deviceRegistList" style="height: calc(100vh - 470rpx);">
 				<checkbox-group @change="changeCheckbox">
 					<view class="cu-list menu-avatar ">
-						<view class=" site-item text-center margin-top" v-if="!this.deviceManage.length&&this.deviceManage==1">暂无数据</view>
+						<view class=" site-item text-center margin-top" v-if="!this.deviceManage.length&&this.deviceManageRes==1">暂无数据</view>
 						<view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''"
 							v-for="(item,index) in deviceManage" :key="index" :data-target="'move-box-' + index">
 							<view class="cu-form-group margin-top">
@@ -126,7 +126,7 @@
 		<!-- 分享区域  end-->
 
 		<!-- 导出弹框 -->
-		<!-- <export-modal :modalName='modalName' @fatherHideModal="hideModal()"></export-modal> -->
+		<export-modal :modalName='modalName' @fSaveAsData="saveAsData()" @fatherHideModal="hideModal()"></export-modal>
 		<!-- 导出弹框 end -->
 
 		<!-- 删除弹框 -->
@@ -191,7 +191,6 @@
 		data() {
 			return {
 				deviceManage: 0,
-				
 				json_fields: {
 					"单位编号": "company", //常规字段
 					"状态": "device_state",
@@ -209,8 +208,7 @@
 					checked: false
 				}],
 
-				// deviceManage: json.deviceManage,
-				siteListRes: 0,
+				deviceManageRes: 0,
 
 				type: '0',
 				siteListData: [],
@@ -251,13 +249,13 @@
 		},
 
 		mounted() {
-			// document.addEventListener('click', (event) => {
-			// 	if (event.target.className != 'showDetailEdit') {
-			// 		this.deviceManage.forEach(item => {
-			// 			item.isShow = false;
-			// 		})
-			// 	}
-			// })
+			document.addEventListener('click', (event) => {
+				if (event.target.className != 'showDetailEdit') {
+					this.deviceManage.forEach(item => {
+						item.isShow = false;
+					})
+				}
+			})
 		},
 		onLoad: function(option) {
 			this.getDataList({
@@ -299,6 +297,9 @@
 			},
 			//导出弹框
 			showModal(e) {
+				console.log('e')
+				console.log(e)
+				
 				var ua = window.navigator.userAgent.toLowerCase();
 				if(ua.match(/MicroMessenger/i) == 'micromessenger'){
 					alert('点击右上角 ┇,选择默认浏览器进行导出操作')
@@ -306,10 +307,8 @@
 					if (this.checkedArr.length == 0) {
 						alert('请选择至少一条需要导出的数据')
 					} else {
-						
 						this.modalName = e.currentTarget.dataset.target;
-						
-						this.getDataExport()
+					
 					}
 				}
 				
@@ -364,8 +363,16 @@
 				link.download = "设备注册管理数据表.xls";
 				link.click();
 			},
+			
+			
+			//导出按钮另存为
+			saveAsData(e){
+				this.modalName = null
+				this.getDataExport();
+			},
 
 			//关闭弹框
+			
 			hideModal(e) {
 				this.modalName = null
 			},

+ 2 - 8
pages/index/index.vue

@@ -19,8 +19,6 @@
 		</view>
 		<!-- 下拉选择 end -->
 
-		<!-- <search-Select :flag="flag"></search-Select> -->
-
 		<!-- 图表 -->
 		<view class="section1 section bg-white padding-xs">
 			<view class=" static-tabs grid margin-bottom text-center col-3 margin-top-sm margin-bottom-sm">
@@ -61,6 +59,7 @@
 			</view>
 		</view>
 		<!-- 图表 end-->
+		
 
 		<!-- 宫格列表 -->
 		<view class="section2 section  bg-white margin-top-sm margin-bottom-sm">
@@ -76,6 +75,7 @@
 			</view>
 		</view>
 		<!-- 宫格列表 end -->
+		
 	</view>
 </template>
 
@@ -86,7 +86,6 @@
 
 	import searchSelect from './components/searchSelect/searchSelect.vue';
 
-
 	import json from '../../data/json.js';
 
 	//引入js sdk的封装
@@ -138,8 +137,6 @@
 				});
 			}
 
-
-
 			// 数据渲染
 			this.getHomeData();
 
@@ -175,9 +172,6 @@
 						}
 					});
 
-
-
-
 					// jwx.configWeiXin(jweixin => {
 					// 	wx.getLocation({
 					// 	  type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'