FEAT => 本次更新项目为:统一内容管理的导航路径,将所有相关路径前缀修改为 "/mine/content",以提升路由结构的一致性和用户体验。

This commit is contained in:
超级老白兔
2025-08-11 11:27:49 +08:00
parent 90f29da343
commit bea245ced9
14 changed files with 23 additions and 41 deletions

View File

@@ -168,7 +168,7 @@ const ContentLibraryList: React.FC = () => {
}; };
const handleViewMaterials = (id: string) => { const handleViewMaterials = (id: string) => {
navigate(`/content/materials/${id}`); navigate(`/mine/content/materials/${id}`);
}; };
const handleSearch = () => { const handleSearch = () => {

View File

@@ -158,7 +158,7 @@ const MaterialForm: React.FC = () => {
content: isEdit ? "更新成功" : "创建成功", content: isEdit ? "更新成功" : "创建成功",
position: "top", position: "top",
}); });
navigate(`/content/materials/${libraryId}`); navigate(`/mine/content/materials/${libraryId}`);
} catch (error: unknown) { } catch (error: unknown) {
console.error("保存素材失败:", error); console.error("保存素材失败:", error);
Toast.show({ Toast.show({
@@ -171,7 +171,7 @@ const MaterialForm: React.FC = () => {
}; };
const handleBack = () => { const handleBack = () => {
navigate(`/content/materials/${libraryId}`); navigate(`/mine/content/materials/${libraryId}`);
}; };
if (loading) { if (loading) {

View File

@@ -72,11 +72,11 @@ const MaterialsList: React.FC = () => {
}, [fetchMaterials]); }, [fetchMaterials]);
const handleCreateNew = () => { const handleCreateNew = () => {
navigate(`/content/materials/new/${id}`); navigate(`/mine/content/materials/new/${id}`);
}; };
const handleEdit = (materialId: number) => { const handleEdit = (materialId: number) => {
navigate(`/content/materials/edit/${id}/${materialId}`); navigate(`/mine/content/materials/edit/${id}/${materialId}`);
}; };
const handleDelete = async (materialId: number) => { const handleDelete = async (materialId: number) => {

View File

@@ -168,7 +168,7 @@ const ContentLibraryList: React.FC = () => {
}; };
const handleViewMaterials = (id: string) => { const handleViewMaterials = (id: string) => {
navigate(`/content/materials/${id}`); navigate(`/mine/content/materials/${id}`);
}; };
const handleRefresh = () => { const handleRefresh = () => {

View File

@@ -158,7 +158,7 @@ const MaterialForm: React.FC = () => {
content: isEdit ? "更新成功" : "创建成功", content: isEdit ? "更新成功" : "创建成功",
position: "top", position: "top",
}); });
navigate(`/content/materials/${libraryId}`); navigate(`/mine/content/materials/${libraryId}`);
} catch (error: unknown) { } catch (error: unknown) {
console.error("保存素材失败:", error); console.error("保存素材失败:", error);
Toast.show({ Toast.show({
@@ -171,7 +171,7 @@ const MaterialForm: React.FC = () => {
}; };
const handleBack = () => { const handleBack = () => {
navigate(`/content/materials/${libraryId}`); navigate(`/mine/content/materials/${libraryId}`);
}; };
if (loading) { if (loading) {

View File

@@ -72,11 +72,11 @@ const MaterialsList: React.FC = () => {
}, [fetchMaterials]); }, [fetchMaterials]);
const handleCreateNew = () => { const handleCreateNew = () => {
navigate(`/content/materials/new/${id}`); navigate(`/mine/content/materials/new/${id}`);
}; };
const handleEdit = (materialId: number) => { const handleEdit = (materialId: number) => {
navigate(`/content/materials/edit/${id}/${materialId}`); navigate(`/mine/content/materials/edit/${id}/${materialId}`);
}; };
const handleDelete = async (materialId: number) => { const handleDelete = async (materialId: number) => {
@@ -109,11 +109,6 @@ const MaterialsList: React.FC = () => {
console.log("查看素材:", materialId); console.log("查看素材:", materialId);
}; };
const handleSearch = () => {
setCurrentPage(1);
fetchMaterials();
};
const handleRefresh = () => { const handleRefresh = () => {
fetchMaterials(); fetchMaterials();
}; };
@@ -283,6 +278,7 @@ const MaterialsList: React.FC = () => {
<> <>
<NavCommon <NavCommon
title="素材管理" title="素材管理"
backFn={() => navigate("/mine/content")}
right={ right={
<Button type="primary" onClick={handleCreateNew}> <Button type="primary" onClick={handleCreateNew}>
<PlusOutlined /> <PlusOutlined />

View File

@@ -132,12 +132,6 @@ const ScenarioList: React.FC = () => {
fetchScenarioData(); fetchScenarioData();
}, [scenarioId]); }, [scenarioId]);
// 加载下一页数据
const handleLoadMore = async () => {
if (loadingMore || !hasMore) return;
await fetchPlanList(currentPage + 1, true);
};
// 分页改变处理 // 分页改变处理
const handlePageChange = async (page: number) => { const handlePageChange = async (page: number) => {
setCurrentPage(page); setCurrentPage(page);

View File

@@ -166,6 +166,7 @@ const AutoGroupList: React.FC = () => {
<> <>
<NavCommon <NavCommon
title="自动建群" title="自动建群"
backFn={() => navigate("/workspace")}
right={ right={
<Button size="small" color="primary" onClick={handleCreateNew}> <Button size="small" color="primary" onClick={handleCreateNew}>
<PlusOutlined /> <PlusOutlined />

View File

@@ -110,10 +110,6 @@ const GroupPush: React.FC = () => {
fetchTasks(); fetchTasks();
}, []); }, []);
const toggleExpand = (taskId: string) => {
setExpandedTaskId(expandedTaskId === taskId ? null : taskId);
};
const handleDelete = async (taskId: string) => { const handleDelete = async (taskId: string) => {
if (!window.confirm("确定要删除该任务吗?")) return; if (!window.confirm("确定要删除该任务吗?")) return;
await deleteGroupPushTask(taskId); await deleteGroupPushTask(taskId);
@@ -178,6 +174,7 @@ const GroupPush: React.FC = () => {
<> <>
<NavCommon <NavCommon
title="群消息推送" title="群消息推送"
backFn={() => navigate("/workspace")}
right={ right={
<Button <Button
type="primary" type="primary"

View File

@@ -1,6 +1,6 @@
import React from "react"; import React from "react";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import { Card, NavBar, Badge } from "antd-mobile"; import { Card, Badge } from "antd-mobile";
import { import {
LikeOutlined, LikeOutlined,
SendOutlined, SendOutlined,

View File

@@ -1,7 +1,7 @@
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
import { Switch, Input, message, Dropdown, Menu } from "antd"; import { Switch, Input, message, Dropdown, Menu } from "antd";
import { NavBar, Button } from "antd-mobile"; import { Button } from "antd-mobile";
import NavCommon from "@/components/NavCommon"; import NavCommon from "@/components/NavCommon";
import { import {
PlusOutlined, PlusOutlined,
@@ -13,7 +13,6 @@ import {
CopyOutlined, CopyOutlined,
MoreOutlined, MoreOutlined,
ClockCircleOutlined, ClockCircleOutlined,
ArrowLeftOutlined,
} from "@ant-design/icons"; } from "@ant-design/icons";
import Layout from "@/components/Layout/Layout"; import Layout from "@/components/Layout/Layout";
import style from "./index.module.scss"; import style from "./index.module.scss";

View File

@@ -98,7 +98,7 @@
.ruleFooter { .ruleFooter {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
font-size: 13px; font-size: 12px;
color: #888; color: #888;
margin-top: 6px; margin-top: 6px;
align-items: center; align-items: center;

View File

@@ -75,12 +75,6 @@ const TrafficDistributionList: React.FC = () => {
} }
}; };
const handleSearch = (val: string) => {
setSearchQuery(val);
setPage(1);
fetchList(1, val);
};
const handlePageChange = (p: number) => { const handlePageChange = (p: number) => {
setPage(p); setPage(p);
fetchList(p, searchQuery); fetchList(p, searchQuery);
@@ -277,6 +271,7 @@ const TrafficDistributionList: React.FC = () => {
<> <>
<NavCommon <NavCommon
title="流量分发" title="流量分发"
backFn={() => navigate("/workspace")}
right={ right={
<Button <Button
type="primary" type="primary"

View File

@@ -72,12 +72,12 @@ export const routeGroups = {
content: { content: {
name: "内容管理", name: "内容管理",
routes: [ routes: [
"/content", "/mine/content",
"/content/new", "/mine/content/new",
"/content/edit/:id", "/mine/content/edit/:id",
"/content/materials/:id", "/mine/content/materials/:id",
"/content/materials/new/:id", "/mine/content/materials/new/:id",
"/content/materials/edit/:id/:materialId", "/mine/content/materials/edit/:id/:materialId",
], ],
}, },