更新打印

This commit is contained in:
xianyi
2025-11-27 16:32:08 +08:00
parent 2a7cc9ae30
commit 540ef7488a
3 changed files with 131 additions and 10 deletions

View File

@@ -88,6 +88,11 @@ export interface PdfResponse {
message: string | null; message: string | null;
} }
export interface SignPdfResponse {
pdf_url: string;
message: string | null;
}
export interface DaojiandanPdfResponse { export interface DaojiandanPdfResponse {
exam_id: number; exam_id: number;
pdf_url: string; pdf_url: string;
@@ -281,12 +286,12 @@ export async function getDaojiandanPdf(
export async function submitDaojiandanSign( export async function submitDaojiandanSign(
exam_id: number, exam_id: number,
sign_file: File | Blob sign_file: File | Blob
): Promise<ApiResponse<PdfResponse>> { ): Promise<ApiResponse<SignPdfResponse>> {
const formData = new FormData(); const formData = new FormData();
formData.append("exam_id", exam_id.toString()); formData.append("exam_id", exam_id.toString());
formData.append("sign_file", sign_file); formData.append("sign_file", sign_file);
const response = await axiosInstance.post<ApiResponse<PdfResponse>>( const response = await axiosInstance.post<ApiResponse<SignPdfResponse>>(
"daojiandan-sign-submit", "daojiandan-sign-submit",
formData, formData,
{ {

View File

@@ -193,7 +193,7 @@ const UI7: React.FC = () => {
canvas.style.width = `${rect.width}px`; canvas.style.width = `${rect.width}px`;
canvas.style.height = `${rect.height}px`; canvas.style.height = `${rect.height}px`;
ctx.strokeStyle = "#000000"; ctx.strokeStyle = "#000000";
ctx.lineWidth = 5; ctx.lineWidth = 10;
ctx.lineCap = "round"; ctx.lineCap = "round";
ctx.lineJoin = "round"; ctx.lineJoin = "round";
ctx.imageSmoothingEnabled = true; ctx.imageSmoothingEnabled = true;
@@ -362,6 +362,7 @@ const UI7: React.FC = () => {
throw new Error(res.Message || "提交签名失败"); throw new Error(res.Message || "提交签名失败");
} }
window.electronAPI?.log("info", "[UI7] 签名提交成功"); window.electronAPI?.log("info", "[UI7] 签名提交成功");
localStorage.setItem("consentSignature", res.Data.pdf_url || "");
navigate("/UI8"); navigate("/UI8");
} catch (err) { } catch (err) {
const msg = (err as Error).message || "签名提交失败,请稍后重试"; const msg = (err as Error).message || "签名提交失败,请稍后重试";

View File

@@ -4,12 +4,15 @@
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
/* 隐藏滚动条但保持滚动功能 */ /* 隐藏滚动条但保持滚动功能 */
scrollbar-width: none; /* Firefox */ scrollbar-width: none;
-ms-overflow-style: none; /* IE 和 Edge */ /* Firefox */
-ms-overflow-style: none;
/* IE 和 Edge */
} }
.ui8-table-container::-webkit-scrollbar { .ui8-table-container::-webkit-scrollbar {
display: none; /* Chrome, Safari, Opera */ display: none;
/* Chrome, Safari, Opera */
} }
.ui8-table { .ui8-table {
@@ -88,13 +91,16 @@
box-sizing: border-box; box-sizing: border-box;
position: relative; position: relative;
/* 隐藏滚动条但保持滚动功能 */ /* 隐藏滚动条但保持滚动功能 */
scrollbar-width: none; /* Firefox */ scrollbar-width: none;
-ms-overflow-style: none; /* IE 和 Edge */ /* Firefox */
-ms-overflow-style: none;
/* IE 和 Edge */
padding: 20px 10px; padding: 20px 10px;
} }
.ui8-pdf-container::-webkit-scrollbar { .ui8-pdf-container::-webkit-scrollbar {
display: none; /* Chrome, Safari, Opera */ display: none;
/* Chrome, Safari, Opera */
} }
/* PDF 页面包装器 - 不再需要,保留以防兼容性 */ /* PDF 页面包装器 - 不再需要,保留以防兼容性 */
@@ -119,6 +125,7 @@
transform: translateY(0); transform: translateY(0);
opacity: 1; opacity: 1;
} }
100% { 100% {
transform: translateY(-10px); transform: translateY(-10px);
opacity: 0; opacity: 0;
@@ -135,6 +142,7 @@
transform: translateY(0); transform: translateY(0);
opacity: 1; opacity: 1;
} }
100% { 100% {
transform: translateY(10px); transform: translateY(10px);
opacity: 0; opacity: 0;
@@ -153,10 +161,13 @@
} }
@keyframes swipeHint { @keyframes swipeHint {
0%, 100% {
0%,
100% {
opacity: 0.65; opacity: 0.65;
transform: translateY(0) scale(1); transform: translateY(0) scale(1);
} }
50% { 50% {
opacity: 1; opacity: 1;
transform: translateY(-5px) scale(1.02); transform: translateY(-5px) scale(1.02);
@@ -191,6 +202,7 @@
opacity: 0; opacity: 0;
transform: scale(0.95); transform: scale(0.95);
} }
to { to {
opacity: 1; opacity: 1;
transform: scale(1); transform: scale(1);
@@ -225,4 +237,107 @@
.ui8-right-section :last-child { .ui8-right-section :last-child {
margin-top: 10px; margin-top: 10px;
margin-left: 100px; 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;
} }