Browse Source

Merge branch 'iteration-20240410' into online

lex 1 year ago
parent
commit
24a4d95609

+ 16 - 9
src/views/attend-class/model/train-type/index.tsx

@@ -54,6 +54,10 @@ export default defineComponent({
       type: Boolean,
       default: false
     },
+    isLarge: {
+      type: Boolean,
+      default: false
+    },
     /** 是否下架 */
     offShelf: {
       type: Boolean,
@@ -179,7 +183,8 @@ export default defineComponent({
         <div
           class={[
             styles['train-content'],
-            props.isDisabled && !props.isCLassWork && styles.trainDisabled
+            props.isDisabled && !props.isCLassWork && styles.trainDisabled,
+            props.isLarge && styles.trainDisabled
           ]}
           onClick={() => {
             if (props.isDisabled && !props.isCLassWork) {
@@ -248,14 +253,16 @@ export default defineComponent({
                 预览
               </NButton>
             </div> */}
-          <img
-            src={iconDelete}
-            class={styles.iconDelete}
-            onClick={(e: MouseEvent) => {
-              e.stopPropagation();
-              emit('delete', props.item);
-            }}
-          />
+          {props.isDelete && (
+            <img
+              src={iconDelete}
+              class={styles.iconDelete}
+              onClick={(e: MouseEvent) => {
+                e.stopPropagation();
+                emit('delete', props.item);
+              }}
+            />
+          )}
         </div>
         <div class={styles['train-footer']}>
           <div class={styles.trainInfo}>

+ 1 - 0
src/views/classList/modals/classTrainingDetails.tsx

@@ -154,6 +154,7 @@ export default defineComponent({
                     style={{ marginBottom: '20px' }}
                     isDisabled={true}
                     isDelete={false}
+                    isLarge
                     isCLassWork={true}
                     item={item}></TrainType>
                 )

+ 14 - 6
src/views/home/components/trainData.tsx

@@ -144,14 +144,22 @@ export default defineComponent({
     };
     const gotoWorkDetail = (row: any) => {
       console.log(row);
+      // router.push({
+      //   path: '/afterWorkDetail',
+      //   query: {
+      //     ...route.query,
+      //     teacherName: row.teacherName,
+      //     trainingId: row.id,
+      //     id: row.classGroupId,
+      //     name: row.classGroupName
+      //   }
+      // });
+
       router.push({
-        path: '/afterWorkDetail',
+        path: '/homework-record-detail',
         query: {
-          ...route.query,
-          teacherName: row.teacherName,
-          trainingId: row.id,
-          id: row.classGroupId,
-          name: row.classGroupName
+          id: row.id,
+          name: row.name
         }
       });
     };

+ 11 - 1
src/views/prepare-lessons/components/lesson-main/train/assign-student/index.tsx

@@ -168,6 +168,12 @@ export default defineComponent({
       const index = state.checkboxIds.findIndex((id: any) => id === item.id);
       if (index !== -1) {
         state.checkboxIds.splice(index, 1);
+        const sIndex = state.selectStudents.findIndex(
+          (select: any) => select.id === item.id
+        );
+        if (sIndex !== -1) {
+          state.selectStudents.splice(sIndex, 1);
+        }
         onCheckStudents();
       }
     };
@@ -256,6 +262,7 @@ export default defineComponent({
                     state.checkboxIds = ids;
                   } else {
                     state.checkboxIds = [];
+                    state.selectStudents = [];
                     state.indeterminate = false;
                   }
                   onCheckStudents();
@@ -284,7 +291,10 @@ export default defineComponent({
             <NSpin show={state.loading} class={styles.loadingSection}>
               <NCheckboxGroup
                 v-model:value={state.checkboxIds}
-                onUpdate:value={onCheckStudents}>
+                onUpdate:value={() => {
+                  state.selectStudents = [];
+                  onCheckStudents();
+                }}>
                 {state.tableList.map((item: any) => (
                   <NCheckbox value={item.id} class={[styles.studentItem]}>
                     <div class={styles.studentInfo}>