This commit is contained in:
王丹 2025-01-16 12:41:23 +08:00
parent c427138970
commit 699cf1805b
6 changed files with 107 additions and 112 deletions

View File

@ -131,6 +131,24 @@
</script>
<style lang="scss" scoped>
// nav
::v-deep.uni-navbar__header-container {
align-items: center;
justify-content: center;
&>view {
font-size: 36rpx;
}
}
::v-deep.uni-navbar__header-btns-left {
font-size: 27rpx;
}
::v-deep.uni-navbar__header-btns-right .icon {
font-size: 44rpx;
margin-left: 10px;
}
.cards-title {
border: none;
}

View File

@ -1543,6 +1543,24 @@
}
</style>
<style lang="scss" scoped>
// nav
::v-deep.uni-navbar__header-container {
align-items: center;
justify-content: center;
&>view {
font-size: 36rpx;
}
}
::v-deep.uni-navbar__header-btns-left {
font-size: 27rpx;
}
::v-deep.uni-navbar__header-btns-right .icon {
font-size: 44rpx;
margin-left: 10px;
}
// .icon {
// width: 16px;
// height: 16px;

View File

@ -4,7 +4,7 @@
<template #top>
<custom-nav-bar :left="true" title="操作日志"></custom-nav-bar>
<view class="search">
<u-search v-model="queryParams.searchValue" @search="queryList" />
<u-search v-model="queryParams.searchValue" @search="queryList" shape="square"/>
</view>
</template>
<view class="card" v-for="item in dataList">

View File

@ -1,93 +1,94 @@
<template>
<view class="index-container">
<z-paging class="paging" ref="paging" use-virtual-list @query="queryList" bg-color="#F6F3F3" :loading-more-enabled="false">
<z-paging class="paging" ref="paging" use-virtual-list @query="queryList" bg-color="#F6F3F3"
:loading-more-enabled="false">
<template #top>
<custom-nav-bar :left="true" title="用户地块">
</custom-nav-bar>
<view class="title">
<u--image style="margin-right: 10px" :src="userInfo.avatarURL ? userInfo.avatarURL : avatar" shape="circle" width="50px" height="50px"></u--image>
<view class="text-intel">
<u--image style="margin-right: 10px" :src="userInfo.avatarURL ? userInfo.avatarURL : avatar"
shape="circle" width="20px" height="20px"></u--image>
<text>{{ userInfo.name }}</text>
<text>{{ userInfo.roleName }}</text>
<text>{{ `地块数量:${landCount}` }}</text>
</view>
<u-gap height="5" bgColor="#F6F3F3"></u-gap>
<view class="search">
<u-search placeholder="请输入地块名称" @search="onSearchValue" @custom="onSearchValue" @clear="onSearchValue(null)" shape="square"></u-search>
<u-search placeholder="请输入地块名称" @search="onSearchValue" @custom="onSearchValue"
@clear="onSearchValue(null)" shape="square"></u-search>
</view>
<u-gap height="5" bgColor="#F6F3F3"></u-gap>
</template>
<template #cell="{ item }">
<view class="item-container">
<view style="display: flex; align-items: center; justify-content: flex-start; margin-bottom: 5px">
<view class="flex-text">
<view class="flex-text-one" style="color: black">地块编号</view>
<view>{{ item.landNum }}</view>
</view>
<view style="margin-right: 10px">
<u-tag text="启用" type="success" plain v-if="item.status == 0"></u-tag>
<u-tag text="禁用" type="error" plain v-if="item.status == 1"></u-tag>
</view>
</view>
<u-line color="#D2D2D2"></u-line>
<view class="data">
<view class="flex-text global-font-size-1">
<view class="flex-text-one">地块名称</view>
<view>{{ item.landName }}</view>
</view>
<view class="flex-text global-font-size-1" style="margin-top: 5px">
<view class="flex-text-one">地块地址</view>
<view>{{ item.landAddress || "-" }}</view>
</view>
</view>
<view v-hasPermi="['device:control:list']" >
<uni-row style="width: 100%" >
<uni-col :span="8"style="float: right;" v-if="userInfo.userType==1">
<u-button style="width: 150px; height: 30px; margin-right: 0px" type="success" text="其它设备权限" size="mini" @click="onClickOtherPermission(item)"></u-button>
</uni-col>
<uni-col :span="8" style="float: right;" >
<u-button style="width: 100px; height: 30px; margin-right: 0px" type="success" text="出水口权限" size="mini" @click="onClickPermission(item)"></u-button>
</uni-col>
</uni-row>
</view>
<view class="card">
<uni-collapse>
<uni-collapse-item title-border="none" :border="false" :show-arrow="false">
<template v-slot:title>
<view class="cards-title">
<view>
<view class="text">地块编号{{ item.landNum }}</view>
</view>
<view class="title-r">
<uni-tag class="bg-green" :circle="true" text="启用" v-if="item.status == 0" />
<uni-tag class="bg-green" :circle="true" text="禁用" v-if="item.status == 1" />
</view>
</view>
</template>
<view class="content">
<view class="cards-content">
<view class="txt-list">
<view class="left">
<view><text>地块名称</text>{{ item.landName }}</view>
<view><text>地块地址</text>{{ item.landAddress || "-" }}</view>
</view>
</view>
<view class="card-font">
<u-button type="success" size="mini" text="其它设备权限"
@click="onClickOtherPermission(item)" />
<u-button type="success" size="mini" text="出水口权限"
@click="onClickOtherPermission(item)" />
</view>
</view>
</view>
</uni-collapse-item>
</uni-collapse>
</view>
</template>
</z-paging>
</view>
</template>
<script >
import store from "@/store"
import plugin from "@/plugins"
import avatar from "../../../static/images/mine/userAvatar.png"
export default {
<script>
import store from "@/store"
import plugin from "@/plugins"
import avatar from "../../../static/images/mine/userAvatar.png"
export default {
data() {
return {
userInfo:{},
landCount:0,
paging:null,
avatar:null,
query:{
userId:null,
landName:null
userInfo: {},
landCount: 0,
paging: null,
avatar: null,
query: {
userId: null,
landName: null
}
}
},
created() {
this.avatar = avatar;
},
onLoad(options){
onLoad(options) {
this.userInfo = JSON.parse(decodeURIComponent(options.userInfo));
console.log(this.userInfo)
this.queryList();
},
onShow() {
if(this.userInfo){
if (this.userInfo) {
this.query.userId = this.userInfo.userId;
}
},
methods: {
queryList() {
if(!this.query.userId){
if (!this.query.userId) {
return;
}
//
@ -98,8 +99,8 @@ export default {
//z-paging
console.log(res)
this.$refs.paging.complete(res.data);
if(res.data){
this.landCount=res.data.length;
if (res.data) {
this.landCount = res.data.length;
}
})
.catch(error => {
@ -117,58 +118,16 @@ export default {
onClickPermission(item) {
plugin.tab.navigateTo(`/pages/work/user/device?landId=${item.id}&userId=${item.userId}`)
},
onClickOtherPermission(item){
onClickOtherPermission(item) {
plugin.tab.navigateTo(`/pages/work/user/otherDevice?landId=${item.id}&userId=${item.userId}`)
}
}
}
</script>
<style lang="stylus">
.index-container{
background-color: #F6F3F3;
height: 100%;
.paging{
background-color: #F6F3F3;
.item{
margin: 10px 10px;
}
}
.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
}
}
.item-container {
padding: 20px;
margin-top: 10px;
background-color: white;
padding-bottom: 10px;
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;
font-weight: bold;
}
}
.data {
margin-top: 10px;
margin-top: 10px;
margin-left: 5px;
margin-right: 10px;
}
<style lang="scss" scoped>
//
.u-search {
padding:0 10px 10px;
}
</style>
</style>

View File

@ -37,9 +37,9 @@
<view class="txt-list" >
<view class="left">
<view>
<u--image :showLoading="true" shape="square" radius="5px" width="70px" height="70px"
<u--image :showLoading="true" shape="square" radius="5px" width="60px" height="60px"
:src="item.avatar" v-if="item.avatar" />
<u--image :showLoading="true" shape="square" radius="5px" width="70px" height="70px"
<u--image :showLoading="true" shape="square" radius="5px" width="60px" height="60px"
src="../../../static/images/login/userAvatar.png" v-else />
</view>
@ -397,12 +397,13 @@
</script>
<style lang="scss" scoped>
.txt-list .left uni-text:first-child {
.txt-list .left ::v-deep text:first-child {
width: auto;
}
.txt-list .left .u-text {
margin-left: 10px !important;
}
//

View File

@ -250,9 +250,8 @@
float: right;
margin-left: 10px;
}
.card-view{display: grid;gap: 5px;
grid-template-columns: repeat(4, 1fr);}
.card-view >view{color: #39ac4f; display: flex;align-items: center;justify-content: center;margin: 10px 0;}
.card-view{display: flex;gap: 5px;}
.card-view >view{flex: 1; color: #39ac4f; display: flex;align-items: center;justify-content: center;margin-bottom: 10px;}
.card-view >view .iconfont{margin-right: 5px;}
/* 展示信息 */
.text-intel{width: 100%;background-color: #fff;padding: 10px;display: flex;font-size: 14px;}
@ -261,7 +260,7 @@
.text-intel >view .text{font-size: 0.875rem;
color: #39ac4f;
font-weight: bold;}
.tip-intel{margin: 10px auto;}
.tip-intel{margin: 5px auto;}
/* 表单按钮 */
.form-btn{display: flex; gap: 10px;margin-top: 50px;}
/* 表单下拉框 */