管理端

This commit is contained in:
2025-03-17 17:41:02 +08:00
parent 5b4a055d47
commit 0c53dc4d54
31 changed files with 440 additions and 46 deletions

View File

@@ -1,13 +1,28 @@
<script setup>
import {useSystemStore} from "../../pinia/SystemStore/index.js";
import {useUserStore} from "../../pinia/UserStore/index.js";
const SystemStore = useSystemStore();
const {logout} = useUserStore();
</script>
<template>
<div class="w-full h-full flex items-center px-[24px] box-border bg-white">
<div class="title">
代发平台-{{SystemStore.isRoot?'管理员':'商家'}}
代发平台-{{ SystemStore.isRoot ? '管理员' : '商家' }}
</div>
<div class="ml-auto">
<a-dropdown>
<a-link
:hoverable="false">
15709267061
<icon-down/>
</a-link>
<template #content>
<a-doption @click="logout">退出登陆</a-doption>
</template>
</a-dropdown>
</div>
</div>
</template>

View File

@@ -42,7 +42,8 @@ const mode = ref(MODE.PHONE);
</a-input>
</div>
<div class="flex flex-col mt-[50px] gap-[32px]">
<a-button @click="login" type="primary">登陆</a-button>
<a-button @click="login(false)" type="primary">登陆商户端</a-button>
<a-button @click="login(true)" type="primary">登陆管理端</a-button>
<a-button
@click="toPath('/loginSYS/register')"
type="text">

View File

@@ -1,11 +0,0 @@
<script setup>
</script>
<template>
<!-- 账号管理 -->
</template>
<style scoped>
</style>

View File

@@ -4,6 +4,7 @@
<template>
<!-- 拉黑记录 -->
拉黑记录
</template>
<style scoped>

View File

@@ -4,6 +4,7 @@
<template>
<!-- 达人账号 -->
达人账号
</template>
<style scoped>

View File

@@ -0,0 +1,16 @@
<script setup>
</script>
<template>
<!-- 账号管理 -->
<div id="Item-View">
<transition name="fade">
<router-view></router-view>
</transition>
</div>
</template>
<style scoped>
</style>

View File

@@ -4,6 +4,7 @@
<template>
<!-- 商家账号 -->
商家账号
</template>
<style scoped>

View File

@@ -4,6 +4,7 @@
<template>
<!-- 推广账号 -->
推广账号
</template>
<style scoped>

View File

@@ -1,11 +0,0 @@
<script setup>
</script>
<template>
<!-- 达人端管理 -->
</template>
<style scoped>
</style>

View File

@@ -4,6 +4,7 @@
<template>
<!-- 资金概览 -->
资金概览
</template>
<style scoped>

View File

@@ -4,6 +4,7 @@
<template>
<!-- 资金管理() -->
资金管理()
</template>
<style scoped>

View File

@@ -4,6 +4,7 @@
<template>
<!-- 资金管理() -->
资金管理()
</template>
<style scoped>

View File

@@ -4,8 +4,23 @@
<template>
<!-- 资金 -->
<div id="Item-View">
<transition name="fade">
<router-view></router-view>
</transition>
</div>
</template>
<style scoped>
<style lang="scss" scoped>
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.5s;
position: relative;
}
.fade-enter-from,
.fade-leave-to {
opacity: 0;
position: absolute;
}
</style>

View File

@@ -4,6 +4,7 @@
<template>
<!-- 打款管理 -->
打款管理
</template>
<style scoped>

View File

@@ -4,6 +4,7 @@
<template>
<!-- 提现信息 -->
提现信息
</template>
<style scoped>

View File

@@ -4,6 +4,7 @@
<template>
<!-- 达人端物料 -->
达人端物料
</template>
<style scoped>

View File

@@ -0,0 +1,26 @@
<script setup>
</script>
<template>
<!-- 达人端管理 -->
<div id="Item-View">
<transition name="fade">
<router-view></router-view>
</transition>
</div>
</template>
<style lang="scss" scoped>
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.5s;
position: relative;
}
.fade-enter-from,
.fade-leave-to {
opacity: 0;
position: absolute;
}
</style>

View File

@@ -4,6 +4,7 @@
<template>
<!-- 任务排序 -->
任务排序
</template>
<style scoped>

View File

@@ -4,6 +4,7 @@
<template>
<!-- 团队投诉 -->
团队投诉
</template>
<style scoped>

View File

@@ -0,0 +1,26 @@
<script setup>
</script>
<template>
<!-- 悬赏任务 -->
<div id="Item-View">
<transition name="fade">
<router-view></router-view>
</transition>
</div>
</template>
<style lang="scss" scoped>
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.5s;
position: relative;
}
.fade-enter-from,
.fade-leave-to {
opacity: 0;
position: absolute;
}
</style>

View File

@@ -4,6 +4,7 @@
<template>
<!-- 子任务审核 -->
子任务审核
</template>
<style scoped>

View File

@@ -4,6 +4,7 @@
<template>
<!-- 任务审核 -->
任务审核
</template>
<style scoped>

View File

@@ -4,6 +4,7 @@
<template>
<!-- 免审审核 -->
免审审核
</template>
<style scoped>

View File

@@ -4,8 +4,23 @@
<template>
<!-- 消息中心 -->
<div id="Item-View">
<transition name="fade">
<router-view></router-view>
</transition>
</div>
</template>
<style scoped>
<style lang="scss" scoped>
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.5s;
position: relative;
}
.fade-enter-from,
.fade-leave-to {
opacity: 0;
position: absolute;
}
</style>

View File

@@ -4,6 +4,7 @@
<template>
<!-- 消息审核 -->
消息审核
</template>
<style scoped>

View File

@@ -4,6 +4,7 @@
<template>
<!-- 平台介入 -->
平台介入
</template>
<style scoped>

View File

@@ -1,11 +0,0 @@
<script setup>
</script>
<template>
<!-- 悬赏任务 -->
</template>
<style scoped>
</style>

View File

@@ -1,6 +1,6 @@
import {defineStore} from "pinia";
import {ref} from "vue";
import mockRoutes from './mock.js';
import {mockRoutes1, mockRoutes2} from './mock.js';
import router from "../../router/index.js";
import generateRouter from "../../router/generateRouter.js";
@@ -21,19 +21,36 @@ export const useSystemStore = defineStore("SystemStore", () => {
await router.replace(router.currentRoute.value.fullPath);
}
const setRouter = async () => {
const setRouter = async (_isRoot) => {
isRoot.value = _isRoot;
RoutesTemp.value.length = 0;
// 请求资源 mockRoutes
const routes = generateRouter(mockRoutes);
RoutesTemp.value.push(...mockRoutes);
const routes = generateRouter(isRoot.value ? mockRoutes2 : mockRoutes1);
RoutesTemp.value.push(...(isRoot.value ? mockRoutes2 : mockRoutes1));
await installRoute();
}
const clearRouter = async () => {
const routes = generateRouter(RoutesTemp.value);
RoutesTemp.value.length = 0;
router.removeRoute('home');
router.addRoute({
path: '/home',
name: 'home',
component: () => import('../../pages/layout/index.vue'),
redirect: `/home/${routes[0].path}`,
children: []
});
await router.replace(router.currentRoute.value.fullPath);
}
return {
isRoot,
RoutesTemp,
setRouter,
installRoute,
clearRouter,
}
}, {
persist: {

View File

@@ -1,4 +1,4 @@
const mockRoutes = [
const mockRoutes1 = [
{
path: 'task-center',
name: 'task-center',
@@ -102,7 +102,8 @@ const mockRoutes = [
title: '数据看板',
icon: '',
meta: {
name: '数据看板'
name: '数据看板',
hidden: true,
},
component: 'data-board',
},
@@ -204,4 +205,240 @@ const mockRoutes = [
}
];
export default mockRoutes;
const mockRoutes2 = [
{
path: 'manage-reward-mission',
name: 'manage-reward-mission',
title: '悬赏任务',
icon: '',
meta: {
name: '悬赏任务'
},
component: 'manage-reward-mission',
children: [
{
path: 'task-review',
name: 'task-review',
title: '任务审核',
icon: '',
meta: {
name: '任务审核'
},
component: 'task-review',
},
{
path: 'subtask-review',
name: 'subtask-review',
title: '子任务审核',
icon: '',
meta: {
name: '子任务审核'
},
component: 'subtask-review',
},
]
},
{
path: 'message-center',
name: 'message-center',
title: '消息中心',
icon: '',
meta: {
name: '消息中心'
},
component: 'message-center',
children: [
{
path: 'message-review',
name: 'message-review',
title: '消息审核',
icon: '',
meta: {
name: '消息审核'
},
component: 'message-review',
},
{
path: 'exemption-from-audit-review',
name: 'exemption-from-audit-review',
title: '免审审核',
icon: '',
meta: {
name: '免审审核'
},
component: 'subtask-review',
},
{
path: 'platform-intervention',
name: 'platform-intervention',
title: '平台介入',
icon: '',
meta: {
name: '平台介入'
},
component: 'platform-intervention',
},
]
},
{
path: 'fund',
name: 'fund',
title: '资金',
icon: '',
meta: {
name: '资金'
},
component: 'fund',
children: [
{
path: 'fund-management-business',
name: 'fund-management-business',
title: '资金管理(商)',
icon: '',
meta: {
name: '资金管理(商)'
},
component: 'fund-management-business',
},
{
path: 'fund-management-expert',
name: 'fund-management-expert',
title: '资金管理(达)',
icon: '',
meta: {
name: '资金管理(达)'
},
component: 'fund-management-expert',
},
{
path: 'withdrawal-information',
name: 'withdrawal-information',
title: '提现信息',
icon: '',
meta: {
name: '提现信息'
},
component: 'withdrawal-information',
},
{
path: 'financial-overview',
name: 'financial-overview',
title: '资金概览',
icon: '',
meta: {
name: '资金概览'
},
component: 'financial-overview',
},
{
path: 'payment-management',
name: 'payment-management',
title: '打款管理',
icon: '',
meta: {
name: '打款管理'
},
component: 'payment-management',
},
]
},
{
path: 'account-management',
name: 'account-management',
title: '账号管理',
icon: '',
meta: {
name: '账号管理'
},
component: 'account-management',
children: [
{
path: 'merchant-account',
name: 'merchant-account',
title: '商家账号',
icon: '',
meta: {
name: '商家账号'
},
component: 'merchant-account',
},
{
path: 'expert-account',
name: 'expert-account',
title: '达人账号',
icon: '',
meta: {
name: '达人账号'
},
component: 'expert-account',
},
{
path: 'promoted-accounts',
name: 'promoted-accounts',
title: '推广账号',
icon: '',
meta: {
name: '推广账号'
},
component: 'promoted-accounts',
},
{
path: 'blackout-records',
name: 'blackout-records',
title: '拉黑记录',
icon: '',
meta: {
name: '拉黑记录'
},
component: 'blackout-records',
},
]
},
{
path: 'manage-expert-management',
name: 'manage-expert-management',
title: '资金',
icon: '',
meta: {
name: '达人端管理'
},
component: 'manage-expert-management',
children: [
{
path: 'expert-end-materials',
name: 'expert-end-materials',
title: '达人端物料',
icon: '',
meta: {
name: '达人端物料'
},
component: 'expert-end-materials',
},
{
path: 'task-sorting',
name: 'task-sorting',
title: '任务排序',
icon: '',
meta: {
name: '任务排序'
},
component: 'task-sorting',
},
{
path: 'team-complaints',
name: 'team-complaints',
title: '团队投诉',
icon: '',
meta: {
name: '团队投诉'
},
component: 'team-complaints',
},
]
}
];
export {
mockRoutes1,
mockRoutes2
};

View File

@@ -7,19 +7,26 @@ export const useUserStore = defineStore("UserStore", () => {
const isLogin = ref(false);
const userInfo = ref(null);
const login = async (from) => {
const login = async (isRoot = false) => {
// 请求
isLogin.value = true;
// 获取并安装路由
const { setRouter } = useSystemStore();
await setRouter();
await setRouter(isRoot);
// 跳转
await router.push('/home');
}
const logout = async () => {
isLogin.value = false;
const { clearRouter } = useSystemStore();
await clearRouter();
}
return {
isLogin,
userInfo,
login,
logout,
}
}, {
persist: {

View File

@@ -1,4 +1,8 @@
const routesMap = {
/**
* 商户端
*/
'task-center': () => import('../pages/merchant/pages/task-center/index.vue'),
'reward-mission': () => import('../pages/merchant/pages/task-center/reward-mission.vue'),
'appointed-task': () => import('../pages/merchant/pages/task-center/appointed-task.vue'),
@@ -22,6 +26,37 @@ const routesMap = {
'get-help': () => import('../pages/merchant/pages/get-help/index.vue'),
'problem-teaching': () => import('../pages/merchant/pages/get-help/problem-teaching.vue'),
'contact-customer-service': () => import('../pages/merchant/pages/get-help/contact-customer-service.vue'),
/**
* 达人端
*/
'manage-reward-mission': () => import('../pages/manage/pages/manage-reward-mission/index.vue'),
'task-review': () => import('../pages/manage/pages/manage-reward-mission/task-review.vue'),
'subtask-review': () => import('../pages/manage/pages/manage-reward-mission/subtask-review.vue'),
'message-center': () => import('../pages/manage/pages/message-center/index.vue'),
'message-review': () => import('../pages/manage/pages/message-center/message-review.vue'),
'exemption-from-audit-review': () => import('../pages/manage/pages/message-center/exemption-from-audit-review.vue'),
'platform-intervention': () => import('../pages/manage/pages/message-center/platform-intervention.vue'),
'fund': () => import('../pages/manage/pages/fund/index.vue'),
'fund-management-business': () => import('../pages/manage/pages/fund/fund-management-business.vue'),
'fund-management-expert': () => import('../pages/manage/pages/fund/fund-management-expert.vue'),
'withdrawal-information': () => import('../pages/manage/pages/fund/withdrawal-information.vue'),
'financial-overview': () => import('../pages/manage/pages/fund/financial-overview.vue'),
'payment-management': () => import('../pages/manage/pages/fund/payment-management.vue'),
'account-management': () => import('../pages/manage/pages/account-management/index.vue'),
'merchant-account': () => import('../pages/manage/pages/account-management/merchant-account.vue'),
'expert-account': () => import('../pages/manage/pages/account-management/expert-account.vue'),
'promoted-accounts': () => import('../pages/manage/pages/account-management/promoted-accounts.vue'),
'blackout-records': () => import('../pages/manage/pages/account-management/blackout-records.vue'),
'manage-expert-management': () => import('../pages/manage/pages/manage-expert-management/index.vue'),
'expert-end-materials': () => import('../pages/manage/pages/manage-expert-management/expert-end-materials.vue'),
'task-sorting': () => import('../pages/manage/pages/manage-expert-management/task-sorting.vue'),
'team-complaints': () => import('../pages/manage/pages/manage-expert-management/team-complaints.vue'),
};
export default routesMap;