perf: add binary suffix to binary keys in tree list

This commit is contained in:
Lykin 2024-01-04 00:33:51 +08:00
parent a71f5e0070
commit 23087a5374
3 changed files with 8 additions and 12 deletions

View File

@ -90,6 +90,7 @@ defineExpose({
v-model:value="inputData.filter" v-model:value="inputData.filter"
:placeholder="$t('interface.filter')" :placeholder="$t('interface.filter')"
:size="props.small ? 'small' : ''" :size="props.small ? 'small' : ''"
:theme-overrides="{ paddingSmall: '0 3px', paddingMedium: '0 6px' }"
clearable clearable
@clear="onClearFilter" @clear="onClearFilter"
@input="onInput" @input="onInput"

View File

@ -367,13 +367,7 @@ const renderPrefix = ({ option }) => {
case ConnectionType.RedisValue: case ConnectionType.RedisValue:
if (prefStore.keyIconType === typesIconStyle.ICON) { if (prefStore.keyIconType === typesIconStyle.ICON) {
return h( return h(NIcon, { size: 20 }, () => h(Key))
NIcon,
{ size: 20 },
{
default: () => h(!!option.redisKeyCode ? Binary : Key),
},
)
} }
const loading = isEmpty(option.redisType) || option.redisType === 'loading' const loading = isEmpty(option.redisType) || option.redisType === 'loading'
if (loading) { if (loading) {
@ -506,10 +500,8 @@ const calcValueMenu = () => {
// render menu function icon // render menu function icon
const renderSuffix = ({ option }) => { const renderSuffix = ({ option }) => {
if ( const selected = includes(selectedKeys.value, option.key)
(option.type === ConnectionType.RedisDB && option.opened) || if (selected && !props.checkMode) {
(includes(selectedKeys.value, option.key) && !props.checkMode)
) {
switch (option.type) { switch (option.type) {
case ConnectionType.RedisDB: case ConnectionType.RedisDB:
return renderIconMenu(calcDBMenu(option.opened, option.loading, option.fullLoaded)) return renderIconMenu(calcDBMenu(option.opened, option.loading, option.fullLoaded))
@ -518,6 +510,9 @@ const renderSuffix = ({ option }) => {
case ConnectionType.RedisValue: case ConnectionType.RedisValue:
return renderIconMenu(calcValueMenu()) return renderIconMenu(calcValueMenu())
} }
} else if (!selected && !!option.redisKeyCode && option.type === ConnectionType.RedisValue) {
// render binary icon
return renderIconMenu(h(NIcon, { size: 20 }, () => h(Binary)))
} }
return null return null
} }

View File

@ -23,7 +23,7 @@ export const themeOverrides = {
paddingMedium: '0 12px', paddingMedium: '0 12px',
}, },
Tag: { Tag: {
// borderRadius: '3px' borderRadius: '4px',
heightLarge: '32px', heightLarge: '32px',
}, },
Input: { Input: {