fix(ui): 统一表格筛选分页和用量明细,升级 ESLint

This commit is contained in:
zhanjunhao
2026-11-19 23:09:58 +08:00
parent 13105bdba5
commit 74ca103334
76 changed files with 2556 additions and 2410 deletions
+33 -28
View File
@@ -17,7 +17,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { TableRowActions } from '@/components/common/table/TableToolbar';
import { useTranslation } from 'react-i18next';
import TableEmpty from '../../components/common/table/TableEmpty';
import TableToolbar from '../../components/common/table/TableToolbar';
@@ -184,32 +183,7 @@ export default function InsightsPanel({ value, onChange, disabled, error }) {
const index = value.articles.findIndex((a) => a.id === item.id);
const move = (offset) => onChange(moveArticle(value, item.id, offset));
return (
<TableRowActions
items={[
{
key: 'up',
label: t('上移'),
title: sortable ? undefined : '请在全部分类且无搜索时调整顺序',
disabled: disabled || !sortable || index <= 0,
onClick: () => move(-1),
},
{
key: 'down',
label: t('下移'),
title: sortable ? undefined : '请在全部分类且无搜索时调整顺序',
disabled:
disabled || !sortable || index >= value.articles.length - 1,
onClick: () => move(1),
},
{
key: 'delete',
label: t('删除'),
danger: true,
disabled,
onClick: () => deleteArticle(item),
},
]}
>
<div className='website-insights-row-actions'>
<Button
type='link'
size='small'
@@ -220,7 +194,38 @@ export default function InsightsPanel({ value, onChange, disabled, error }) {
>
{t('编辑')}
</Button>
</TableRowActions>
<Button
type='link'
size='small'
aria-label={`上移${item.title}`}
title={sortable ? undefined : '请在全部分类且无搜索时调整顺序'}
disabled={disabled || !sortable || index <= 0}
onClick={() => move(-1)}
>
{t('上移')}
</Button>
<Button
type='link'
size='small'
aria-label={`下移${item.title}`}
title={sortable ? undefined : '请在全部分类且无搜索时调整顺序'}
disabled={
disabled || !sortable || index >= value.articles.length - 1
}
onClick={() => move(1)}
>
{t('下移')}
</Button>
<Button
type='link'
size='small'
danger
disabled={disabled}
onClick={() => deleteArticle(item)}
>
{t('删除')}
</Button>
</div>
);
},
},