修复由于没有根节点导致的其他页面不显示

This commit is contained in:
lingling 2025-02-26 21:12:23 +08:00
parent 6186c68bc8
commit 95ebce0990
1 changed files with 91 additions and 90 deletions

View File

@ -1,84 +1,87 @@
<template> <template>
<div class="container"> <div>
<Breadcrumb :items="['menu.promotion', 'menu.promotion.Table']" />
<a-card class="general-card" :title="$t('menu.promotion.Table') + invite_code">
<a-row style="padding: 20px;">
<a-col :flex="1">
<a-form :model="queryParams" :label-col-props="{ span: 6 }" :wrapper-col-props="{ span: 18 }"
label-align="left">
<a-row :gutter="16">
<a-col :span="18">
<a-form-item field="createdTime" :label="'按照时间查询'">
<a-range-picker v-model="queryParams" style="width: 100%" />
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-col>
<a-col :flex="'86px'" style="text-align: right">
<a-space :size="18">
<a-button type="primary" @click="search">
<template #icon>
<icon-search />
</template>
查询
</a-button>
<a-button @click="reset">
<template #icon>
<icon-refresh />
</template>
重置
</a-button>
</a-space>
</a-col>
</a-row>
<div class="left-side">
<div class="panel"> <div class="container">
<Breadcrumb :items="['menu.promotion', 'menu.promotion.Table']" />
<a-card class="general-card" :title="$t('menu.promotion.Table') + invite_code">
<a-row style="padding: 20px;">
<a-col :flex="1">
<a-form :model="queryParams" :label-col-props="{ span: 6 }" :wrapper-col-props="{ span: 18 }"
label-align="left">
<a-row :gutter="16">
<a-col :span="18">
<a-form-item field="createdTime" :label="'按照时间查询'">
<a-range-picker v-model="queryParams" style="width: 100%" />
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-col>
<a-col :flex="'86px'" style="text-align: right">
<a-space :size="18">
<a-button type="primary" @click="search">
<template #icon>
<icon-search />
</template>
查询
</a-button>
<a-button @click="reset">
<template #icon>
<icon-refresh />
</template>
重置
</a-button>
</a-space>
</a-col>
</a-row>
<div class="left-side">
<a-grid :cols="24" :row-gap="16" class="panel"> <div class="panel">
<a-grid-item class="panel-col" :span="{ xs: 12, sm: 12, md: 12, lg: 12, xl: 12, xxl: 8 }">
<a-space>
<a-avatar :size="54" class="col-avatar"> <a-grid :cols="24" :row-gap="16" class="panel">
<img alt="avatar" <a-grid-item class="panel-col" :span="{ xs: 12, sm: 12, md: 12, lg: 12, xl: 12, xxl: 8 }">
src="//p3-armor.byteimg.com/tos-cn-i-49unhts6dw/288b89194e657603ff40db39e8072640.svg~tplv-49unhts6dw-image.image" /> <a-space>
</a-avatar> <a-avatar :size="54" class="col-avatar">
<a-statistic :title="'注册人数'" :value="data.register" :value-from="0" animation show-group-separator> <img alt="avatar"
<template #suffix> src="//p3-armor.byteimg.com/tos-cn-i-49unhts6dw/288b89194e657603ff40db39e8072640.svg~tplv-49unhts6dw-image.image" />
<span class="unit"></span> </a-avatar>
</template> <a-statistic :title="'注册人数'" :value="data.register" :value-from="0" animation show-group-separator>
</a-statistic> <template #suffix>
</a-space> <span class="unit"></span>
</a-grid-item> </template>
<a-grid-item class="panel-col" :span="{ xs: 12, sm: 12, md: 12, lg: 12, xl: 12, xxl: 8 }"> </a-statistic>
<a-space> </a-space>
<a-avatar :size="54" class="col-avatar"> </a-grid-item>
<img alt="avatar" <a-grid-item class="panel-col" :span="{ xs: 12, sm: 12, md: 12, lg: 12, xl: 12, xxl: 8 }">
src="//p3-armor.byteimg.com/tos-cn-i-49unhts6dw/fdc66b07224cdf18843c6076c2587eb5.svg~tplv-49unhts6dw-image.image" /> <a-space>
</a-avatar> <a-avatar :size="54" class="col-avatar">
<a-statistic :title="'绑定人数'" :value="data.binding" :value-from="0" animation show-group-separator> <img alt="avatar"
<template #suffix> src="//p3-armor.byteimg.com/tos-cn-i-49unhts6dw/fdc66b07224cdf18843c6076c2587eb5.svg~tplv-49unhts6dw-image.image" />
<span class="unit">{{ $t('workplace.pecs') }}</span> </a-avatar>
</template> <a-statistic :title="'绑定人数'" :value="data.binding" :value-from="0" animation show-group-separator>
</a-statistic> <template #suffix>
</a-space> <span class="unit">{{ $t('workplace.pecs') }}</span>
</a-grid-item> </template>
</a-grid> </a-statistic>
</a-space>
</a-grid-item>
</a-grid>
</div>
</div> </div>
</a-card>
</div> </div>
</a-card> <div>
</div>
<div >
<a-row> <a-row>
<a-col :span="12"> <a-col :span="12">
<div>注册的用户</div> <div>注册的用户</div>
<a-table :data="data.register_user"> <a-table :data="data.register_user">
<template #columns> <template #columns>
<a-table-column title="用户id" data-index="id"></a-table-column> <a-table-column title="用户id" data-index="id"></a-table-column>
<a-table-column title="用户名称" data-index="username"></a-table-column> <a-table-column title="用户名称" data-index="username"></a-table-column>
@ -97,7 +100,7 @@
<a-col :span="12"> <a-col :span="12">
<div>绑定手机号的用户</div> <div>绑定手机号的用户</div>
<a-table :data="data.binding_user"> <a-table :data="data.binding_user">
<template #columns> <template #columns>
<a-table-column title="用户id" data-index="id"></a-table-column> <a-table-column title="用户id" data-index="id"></a-table-column>
<a-table-column title="用户名称" data-index="username"></a-table-column> <a-table-column title="用户名称" data-index="username"></a-table-column>
@ -117,6 +120,7 @@
</div> </div>
</div>
</template> </template>
<script setup> <script setup>
@ -130,8 +134,8 @@ import dayjs from 'dayjs';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
const route = useRoute() const route = useRoute()
import router from '@/router';
const invite_code = ref(route.params.invite_code) const invite_code = ref("")
// const data = reactive({ // const data = reactive({
// register: 0, // register: 0,
@ -143,24 +147,21 @@ const data = ref({
register_user: [], // register_user: [], //
binding_user: [] // binding_user: [] //
}); });
const queryParams = ref([dayjs().subtract(1, 'day').format("YYYY-MM-DD"), dayjs().format("YYYY-MM-DD")])
onMounted(async () => { onMounted(async () => {
// if (route.params.invite_code) {
const startDate = dayjs().format("YYYY-MM-DD"); invite_code.value = route.params.invite_code
const endDate = startDate; // } else {
router.go(-1)
try {
const res = await detailed(invite_code.value, queryParams.value[0], queryParams.value[1]); //
//
data.value.register = res.data.register;
data.value.binding = res.data.binding;
data.value.register_user = res.data.register_user;
data.value.binding_user = res.data.binding_user;
} catch (error) {
console.error("Error fetching data:", error);
//
} }
const res = await detailed(invite_code.value, queryParams.value[0], queryParams.value[1]); //
//
data.value.register = res.data.register;
data.value.binding = res.data.binding;
data.value.register_user = res.data.register_user;
data.value.binding_user = res.data.binding_user;
}); });
const reset = () => { } const reset = () => { }
const search = async () => { const search = async () => {
@ -172,7 +173,7 @@ const search = async () => {
data.value.register_user = res.data.register_user; data.value.register_user = res.data.register_user;
data.value.binding_user = res.data.binding_user; data.value.binding_user = res.data.binding_user;
} }
const queryParams = ref([dayjs().subtract(1, 'day').format("YYYY-MM-DD"), dayjs().format("YYYY-MM-DD")])
</script> </script>