lex 1 年之前
父節點
當前提交
69ccebe56b

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

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

+ 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}>