fix(ui): 统一表格筛选分页和用量明细,升级 ESLint
This commit is contained in:
@@ -22,7 +22,6 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
// 也会带上这里写的内容。客户端读公开接口 GET /api/weyai/desktop/release-notes,
|
||||
// 未登录也能看到;草稿只在这里可见。root 和被下放了「WeyAi」页签的管理员都能用。
|
||||
|
||||
import { TableRowActions } from '@/components/common/table/TableToolbar';
|
||||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import {
|
||||
Banner,
|
||||
@@ -31,6 +30,7 @@ import {
|
||||
Empty,
|
||||
Input,
|
||||
Modal,
|
||||
Popconfirm,
|
||||
Space,
|
||||
Switch,
|
||||
Table,
|
||||
@@ -197,37 +197,7 @@ const SettingsWeyAiReleaseNotes = () => {
|
||||
title: t('操作'),
|
||||
width: 240,
|
||||
render: (_, note) => (
|
||||
<TableRowActions
|
||||
items={[
|
||||
note.status === 'published' && {
|
||||
key: 'withdraw',
|
||||
label: t('撤回'),
|
||||
onClick: () => setStatus(note, 'draft'),
|
||||
disabled: busyId === note.id,
|
||||
},
|
||||
note.status !== 'published' && {
|
||||
key: 'publish',
|
||||
label: t('发布'),
|
||||
onClick: () => setStatus(note, 'published'),
|
||||
disabled: busyId === note.id,
|
||||
},
|
||||
{
|
||||
key: 'delete',
|
||||
label: t('删除'),
|
||||
disabled: busyId === note.id,
|
||||
danger: true,
|
||||
onClick: () =>
|
||||
Modal.confirm({
|
||||
title: t('确定删除这条版本说明吗?'),
|
||||
content: t('删除后客户端不再显示这个版本的说明'),
|
||||
okText: t('确认'),
|
||||
cancelText: t('取消'),
|
||||
okButtonProps: { danger: true },
|
||||
onOk: () => remove(note),
|
||||
}),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Space>
|
||||
<Button
|
||||
onClick={() => setDraft({ ...note })}
|
||||
type='link'
|
||||
@@ -235,7 +205,40 @@ const SettingsWeyAiReleaseNotes = () => {
|
||||
>
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
</TableRowActions>
|
||||
{note.status === 'published' ? (
|
||||
<Button
|
||||
loading={busyId === note.id}
|
||||
onClick={() => setStatus(note, 'draft')}
|
||||
type='link'
|
||||
size='small'
|
||||
>
|
||||
{t('撤回')}
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
loading={busyId === note.id}
|
||||
onClick={() => setStatus(note, 'published')}
|
||||
type='link'
|
||||
size='small'
|
||||
>
|
||||
{t('发布')}
|
||||
</Button>
|
||||
)}
|
||||
<Popconfirm
|
||||
title={t('确定删除这条版本说明吗?')}
|
||||
content={t('删除后客户端不再显示这个版本的说明')}
|
||||
onConfirm={() => remove(note)}
|
||||
>
|
||||
<Button
|
||||
disabled={busyId === note.id}
|
||||
type='link'
|
||||
size='small'
|
||||
danger
|
||||
>
|
||||
{t('删除')}
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user