Browse Source

fix: show complete lesson types and verified historical durations

彭峰 2 giờ trước cách đây
mục cha
commit
f0f8db3586

+ 2 - 2
projects/xiaoshu-admin/src/app/pages/lesson-records.component.html

@@ -23,7 +23,7 @@
           <th scope="col">课程</th>
           <th scope="col">课程</th>
           <th scope="col" aria-sort="descending">训练时间 <span aria-hidden="true">↓</span></th>
           <th scope="col" aria-sort="descending">训练时间 <span aria-hidden="true">↓</span></th>
           <th scope="col">授课老师</th>
           <th scope="col">授课老师</th>
-          <th scope="col">课型</th>
+          <th scope="col" class="class-cell">课型</th>
           <th scope="col">反馈摘要</th>
           <th scope="col">反馈摘要</th>
           <th scope="col">当前复习陪练</th>
           <th scope="col">当前复习陪练</th>
           <th scope="col" class="number-cell">待复习</th>
           <th scope="col" class="number-cell">待复习</th>
@@ -40,7 +40,7 @@
             <td [attr.title]="row.courseName">{{ row.courseName }}</td>
             <td [attr.title]="row.courseName">{{ row.courseName }}</td>
             <td class="time-cell">{{ row.lessonAt | date:'yyyy-MM-dd HH:mm':'+0800' }}</td>
             <td class="time-cell">{{ row.lessonAt | date:'yyyy-MM-dd HH:mm':'+0800' }}</td>
             <td [attr.title]="row.coachName">{{ row.coachName }}</td>
             <td [attr.title]="row.coachName">{{ row.coachName }}</td>
-            <td [attr.title]="row.classTypeLabel">{{ row.classTypeLabel }}</td>
+            <td class="class-cell" [attr.title]="row.classTypeLabel">{{ row.classTypeLabel }}</td>
             <td>
             <td>
               <div class="feedback-cell">
               <div class="feedback-cell">
                 <span class="feedback-excerpt" [attr.title]="row.feedbackSummary || null">{{ row.feedbackSummary || '未记录' }}</span>
                 <span class="feedback-excerpt" [attr.title]="row.feedbackSummary || null">{{ row.feedbackSummary || '未记录' }}</span>

+ 8 - 2
projects/xiaoshu-admin/src/app/pages/lesson-records.component.scss

@@ -8,7 +8,7 @@
 .lesson-history>.page-header{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:16px}.lesson-history>.page-header>div{min-width:0}.lesson-history>.page-header>.ui-button{justify-self:end}
 .lesson-history>.page-header{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:16px}.lesson-history>.page-header>div{min-width:0}.lesson-history>.page-header>.ui-button{justify-self:end}
 
 
 .lesson-table {
 .lesson-table {
-  min-width: 1120px;
+  min-width: 1240px;
   table-layout: fixed;
   table-layout: fixed;
 }
 }
 .lesson-table .number-col { width: 48px; }
 .lesson-table .number-col { width: 48px; }
@@ -18,7 +18,7 @@
 .lesson-table .course-col { width: 15%; }
 .lesson-table .course-col { width: 15%; }
 .lesson-table .time-col { width: 138px; }
 .lesson-table .time-col { width: 138px; }
 .lesson-table .coach-col { width: 8%; }
 .lesson-table .coach-col { width: 8%; }
-.lesson-table .class-col { width: 136px; }
+.lesson-table .class-col { width: 176px; }
 .lesson-table .review-col { width: 9%; }
 .lesson-table .review-col { width: 9%; }
 .lesson-table .pending-col { width: 62px; }
 .lesson-table .pending-col { width: 62px; }
 .lesson-table .action-col { width: 92px; }
 .lesson-table .action-col { width: 92px; }
@@ -35,6 +35,12 @@
   overflow: hidden;
   overflow: hidden;
   text-overflow: ellipsis;
   text-overflow: ellipsis;
 }
 }
+.lesson-table .class-cell {
+  white-space: normal;
+  overflow: visible;
+  text-overflow: clip;
+  overflow-wrap: anywhere;
+}
 .lesson-table .number-cell { text-align: center; }
 .lesson-table .number-cell { text-align: center; }
 .lesson-table :is(.time-cell, .id-cell, .number-cell) { font-variant-numeric: tabular-nums; }
 .lesson-table :is(.time-cell, .id-cell, .number-cell) { font-variant-numeric: tabular-nums; }
 .feedback-cell { display: flex; align-items: center; gap: 6px; }
 .feedback-cell { display: flex; align-items: center; gap: 6px; }

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 10 - 5
scripts/deploy-admin-functions.mjs


+ 28 - 0
scripts/tests/learning-report-query.test.mjs

@@ -156,3 +156,31 @@ test('报表先定位课次时仍兼容报表对象、通用编号和原学习
   }
   }
   assert.deepEqual((await db.query(targetSql, ['co', 'foreign-target'])).rows, []);
   assert.deepEqual((await db.query(targetSql, ['co', 'foreign-target'])).rows, []);
 });
 });
+
+test('已逐条核实的缺失预约快照补齐课型,同时核验学员和预约身份', () => {
+  const reportMetadata = {
+    verified: true, studentId: 1790, appointmentId: '802757', classType: '2',
+    durationMinutes: 60, courseId: 398, courseName: '阅读写作', categoryName: '语法写作课',
+  };
+  const row = { userId: 1790, dsid: '802757', reportMetadata, isWriting: true };
+  const writing = gateway.learningReportProjection(row);
+  assert.equal(writing.classTypeLabel, '语法写作课 60 分钟');
+  assert.equal(writing.courseName, '阅读写作');
+  assert.equal(writing.masteryRate, null);
+  assert.equal(gateway.learningReportProjection({ ...row, userId: 1828 }).classTypeLabel, '未设置');
+  assert.equal(gateway.learningReportProjection({ ...row, dsid: 'other' }).classTypeLabel, '未设置');
+  const trial = gateway.learningReportProjection({
+    userId: 1828, dsid: '817637',
+    reportMetadata: { ...reportMetadata, studentId: 1828, appointmentId: '817637', classType: '3', courseId: 405, categoryName: '体验课' },
+  });
+  assert.equal(trial.classTypeLabel, '体验课 60 分钟');
+});
+
+test('已核实的原预约写作课快照参与写作筛选,并拒绝身份不符的快照', async () => {
+  await db.exec('ALTER TABLE "DailyStudyRecord" ADD COLUMN "reportMetadata" jsonb');
+  const metadata = JSON.stringify({ verified: true, studentId: 1790, appointmentId: '802757', courseId: 398 });
+  await db.query('INSERT INTO "DailyStudyRecord" ("objectId",company,id,"userId",dsid,dqrq,xxqs,"reportMetadata") VALUES ($1,$2,19999,1790,$3,$4,$5,$6)', ['resolved-writing','co','802757','20260814','[]',metadata]);
+  await db.query('INSERT INTO "DailyStudyRecord" ("objectId",company,id,"userId",dsid,dqrq,xxqs,"reportMetadata") VALUES ($1,$2,20000,1800,$3,$4,$5,$6)', ['mismatched-writing','co','802757','20260814','[]',metadata]);
+  assert.deepEqual(await rows({ status: 'writing', studentId: 1790 }), ['resolved-writing']);
+  assert.deepEqual(await rows({ status: 'writing', studentId: 1800 }), []);
+});

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác