新增用户列表数据字段,更新导航组件图标和功能,优化内容管理界面,调整微信页面加载逻辑,移除ProfileCard组件中的调试信息。
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -82,6 +82,8 @@ export interface KfUserListData {
|
||||
labels: string[];
|
||||
lastUpdateTime: string;
|
||||
isOnline?: boolean;
|
||||
momentsMax: number;
|
||||
momentsNum: number;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
|
||||
@@ -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}>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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连接
|
||||
|
||||
Reference in New Issue
Block a user