💄 修改表格样式.

This commit is contained in:
lijiahang
2024-07-09 10:34:39 +08:00
parent 7ba278d210
commit a7f86bf62a
20 changed files with 85 additions and 23 deletions

View File

@@ -3,7 +3,22 @@
:options="optionData"
:loading="loading"
placeholder="请选择主机身份"
allow-clear />
allow-clear>
<!-- label -->
<template #label="{ data }">
<span class="option-wrapper">
<span class="label">{{ data.label }}</span>
<span class="username">{{ data.username }}</span>
</span>
</template>
<!-- 选项 -->
<template #option="{ data }">
<span class="option-wrapper">
<span class="label">{{ data.label }}</span>
<span class="username">{{ data.username }}</span>
</span>
</template>
</a-select>
</template>
<script lang="ts">
@@ -53,8 +68,9 @@
: await cacheStore.loadHostIdentities();
optionData.value = hostIdentities.map(s => {
return {
label: `${s.name} (${s.username})`,
label: s.name,
value: s.id,
username: s.username,
};
});
} catch (e) {
@@ -66,5 +82,18 @@
</script>
<style lang="less" scoped>
.option-wrapper {
display: flex;
justify-content: space-between;
align-items: center;
.label {
margin-right: 8px;
}
.username {
font-size: 12px;
color: var(--color-text-3);
}
}
</style>

View File

@@ -37,6 +37,7 @@
:allow-clear="true"
:data="filterOptions"
:filter-option="tagLabelFilter">
<!-- 选项 -->
<template #option="{ data: { raw: { label, isTag } } }">
<!-- tag -->
<a-tag v-if="isTag" :color="dataColor(label, tagColor)">

View File

@@ -8,6 +8,7 @@
@exceed-limit="() => { emits('onLimited', limit, `最多选择${limit}个tag`) }"
multiple
allow-clear>
<!-- 选项 -->
<template #option="{ data: { label } }">
<a-tag :color="dataColor(label, tagColor)">
{{ label }}

View File

@@ -34,7 +34,7 @@
readonly: boolean;
}>>(), {
width: '60%',
height: 'calc(100vh - 240px)',
height: 'calc(100vh - 242px)',
readonly: true,
});