|
@@ -6,22 +6,29 @@
|
|
<view class="ding">
|
|
<view class="ding">
|
|
<view class="cu-bar search bg-gray filter-section" style="with:50%;">
|
|
<view class="cu-bar search bg-gray filter-section" style="with:50%;">
|
|
<view class="search-form round bg-white" >
|
|
<view class="search-form round bg-white" >
|
|
- <select name="" id="" placeholder="">
|
|
|
|
- <option value="">请选择设备类型</option>
|
|
|
|
- <option value="">类型1</option>
|
|
|
|
- <option value="">类型2</option>
|
|
|
|
|
|
+ <select name="" id="" placeholder="" v-model="dwtype">
|
|
|
|
+ <option value="0">请选择设备类型</option>
|
|
|
|
+ <option value="1">用传</option>
|
|
|
|
+ <option value="2">水表</option>
|
|
|
|
+ <option value="3">烟感</option>
|
|
|
|
+ <option value="4">消防栓</option>
|
|
|
|
+ <option value="5">液位</option>
|
|
|
|
+ <option value="6">RTU</option>
|
|
|
|
+ <option value="7">电气火灾</option>
|
|
|
|
+ <option value="16">视频监测</option>
|
|
</select>
|
|
</select>
|
|
</view>
|
|
</view>
|
|
- <view class="search-form round bg-white">
|
|
|
|
- <input type="text"
|
|
|
|
- placeholder="选输入设备点位" confirm-type="search"></input>
|
|
|
|
- </view>
|
|
|
|
|
|
+
|
|
</view>
|
|
</view>
|
|
|
|
|
|
<view class="cu-bar search bg-gray filter-section">
|
|
<view class="cu-bar search bg-gray filter-section">
|
|
<view class="search-form round bg-white" style="margin-bottom:26rpx">
|
|
<view class="search-form round bg-white" style="margin-bottom:26rpx">
|
|
- <input class="" @focus="InputFocus" v-model="siteName" @blur="InputBlur" :adjust-position="false" type="text"
|
|
|
|
- placeholder="选择传输方式" confirm-type="search"></input>
|
|
|
|
|
|
+ <select name="" id="" placeholder="" v-model=" transfer_type">
|
|
|
|
+ <option value="0">请选择传输方式</option>
|
|
|
|
+ <option value="NB">NB</option>
|
|
|
|
+ <option value="4G">4G</option>
|
|
|
|
+ <option value="Lora">Lora</option>
|
|
|
|
+ </select>
|
|
</view>
|
|
</view>
|
|
<view class="action">
|
|
<view class="action">
|
|
<button class="cu-btn bg-blue round" @click="searchData()">查询</button>
|
|
<button class="cu-btn bg-blue round" @click="searchData()">查询</button>
|
|
@@ -39,14 +46,14 @@
|
|
<view class="cu-avatar lg" style="background-image:url(../../static/device-icon.png);"></view>
|
|
<view class="cu-avatar lg" style="background-image:url(../../static/device-icon.png);"></view>
|
|
<view class="content">
|
|
<view class="content">
|
|
<view class="pro-title">
|
|
<view class="pro-title">
|
|
- <view class="cut">{{item.title}}</view>
|
|
|
|
|
|
+ <view class="cut">{{item.owner_name}}</view>
|
|
</view>
|
|
</view>
|
|
<view class="pro-des ">
|
|
<view class="pro-des ">
|
|
<view class="text-cut">
|
|
<view class="text-cut">
|
|
- {{item.subTitle}}
|
|
|
|
|
|
+ {{item.unitinfo}}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view class="pro-date ">{{item.time}}</view>
|
|
|
|
|
|
+ <view class="pro-date ">{{item.install_time}}</view>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
</view>
|
|
</view>
|
|
@@ -65,7 +72,15 @@
|
|
|
|
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
- return {
|
|
|
|
|
|
+ return {
|
|
|
|
+
|
|
|
|
+ dwtype: 0,
|
|
|
|
+ transfer_type: 0,
|
|
|
|
+
|
|
|
|
+ dwtype1: 0,
|
|
|
|
+ transfer_type1: 0,
|
|
|
|
+
|
|
|
|
+ status_type:0,
|
|
deviceOffLineData:json.deviceOffLineData,
|
|
deviceOffLineData:json.deviceOffLineData,
|
|
siteListRes: 0,
|
|
siteListRes: 0,
|
|
siteName: '',
|
|
siteName: '',
|
|
@@ -80,10 +95,7 @@
|
|
|
|
|
|
|
|
|
|
onPullDownRefresh() {
|
|
onPullDownRefresh() {
|
|
- console.log('refresh');
|
|
|
|
- setTimeout(function() {
|
|
|
|
- uni.stopPullDownRefresh();
|
|
|
|
- }, 1000);
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
newSiteListData() {
|
|
newSiteListData() {
|
|
@@ -105,46 +117,113 @@
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- onLoad() {
|
|
|
|
- this.getSiteList()
|
|
|
|
|
|
+ onLoad(option) {
|
|
|
|
+ this.status_type=option.status_type;
|
|
|
|
+ this.getSiteList({"status_type":option.status_type,"company_code ":uni.getStorageSync('selectedCode')});
|
|
|
|
+
|
|
|
|
+ let url = "";
|
|
|
|
+ switch (parseInt(option.status_type)) {
|
|
|
|
+ case 1:
|
|
|
|
+ url = "离线"
|
|
|
|
+ break;
|
|
|
|
+ case 2:
|
|
|
|
+ url = "在线"
|
|
|
|
+ break;
|
|
|
|
+
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ uni.setNavigationBarTitle({
|
|
|
|
+ title: url+"设备",
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 自定义导航事件
|
|
|
|
+ onNavigationBarButtonTap(e) {
|
|
|
|
+ if (e.float == 'right') {
|
|
|
|
+ alert("你点击了导出");
|
|
|
|
+
|
|
|
|
+ this.exportData({
|
|
|
|
+ "status_type":this.status_type,
|
|
|
|
+ "transfer_type":this. transfer_type1,
|
|
|
|
+ dwtype:this.dwtype1,
|
|
|
|
+ company_code:uni.getStorageSync('selectedCode')
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ let exportUrl= this.$BASE_URL+`ExportModule/getStatusDetailsListExpor/status_type/${this.status_type}/company_code/${uni.getStorageSync('selectedCode')}/ transfer_type/${this. transfer_type1}/dwtype/${this.dwtype1}/`
|
|
|
|
+
|
|
|
|
+ //#ifdef H5
|
|
|
|
+
|
|
|
|
+ // window.open(URL,name,features,replace)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // 通过创建a标签实现
|
|
|
|
+ const link = document.createElement("a");
|
|
|
|
+ link.href = exportUrl;
|
|
|
|
+ // 对下载的文件命名
|
|
|
|
+ // link.open = "设备注册管理数据表.xls";
|
|
|
|
+ link.target="_blank"
|
|
|
|
+ console.log(link)
|
|
|
|
+ link.click();
|
|
|
|
+
|
|
|
|
+ // window.open(exportUrl,true)
|
|
|
|
+ //#endif
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
searchData() {
|
|
searchData() {
|
|
this.getSiteList({
|
|
this.getSiteList({
|
|
- "siteName": this.siteName
|
|
|
|
|
|
+ " transfer_type": this. transfer_type,
|
|
|
|
+ "dwtype": this.dwtype,
|
|
|
|
+ 'company_code': uni.getStorageSync('selectedCode'),
|
|
|
|
+ "status_type":this.status_type
|
|
})
|
|
})
|
|
|
|
+ this. transfer_type1=this. transfer_type;
|
|
|
|
+ this.dwtype1=this.dwtype;
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
- async getSiteList(ming) {
|
|
|
|
|
|
+ async getSiteList(params) {
|
|
const res = await this.$myRequest({
|
|
const res = await this.$myRequest({
|
|
- url: 'OperationMonitoring/getSiteList',
|
|
|
|
|
|
+ url: 'StatusDetails/getStatusDetailsList',
|
|
showLoading: true,
|
|
showLoading: true,
|
|
- data: ming
|
|
|
|
|
|
+ data: params
|
|
})
|
|
})
|
|
this.siteListRes = 1;
|
|
this.siteListRes = 1;
|
|
console.log(res.data.data)
|
|
console.log(res.data.data)
|
|
- this.siteListData = res.data.data
|
|
|
|
|
|
+ this.deviceOffLineData = res.data.data
|
|
},
|
|
},
|
|
-
|
|
|
|
-
|
|
|
|
- // 隐藏显示
|
|
|
|
- showDetail(e) {
|
|
|
|
- // 存储点击那一项的状态
|
|
|
|
- const nowStatu = e.isShow;
|
|
|
|
- // 将每一项列表的isShow设置为false,让所有的列表都隐藏
|
|
|
|
- this.siteListData.forEach(item => {
|
|
|
|
- item.isShow = false
|
|
|
|
|
|
+
|
|
|
|
+ // 导出
|
|
|
|
+ async exportData(params) {
|
|
|
|
+ const res = await this.$myRequest({
|
|
|
|
+ url: 'ExportModule/getStatusDetailsListExpor',
|
|
|
|
+ // showLoading: true,
|
|
|
|
+ responseType: 'blob',
|
|
|
|
+ data: params
|
|
})
|
|
})
|
|
- // 用于再次点击该项的取反
|
|
|
|
- e.isShow = !nowStatu
|
|
|
|
- },
|
|
|
|
- InputFocus(e) {
|
|
|
|
- this.InputBottom = e.detail.height
|
|
|
|
- },
|
|
|
|
- InputBlur(e) {
|
|
|
|
- this.InputBottom = 0
|
|
|
|
|
|
+ console.log(res);
|
|
|
|
+ const blob = new Blob([res.data], { type: 'application/vnd.ms-excel' });
|
|
|
|
+
|
|
|
|
+ let url = window.URL.createObjectURL(blob);
|
|
|
|
+ let aLink = document.createElement('a');
|
|
|
|
+ aLink.style.display = 'none';
|
|
|
|
+ aLink.href = url;
|
|
|
|
+ aLink.target="_blank";
|
|
|
|
+ // aLink.setAttribute('download', res.headers['content-disposition'].split('=')[1]);
|
|
|
|
+ document.body.appendChild(aLink);
|
|
|
|
+ aLink.click();
|
|
|
|
+ document.body.removeChild(aLink); // 下载完成移除元素
|
|
|
|
+ window.URL.revokeObjectURL(url); // 释放掉blob对象
|
|
|
|
+
|
|
|
|
+
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|