Преглед на файлове

feat(@six/wisdom-legacy): 成果管理 -知识产权静态页面新增

Co-authored-by: Cursor <cursoragent@cursor.com>
cmj преди 2 дни
родител
ревизия
1a137c3284

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

@@ -1,3 +1,4 @@
+export * from './intellectual-property.api';
 export * from './medical-case-library.api';
 export * from './monograph.api';
 export * from './paper.api';

+ 145 - 0
apps/wisdom-legacy/src/api/outcome/intellectual-property.api.ts

@@ -0,0 +1,145 @@
+import type {
+  IntellectualPropertySubmitVO,
+  IntellectualPropertyVO,
+} from './intellectual-property.schema';
+
+import type { PageQueryMethodArgs } from '#/request/schema';
+
+import { getEnvelopeData, httpClient } from '#/request';
+import {
+  pageQueryArgsTransform,
+  paginateTransform,
+  transform,
+} from '#/request/schema';
+
+import {
+  mockDeleteIntellectualPropertyMethod,
+  mockEditIntellectualPropertyMethod,
+  mockGetIntellectualPropertyMethod,
+  mockListIntellectualPropertyMethod,
+  USE_INTELLECTUAL_PROPERTY_MOCK,
+} from './intellectual-property.mock';
+import {
+  decodeIntellectualProperty,
+  encodeIntellectualProperty,
+  encodeIntellectualPropertyQuery,
+} from './intellectual-property.schema';
+
+export { USE_INTELLECTUAL_PROPERTY_MOCK } from './intellectual-property.mock';
+export type {
+  IntellectualPropertyQueryVO,
+  IntellectualPropertySubmitVO,
+  IntellectualPropertyVO,
+  PatentStatus,
+  PatentType,
+} from './intellectual-property.schema';
+export {
+  getPatentStatusColor,
+  getPatentStatusLabel,
+  getPatentTypeLabel,
+  IntellectualPropertyVOSchema,
+  PATENT_STATUS_OPTIONS,
+  PATENT_TYPE_OPTIONS,
+} from './intellectual-property.schema';
+
+/** 知识产权分页列表 */
+export function listIntellectualPropertyMethod(...args: PageQueryMethodArgs) {
+  if (USE_INTELLECTUAL_PROPERTY_MOCK) {
+    return mockListIntellectualPropertyMethod(...args) as any;
+  }
+
+  const { params, data } = pageQueryArgsTransform(
+    args,
+    encodeIntellectualPropertyQuery,
+  );
+  return httpClient.Post(
+    `/wis-pc/outcome/intellectualPropertyManage/page`,
+    { ...params, ...data },
+    {
+      params,
+      hitSource: /^outcome-intellectual-property:(edit|delete)/,
+      transform: paginateTransform(decodeIntellectualProperty),
+    },
+  );
+}
+
+/** 新增专利 */
+export function createIntellectualPropertyMethod(
+  vo: IntellectualPropertySubmitVO,
+) {
+  if (USE_INTELLECTUAL_PROPERTY_MOCK) {
+    return mockEditIntellectualPropertyMethod(vo) as any;
+  }
+
+  return httpClient.Post(
+    `/wis-pc/outcome/intellectualPropertyManage/add`,
+    encodeIntellectualProperty(vo),
+    {
+      name: 'outcome-intellectual-property:edit',
+      transform: getEnvelopeData<null | string>,
+    },
+  );
+}
+
+/** 修改专利 */
+export function updateIntellectualPropertyMethod(
+  vo: IntellectualPropertySubmitVO,
+) {
+  if (USE_INTELLECTUAL_PROPERTY_MOCK) {
+    return mockEditIntellectualPropertyMethod(vo) as any;
+  }
+
+  return httpClient.Post(
+    `/wis-pc/outcome/intellectualPropertyManage/update`,
+    encodeIntellectualProperty(vo),
+    {
+      name: 'outcome-intellectual-property:edit',
+      transform: getEnvelopeData<null | string>,
+    },
+  );
+}
+
+/** 新增 / 修改专利 */
+export function editIntellectualPropertyMethod(
+  vo: IntellectualPropertySubmitVO,
+) {
+  return vo.id
+    ? updateIntellectualPropertyMethod(vo)
+    : createIntellectualPropertyMethod(vo);
+}
+
+/** 专利详情 */
+export function getIntellectualPropertyMethod(
+  vo: Partial<IntellectualPropertyVO>,
+) {
+  if (USE_INTELLECTUAL_PROPERTY_MOCK) {
+    return mockGetIntellectualPropertyMethod(vo) as any;
+  }
+
+  return httpClient.Post(
+    `/wis-pc/outcome/intellectualPropertyManage/detail/${vo.id}`,
+    {},
+    {
+      hitSource: /^outcome-intellectual-property:edit/,
+      transform: transform(decodeIntellectualProperty),
+    },
+  );
+}
+
+/** 删除专利 */
+export function deleteIntellectualPropertyMethod(
+  vo: Pick<IntellectualPropertyVO, 'id'>,
+) {
+  if (USE_INTELLECTUAL_PROPERTY_MOCK) {
+    return mockDeleteIntellectualPropertyMethod(vo) as any;
+  }
+
+  return httpClient.Post(
+    `/wis-pc/outcome/intellectualPropertyManage/delete/${vo.id}`,
+    {},
+    {
+      name: 'outcome-intellectual-property:delete',
+      meta: { ignoreError: true },
+    },
+  );
+}

+ 270 - 0
apps/wisdom-legacy/src/api/outcome/intellectual-property.mock.ts

@@ -0,0 +1,270 @@
+import type {
+  IntellectualPropertyDTO,
+  IntellectualPropertySubmitVO,
+  IntellectualPropertyVO,
+  PatentStatus,
+  PatentType,
+} from './intellectual-property.schema';
+
+import type { PageQueryMethodArgs } from '#/request/schema';
+import type { PageVO } from '#/request/schema/record';
+
+import { pageQueryArgsTransform } from '#/request/schema';
+
+import {
+  decodeIntellectualProperty,
+  encodeIntellectualProperty,
+  encodeIntellectualPropertyQuery,
+} from './intellectual-property.schema';
+
+/** 后端接口就绪后改为 false */
+export const USE_INTELLECTUAL_PROPERTY_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<
+  IntellectualPropertyDTO,
+  'createTime' | 'id' | 'personalStudioId' | 'updateTime'
+>[] = [
+  {
+    patentNumber: 'CN202310123456.7',
+    title: '一种治疗慢性胃炎的中药复方制剂',
+    patentType: 'invention',
+    inventors: '张三, 李四, 王五',
+    applicationDate: '2023-03-15',
+    status: 'rejected',
+    authorizationDate: '2024-06-20',
+    commentCount: 5,
+    createBy: '张三',
+    fileUrl: MOCK_PDF_URL,
+  },
+  {
+    patentNumber: 'CN202410234567.8',
+    title: '基于人工智能的中医诊断辅助系统',
+    patentType: 'invention',
+    inventors: '赵六, 钱七',
+    applicationDate: '2024-01-10',
+    status: 'under_review',
+    authorizationDate: '2025-02-28',
+    commentCount: 3,
+    createBy: '赵六',
+    fileUrl: MOCK_PDF_URL,
+  },
+  {
+    patentNumber: 'CN202210345678.9',
+    title: '改进型针灸治疗仪',
+    patentType: 'utility_model',
+    inventors: '孙八, 周九',
+    applicationDate: '2022-08-22',
+    status: 'authorized',
+    authorizationDate: '2023-05-18',
+    commentCount: 8,
+    createBy: '孙八',
+    fileUrl: MOCK_PDF_URL,
+  },
+  {
+    patentNumber: 'CN202310456789.0',
+    title: '一种中药提取装置',
+    patentType: 'utility_model',
+    inventors: '吴十, 郑十一',
+    applicationDate: '2023-06-01',
+    status: 'authorized',
+    authorizationDate: '2024-03-12',
+    commentCount: 2,
+    createBy: '吴十',
+    fileUrl: MOCK_PDF_URL,
+  },
+  {
+    patentNumber: 'CN202410567890.1',
+    title: '便携式脉诊仪外观设计',
+    patentType: 'design',
+    inventors: '王十二',
+    applicationDate: '2024-02-14',
+    status: 'under_review',
+    authorizationDate: '2025-01-20',
+    commentCount: 1,
+    createBy: '王十二',
+    fileUrl: MOCK_PDF_URL,
+  },
+  {
+    patentNumber: 'CN202210678901.2',
+    title: '一种艾灸烟雾净化装置',
+    patentType: 'utility_model',
+    inventors: '李十三, 张十四',
+    applicationDate: '2022-11-05',
+    status: 'authorized',
+    authorizationDate: '2023-09-30',
+    commentCount: 6,
+    createBy: '李十三',
+    fileUrl: MOCK_PDF_URL,
+  },
+];
+
+function createInitialStore(): IntellectualPropertyDTO[] {
+  const records: IntellectualPropertyDTO[] = [];
+  for (let index = 0; index < 12; 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: IntellectualPropertyDTO, keyword?: string) {
+  if (!keyword) return true;
+  const text = [
+    record.title,
+    record.patentNumber,
+    record.inventors,
+    record.createBy,
+  ]
+    .filter(Boolean)
+    .join(' ');
+  return text.includes(keyword);
+}
+
+function matchWorkroom(record: IntellectualPropertyDTO, workroomId?: string) {
+  if (!workroomId) return true;
+  return String(record.personalStudioId ?? '') === String(workroomId);
+}
+
+function matchPatentType(
+  record: IntellectualPropertyDTO,
+  patentType?: PatentType,
+) {
+  if (!patentType) return true;
+  return record.patentType === patentType;
+}
+
+function matchStatus(record: IntellectualPropertyDTO, status?: PatentStatus) {
+  if (!status) return true;
+  return record.status === status;
+}
+
+function toVo(dto: IntellectualPropertyDTO): IntellectualPropertyVO {
+  return decodeIntellectualProperty(dto);
+}
+
+export function mockListIntellectualPropertyMethod(
+  ...args: PageQueryMethodArgs
+) {
+  const { params, data } = pageQueryArgsTransform(
+    args,
+    encodeIntellectualPropertyQuery,
+  );
+  const pageNum = Number(params.pageNum ?? 1);
+  const pageSize = Number(params.pageSize ?? 10);
+  const keyword = data.mixture;
+  const workroomId = data.personalStudioId?.toString();
+  const patentType = data.patentType;
+  const status = data.status;
+
+  const filtered = store.filter(
+    (record) =>
+      matchKeyword(record, keyword) &&
+      matchWorkroom(record, workroomId) &&
+      matchPatentType(record, patentType) &&
+      matchStatus(record, status),
+  );
+  const start = (pageNum - 1) * pageSize;
+  const items = filtered
+    .slice(start, start + pageSize)
+    .map((record) => toVo(record));
+
+  const result: PageVO<IntellectualPropertyVO> = {
+    total: filtered.length,
+    items,
+  };
+  return delay(() => result);
+}
+
+export function mockGetIntellectualPropertyMethod(
+  vo: Partial<IntellectualPropertyVO>,
+) {
+  return delay(() => {
+    const record = store.find((item) => String(item.id) === String(vo.id));
+    if (!record) {
+      throw new Error('专利不存在');
+    }
+    return toVo(record);
+  });
+}
+
+export function mockEditIntellectualPropertyMethod(
+  vo: IntellectualPropertySubmitVO,
+) {
+  return delay(() => {
+    const dto = encodeIntellectualProperty(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,
+      commentCount: 0,
+      createBy: dto.createBy ?? '当前用户',
+      createTime: now,
+      updateTime: now,
+    });
+    return id;
+  });
+}
+
+export function mockDeleteIntellectualPropertyMethod(
+  vo: Pick<IntellectualPropertyVO, '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 resetIntellectualPropertyMockStore() {
+  nextId = 100;
+  store = createInitialStore();
+}

+ 190 - 0
apps/wisdom-legacy/src/api/outcome/intellectual-property.schema.ts

@@ -0,0 +1,190 @@
+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 PatentType = 'design' | 'invention' | 'utility_model';
+
+export type PatentStatus = 'authorized' | 'rejected' | 'under_review';
+
+export const PATENT_TYPE_OPTIONS = [
+  { label: '发明专利', value: 'invention' },
+  { label: '实用新型', value: 'utility_model' },
+  { label: '外观设计', value: 'design' },
+] as const satisfies ReadonlyArray<{
+  label: string;
+  value: PatentType;
+}>;
+
+export const PATENT_STATUS_OPTIONS = [
+  { label: '已授权', value: 'authorized' },
+  { label: '审查中', value: 'under_review' },
+  { label: '已驳回', value: 'rejected' },
+] as const satisfies ReadonlyArray<{
+  label: string;
+  value: PatentStatus;
+}>;
+
+export function getPatentTypeLabel(type?: PatentType) {
+  return PATENT_TYPE_OPTIONS.find((item) => item.value === type)?.label ?? '';
+}
+
+export function getPatentStatusLabel(status?: PatentStatus) {
+  return (
+    PATENT_STATUS_OPTIONS.find((item) => item.value === status)?.label ?? ''
+  );
+}
+
+export function getPatentStatusColor(status?: PatentStatus) {
+  switch (status) {
+    case 'authorized': {
+      return 'success';
+    }
+    case 'rejected': {
+      return 'error';
+    }
+    case 'under_review': {
+      return 'warning';
+    }
+    default: {
+      return 'default';
+    }
+  }
+}
+
+// ---------------------------------------------------------------------------
+// DTO
+// ---------------------------------------------------------------------------
+
+export interface IntellectualPropertyDTO extends AuditRecordDTO {
+  id?: number | string;
+  personalStudioId?: number | string;
+  patentNumber?: string;
+  title?: string;
+  patentType?: PatentType;
+  inventors?: string;
+  applicationDate?: string;
+  status?: PatentStatus;
+  authorizationDate?: string;
+  fileUrl?: string;
+  commentCount?: number;
+}
+
+export interface IntellectualPropertyQueryDTO {
+  mixture?: string;
+  personalStudioId?: number | string;
+  patentType?: PatentType;
+  status?: PatentStatus;
+  pageNum?: number;
+  pageSize?: number;
+}
+
+// ---------------------------------------------------------------------------
+// VO
+// ---------------------------------------------------------------------------
+
+export interface IntellectualPropertyVO extends AuditRecordVO {
+  id?: string;
+  workroomId: string;
+  patentNumber: string;
+  title: string;
+  patentType: PatentType;
+  inventors: string;
+  applicationDate: string;
+  status: PatentStatus;
+  authorizationDate: string;
+  pdfUrl?: string;
+  commentCount?: number;
+}
+
+export type IntellectualPropertySubmitVO = IntellectualPropertyVO;
+
+export interface IntellectualPropertyQueryVO {
+  keyword?: string;
+  workroomId?: string;
+  patentType?: PatentType;
+  status?: PatentStatus;
+}
+
+// ---------------------------------------------------------------------------
+// Schema
+// ---------------------------------------------------------------------------
+
+export const IntellectualPropertyVOSchema = z.object({
+  id: z.string().optional(),
+  workroomId: z.string().min(1, '工作室不能为空'),
+  patentNumber: z.string().min(1, '请输入专利号'),
+  title: z.string().min(1, '请输入专利名称'),
+  patentType: z.enum(['invention', 'utility_model', 'design'], {
+    message: '请选择专利类型',
+  }),
+  inventors: z.string().min(1, '请输入发明人'),
+  applicationDate: z.string().min(1, '请选择申请日期'),
+  status: z.enum(['authorized', 'under_review', 'rejected'], {
+    message: '请选择授权状态',
+  }),
+  authorizationDate: z.string().min(1, '请选择授权日期'),
+});
+
+// ---------------------------------------------------------------------------
+// 编解码
+// ---------------------------------------------------------------------------
+
+export function decodeIntellectualProperty(
+  dto: IntellectualPropertyDTO,
+): IntellectualPropertyVO {
+  return {
+    ...decodeAuditRecord(dto),
+    id: dto.id?.toString(),
+    workroomId: dto.personalStudioId?.toString() ?? '',
+    patentNumber: dto.patentNumber ?? '',
+    title: dto.title ?? '',
+    patentType: dto.patentType ?? 'invention',
+    inventors: dto.inventors ?? '',
+    applicationDate: dto.applicationDate ?? '',
+    status: dto.status ?? 'under_review',
+    authorizationDate: dto.authorizationDate ?? '',
+    pdfUrl: dto.fileUrl,
+    commentCount: dto.commentCount ?? 0,
+  };
+}
+
+export function encodeIntellectualPropertyQuery(
+  query: Partial<IntellectualPropertyQueryVO>,
+): IntellectualPropertyQueryDTO {
+  return {
+    mixture: query.keyword,
+    personalStudioId: query.workroomId,
+    patentType: query.patentType,
+    status: query.status,
+  };
+}
+
+export function encodeIntellectualProperty(
+  vo: IntellectualPropertySubmitVO,
+): IntellectualPropertyDTO {
+  return {
+    id: vo.id,
+    personalStudioId: vo.workroomId,
+    patentNumber: vo.patentNumber,
+    title: vo.title,
+    patentType: vo.patentType,
+    inventors: vo.inventors,
+    applicationDate: vo.applicationDate,
+    status: vo.status,
+    authorizationDate: vo.authorizationDate,
+    fileUrl: vo.pdfUrl,
+  };
+}
+
+export function decodeIntellectualPropertyList(dto: IntellectualPropertyDTO[]) {
+  return decodeList(dto, decodeIntellectualProperty);
+}

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

@@ -13,5 +13,8 @@
   },
   "researchReport": {
     "name": "研究报告"
+  },
+  "intellectualProperty": {
+    "name": "知识产权"
   }
 }

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

@@ -7,6 +7,8 @@ const treatmentPlan = () => import('#/views/outcome/TreatmentPlanList.vue');
 const paper = () => import('#/views/outcome/PaperList.vue');
 const monograph = () => import('#/views/outcome/MonographList.vue');
 const researchReport = () => import('#/views/outcome/ResearchReportList.vue');
+const intellectualProperty = () =>
+  import('#/views/outcome/IntellectualPropertyList.vue');
 
 const routes: RouteRecordRaw[] = [
   {
@@ -71,7 +73,7 @@ const routes: RouteRecordRaw[] = [
           icon: 'carbon:user',
           title: '知识产权',
         },
-        component: placeholder,
+        component: intellectualProperty,
       },
       {
         path: '/outcome/hospital-preparation',

+ 250 - 0
apps/wisdom-legacy/src/views/outcome/IntellectualPropertyList.vue

@@ -0,0 +1,250 @@
+<script setup lang="ts">
+import type {
+  IntellectualPropertyVO,
+  PatentStatus,
+  PatentType,
+} 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,
+  Select,
+  Spin,
+} from 'ant-design-vue';
+import { storeToRefs } from 'pinia';
+
+import { useShell } from '#/adapter/shell';
+import { invokeMethod } from '#/adapter/vxe-table/proxy/invoke-method';
+import {
+  deleteIntellectualPropertyMethod,
+  listIntellectualPropertyMethod,
+  PATENT_STATUS_OPTIONS,
+  PATENT_TYPE_OPTIONS,
+} from '#/api/outcome';
+import { useWorkroomStore } from '#/stores';
+
+import IntellectualPropertyCard from './components/IntellectualPropertyCard.vue';
+import IntellectualPropertyEdit from './modules/IntellectualPropertyEdit.vue';
+
+const workroomStore = useWorkroomStore();
+const { workroomId } = storeToRefs(workroomStore);
+
+const keyword = ref('');
+const searchKeyword = ref('');
+const patentType = ref<'' | PatentType>('');
+const status = ref<'' | PatentStatus>('');
+const pageNum = ref(1);
+const pageSize = ref(10);
+const loading = ref(false);
+const pageData = ref<{ items: IntellectualPropertyVO[]; total: number }>({
+  total: 0,
+  items: [],
+});
+
+const deletingIds = shallowRef(new Set<string>());
+
+const patentTypeOptions = [
+  { label: '全部类型', value: '' },
+  ...PATENT_TYPE_OPTIONS,
+];
+
+const statusOptions = [
+  { label: '全部状态', value: '' },
+  ...PATENT_STATUS_OPTIONS,
+];
+
+async function loadList() {
+  if (!workroomId.value) {
+    pageData.value = { total: 0, items: [] };
+    loading.value = false;
+    return;
+  }
+
+  loading.value = true;
+  try {
+    pageData.value = await invokeMethod(
+      listIntellectualPropertyMethod(pageNum.value, pageSize.value, {
+        $filters: [],
+        $sorts: [],
+        keyword: searchKeyword.value || undefined,
+        workroomId: workroomId.value,
+        patentType: patentType.value || undefined,
+        status: status.value || undefined,
+      }),
+      { force: true },
+    );
+  } finally {
+    loading.value = false;
+  }
+}
+
+const items = computed(() => pageData.value.items);
+const total = computed(() => pageData.value.total);
+
+const [Edit, editApi] = useShell('modal', {
+  connectedComponent: IntellectualPropertyEdit,
+});
+
+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,
+      patentType: 'invention',
+      status: 'authorized',
+    } as IntellectualPropertyVO)
+    .open<{ id?: string }>(Promise.withResolvers());
+  if (result?.id) {
+    pageNum.value = 1;
+    await loadList();
+  }
+}
+
+async function openEdit(row: IntellectualPropertyVO) {
+  const result = await editApi
+    .setData(row)
+    .open<{ id?: string }>(Promise.withResolvers());
+  if (result?.id) {
+    await loadList();
+  }
+}
+
+function openView(row: IntellectualPropertyVO) {
+  if (row.pdfUrl) {
+    window.open(row.pdfUrl, '_blank');
+  } else {
+    message.warning('暂无专利附件');
+  }
+}
+
+async function handleDelete(row: IntellectualPropertyVO) {
+  if (!row.id || isDeleting(row.id)) return;
+  setDeleting(row.id, true);
+  try {
+    await invokeMethod(deleteIntellectualPropertyMethod(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 onPageChange(page: number, size: number) {
+  pageNum.value = page;
+  pageSize.value = size;
+}
+
+watch([patentType, status], () => {
+  pageNum.value = 1;
+});
+
+watch(workroomId, () => {
+  pageNum.value = 1;
+});
+
+watch(
+  [pageNum, pageSize, searchKeyword, patentType, status, 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">
+      <div class="flex flex-wrap items-center gap-3">
+        <Input.Search
+          v-model:value="keyword"
+          allow-clear
+          class="min-w-[240px] flex-1"
+          placeholder="搜索专利名称、专利号或发明人..."
+          @search="onSearch"
+        />
+        <Select
+          v-model:value="patentType"
+          :options="patentTypeOptions"
+          class="w-36"
+        />
+        <Select v-model:value="status" :options="statusOptions" class="w-36" />
+      </div>
+
+      <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">
+            <IntellectualPropertyCard
+              v-for="item in items"
+              :key="item.id"
+              :data="item"
+              :deleting="isDeleting(item.id)"
+              @edit="openEdit"
+              @view="openView"
+              @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>

+ 110 - 0
apps/wisdom-legacy/src/views/outcome/components/IntellectualPropertyCard.vue

@@ -0,0 +1,110 @@
+<script setup lang="ts">
+import type { IntellectualPropertyVO } from '#/api/outcome';
+
+import {
+  CommentOutlined,
+  DeleteOutlined,
+  EditOutlined,
+  EyeOutlined,
+  SafetyCertificateOutlined,
+} from '@ant-design/icons-vue';
+import { Button, Card, Popconfirm, Tag } from 'ant-design-vue';
+
+import {
+  getPatentStatusColor,
+  getPatentStatusLabel,
+  getPatentTypeLabel,
+} from '#/api/outcome';
+
+const { data, deleting } = defineProps<{
+  data: IntellectualPropertyVO;
+  deleting?: boolean;
+}>();
+
+const emit = defineEmits<{
+  delete: [IntellectualPropertyVO];
+  edit: [IntellectualPropertyVO];
+  view: [IntellectualPropertyVO];
+}>();
+</script>
+
+<template>
+  <Card class="intellectual-property-card" :bordered="true">
+    <div class="flex gap-4">
+      <div
+        class="flex size-14 shrink-0 items-center justify-center rounded-lg bg-primary/10"
+      >
+        <SafetyCertificateOutlined class="text-2xl text-primary" />
+      </div>
+
+      <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>
+          <div class="flex shrink-0 flex-wrap items-center gap-2">
+            <Tag color="purple">
+              {{ getPatentTypeLabel(data.patentType) }}
+            </Tag>
+            <Tag :color="getPatentStatusColor(data.status)">
+              {{ getPatentStatusLabel(data.status) }}
+            </Tag>
+          </div>
+        </div>
+
+        <p class="mb-1 text-sm text-foreground/70">
+          专利号:{{ data.patentNumber }} · 发明人:{{ data.inventors }}
+        </p>
+
+        <p class="mb-3 text-sm text-foreground/70">
+          申请日期:{{ data.applicationDate }} · 授权日期:{{
+            data.authorizationDate
+          }}
+        </p>
+
+        <div
+          class="flex flex-wrap items-center justify-between gap-3 border-t pt-3"
+        >
+          <span
+            class="inline-flex items-center gap-1 text-sm text-foreground/60"
+          >
+            <CommentOutlined />
+            {{ data.commentCount ?? 0 }} 条评论
+          </span>
+
+          <div class="flex flex-wrap items-center gap-1">
+            <Button type="link" class="!px-2" @click="emit('view', data)">
+              <EyeOutlined />
+              查看详情
+            </Button>
+            <Button
+              type="link"
+              class="!px-2 !text-primary"
+              @click="emit('edit', data)"
+            >
+              <EditOutlined />
+              编辑
+            </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>
+        </div>
+      </div>
+    </div>
+  </Card>
+</template>
+
+<style scoped>
+.intellectual-property-card :deep(.ant-card-body) {
+  padding: 20px 24px;
+}
+</style>

+ 116 - 0
apps/wisdom-legacy/src/views/outcome/intellectual-property.data.ts

@@ -0,0 +1,116 @@
+import type { IntellectualPropertyVO } from '#/api/outcome';
+
+import { getPopupContainer } from '@vben/utils';
+
+import { defineEditShell } from '#/adapter/shell/edit';
+import {
+  editIntellectualPropertyMethod,
+  getIntellectualPropertyMethod,
+  IntellectualPropertyVOSchema,
+  PATENT_STATUS_OPTIONS,
+  PATENT_TYPE_OPTIONS,
+} from '#/api/outcome';
+
+export const intellectualPropertyForm = defineEditShell<IntellectualPropertyVO>(
+  {
+    scope: 'outcome.intellectualProperty',
+    title: '专利',
+    submit: editIntellectualPropertyMethod,
+    load: getIntellectualPropertyMethod,
+    shell: {
+      type: 'modal',
+      class: '!w-[560px]',
+      confirmText: '确定',
+    },
+    form: {
+      layout: 'vertical',
+      wrapperClass: 'grid-cols-1',
+    },
+    schema: [
+      {
+        component: 'Input',
+        fieldName: 'patentNumber',
+        label: '专利号',
+        componentProps: {
+          placeholder: '请输入',
+        },
+        rules: IntellectualPropertyVOSchema.shape.patentNumber,
+      },
+      {
+        component: 'Input',
+        fieldName: 'title',
+        label: '专利名称',
+        componentProps: {
+          placeholder: '请输入',
+        },
+        rules: IntellectualPropertyVOSchema.shape.title,
+      },
+      {
+        component: 'Select',
+        fieldName: 'patentType',
+        label: '专利类型',
+        componentProps: {
+          options: [...PATENT_TYPE_OPTIONS],
+          placeholder: '请选择专利类型',
+          getPopupContainer,
+        },
+        rules: IntellectualPropertyVOSchema.shape.patentType,
+      },
+      {
+        component: 'Input',
+        fieldName: 'inventors',
+        label: '发明人',
+        componentProps: {
+          placeholder: '多个发明人用逗号分隔',
+        },
+        rules: IntellectualPropertyVOSchema.shape.inventors,
+      },
+      {
+        component: 'DatePicker',
+        fieldName: 'applicationDate',
+        label: '申请日期',
+        componentProps: {
+          class: 'w-full',
+          format: 'YYYY/MM/DD',
+          placeholder: '年/月/日',
+          valueFormat: 'YYYY-MM-DD',
+          getPopupContainer,
+        },
+        rules: IntellectualPropertyVOSchema.shape.applicationDate,
+      },
+      {
+        component: 'Select',
+        fieldName: 'status',
+        label: '授权状态',
+        componentProps: {
+          options: [...PATENT_STATUS_OPTIONS],
+          placeholder: '请选择授权状态',
+          getPopupContainer,
+        },
+        rules: IntellectualPropertyVOSchema.shape.status,
+      },
+      {
+        component: 'DatePicker',
+        fieldName: 'authorizationDate',
+        label: '授权日期',
+        componentProps: {
+          class: 'w-full',
+          format: 'YYYY/MM/DD',
+          placeholder: '年/月/日',
+          valueFormat: 'YYYY-MM-DD',
+          getPopupContainer,
+        },
+        rules: IntellectualPropertyVOSchema.shape.authorizationDate,
+      },
+      {
+        component: 'Input',
+        fieldName: 'workroomId',
+        dependencies: {
+          show: false,
+          triggerFields: ['workroomId'],
+        },
+        rules: IntellectualPropertyVOSchema.shape.workroomId,
+      },
+    ],
+  },
+);

+ 168 - 0
apps/wisdom-legacy/src/views/outcome/modules/IntellectualPropertyEdit.vue

@@ -0,0 +1,168 @@
+<script setup lang="ts">
+import type { UploadFile, UploadProps } from 'ant-design-vue';
+
+import type { IntellectualPropertySubmitVO } from '#/api/outcome';
+
+import { ref } from 'vue';
+
+import { InboxOutlined } from '@ant-design/icons-vue';
+import { 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 { intellectualPropertyForm } from '../intellectual-property.data';
+
+const workroomStore = useWorkroomStore();
+
+const PDF_MAX_SIZE = 50 * 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<IntellectualPropertySubmitVO>(
+  intellectualPropertyForm,
+  {
+    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('请上传专利附件');
+        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('文件大小不能超过50MB');
+    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>
+          附件
+        </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格式文件,建议文件大小不超过50MB
+          </p>
+        </UploadDragger>
+      </div>
+    </div>
+  </Shell>
+</template>