feat(前端界面): 精简并统一界面文案
build.yaml / build (push) Successful in 38s

This commit is contained in:
xiaoqidun committed 2026-09-18 16:42:06 +08:00
1 parent cbd0f7ca44
commit 92ddacaf66
3 files changed
+12 -16

No files matched your search

+3 -3
View File
@@ -291,8 +291,8 @@
</div> </div>
<label class="form-row" data-annotation="watermark"><span>排列</span><select id="annotationTile"><option value="single">单个</option><option value="tile">平铺</option></select></label> <label class="form-row" data-annotation="watermark"><span>排列</span><select id="annotationTile"><option value="single">单个</option><option value="tile">平铺</option></select></label>
<div class="form-row" data-annotation="watermark"><label id="annotationPlacementLabel" for="annotationPlacement">位置</label><div class="annotation-placement"><select id="annotationPlacement"><option value="page">居中</option><option value="custom">指定</option></select><button id="annotationPick" class="button" type="button">定位</button></div></div> <div class="form-row" data-annotation="watermark"><label id="annotationPlacementLabel" for="annotationPlacement">位置</label><div class="annotation-placement"><select id="annotationPlacement"><option value="page">居中</option><option value="custom">指定</option></select><button id="annotationPick" class="button" type="button">定位</button></div></div>
<label class="form-row" data-annotation="watermark"><span>应用</span><select id="annotationScope"><option value="current">本页</option><option value="all">全文</option><option value="custom">指定</option></select></label> <label class="form-row" data-annotation="watermark"><span>应用</span><select id="annotationScope"><option value="current">本页</option><option value="all">全部</option><option value="custom">指定</option></select></label>
<label class="form-row" data-annotation="note watermark stamp link"><span>页面</span><input id="annotationPages" type="text" required></label> <label class="form-row" data-annotation="note watermark stamp link"><span>页码</span><input id="annotationPages" type="text" required></label>
<div class="form-actions"><div id="annotationCreateStatus" class="form-status" role="status"></div><button id="annotationCreateCancel" class="button" type="button">取消</button><button class="button" type="submit">确定</button></div> <div class="form-actions"><div id="annotationCreateStatus" class="form-status" role="status"></div><button id="annotationCreateCancel" class="button" type="button">取消</button><button class="button" type="submit">确定</button></div>
</form> </form>
</dialog> </dialog>
@@ -433,7 +433,7 @@
</section> </section>
<div class="panel-row"> <div class="panel-row">
<div class="panel-title compact">文档</div> <div class="panel-title compact">文档</div>
<button id="infoButton" class="small-button" type="button" aria-label="编辑文档信息" aria-haspopup="dialog" aria-controls="infoPanel" hidden>修改</button> <button id="infoButton" class="small-button" type="button" aria-label="修改文档信息" aria-haspopup="dialog" aria-controls="infoPanel" hidden>修改</button>
</div> </div>
<div id="editNotice" class="font-permission-hint" role="status" hidden></div> <div id="editNotice" class="font-permission-hint" role="status" hidden></div>
<dl class="meta-list"> <dl class="meta-list">
-6
View File
@@ -1485,12 +1485,6 @@ button.outline-link:hover {
outline: none; outline: none;
} }
.edit-text::selection,
.edit-text ::selection {
color: #fff;
background: var(--accent);
}
.editing-select .edit-layer { .editing-select .edit-layer {
display: block; display: block;
} }
+9 -7
View File
@@ -1328,7 +1328,7 @@ function openPagePanel() {
for (const [input, key] of [[el.pageWidth, "width"], [el.pageHeight, "height"]]) { for (const [input, key] of [[el.pageWidth, "width"], [el.pageHeight, "height"]]) {
const same = pages.every(page => page[key] === pages[0][key]); const same = pages.every(page => page[key] === pages[0][key]);
input.value = same ? String(pages[0][key]) : ""; input.value = same ? String(pages[0][key]) : "";
input.placeholder = same ? "" : "不同"; input.placeholder = same ? "" : "混合";
} }
el.pageRangeRow.hidden = pages.length === 1; el.pageRangeRow.hidden = pages.length === 1;
el.pageRange.textContent = `共${pages.length}页`; el.pageRange.textContent = `共${pages.length}页`;
@@ -1446,7 +1446,7 @@ async function toggleEditor() {
function confirmTextReflow(item) { function confirmTextReflow(item) {
return canEditObject(item, "reflow") && (canEditObject(item, "layoutKnown") return canEditObject(item, "reflow") && (canEditObject(item, "layoutKnown")
|| window.confirm("原文排版未知,将重新排版。继续?")); || window.confirm("将重新排版原文,是否继续?"));
} }
function openCreatePanel() { function openCreatePanel() {
@@ -2714,7 +2714,7 @@ async function loadWASM() {
if (data.ok) { if (data.ok) {
request.resolve(data.data); request.resolve(data.data);
} else { } else {
const err = new Error(missingGlyphMessage(data.missingGlyphs) || (data.reasonCode === "layoutRequired" ? "请先设置段落排版,再跨段或换行修改" : data.error)); const err = new Error(missingGlyphMessage(data.missingGlyphs) || (data.reasonCode === "layoutRequired" ? "跨段或换行修改需先设置段落排版" : data.error));
if (data.canceled) { if (data.canceled) {
err.name = "AbortError"; err.name = "AbortError";
} }
@@ -3513,9 +3513,10 @@ async function exportFile(whole, indices = null, value = el.exportFormat.value)
const fileName = saving && indices !== null ? `${baseFileName()}_选页.ofd` : whole ? `${baseFileName()}.${extension}` : pageFileName(extension); const fileName = saving && indices !== null ? `${baseFileName()}_选页.ofd` : whole ? `${baseFileName()}.${extension}` : pageFileName(extension);
const pageIndex = state.pageIndex; const pageIndex = state.pageIndex;
const dpi = exportFormatUsesDPI(format.value) ? currentImageDPI() : 0; const dpi = exportFormatUsesDPI(format.value) ? currentImageDPI() : 0;
const status = saving ? "正在保存文档" : whole ? STATUS.exporting : STATUS.pageExporting;
state.exporting = true; state.exporting = true;
updateControls(); updateControls();
setBusy(true, `正在生成 ${label}`, null, whole ? STATUS.exporting : STATUS.pageExporting); setBusy(true, `正在生成 ${label}`, null, status);
try { try {
const file = window.showSaveFilePicker ? await window.showSaveFilePicker({ const file = window.showSaveFilePicker ? await window.showSaveFilePicker({
suggestedName: fileName, suggestedName: fileName,
@@ -3530,7 +3531,7 @@ async function exportFile(whole, indices = null, value = el.exportFormat.value)
if (!await canvasEditor.commitText()) return; if (!await canvasEditor.commitText()) return;
if (!await canvasEditor.commitCrop()) return; if (!await canvasEditor.commitCrop()) return;
openSeq = state.openSeq; openSeq = state.openSeq;
setBusy(true, `正在生成 ${label}`, null, whole ? STATUS.exporting : STATUS.pageExporting); setBusy(true, `正在生成 ${label}`, null, status);
} }
const result = saving ? await callWASM("ofdgoSaveDocument", indices, file) : whole const result = saving ? await callWASM("ofdgoSaveDocument", indices, file) : whole
? await callWASM("ofdgoExportDocument", format.value, dpi, indices, file) ? await callWASM("ofdgoExportDocument", format.value, dpi, indices, file)
@@ -3549,9 +3550,10 @@ async function exportFile(whole, indices = null, value = el.exportFormat.value)
return true; return true;
} catch (err) { } catch (err) {
if (openSeq === state.openSeq) { if (openSeq === state.openSeq) {
if (el.batchPagesPanel.open) el.batchPagesStatus.textContent = err.name === "AbortError" ? "导出已取消" : err.message; const canceled = saving ? "保存已取消" : "导出已取消";
if (el.batchPagesPanel.open) el.batchPagesStatus.textContent = err.name === "AbortError" ? canceled : err.message;
if (err.name === "AbortError") { if (err.name === "AbortError") {
setStatus("导出已取消"); setStatus(canceled);
} else { } else {
showError(err, false); showError(err, false);
} }