Ver código fonte

feat(@six/wisdom-legacy): 成果管理 - 论文静态页面新增

Co-authored-by: Cursor <cursoragent@cursor.com>
cmj 2 dias atrás
pai
commit
0dd5613df8

+ 1 - 0
apps/wisdom-legacy/src/api/outcome/index.ts

@@ -1,2 +1,3 @@
 export * from './medical-case-library.api';
+export * from './paper.api';
 export * from './treatment-plan.api';

+ 115 - 0
apps/wisdom-legacy/src/api/outcome/paper.api.ts

@@ -0,0 +1,115 @@
+import type { PaperSubmitVO, PaperVO } from './paper.schema';
+
+import type { PageQueryMethodArgs } from '#/request/schema';
+
+import { getEnvelopeData, httpClient } from '#/request';
+import {
+  pageQueryArgsTransform,
+  paginateTransform,
+  transform,
+} from '#/request/schema';
+
+import {
+  mockDeletePaperMethod,
+  mockEditPaperMethod,
+  mockGetPaperMethod,
+  mockListPaperMethod,
+  USE_PAPER_MOCK,
+} from './paper.mock';
+import { decodePaper, encodePaper, encodePaperQuery } from './paper.schema';
+
+export { USE_PAPER_MOCK } from './paper.mock';
+export type {
+  PaperCategory,
+  PaperQueryVO,
+  PaperSubmitVO,
+  PaperVO,
+} from './paper.schema';
+export {
+  getPaperCategoryLabel,
+  PAPER_CATEGORY_OPTIONS,
+  PaperVOSchema,
+} from './paper.schema';
+
+/** 论文分页列表 */
+export function listPaperMethod(...args: PageQueryMethodArgs) {
+  if (USE_PAPER_MOCK) {
+    return mockListPaperMethod(...args) as any;
+  }
+
+  const { params, data } = pageQueryArgsTransform(args, encodePaperQuery);
+  return httpClient.Post(
+    `/wis-pc/outcome/paperManage/page`,
+    { ...params, ...data },
+    {
+      params,
+      hitSource: /^outcome-paper:(edit|delete)/,
+      transform: paginateTransform(decodePaper),
+    },
+  );
+}
+
+/** 新增论文 */
+export function createPaperMethod(vo: PaperSubmitVO) {
+  if (USE_PAPER_MOCK) {
+    return mockEditPaperMethod(vo) as any;
+  }
+
+  return httpClient.Post(`/wis-pc/outcome/paperManage/add`, encodePaper(vo), {
+    name: 'outcome-paper:edit',
+    transform: getEnvelopeData<null | string>,
+  });
+}
+
+/** 修改论文 */
+export function updatePaperMethod(vo: PaperSubmitVO) {
+  if (USE_PAPER_MOCK) {
+    return mockEditPaperMethod(vo) as any;
+  }
+
+  return httpClient.Post(
+    `/wis-pc/outcome/paperManage/update`,
+    encodePaper(vo),
+    {
+      name: 'outcome-paper:edit',
+      transform: getEnvelopeData<null | string>,
+    },
+  );
+}
+
+/** 新增 / 修改论文 */
+export function editPaperMethod(vo: PaperSubmitVO) {
+  return vo.id ? updatePaperMethod(vo) : createPaperMethod(vo);
+}
+
+/** 论文详情 */
+export function getPaperMethod(vo: Partial<PaperVO>) {
+  if (USE_PAPER_MOCK) {
+    return mockGetPaperMethod(vo) as any;
+  }
+
+  return httpClient.Post(
+    `/wis-pc/outcome/paperManage/detail/${vo.id}`,
+    {},
+    {
+      hitSource: /^outcome-paper:edit/,
+      transform: transform(decodePaper),
+    },
+  );
+}
+
+/** 删除论文 */
+export function deletePaperMethod(vo: Pick<PaperVO, 'id'>) {
+  if (USE_PAPER_MOCK) {
+    return mockDeletePaperMethod(vo) as any;
+  }
+
+  return httpClient.Post(
+    `/wis-pc/outcome/paperManage/delete/${vo.id}`,
+    {},
+    {
+      name: 'outcome-paper:delete',
+      meta: { ignoreError: true },
+    },
+  );
+}

+ 252 - 0
apps/wisdom-legacy/src/api/outcome/paper.mock.ts

@@ -0,0 +1,252 @@
+import type {
+  PaperCategory,
+  PaperDTO,
+  PaperSubmitVO,
+  PaperVO,
+} from './paper.schema';
+
+import type { PageQueryMethodArgs } from '#/request/schema';
+import type { PageVO } from '#/request/schema/record';
+
+import { pageQueryArgsTransform } from '#/request/schema';
+
+import { decodePaper, encodePaper, encodePaperQuery } from './paper.schema';
+
+/** 后端接口就绪后改为 false */
+export const USE_PAPER_MOCK = true;
+
+type MethodLike<T> = PromiseLike<T> & {
+  send?: (force?: boolean) => PromiseLike<T>;
+};
+
+const MOCK_PDF_URL =
+  'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf';
+
+const SEED_RECORDS: Omit<
+  PaperDTO,
+  'createTime' | 'id' | 'personalStudioId' | 'updateTime'
+>[] = [
+  {
+    category: 'journal',
+    title: '中医药治疗慢性胃炎的临床研究',
+    authors: '王教授, 张主任, 李医师',
+    journalName: '中华中医药杂志',
+    publishYear: '2026',
+    volumeInfo: '第41卷第3期',
+    keywords: '中医药; 慢性胃炎; 临床研究',
+    downloadCount: 156,
+    commentCount: 8,
+    createBy: '王刚',
+    fileUrl: MOCK_PDF_URL,
+  },
+  {
+    category: 'journal',
+    title: '针灸联合推拿治疗腰椎间盘突出症的疗效观察',
+    authors: '李明, 赵华',
+    journalName: '中国针灸',
+    publishYear: '2025',
+    volumeInfo: '第45卷第12期',
+    keywords: '针灸; 推拿; 腰椎间盘突出',
+    downloadCount: 89,
+    commentCount: 5,
+    createBy: '张许',
+    fileUrl: MOCK_PDF_URL,
+  },
+  {
+    category: 'degree',
+    title: '基于数据挖掘的方剂配伍规律研究',
+    authors: '陈思远',
+    journalName: '北京中医药大学',
+    publishYear: '2024',
+    volumeInfo: '博士学位论文',
+    keywords: '数据挖掘; 方剂; 配伍规律',
+    downloadCount: 42,
+    commentCount: 3,
+    createBy: '李虎',
+    fileUrl: MOCK_PDF_URL,
+  },
+  {
+    category: 'conference',
+    title: '人工智能辅助中医辨证论治系统的设计与实现',
+    authors: '刘洋, 周敏, 孙伟',
+    journalName: '全国中医药信息学术年会',
+    publishYear: '2025',
+    volumeInfo: '2025年11月',
+    keywords: '人工智能; 中医辨证; 辅助诊疗',
+    downloadCount: 67,
+    commentCount: 12,
+    createBy: '王刚',
+    fileUrl: MOCK_PDF_URL,
+  },
+  {
+    category: 'journal',
+    title: '经典名方化裁治疗失眠的临床体会',
+    authors: '黄医师, 吴教授',
+    journalName: '中医杂志',
+    publishYear: '2025',
+    volumeInfo: '第66卷第8期',
+    keywords: '经典名方; 失眠; 临床体会',
+    downloadCount: 203,
+    commentCount: 15,
+    createBy: '张许',
+    fileUrl: MOCK_PDF_URL,
+  },
+  {
+    category: 'journal',
+    title: '中药外敷治疗膝骨关节炎的Meta分析',
+    authors: '郑研究员, 钱博士',
+    journalName: '中国中药杂志',
+    publishYear: '2024',
+    volumeInfo: '第49卷第6期',
+    keywords: '中药外敷; 膝骨关节炎; Meta分析',
+    downloadCount: 118,
+    commentCount: 6,
+    createBy: '李虎',
+    fileUrl: MOCK_PDF_URL,
+  },
+];
+
+function createInitialStore(): PaperDTO[] {
+  const records: PaperDTO[] = [];
+  for (let index = 0; index < 42; index += 1) {
+    const seed = SEED_RECORDS[index % SEED_RECORDS.length] ?? SEED_RECORDS[0];
+    if (!seed) continue;
+    const day = String((index % 28) + 1).padStart(2, '0');
+    const month = String((index % 12) + 1).padStart(2, '0');
+    records.push({
+      ...seed,
+      id: String(index + 1),
+      personalStudioId: '327477138296832',
+      createTime: `2026-${month}-${day}T10:00:00`,
+      updateTime: `2026-05-${day}T10:00:00`,
+    });
+  }
+  return records;
+}
+
+let nextId = 100;
+let store = createInitialStore();
+
+function delay<T>(runner: () => Promise<T> | T, ms = 120): MethodLike<T> {
+  const run = async () => {
+    await new Promise((resolve) => setTimeout(resolve, ms));
+    return runner();
+  };
+  const promise = run();
+  return Object.assign(promise, { send: run });
+}
+
+function matchKeyword(record: PaperDTO, keyword?: string) {
+  if (!keyword) return true;
+  const text = [
+    record.title,
+    record.authors,
+    record.keywords,
+    record.journalName,
+    record.createBy,
+  ]
+    .filter(Boolean)
+    .join(' ');
+  return text.includes(keyword);
+}
+
+function matchWorkroom(record: PaperDTO, workroomId?: string) {
+  if (!workroomId) return true;
+  return String(record.personalStudioId ?? '') === String(workroomId);
+}
+
+function matchCategory(record: PaperDTO, category?: PaperCategory) {
+  if (!category) return true;
+  return record.category === category;
+}
+
+function toVo(dto: PaperDTO): PaperVO {
+  return decodePaper(dto);
+}
+
+export function mockListPaperMethod(...args: PageQueryMethodArgs) {
+  const { params, data } = pageQueryArgsTransform(args, encodePaperQuery);
+  const pageNum = Number(params.pageNum ?? 1);
+  const pageSize = Number(params.pageSize ?? 10);
+  const keyword = data.mixture;
+  const workroomId = data.personalStudioId?.toString();
+  const category = data.category;
+
+  const filtered = store.filter(
+    (record) =>
+      matchKeyword(record, keyword) &&
+      matchWorkroom(record, workroomId) &&
+      matchCategory(record, category),
+  );
+  const start = (pageNum - 1) * pageSize;
+  const items = filtered
+    .slice(start, start + pageSize)
+    .map((record) => toVo(record));
+
+  const result: PageVO<PaperVO> = {
+    total: filtered.length,
+    items,
+  };
+  return delay(() => result);
+}
+
+export function mockGetPaperMethod(vo: Partial<PaperVO>) {
+  return delay(() => {
+    const record = store.find((item) => String(item.id) === String(vo.id));
+    if (!record) {
+      throw new Error('论文不存在');
+    }
+    return toVo(record);
+  });
+}
+
+export function mockEditPaperMethod(vo: PaperSubmitVO) {
+  return delay(() => {
+    const dto = encodePaper(vo);
+    const now = new Date().toISOString();
+
+    if (vo.id) {
+      const index = store.findIndex(
+        (item) => String(item.id) === String(vo.id),
+      );
+      if (index === -1) {
+        throw new Error('论文不存在');
+      }
+      store[index] = {
+        ...store[index],
+        ...dto,
+        updateTime: now,
+      };
+      return String(vo.id);
+    }
+
+    const id = String(nextId++);
+    store.unshift({
+      ...dto,
+      id,
+      downloadCount: 0,
+      commentCount: 0,
+      createBy: dto.createBy ?? '当前用户',
+      createTime: now,
+      updateTime: now,
+    });
+    return id;
+  });
+}
+
+export function mockDeletePaperMethod(vo: Pick<PaperVO, 'id'>) {
+  return delay(() => {
+    const before = store.length;
+    store = store.filter((item) => String(item.id) !== String(vo.id));
+    if (store.length === before) {
+      throw new Error('论文不存在');
+    }
+    return null;
+  });
+}
+
+/** 仅用于本地调试,重置 mock 数据 */
+export function resetPaperMockStore() {
+  nextId = 100;
+  store = createInitialStore();
+}

+ 150 - 0
apps/wisdom-legacy/src/api/outcome/paper.schema.ts

@@ -0,0 +1,150 @@
+import type {
+  AuditRecordDTO,
+  AuditRecordVO,
+} from '#/request/schema/audit-record';
+
+import { z } from '#/adapter/form';
+import { decodeList } from '#/request/schema';
+import { decodeAuditRecord } from '#/request/schema/audit-record';
+
+// ---------------------------------------------------------------------------
+// 枚举
+// ---------------------------------------------------------------------------
+
+export type PaperCategory = 'conference' | 'degree' | 'journal';
+
+export const PAPER_CATEGORY_OPTIONS = [
+  { label: '期刊论文', value: 'journal' },
+  { label: '学位论文', value: 'degree' },
+  { label: '会议论文', value: 'conference' },
+] as const satisfies ReadonlyArray<{
+  label: string;
+  value: PaperCategory;
+}>;
+
+export function getPaperCategoryLabel(category?: PaperCategory) {
+  return (
+    PAPER_CATEGORY_OPTIONS.find((item) => item.value === category)?.label ?? ''
+  );
+}
+
+// ---------------------------------------------------------------------------
+// DTO
+// ---------------------------------------------------------------------------
+
+export interface PaperDTO extends AuditRecordDTO {
+  id?: number | string;
+  personalStudioId?: number | string;
+  category?: PaperCategory;
+  title?: string;
+  authors?: string;
+  journalName?: string;
+  publishYear?: string;
+  volumeInfo?: string;
+  keywords?: string;
+  fileUrl?: string;
+  downloadCount?: number;
+  commentCount?: number;
+}
+
+export interface PaperQueryDTO {
+  mixture?: string;
+  personalStudioId?: number | string;
+  category?: PaperCategory;
+  pageNum?: number;
+  pageSize?: number;
+}
+
+// ---------------------------------------------------------------------------
+// VO
+// ---------------------------------------------------------------------------
+
+export interface PaperVO extends AuditRecordVO {
+  id?: string;
+  workroomId: string;
+  category: PaperCategory;
+  title: string;
+  authors: string;
+  journalName: string;
+  publishYear: string;
+  volumeInfo?: string;
+  keywords?: string;
+  pdfUrl?: string;
+  downloadCount?: number;
+  commentCount?: number;
+}
+
+export type PaperSubmitVO = PaperVO;
+
+export interface PaperQueryVO {
+  keyword?: string;
+  workroomId?: string;
+  category?: PaperCategory;
+}
+
+// ---------------------------------------------------------------------------
+// Schema
+// ---------------------------------------------------------------------------
+
+export const PaperVOSchema = z.object({
+  id: z.string().optional(),
+  workroomId: z.string().min(1, '工作室不能为空'),
+  category: z.enum(['journal', 'degree', 'conference'], {
+    message: '请选择论文分类',
+  }),
+  title: z.string().min(1, '请输入论文标题'),
+  authors: z.string().min(1, '请输入作者'),
+  journalName: z.string().min(1, '请输入期刊名称'),
+  publishYear: z.string().min(1, '请输入发表年份'),
+  volumeInfo: z.string().optional(),
+  keywords: z.string().optional(),
+});
+
+// ---------------------------------------------------------------------------
+// 编解码
+// ---------------------------------------------------------------------------
+
+export function decodePaper(dto: PaperDTO): PaperVO {
+  return {
+    ...decodeAuditRecord(dto),
+    id: dto.id?.toString(),
+    workroomId: dto.personalStudioId?.toString() ?? '',
+    category: dto.category ?? 'journal',
+    title: dto.title ?? '',
+    authors: dto.authors ?? '',
+    journalName: dto.journalName ?? '',
+    publishYear: dto.publishYear ?? '',
+    volumeInfo: dto.volumeInfo,
+    keywords: dto.keywords,
+    pdfUrl: dto.fileUrl,
+    downloadCount: dto.downloadCount ?? 0,
+    commentCount: dto.commentCount ?? 0,
+  };
+}
+
+export function encodePaperQuery(query: Partial<PaperQueryVO>): PaperQueryDTO {
+  return {
+    mixture: query.keyword,
+    personalStudioId: query.workroomId,
+    category: query.category,
+  };
+}
+
+export function encodePaper(vo: PaperSubmitVO): PaperDTO {
+  return {
+    id: vo.id,
+    personalStudioId: vo.workroomId,
+    category: vo.category,
+    title: vo.title,
+    authors: vo.authors,
+    journalName: vo.journalName,
+    publishYear: vo.publishYear,
+    volumeInfo: vo.volumeInfo,
+    keywords: vo.keywords,
+    fileUrl: vo.pdfUrl,
+  };
+}
+
+export function decodePaperList(dto: PaperDTO[]) {
+  return decodeList(dto, decodePaper);
+}

+ 3 - 0
apps/wisdom-legacy/src/locales/langs/zh-CN/outcome.json

@@ -4,5 +4,8 @@
   },
   "treatmentPlan": {
     "name": "诊疗方案"
+  },
+  "paper": {
+    "name": "论文"
   }
 }

+ 2 - 1
apps/wisdom-legacy/src/router/routes/modules/outcome.route.ts

@@ -4,6 +4,7 @@ const placeholder = () => import('#/views/outcome/Placeholder.vue');
 const medicalCaseLibrary = () =>
   import('#/views/outcome/MedicalCaseLibraryList.vue');
 const treatmentPlan = () => import('#/views/outcome/TreatmentPlanList.vue');
+const paper = () => import('#/views/outcome/PaperList.vue');
 
 const routes: RouteRecordRaw[] = [
   {
@@ -41,7 +42,7 @@ const routes: RouteRecordRaw[] = [
           icon: 'carbon:email',
           title: '论文',
         },
-        component: placeholder,
+        component: paper,
       },
       {
         path: '/outcome/monograph',

+ 279 - 0
apps/wisdom-legacy/src/views/outcome/PaperList.vue

@@ -0,0 +1,279 @@
+<script setup lang="ts">
+import type { PaperCategory, PaperVO } from '#/api/outcome';
+
+import { computed, ref, shallowRef, triggerRef, watch } from 'vue';
+
+import { Page } from '@vben/common-ui';
+import { Plus } from '@vben/icons';
+
+import {
+  Button,
+  Empty,
+  Input,
+  message,
+  Pagination,
+  Spin,
+  Tabs,
+} from 'ant-design-vue';
+import { storeToRefs } from 'pinia';
+
+import { useShell } from '#/adapter/shell';
+import { invokeMethod } from '#/adapter/vxe-table/proxy/invoke-method';
+import {
+  deletePaperMethod,
+  listPaperMethod,
+  PAPER_CATEGORY_OPTIONS,
+} from '#/api/outcome';
+import { useWorkroomStore } from '#/stores';
+
+import PaperCard from './components/PaperCard.vue';
+import PaperEdit from './modules/PaperEdit.vue';
+
+const workroomStore = useWorkroomStore();
+const { workroomId } = storeToRefs(workroomStore);
+
+const keyword = ref('');
+const searchKeyword = ref('');
+const category = ref<PaperCategory>('journal');
+const pageNum = ref(1);
+const pageSize = ref(10);
+const loading = ref(false);
+const pageData = ref<{ items: PaperVO[]; total: number }>({
+  total: 0,
+  items: [],
+});
+
+const deletingIds = shallowRef(new Set<string>());
+
+async function loadList() {
+  if (!workroomId.value) {
+    pageData.value = { total: 0, items: [] };
+    loading.value = false;
+    return;
+  }
+
+  loading.value = true;
+  try {
+    pageData.value = await invokeMethod(
+      listPaperMethod(pageNum.value, pageSize.value, {
+        $filters: [],
+        $sorts: [],
+        keyword: searchKeyword.value || undefined,
+        workroomId: workroomId.value,
+        category: category.value,
+      }),
+      { force: true },
+    );
+  } finally {
+    loading.value = false;
+  }
+}
+
+const items = computed(() => pageData.value.items);
+const total = computed(() => pageData.value.total);
+
+const tabItems = PAPER_CATEGORY_OPTIONS;
+
+const [Edit, editApi] = useShell('modal', {
+  connectedComponent: PaperEdit,
+});
+
+function isDeleting(id?: string) {
+  return id ? deletingIds.value.has(id) : false;
+}
+
+function setDeleting(id: string, value: boolean) {
+  if (value) {
+    deletingIds.value.add(id);
+  } else {
+    deletingIds.value.delete(id);
+  }
+  triggerRef(deletingIds);
+}
+
+async function openCreate() {
+  const result = await editApi
+    .setData({
+      workroomId: workroomId.value,
+      category: category.value,
+    } as PaperVO)
+    .open<{ id?: string }>(Promise.withResolvers());
+  if (result?.id) {
+    pageNum.value = 1;
+    await loadList();
+  }
+}
+
+async function openEdit(row: PaperVO) {
+  const result = await editApi
+    .setData(row)
+    .open<{ id?: string }>(Promise.withResolvers());
+  if (result?.id) {
+    await loadList();
+  }
+}
+
+function openView(row: PaperVO) {
+  if (row.pdfUrl) {
+    window.open(row.pdfUrl, '_blank');
+  } else {
+    message.warning('暂无PDF文件');
+  }
+}
+
+function openDownload(row: PaperVO) {
+  if (row.pdfUrl) {
+    window.open(row.pdfUrl, '_blank');
+  } else {
+    message.warning('暂无PDF文件');
+  }
+}
+
+async function handleDelete(row: PaperVO) {
+  if (!row.id || isDeleting(row.id)) return;
+  setDeleting(row.id, true);
+  try {
+    await invokeMethod(deletePaperMethod(row), { force: true });
+    message.success('删除成功');
+    if (items.value.length <= 1 && pageNum.value > 1) {
+      pageNum.value -= 1;
+    }
+    await loadList();
+  } finally {
+    setDeleting(row.id, false);
+  }
+}
+
+function onSearch() {
+  searchKeyword.value = keyword.value.trim();
+  pageNum.value = 1;
+}
+
+function onTabChange(key: number | string) {
+  category.value = key as PaperCategory;
+  pageNum.value = 1;
+}
+
+function onPageChange(page: number, size: number) {
+  pageNum.value = page;
+  pageSize.value = size;
+}
+
+watch(workroomId, () => {
+  pageNum.value = 1;
+});
+
+watch(
+  [pageNum, pageSize, searchKeyword, category, workroomId],
+  () => {
+    void loadList();
+  },
+  { immediate: true },
+);
+</script>
+
+<template>
+  <Page auto-content-height title="论文管理">
+    <Edit />
+
+    <template #extra>
+      <Button type="primary" @click="openCreate()">
+        <Plus class="size-4" />
+        上传论文
+      </Button>
+    </template>
+
+    <div class="flex h-full flex-col gap-4">
+      <Input.Search
+        v-model:value="keyword"
+        allow-clear
+        placeholder="搜索论文标题、作者或关键词..."
+        @search="onSearch"
+      />
+
+      <Tabs
+        v-model:active-key="category"
+        class="paper-tabs"
+        @change="onTabChange"
+      >
+        <Tabs.TabPane
+          v-for="item in tabItems"
+          :key="item.value"
+          :tab-key="item.value"
+          :tab="item.label"
+        />
+      </Tabs>
+
+      <Spin :spinning="loading">
+        <div class="min-h-48">
+          <Empty
+            v-if="!loading && items.length === 0"
+            :image="Empty.PRESENTED_IMAGE_SIMPLE"
+            description="暂无论文数据"
+          >
+            <Button type="primary" @click="openCreate()">上传论文</Button>
+          </Empty>
+
+          <div v-else class="flex flex-col gap-4">
+            <PaperCard
+              v-for="item in items"
+              :key="item.id"
+              :data="item"
+              :deleting="isDeleting(item.id)"
+              @edit="openEdit"
+              @view="openView"
+              @download="openDownload"
+              @delete="handleDelete"
+            />
+          </div>
+        </div>
+      </Spin>
+
+      <div
+        v-if="total > 0"
+        class="mt-auto flex flex-wrap items-center justify-between gap-3 border-t pt-4"
+      >
+        <span class="text-sm text-foreground/70">共 {{ total }} 条记录</span>
+        <Pagination
+          :current="pageNum"
+          :page-size="pageSize"
+          :total="total"
+          :show-size-changer="false"
+          show-less-items
+          @change="onPageChange"
+        />
+      </div>
+    </div>
+  </Page>
+</template>
+
+<style scoped>
+.paper-tabs :deep(.ant-tabs-content-holder) {
+  display: none;
+}
+
+.paper-tabs :deep(.ant-tabs-nav) {
+  margin-bottom: 0;
+}
+
+.paper-tabs :deep(.ant-tabs-nav::before) {
+  border-bottom: 1px solid hsl(var(--border));
+}
+
+.paper-tabs :deep(.ant-tabs-tab) {
+  padding: 12px 0;
+  margin: 0 32px 0 0;
+  font-size: 15px;
+  color: hsl(var(--foreground) / 55%);
+}
+
+.paper-tabs :deep(.ant-tabs-tab-active .ant-tabs-tab-btn) {
+  font-weight: 500;
+  color: hsl(var(--primary));
+}
+
+.paper-tabs :deep(.ant-tabs-ink-bar) {
+  height: 2px;
+  background: hsl(var(--primary));
+}
+</style>

+ 118 - 0
apps/wisdom-legacy/src/views/outcome/components/PaperCard.vue

@@ -0,0 +1,118 @@
+<script setup lang="ts">
+import type { PaperVO } from '#/api/outcome';
+
+import {
+  CommentOutlined,
+  DeleteOutlined,
+  DownloadOutlined,
+  EditOutlined,
+  EyeOutlined,
+} from '@ant-design/icons-vue';
+import { Button, Card, Popconfirm, Tag } from 'ant-design-vue';
+
+import { getPaperCategoryLabel } from '#/api/outcome';
+
+const { data, deleting } = defineProps<{
+  data: PaperVO;
+  deleting?: boolean;
+}>();
+
+const emit = defineEmits<{
+  delete: [PaperVO];
+  download: [PaperVO];
+  edit: [PaperVO];
+  view: [PaperVO];
+}>();
+
+function formatKeywords(keywords?: string) {
+  if (!keywords) return '';
+  return keywords
+    .split(/[;;]/)
+    .map((item) => item.trim())
+    .filter(Boolean)
+    .join(' ');
+}
+
+function formatMeta(item: PaperVO) {
+  const parts = [
+    item.authors ? `作者: ${item.authors}` : '',
+    item.journalName,
+    [item.publishYear, item.volumeInfo].filter(Boolean).join(' '),
+  ].filter(Boolean);
+  return parts.join(' · ');
+}
+</script>
+
+<template>
+  <Card class="paper-card" :bordered="true">
+    <div
+      class="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between"
+    >
+      <div class="min-w-0 flex-1">
+        <div class="mb-2 flex items-start justify-between gap-3">
+          <h3 class="text-base font-semibold leading-6 text-foreground">
+            {{ data.title }}
+          </h3>
+          <Tag color="success" class="shrink-0">
+            {{ getPaperCategoryLabel(data.category) }}
+          </Tag>
+        </div>
+
+        <p class="mb-2 text-sm text-foreground/70">
+          {{ formatMeta(data) }}
+        </p>
+
+        <p v-if="data.keywords" class="mb-3 text-sm text-foreground/70">
+          关键词: {{ formatKeywords(data.keywords) }}
+        </p>
+
+        <div
+          class="flex flex-wrap items-center gap-4 text-sm text-foreground/60"
+        >
+          <span class="inline-flex items-center gap-1">
+            <DownloadOutlined />
+            {{ data.downloadCount ?? 0 }} 次下载
+          </span>
+          <span class="inline-flex items-center gap-1">
+            <CommentOutlined />
+            {{ data.commentCount ?? 0 }} 条评论
+          </span>
+        </div>
+      </div>
+    </div>
+
+    <div
+      class="mt-4 flex flex-wrap items-center justify-end gap-2 border-t pt-3"
+    >
+      <Button type="link" class="!px-2" @click="emit('edit', data)">
+        <EditOutlined />
+        编辑
+      </Button>
+      <Button type="link" class="!px-2" @click="emit('view', data)">
+        <EyeOutlined />
+        查看
+      </Button>
+      <Button type="link" class="!px-2" @click="emit('download', data)">
+        <DownloadOutlined />
+        下载
+      </Button>
+      <Popconfirm
+        title="确定删除该论文吗?"
+        :ok-button-props="{ loading: deleting, danger: true }"
+        :cancel-button-props="{ disabled: deleting }"
+        @confirm="emit('delete', data)"
+      >
+        <Button type="link" danger class="!px-2" :disabled="deleting">
+          <DeleteOutlined />
+          删除
+        </Button>
+      </Popconfirm>
+    </div>
+  </Card>
+</template>
+
+<style scoped>
+.paper-card :deep(.ant-card-body) {
+  padding: 20px 24px;
+}
+</style>

+ 176 - 0
apps/wisdom-legacy/src/views/outcome/modules/PaperEdit.vue

@@ -0,0 +1,176 @@
+<script setup lang="ts">
+import type { UploadFile, UploadProps } from 'ant-design-vue';
+
+import type { PaperSubmitVO } from '#/api/outcome';
+
+import { ref } from 'vue';
+
+import { InboxOutlined } from '@ant-design/icons-vue';
+import { Alert, message, Upload, UploadDragger } from 'ant-design-vue';
+
+import { useEditShell } from '#/adapter/shell';
+import { invokeMethod } from '#/adapter/vxe-table/proxy/invoke-method';
+import { uploadFileMethod } from '#/api/common';
+import { useWorkroomStore } from '#/stores';
+
+import { paperForm } from '../paper.data';
+
+const workroomStore = useWorkroomStore();
+
+const PDF_MAX_SIZE = 20 * 1024 * 1024;
+
+const pdfFileList = ref<UploadFile[]>([]);
+const pdfUrl = ref<string>();
+const pdfUploading = ref(false);
+
+function createUploadFile(url: string | undefined, name: string): UploadFile[] {
+  if (!url) return [];
+  return [
+    {
+      uid: '-1',
+      name,
+      status: 'done',
+      url,
+    },
+  ];
+}
+
+function resetUploads() {
+  pdfFileList.value = [];
+  pdfUrl.value = void 0;
+  pdfUploading.value = false;
+}
+
+async function uploadImmediately(file: File) {
+  const uploadFile: UploadFile = {
+    uid: `${Date.now()}`,
+    name: file.name,
+    status: 'uploading',
+    percent: 0,
+  };
+  pdfFileList.value = [uploadFile];
+  pdfUploading.value = true;
+
+  try {
+    const url = await invokeMethod(uploadFileMethod(file), { force: true });
+    if (!url) {
+      throw new Error('upload empty url');
+    }
+    pdfUrl.value = url;
+    pdfFileList.value = [
+      {
+        ...uploadFile,
+        status: 'done',
+        url,
+      },
+    ];
+  } catch {
+    pdfUrl.value = void 0;
+    pdfFileList.value = [
+      {
+        ...uploadFile,
+        status: 'error',
+      },
+    ];
+    message.error(`${file.name} 上传失败,请重试`);
+  } finally {
+    pdfUploading.value = false;
+  }
+}
+
+const { Form, Shell, api } = useEditShell<PaperSubmitVO>(paperForm, {
+  onLoaded(model) {
+    api.shell.setState({
+      title: model.id ? '编辑论文' : '上传论文',
+    });
+  },
+  handleLoad(model) {
+    resetUploads();
+    pdfUrl.value = model.pdfUrl;
+    pdfFileList.value = createUploadFile(model.pdfUrl, '论文.pdf');
+    return model;
+  },
+  handleSubmit(values) {
+    const workroomId = values.workroomId || workroomStore.workroomId;
+    if (!workroomId) {
+      message.error('请先选择工作室');
+      throw new Error('workroom required');
+    }
+    if (pdfUploading.value) {
+      message.warning('文件上传中,请稍候');
+      throw new Error('uploading');
+    }
+    if (!pdfUrl.value) {
+      message.error('请上传论文PDF文件');
+      throw new Error('pdf required');
+    }
+
+    return {
+      ...values,
+      workroomId,
+      pdfUrl: pdfUrl.value,
+    };
+  },
+  onClosed: resetUploads,
+});
+
+const beforePdfUpload: UploadProps['beforeUpload'] = (file) => {
+  const isPdf =
+    file.type === 'application/pdf' || file.name.toLowerCase().endsWith('.pdf');
+  if (!isPdf) {
+    message.error('仅支持PDF格式文件');
+    return Upload.LIST_IGNORE;
+  }
+  if (file.size > PDF_MAX_SIZE) {
+    message.error('文件大小不能超过20MB');
+    return Upload.LIST_IGNORE;
+  }
+  void uploadImmediately(file);
+  return false;
+};
+
+function onPdfRemove() {
+  pdfUrl.value = void 0;
+}
+</script>
+
+<template>
+  <Shell>
+    <div class="mx-4">
+      <Form />
+
+      <div class="pb-4">
+        <div class="mb-2 text-sm">
+          <span class="text-destructive mr-1">*</span>
+          论文PDF文件
+        </div>
+        <UploadDragger
+          v-model:file-list="pdfFileList"
+          :before-upload="beforePdfUpload"
+          :max-count="1"
+          accept=".pdf,application/pdf"
+          @remove="onPdfRemove"
+        >
+          <p class="ant-upload-drag-icon">
+            <InboxOutlined />
+          </p>
+          <p class="ant-upload-text">点击上传或拖拽PDF文件到此处</p>
+          <p class="ant-upload-hint">
+            仅支持PDF格式文件,建议文件大小不超过20MB
+          </p>
+        </UploadDragger>
+      </div>
+
+      <Alert type="info" show-icon class="mb-4">
+        <template #message>温馨提示</template>
+        <template #description>
+          <ul class="mb-0 list-disc pl-4 text-sm">
+            <li>请确保论文内容符合学术规范和版权要求</li>
+            <li>上传的PDF文件将用于在线预览和下载</li>
+            <li>论文一经上传,将进入审核流程</li>
+          </ul>
+        </template>
+      </Alert>
+    </div>
+  </Shell>
+</template>

+ 106 - 0
apps/wisdom-legacy/src/views/outcome/paper.data.ts

@@ -0,0 +1,106 @@
+import type { PaperVO } from '#/api/outcome';
+
+import { getPopupContainer } from '@vben/utils';
+
+import { defineEditShell } from '#/adapter/shell/edit';
+import {
+  editPaperMethod,
+  getPaperMethod,
+  PAPER_CATEGORY_OPTIONS,
+  PaperVOSchema,
+} from '#/api/outcome';
+
+export const paperForm = defineEditShell<PaperVO>({
+  scope: 'outcome.paper',
+  title: '论文',
+  submit: editPaperMethod,
+  load: getPaperMethod,
+  shell: {
+    type: 'modal',
+    class: '!w-[640px]',
+    confirmText: '提交论文',
+  },
+  form: {
+    layout: 'vertical',
+    wrapperClass: 'grid-cols-2',
+  },
+  schema: [
+    {
+      component: 'Select',
+      fieldName: 'category',
+      label: '论文分类',
+      formItemClass: 'col-span-2',
+      componentProps: {
+        options: [...PAPER_CATEGORY_OPTIONS],
+        placeholder: '请选择论文分类',
+        getPopupContainer,
+      },
+      rules: PaperVOSchema.shape.category,
+    },
+    {
+      component: 'Input',
+      fieldName: 'title',
+      label: '论文标题',
+      formItemClass: 'col-span-2',
+      componentProps: {
+        placeholder: '请输入论文标题',
+      },
+      rules: PaperVOSchema.shape.title,
+    },
+    {
+      component: 'Input',
+      fieldName: 'authors',
+      label: '作者',
+      formItemClass: 'col-span-2',
+      componentProps: {
+        placeholder: '多个作者用逗号分隔,例如:王教授, 张主任, 李医师',
+      },
+      rules: PaperVOSchema.shape.authors,
+    },
+    {
+      component: 'Input',
+      fieldName: 'journalName',
+      label: '期刊名称',
+      formItemClass: 'col-span-2',
+      componentProps: {
+        placeholder: '例如:中华中医药杂志',
+      },
+      rules: PaperVOSchema.shape.journalName,
+    },
+    {
+      component: 'Input',
+      fieldName: 'publishYear',
+      label: '发表年份',
+      componentProps: {
+        placeholder: '例如:2026',
+      },
+      rules: PaperVOSchema.shape.publishYear,
+    },
+    {
+      component: 'Input',
+      fieldName: 'volumeInfo',
+      label: '卷期信息',
+      componentProps: {
+        placeholder: '例如:第41卷第3期',
+      },
+    },
+    {
+      component: 'Input',
+      fieldName: 'keywords',
+      label: '关键词',
+      formItemClass: 'col-span-2',
+      componentProps: {
+        placeholder: '多个关键词用分号分隔,例如:中医药; 慢性胃炎; 临床研究',
+      },
+    },
+    {
+      component: 'Input',
+      fieldName: 'workroomId',
+      dependencies: {
+        show: false,
+        triggerFields: ['workroomId'],
+      },
+      rules: PaperVOSchema.shape.workroomId,
+    },
+  ],
+});