refactor(qrCode): 优化二维码解析功能
- 将'二维码转 URL'改为'二维码转文本' - 将解析结果的文本预览框的 placeholder 置为空 - 去除手动解析二维码功能,只保留自动解析
This commit is contained in:
@@ -9,8 +9,7 @@ import { useQrCodeContext } from '../contexts/QrCodeContext';
|
||||
export default function ParsePanel() {
|
||||
const { t } = useLazyTranslation('qrCode');
|
||||
const { showMessage } = useSnackbar();
|
||||
const { parserState, setParserState, parseQrCode, handleFileChange, handleClearFile } =
|
||||
useQrCodeContext();
|
||||
const { parserState, setParserState, handleFileChange, handleClearFile } = useQrCodeContext();
|
||||
|
||||
// 全局粘贴事件监听
|
||||
const handlePaste = useCallback(
|
||||
@@ -77,21 +76,8 @@ export default function ParsePanel() {
|
||||
readOnly
|
||||
showClear={false}
|
||||
allowCopy
|
||||
placeholder=""
|
||||
externalError={parserState.parseError}
|
||||
actions={[
|
||||
{
|
||||
key: 'parse',
|
||||
label: parserState.parsing ? t('qrCode:parsing') : t('qrCode:parseButton'),
|
||||
type: 'primary',
|
||||
position: 'bottom',
|
||||
disabled: !parserState.selectedFile || parserState.parsing,
|
||||
onClick: () => {
|
||||
if (parserState.selectedFile) {
|
||||
parseQrCode(parserState.selectedFile);
|
||||
}
|
||||
},
|
||||
},
|
||||
]}
|
||||
showMessage={showMessage}
|
||||
/>
|
||||
</Grid>
|
||||
|
||||
Reference in New Issue
Block a user