修改授权管理员删除钥匙流程
This commit is contained in:
parent
760059211d
commit
6b0a12dd83
@ -38,6 +38,15 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="button-logout" @click="deleteLock">删除</view>
|
<view class="button-logout" @click="deleteLock">删除</view>
|
||||||
|
<up-modal :show="showModal" title="是否删除授权管理员钥匙?" :showCancelButton="true" width="600rpx" @cancel="cancelModal"
|
||||||
|
@confirm="confirmModal">
|
||||||
|
<view class="slot-content" @click="changeRadio">
|
||||||
|
<view style="display: flex;align-items: center;">
|
||||||
|
<radio :checked="checked"></radio>
|
||||||
|
<view>同时删除其发送的所有钥匙,钥匙删除后不能恢复</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</up-modal>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -54,7 +63,9 @@ import { useBasicStore } from '@/stores/basic'
|
|||||||
export default {
|
export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
unlockApp: 0
|
unlockApp: 0,
|
||||||
|
showModal: false,
|
||||||
|
checked: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -69,6 +80,39 @@ export default {
|
|||||||
...mapActions(useBluetoothStore, ['resetDevice', 'updateCurrentLockInfo']),
|
...mapActions(useBluetoothStore, ['resetDevice', 'updateCurrentLockInfo']),
|
||||||
...mapActions(useLockStore, ['getLockList', 'updateLockSearch']),
|
...mapActions(useLockStore, ['getLockList', 'updateLockSearch']),
|
||||||
...mapActions(useBasicStore, ['backAndToast']),
|
...mapActions(useBasicStore, ['backAndToast']),
|
||||||
|
changeRadio() {
|
||||||
|
this.checked = !this.checked
|
||||||
|
},
|
||||||
|
cancelModal() {
|
||||||
|
this.showModal = false
|
||||||
|
this.checked = false
|
||||||
|
},
|
||||||
|
async confirmModal() {
|
||||||
|
uni.showLoading({
|
||||||
|
title: '删除中',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
const that = this
|
||||||
|
const { code } = await deleteKeyRequest({
|
||||||
|
keyId: that.keyId,
|
||||||
|
includeUnderlings: that.checked ? 1 : 0
|
||||||
|
})
|
||||||
|
if(code === 0) {
|
||||||
|
uni.hideLoading()
|
||||||
|
that.updateLockSearch({
|
||||||
|
...that.lockSearch,
|
||||||
|
pageNo: 1
|
||||||
|
})
|
||||||
|
that.getLockList(that.lockSearch)
|
||||||
|
that.backAndToast('删除成功', 2)
|
||||||
|
} else {
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.showToast({
|
||||||
|
title: 'message',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
async changeUnlockApp(value) {
|
async changeUnlockApp(value) {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '更新中',
|
title: '更新中',
|
||||||
@ -98,6 +142,10 @@ export default {
|
|||||||
},
|
},
|
||||||
deleteLock() {
|
deleteLock() {
|
||||||
const that = this
|
const that = this
|
||||||
|
if(this.currentLockInfo.userType !== 110301 && this.currentLockInfo.keyRight === 1) {
|
||||||
|
this.showModal = true
|
||||||
|
return
|
||||||
|
}
|
||||||
const message = that.currentLockInfo.userType === 110301 ? '删除锁后,所有信息都会一起删除,确定删除锁吗?' : '确定删除该钥匙吗?'
|
const message = that.currentLockInfo.userType === 110301 ? '删除锁后,所有信息都会一起删除,确定删除锁吗?' : '确定删除该钥匙吗?'
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
@ -215,4 +263,21 @@ page {
|
|||||||
height: 3rpx;
|
height: 3rpx;
|
||||||
background: #EBEBEB;
|
background: #EBEBEB;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
radio .wx-radio-input.wx-radio-input-checked {
|
||||||
|
border: none;
|
||||||
|
background: #c1885a;
|
||||||
|
}
|
||||||
|
radio .wx-radio-input.wx-radio-input-checked::before {
|
||||||
|
border-radius: 50%; /* 圆角 */
|
||||||
|
width: 28rpx; /* 选中后对勾大小,不要超过背景的尺寸 */
|
||||||
|
height: 28rpx; /* 选中后对勾大小,不要超过背景的尺寸 */
|
||||||
|
line-height: 28rpx;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 20rpx; /* 对勾大小 30rpx */
|
||||||
|
color: #fff; /* 对勾颜色 白色 */
|
||||||
|
background: #c1885a;
|
||||||
|
transform: translate(-50%, -50%) scale(1);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user