|
@@ -8,8 +8,8 @@
|
|
|
<!-- 设备注册列表start -->
|
|
|
<block class="">
|
|
|
<view class="processList deviceRegistList" style="height: calc(100vh - 241px);">
|
|
|
- <checkbox-group @change="changeCheckbox">
|
|
|
- <view class="cu-list menu-avatar ">
|
|
|
+ <checkbox-group @change="changeCheckbox">
|
|
|
+ <view class="cu-list menu-avatar ">
|
|
|
<view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''"
|
|
|
v-for="(item,index) in newDeviceManage" :key="index" :data-target="'move-box-' + index">
|
|
|
<view class="cu-form-group margin-top">
|
|
@@ -31,7 +31,7 @@
|
|
|
|
|
|
<view class="showDetail" v-if="item.isShow">
|
|
|
<view @tap="goDeviceEdit(item)">修改设备</view>
|
|
|
- <view @tap="deleteItem2" data-target="DialogModal2" :data-id='item.id'>删除设备</view>
|
|
|
+ <view @tap="deleteItem2" data-target="DialogModal2" :data-id='item.id' :data-index='index'>删除设备</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="nav-right num">
|
|
@@ -43,7 +43,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </view>
|
|
|
</checkbox-group>
|
|
|
</view>
|
|
|
</block>
|
|
@@ -57,7 +57,7 @@
|
|
|
</view>
|
|
|
<view class="share-item text-center">
|
|
|
<view><text class="icon iconfont margin-xs" style="color:#FF0303"></text></view>
|
|
|
- <view @tap="deleteItem;pindex=index" data-target="DialogModal2">删除</view>
|
|
|
+ <view @tap="deleteItem" data-target="DialogModal2">删除</view>
|
|
|
</view>
|
|
|
<view class="share-item text-center">
|
|
|
<view><text class="icon iconfont margin-xs" style="color:#FF642E"></text></view>
|
|
@@ -77,7 +77,7 @@
|
|
|
<!-- 分享区域 end-->
|
|
|
|
|
|
<!-- 导出弹框 -->
|
|
|
- <export-modal :modalName='modalName' @fatherHideModal="hideModal()"></export-modal>
|
|
|
+ <export-modal :modalName='modalName' @fatherHideModal="hideModal()"></export-modal>
|
|
|
<!-- 导出弹框 end -->
|
|
|
|
|
|
<!-- 删除弹框 -->
|
|
@@ -90,7 +90,8 @@
|
|
|
</view>
|
|
|
<view class="padding-sm bg-white">
|
|
|
<image src="../../static/chart3-2.png" style="width:100rpx;height:100rpx"></image>
|
|
|
- <view style="margin:20rpx 0">确定删除该设备吗?</view>
|
|
|
+ <view style="margin:20rpx 0" v-if="checkedArr.length>1">确定删除这些设备吗?</view>
|
|
|
+ <view style="margin:20rpx 0" v-else>确定删除该设备吗?</view>
|
|
|
</view>
|
|
|
<view class="cu-bar operate bg-white" style="min-height: 100rpx;">
|
|
|
<view class="action margin-0 " @tap="hideModal">
|
|
@@ -134,7 +135,9 @@
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
- validCode,searchArea,exportModal
|
|
|
+ validCode,
|
|
|
+ searchArea,
|
|
|
+ exportModal
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -147,14 +150,15 @@
|
|
|
|
|
|
deviceManage: json.deviceManage,
|
|
|
siteListRes: 0,
|
|
|
-
|
|
|
+
|
|
|
type: '0',
|
|
|
siteListData: [],
|
|
|
modalName: null,
|
|
|
listTouchStart: 0,
|
|
|
listTouchDirection: null,
|
|
|
CustomBar: this.CustomBar,
|
|
|
-
|
|
|
+
|
|
|
+ deleteIndex:'',
|
|
|
deleteId:'',
|
|
|
|
|
|
|
|
@@ -190,6 +194,7 @@
|
|
|
this.deviceManage.forEach(item => {
|
|
|
item.isShow = false
|
|
|
})
|
|
|
+
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -203,65 +208,66 @@
|
|
|
},
|
|
|
goDeviceEdit(item) {
|
|
|
uni.navigateTo({
|
|
|
- url: '/pages/deviceManage/deviceEdit/deviceEdit?type='+item.id+'',
|
|
|
+ url: '/pages/deviceManage/deviceEdit/deviceEdit?type=' + item.id + '',
|
|
|
});
|
|
|
},
|
|
|
//导出弹框
|
|
|
showModal(e) {
|
|
|
// alert(1)
|
|
|
- if(this.checkedArr.length==0){
|
|
|
+ if (this.checkedArr.length == 0) {
|
|
|
alert('请选择至少一条需要导出的数据')
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.modalName = e.currentTarget.dataset.target
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
//关闭弹框
|
|
|
hideModal(e) {
|
|
|
this.modalName = null
|
|
|
},
|
|
|
+
|
|
|
//删除弹出框操作
|
|
|
deleteItem(e) {
|
|
|
- if(this.checkedArr.length==0){
|
|
|
+ if (this.checkedArr.length == 0) {
|
|
|
alert('请选择至少一条需要删除的数据')
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.modalName = e.currentTarget.dataset.target;
|
|
|
}
|
|
|
},
|
|
|
deleteItem2(e) {
|
|
|
- this.deleteId=e.target.dataset.id;
|
|
|
- console.log('e.target.dataset');
|
|
|
- console.log(e.target.dataset);
|
|
|
- console.log(e.target.dataset.id);
|
|
|
+ this.checkedArr.push(e.target.dataset.id);
|
|
|
+ this.deleteIndex=e.target.dataset.index;
|
|
|
+ console.log('this.checkedArr 单个点击删除按钮 存入要删除的索引')
|
|
|
+ console.log(this.checkedArr)
|
|
|
this.modalName = e.currentTarget.dataset.target;
|
|
|
- // this.todos.splice(index, 1);
|
|
|
},
|
|
|
- confirmDelete(){
|
|
|
- // alert(this.deleteId)
|
|
|
-
|
|
|
- // alert(this.pindex)
|
|
|
- // this.deviceManage.splice(this.deleteId,1);
|
|
|
- var arr=["1"]
|
|
|
-
|
|
|
-// this.deviceManage = this.deviceManage.filter((item) => !arr.includes(item.id));
|
|
|
-this.deviceManage.filter((item) => !arr.includes(item.id));
|
|
|
-console.log(this.deviceManage)
|
|
|
+ confirmDelete() {
|
|
|
+ // alert(this.deleteIndex)
|
|
|
+ // this.deviceManage.splice(this.deleteIndex,1);
|
|
|
|
|
|
+ this.deviceManage = this.deviceManage.filter((item) => !this.checkedArr.includes(item.id));
|
|
|
+ console.log('this.deviceManage')
|
|
|
+ console.log(this.deviceManage)
|
|
|
+ this.modalName = null
|
|
|
},
|
|
|
//再次确认弹框
|
|
|
openConfirmModal(e) {
|
|
|
this.modalName = e.currentTarget.dataset.target;
|
|
|
-
|
|
|
},
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
// 隐藏显示
|
|
|
showDetail(e) {
|
|
|
// console.log('e')
|
|
|
// console.log(e)
|
|
|
// 存储点击那一项的状态
|
|
|
const nowStatu = e.isShow;
|
|
|
+
|
|
|
+ //判断如果长摁弹框出来时,情况选中状态 ???
|
|
|
+ if(!nowStatu){
|
|
|
+ this.checkedArr=[];
|
|
|
+ this.allChecked = false;
|
|
|
+ }
|
|
|
// 将每一项列表的isShow设置为false,让所有的列表都隐藏
|
|
|
this.deviceManage.forEach(item => {
|
|
|
item.isShow = false
|
|
@@ -269,8 +275,8 @@ console.log(this.deviceManage)
|
|
|
// 用于再次点击该项的取反
|
|
|
e.isShow = !nowStatu
|
|
|
},
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
// 多选复选框改变事件
|
|
|
changeCheckbox(e) {
|
|
|
this.checkedArr = e.detail.value;
|