jsy-app/pages/work/user/otherDevice.vue

168 lines
3.6 KiB
Vue
Raw Normal View History

2024-12-19 12:41:30 +08:00
<template>
<view class="index-container">
<z-paging class="paging" ref="paging" use-virtual-list bg-color="#F6F3F3" :loading-more-enabled="false">
<template #top>
2025-01-14 17:59:17 +08:00
<custom-nav-bar :left="true" title="其它设备权限">
<template v-slot:right>
<view class="fixed">
<view align="right" class="iconfont icon-jia icon" v-hasPermi="['system:permission:add']"
@click="onAdd"></view>
</view>
</template>
</custom-nav-bar>
2024-12-19 12:41:30 +08:00
<view class="search">
<u-search placeholder="请输入设备编号" @search="onSearchValue" @custom="onSearchValue"
@clear="onSearchValue(null)" shape="square"></u-search>
</view>
</template>
<template #cell="{ item }">
<view class="item-container">
<view class="flex">
<view class="flex-text global-font-size-1">
<view class="flex-text-one">设备编号</view>
<view>{{ item.deviceCode }}</view>
</view>
<view class="flex">
<u--text size="10" style="margin-left: 10px"
prefixIcon="../../../static/images/work/user/user-index-del-icon.png"
v-hasPermi="['system:permission:remove']" iconStyle="font-size: 10px;margin-right: 2px;"
text="删除" @click="onDeleteClick(item.id)"></u--text>
</view>
</view>
<view class="flex-text global-font-size-1" style="margin: 5px 0px">
<view class="flex-text-one">设备类型</view>
<view>{{ item.deviceTypeName }}</view>
</view>
</view>
</template>
</z-paging>
</view>
</template>
<script>
import plugin from "@/plugins";
import {
getUseDevicePermission,
getUnUseDeviceList,
addBatch,
delDeviceUserPermission
} from "@/api/system/deviceUserPermission";
export default {
data() {
return {
dataList: [],
query: {
landId: null,
deviceCode: null,
userId: null
}
};
},
onLoad(options) {
2025-01-14 17:59:17 +08:00
if(options){
this.query.landId = options.landId;
this.query.userId = options.userId;
}
2024-12-19 12:41:30 +08:00
},
onShow() {
this.queryList();
},
methods: {
queryList() {
if (!this.query.landId) {
return;
}
this.dataList = [];
getUseDevicePermission(this.query).then(res => {
2025-01-17 17:50:47 +08:00
this.$refs.paging.complete(res.data);
2024-12-19 12:41:30 +08:00
});
},
onSearchValue(e) {
this.query.deviceCode = e;
this.queryList();
},
onAdd() {
plugin.tab.navigateTo(
`/pages/work/user/selectOtherDevice?landId=${this.query.landId}&userId=${this.query.userId}`)
},
onDeleteClick(id) {
delDeviceUserPermission(id).then(res => {
this.queryList();
});
}
}
};
</script>
<style lang="scss" scoped>
.index-container {
background-color: #f6f3f3;
height: 100%;
.search {
background-color: white;
padding: 10px;
}
.title {
height: 50px;
display: flex;
padding: 15px 15px;
background: white;
align-items: center;
text {
font-size: 14px;
margin-right: 10px;
}
}
.button {
padding: 10px 20px;
display: flex;
background: white;
}
.item-container {
margin: 10px 10px;
padding: 10px 20px;
background: white;
height: 100%;
border-radius: 10px;
box-shadow: 1px 1px 2px 2px rgba(0, 0, 0, 0.05);
.flex-text {
display: flex;
align-items: center;
.flex-text-one {
color: #939393;
}
}
.icon {
margin-right: 5px;
}
.flex {
display: flex;
align-items: center;
justify-content: space-between;
}
}
}
.tips {
padding: 10px;
line-height: 20px;
font-size: 14px;
color: gray;
background-color: #fff;
border-top: 1px solid #eee;
}
::v-deep.zp-paging-container {
background: #f3f3f3 !important;
}
</style>