better EventRecordList.vue option tips

This commit is contained in:
Timi
2026-09-09 15:32:33 +08:00
parent 028d29eac5
commit bd5f6dd3ba
+16 -2
View File
@@ -34,7 +34,7 @@
<t-dropdown-item <t-dropdown-item
v-model="optionFilter" v-model="optionFilter"
:label="optionFilterLabel" :label="optionFilterLabel"
:disabled="!optionFilterOptions.length" :footer="!optionFilterOptions.length ? optionFilterUnavailableFooter : undefined"
options-columns="2" options-columns="2"
:options="optionFilterOptions" :options="optionFilterOptions"
multiple multiple
@@ -218,6 +218,14 @@ const optionFilterOptions = computed(() => {
value: String(option.id) value: String(option.id)
}))); })));
}); });
const optionFilterUnavailableReason = computed(() => actionFilter.value.length === 1
? "当前选择的事件没有可用选项"
: "请先只选择一个事件,才能按选项筛选");
const optionFilterUnavailableFooter = (h: typeof import("vue").h) => h(
"div",
{ class: "center-tips red" },
optionFilterUnavailableReason.value
);
const optionFilterLabel = computed(() => { const optionFilterLabel = computed(() => {
if (!optionFilter.value.length) { if (!optionFilter.value.length) {
return "全部选项"; return "全部选项";
@@ -774,6 +782,13 @@ onUnmounted(() => {
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.option-empty-tip {
color: #64748b;
padding: .75rem 1rem;
font-size: .8125rem;
text-align: center;
}
} }
} }
@@ -832,6 +847,5 @@ onUnmounted(() => {
color: #94a3b8; color: #94a3b8;
} }
} }
} }
</style> </style>