DESKTOP-USV654P\pc 3 тижнів тому
батько
коміт
9aa9dadb33

+ 1 - 1
Makefile

@@ -12,7 +12,7 @@ build:
 
 commit:
 	git add . && \
-	git commit --no-verify -m "fix: change multiple select"
+	git commit --no-verify -m "fix: change evaluate"
 
 checkPre:
 	git checkout pre

+ 1 - 1
src/services/apis/EvaluateResultController.ts

@@ -25,6 +25,6 @@ export async function postEvaluateResultExportQuery(params:API.ResultViewingExce
 export async function getEvaluateResultIndexPage(params:any,mode: ErrorMessageMode = 'modal'){ return defHttp.get<API.PageOutput<API.EvaluateResultIndexPageVo>>
         ({url: '/evaluate/evaluateResult/index-page', params:params},{errorMessageMode:mode});}
 /** 结果查看(分页) GET /evaluate/evaluateResult/result-viewing-page */
-export async function getEvaluateResultResultViewingPage(params:any,mode: ErrorMessageMode = 'modal'){ return defHttp.get<API.PageOutput<API.ResultViewingPageVo>>
+export async function getEvaluateResultResultViewingPage(params:any,mode: ErrorMessageMode = 'modal'){ return defHttp.get<API.ResultViewingPageVo[]>
         ({url: '/evaluate/evaluateResult/result-viewing-page', params:params},{errorMessageMode:mode});}
             

+ 7 - 11
src/services/typing.d.ts

@@ -9580,6 +9580,8 @@ orgName?: string;
 semesterName?: string;
 /** 开始时间 */
 startTime?: string;
+/** 状态(-1:未发布,1:进行中,0,暂停) */
+status?: number;
 }
 
 type EvaluateResultSaveDto = {
@@ -13025,14 +13027,6 @@ total?: number;
 totalPage?: number;
 }
 
-type PageOutput<ResultViewingPageVo> = {
-currentPage?: number;
-list?: ResultViewingPageVo[];
-pageSize?: number;
-total?: number;
-totalPage?: number;
-}
-
 type PageOutput<RoomBedCheckRecordPageVo> = {
 currentPage?: number;
 list?: RoomBedCheckRecordPageVo[];
@@ -14645,14 +14639,16 @@ objectIdCN?: string;
 planExecuterNum?: number;
 /** 题目名称 */
 problem?: string;
+/** 状态(2:已评分,0:未评分) */
+status?: number;
 /** 单个被评对象的每一道题的平均得分 */
-sumScore?: number;
+sumScore?: string;
 /** 单个被评对象的综合平均得分 */
-synthesisScore?: number;
+synthesisScore?: string;
 /** 标题名称 */
 topic?: string;
 /** 单个被评对象的每个标题的平均得分 */
-topicScore?: number;
+topicScore?: string;
 }
 
 type RoomBedCheckRecordEchoVo = {

+ 64 - 68
src/views/course/statistics/components/detail.vue

@@ -73,7 +73,6 @@
     postClassTimeStatisticsRecordDetailExportQuery,
     getClassTimeStatisticsRecordDetailInfo,
   } from '/@/services/apis/ClassTimeStatisticsController';
-  import { useLoading } from '/@/components/Loading';
   import { formatToDate } from '/@/utils/dateUtil';
   import { downloadByData } from '/@/utils/file/download';
 
@@ -84,9 +83,6 @@
     index: 0,
   });
   const emit = defineEmits(['success', 'register']);
-  const [openFullLoading, closeFullLoading] = useLoading({
-    tip: '处理中...',
-  });
 
   const [registerTable, { setTableData, setColumns, redoHeight }] = useTable({
     title: '课时统计表',
@@ -119,8 +115,7 @@
   });
 
   const loadData = async () => {
-    setModalProps({ confirmLoading: true });
-    openFullLoading();
+    setModalProps({ confirmLoading: true, loading: true });
     modelRef.value = dataSoruce.data[dataSoruce.index];
     const resData = await getClassTimeStatisticsRecordDetailInfo({ id: unref(modelRef).id });
 
@@ -133,87 +128,88 @@
       },
     ];
     const dataList: Recordable[] = [];
-    if (resData) {
-      const { rowTitle, columnTitle, data, allClassTime } = JSON.parse(resData);
+    try {
+      if (resData) {
+        const { rowTitle, columnTitle, data, allClassTime } = resData;
 
-      const totalRow: Recordable = { timeName: '合计课时' };
+        const totalRow: Recordable = { timeName: '合计课时' };
 
-      rowTitle.forEach((item, index) => {
-        columns.push({
-          title: item.scheduleDate,
-          dataIndex: `day${index}`,
-          width: 120,
-          customRender: formatDay,
+        rowTitle.forEach((item, index) => {
+          columns.push({
+            title: item.scheduleDate,
+            dataIndex: `day${index}`,
+            width: 120,
+            customRender: formatDay,
+          });
         });
-      });
 
-      columnTitle.forEach((col) => {
-        let row: Recordable = {
-          timeName: col.type,
-        };
+        columnTitle.forEach((col) => {
+          let row: Recordable = {
+            timeName: col.type,
+          };
 
-        rowTitle.forEach((item, index) => {
-          const filter = data.filter(
-            (f) =>
-              formatToDate(f.scheduleDate, 'MM.DD') === `${item.scheduleDate}` &&
-              f.type === col.type,
-          );
+          rowTitle.forEach((item, index) => {
+            const filter = data.filter(
+              (f) =>
+                formatToDate(f.scheduleDate, 'MM.DD') === `${item.scheduleDate}` &&
+                f.type === col.type,
+            );
 
-          const colName = `day${index}`;
+            const colName = `day${index}`;
 
-          totalRow[colName] = { courseName: item.content };
+            totalRow[colName] = { courseName: item.content };
 
-          row[colName] = {};
-          row['total'] = col.content === 0 ? '' : col.content;
+            row[colName] = {};
+            row['total'] = col.content === 0 ? '' : col.content;
 
-          if (filter.length > 0) {
-            // console.log('filter', filter);
-            const filterItem = filter[0];
-            if (filterItem.content) {
-              const contents = filterItem.content.split(',');
-              const courseName = contents[0];
-              let className = '';
-              if (contents.length > 1) {
-                className = contents[1];
-              }
+            if (filter.length > 0) {
+              // console.log('filter', filter);
+              const filterItem = filter[0];
+              if (filterItem.content) {
+                const contents = filterItem.content.split(',');
+                const courseName = contents[0];
+                let className = '';
+                if (contents.length > 1) {
+                  className = contents[1];
+                }
 
-              row[colName]['courseName'] = courseName;
-              row[colName]['className'] = className;
+                row[colName]['courseName'] = courseName;
+                row[colName]['className'] = className;
 
-              if (filterItem.adjustType === 'course_exchange') {
-                row[colName]['color'] = '#facd91';
-              }
-              if (filterItem.adjustType === 'course_substitute') {
-                row[colName]['color'] = '#ec808d';
+                if (filterItem.adjustType === 'course_exchange') {
+                  row[colName]['color'] = '#facd91';
+                }
+                if (filterItem.adjustType === 'course_substitute') {
+                  row[colName]['color'] = '#ec808d';
+                }
               }
             }
-          }
-        });
+          });
 
-        dataList.push(row);
-      });
-
-      totalRow['total'] = allClassTime;
-      dataList.push(totalRow);
+          dataList.push(row);
+        });
 
-      // console.log('dataList', dataList);
-    }
+        totalRow['total'] = allClassTime;
+        dataList.push(totalRow);
 
-    columns.push({
-      title: '合计(课时)',
-      dataIndex: 'total',
-      width: 90,
-    });
+        // console.log('dataList', dataList);
+      }
 
-    setColumns(columns);
-    setTableData(dataList);
+      columns.push({
+        title: '合计(课时)',
+        dataIndex: 'total',
+        width: 90,
+      });
 
-    setTimeout(() => {
-      redoHeight();
-    }, 500);
+      setColumns(columns);
+      setTableData(dataList);
 
-    setModalProps({ confirmLoading: false });
-    closeFullLoading();
+      setTimeout(() => {
+        redoHeight();
+      }, 500);
+    } finally {
+      setModalProps({ confirmLoading: false, loading: false });
+    }
   };
 
   const formatDay = ({ text }) => {

+ 1 - 0
src/views/evaluate/maintenance/index.vue

@@ -19,6 +19,7 @@
               {
                 label: '删除',
                 color: 'error',
+                disabled: record.useStatus === 1,
                 onClick: handleDelete.bind(null, record),
               },
             ]"

+ 8 - 8
src/views/evaluate/result/components/data.config.ts

@@ -43,7 +43,7 @@ export const tableColumns: BasicColumn[] = [
     dataIndex: 'action',
     slots: { customRender: 'action' },
     align: 'center',
-    width: 180,
+    width: 210,
   },
 ];
 //评价结果里面的搜索字段
@@ -365,7 +365,7 @@ export const evaluateResultTableColumns: BasicColumn[] = [
     dataIndex: 'index',
     width: 60,
     customCell: (record) => {
-      return { rowSpan: record.rowSpanTopic };
+      return { rowSpan: record.rowSpanObject };
     },
   },
   {
@@ -374,7 +374,7 @@ export const evaluateResultTableColumns: BasicColumn[] = [
     width: 120,
     align: 'left',
     customCell: (record) => {
-      return { rowSpan: record.rowSpanTopic };
+      return { rowSpan: record.rowSpanObject };
     },
   },
   {
@@ -383,7 +383,7 @@ export const evaluateResultTableColumns: BasicColumn[] = [
     width: 100,
     align: 'left',
     customCell: (record) => {
-      return { rowSpan: record.rowSpanTopic };
+      return { rowSpan: record.rowSpanObject };
     },
   },
   {
@@ -392,7 +392,7 @@ export const evaluateResultTableColumns: BasicColumn[] = [
     width: 110,
     align: 'left',
     customCell: (record) => {
-      return { rowSpan: record.rowSpanTopic };
+      return { rowSpan: record.rowSpanObject };
     },
   },
   {
@@ -412,7 +412,7 @@ export const evaluateResultTableColumns: BasicColumn[] = [
     width: 200,
     align: 'left',
     customCell: (record) => {
-      return { rowSpan: record.rowSpanProblem };
+      return { rowSpan: record.rowSpanTopic };
     },
   },
   {
@@ -421,7 +421,7 @@ export const evaluateResultTableColumns: BasicColumn[] = [
     width: 80,
     align: 'left',
     customCell: (record) => {
-      return { rowSpan: record.rowSpanProblem };
+      return { rowSpan: record.rowSpanTopic };
     },
   },
   {
@@ -430,7 +430,7 @@ export const evaluateResultTableColumns: BasicColumn[] = [
     width: 80,
     align: 'left',
     customCell: (record) => {
-      return { rowSpan: record.rowSpanTopic };
+      return { rowSpan: record.rowSpanObject };
     },
   },
 ];

+ 21 - 3
src/views/evaluate/result/components/resultView.vue

@@ -35,16 +35,33 @@
     bordered: true,
     immediate: false,
     canResize: true,
+    pagination: false,
     afterFetch: (t) => {
-      const dataList = sortBy(t, ['topic', 'problem'], ['asc', 'asc']);
+      const dataList = sortBy(t, ['objectIdCN', 'topic', 'problem'], ['asc', 'asc', 'asc']);
       let topic = '';
       let problem = '';
+      let objectIdCN = '';
+      let objectIndex = 1;
       let topicIndex = 1;
       dataList.forEach((item) => {
+        if (item.objectIdCN !== objectIdCN) {
+          objectIdCN = item.objectIdCN;
+          topic = '';
+          problem = '';
+          const filterItme = dataList.filter((row) => row.objectIdCN === objectIdCN);
+          item.rowSpanObject = filterItme.length;
+          item.objectIndex = objectIndex++;
+        } else {
+          item.rowSpanObject = 0;
+          item.objectIndex = objectIndex;
+        }
+
         if (item.topic !== topic) {
           topic = item.topic;
           problem = '';
-          const filterItme = dataList.filter((row) => row.topic === topic);
+          const filterItme = dataList.filter(
+            (row) => row.objectIdCN === objectIdCN && row.topic === topic,
+          );
           item.rowSpanTopic = filterItme.length;
           item.index = topicIndex++;
         } else {
@@ -55,7 +72,8 @@
         if (item.problem !== problem) {
           problem = item.problem;
           const filterItme = dataList.filter(
-            (row) => row.topic === topic && row.problem === problem,
+            (row) =>
+              row.objectIdCN === objectIdCN && row.topic === topic && row.problem === problem,
           );
           item.rowSpanProblem = filterItme.length;
         } else {

+ 15 - 1
src/views/evaluate/result/index.vue

@@ -7,7 +7,8 @@
   import detailView from './components/detailView.vue';
   import resultView from './components/resultView.vue';
   import { getEvaluateResultIndexPage } from '/@/services/apis/EvaluateResultController';
-  const [tableRegister] = useTable({
+  import { postEvaluateManageChangeStatus } from '/@/services/apis/EvaluateManageController';
+  const [tableRegister, { reload }] = useTable({
     api: getEvaluateResultIndexPage,
     columns: tableColumns,
     title: '评价结果',
@@ -30,6 +31,14 @@
   const handleResult = (record: any) => {
     openResultModal(true, { ...record });
   };
+
+  const handlePush = async (record: any) => {
+    await postEvaluateManageChangeStatus({
+      id: record.evaluateManageId,
+      status: 0,
+    });
+    reload();
+  };
 </script>
 
 <template>
@@ -46,6 +55,11 @@
               label: '结果查看',
               onClick: handleResult.bind(null, record),
             },
+            {
+              label: '暂停',
+              disabled: record.status !== 1,
+              onClick: handlePush.bind(null, record),
+            },
           ]"
         />
       </template>