diff --git a/src/components/Editor/index.jsx b/src/components/Editor/index.jsx index 9351c3c..d65fe64 100644 --- a/src/components/Editor/index.jsx +++ b/src/components/Editor/index.jsx @@ -4,6 +4,19 @@ import 'quill/dist/quill.snow.css'; // import 'quill/dist/quill.bubble.css'; import './custom.snow.css'; + +function decodeEntities(str) { + const entities = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'", + ' ': ' ', + }; + return str.replace(/&|<|>|"|'| /g, (match) => entities[match]); +} + const toolbarOptions = [ [{ 'header': [1, 2, 3, 4, 5, 6, false] }], // [{ 'font': [] }], @@ -102,7 +115,8 @@ const Editor = forwardRef(({ readOnly, defaultValue, value, onChange, onTextChan // const text = quill.getText(); onTextChangeRef.current?.(...args); const html = quill.getSemanticHTML(); - onChangeRef.current?.(html); + const htmlText = decodeEntities(html); + onChangeRef.current?.(htmlText); }); quill.on(Quill.events.SELECTION_CHANGE, (...args) => { diff --git a/src/components/SearchForm.jsx b/src/components/SearchForm.jsx index 7c2e4bd..b53db2d 100644 --- a/src/components/SearchForm.jsx +++ b/src/components/SearchForm.jsx @@ -260,7 +260,7 @@ function getFields(props) { item( "dates", //时间日期 99, - + <> diff --git a/src/components/SearchInput.jsx b/src/components/SearchInput.jsx index a30bcfa..62d1ca5 100644 --- a/src/components/SearchInput.jsx +++ b/src/components/SearchInput.jsx @@ -13,7 +13,7 @@ function DebounceSelect({ fetchOptions, debounceTimeout = 500, initLoad = false, if (initLoad && defaultOptions.length===0) { loadOptions(' '); } - }, [initLoad]); + }, [initLoad, defaultOptions]); const loadOptions = (value) => { fetchRef.current += 1; @@ -50,13 +50,8 @@ function DebounceSelect({ fetchOptions, debounceTimeout = 500, initLoad = false, onSearch={debounceFetcher} notFoundContent={fetching ? : null} optionFilterProp='label' - > - {options.map((d) => ( - - {d.label} - - ))} - + options={options} + /> ); } diff --git a/src/components/VendorSelector.jsx b/src/components/VendorSelector.jsx index 2e7b643..dfb75f5 100644 --- a/src/components/VendorSelector.jsx +++ b/src/components/VendorSelector.jsx @@ -20,12 +20,13 @@ const VendorSelector = ({ ...props }) => { const { travelAgencyId: myAgencyId } = usingStorage(); const [{ travelAgencyName: myAgencyName }] = useAuthStore((state) => [state.currentUser]); const { t } = useTranslation(); - const [{ vendorList }, setCache] = useFormStore(state => [state.cache, state.setCache]); + const [{ vendorList }, setCache] = useFormStore(state => [state.cache, state.setCache]); return ( <> { const { t } = useTranslation(); const { message } = App.useApp(); @@ -22,8 +38,10 @@ const Edit = ({ ...props }) => { const [form] = Form.useForm(); const clickedButton = useRef(''); const quillRef = useRef(); + const setCache = useFormStore(state => state.setCache); + - const [showAgencySelector, setShowAgencySelector] = useState(0); + const [showAgencySelector, setShowAgencySelector] = useState(1); const [showAgencySeleted, setShowAgencySeleted] = useState(0); // const [noticeInfo, setNoticeInfo] = useState({}); @@ -45,7 +63,10 @@ const Edit = ({ ...props }) => { form.setFieldsValue({ agency_list: _list, }); + setCache({ vendorList: _list }) }); + } else { + setCache({ vendorList: allOverseasAgency }) } }, []); @@ -131,7 +152,7 @@ const Edit = ({ ...props }) => { - +