|
@@ -43,15 +43,19 @@
|
|
|
|
|
|
<!-- 设备注册列表start -->
|
|
<!-- 设备注册列表start -->
|
|
<block class="">
|
|
<block class="">
|
|
- <view class="processList deviceRegistList" style="height: calc(100vh - 470rpx);">
|
|
|
|
|
|
+ <view class="processList deviceRegistList" style="padding-bottom:150rpx;" >
|
|
<checkbox-group @change="changeCheckbox">
|
|
<checkbox-group @change="changeCheckbox">
|
|
<view class="cu-list menu-avatar ">
|
|
<view class="cu-list menu-avatar ">
|
|
<view class=" site-item text-center margin-top"
|
|
<view class=" site-item text-center margin-top"
|
|
v-if="!this.deviceManage.length&&this.deviceManageRes==1">暂无数据</view>
|
|
v-if="!this.deviceManage.length&&this.deviceManageRes==1">暂无数据</view>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
<view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''"
|
|
<view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''"
|
|
v-for="(item,index) in newDeviceManage" :key="index" :data-target="'move-box-' + index">
|
|
v-for="(item,index) in newDeviceManage" :key="index" :data-target="'move-box-' + index">
|
|
<view class="cu-form-group margin-top">
|
|
<view class="cu-form-group margin-top">
|
|
- <checkbox :value="String(item.owner_code)" :checked="checkedArr.includes(String(item.owner_code))"
|
|
|
|
|
|
+ <checkbox :value="String(item.owner_code)"
|
|
|
|
+ :checked="checkedArr.includes(String(item.owner_code))"
|
|
:class="{'checked':checkedArr.includes(String(item.owner_code))}"></checkbox>
|
|
:class="{'checked':checkedArr.includes(String(item.owner_code))}"></checkbox>
|
|
</view>
|
|
</view>
|
|
<view class="cu-avatar round lg">
|
|
<view class="cu-avatar round lg">
|
|
@@ -84,6 +88,9 @@
|
|
</view>
|
|
</view>
|
|
</view> -->
|
|
</view> -->
|
|
</view>
|
|
</view>
|
|
|
|
+ <view v-show="isLoadMore&&page>1" >
|
|
|
|
+ <uni-load-more :status="loadStatus"></uni-load-more>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</checkbox-group>
|
|
</checkbox-group>
|
|
</view>
|
|
</view>
|
|
@@ -105,12 +112,12 @@
|
|
<!-- <view @tap="showModal" data-target="DialogModal">
|
|
<!-- <view @tap="showModal" data-target="DialogModal">
|
|
导出
|
|
导出
|
|
</view> -->
|
|
</view> -->
|
|
-
|
|
|
|
|
|
+
|
|
<view @tap="exportButton()" data-target="DialogModal">
|
|
<view @tap="exportButton()" data-target="DialogModal">
|
|
导出
|
|
导出
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
</view>
|
|
</view>
|
|
<view class="checkAll" style="display:inline-block">
|
|
<view class="checkAll" style="display:inline-block">
|
|
<checkbox-group @change="allChoose" v-if="deviceManage.length">
|
|
<checkbox-group @change="allChoose" v-if="deviceManage.length">
|
|
@@ -218,6 +225,14 @@
|
|
"单元地址": "unitinfo",
|
|
"单元地址": "unitinfo",
|
|
"创建时间": "install_time",
|
|
"创建时间": "install_time",
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ page: 1,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
|
|
|
|
+ isLoadMore: false, //是否加载中
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -242,16 +257,34 @@
|
|
},
|
|
},
|
|
onShow: function(option) {
|
|
onShow: function(option) {
|
|
this.getDataList({
|
|
this.getDataList({
|
|
- 'company_code': uni.getStorageSync('selectedCode')
|
|
|
|
|
|
+ 'company_code': uni.getStorageSync('selectedCode'),
|
|
|
|
+ "page": this.page,
|
|
|
|
+ "pageSize": this.pageSize,
|
|
|
|
+ "transmission_mode": this.transmission_mode,
|
|
|
|
+ "dwtype": this.dwtype,
|
|
})
|
|
})
|
|
- },
|
|
|
|
- onLoad: function(option) {
|
|
|
|
- this.getDataList({
|
|
|
|
- 'company_code': uni.getStorageSync('selectedCode')
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ onReachBottom() { //上拉触底函数
|
|
|
|
+ if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
|
|
|
|
+ this.isLoadMore = true
|
|
|
|
+ this.page += 1
|
|
|
|
+ this.getDataList({
|
|
|
|
+ 'company_code': uni.getStorageSync('selectedCode'),
|
|
|
|
+ "page": this.page,
|
|
|
|
+ "pageSize": this.pageSize,
|
|
|
|
+ "transmission_mode": this.transmission_mode,
|
|
|
|
+ "dwtype": this.dwtype,
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ // alert(this.page)
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
methods: {
|
|
methods: {
|
|
-
|
|
|
|
|
|
+
|
|
exportButton() {
|
|
exportButton() {
|
|
if (this.checkedArr.length == 0) {
|
|
if (this.checkedArr.length == 0) {
|
|
uni.showModal({
|
|
uni.showModal({
|
|
@@ -259,24 +292,24 @@
|
|
content: '请选择至少一条需要导出的数据'
|
|
content: '请选择至少一条需要导出的数据'
|
|
});
|
|
});
|
|
return;
|
|
return;
|
|
- }
|
|
|
|
|
|
+ }
|
|
let aa;
|
|
let aa;
|
|
let bb;
|
|
let bb;
|
|
- if(this.allChecked==true){
|
|
|
|
|
|
+ if (this.allChecked == true) {
|
|
alert('全选');
|
|
alert('全选');
|
|
- aa='status';
|
|
|
|
- bb=1
|
|
|
|
- }else{
|
|
|
|
|
|
+ aa = 'status';
|
|
|
|
+ bb = 1
|
|
|
|
+ } else {
|
|
alert('非全选')
|
|
alert('非全选')
|
|
- aa='device_code_list';
|
|
|
|
- bb=this.checkedArr.join(",")
|
|
|
|
- alert(bb)
|
|
|
|
|
|
+ aa = 'device_code_list';
|
|
|
|
+ bb = this.checkedArr.join(",")
|
|
|
|
+ alert(bb)
|
|
}
|
|
}
|
|
|
|
|
|
- let exportUrl = this.$BASE_URL+
|
|
|
|
- `ExportModule/getDeviceConfigListExpor/transmission_mode/${this.transmission_mode1}/${aa}/${bb}/dwtype/${this.dwtype1}/company_code/${uni.getStorageSync('selectedCode')}/`
|
|
|
|
- alert(exportUrl)
|
|
|
|
-
|
|
|
|
|
|
+ let exportUrl = this.$BASE_URL +
|
|
|
|
+ `ExportModule/getDeviceConfigListExpor/transmission_mode/${this.transmission_mode1}/${aa}/${bb}/dwtype/${this.dwtype1}/company_code/${uni.getStorageSync('selectedCode')}/`
|
|
|
|
+ alert(exportUrl)
|
|
|
|
+
|
|
var ua = window.navigator.userAgent.toLowerCase();
|
|
var ua = window.navigator.userAgent.toLowerCase();
|
|
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
|
|
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
|
|
uni.showModal({
|
|
uni.showModal({
|
|
@@ -289,22 +322,27 @@
|
|
} else {
|
|
} else {
|
|
window.location.href = exportUrl;
|
|
window.location.href = exportUrl;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
//筛选请求
|
|
//筛选请求
|
|
searchList() {
|
|
searchList() {
|
|
|
|
+ this.deviceManage=[],
|
|
|
|
+ this.page=1,
|
|
this.getDataList({
|
|
this.getDataList({
|
|
"transmission_mode": this.transmission_mode,
|
|
"transmission_mode": this.transmission_mode,
|
|
"dwtype": this.dwtype,
|
|
"dwtype": this.dwtype,
|
|
- 'company_code': uni.getStorageSync('selectedCode')
|
|
|
|
|
|
+ 'company_code': uni.getStorageSync('selectedCode'),
|
|
|
|
+ "page": this.page,
|
|
|
|
+ "pageSize": this.pageSize,
|
|
})
|
|
})
|
|
- this.transmission_mode1=this.transmission_mode;
|
|
|
|
- this.dwtype1=this.dwtype;
|
|
|
|
|
|
+
|
|
|
|
+ this.transmission_mode1 = this.transmission_mode;
|
|
|
|
+ this.dwtype1 = this.dwtype;
|
|
},
|
|
},
|
|
|
|
|
|
// 列表数据请求
|
|
// 列表数据请求
|
|
@@ -314,8 +352,25 @@
|
|
data: params,
|
|
data: params,
|
|
showLoading: true
|
|
showLoading: true
|
|
})
|
|
})
|
|
- this.deviceManage = res.data.data;
|
|
|
|
this.deviceManageRes = 1;
|
|
this.deviceManageRes = 1;
|
|
|
|
+
|
|
|
|
+ if (res.data.data.length) {
|
|
|
|
+
|
|
|
|
+ this.deviceManage = this.deviceManage.concat(res.data.data)
|
|
|
|
+
|
|
|
|
+ if (res.data.data.length < this.pageSize) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
|
|
|
+ this.isLoadMore = true
|
|
|
|
+ this.loadStatus = 'nomore'
|
|
|
|
+ } else {
|
|
|
|
+ this.isLoadMore = false
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.isLoadMore = true
|
|
|
|
+ this.loadStatus = 'nomore'
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
},
|
|
},
|
|
|
|
|
|
// 页面跳转
|
|
// 页面跳转
|
|
@@ -460,7 +515,7 @@
|
|
changeCheckbox(e) {
|
|
changeCheckbox(e) {
|
|
console.log(e.detail.value)
|
|
console.log(e.detail.value)
|
|
this.checkedArr = e.detail.value;
|
|
this.checkedArr = e.detail.value;
|
|
-
|
|
|
|
|
|
+
|
|
// 如果选择的数组中有值,并且长度等于列表的长度,就是全选
|
|
// 如果选择的数组中有值,并且长度等于列表的长度,就是全选
|
|
if (this.checkedArr.length > 0 && this.checkedArr.length == this.newDeviceManage.length) {
|
|
if (this.checkedArr.length > 0 && this.checkedArr.length == this.newDeviceManage.length) {
|
|
this.allChecked = true;
|
|
this.allChecked = true;
|
|
@@ -471,11 +526,11 @@
|
|
// 全选事件
|
|
// 全选事件
|
|
allChoose(e) {
|
|
allChoose(e) {
|
|
let chooseItem = e.detail.value;
|
|
let chooseItem = e.detail.value;
|
|
-
|
|
|
|
|
|
+
|
|
// 全选
|
|
// 全选
|
|
if (chooseItem[0] == 'all') {
|
|
if (chooseItem[0] == 'all') {
|
|
this.allChecked = true;
|
|
this.allChecked = true;
|
|
-
|
|
|
|
|
|
+
|
|
for (let item of this.newDeviceManage) {
|
|
for (let item of this.newDeviceManage) {
|
|
let itemVal = String(item.owner_code);
|
|
let itemVal = String(item.owner_code);
|
|
if (!this.checkedArr.includes(itemVal)) {
|
|
if (!this.checkedArr.includes(itemVal)) {
|
|
@@ -495,7 +550,6 @@
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style>
|
|
<style>
|
|
-
|
|
|
|
.showDetailEdit {
|
|
.showDetailEdit {
|
|
position: absolute;
|
|
position: absolute;
|
|
background: #fff;
|
|
background: #fff;
|