import { useState } from 'react'; import { ClipboardCopy, FileText } from 'lucide-react'; import { Button, Modal, Tag } from '@/components/ui'; type LinkStatus = 'connected' | 'disconnected' | 'inactive'; type SmsApplication = { id: string; name: string; appid: string; todaySuccess: number; deliveryRate?: number; price: string; score?: string; status: LinkStatus; params: Array<{ label: string; value: string; highlight?: boolean }>; }; const statusLabelMap: Record = { connected: '已连接', disconnected: '已断', inactive: '未开通', }; const statusToneMap: Record = { connected: 'success', disconnected: 'danger', inactive: 'info', }; const applications: SmsApplication[] = [ { id: 'app-1', name: '营销推广平台', appid: 'AK_2024010912345678', todaySuccess: 1500, deliveryRate: 95, price: '0.050 元', score: '100分', status: 'connected', params: [ { label: 'ID', value: '113009756' }, { label: '企业名', value: '启瑞物业三网' }, { label: '开通时间', value: '2023-12-13' }, { label: '企业代码', value: 'qrhyyd' }, { label: '账号', value: 'qrhyyd' }, { label: '密码', value: 'm6yZvZKn', highlight: true }, { label: '网关IP', value: '121.40.172.212' }, { label: '网关端口', value: '7890' }, { label: '接入号', value: '106999999' }, { label: '绑定IP', value: '61.129.57.48' }, { label: '连接数', value: '1' }, ], }, { id: 'app-2', name: '客服系统', appid: 'AK_2024010987654321', todaySuccess: 800, deliveryRate: 90, price: '0.060 元', score: '80分', status: 'disconnected', params: [ { label: 'ID', value: '113009812' }, { label: '企业名', value: '客服系统三网' }, { label: '开通时间', value: '2024-01-09' }, { label: '企业代码', value: 'kfxt' }, { label: '账号', value: 'kfxt' }, { label: '密码', value: 'r8xKvP2m', highlight: true }, { label: '网关IP', value: '121.40.172.213' }, { label: '网关端口', value: '7890' }, { label: '接入号', value: '106988888' }, { label: '绑定IP', value: '61.129.57.49' }, { label: '连接数', value: '1' }, ], }, { id: 'app-3', name: '验证码服务', appid: 'AK_2024010811223344', todaySuccess: 0, price: '0.040 元', status: 'inactive', params: [ { label: 'ID', value: '-' }, { label: '企业名', value: '验证码服务' }, { label: '开通时间', value: '-' }, { label: '企业代码', value: '-' }, { label: '账号', value: '-' }, { label: '密码', value: '-' }, { label: '网关IP', value: '-' }, { label: '网关端口', value: '-' }, { label: '接入号', value: '-' }, { label: '绑定IP', value: '-' }, { label: '连接数', value: '-' }, ], }, ]; export function ClientApplicationsPage() { const [selectedApp, setSelectedApp] = useState(null); return (

短信应用列表

共 {applications.length} 个应用
{applications.map((application) => (

{application.name}

appid
{application.appid}
今日发送成功
{application.todaySuccess.toLocaleString('zh-CN')} 条
到达率
{application.deliveryRate ? `${application.deliveryRate}%` : '-'}
单价
{application.price}{application.score ? ({application.score}) : null}
CMPP链接状态
{statusLabelMap[application.status]}
))}
}>复制参数} onClose={() => setSelectedApp(null)} open={Boolean(selectedApp)} size="xl" title="接口参数" > {selectedApp ? (
{selectedApp.params.map((item) => (
{item.label} {item.value}
))}
) : null}
); }