From 01cea56a6a777a59a93ea97bb889ea929ac2f7ae Mon Sep 17 00:00:00 2001 From: awen Date: Thu, 29 May 2025 18:29:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E6=A0=B7=E5=BC=8F=E4=BA=A4?= =?UTF-8?q?=E4=BA=92=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../contract-template/CompactSearchBox.tsx | 12 +++++++++--- .../contract-template/ContractSearchHero.tsx | 12 +++++++++--- app/routes/contract-template.search._index.tsx | 2 +- html/合同模板页面.html | 2 +- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/app/components/contract-template/CompactSearchBox.tsx b/app/components/contract-template/CompactSearchBox.tsx index 1e97f54..f8f2c96 100644 --- a/app/components/contract-template/CompactSearchBox.tsx +++ b/app/components/contract-template/CompactSearchBox.tsx @@ -32,9 +32,15 @@ export function CompactSearchBox({ }; const handleKeyDown = (e: React.KeyboardEvent) => { - if (e.key === 'Enter' && (e.ctrlKey || e.metaKey)) { - e.preventDefault(); - handleSearch(); + if (e.key === 'Enter') { + if (e.shiftKey) { + // Shift+回车:允许换行,不做任何处理 + return; + } else { + // 单独回车:触发搜索 + e.preventDefault(); + handleSearch(); + } } }; diff --git a/app/components/contract-template/ContractSearchHero.tsx b/app/components/contract-template/ContractSearchHero.tsx index aed5cc2..bde2cda 100644 --- a/app/components/contract-template/ContractSearchHero.tsx +++ b/app/components/contract-template/ContractSearchHero.tsx @@ -32,9 +32,15 @@ export function ContractSearchHero({ }; const handleKeyDown = (e: React.KeyboardEvent) => { - if (e.key === 'Enter' && (e.ctrlKey || e.metaKey)) { - e.preventDefault(); - handleSearch(); + if (e.key === 'Enter') { + if (e.shiftKey) { + // Shift+回车:允许换行,不做任何处理 + return; + } else { + // 单独回车:触发搜索 + e.preventDefault(); + handleSearch(); + } } }; diff --git a/app/routes/contract-template.search._index.tsx b/app/routes/contract-template.search._index.tsx index f90ce8c..fe48245 100644 --- a/app/routes/contract-template.search._index.tsx +++ b/app/routes/contract-template.search._index.tsx @@ -27,7 +27,7 @@ export default function ContractTemplateSearchIndex() { // 模拟分类数据 const categories = [ - { name: '销售合同', icon: 'ri-handshake-line', count: 128 }, + { name: '销售合同', icon: 'ri-contract-line', count: 128 }, { name: '采购合同', icon: 'ri-shopping-cart-line', count: 96 }, { name: '物流运输', icon: 'ri-truck-line', count: 64 }, { name: '人事劳务', icon: 'ri-user-settings-line', count: 52 }, diff --git a/html/合同模板页面.html b/html/合同模板页面.html index 873e9b1..dd681a9 100644 --- a/html/合同模板页面.html +++ b/html/合同模板页面.html @@ -804,7 +804,7 @@ 为您找到 24 个相关模板
-