fix(ui): 统一表格筛选分页和用量明细,升级 ESLint
This commit is contained in:
@@ -24,10 +24,15 @@ import {
|
||||
Copy as ActionCopy,
|
||||
BookOpen as ActionBookOpen,
|
||||
HelpCircle as ActionHelpCircle,
|
||||
Search as ActionSearch,
|
||||
Plus as ActionPlus,
|
||||
Search as ActionSearch,
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
import { writeClipboardText } from '../../helpers/clipboard';
|
||||
import { ConsoleCollectionSearch } from '../../components/console/ConsoleCollection';
|
||||
import {
|
||||
ConsoleFilterField,
|
||||
ConsoleFilterGrid,
|
||||
} from '../../components/console/ConsolePrimitives';
|
||||
import TableEmpty from '../../components/common/table/TableEmpty';
|
||||
import React, { useState, useRef, useEffect, useContext } from 'react';
|
||||
import Table from '../../components/ui/CenterActionTable';
|
||||
@@ -892,35 +897,28 @@ const KeyManagement = ({ embedded = false }) => {
|
||||
<DesensitizeNotice t={t} />
|
||||
|
||||
<div className='km-panels'>
|
||||
<Card className='km-card km-search-card tour-search-input'>
|
||||
<label className='km-search-label' htmlFor='km-search-input'>
|
||||
{t('密钥查询')}
|
||||
</label>
|
||||
<div className='km-search-row'>
|
||||
<Input
|
||||
id='km-search-input'
|
||||
className='km-search-input'
|
||||
placeholder={t('搜索密钥名称、Key 或分组')}
|
||||
value={searchValue}
|
||||
onChange={(event) => setSearchValue(event.target.value)}
|
||||
onPressEnter={() => setSearchValue(searchValue)}
|
||||
allowClear
|
||||
/>
|
||||
<Button onClick={() => setSearchValue('')}>{t('重置')}</Button>
|
||||
<Button
|
||||
type='primary'
|
||||
icon={<ActionSearch size={14} />}
|
||||
onClick={() => setSearchValue(searchValue)}
|
||||
>
|
||||
{t('搜索')}
|
||||
</Button>
|
||||
</div>
|
||||
</Card>
|
||||
<ConsoleCollectionSearch className='km-card km-search-card tour-search-input'>
|
||||
<ConsoleFilterGrid
|
||||
onReset={() => setSearchValue('')}
|
||||
onSearch={() => setSearchValue(searchValue.trim())}
|
||||
>
|
||||
<ConsoleFilterField label={t('密钥查询')} id='km-search-input'>
|
||||
<Input
|
||||
id='km-search-input'
|
||||
prefix={<ActionSearch size={14} />}
|
||||
placeholder={t('搜索密钥名称、Key 或分组')}
|
||||
value={searchValue}
|
||||
onChange={(event) => setSearchValue(event.target.value)}
|
||||
allowClear
|
||||
/>
|
||||
</ConsoleFilterField>
|
||||
</ConsoleFilterGrid>
|
||||
</ConsoleCollectionSearch>
|
||||
|
||||
<Card className='km-card km-list-card'>
|
||||
<div className='km-list-head'>
|
||||
<div className='km-list-head console-list-tools'>
|
||||
<h2>{t('密钥列表')}</h2>
|
||||
<div className='km-list-actions'>
|
||||
<div className='km-list-actions console-list-tool-actions'>
|
||||
<Button
|
||||
type='link'
|
||||
className='km-contact-link'
|
||||
@@ -928,14 +926,6 @@ const KeyManagement = ({ embedded = false }) => {
|
||||
>
|
||||
{t('创建密钥后不知道怎么用?联系客服')}
|
||||
</Button>
|
||||
<Button
|
||||
type='primary'
|
||||
icon={<ActionPlus size={16} />}
|
||||
className='tour-create-btn'
|
||||
onClick={handleCreate}
|
||||
>
|
||||
{t('创建密钥')}
|
||||
</Button>
|
||||
<TableColumnSettings
|
||||
columns={COLUMN_OPTIONS.map((option) => ({
|
||||
key: option.value,
|
||||
@@ -945,6 +935,14 @@ const KeyManagement = ({ embedded = false }) => {
|
||||
defaultValue={COLUMN_OPTIONS.map((option) => option.value)}
|
||||
onChange={setVisibleColumns}
|
||||
/>
|
||||
<Button
|
||||
type='primary'
|
||||
icon={<ActionPlus size={16} />}
|
||||
className='tour-create-btn'
|
||||
onClick={handleCreate}
|
||||
>
|
||||
{t('创建密钥')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
.km-page {
|
||||
--km-page-bg: #f8fafc;
|
||||
--km-text: rgba(0, 0, 0, 0.88);
|
||||
--km-label: #6b7789;
|
||||
--km-search-border: #f0f0f0;
|
||||
--km-card-border: #e6e9ef;
|
||||
--km-card-shadow: 0 4px 24px rgba(15, 23, 42, 0.02);
|
||||
@@ -24,7 +23,6 @@
|
||||
html.dark .km-page {
|
||||
--km-page-bg: var(--surface-bg-base);
|
||||
--km-text: var(--uc-heading);
|
||||
--km-label: var(--text-secondary);
|
||||
--km-search-border: var(--border-subtle);
|
||||
--km-card-border: var(--border-subtle);
|
||||
--km-card-shadow: none;
|
||||
@@ -71,28 +69,6 @@ html.dark .km-page {
|
||||
box-shadow: var(--km-card-shadow);
|
||||
}
|
||||
|
||||
/* 查询标签与消费记录筛选标签一致;输入 620px,输入与按钮 16px,按钮间 8px。 */
|
||||
.km-search-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 21px;
|
||||
margin-bottom: 8px;
|
||||
color: var(--km-label);
|
||||
font-size: 13px;
|
||||
line-height: 1.5714285714285714;
|
||||
}
|
||||
.km-search-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
.km-search-row .km-search-input {
|
||||
width: 620px;
|
||||
max-width: 100%;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
/* 列表卡头:标题 15px/600,与表格 18px(同使用记录表格卡) */
|
||||
.km-list-head {
|
||||
display: flex;
|
||||
@@ -328,10 +304,6 @@ html.dark .km-edit-drawer {
|
||||
.km-page-standalone .km-content.uc-page {
|
||||
padding-top: 80px;
|
||||
}
|
||||
.km-search-row .km-search-input {
|
||||
width: 100%;
|
||||
margin-right: 0;
|
||||
}
|
||||
.km-list-head {
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user