|
@@ -12,13 +12,15 @@ import type { PageVO } from '#/request/schema/record';
|
|
|
import { pageQueryArgsTransform } from '#/request/schema';
|
|
import { pageQueryArgsTransform } from '#/request/schema';
|
|
|
|
|
|
|
|
import {
|
|
import {
|
|
|
|
|
+ decodeGrantStatus,
|
|
|
decodeIntellectualProperty,
|
|
decodeIntellectualProperty,
|
|
|
|
|
+ decodePatentType,
|
|
|
encodeIntellectualProperty,
|
|
encodeIntellectualProperty,
|
|
|
encodeIntellectualPropertyQuery,
|
|
encodeIntellectualPropertyQuery,
|
|
|
} from './intellectual-property.schema';
|
|
} from './intellectual-property.schema';
|
|
|
|
|
|
|
|
/** 后端接口就绪后改为 false */
|
|
/** 后端接口就绪后改为 false */
|
|
|
-export const USE_INTELLECTUAL_PROPERTY_MOCK = true;
|
|
|
|
|
|
|
+export const USE_INTELLECTUAL_PROPERTY_MOCK = false;
|
|
|
|
|
|
|
|
type MethodLike<T> = PromiseLike<T> & {
|
|
type MethodLike<T> = PromiseLike<T> & {
|
|
|
send?: (force?: boolean) => PromiseLike<T>;
|
|
send?: (force?: boolean) => PromiseLike<T>;
|
|
@@ -32,73 +34,73 @@ const SEED_RECORDS: Omit<
|
|
|
'createTime' | 'id' | 'personalStudioId' | 'updateTime'
|
|
'createTime' | 'id' | 'personalStudioId' | 'updateTime'
|
|
|
>[] = [
|
|
>[] = [
|
|
|
{
|
|
{
|
|
|
- patentNumber: 'CN202310123456.7',
|
|
|
|
|
- title: '一种治疗慢性胃炎的中药复方制剂',
|
|
|
|
|
- patentType: 'invention',
|
|
|
|
|
- inventors: '张三, 李四, 王五',
|
|
|
|
|
- applicationDate: '2023-03-15',
|
|
|
|
|
- status: 'rejected',
|
|
|
|
|
- authorizationDate: '2024-06-20',
|
|
|
|
|
|
|
+ patentCode: 'CN202310123456.7',
|
|
|
|
|
+ patentName: '一种治疗慢性胃炎的中药复方制剂',
|
|
|
|
|
+ type: '0',
|
|
|
|
|
+ inventor: '张三, 李四, 王五',
|
|
|
|
|
+ applyTime: '2023-03-15T00:00:00',
|
|
|
|
|
+ grantStatus: '1',
|
|
|
|
|
+ grantTime: '2024-06-20T00:00:00',
|
|
|
commentCount: 5,
|
|
commentCount: 5,
|
|
|
createBy: '张三',
|
|
createBy: '张三',
|
|
|
fileUrl: MOCK_PDF_URL,
|
|
fileUrl: MOCK_PDF_URL,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- patentNumber: 'CN202410234567.8',
|
|
|
|
|
- title: '基于人工智能的中医诊断辅助系统',
|
|
|
|
|
- patentType: 'invention',
|
|
|
|
|
- inventors: '赵六, 钱七',
|
|
|
|
|
- applicationDate: '2024-01-10',
|
|
|
|
|
- status: 'under_review',
|
|
|
|
|
- authorizationDate: '2025-02-28',
|
|
|
|
|
|
|
+ patentCode: 'CN202410234567.8',
|
|
|
|
|
+ patentName: '基于人工智能的中医诊断辅助系统',
|
|
|
|
|
+ type: '0',
|
|
|
|
|
+ inventor: '赵六, 钱七',
|
|
|
|
|
+ applyTime: '2024-01-10T00:00:00',
|
|
|
|
|
+ grantStatus: '0',
|
|
|
|
|
+ grantTime: '2025-02-28T00:00:00',
|
|
|
commentCount: 3,
|
|
commentCount: 3,
|
|
|
createBy: '赵六',
|
|
createBy: '赵六',
|
|
|
fileUrl: MOCK_PDF_URL,
|
|
fileUrl: MOCK_PDF_URL,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- patentNumber: 'CN202210345678.9',
|
|
|
|
|
- title: '改进型针灸治疗仪',
|
|
|
|
|
- patentType: 'utility_model',
|
|
|
|
|
- inventors: '孙八, 周九',
|
|
|
|
|
- applicationDate: '2022-08-22',
|
|
|
|
|
- status: 'authorized',
|
|
|
|
|
- authorizationDate: '2023-05-18',
|
|
|
|
|
|
|
+ patentCode: 'CN202210345678.9',
|
|
|
|
|
+ patentName: '改进型针灸治疗仪',
|
|
|
|
|
+ type: '1',
|
|
|
|
|
+ inventor: '孙八, 周九',
|
|
|
|
|
+ applyTime: '2022-08-22T00:00:00',
|
|
|
|
|
+ grantStatus: '2',
|
|
|
|
|
+ grantTime: '2023-05-18T00:00:00',
|
|
|
commentCount: 8,
|
|
commentCount: 8,
|
|
|
createBy: '孙八',
|
|
createBy: '孙八',
|
|
|
fileUrl: MOCK_PDF_URL,
|
|
fileUrl: MOCK_PDF_URL,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- patentNumber: 'CN202310456789.0',
|
|
|
|
|
- title: '一种中药提取装置',
|
|
|
|
|
- patentType: 'utility_model',
|
|
|
|
|
- inventors: '吴十, 郑十一',
|
|
|
|
|
- applicationDate: '2023-06-01',
|
|
|
|
|
- status: 'authorized',
|
|
|
|
|
- authorizationDate: '2024-03-12',
|
|
|
|
|
|
|
+ patentCode: 'CN202310456789.0',
|
|
|
|
|
+ patentName: '一种中药提取装置',
|
|
|
|
|
+ type: '1',
|
|
|
|
|
+ inventor: '吴十, 郑十一',
|
|
|
|
|
+ applyTime: '2023-06-01T00:00:00',
|
|
|
|
|
+ grantStatus: '2',
|
|
|
|
|
+ grantTime: '2024-03-12T00:00:00',
|
|
|
commentCount: 2,
|
|
commentCount: 2,
|
|
|
createBy: '吴十',
|
|
createBy: '吴十',
|
|
|
fileUrl: MOCK_PDF_URL,
|
|
fileUrl: MOCK_PDF_URL,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- patentNumber: 'CN202410567890.1',
|
|
|
|
|
- title: '便携式脉诊仪外观设计',
|
|
|
|
|
- patentType: 'design',
|
|
|
|
|
- inventors: '王十二',
|
|
|
|
|
- applicationDate: '2024-02-14',
|
|
|
|
|
- status: 'under_review',
|
|
|
|
|
- authorizationDate: '2025-01-20',
|
|
|
|
|
|
|
+ patentCode: 'CN202410567890.1',
|
|
|
|
|
+ patentName: '便携式脉诊仪外观设计',
|
|
|
|
|
+ type: '2',
|
|
|
|
|
+ inventor: '王十二',
|
|
|
|
|
+ applyTime: '2024-02-14T00:00:00',
|
|
|
|
|
+ grantStatus: '0',
|
|
|
|
|
+ grantTime: '2025-01-20T00:00:00',
|
|
|
commentCount: 1,
|
|
commentCount: 1,
|
|
|
createBy: '王十二',
|
|
createBy: '王十二',
|
|
|
fileUrl: MOCK_PDF_URL,
|
|
fileUrl: MOCK_PDF_URL,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- patentNumber: 'CN202210678901.2',
|
|
|
|
|
- title: '一种艾灸烟雾净化装置',
|
|
|
|
|
- patentType: 'utility_model',
|
|
|
|
|
- inventors: '李十三, 张十四',
|
|
|
|
|
- applicationDate: '2022-11-05',
|
|
|
|
|
- status: 'authorized',
|
|
|
|
|
- authorizationDate: '2023-09-30',
|
|
|
|
|
|
|
+ patentCode: 'CN202210678901.2',
|
|
|
|
|
+ patentName: '一种艾灸烟雾净化装置',
|
|
|
|
|
+ type: '1',
|
|
|
|
|
+ inventor: '李十三, 张十四',
|
|
|
|
|
+ applyTime: '2022-11-05T00:00:00',
|
|
|
|
|
+ grantStatus: '2',
|
|
|
|
|
+ grantTime: '2023-09-30T00:00:00',
|
|
|
commentCount: 6,
|
|
commentCount: 6,
|
|
|
createBy: '李十三',
|
|
createBy: '李十三',
|
|
|
fileUrl: MOCK_PDF_URL,
|
|
fileUrl: MOCK_PDF_URL,
|
|
@@ -138,9 +140,9 @@ function delay<T>(runner: () => Promise<T> | T, ms = 120): MethodLike<T> {
|
|
|
function matchKeyword(record: IntellectualPropertyDTO, keyword?: string) {
|
|
function matchKeyword(record: IntellectualPropertyDTO, keyword?: string) {
|
|
|
if (!keyword) return true;
|
|
if (!keyword) return true;
|
|
|
const text = [
|
|
const text = [
|
|
|
- record.title,
|
|
|
|
|
- record.patentNumber,
|
|
|
|
|
- record.inventors,
|
|
|
|
|
|
|
+ record.patentName,
|
|
|
|
|
+ record.patentCode,
|
|
|
|
|
+ record.inventor,
|
|
|
record.createBy,
|
|
record.createBy,
|
|
|
]
|
|
]
|
|
|
.filter(Boolean)
|
|
.filter(Boolean)
|
|
@@ -158,12 +160,15 @@ function matchPatentType(
|
|
|
patentType?: PatentType,
|
|
patentType?: PatentType,
|
|
|
) {
|
|
) {
|
|
|
if (!patentType) return true;
|
|
if (!patentType) return true;
|
|
|
- return record.patentType === patentType;
|
|
|
|
|
|
|
+ return decodePatentType(record.type) === patentType;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-function matchStatus(record: IntellectualPropertyDTO, status?: PatentStatus) {
|
|
|
|
|
|
|
+function matchGrantStatus(
|
|
|
|
|
+ record: IntellectualPropertyDTO,
|
|
|
|
|
+ status?: PatentStatus,
|
|
|
|
|
+) {
|
|
|
if (!status) return true;
|
|
if (!status) return true;
|
|
|
- return record.status === status;
|
|
|
|
|
|
|
+ return decodeGrantStatus(record.grantStatus) === status;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function toVo(dto: IntellectualPropertyDTO): IntellectualPropertyVO {
|
|
function toVo(dto: IntellectualPropertyDTO): IntellectualPropertyVO {
|
|
@@ -181,15 +186,17 @@ export function mockListIntellectualPropertyMethod(
|
|
|
const pageSize = Number(params.pageSize ?? 10);
|
|
const pageSize = Number(params.pageSize ?? 10);
|
|
|
const keyword = data.mixture;
|
|
const keyword = data.mixture;
|
|
|
const workroomId = data.personalStudioId?.toString();
|
|
const workroomId = data.personalStudioId?.toString();
|
|
|
- const patentType = data.patentType;
|
|
|
|
|
- const status = data.status;
|
|
|
|
|
|
|
+ const patentType = data.type ? decodePatentType(data.type) : undefined;
|
|
|
|
|
+ const status = data.grantStatus
|
|
|
|
|
+ ? decodeGrantStatus(data.grantStatus)
|
|
|
|
|
+ : undefined;
|
|
|
|
|
|
|
|
const filtered = store.filter(
|
|
const filtered = store.filter(
|
|
|
(record) =>
|
|
(record) =>
|
|
|
matchKeyword(record, keyword) &&
|
|
matchKeyword(record, keyword) &&
|
|
|
matchWorkroom(record, workroomId) &&
|
|
matchWorkroom(record, workroomId) &&
|
|
|
matchPatentType(record, patentType) &&
|
|
matchPatentType(record, patentType) &&
|
|
|
- matchStatus(record, status),
|
|
|
|
|
|
|
+ matchGrantStatus(record, status),
|
|
|
);
|
|
);
|
|
|
const start = (pageNum - 1) * pageSize;
|
|
const start = (pageNum - 1) * pageSize;
|
|
|
const items = filtered
|
|
const items = filtered
|