調整Ckbox頁面標題及優化CommonConfig組件:將標題更改為「觸客寶」,並重構標籤頁內容顯示邏輯,新增佔位符以顯示未開發功能,提升用戶體驗。

This commit is contained in:
超级老白兔
2025-09-26 17:00:26 +08:00
parent 43209882e4
commit 0b50724b2f
6 changed files with 284 additions and 130 deletions

View File

@@ -0,0 +1,9 @@
import request from "@/api/request";
export const getAiSettings = () => {
return request("/v1/kefu/ai/settings/get", "GET");
};
export const setAiSettings = (data: any) => {
return request("/v1/kefu/ai/settings/set", "POST", data);
};

View File

@@ -0,0 +1,78 @@
.container {
display: flex;
gap: 24px;
height: 100%;
.left {
flex: 1;
min-width: 0;
.tip {
background: #f6f8fa;
border: 1px solid #e1e4e8;
border-radius: 6px;
padding: 12px 16px;
margin-bottom: 20px;
font-size: 14px;
color: #586069;
line-height: 1.5;
}
.formItem {
margin-bottom: 20px;
.label {
font-size: 14px;
font-weight: 500;
color: #24292e;
margin-bottom: 8px;
}
}
.primaryBtn {
margin-top: 20px;
height: 40px;
font-size: 14px;
font-weight: 500;
}
}
.right {
flex: 1;
min-width: 0;
:global(.ant-list-item) {
padding: 16px 0;
border-bottom: 1px solid #f0f0f0;
&:last-child {
border-bottom: none;
}
}
:global(.ant-list-item-meta-title) {
font-size: 14px;
font-weight: 500;
color: #24292e;
margin-bottom: 4px;
}
:global(.ant-list-item-meta-description) {
font-size: 12px;
color: #586069;
}
}
}
// 响应式设计
@media (max-width: 768px) {
.container {
flex-direction: column;
gap: 16px;
.left,
.right {
flex: none;
}
}
}

View File

@@ -0,0 +1,114 @@
import React, { useState } from "react";
import { Card, Select, Button, Space, Tag, List } from "antd";
import { DatabaseOutlined } from "@ant-design/icons";
import styles from "./index.module.scss";
const { Option } = Select;
const ReceptionSettings: React.FC = () => {
const [pool, setPool] = useState<string | undefined>();
const [mode, setMode] = useState<string>("人工接待");
const pools = ["官网咨询", "朋友推荐", "展会获客"];
const typeOptions = [
{ value: 0, label: "人工接待" },
{ value: 1, label: "AI辅助" },
{ value: 2, label: "AI接管" },
];
const [currentConfig, setCurrentConfig] = useState<number | null>(null);
return (
<div className={styles.container}>
<div className={styles.left}>
<Card
title={
<Space size={8}>
<DatabaseOutlined />
<span></span>
</Space>
}
>
<div className={styles.tip}>
</div>
<div className={styles.formItem}>
<div className={styles.label}></div>
<Select
placeholder="请选择流量池"
value={pool}
onChange={setPool}
style={{ width: "100%" }}
>
{pools.map(p => (
<Option key={p} value={p}>
{p}
</Option>
))}
</Select>
</div>
<div className={styles.formItem}>
<div className={styles.label}></div>
<Select
value={mode}
onChange={setCurrentConfig}
style={{ width: "100%" }}
>
{typeOptions.map(option => (
<Option key={option.value} value={option.value}>
{option.label}
</Option>
))}
</Select>
</div>
{JSON.stringify(currentConfig)}
<Button type="primary" block className={styles.primaryBtn}>
</Button>
</Card>
</div>
<div className={styles.right}>
<Card
title={
<Space size={8}>
<DatabaseOutlined />
<span></span>
</Space>
}
>
<List
itemLayout="horizontal"
dataSource={pools}
renderItem={(item, index) => (
<List.Item>
<List.Item.Meta
title={item}
description={`${Math.floor(Math.random() * 300) + 50} 个客户`}
/>
<Tag
color={
index % 3 === 0
? "blue"
: index % 3 === 1
? "orange"
: "green"
}
>
{index % 3 === 0
? "AI辅助"
: index % 3 === 1
? "人工接待"
: "AI接管"}
</Tag>
</List.Item>
)}
/>
</Card>
</div>
</div>
);
};
export default ReceptionSettings;

View File

@@ -1,32 +1,50 @@
/* common-config page styles */
.container {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16px;
.content {
flex: 1;
overflow: hidden;
padding: 16px;
}
.tabsBar {
display: grid;
grid-template-columns: repeat(5, max-content);
gap: 24px;
padding: 12px 16px 0 16px;
color: #667085;
display: flex;
gap: 0;
border-bottom: 1px solid #e8e8e8;
margin-bottom: 24px;
padding: 0 16px;
.tab {
padding: 12px 24px;
cursor: pointer;
border-bottom: 2px solid transparent;
color: #666;
font-size: 14px;
transition: all 0.3s;
user-select: none;
&:hover {
color: #1890ff;
background-color: #f5f5f5;
}
}
.tabActive {
color: #1890ff;
border-bottom-color: #1890ff;
background-color: #f0f8ff;
font-weight: 500;
}
}
.tab {
padding: 10px 16px;
.placeholder {
display: flex;
align-items: center;
justify-content: center;
height: 400px;
font-size: 16px;
color: #999;
background: #fafafa;
border-radius: 8px;
background: #f7f9fc;
cursor: pointer;
}
.tabActive {
padding: 10px 16px;
border-radius: 8px;
background: #eef5ff;
color: #1677ff;
box-shadow: inset 0 0 0 1px #d6e6ff;
border: 1px dashed #d9d9d9;
}
.left,

View File

@@ -1,18 +1,41 @@
import React, { useState } from "react";
import Layout from "@/components/Layout/LayoutFiexd";
import PowerNavigation from "@/components/PowerNavtion";
import { Card, Select, Button, Space, Tag, List } from "antd";
import { SettingOutlined, DatabaseOutlined } from "@ant-design/icons";
import { Button, Space } from "antd";
import ReceptionSettings from "./components/ReceptionSettings";
import styles from "./index.module.scss";
const { Option } = Select;
const CommonConfig: React.FC = () => {
const [pool, setPool] = useState<string | undefined>();
const [mode, setMode] = useState<string>("人工接待");
const [activeTab, setActiveTab] = useState<string>("reception");
const pools = ["官网咨询", "朋友推荐", "展会获客"];
const tabs = [
{ key: "reception", label: "接待设置" },
{ key: "notification", label: "通知设置" },
{ key: "system", label: "系统设置" },
{ key: "security", label: "安全设置" },
{ key: "advanced", label: "高级设置" },
];
const handleTabClick = (tabKey: string) => {
setActiveTab(tabKey);
};
const renderTabContent = () => {
switch (activeTab) {
case "reception":
return <ReceptionSettings />;
case "notification":
return <div className={styles.placeholder}>...</div>;
case "system":
return <div className={styles.placeholder}>...</div>;
case "security":
return <div className={styles.placeholder}>...</div>;
case "advanced":
return <div className={styles.placeholder}>...</div>;
default:
return <ReceptionSettings />;
}
};
return (
<Layout
header={
@@ -24,114 +47,30 @@ const CommonConfig: React.FC = () => {
backButtonText="返回功能中心"
/>
<div className={styles.tabsBar}>
<div className={styles.tabActive}></div>
<div className={styles.tab}></div>
<div className={styles.tab}></div>
<div className={styles.tab}></div>
<div className={styles.tab}></div>
{tabs.map(tab => (
<div
key={tab.key}
className={`${styles.tab} ${
activeTab === tab.key ? styles.tabActive : ""
}`}
onClick={() => handleTabClick(tab.key)}
>
{tab.label}
</div>
))}
</div>
</>
}
footer={
<div className={styles.actions}>
<Space>
<Button
onClick={() => {
setPool(undefined);
setMode("人工接待");
}}
>
</Button>
<Button onClick={() => setActiveTab("reception")}></Button>
<Button type="primary"></Button>
</Space>
</div>
}
>
<div className={styles.container}>
<div className={styles.left}>
<Card
title={
<Space size={8}>
<DatabaseOutlined />
<span></span>
</Space>
}
>
<div className={styles.tip}>
</div>
<div className={styles.formItem}>
<div className={styles.label}></div>
<Select
placeholder="请选择流量池"
value={pool}
onChange={setPool}
style={{ width: "100%" }}
>
{pools.map(p => (
<Option key={p} value={p}>
{p}
</Option>
))}
</Select>
</div>
<div className={styles.formItem}>
<div className={styles.label}></div>
<Select value={mode} onChange={setMode} style={{ width: "100%" }}>
<Option value="人工接待"></Option>
<Option value="AI接待">AI接待</Option>
<Option value="AI辅助">AI辅助</Option>
</Select>
</div>
<Button type="primary" block className={styles.primaryBtn}>
</Button>
</Card>
</div>
<div className={styles.right}>
<Card
title={
<Space size={8}>
<SettingOutlined />
<span></span>
</Space>
}
>
<List
itemLayout="horizontal"
dataSource={pools}
renderItem={(item, index) => (
<List.Item>
<List.Item.Meta
title={item}
description={`${Math.floor(Math.random() * 300) + 50} 个客户`}
/>
<Tag
color={
index % 3 === 0
? "blue"
: index % 3 === 1
? "orange"
: "green"
}
>
{index % 3 === 0
? "AI辅助"
: index % 3 === 1
? "人工接待"
: "AI接管"}
</Tag>
</List.Item>
)}
/>
</Card>
</div>
</div>
<div className={styles.content}>{renderTabContent()}</div>
</Layout>
);
};

View File

@@ -4,11 +4,7 @@ import { Outlet } from "react-router-dom";
import NavCommon from "./components/NavCommon";
const CkboxPage: React.FC = () => {
return (
<Layout
header={
<NavCommon title="AI自动聊天懂业务会引导客户不停地聊不停" />
}
>
<Layout header={<NavCommon title="触客宝" />}>
<Outlet />
</Layout>
);