feat: 初始化素材中心页面路由结构

This commit is contained in:
rd
2025-08-22 11:48:41 +08:00
parent f53b697df1
commit 0d5cb7ba38
19 changed files with 389 additions and 25 deletions

View File

@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.01884 6.07878C7.23558 5.96285 7.49856 5.97564 7.70308 6.11198L9.70308 7.44532C9.88855 7.56896 9.99995 7.77711 9.99996 8C9.99996 8.2229 9.88855 8.43105 9.70308 8.55469L7.70308 9.88803C7.49856 10.0244 7.23558 10.0372 7.01884 9.92123C6.80207 9.80521 6.66663 9.5792 6.66663 9.33334V6.66667L6.67314 6.57553C6.70203 6.36603 6.8292 6.18027 7.01884 6.07878ZM7.99996 8.08724L8.13147 8L7.99996 7.91211V8.08724Z" fill="currentColor"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.3333 1.66667C12.7015 1.66667 13 1.96515 13 2.33334V3.00001H14.6666C15.0348 3.00001 15.3333 3.29848 15.3333 3.66667V12.3333C15.3333 12.7015 15.0348 13 14.6666 13H13V13.6667C13 14.0349 12.7015 14.3333 12.3333 14.3333H3.66663C3.29844 14.3333 2.99996 14.0349 2.99996 13.6667V13H1.33329C0.965103 13 0.666626 12.7015 0.666626 12.3333V3.66667C0.666626 3.29848 0.965103 3.00001 1.33329 3.00001H2.99996V2.33334C2.99996 1.96515 3.29844 1.66667 3.66663 1.66667H12.3333ZM4.33329 13H11.6666V3.00001H4.33329V13ZM1.99996 11.6667H2.99996V4.33334H1.99996V11.6667ZM13 11.6667H14V4.33334H13V11.6667Z" fill="currentColor"/>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.3334 1.33334C14.0698 1.33334 14.6667 1.9303 14.6667 2.66668V13.3333C14.6667 14.0697 14.0698 14.6667 13.3334 14.6667H2.66671C1.93033 14.6667 1.33337 14.0697 1.33337 13.3333V2.66668C1.33337 1.9303 1.93033 1.33334 2.66671 1.33334H13.3334ZM2.66671 12V13.3333H4.00004V12H2.66671ZM5.33337 13.3333H10.6667V8.66668H5.33337V13.3333ZM12 13.3333H13.3334V12H12V13.3333ZM2.66671 10.6667H4.00004V8.66668H2.66671V10.6667ZM12 10.6667H13.3334V8.66668H12V10.6667ZM2.66671 7.33334H4.00004V5.33334H2.66671V7.33334ZM5.33337 7.33334H10.6667V2.66668H5.33337V7.33334ZM12 7.33334H13.3334V5.33334H12V7.33334ZM2.66671 4.00001H4.00004V2.66668H2.66671V4.00001ZM12 4.00001H13.3334V2.66668H12V4.00001Z" fill="currentColor"/>
</svg>

After

Width:  |  Height:  |  Size: 851 B

View File

@ -83,6 +83,7 @@ import router from '@/router';
import { useEnterpriseStore } from '@/stores/modules/enterprise'; import { useEnterpriseStore } from '@/stores/modules/enterprise';
import { useSidebarStore } from '@/stores/modules/side-bar'; import { useSidebarStore } from '@/stores/modules/side-bar';
import { useUserStore } from '@/stores'; import { useUserStore } from '@/stores';
import { handleUserHome } from '@/utils/user';
import ExitAccountModal from '../exit-account-modal'; import ExitAccountModal from '../exit-account-modal';
import DownloadCenterModal from '../task-center-modal'; import DownloadCenterModal from '../task-center-modal';
@ -134,7 +135,7 @@ const setUnread = () => {
} }
}; };
const handleAgentClick = () => { const handleAgentClick = () => {
router.push({ name: props.isAgentRoute ? 'Home' : 'AgentIndex' }); props.isAgentRoute ? handleUserHome() : router.push({ name: 'AgentIndex' });
}; };
</script> </script>

View File

@ -8,6 +8,7 @@ import { useAppStore } from '@/stores';
import { useSidebarStore } from '@/stores/modules/side-bar'; import { useSidebarStore } from '@/stores/modules/side-bar';
import { MENU_LIST } from './menu-list'; import { MENU_LIST } from './menu-list';
import type { typeMenuItem } from './menu-list'; import type { typeMenuItem } from './menu-list';
import { handleUserHome } from '@/utils/user';
import icon1 from '@/assets/img/agent/icon1.png'; import icon1 from '@/assets/img/agent/icon1.png';
@ -124,7 +125,7 @@ export default defineComponent({
<Menu class={`siderBar-wrap p-16px w-full h-full flex flex-col ${sidebarStore.menuCollapse ? 'menu-fold' : ''}`}> <Menu class={`siderBar-wrap p-16px w-full h-full flex flex-col ${sidebarStore.menuCollapse ? 'menu-fold' : ''}`}>
<Menu.Item <Menu.Item
class={`menu-item !mb-0 ${currentRouteName.value === 'Home' ? 'active' : ''}`} class={`menu-item !mb-0 ${currentRouteName.value === 'Home' ? 'active' : ''}`}
onClick={() => onClickItem('Home')} onClick={handleUserHome}
> >
<img src={icon1} width={18} height={18} /> <img src={icon1} width={18} height={18} />
{!sidebarStore.menuCollapse && <span class="cts label">智能搜索</span>} {!sidebarStore.menuCollapse && <span class="cts label">智能搜索</span>}

View File

@ -43,7 +43,7 @@ export const MENU_LIST = <Record<string, typeMenuItem[]>>{
{ {
key: 'ModPutAccountData', key: 'ModPutAccountData',
icon: 'svg-putAccountData', icon: 'svg-putAccountData',
label: '账户数据', label: '账户数据',
routeName: 'PutAccountAccountData', routeName: 'PutAccountAccountData',
requireLogin: true, requireLogin: true,
activeMatch: ['PutAccountAccountData'], activeMatch: ['PutAccountAccountData'],
@ -72,20 +72,20 @@ export const MENU_LIST = <Record<string, typeMenuItem[]>>{
icon: 'svg-materialCenter', icon: 'svg-materialCenter',
children: [ children: [
{ {
key: 'ModMediaFinishProductsWareHouse', key: 'ModMaterialCenterFinishedProductsWareHouse',
icon: 'svg-finishProductsWareHouse', icon: 'svg-finishProductsWareHouse',
label: '成品库', label: '成品库',
routeName: 'FinishProductsWareHouse', routeName: 'MaterialCenterFinishedProducts',
requireLogin: true, requireLogin: true,
activeMatch: ['FinishProductsWareHouse', 'FinishProductsWareHouseWriter'], activeMatch: ['MaterialCenterFinishedProducts'],
}, },
{ {
key: 'ModMediaRawMaterialStorage', key: 'ModMaterialCenterRawMaterialStorage',
icon: 'svg-rawMaterialStorage', icon: 'svg-rawMaterialStorage',
label: '原料库', label: '原料库',
routeName: 'RawMaterialStorage', routeName: 'MaterialCenterRawMaterial',
requireLogin: true, requireLogin: true,
activeMatch: ['RawMaterialStorage', 'RawMaterialStorageWriter'], activeMatch: ['MaterialCenterRawMaterial'],
}, },
], ],
}, },
@ -122,4 +122,3 @@ export const MENU_LIST = <Record<string, typeMenuItem[]>>{
}, },
], ],
}; };

View File

@ -0,0 +1,164 @@
import type { AppRouteRecordRaw } from '../types';
import { MENU_GROUP_IDS } from '@/router/constants';
import IconContentManuscript from '@/assets/svg/svg-contentManuscript.svg';
const COMPONENTS: AppRouteRecordRaw[] = [
{
path: '/material-center',
name: 'MaterialCenter',
redirect: 'material-center/finished-products',
meta: {
locale: '素材中心',
icon: IconContentManuscript,
requiresAuth: true,
requireLogin: true,
roles: ['*'],
id: MENU_GROUP_IDS.CREATIVE_GENERATION_WORKSHOP_ID,
},
children: [
{
path: 'finished-products',
name: 'MaterialCenterFinishedProducts',
meta: {
locale: '成品库',
requiresAuth: true,
requireLogin: true,
roles: ['*'],
},
component: () => import('@/views/material-center/index.vue'),
},
{
path: 'raw-material',
name: 'MaterialCenterRawMaterial',
meta: {
locale: '原料库',
requiresAuth: true,
requireLogin: true,
roles: ['*'],
},
component: () => import('@/views/material-center/index.vue'),
},
// {
// path: 'list',
// name: 'ManuscriptList',
// meta: {
// locale: '内容稿件列表',
// requiresAuth: true,
// requireLogin: true,
// roles: ['*'],
// },
// component: () => import('@/views/creative-generation-workshop/manuscript/list/index.vue'),
// },
// {
// path: 'upload',
// name: 'ManuscriptUpload',
// meta: {
// locale: '稿件上传',
// requiresAuth: true,
// requireLogin: true,
// hideFooter: true,
// roles: ['*'],
// hideInMenu: true,
// activeMenu: 'ManuscriptList',
// },
// component: () => import('@/views/creative-generation-workshop/manuscript/upload/index.vue'),
// },
// {
// path: 'edit/:id',
// name: 'ManuscriptEdit',
// meta: {
// locale: '账号详情',
// requiresAuth: true,
// requireLogin: true,
// hideFooter: true,
// roles: ['*'],
// hideInMenu: true,
// activeMenu: 'ManuscriptList',
// },
// component: () => import('@/views/creative-generation-workshop/manuscript/edit/index.vue'),
// },
// {
// path: 'detail/:id',
// name: 'ManuscriptDetail',
// meta: {
// locale: '稿件详情',
// requiresAuth: true,
// requireLogin: true,
// hideFooter: true,
// roles: ['*'],
// hideInMenu: true,
// activeMenu: 'ManuscriptList',
// },
// component: () => import('@/views/creative-generation-workshop/manuscript/detail/index.vue'),
// },
// {
// path: 'check-list',
// name: 'ManuscriptCheckList',
// meta: {
// locale: '内容稿件审核',
// requiresAuth: true,
// requireLogin: true,
// roles: ['*'],
// },
// component: () => import('@/views/creative-generation-workshop/manuscript/check-list/index.vue'),
// },
// {
// path: 'check-list/detail/:id',
// name: 'ManuscriptCheckListDetail',
// meta: {
// locale: '内容稿件审核详情',
// requiresAuth: true,
// requireLogin: true,
// hideFooter: true,
// hideInMenu: true,
// roles: ['*'],
// activeMenu: 'ManuscriptCheckList',
// },
// component: () => import('@/views/creative-generation-workshop/manuscript/detail/index.vue'),
// },
// {
// path: 'check',
// name: 'ManuscriptCheck',
// meta: {
// locale: '稿件审核',
// requiresAuth: true,
// requireLogin: true,
// hideFooter: true,
// roles: ['*'],
// hideInMenu: true,
// activeMenu: 'ManuscriptCheckList',
// },
// component: () => import('@/views/creative-generation-workshop/manuscript/check/index.vue'),
// },
],
},
// {
// path: '/explore/list/:shareCode',
// name: 'ExploreList',
// meta: {
// locale: '分享链接列表',
// requiresAuth: false,
// requireLogin: false,
// hideFooter: true,
// hideSidebar: true,
// roles: ['*'],
// },
// component: () => import('@/views/creative-generation-workshop/explore/list/index.vue'),
// },
// {
// path: '/explore/detail/:shareCode/:id',
// name: 'ExploreDetail',
// meta: {
// locale: '分享链接详情',
// requiresAuth: false,
// requireLogin: false,
// hideFooter: true,
// hideSidebar: true,
// roles: ['*'],
// },
// component: () => import('@/views/creative-generation-workshop/explore/detail/index.vue'),
// },
];
export default COMPONENTS;

View File

@ -16,3 +16,29 @@
font-family: 'Manrope-SemiBold'; font-family: 'Manrope-SemiBold';
src: url('@/assets/fonts/Manrope-SemiBold.ttf'); src: url('@/assets/fonts/Manrope-SemiBold.ttf');
} }
.font-family-regular {
font-family: $font-family-regular;
}
.font-family-medium {
font-family: $font-family-medium;
}
.font-family-light {
font-family: $font-family-light;
}
.font-family-bold {
font-family: $font-family-bold;
}
.font-family-manrope-regular {
font-family: $font-family-manrope-regular;
}
.font-family-manrope-medium {
font-family: $font-family-manrope-medium;
}
.font-family-manrope-bold {
font-family: $font-family-manrope-bold;
}
.font-family-manrope-semiBold {
font-family: $font-family-manrope-semiBold;
}

View File

@ -8,7 +8,7 @@
:columns="columns" :columns="columns"
:data="dataSource" :data="dataSource"
:pagination="pagination" :pagination="pagination"
class="mt-8px h-540px" class="mt-8px"
@page-change="handlePageChange" @page-change="handlePageChange"
@page-size-change="handlePageSizeChange" @page-size-change="handlePageSizeChange"
> >

View File

@ -3,7 +3,7 @@
<div class="title-row"> <div class="title-row">
<span class="title">企业信息</span> <span class="title">企业信息</span>
</div> </div>
<a-table :columns="columns" :data="dataSource" :pagination="false" class="mt-8px h-540px"> <a-table :columns="columns" :data="dataSource" :pagination="false" class="mt-8px">
<template #empty> <template #empty>
<NoData /> <NoData />
</template> </template>

View File

@ -3,7 +3,7 @@
<div class="title-row"> <div class="title-row">
<span class="title">个人信息</span> <span class="title">个人信息</span>
</div> </div>
<a-table :columns="columns" :data="dataSource" :pagination="false" class="mt-8px h-540px"> <a-table :columns="columns" :data="dataSource" :pagination="false" class="mt-8px">
<template #empty> <template #empty>
<NoData /> <NoData />
</template> </template>

View File

@ -5,6 +5,7 @@ import SenderInput from '../sender-input/index.vue';
import { useSharedDataStore } from '@/stores/modules/share-data'; import { useSharedDataStore } from '@/stores/modules/share-data';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { handleUserHome } from '@/utils/user';
export default { export default {
setup(props, { emit, expose }) { setup(props, { emit, expose }) {
@ -20,12 +21,7 @@ export default {
const handleSearch = () => { const handleSearch = () => {
console.log('searchValue.value', searchValue.value); console.log('searchValue.value', searchValue.value);
// const conversationId = searchValue.value; // const conversationId = searchValue.value;
// router.push({ // handleUserHome({conversationId})
// name: 'Home',
// params: {
// conversationId,
// },
// });
}; };
const tagList = [ const tagList = [

View File

@ -5,6 +5,8 @@ import Conversations from '@/components/xt-chat/xt-conversations';
import SvgIcon from '@/components/svg-icon'; import SvgIcon from '@/components/svg-icon';
import { Button, Flex, Input } from 'ant-design-vue'; import { Button, Flex, Input } from 'ant-design-vue';
import DeleteChatModal from './delete-chat-modal.vue'; import DeleteChatModal from './delete-chat-modal.vue';
import { handleUserHome } from '@/utils/user';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
export default { export default {
@ -48,12 +50,7 @@ export default {
}; };
const handleActiveChange = (item) => { const handleActiveChange = (item) => {
const { id } = item; const { id } = item;
router.push({ handleUserHome({ conversationId: id });
name: 'Home',
params: {
conversationId: id,
},
});
}; };
expose({ expose({

View File

@ -0,0 +1,26 @@
export enum AuditStatus {
All = '0',
Pending = '1',
Auditing = '2',
Passed = '3',
}
export const TABS_LIST = [
{
label: '全部',
value: AuditStatus.All,
},
{
label: '待审核',
value: AuditStatus.Pending,
},
{
label: '审核中',
value: AuditStatus.Auditing,
},
{
label: '已通过',
value: AuditStatus.Passed,
},
];

View File

@ -0,0 +1,35 @@
<script lang="tsx">
import { Tabs, TabPane } from 'ant-design-vue';
import { TABS_LIST, AuditStatus } from './constants';
export default defineComponent({
setup(_, { attrs, slots, expose }) {
const activeKey = ref(AuditStatus.All);
return () => (
<div class="finished-products-wrap h-full flex flex-col">
<div class="bg-#fff rounded-8px mb-16px">
<Tabs v-model:activeKey={activeKey.value} v-slots={{
'rightExtra': () => (
<div class="flex items-center">
123
</div>
)
}}>
{TABS_LIST.map((item) => (
<TabPane key={item.value} tab={item.label}>
{item.label}
</TabPane>
))}
</Tabs>
</div>
</div>
);
},
});
</script>
<style scoped lang="scss">
@import './style.scss';
</style>

View File

@ -0,0 +1,37 @@
.finished-products-wrap {
:deep(.ant-tabs) {
.ant-tabs-nav {
margin-bottom: 0;
padding: 0 24px;
.ant-tabs-nav-wrap {
height: 56px;
.ant-tabs-nav-list {
.ant-tabs-tab {
.ant-tabs-tab-btn {
color: var(--Text-2, #55585f);
font-family: $font-family-regular;
font-size: 16px;
font-style: normal;
font-weight: 400;
line-height: 24px;
}
&.ant-tabs-tab-active {
.ant-tabs-tab-btn {
color: var(--Brand-6, #6d4cfe);
font-weight: 500;
font-family: $font-family-medium;
text-shadow: none;
}
}
}
.ant-tabs-ink-bar {
background: #6D4CFE;
}
}
}
}
.ant-tabs-content-holder {
display: none;
}
}
}

View File

@ -0,0 +1,16 @@
<script lang="tsx">
export default defineComponent({
setup(_, { attrs, slots, expose }) {
return () => (
<div class="raw-material-wrap h-full flex flex-col">
原材料库
</div>
);
},
});
</script>
<style scoped lang="scss">
@import './style.scss';
</style>

View File

@ -0,0 +1,3 @@
.raw-material-wrap {
}

View File

@ -0,0 +1,54 @@
<script lang="tsx">
import FinishedProducts from './components/finished-products/index.vue';
import RawMaterial from './components/raw-material/index.vue';
const TABS = [
{
label: '成品库',
key: '1',
routeName: 'MaterialCenterFinishedProducts',
},
{
label: '原料库',
key: '2',
routeName: 'MaterialCenterRawMaterial',
},
];
export default defineComponent({
setup(_, { attrs, slots, expose }) {
const route = useRoute();
const router = useRouter();
const activeKey = ref('1');
onMounted(() => {
activeKey.value = TABS.find((item) => item.routeName === route.name)?.key;
});
return () => (
<div class="material-center-wrap h-full flex flex-col">
<header class="py-16px px-24px rounded-8px bg-#fff flex items-center mb-16px">
{TABS.map((item) => (
<p
key={item.key}
class={`font-family-medium color-#737478 font-400 text-16px lh-24px cursor-pointer mr-32px ${
item.key === activeKey.value ? '!color-#6D4CFE font-500' : ''
}`}
onClick={() => {
activeKey.value = item.key;
router.push({ name: item.routeName });
}}
>
{item.label}
</p>
))}
</header>
{activeKey.value === '1' ? <FinishedProducts /> : <RawMaterial />}
</div>
);
},
});
</script>
<style scoped lang="scss">
@import './style.scss';
</style>

View File

@ -0,0 +1,2 @@
.material-center-wrap {
}