From 220841444a4269a0592a30004c251bf0a8033349 Mon Sep 17 00:00:00 2001 From: iqudoo Date: Fri, 12 Jun 2026 21:17:24 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 18 ++-- src/components/LabelDesigner.tsx | 158 ++++++++++++++++++++----------- src/components/PropSidebar.tsx | 57 +++++++---- src/hooks/useIsMobile.ts | 5 + src/index.css | 28 ++++++ src/types.ts | 4 + src/utils.ts | 51 +++++++++- 7 files changed, 240 insertions(+), 81 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 8a6b8fb..7981b78 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -290,7 +290,7 @@ export default function App() { const handleExportTemplate = (tmpl: LabelTemplate) => { const dataStr = JSON.stringify(normalizeTemplate(tmpl), null, 2); const dataUri = 'data:application/json;charset=utf-8,' + encodeURIComponent(dataStr); - const exportFileDefaultName = `模板_${tmpl.name?.replace(/\s+/g, '_') || tmpl.id}.json`; + const exportFileDefaultName = `模板_${tmpl.name?.replace(/\s+/g, '_') || tmpl.id}.lad`; const linkElement = document.createElement('a'); linkElement.setAttribute('href', dataUri); @@ -325,12 +325,12 @@ export default function App() { handleSelectTemplate(newId); await showAlert('模板读取解析成功,已追加至库中。', { variant: 'success' }); } else { - await showAlert('JSON格式错误:外部模板必须至少包含 width, height, 以及 elements 分组', { + await showAlert('模板格式错误:外部模板必须至少包含 width, height, 以及 elements 分组', { variant: 'error', }); } } catch (err) { - await showAlert('文件解码失败,请确保您上传的是合法的 json 模板结构文件。', { + await showAlert('文件解码失败,请确保您上传的是合法的模板文件。', { variant: 'error', }); } @@ -648,10 +648,10 @@ export default function App() {