|
|
@@ -16,7 +16,7 @@ import {
|
|
|
} from './reading-note.schema';
|
|
|
|
|
|
/** 后端接口就绪后改为 false */
|
|
|
-export const USE_READING_NOTE_MOCK = true;
|
|
|
+export const USE_READING_NOTE_MOCK = false;
|
|
|
|
|
|
type MethodLike<T> = PromiseLike<T> & {
|
|
|
send?: (force?: boolean) => PromiseLike<T>;
|
|
|
@@ -27,64 +27,64 @@ const SEED_RECORDS: Omit<
|
|
|
'createTime' | 'id' | 'personalStudioId' | 'updateTime'
|
|
|
>[] = [
|
|
|
{
|
|
|
- insightTitle: '《黄帝内经》阴阳五行理论学习心得',
|
|
|
+ title: '《黄帝内经》阴阳五行理论学习心得',
|
|
|
bookName: '《黄帝内经》',
|
|
|
- authorName: '王医师',
|
|
|
- noteDate: '2026-05-20',
|
|
|
- noteContent:
|
|
|
+ author: '王医师',
|
|
|
+ content:
|
|
|
'《黄帝内经》作为中医理论的奠基之作,其阴阳五行学说贯穿整个中医理论体系。通过深入学习,我对阴阳互根、五行生克有了更深刻的理解,这对临床辨证论治具有重要指导意义。',
|
|
|
- agreeCount: 23,
|
|
|
+ praiseCount: 23,
|
|
|
createBy: '王医师',
|
|
|
+ fileUrl: '',
|
|
|
},
|
|
|
{
|
|
|
- insightTitle: '《伤寒论》六经辨证临床应用体会',
|
|
|
+ title: '《伤寒论》六经辨证临床应用体会',
|
|
|
bookName: '《伤寒论》',
|
|
|
- authorName: '李主任',
|
|
|
- noteDate: '2026-05-18',
|
|
|
- noteContent:
|
|
|
+ author: '李主任',
|
|
|
+ content:
|
|
|
'六经辨证是《伤寒论》的核心内容。在临床实践中,太阳病与少阳病的鉴别尤为关键。结合具体病例,我总结了若干辨证要点,供同仁参考。',
|
|
|
- agreeCount: 18,
|
|
|
+ praiseCount: 18,
|
|
|
createBy: '李主任',
|
|
|
+ fileUrl: '',
|
|
|
},
|
|
|
{
|
|
|
- insightTitle: '《金匮要略》杂病诊治思路梳理',
|
|
|
+ title: '《金匮要略》杂病诊治思路梳理',
|
|
|
bookName: '《金匮要略》',
|
|
|
- authorName: '张教授',
|
|
|
- noteDate: '2026-05-15',
|
|
|
- noteContent:
|
|
|
+ author: '张教授',
|
|
|
+ content:
|
|
|
'《金匮要略》对杂病的论述系统而深入。本书心得重点梳理了虚劳、痰饮、水气等常见杂病的辨治思路,并结合现代临床进行了延伸思考。',
|
|
|
- agreeCount: 31,
|
|
|
+ praiseCount: 31,
|
|
|
createBy: '张教授',
|
|
|
+ fileUrl: '',
|
|
|
},
|
|
|
{
|
|
|
- insightTitle: '《温病条辨》卫气营血辨证学习笔记',
|
|
|
+ title: '《温病条辨》卫气营血辨证学习笔记',
|
|
|
bookName: '《温病条辨》',
|
|
|
- authorName: '赵医师',
|
|
|
- noteDate: '2026-05-12',
|
|
|
- noteContent:
|
|
|
+ author: '赵医师',
|
|
|
+ content:
|
|
|
'温病学说是中医外感热病学的重要组成部分。吴鞠通的卫气营血辨证体系层次分明,对急性热病的诊治具有重要价值。',
|
|
|
- agreeCount: 15,
|
|
|
+ praiseCount: 15,
|
|
|
createBy: '赵医师',
|
|
|
+ fileUrl: '',
|
|
|
},
|
|
|
{
|
|
|
- insightTitle: '《神农本草经》药物性味归经研读',
|
|
|
+ title: '《神农本草经》药物性味归经研读',
|
|
|
bookName: '《神农本草经》',
|
|
|
- authorName: '陈教授',
|
|
|
- noteDate: '2026-05-10',
|
|
|
- noteContent:
|
|
|
+ author: '陈教授',
|
|
|
+ content:
|
|
|
'《神农本草经》是我国现存最早的本草学专著。通过系统研读,我对药物四气五味、升降浮沉及归经理论有了更系统的认识。',
|
|
|
- agreeCount: 27,
|
|
|
+ praiseCount: 27,
|
|
|
createBy: '陈教授',
|
|
|
+ fileUrl: '',
|
|
|
},
|
|
|
{
|
|
|
- insightTitle: '《针灸大成》腧穴配伍心得',
|
|
|
+ title: '《针灸大成》腧穴配伍心得',
|
|
|
bookName: '《针灸大成》',
|
|
|
- authorName: '刘医师',
|
|
|
- noteDate: '2026-05-08',
|
|
|
- noteContent:
|
|
|
+ author: '刘医师',
|
|
|
+ content:
|
|
|
'《针灸大成》汇集历代针灸精华。本书心得重点记录了常用腧穴配伍规律及临床运用体会,对提高针灸疗效颇有帮助。',
|
|
|
- agreeCount: 12,
|
|
|
+ praiseCount: 12,
|
|
|
createBy: '刘医师',
|
|
|
+ fileUrl: '',
|
|
|
},
|
|
|
];
|
|
|
|
|
|
@@ -99,7 +99,7 @@ function createInitialStore(): ReadingNoteDTO[] {
|
|
|
...seed,
|
|
|
id: String(index + 1),
|
|
|
personalStudioId: '327477138296832',
|
|
|
- agreeCount: (seed.agreeCount ?? 0) + (index % 5),
|
|
|
+ praiseCount: (seed.praiseCount ?? 0) + (index % 5),
|
|
|
createTime: `2026-${month}-${day}T10:00:00`,
|
|
|
updateTime: `2026-05-${day}T10:00:00`,
|
|
|
});
|
|
|
@@ -121,12 +121,7 @@ function delay<T>(runner: () => Promise<T> | T, ms = 120): MethodLike<T> {
|
|
|
|
|
|
function matchKeyword(record: ReadingNoteDTO, keyword?: string) {
|
|
|
if (!keyword) return true;
|
|
|
- const text = [
|
|
|
- record.insightTitle,
|
|
|
- record.bookName,
|
|
|
- record.authorName,
|
|
|
- record.createBy,
|
|
|
- ]
|
|
|
+ const text = [record.title, record.bookName, record.author, record.createBy]
|
|
|
.filter(Boolean)
|
|
|
.join(' ');
|
|
|
return text.includes(keyword);
|
|
|
@@ -139,8 +134,8 @@ function matchWorkroom(record: ReadingNoteDTO, workroomId?: string) {
|
|
|
|
|
|
function sortRecords(records: ReadingNoteDTO[]) {
|
|
|
return records.toSorted((a, b) => {
|
|
|
- const timeA = a.noteDate ? Date.parse(a.noteDate) : 0;
|
|
|
- const timeB = b.noteDate ? Date.parse(b.noteDate) : 0;
|
|
|
+ const timeA = a.createTime ? Date.parse(a.createTime) : 0;
|
|
|
+ const timeB = b.createTime ? Date.parse(b.createTime) : 0;
|
|
|
return timeB - timeA;
|
|
|
});
|
|
|
}
|
|
|
@@ -208,8 +203,8 @@ export function mockEditReadingNoteMethod(vo: ReadingNoteSubmitVO) {
|
|
|
store.unshift({
|
|
|
...dto,
|
|
|
id,
|
|
|
- agreeCount: 0,
|
|
|
- createBy: dto.authorName ?? '当前用户',
|
|
|
+ praiseCount: 0,
|
|
|
+ createBy: dto.author ?? '当前用户',
|
|
|
createTime: now,
|
|
|
updateTime: now,
|
|
|
});
|