优化半自动履约客户页与后台操作布局
用户侧统一显示等待客服处理并精简平台标题;移除 Cookie 等专业表述;后台操作改为两行行内按钮,取消操作下拉。
This commit is contained in:
@@ -2,10 +2,7 @@ import {
|
||||
CheckCircleOutlined,
|
||||
ChromeOutlined,
|
||||
CopyOutlined,
|
||||
DownOutlined,
|
||||
KeyOutlined,
|
||||
LinkOutlined,
|
||||
MoreOutlined,
|
||||
ReloadOutlined,
|
||||
SendOutlined,
|
||||
UserSwitchOutlined,
|
||||
@@ -17,7 +14,6 @@ import {
|
||||
Card,
|
||||
Descriptions,
|
||||
Drawer,
|
||||
Dropdown,
|
||||
Form,
|
||||
Input,
|
||||
InputNumber,
|
||||
@@ -288,76 +284,6 @@ export default function AdminSemiAutoTasksPage() {
|
||||
})
|
||||
}
|
||||
|
||||
function credentialMenu(task: SemiAutoTask) {
|
||||
return {
|
||||
items: [
|
||||
{
|
||||
key: 'copy',
|
||||
icon: <KeyOutlined />,
|
||||
label: '复制最终 CK',
|
||||
disabled: !task.credentialReady || credentialExportMutation.isPending,
|
||||
},
|
||||
{
|
||||
key: 'inject',
|
||||
icon: <ChromeOutlined />,
|
||||
label: '注入浏览器',
|
||||
disabled: !taskCanUseCredential(task) || injectionMutation.isPending,
|
||||
},
|
||||
],
|
||||
onClick: ({ key }: { key: string }) => {
|
||||
if (key === 'copy') {
|
||||
confirmCopyCredential(task)
|
||||
return
|
||||
}
|
||||
if (key === 'inject') injectionMutation.mutate(task)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
function taskMenu(task: SemiAutoTask) {
|
||||
const active = task.executionStatus !== 'completed' && task.executionStatus !== 'cancelled'
|
||||
return {
|
||||
items: [
|
||||
{
|
||||
key: 'copy',
|
||||
icon: <LinkOutlined />,
|
||||
label: '复制客户链接',
|
||||
},
|
||||
{
|
||||
key: 'sync',
|
||||
icon: <ReloadOutlined />,
|
||||
label: '刷新客户状态',
|
||||
disabled: syncMutation.isPending,
|
||||
},
|
||||
...(!task.assignedAdminUserId
|
||||
? [
|
||||
{
|
||||
key: 'claim',
|
||||
icon: <UserSwitchOutlined />,
|
||||
label: '领取任务',
|
||||
disabled: claimMutation.isPending,
|
||||
},
|
||||
]
|
||||
: []),
|
||||
...(active
|
||||
? [
|
||||
{
|
||||
key: 'cancel',
|
||||
danger: true,
|
||||
label: '取消任务',
|
||||
},
|
||||
]
|
||||
: []),
|
||||
],
|
||||
onClick: ({ key }: { key: string }) => {
|
||||
if (key === 'copy') void copyCustomerLink(task)
|
||||
if (key === 'sync') syncMutation.mutate(task.id)
|
||||
if (key === 'claim') claimMutation.mutate(task.id)
|
||||
if (key === 'cancel') confirmCancel(task)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
function openComplete(task: SemiAutoTask) {
|
||||
setCompleteTask(task)
|
||||
setCompleteFiles([])
|
||||
@@ -461,46 +387,88 @@ export default function AdminSemiAutoTasksPage() {
|
||||
{
|
||||
title: '操作',
|
||||
key: 'actions',
|
||||
width: 340,
|
||||
width: 520,
|
||||
render: (_, task) => (
|
||||
<Space wrap>
|
||||
<Button size="small" onClick={() => setDetailTaskId(task.id)}>
|
||||
详情
|
||||
</Button>
|
||||
{taskNeedsCustomerReauth(task) ? (
|
||||
<Space direction="vertical" size={6} style={{ width: '100%' }}>
|
||||
<Space wrap>
|
||||
<Button size="small" onClick={() => setDetailTaskId(task.id)}>
|
||||
详情
|
||||
</Button>
|
||||
{taskNeedsCustomerReauth(task) ? (
|
||||
<Button
|
||||
size="small"
|
||||
type="primary"
|
||||
icon={<SendOutlined />}
|
||||
loading={reauthMutation.isPending}
|
||||
onClick={() => confirmReauth(task)}
|
||||
>
|
||||
重发授权
|
||||
</Button>
|
||||
) : null}
|
||||
<Button
|
||||
size="small"
|
||||
type="primary"
|
||||
icon={<SendOutlined />}
|
||||
loading={reauthMutation.isPending}
|
||||
onClick={() => confirmReauth(task)}
|
||||
icon={<KeyOutlined />}
|
||||
disabled={!task.credentialReady}
|
||||
loading={credentialExportMutation.isPending}
|
||||
onClick={() => confirmCopyCredential(task)}
|
||||
>
|
||||
重发授权
|
||||
复制 CK
|
||||
</Button>
|
||||
) : null}
|
||||
<Dropdown menu={credentialMenu(task)} trigger={['click']}>
|
||||
<Button size="small" icon={<KeyOutlined />}>
|
||||
CK 操作 <DownOutlined />
|
||||
</Button>
|
||||
</Dropdown>
|
||||
{task.executionStatus !== 'completed' &&
|
||||
task.executionStatus !== 'cancelled' &&
|
||||
!taskNeedsCustomerReauth(task) ? (
|
||||
<Button
|
||||
size="small"
|
||||
type="primary"
|
||||
icon={<CheckCircleOutlined />}
|
||||
icon={<ChromeOutlined />}
|
||||
disabled={!taskCanUseCredential(task)}
|
||||
onClick={() => openComplete(task)}
|
||||
loading={injectionMutation.isPending}
|
||||
onClick={() => injectionMutation.mutate(task)}
|
||||
>
|
||||
完成
|
||||
注入浏览器
|
||||
</Button>
|
||||
) : null}
|
||||
<Dropdown menu={taskMenu(task)} trigger={['click']}>
|
||||
<Button size="small" icon={<MoreOutlined />}>
|
||||
更多
|
||||
</Space>
|
||||
<Space wrap>
|
||||
<Button
|
||||
size="small"
|
||||
icon={<CopyOutlined />}
|
||||
onClick={() => void copyCustomerLink(task)}
|
||||
>
|
||||
客户链接
|
||||
</Button>
|
||||
</Dropdown>
|
||||
<Button
|
||||
size="small"
|
||||
icon={<ReloadOutlined />}
|
||||
loading={syncMutation.isPending}
|
||||
onClick={() => syncMutation.mutate(task.id)}
|
||||
>
|
||||
刷新
|
||||
</Button>
|
||||
{!task.assignedAdminUserId ? (
|
||||
<Button
|
||||
size="small"
|
||||
icon={<UserSwitchOutlined />}
|
||||
loading={claimMutation.isPending}
|
||||
onClick={() => claimMutation.mutate(task.id)}
|
||||
>
|
||||
领取
|
||||
</Button>
|
||||
) : null}
|
||||
{task.executionStatus !== 'completed' &&
|
||||
task.executionStatus !== 'cancelled' &&
|
||||
!taskNeedsCustomerReauth(task) ? (
|
||||
<Button
|
||||
size="small"
|
||||
type="primary"
|
||||
icon={<CheckCircleOutlined />}
|
||||
disabled={!taskCanUseCredential(task)}
|
||||
onClick={() => openComplete(task)}
|
||||
>
|
||||
完成
|
||||
</Button>
|
||||
) : null}
|
||||
{task.executionStatus !== 'completed' && task.executionStatus !== 'cancelled' ? (
|
||||
<Button size="small" danger onClick={() => confirmCancel(task)}>
|
||||
取消
|
||||
</Button>
|
||||
) : null}
|
||||
</Space>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
@@ -690,11 +658,22 @@ export default function AdminSemiAutoTasksPage() {
|
||||
>
|
||||
刷新客户状态
|
||||
</Button>
|
||||
<Dropdown menu={credentialMenu(detail.task)} trigger={['click']}>
|
||||
<Button icon={<KeyOutlined />}>
|
||||
CK 操作 <DownOutlined />
|
||||
</Button>
|
||||
</Dropdown>
|
||||
<Button
|
||||
icon={<KeyOutlined />}
|
||||
disabled={!detail.task.credentialReady}
|
||||
loading={credentialExportMutation.isPending}
|
||||
onClick={() => confirmCopyCredential(detail.task)}
|
||||
>
|
||||
复制 CK
|
||||
</Button>
|
||||
<Button
|
||||
icon={<ChromeOutlined />}
|
||||
disabled={!taskCanUseCredential(detail.task)}
|
||||
loading={injectionMutation.isPending}
|
||||
onClick={() => injectionMutation.mutate(detail.task)}
|
||||
>
|
||||
注入浏览器
|
||||
</Button>
|
||||
</Space>
|
||||
</Card>
|
||||
<Card size="small" title="时间线">
|
||||
|
||||
Reference in New Issue
Block a user