refactor(qrCode): 优化二维码解析功能

- 将'二维码转 URL'改为'二维码转文本'
- 将解析结果的文本预览框的 placeholder 置为空
- 去除手动解析二维码功能,只保留自动解析
This commit is contained in:
雨霖铃
2026-05-21 00:22:47 +08:00
parent 4b339fc628
commit e4fac241f1
3 changed files with 6 additions and 20 deletions
+2 -16
View File
@@ -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>