調整Ckbox頁面標題及優化CommonConfig組件:將標題更改為「觸客寶」,並重構標籤頁內容顯示邏輯,新增佔位符以顯示未開發功能,提升用戶體驗。
This commit is contained in:
@@ -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);
|
||||
};
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
@@ -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,
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user