FEAT => 本次更新项目为:统一内容管理的导航路径,将所有相关路径前缀修改为 "/mine/content",以提升路由结构的一致性和用户体验。
This commit is contained in:
@@ -168,7 +168,7 @@ const ContentLibraryList: React.FC = () => {
|
||||
};
|
||||
|
||||
const handleViewMaterials = (id: string) => {
|
||||
navigate(`/content/materials/${id}`);
|
||||
navigate(`/mine/content/materials/${id}`);
|
||||
};
|
||||
|
||||
const handleSearch = () => {
|
||||
|
||||
@@ -158,7 +158,7 @@ const MaterialForm: React.FC = () => {
|
||||
content: isEdit ? "更新成功" : "创建成功",
|
||||
position: "top",
|
||||
});
|
||||
navigate(`/content/materials/${libraryId}`);
|
||||
navigate(`/mine/content/materials/${libraryId}`);
|
||||
} catch (error: unknown) {
|
||||
console.error("保存素材失败:", error);
|
||||
Toast.show({
|
||||
@@ -171,7 +171,7 @@ const MaterialForm: React.FC = () => {
|
||||
};
|
||||
|
||||
const handleBack = () => {
|
||||
navigate(`/content/materials/${libraryId}`);
|
||||
navigate(`/mine/content/materials/${libraryId}`);
|
||||
};
|
||||
|
||||
if (loading) {
|
||||
|
||||
@@ -72,11 +72,11 @@ const MaterialsList: React.FC = () => {
|
||||
}, [fetchMaterials]);
|
||||
|
||||
const handleCreateNew = () => {
|
||||
navigate(`/content/materials/new/${id}`);
|
||||
navigate(`/mine/content/materials/new/${id}`);
|
||||
};
|
||||
|
||||
const handleEdit = (materialId: number) => {
|
||||
navigate(`/content/materials/edit/${id}/${materialId}`);
|
||||
navigate(`/mine/content/materials/edit/${id}/${materialId}`);
|
||||
};
|
||||
|
||||
const handleDelete = async (materialId: number) => {
|
||||
|
||||
@@ -168,7 +168,7 @@ const ContentLibraryList: React.FC = () => {
|
||||
};
|
||||
|
||||
const handleViewMaterials = (id: string) => {
|
||||
navigate(`/content/materials/${id}`);
|
||||
navigate(`/mine/content/materials/${id}`);
|
||||
};
|
||||
|
||||
const handleRefresh = () => {
|
||||
|
||||
@@ -158,7 +158,7 @@ const MaterialForm: React.FC = () => {
|
||||
content: isEdit ? "更新成功" : "创建成功",
|
||||
position: "top",
|
||||
});
|
||||
navigate(`/content/materials/${libraryId}`);
|
||||
navigate(`/mine/content/materials/${libraryId}`);
|
||||
} catch (error: unknown) {
|
||||
console.error("保存素材失败:", error);
|
||||
Toast.show({
|
||||
@@ -171,7 +171,7 @@ const MaterialForm: React.FC = () => {
|
||||
};
|
||||
|
||||
const handleBack = () => {
|
||||
navigate(`/content/materials/${libraryId}`);
|
||||
navigate(`/mine/content/materials/${libraryId}`);
|
||||
};
|
||||
|
||||
if (loading) {
|
||||
|
||||
@@ -72,11 +72,11 @@ const MaterialsList: React.FC = () => {
|
||||
}, [fetchMaterials]);
|
||||
|
||||
const handleCreateNew = () => {
|
||||
navigate(`/content/materials/new/${id}`);
|
||||
navigate(`/mine/content/materials/new/${id}`);
|
||||
};
|
||||
|
||||
const handleEdit = (materialId: number) => {
|
||||
navigate(`/content/materials/edit/${id}/${materialId}`);
|
||||
navigate(`/mine/content/materials/edit/${id}/${materialId}`);
|
||||
};
|
||||
|
||||
const handleDelete = async (materialId: number) => {
|
||||
@@ -109,11 +109,6 @@ const MaterialsList: React.FC = () => {
|
||||
console.log("查看素材:", materialId);
|
||||
};
|
||||
|
||||
const handleSearch = () => {
|
||||
setCurrentPage(1);
|
||||
fetchMaterials();
|
||||
};
|
||||
|
||||
const handleRefresh = () => {
|
||||
fetchMaterials();
|
||||
};
|
||||
@@ -283,6 +278,7 @@ const MaterialsList: React.FC = () => {
|
||||
<>
|
||||
<NavCommon
|
||||
title="素材管理"
|
||||
backFn={() => navigate("/mine/content")}
|
||||
right={
|
||||
<Button type="primary" onClick={handleCreateNew}>
|
||||
<PlusOutlined /> 新建素材
|
||||
|
||||
@@ -132,12 +132,6 @@ const ScenarioList: React.FC = () => {
|
||||
fetchScenarioData();
|
||||
}, [scenarioId]);
|
||||
|
||||
// 加载下一页数据
|
||||
const handleLoadMore = async () => {
|
||||
if (loadingMore || !hasMore) return;
|
||||
await fetchPlanList(currentPage + 1, true);
|
||||
};
|
||||
|
||||
// 分页改变处理
|
||||
const handlePageChange = async (page: number) => {
|
||||
setCurrentPage(page);
|
||||
|
||||
@@ -166,6 +166,7 @@ const AutoGroupList: React.FC = () => {
|
||||
<>
|
||||
<NavCommon
|
||||
title="自动建群"
|
||||
backFn={() => navigate("/workspace")}
|
||||
right={
|
||||
<Button size="small" color="primary" onClick={handleCreateNew}>
|
||||
<PlusOutlined /> 新建任务
|
||||
|
||||
@@ -110,10 +110,6 @@ const GroupPush: React.FC = () => {
|
||||
fetchTasks();
|
||||
}, []);
|
||||
|
||||
const toggleExpand = (taskId: string) => {
|
||||
setExpandedTaskId(expandedTaskId === taskId ? null : taskId);
|
||||
};
|
||||
|
||||
const handleDelete = async (taskId: string) => {
|
||||
if (!window.confirm("确定要删除该任务吗?")) return;
|
||||
await deleteGroupPushTask(taskId);
|
||||
@@ -178,6 +174,7 @@ const GroupPush: React.FC = () => {
|
||||
<>
|
||||
<NavCommon
|
||||
title="群消息推送"
|
||||
backFn={() => navigate("/workspace")}
|
||||
right={
|
||||
<Button
|
||||
type="primary"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { Card, NavBar, Badge } from "antd-mobile";
|
||||
import { Card, Badge } from "antd-mobile";
|
||||
import {
|
||||
LikeOutlined,
|
||||
SendOutlined,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
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 {
|
||||
PlusOutlined,
|
||||
@@ -13,7 +13,6 @@ import {
|
||||
CopyOutlined,
|
||||
MoreOutlined,
|
||||
ClockCircleOutlined,
|
||||
ArrowLeftOutlined,
|
||||
} from "@ant-design/icons";
|
||||
import Layout from "@/components/Layout/Layout";
|
||||
import style from "./index.module.scss";
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
.ruleFooter {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 13px;
|
||||
font-size: 12px;
|
||||
color: #888;
|
||||
margin-top: 6px;
|
||||
align-items: center;
|
||||
|
||||
@@ -75,12 +75,6 @@ const TrafficDistributionList: React.FC = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const handleSearch = (val: string) => {
|
||||
setSearchQuery(val);
|
||||
setPage(1);
|
||||
fetchList(1, val);
|
||||
};
|
||||
|
||||
const handlePageChange = (p: number) => {
|
||||
setPage(p);
|
||||
fetchList(p, searchQuery);
|
||||
@@ -277,6 +271,7 @@ const TrafficDistributionList: React.FC = () => {
|
||||
<>
|
||||
<NavCommon
|
||||
title="流量分发"
|
||||
backFn={() => navigate("/workspace")}
|
||||
right={
|
||||
<Button
|
||||
type="primary"
|
||||
|
||||
@@ -72,12 +72,12 @@ export const routeGroups = {
|
||||
content: {
|
||||
name: "内容管理",
|
||||
routes: [
|
||||
"/content",
|
||||
"/content/new",
|
||||
"/content/edit/:id",
|
||||
"/content/materials/:id",
|
||||
"/content/materials/new/:id",
|
||||
"/content/materials/edit/:id/:materialId",
|
||||
"/mine/content",
|
||||
"/mine/content/new",
|
||||
"/mine/content/edit/:id",
|
||||
"/mine/content/materials/:id",
|
||||
"/mine/content/materials/new/:id",
|
||||
"/mine/content/materials/edit/:id/:materialId",
|
||||
],
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user