lex 1 rok pred
rodič
commit
10b7b4b5a5

+ 22 - 19
src/views/notation/index.tsx

@@ -15,24 +15,26 @@ export default defineComponent({
     const Authorization = userStore.getToken || '';
     const iframeRef = ref();
     console.log(Authorization);
+    const notationOpenCreate = sessionStorage.getItem('notation-open-create');
+    const openCreateUrl = notationOpenCreate == '1' ? '&addShow=1' : '';
     const data = reactive({
       src: `${
         /(192|localhost)/.test(location.origin)
           ? // ?
-          // 'https://test.lexiaoya.cn'
-            'http://localhost:3050'
-          : location.origin
-      }/notation/#/create?Authorization=${Authorization}`
+            'https://test.lexiaoya.cn'
+          : // 'http://localhost:3050'
+            location.origin
+      }/notation/#/create?Authorization=${Authorization}${openCreateUrl}`
       //   src: `http://localhost:3050/#/create?Authorization=${Authorization}`
     });
-    const fscreen=()=> {
-      const el = document.documentElement as any
-        //进入全屏
-        (el.requestFullscreen && el.requestFullscreen()) ||
+    const fscreen = () => {
+      const el = document.documentElement as any;
+      //进入全屏
+      (el.requestFullscreen && el.requestFullscreen()) ||
         (el.mozRequestFullScreen && el.mozRequestFullScreen()) ||
         (el.webkitRequestFullscreen && el.webkitRequestFullscreen()) ||
-        (el.msRequestFullscreen && el.msRequestFullscreen())
-       }
+        (el.msRequestFullscreen && el.msRequestFullscreen());
+    };
     const handleOpen = (e: MessageEvent) => {
       console.log(e.data, 'data');
       if (e.data.api === 'notation_open') {
@@ -42,12 +44,12 @@ export default defineComponent({
           previewParams.value = {
             url: e.data.url
           };
-          fscreen()
+          fscreen();
         } else {
           window.open(e.data.url);
         }
       } else if (e.data.api === 'notation_exit') {
-        console.log('进来')
+        console.log('进来');
 
         removeVisiable.value = true;
       }
@@ -100,13 +102,14 @@ export default defineComponent({
                   );
                   if (state.application) {
                     document.exitFullscreen
-                    ? document.exitFullscreen()
-                    : document.mozCancelFullScreen
-                    ? document.mozCancelFullScreen()
-                    : document.webkitExitFullscreen
-                    ? document.webkitExitFullscreen()
-                    : ''
-                }}}>
+                      ? document.exitFullscreen()
+                      : document.mozCancelFullScreen
+                      ? document.mozCancelFullScreen()
+                      : document.webkitExitFullscreen
+                      ? document.webkitExitFullscreen()
+                      : '';
+                  }
+                }}>
                 确定
               </NButton>
               <NButton round onClick={() => (removeVisiable.value = false)}>

+ 20 - 5
src/views/prepare-lessons/components/lesson-main/courseware/index.tsx

@@ -456,10 +456,10 @@ export default defineComponent({
           <NSpin show={forms.loadingStatus}>
             <div
               class={[
-                styles.listSection,
-                !forms.loadingStatus && forms.coursewareList.length <= 0
-                  ? styles.emptySection
-                  : ''
+                styles.listSection
+                // !forms.loadingStatus && forms.coursewareList.length <= 0
+                //   ? styles.emptySection
+                //   : ''
               ]}>
               {forms.coursewareList.length > 0 && (
                 <>
@@ -541,8 +541,23 @@ export default defineComponent({
                 </>
               )}
 
-              {!forms.loadingStatus && forms.coursewareList.length <= 0 && (
+              {/* {!forms.loadingStatus && forms.coursewareList.length <= 0 && (
                 <TheEmpty description="暂无课件" />
+              )} */}
+              {forms.coursewareList.length <= 0 && (
+                <div class={styles.list}>
+                  <div
+                    class={[styles.itemContent, styles.addMusicItem, 'handle']}
+                    onClick={() => {
+                      // 直接跳转到制谱页面 (临时存储数据)
+                      sessionStorage.setItem('notation-open-create', '1');
+                      router.push('/notation');
+                    }}>
+                    <img src={iconAddMusic} />
+
+                    <p class={styles.addMusicName}>开始制谱</p>
+                  </div>
+                </div>
               )}
             </div>
           </NSpin>