黄琪勇 1 anno fa
parent
commit
51f3d994d5

+ 6 - 4
src/components/card-preview/index.module.less

@@ -18,10 +18,12 @@
     }
   }
 }
-.dragbom{
-  position: absolute;
-  left: 0;
-  bottom: 0;
+:global{
+  .cardPreviewBoxClass_drag .bom_drag{
+    position: absolute;
+    left: 0;
+    bottom: 0;
+  }
 }
 .maxCard {
   width: 1200px;

+ 1 - 1
src/components/card-preview/index.tsx

@@ -188,7 +188,7 @@ export default defineComponent({
             'MUSIC_WIKI',
             'LISTEN'
           ].includes(item.value.type) && <TheEmpty />}
-          {props.from === 'class' && <Dragbom class={styles.dragbom}></Dragbom>}
+          {props.from === 'class' && <Dragbom></Dragbom>}
         </NModal>
       </>
     );

+ 16 - 6
src/views/attend-class/index.module.less

@@ -526,11 +526,6 @@
     }
   }
 }
-.dragbom{
-  position: absolute;
-  bottom: 0;
-  left: 0;
-}
 .removeVisiable {
   width: 432px;
   position: relative;
@@ -771,8 +766,23 @@
 
 .workVisiable {
   width: 1200px;
+  :global {
+    .bom_drag{
+      position: absolute;
+      bottom: 0;
+      left: 0;
+    }
+  }
+}
+:global{
+  .metronomeConBoxClass_drag,.timerMeterConBoxClass_drag{
+    .bom_drag{
+      position: absolute;
+      bottom: 0;
+      left: 0;
+    }
+  }
 }
-
 .workContainer {
   display: flex;
   align-items: center;

+ 4 - 4
src/views/attend-class/index.tsx

@@ -2159,7 +2159,7 @@ export default defineComponent({
               </NButton>
             </NSpace>
           </div>
-          <Dragbom class={styles.dragbom}></Dragbom>
+          <Dragbom></Dragbom>
         </NModal>
 
         {/* 训练设置 */}
@@ -2212,7 +2212,7 @@ export default defineComponent({
               <ResourceMain from={'class'} cardType="homerowk-record" />
             </div>
           </div>
-          <Dragbom class={styles.dragbom}></Dragbom>
+          <Dragbom></Dragbom>
         </NModal>
 
         <NModal
@@ -2235,7 +2235,7 @@ export default defineComponent({
                 iframeDislableKeyboard(val.target);
               }}
               height={'650px'}></iframe>
-            <Dragbom class={styles.dragbom}></Dragbom>
+            <Dragbom></Dragbom>
           </div>
         </NModal>
 
@@ -2262,7 +2262,7 @@ export default defineComponent({
           }}>
           <div>
             <TimerMeter></TimerMeter>
-            <Dragbom class={styles.dragbom}></Dragbom>
+            <Dragbom></Dragbom>
           </div>
         </NModal>
 

+ 44 - 3
src/views/prepare-lessons/components/lesson-main/train/assign-homework.tsx

@@ -1,4 +1,11 @@
-import { PropType, defineComponent, onMounted, reactive, ref } from 'vue';
+import {
+  PropType,
+  defineComponent,
+  onMounted,
+  reactive,
+  ref,
+  toRef
+} from 'vue';
 import styles from './index.module.less';
 import {
   NButton,
@@ -21,6 +28,9 @@ import { usePrepareStore } from '/src/store/modules/prepareLessons';
 import AssignStudent from './assign-student';
 import { state } from '/src/state';
 import { nextTick } from 'process';
+import useDrag from '@/hooks/useDrag';
+import Dragbom from '@/hooks/useDrag/dragbom';
+import { useUserStore } from '@/store/modules/users';
 
 export default defineComponent({
   name: 'assign-homework',
@@ -50,6 +60,11 @@ export default defineComponent({
     homeworkType: {
       type: String as PropType<'CLASSWORK' | 'HOMEWORK'>,
       default: 'CLASSWORK'
+    },
+    from: {
+      // 来自哪里
+      type: String,
+      default: ''
     }
   },
   emits: ['close', 'confirm'],
@@ -181,6 +196,22 @@ export default defineComponent({
     onMounted(async () => {
       await getClassGroupList();
     });
+    // 选择学生
+    let assignHomeworkStuBoxDragData: any;
+    let assignHomeworkStuBoxClass: string;
+    if (props.from === 'class') {
+      const users = useUserStore();
+      assignHomeworkStuBoxClass = 'assignHomeworkStuBoxClass_drag';
+      assignHomeworkStuBoxDragData = useDrag(
+        [
+          `${assignHomeworkStuBoxClass}>.n-card-header`,
+          `${assignHomeworkStuBoxClass} .bom_drag`
+        ],
+        assignHomeworkStuBoxClass,
+        toRef(forms, 'workVisiable'),
+        users.info.id
+      );
+    }
     return () => (
       <div class={styles.assignHomeworkContainer}>
         <NForm
@@ -363,11 +394,20 @@ export default defineComponent({
 
         <NModal
           v-model:show={forms.workVisiable}
+          style={
+            props.from === 'class'
+              ? {
+                  width: '640px',
+                  ...assignHomeworkStuBoxDragData.styleDrag.value
+                }
+              : {
+                  width: '640px'
+                }
+          }
           preset="card"
           showIcon={false}
-          class={['modalTitle background']}
+          class={['modalTitle background', assignHomeworkStuBoxClass]}
           title={'选择学生'}
-          style={{ width: '640px' }}
           blockScroll={false}>
           <AssignStudent
             classGroupId={props.classGroupId}
@@ -381,6 +421,7 @@ export default defineComponent({
               forms.workVisiable = false;
             }}
           />
+          {props.from === 'class' && <Dragbom></Dragbom>}
         </NModal>
       </div>
     );

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

@@ -207,7 +207,7 @@ export default defineComponent({
       });
     });
     return () => (
-      <div class={styles.assignStudent}>
+      <div class={[styles.assignStudent, 'assignStudent']}>
         <div class={styles.studentListGroup}>
           <div class={styles.searchSection}>
             <div class={styles.searchSpace}>

+ 15 - 4
src/views/prepare-lessons/components/lesson-main/train/index.module.less

@@ -57,10 +57,21 @@
     }
   }
 }
-.dragbom{
-  position: absolute;
-  bottom: 0;
-  left: 0;
+:global{
+  .assignHomeworkStuBoxClass_drag{
+    .assignStudent{
+      >div{
+        padding-bottom: 10px;
+      }
+    }
+  }
+  .assignHomeworkStuBoxClass_drag,.workSetingBoxClass_drag,.workClearBoxClass_drag,.workSaveBoxClass_drag,.workArrangeImmediatelyBoxClass_drag{
+    .bom_drag{
+      position: absolute;
+      left: 0;
+      bottom: 0;
+    }
+  }
 }
 .tipsContainer {
   display: flex;

+ 5 - 4
src/views/prepare-lessons/components/lesson-main/train/index.tsx

@@ -562,7 +562,7 @@ export default defineComponent({
               prepareStore.setTrainList(forms.trainList);
             }}
           />
-          {props.from === 'class' && <Dragbom class={styles.dragbom}></Dragbom>}
+          {props.from === 'class' && <Dragbom></Dragbom>}
         </NModal>
 
         {/* 添加自定义教材 */}
@@ -583,6 +583,7 @@ export default defineComponent({
           title={'布置作业'}
           blockScroll={false}>
           <AssignHomework
+            from={props.from}
             classGroupId={props.classGroupId}
             courseScheduleId={props.courseScheduleId}
             chapterLessonCoursewareId={props.lessonPreTraining.chapterId}
@@ -601,7 +602,7 @@ export default defineComponent({
               }
             }}
           />
-          {props.from === 'class' && <Dragbom class={styles.dragbom}></Dragbom>}
+          {props.from === 'class' && <Dragbom></Dragbom>}
         </NModal>
 
         {/* {showGuide.value ? <Trainguide></Trainguide> : null} */}
@@ -639,7 +640,7 @@ export default defineComponent({
               </NButton>
             </NSpace>
           </div>
-          {props.from === 'class' && <Dragbom class={styles.dragbom}></Dragbom>}
+          {props.from === 'class' && <Dragbom></Dragbom>}
         </NModal>
 
         <NModal
@@ -657,7 +658,7 @@ export default defineComponent({
             onClose={() => (forms.preSaveVisiable = false)}
             onConfirm={() => onPreSave()}
           />
-          {props.from === 'class' && <Dragbom class={styles.dragbom}></Dragbom>}
+          {props.from === 'class' && <Dragbom></Dragbom>}
         </NModal>
       </div>
     );

+ 7 - 4
src/views/prepare-lessons/components/resource-main/components/select-music/index.module.less

@@ -39,8 +39,11 @@
 .trainEditModal {
   width: 494px;
 }
-.dragbom{
-  position: absolute;
-  bottom: 0;
-  left: 0;
+
+:global{
+  .workSetingBoxClass_drag .bom_drag{
+    position: absolute;
+    left: 0;
+    bottom: 0;
+  }
 }

+ 1 - 1
src/views/prepare-lessons/components/resource-main/components/select-music/index.tsx

@@ -347,7 +347,7 @@ export default defineComponent({
               eventGlobal.emit('onTrainAddItem', train);
             }}
           />
-          {props.from === 'class' && <Dragbom class={styles.dragbom}></Dragbom>}
+          {props.from === 'class' && <Dragbom></Dragbom>}
         </NModal>
       </div>
     );

+ 8 - 4
src/views/prepare-lessons/components/resource-main/index.module.less

@@ -78,10 +78,14 @@
   }
 
 }
-.dragbom{
-  position: absolute;
-  bottom: 0;
-  left: 0;
+:global{
+  .workSetingBoxClass_drag,.selectResourceStatusAddBoxClass_drag{
+    .bom_drag{
+      position: absolute;
+      left: 0;
+      bottom: 0;
+    }
+  }
 }
 .selectMusicModal {
   position: relative;

+ 2 - 2
src/views/prepare-lessons/components/resource-main/index.tsx

@@ -284,7 +284,7 @@ export default defineComponent({
             from={props.from}
             onAdd={(item: any) => onAdd(item)}
           />
-          {props.from === 'class' && <Dragbom class={styles.dragbom}></Dragbom>}
+          {props.from === 'class' && <Dragbom></Dragbom>}
         </NModal>
         <NModal
           style={
@@ -315,7 +315,7 @@ export default defineComponent({
               eventGlobal.emit('onTrainAddItem', train);
             }}
           />
-          {props.from === 'class' && <Dragbom class={styles.dragbom}></Dragbom>}
+          {props.from === 'class' && <Dragbom></Dragbom>}
         </NModal>
       </div>
     );