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> </script>
<style lang="scss" scoped> <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 { .cards-title {
border: none; border: none;
} }

View File

@ -1543,6 +1543,24 @@
} }
</style> </style>
<style lang="scss" scoped> <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 { // .icon {
// width: 16px; // width: 16px;
// height: 16px; // height: 16px;

View File

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

View File

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

View File

@ -37,9 +37,9 @@
<view class="txt-list" > <view class="txt-list" >
<view class="left"> <view class="left">
<view> <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" /> :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 /> src="../../../static/images/login/userAvatar.png" v-else />
</view> </view>
@ -397,12 +397,13 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.txt-list .left uni-text:first-child { .txt-list .left ::v-deep text:first-child {
width: auto; width: auto;
} }
.txt-list .left .u-text { .txt-list .left .u-text {
margin-left: 10px !important; margin-left: 10px !important;
} }
// //

View File

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