chore(order-delivery-reply): 前端页面调整、细节修改、优化逻辑等
This commit is contained in:
1 parent
7fb36b301c
commit
36868f875c
36 files changed
+1577
-376
No files matched your search
@@ -133,6 +133,20 @@ const loadOptions = async (source: string): Promise<void> => {
|
||||
}
|
||||
};
|
||||
|
||||
/** multi_select 选项本地搜索词(按字段 key 隔离)。 */
|
||||
const multiSearch = reactive<Record<string, string>>({});
|
||||
|
||||
/** multi_select 选项按关键词过滤(匹配 label/描述,大小写不敏感)。 */
|
||||
const filteredMultiOptions = (field: PlatformTaskParamField) => {
|
||||
const keyword = (multiSearch[field.key] || '').trim().toLowerCase();
|
||||
const all = optionsCache[field.options_source || ''] || [];
|
||||
if (!keyword) return all;
|
||||
return all.filter((o) =>
|
||||
String(o.label || '').toLowerCase().includes(keyword) ||
|
||||
String(o.description || '').toLowerCase().includes(keyword),
|
||||
);
|
||||
};
|
||||
|
||||
/** multi_select 勾选切换。 */
|
||||
const toggleMultiValue = (key: string, value: string | number): void => {
|
||||
const current: Array<string | number> = Array.isArray(params.value[key]) ? [...params.value[key]] : [];
|
||||
@@ -323,6 +337,12 @@ watch(
|
||||
v-else-if="field.type === 'multi_select'"
|
||||
class="max-h-52 space-y-1 overflow-y-auto rounded-xl border border-default bg-surface p-2"
|
||||
>
|
||||
<input
|
||||
v-model="multiSearch[field.key]"
|
||||
type="text"
|
||||
class="mb-1 w-full rounded-lg border border-default px-2 py-1.5 text-sm outline-none focus:border-blue-500"
|
||||
:placeholder="$t('admin.schedule.form.dynamicParamsSearchPlaceholder')"
|
||||
/>
|
||||
<p v-if="optionsLoading[field.options_source || '']" class="px-2 py-1 text-xs text-muted">
|
||||
{{ $t('admin.schedule.form.dynamicParamsOptionsLoading') }}
|
||||
</p>
|
||||
@@ -332,8 +352,14 @@ watch(
|
||||
>
|
||||
{{ $t('admin.schedule.form.dynamicParamsNoOptions') }}
|
||||
</p>
|
||||
<p
|
||||
v-else-if="!filteredMultiOptions(field).length"
|
||||
class="px-2 py-1 text-xs text-muted"
|
||||
>
|
||||
{{ $t('admin.schedule.form.dynamicParamsSearchNoMatch') }}
|
||||
</p>
|
||||
<label
|
||||
v-for="option in optionsCache[field.options_source || ''] || []"
|
||||
v-for="option in filteredMultiOptions(field)"
|
||||
:key="String(option.value)"
|
||||
class="flex cursor-pointer items-start gap-2 rounded-lg px-2 py-1.5 text-sm transition hover:bg-surface-soft"
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user