功能(文档预览):集成 ONLYOFFICE 安全只读预览与工作台体验
新增 ONLYOFFICE 配置签名、内部内容接口、容器编排与反向代理。 打通网页端和桌面端独立预览工作区,完善文档入口、布局及帮助体验。 补充桌面安全发布门禁、开发脚本、使用文档和前后端测试。
This commit is contained in:
@@ -27,6 +27,7 @@ const readMainStyleSource = () => readSource(resolve(__dirname, "../styles/main.
|
||||
const readFaqSource = () => readSource(resolve(__dirname, "../views/Faq.vue"));
|
||||
const readFaqListSource = () => readSource(resolve(__dirname, "./FaqList.vue"));
|
||||
const readProjectOverviewSource = () => readSource(resolve(__dirname, "../views/ia/ProjectOverview.vue"));
|
||||
const readProjectMilestonesSource = () => readSource(resolve(__dirname, "../views/ia/ProjectMilestones.vue"));
|
||||
|
||||
describe("desktop layout shell", () => {
|
||||
it("routes desktop and web shells through the runtime flag", () => {
|
||||
@@ -373,6 +374,16 @@ describe("desktop layout shell", () => {
|
||||
expect(source).toContain("const removeWorkspaceTabContext = (tabPath: string) => {");
|
||||
});
|
||||
|
||||
it("closes transient preview tasks back to their originating workspace tab", () => {
|
||||
const source = readDesktopLayoutSource();
|
||||
|
||||
expect(source).toContain("const workspaceTaskOrigins = ref<Record<string, string>>({});");
|
||||
expect(source).toContain("if (route.meta.transientWorkspaceTask && previousTabPath && previousTabPath !== current.path)");
|
||||
expect(source).toContain("workspaceTabs.value.find((tab) => tab.path === originPath)");
|
||||
expect(source).toContain("provide(workspaceTaskControllerKey, { closeTransientTask: closeTransientWorkspaceTask });");
|
||||
expect(source).toContain("if (!workspaceTaskOrigins.value[path] && workspaceTabs.value.length <= 1) return false;");
|
||||
});
|
||||
|
||||
it("allows desktop shortcuts to be customized from system preferences", () => {
|
||||
const preferences = readDesktopPreferencesSource();
|
||||
const tauriLib = readTauriLibSource();
|
||||
@@ -625,32 +636,50 @@ describe("desktop layout shell", () => {
|
||||
expect(styles).toContain(':root[data-ctms-theme="dark"] body.is-desktop-runtime .el-dialog');
|
||||
});
|
||||
|
||||
it("keeps first-pass desktop content pages workbench-oriented", () => {
|
||||
it("shares the medical-consult workbench UI across web and desktop shells", () => {
|
||||
const faq = readFaqSource();
|
||||
const faqList = readFaqListSource();
|
||||
const projectOverview = readProjectOverviewSource();
|
||||
const projectMilestones = readProjectMilestonesSource();
|
||||
const webLayout = readWebLayoutSource();
|
||||
|
||||
expect(faq).toContain("const isDesktop = isTauriRuntime();");
|
||||
expect(faq).toContain(":class=\"{ 'medical-consult-page--desktop': isDesktop }\"");
|
||||
expect(faq).toContain('v-if="!isDesktop" class="page-bg-dots"');
|
||||
expect(faq).toContain('<h1 v-if="!isDesktop"');
|
||||
expect(faq).toContain('v-else class="desktop-toolbar-meta"');
|
||||
expect(faq).toContain('v-if="isDesktop" action="faq.create"');
|
||||
expect(faq).toContain('<div v-if="!isDesktop" class="list-toolbar">');
|
||||
expect(faq).toContain(".medical-consult-page--desktop .faq-workspace");
|
||||
expect(faq).toContain("medical-consult-page--workbench");
|
||||
expect(faq).toContain('class="workbench-toolbar-meta"');
|
||||
expect(faq).toContain('<PermissionAction action="faq.create">');
|
||||
expect(faq).not.toContain("const isDesktop = isTauriRuntime();");
|
||||
expect(faq).not.toContain("page-bg-dots");
|
||||
expect(faq).not.toContain("list-toolbar");
|
||||
expect(faq).toContain(".medical-consult-page--workbench .faq-workspace");
|
||||
expect(faq).toContain("grid-template-columns: 236px minmax(0, 1fr);");
|
||||
expect(faqList).toContain(":class=\"{ 'faq-list-card--desktop': isDesktop }\"");
|
||||
expect(faqList).toContain("const isDesktop = isTauriRuntime();");
|
||||
expect(faqList).toContain(".faq-list-card--desktop .faq-table");
|
||||
expect(faqList).toContain('class="faq-list-card faq-list-card--workbench"');
|
||||
expect(faqList).toContain('height="100%"');
|
||||
expect(faqList).not.toContain("const isDesktop = isTauriRuntime();");
|
||||
expect(faqList).toContain(".faq-list-card--workbench .faq-table");
|
||||
expect(projectOverview).toContain(":class=\"{ 'project-overview--desktop': isDesktop }\"");
|
||||
expect(projectOverview).not.toContain("overview-summary-strip");
|
||||
expect(projectOverview).not.toContain("const activeCenterCount");
|
||||
expect(projectOverview).toContain("desktop-attention-section");
|
||||
expect(projectOverview).not.toContain("项目关注");
|
||||
expect(projectOverview).not.toContain("desktop-attention-head");
|
||||
expect(projectOverview).toContain('class="overview-updated-at">更新 {{ overviewUpdatedAtLabel }}</span>');
|
||||
expect(projectOverview.indexOf("刷新")).toBeLessThan(projectOverview.indexOf('class="overview-updated-at"'));
|
||||
expect(projectOverview.indexOf('class="overview-updated-at"')).toBeLessThan(projectOverview.indexOf('class="progress-legend"'));
|
||||
expect(projectOverview).toContain('class="overview-live-clock">数据 {{ overviewClockText }}</span>');
|
||||
expect(projectOverview).toContain('v-else class="overview-updated-at">更新 {{ overviewUpdatedAtLabel }}</span>');
|
||||
expect(projectOverview.indexOf("刷新")).toBeLessThan(projectOverview.indexOf('class="overview-live-clock"'));
|
||||
expect(projectOverview.indexOf('class="overview-live-clock"')).toBeLessThan(projectOverview.indexOf('class="progress-legend"'));
|
||||
expect(projectOverview).toContain("overviewClockTimer = window.setInterval");
|
||||
expect(webLayout).not.toContain("headerClockText");
|
||||
expect(webLayout).not.toContain('key: "updatedAt"');
|
||||
expect(webLayout).not.toContain('class="header-center"');
|
||||
expect(webLayout).not.toContain("headerProjectInfo");
|
||||
expect(webLayout).not.toContain("fetchProjectOverview");
|
||||
expect(webLayout).not.toContain("loadHeaderOverviewStats");
|
||||
expect(webLayout).not.toContain("header-status-pill");
|
||||
expect(webLayout).not.toContain("header-meta-item");
|
||||
expect(projectMilestones).toContain('class="unified-action-bar milestone-action-bar"');
|
||||
expect(projectMilestones).not.toContain('class="unified-action-bar bar--flush"');
|
||||
expect(projectMilestones).not.toContain("sourceLabel");
|
||||
expect(projectMilestones).not.toContain("dataSourceLabel");
|
||||
expect(projectMilestones).not.toContain("updatedAtLabel");
|
||||
expect(projectMilestones).toContain(".milestone-action-bar {\n min-height: 56px;\n box-sizing: border-box;");
|
||||
expect(projectOverview).toContain("overview-workbench");
|
||||
expect(projectOverview).toContain("enrollment-snapshot");
|
||||
expect(projectOverview).toContain("desktop-attention-board");
|
||||
|
||||
Reference in New Issue
Block a user