diff --git a/src/api/hisApi.ts b/src/api/hisApi.ts index c73eac8..fbfdb81 100644 --- a/src/api/hisApi.ts +++ b/src/api/hisApi.ts @@ -88,6 +88,11 @@ export interface PdfResponse { message: string | null; } +export interface SignPdfResponse { + pdf_url: string; + message: string | null; +} + export interface DaojiandanPdfResponse { exam_id: number; pdf_url: string; @@ -281,12 +286,12 @@ export async function getDaojiandanPdf( export async function submitDaojiandanSign( exam_id: number, sign_file: File | Blob -): Promise> { +): Promise> { const formData = new FormData(); formData.append("exam_id", exam_id.toString()); formData.append("sign_file", sign_file); - const response = await axiosInstance.post>( + const response = await axiosInstance.post>( "daojiandan-sign-submit", formData, { diff --git a/src/pages/UI7/UI7.tsx b/src/pages/UI7/UI7.tsx index 1d03bb1..56ddb8b 100644 --- a/src/pages/UI7/UI7.tsx +++ b/src/pages/UI7/UI7.tsx @@ -193,7 +193,7 @@ const UI7: React.FC = () => { canvas.style.width = `${rect.width}px`; canvas.style.height = `${rect.height}px`; ctx.strokeStyle = "#000000"; - ctx.lineWidth = 5; + ctx.lineWidth = 10; ctx.lineCap = "round"; ctx.lineJoin = "round"; ctx.imageSmoothingEnabled = true; @@ -362,6 +362,7 @@ const UI7: React.FC = () => { throw new Error(res.Message || "提交签名失败"); } window.electronAPI?.log("info", "[UI7] 签名提交成功"); + localStorage.setItem("consentSignature", res.Data.pdf_url || ""); navigate("/UI8"); } catch (err) { const msg = (err as Error).message || "签名提交失败,请稍后重试"; diff --git a/src/pages/UI8/UI8.css b/src/pages/UI8/UI8.css index 9902407..376f37e 100644 --- a/src/pages/UI8/UI8.css +++ b/src/pages/UI8/UI8.css @@ -4,12 +4,15 @@ overflow-y: auto; overflow-x: hidden; /* 隐藏滚动条但保持滚动功能 */ - scrollbar-width: none; /* Firefox */ - -ms-overflow-style: none; /* IE 和 Edge */ + scrollbar-width: none; + /* Firefox */ + -ms-overflow-style: none; + /* IE 和 Edge */ } .ui8-table-container::-webkit-scrollbar { - display: none; /* Chrome, Safari, Opera */ + display: none; + /* Chrome, Safari, Opera */ } .ui8-table { @@ -88,13 +91,16 @@ box-sizing: border-box; position: relative; /* 隐藏滚动条但保持滚动功能 */ - scrollbar-width: none; /* Firefox */ - -ms-overflow-style: none; /* IE 和 Edge */ + scrollbar-width: none; + /* Firefox */ + -ms-overflow-style: none; + /* IE 和 Edge */ padding: 20px 10px; } .ui8-pdf-container::-webkit-scrollbar { - display: none; /* Chrome, Safari, Opera */ + display: none; + /* Chrome, Safari, Opera */ } /* PDF 页面包装器 - 不再需要,保留以防兼容性 */ @@ -119,6 +125,7 @@ transform: translateY(0); opacity: 1; } + 100% { transform: translateY(-10px); opacity: 0; @@ -135,6 +142,7 @@ transform: translateY(0); opacity: 1; } + 100% { transform: translateY(10px); opacity: 0; @@ -153,10 +161,13 @@ } @keyframes swipeHint { - 0%, 100% { + + 0%, + 100% { opacity: 0.65; transform: translateY(0) scale(1); } + 50% { opacity: 1; transform: translateY(-5px) scale(1.02); @@ -191,6 +202,7 @@ opacity: 0; transform: scale(0.95); } + to { opacity: 1; transform: scale(1); @@ -225,4 +237,107 @@ .ui8-right-section :last-child { margin-top: 10px; margin-left: 100px; +} + +.ui8-printer-panel { + width: 100%; + height: -6px; + margin-right: 44px; + border-radius: 10px; + display: flex; + justify-content: end; + position: relative; +} + +.ui8-printer-label { + font-size: 18px; + font-family: NotoSansCJKsc-Medium; +} + +.ui8-printer-trigger { + height: 30px; + border: none; + padding: 0 20px; + font-size: 16px; + font-family: NotoSansCJKsc-Regular; + background-color: inherit; + display: flex; + align-items: center; + justify-content: space-between; + cursor: pointer; + transition: border-color 0.2s ease, box-shadow 0.2s ease; +} + +.ui8-printer-trigger.open { + box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); +} + +.ui8-printer-trigger.disabled { + color: rgba(0, 0, 0, 0.45); + border-color: rgba(0, 0, 0, 0.2); + background-color: #f5f5f5; + cursor: not-allowed; +} + +.ui8-printer-arrow { + width: 0; + height: 0; + border-left: 8px solid transparent; + border-right: 8px solid transparent; + border-top: 10px solid rgba(0, 45, 93, 0.8); + transition: transform 0.2s ease; +} + +.ui8-printer-trigger.open .ui8-printer-arrow { + transform: rotate(180deg); +} + +.ui8-printer-options { + position: absolute; + top: 30px; + border-radius: 20px; + background-color: white; + border: none; + box-shadow: none; + max-height: 100px; + overflow-y: auto; + z-index: 20; + padding: 0; + /* 不显示滚动条 */ + scrollbar-width: none; + -ms-overflow-style: none; +} + +.ui8-printer-options::-webkit-scrollbar { + display: none; +} + +.ui8-printer-option { + padding: 14px 22px; + font-size: 22px; + font-family: NotoSansCJKsc-Regular; + color: #002d5d; + cursor: pointer; + transition: background-color 0.15s ease; +} + +.ui8-printer-option:hover, +.ui8-printer-option:focus { + background-color: rgba(0, 45, 93, 0.08); + outline: none; +} + +.ui8-printer-option.active { + background-color: rgba(0, 45, 93, 0.15); + font-weight: 600; +} + +.ui8-printer-hint { + font-size: 20px; + color: rgba(0, 0, 0, 0.6); +} + +.ui8-printer-error { + font-size: 22px; + color: #b12651; } \ No newline at end of file