lex vor 1 Jahr
Ursprung
Commit
1e1b1dc140

+ 3 - 1
src/components/layout/imGroup.tsx

@@ -17,7 +17,9 @@ export default defineComponent({
       : /online.lexiaoya.cn/.test(location.href)
       ? 'https://kt.colexiu.com'
       : location.origin;
-    const src = `${origin}/classroom-im/?userID=${userStore.getUserInfo.imUserId}&Authorization=${userStore.getToken}`;
+    const src = `${origin}/classroom-im/?userID=${
+      userStore.getUserInfo.imUserId
+    }&Authorization=${userStore.getToken}&t=${+new Date()}`;
 
     return () => (
       <div class={styles.imGroupContainer}>

+ 0 - 1
src/custom-plugins/guide-page/class-guide.tsx

@@ -148,7 +148,6 @@ export default defineComponent({
     const onResetGuide = async (name: string) => {
       try {
         if (name !== 'classList') return;
-        console.log(name, 'name');
         if (!guideInfo.value) {
           guideInfo.value = { classGuide: false };
         } else {

+ 2 - 2
src/custom-plugins/guide-page/student-guide.tsx

@@ -130,9 +130,9 @@ export default defineComponent({
       try {
         if (name !== 'studentList') return;
         if (!guideInfo.value) {
-          guideInfo.value = { classGuide: false };
+          guideInfo.value = { studentGuide: false };
         } else {
-          guideInfo.value.classGuide = false;
+          guideInfo.value.studentGuide = false;
         }
         try {
           await setGuidance({

+ 1 - 1
src/views/attend-class/component/tools/pen.module.less

@@ -4,7 +4,7 @@
   right: 0;
   bottom: 0;
   top: 0;
-  z-index: 11;
+  z-index: 501;
 }
 
 .open {

+ 1 - 1
src/views/natural-resources/components/my-resources/index.tsx

@@ -295,7 +295,7 @@ export default defineComponent({
                   subjectIds: null,
                   openFlag: true,
                   coverImg: item.coverImg,
-                  name: null,
+                  title: item.name || '',
                   type: formatUrlType(item.content),
                   enableFlag: 1,
                   content: item.content,

+ 26 - 12
src/views/natural-resources/components/my-resources/save-modal/index.tsx

@@ -88,8 +88,15 @@ export default defineComponent({
         ? NaturalTypeEnum.IMG
         : file.type.includes('audio')
         ? NaturalTypeEnum.SONG
-        : NaturalTypeEnum.VIDEO;
+        : file.type.includes('video')
+        ? NaturalTypeEnum.VIDEO
+        : 'other';
 
+      console.log(type, 'type');
+      if (type === 'other') {
+        message.error(`文件格式不支持`);
+        return false;
+      }
       const size = type === 'IMG' ? 2 : type === 'SONG' ? 20 : 500;
       if (size) {
         isLt2M = file.file.size / 1024 / 1024 < size;
@@ -124,9 +131,7 @@ export default defineComponent({
         btnLoading.value = true;
         const name = file.file.name;
         const suffix = name.slice(name.lastIndexOf('.'));
-        const fileName = `${props.path}${
-          props.fileName || Date.now() + suffix
-        }`;
+        const fileName = `${props.path}${Date.now() + file.id + suffix}`;
         const obj = {
           filename: fileName,
           bucketName: props.bucketName,
@@ -166,7 +171,7 @@ export default defineComponent({
     };
 
     const onFinish = (options: any) => {
-      console.log(options, 'onFinish');
+      // console.log(options, 'onFinish');
       onFinishAfter(options);
     };
     const onFinishAfter = async (options: any) => {
@@ -193,14 +198,15 @@ export default defineComponent({
       uploadList.value.push({
         coverImg,
         content: url,
-        id: options.file.id
+        id: options.file.id,
+        name: options.file.name
+          ? options.file.name.slice(0, options.file.name.lastIndexOf('.'))
+          : ''
       });
 
       options.file.url = url;
       visiable.value = false;
       btnLoading.value = false;
-
-      console.log(fileListRef.value, 'fileListRef', uploadList.value);
     };
     const getVideoMsg = (file: any) => {
       return new Promise(resolve => {
@@ -216,7 +222,7 @@ export default defineComponent({
           canvas.height = height;
           canvas.getContext('2d').drawImage(videoElement, 0, 0, width, height); //绘制canvas
           // dataURL = canvas.toDataURL('image/jpeg'); //转换为base64
-          console.log(canvas);
+          // console.log(canvas);
           canvas.toBlob((blob: any) => {
             // console.log(blob);
             resolve(blob);
@@ -266,7 +272,6 @@ export default defineComponent({
     };
 
     const onRemove = async (file: any) => {
-      console.log(file, 'file');
       const index = uploadList.value.findIndex(
         (update: any) => update.id === file.file.id
       );
@@ -282,11 +287,20 @@ export default defineComponent({
           status = true;
         }
       });
-      return status;
+      return status || fileListRef.value.length <= 0;
     });
 
     const onSubmit = async () => {
-      emit('confrim', uploadList.value);
+      const list: any = [];
+      fileListRef.value.forEach((file: any) => {
+        const item = uploadList.value.find(
+          (child: any) => child.id === file.id
+        );
+        if (item) {
+          list.push(item);
+        }
+      });
+      emit('confrim', list);
     };
 
     return () => (