Merge pull request #8244 from dataease/pr@dev-v2_dzz_mobile

fix(移动端): 暂无数据
This commit is contained in:
dataeaseShu 2024-02-29 15:41:58 +08:00 committed by GitHub
commit d63af3e16c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 47 additions and 6 deletions

View File

@ -6,6 +6,7 @@ import { shortcutOption } from '@/views/workbranch/ShortcutOption'
import { useRouter } from 'vue-router'
import Workbranch from '@/views/mobile/components/Workbranch.vue'
import request from '@/config/axios'
import nothingNone from '@/assets/img/none.png'
import VanTabs from 'vant/es/tabs'
import VanNavBar from 'vant/es/nav-bar'
import VanTab from 'vant/es/tab'
@ -19,6 +20,7 @@ const router = useRouter()
const { t } = useI18n()
const activeTab = ref('recent')
const emptyTips = ref('')
const state = reactive({
tableData: [],
curTypeList: []
@ -35,9 +37,22 @@ const loadTableData = () => {
})
.finally(() => {
emits('setLoading', false)
setEmptyTips()
})
}
const setEmptyTips = () => {
emptyTips.value = state.tableData.length
? ''
: `暂无${
{
recent: '数据',
store: '收藏',
share: '分享'
}[activeTab.value]
}`
}
const loadShareTableData = () => {
emits('setLoading', true)
request
@ -50,6 +65,7 @@ const loadShareTableData = () => {
})
.finally(() => {
emits('setLoading', false)
setEmptyTips()
})
}
@ -133,6 +149,12 @@ const formatterTime = val => {
:time="formatterTime(ele.lastEditTime || ele.time)"
/>
</div>
<div class="empty-img-mobile" v-if="!!emptyTips">
<img width="125" height="125" :src="nothingNone" alt="" />
<div class="empty-tips">
{{ emptyTips }}
</div>
</div>
</div>
</template>
@ -145,5 +167,23 @@ const formatterTime = val => {
height: calc(100vh - 142px);
margin-top: 8px;
}
.empty-img-mobile {
position: absolute;
top: 33%;
left: 0;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
font-size: 14px;
font-weight: 400;
line-height: 22px;
img {
margin-bottom: 8px;
}
}
}
</style>

View File

@ -67,12 +67,7 @@ const onClickLeft = () => {
<template>
<div class="dv-common-layout-mobile">
<van-sticky>
<van-nav-bar
:title="state.dvInfo.name"
left-text="返回"
left-arrow
@click-left="onClickLeft"
/>
<van-nav-bar :title="state.dvInfo.name" left-arrow @click-left="onClickLeft" />
</van-sticky>
<de-preview
ref="dashboardPreview"
@ -92,5 +87,11 @@ const onClickLeft = () => {
height: 100vh;
width: 100vw;
overflow-y: auto;
--van-nav-bar-height: 44px;
--van-nav-bar-arrow-size: 20px;
--van-nav-bar-icon-color: #1f2329;
--van-nav-bar-title-text-color: #1f2329;
--van-font-bold: 500;
--van-nav-bar-title-font-size: 17px;
}
</style>