新增用户列表数据字段,更新导航组件图标和功能,优化内容管理界面,调整微信页面加载逻辑,移除ProfileCard组件中的调试信息。

This commit is contained in:
超级老白兔
2025-10-14 18:13:38 +08:00
parent 892e82c1d6
commit 811ebff52f
5 changed files with 23 additions and 45 deletions

View File

@@ -16,7 +16,8 @@ import {
LogoutOutlined,
ThunderboltOutlined,
SettingOutlined,
WechatOutlined,
CalendarOutlined,
RetweetOutlined,
} from "@ant-design/icons";
import { noticeList, readMessage, readAll } from "./api";
import { useUserStore } from "@/store/module/user";
@@ -64,8 +65,8 @@ const NavCommon: React.FC<NavCommonProps> = ({ title = "触客宝" }) => {
}, []);
// 处理菜单图标点击:在两个路由之间切换
const handleMenuClick = (index: number) => {
if (index === 0) {
const handleMenuClick = () => {
if (!location.pathname.startsWith("/pc/powerCenter")) {
navigate("/pc/powerCenter");
} else {
navigate("/pc/weChat");
@@ -205,24 +206,27 @@ const NavCommon: React.FC<NavCommonProps> = ({ title = "触客宝" }) => {
onClick: handleLogout,
},
];
const handleContentManagementClick = () => {
navigate("/pc/powerCenter/content-management");
};
return (
<>
<Header className={styles.header}>
<div className={styles.headerLeft}>
<Button
icon={<BarChartOutlined />}
type={!isWeChat() ? "primary" : "default"}
onClick={() => handleMenuClick(0)}
icon={<BarChartOutlined style={{ fontSize: 18 }} />}
type="primary"
onClick={handleMenuClick}
>
{isWeChat() ? "功能中心" : "Ai智能客服"}
<RetweetOutlined style={{ fontSize: 18 }} />
</Button>
<Button
icon={<WechatOutlined />}
type={isWeChat() ? "primary" : "default"}
onClick={() => handleMenuClick(1)}
icon={<CalendarOutlined />}
onClick={handleContentManagementClick}
>
Ai智能客服
</Button>
<span className={styles.title}>{title}</span>
</div>

View File

@@ -82,6 +82,8 @@ export interface KfUserListData {
labels: string[];
lastUpdateTime: string;
isOnline?: boolean;
momentsMax: number;
momentsNum: number;
[key: string]: any;
}

View File

@@ -30,19 +30,6 @@ const ContentManagement: React.FC = () => {
{ key: "keyword", label: "关键词回复" },
];
// 按钮点击处理函数
const handleAddMaterial = () => {
setMaterialModalVisible(true);
};
const handleAddSensitiveWord = () => {
setSensitiveWordModalVisible(true);
};
const handleAddKeyword = () => {
setKeywordModalVisible(true);
};
// 弹窗成功回调
const handleModalSuccess = () => {
console.log("handleModalSuccess");
@@ -94,23 +81,7 @@ const ContentManagement: React.FC = () => {
subtitle="可以讲聊天过程的信息收录到素材库中,也调用。"
showBackButton={true}
backButtonText="返回功能中心"
rightContent={
<div className={styles.headerActions}>
<Button
icon={<PlusOutlined />}
type="primary"
onClick={handleAddMaterial}
>
</Button>
<Button icon={<PlusOutlined />} onClick={handleAddSensitiveWord}>
</Button>
<Button icon={<PlusOutlined />} onClick={handleAddKeyword}>
</Button>
</div>
}
rightContent={<div className={styles.headerActions}></div>}
/>
<div className={styles.tabsSection}>

View File

@@ -16,7 +16,6 @@ interface PersonProps {
const Person: React.FC<PersonProps> = ({ contract }) => {
const [activeKey, setActiveKey] = useState("profile");
const isGroup = "chatroomId" in contract;
console.log(contract);
return (
<Sider width={330} className={styles.profileSider}>
<LayoutFiexd

View File

@@ -9,14 +9,16 @@ import styles from "./index.module.scss";
const { Content, Sider } = Layout;
import { chatInitAPIdata, initSocket } from "./main";
import { useWeChatStore } from "@/store/module/weChat/weChat";
import { getIsLoadWeChat } from "@/store/module/ckchat/ckchat";
const CkboxPage: React.FC = () => {
// 不要在组件初始化时获取sendCommand而是在需要时动态获取
const [loading, setLoading] = useState(false);
const currentContract = useWeChatStore(state => state.currentContract);
useEffect(() => {
// 方法一:使用 Promise 链式调用处理异步函数
setLoading(true);
if (!getIsLoadWeChat()) {
setLoading(true);
}
chatInitAPIdata()
.then(() => {
// 数据加载完成后初始化WebSocket连接