feat(web): 同步预约演示与兜底渠道优化
This commit is contained in:
@@ -270,17 +270,21 @@ const EditChannelModal = (props) => {
|
||||
res.data.data
|
||||
.filter((ch) => ch.id !== selfId)
|
||||
.map((ch) => {
|
||||
const label = `${formatIdReference(ch.id)} ${ch.name}`;
|
||||
if (ch.status !== 1) {
|
||||
const searchLabel = `${label}${t('(已禁用)')}`;
|
||||
return {
|
||||
value: ch.id,
|
||||
label: `${formatIdReference(ch.id)} ${ch.name}${t('(已禁用)')}`,
|
||||
label,
|
||||
searchLabel,
|
||||
title: searchLabel,
|
||||
disabled: true,
|
||||
};
|
||||
}
|
||||
const parts = [`${formatIdReference(ch.id)} ${ch.name}`];
|
||||
if (ch.group) parts.push(ch.group);
|
||||
if (ch.region) parts.push(ch.region);
|
||||
return { value: ch.id, label: parts.join(' · ') };
|
||||
const searchLabel = [label, ch.group, ch.region]
|
||||
.filter(Boolean)
|
||||
.join(' · ');
|
||||
return { value: ch.id, label, searchLabel };
|
||||
}),
|
||||
);
|
||||
setFallbackCandidatesLoaded(true);
|
||||
@@ -2993,6 +2997,9 @@ const EditChannelModal = (props) => {
|
||||
filter
|
||||
showClear
|
||||
max={20}
|
||||
showSearch={{
|
||||
optionFilterProp: ['searchLabel', 'label'],
|
||||
}}
|
||||
optionList={fallbackOptionList}
|
||||
// Semi 对 disabled option 的已选标签不给关闭按钮;
|
||||
// 已禁用/已删除的渠道需要能从链中移除,故自绘可关闭标签
|
||||
@@ -3004,9 +3011,20 @@ const EditChannelModal = (props) => {
|
||||
color='white'
|
||||
size='large'
|
||||
onClose={onClose}
|
||||
style={{ maxWidth: '100%' }}
|
||||
title={
|
||||
option.disabled ? option.searchLabel : undefined
|
||||
}
|
||||
style={{
|
||||
maxWidth: '100%',
|
||||
color: option.disabled
|
||||
? 'var(--text-secondary)'
|
||||
: undefined,
|
||||
}}
|
||||
>
|
||||
{option.label}
|
||||
{option.disabled && option.searchLabel && (
|
||||
<span className='sr-only'>{t('(已禁用)')}</span>
|
||||
)}
|
||||
</Tag>
|
||||
),
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user