import { useState } from 'react'
import { Form, Input, Switch, Select, Button, Card, Table, Tag, message } from 'antd'
import { LinkOutlined, WechatOutlined, PhoneOutlined, MailOutlined, MobileOutlined, CopyOutlined } from '@ant-design/icons'
const channelTypes = [
{ key: 'web', icon: , label: '网页聊天', status: true, code: 'WK_8a3f2e', script: '' },
{ key: 'wechat', icon: , label: '微信公众号', status: true, code: 'WX_c7b9d1', script: '' },
{ key: 'app', icon: , label: 'APP 内嵌', status: false, code: '', script: '' },
{ key: 'phone', icon: , label: '电话客服', status: false, code: '', script: '' },
{ key: 'email', icon: , label: '邮件工单', status: true, code: 'EM_f2a8c3', script: '' },
]
const Settings = () => {
const [activeTab, setActiveTab] = useState('basic')
const [basicForm] = Form.useForm()
const [autoReplyForm] = Form.useForm()
const tabItems = [
{ key: 'basic', label: '基本设置' },
{ key: 'channels', label: '渠道管理' },
{ key: 'assignment', label: '分配规则' },
{ key: 'permission', label: '权限管理' },
{ key: 'autoreply', label: '自动回复' },
{ key: 'worktime', label: '工作时间' },
{ key: 'notify', label: '通知设置' },
]
return (
{/* 左侧导航 */}
系统设置
{tabItems.map(item => (
setActiveTab(item.key)}
>
{item.label}
))}
{/* 右侧内容 */}
{/* 基本设置 */}
{activeTab === 'basic' && (
)}
{/* 渠道管理 */}
{activeTab === 'channels' && (
渠道管理
{channelTypes.map(ch => (
{ch.icon}
{ch.label}
{ch.status ? '已启用' : '未启用'}
}>
{ch.code &&
渠道ID{ch.code}
}
{ch.script && (
接入代码
{ch.script}
message.success('已复制')} />
)}
启用状态
))}
)}
{/* 分配规则 */}
{activeTab === 'assignment' && (
)}
{/* 权限管理 */}
{activeTab === 'permission' && (
{v ? '启用' : '禁用'} },
{ title: '操作', key: 'op', render: () => },
]}
pagination={false}
size="middle"
/>
)}
{/* 自动回复 */}
{activeTab === 'autoreply' && (
)}
{/* 工作时间 */}
{activeTab === 'worktime' && (
每周工作时段
{['周一', '周二', '周三', '周四', '周五', '周六', '周日'].map(day => (
{day}
))}
)}
{/* 通知设置 */}
{activeTab === 'notify' && (
{[ { label: '新会话提醒', desc: '有新访客发起会话时桌面通知' },
{ label: '消息声音', desc: '收到新消息时播放提示音' },
{ label: '离线消息通知', desc: '非工作时间收到的留言邮件通知' },
{ label: '日报推送', desc: '每日客服数据汇总邮件' },
{ label: '周报推送', desc: '每周客服数据汇总邮件' },
].map((item, i) => (
))}
)}
)
}
export default Settings