|
@@ -3,12 +3,12 @@
|
|
|
|
|
|
<!-- 筛选框start -->
|
|
<!-- 筛选框start -->
|
|
<view>
|
|
<view>
|
|
-
|
|
|
|
|
|
+
|
|
<view style="height:206rpx"></view>
|
|
<view style="height:206rpx"></view>
|
|
<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="">
|
|
|
|
|
|
+ <select name="" id="" placeholder="" v-model="dwtype">
|
|
<option value="0">请选择设备类型</option>
|
|
<option value="0">请选择设备类型</option>
|
|
<option value="1">用传</option>
|
|
<option value="1">用传</option>
|
|
<option value="2">水表</option>
|
|
<option value="2">水表</option>
|
|
@@ -21,10 +21,10 @@
|
|
</select>
|
|
</select>
|
|
</view>
|
|
</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">
|
|
- <select name="" id="" placeholder="">
|
|
|
|
|
|
+ <select name="" id="" placeholder="" v-model="transmission_mode">
|
|
<option value="0">请选择传输方式</option>
|
|
<option value="0">请选择传输方式</option>
|
|
<option value="NB">NB</option>
|
|
<option value="NB">NB</option>
|
|
<option value="4G">4G</option>
|
|
<option value="4G">4G</option>
|
|
@@ -32,11 +32,11 @@
|
|
</select>
|
|
</select>
|
|
</view>
|
|
</view>
|
|
<view class="action">
|
|
<view class="action">
|
|
- <button class="cu-btn bg-blue round">查询</button>
|
|
|
|
|
|
+ <button class="cu-btn bg-blue round" @click="searchList">查询</button>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
|
|
+
|
|
</view>
|
|
</view>
|
|
<!-- 筛选框end -->
|
|
<!-- 筛选框end -->
|
|
|
|
|
|
@@ -45,6 +45,7 @@
|
|
<view class="processList deviceRegistList" style="height: calc(100vh - 470rpx);">
|
|
<view class="processList deviceRegistList" style="height: calc(100vh - 470rpx);">
|
|
<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" v-if="!deviceManage.length" >暂无结果</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 deviceManage" :key="index" :data-target="'move-box-' + index">
|
|
v-for="(item,index) in deviceManage" :key="index" :data-target="'move-box-' + index">
|
|
<view class="cu-form-group margin-top">
|
|
<view class="cu-form-group margin-top">
|
|
@@ -53,7 +54,7 @@
|
|
</view>
|
|
</view>
|
|
<view class="cu-avatar round lg" style="background-image:url(../../static/device-icon.png)">
|
|
<view class="cu-avatar round lg" style="background-image:url(../../static/device-icon.png)">
|
|
</view>
|
|
</view>
|
|
- <view class="content" @longpress="showDetail(item)">
|
|
|
|
|
|
+ <view class="content" @longpress="showDetail(item)" >
|
|
<view class="pro-title">
|
|
<view class="pro-title">
|
|
<view class="cut">{{item.owner_name}}</view>
|
|
<view class="cut">{{item.owner_name}}</view>
|
|
</view>
|
|
</view>
|
|
@@ -64,10 +65,14 @@
|
|
</view>
|
|
</view>
|
|
<view class="pro-date ">{{item.install_time}}</view>
|
|
<view class="pro-date ">{{item.install_time}}</view>
|
|
|
|
|
|
- <view class="showDetail" v-if="item.isShow">
|
|
|
|
|
|
+ <view class="showDetailEdit" v-if="item.isShow==true">
|
|
<view @tap="goDeviceEdit(item)">修改设备</view>
|
|
<view @tap="goDeviceEdit(item)">修改设备</view>
|
|
- <view @tap="deleteItem2" data-target="DialogModal2" :data-id='item.id' :data-index='index'>删除设备</view>
|
|
|
|
|
|
+ <!-- <view @tap="deleteItem2" data-target="DialogModal2" :data-id='item.id'
|
|
|
|
+ :data-index='index'>删除设备</view> -->
|
|
</view>
|
|
</view>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
</view>
|
|
</view>
|
|
<view class="nav-right num">
|
|
<view class="nav-right num">
|
|
<view class="text-grey">
|
|
<view class="text-grey">
|
|
@@ -101,7 +106,7 @@
|
|
</view>
|
|
</view>
|
|
<view class="checkAll" style="display:inline-block">
|
|
<view class="checkAll" style="display:inline-block">
|
|
|
|
|
|
- <checkbox-group @change="allChoose">
|
|
|
|
|
|
+ <checkbox-group @change="allChoose" v-if="deviceManage.length">
|
|
<label>
|
|
<label>
|
|
<checkbox value="all" :class="{'checked':allChecked}" :checked="allChecked?true:false">
|
|
<checkbox value="all" :class="{'checked':allChecked}" :checked="allChecked?true:false">
|
|
</checkbox> <text class="margin-left-xs">全选</text>
|
|
</checkbox> <text class="margin-left-xs">全选</text>
|
|
@@ -151,7 +156,7 @@
|
|
<valid-code :value.sync="validCode"></valid-code>
|
|
<valid-code :value.sync="validCode"></valid-code>
|
|
</view>
|
|
</view>
|
|
<view class="cu-bar operate bg-white" style="min-height: 100rpx;">
|
|
<view class="cu-bar operate bg-white" style="min-height: 100rpx;">
|
|
- <view class="action margin-0 " @tap="hideModal">
|
|
|
|
|
|
+ <view class="action margin-0" @tap="hideModal">
|
|
取消</view>
|
|
取消</view>
|
|
<view class="action margin-0 solid-left text-blue" @tap="confirmDelete">确定</view>
|
|
<view class="action margin-0 solid-left text-blue" @tap="confirmDelete">确定</view>
|
|
</view>
|
|
</view>
|
|
@@ -176,8 +181,8 @@
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
-
|
|
|
|
- deviceManage:[],
|
|
|
|
|
|
+
|
|
|
|
+ deviceManage: [],
|
|
validCode: '',
|
|
validCode: '',
|
|
|
|
|
|
checkbox: [{
|
|
checkbox: [{
|
|
@@ -195,9 +200,10 @@
|
|
listTouchDirection: null,
|
|
listTouchDirection: null,
|
|
CustomBar: this.CustomBar,
|
|
CustomBar: this.CustomBar,
|
|
|
|
|
|
- deleteIndex:'',
|
|
|
|
- deleteId:'',
|
|
|
|
-
|
|
|
|
|
|
+ deleteIndex: '',
|
|
|
|
+ deleteId: '',
|
|
|
|
+ dwtype: 0,
|
|
|
|
+ transmission_mode: 0,
|
|
|
|
|
|
// checkAllFlag:false,
|
|
// checkAllFlag:false,
|
|
|
|
|
|
@@ -226,34 +232,49 @@
|
|
},
|
|
},
|
|
|
|
|
|
mounted() {
|
|
mounted() {
|
|
- document.addEventListener('click', (e) => {
|
|
|
|
- if (e.target.className != 'showDetail') {
|
|
|
|
|
|
+ document.addEventListener('click', (event) => {
|
|
|
|
+ console.log(this.deviceManage)
|
|
|
|
+
|
|
|
|
+ if (event.target.className != 'showDetailEdit') {
|
|
this.deviceManage.forEach(item => {
|
|
this.deviceManage.forEach(item => {
|
|
- item.isShow = false
|
|
|
|
|
|
+ item.isShow = false;
|
|
|
|
+ // console.log(item)
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+ // console.log(this.deviceManage)
|
|
|
|
+
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- onLoad:function(option){
|
|
|
|
- this.getDataList({'company_code':uni.getStorageSync('selectedCode')})
|
|
|
|
|
|
+ onLoad: function(option) {
|
|
|
|
+ this.getDataList({
|
|
|
|
+ 'company_code': uni.getStorageSync('selectedCode')
|
|
|
|
+ })
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ //筛选
|
|
|
|
+ searchList() {
|
|
|
|
+ this.getDataList({
|
|
|
|
+ "transmission_mode": this.transmission_mode,
|
|
|
|
+ "dwtype": this.dwtype,
|
|
|
|
+ 'company_code': uni.getStorageSync('selectedCode')
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
// 列表数据请求
|
|
// 列表数据请求
|
|
async getDataList(params = {}) {
|
|
async getDataList(params = {}) {
|
|
const res = await this.$myRequest({
|
|
const res = await this.$myRequest({
|
|
url: 'DeviceConfig/getDeviceList',
|
|
url: 'DeviceConfig/getDeviceList',
|
|
- data:params,
|
|
|
|
|
|
+ data: params,
|
|
showLoading: true
|
|
showLoading: true
|
|
})
|
|
})
|
|
- this.deviceManage=res.data.data;
|
|
|
|
-
|
|
|
|
|
|
+ this.deviceManage = res.data.data;
|
|
|
|
+
|
|
// console.log(res.data.data.length)
|
|
// console.log(res.data.data.length)
|
|
console.log(this.deviceManage);
|
|
console.log(this.deviceManage);
|
|
-
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+
|
|
// 页面跳转
|
|
// 页面跳转
|
|
goDeviceAdd() {
|
|
goDeviceAdd() {
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
@@ -279,18 +300,23 @@
|
|
hideModal(e) {
|
|
hideModal(e) {
|
|
this.modalName = null
|
|
this.modalName = null
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+
|
|
//删除弹出框操作
|
|
//删除弹出框操作
|
|
deleteItem(e) {
|
|
deleteItem(e) {
|
|
- if (this.checkedArr.length == 0) {
|
|
|
|
- alert('请选择至少一条需要删除的数据')
|
|
|
|
- } else {
|
|
|
|
- this.modalName = e.currentTarget.dataset.target;
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ uni.showModal({
|
|
|
|
+ showCancel: false,
|
|
|
|
+ content: '暂不支持删除功能'
|
|
|
|
+ });
|
|
|
|
+ // if (this.checkedArr.length == 0) {
|
|
|
|
+ // alert('请选择至少一条需要删除的数据')
|
|
|
|
+ // } else {
|
|
|
|
+ // this.modalName = e.currentTarget.dataset.target;
|
|
|
|
+ // }
|
|
},
|
|
},
|
|
deleteItem2(e) {
|
|
deleteItem2(e) {
|
|
this.checkedArr.push(e.target.dataset.id);
|
|
this.checkedArr.push(e.target.dataset.id);
|
|
- this.deleteIndex=e.target.dataset.index;
|
|
|
|
|
|
+ this.deleteIndex = e.target.dataset.index;
|
|
console.log('this.checkedArr 单个点击删除按钮 存入要删除的索引')
|
|
console.log('this.checkedArr 单个点击删除按钮 存入要删除的索引')
|
|
console.log(this.checkedArr)
|
|
console.log(this.checkedArr)
|
|
this.modalName = e.currentTarget.dataset.target;
|
|
this.modalName = e.currentTarget.dataset.target;
|
|
@@ -298,7 +324,7 @@
|
|
confirmDelete() {
|
|
confirmDelete() {
|
|
// alert(this.deleteIndex)
|
|
// alert(this.deleteIndex)
|
|
// this.deviceManage.splice(this.deleteIndex,1);
|
|
// this.deviceManage.splice(this.deleteIndex,1);
|
|
-
|
|
|
|
|
|
+
|
|
this.deviceManage = this.deviceManage.filter((item) => !this.checkedArr.includes(item.id));
|
|
this.deviceManage = this.deviceManage.filter((item) => !this.checkedArr.includes(item.id));
|
|
console.log('this.deviceManage')
|
|
console.log('this.deviceManage')
|
|
console.log(this.deviceManage)
|
|
console.log(this.deviceManage)
|
|
@@ -312,14 +338,16 @@
|
|
|
|
|
|
// 隐藏显示
|
|
// 隐藏显示
|
|
showDetail(e) {
|
|
showDetail(e) {
|
|
|
|
+
|
|
|
|
+ console.log(this.deviceManage)
|
|
// console.log('e')
|
|
// console.log('e')
|
|
// console.log(e)
|
|
// console.log(e)
|
|
// 存储点击那一项的状态
|
|
// 存储点击那一项的状态
|
|
const nowStatu = e.isShow;
|
|
const nowStatu = e.isShow;
|
|
-
|
|
|
|
- //判断如果长摁弹框出来时,情况选中状态 ???
|
|
|
|
- if(!nowStatu){
|
|
|
|
- this.checkedArr=[];
|
|
|
|
|
|
+
|
|
|
|
+ //判断如果长摁弹框出来时,情况选中状态 ???
|
|
|
|
+ if (!nowStatu) {
|
|
|
|
+ this.checkedArr = [];
|
|
this.allChecked = false;
|
|
this.allChecked = false;
|
|
}
|
|
}
|
|
// 将每一项列表的isShow设置为false,让所有的列表都隐藏
|
|
// 将每一项列表的isShow设置为false,让所有的列表都隐藏
|
|
@@ -331,7 +359,7 @@
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
-InputFocus(e) {
|
|
|
|
|
|
+ InputFocus(e) {
|
|
this.InputBottom = e.detail.height
|
|
this.InputBottom = e.detail.height
|
|
},
|
|
},
|
|
InputBlur(e) {
|
|
InputBlur(e) {
|
|
@@ -372,7 +400,7 @@ InputFocus(e) {
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style>
|
|
<style>
|
|
- .showDetail {
|
|
|
|
|
|
+ .showDetailEdit {
|
|
position: absolute;
|
|
position: absolute;
|
|
background: #fff;
|
|
background: #fff;
|
|
box-shadow: 0 1px 6px 0 rgb(32 33 36 / 28%);
|
|
box-shadow: 0 1px 6px 0 rgb(32 33 36 / 28%);
|
|
@@ -383,11 +411,11 @@ InputFocus(e) {
|
|
font-size: 28rpx;
|
|
font-size: 28rpx;
|
|
}
|
|
}
|
|
|
|
|
|
- .showDetail view {
|
|
|
|
|
|
+ .showDetailEdit view {
|
|
padding: 0rpx 20rpx;
|
|
padding: 0rpx 20rpx;
|
|
}
|
|
}
|
|
|
|
|
|
- .showDetail view:first-child {
|
|
|
|
|
|
+ .showDetailEdit view:first-child {
|
|
border-bottom: 1px solid #EDEDED;
|
|
border-bottom: 1px solid #EDEDED;
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|