|
|
|
@ -13,13 +13,16 @@ class SiteSelect extends Component {
|
|
|
|
|
const { store, mode, value, onChange, show_all, ...extProps } = this.props;
|
|
|
|
|
const _mode = mode || store?.group_select_mode || null;
|
|
|
|
|
const _show_all = ['tags', 'multiple'].includes(_mode) ? false : show_all;
|
|
|
|
|
const _value = !['tags', 'multiple'].includes(_mode) ? (value || store?.webcode || undefined) : (value || store?.webcode || []).filter(item => item.value !== 'ALL');
|
|
|
|
|
const __value = ['tags', 'multiple'].includes(_mode) ? (value.constructor === Object ? [value] : value) : undefined;
|
|
|
|
|
const _value = !['tags', 'multiple'].includes(_mode)
|
|
|
|
|
? value || store?.webcode || undefined
|
|
|
|
|
: (__value || store?.webcode || []).filter((item) => String(item?.value || item.key).toLowerCase() !== 'all');
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
<Select
|
|
|
|
|
mode={_mode}
|
|
|
|
|
style={{width: '100%'}}
|
|
|
|
|
placeholder="选择来源"
|
|
|
|
|
placeholder="所有来源"
|
|
|
|
|
value={_value}
|
|
|
|
|
onChange={(value) => {
|
|
|
|
|
if (typeof onChange === 'function') {
|
|
|
|
|