fix(移动端): 新增用户信息

This commit is contained in:
dataeaseShu 2024-01-31 15:30:55 +08:00
parent b1987c190d
commit 3a84ac85c4
4 changed files with 78 additions and 17 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -2,20 +2,15 @@
import { ref } from 'vue'
import Home from './home/index.vue'
import Directory from './directory/index.vue'
import Personal from './personal/index.vue'
import VanTabbar from 'vant/es/tabbar'
import VanTabbarItem from 'vant/es/tabbar-item'
import VanCell from 'vant/es/cell'
import VanSticky from 'vant/es/sticky'
import VanOverlay from 'vant/es/overlay'
import VanLoading from 'vant/es/loading'
import VanCellGroup from 'vant/es/cell-group'
import 'vant/es/tabbar-item/style'
import 'vant/es/tabbar/style'
import 'vant/es/sticky/style'
import 'vant/es/overlay/style'
import 'vant/es/cell/style'
import 'vant/es/loading/style'
import 'vant/es/cell-group/style'
const activeTabbar = ref('home')
const showLoading = ref(false)
@ -30,6 +25,7 @@ const hiddenTabbar = ref(false)
@setLoading="val => (showLoading = val)"
@hiddenTabbar="val => (hiddenTabbar = val)"
></Directory>
<Personal v-else-if="activeTabbar === 'user'"> </Personal>
<van-tabbar v-if="!hiddenTabbar" v-model="activeTabbar">
<van-tabbar-item name="home" icon="wap-home-o">首页</van-tabbar-item>
<van-tabbar-item name="direct" icon="bars">目录</van-tabbar-item>
@ -45,7 +41,8 @@ const hiddenTabbar = ref(false)
<style lang="less" scoped>
.mobile-index {
width: 100%;
height: 100%;
width: 100vw;
height: 100vh;
overflow: hidden;
}
</style>

View File

@ -1,9 +1,78 @@
<script lang="ts" setup>
import { ref } from 'vue'
import { useUserStoreWithOut } from '@/store/modules/user'
import userImg from '@/assets/img/user.png'
import { useRouter } from 'vue-router'
import { logoutApi } from '@/api/login'
import { logoutHandler } from '@/utils/logout'
import VanButton from 'vant/es/button'
import VanCell from 'vant/es/cell'
import VanIcon from 'vant/es/icon'
import VanImage from 'vant/es/image'
import 'vant/es/image/style'
import 'vant/es/icon/style'
import 'vant/es/cell/style'
import 'vant/es/button/style'
const userStore = useUserStoreWithOut()
const { push } = useRouter()
const logout = async () => {
await logoutApi()
logoutHandler()
push('/login')
}
</script>
<template>
<div></div>
<div class="de-mobile-user">
<div class="mobile-user-top">
<van-image width="75" height="75" :src="userImg" />
<div class="user-name">
{{ userStore.name }}
</div>
</div>
<van-cell value="系统信息" is-link>
<template #title>
<van-icon name="user-o" class="search-icon" />
<span class="custom-title">关于</span>
</template>
</van-cell>
<div style="margin: 16px">
<van-button round block type="primary" @click="logout"> 注销 </van-button>
</div>
</div>
</template>
<style lang="less" scoped></style>
<style lang="less" scoped>
.de-mobile-user {
height: 100vh;
width: 100vw;
.mobile-user-top {
padding: 24px 24px 16px 24px;
display: flex;
.user-name {
height: 45px;
text-align: left;
padding-left: 10px;
padding-top: 20px;
}
}
:deep(.van-cell__title) {
display: flex;
align-items: center;
}
.custom-title {
margin-right: 4px;
vertical-align: middle;
margin-left: 12px;
}
.search-icon {
font-size: 26px;
line-height: inherit;
}
}
</style>

View File

@ -261,12 +261,7 @@ const handleNodeClick = (data: BusiTreeNode) => {
}
const editorDataset = () => {
router.push({
path: '/dataset-form',
query: {
id: nodeInfo.id
}
})
handleEdit(nodeInfo.id)
}
const handleEdit = id => {