mo 1 rok pred
rodič
commit
22d8ce3029

+ 36 - 1
src/components/layout/index.tsx

@@ -1,4 +1,4 @@
-import { Transition, defineComponent, onMounted, ref, reactive } from 'vue';
+import { Transition, defineComponent, onMounted, ref, reactive,onUnmounted } from 'vue';
 import LayoutSilder from './layoutSilder';
 import LayoutTop from './layoutTop';
 import styles from './index.module.less';
@@ -327,7 +327,42 @@ export default defineComponent({
       // initBoxRectInfo(classEl, classBoundaryInfo);
       initBoundaryWrap(subdEl, boxBoundaryInfo);
       // initBoundaryWrap(classEl, classBoundaryInfo);
+      window.addEventListener("resize", resetSize);
     });
+
+    const resetSize = ()=>{
+      const subdEl = document.getElementById(`moveNPopover`) as HTMLDivElement;
+      subdEl.style.display = 'none'
+      // const boxBoundaryInfo = reactive({
+      //   isBoundary: true,
+      //   isBoundaryType: 'right' as any,
+      //   mainWidth: '' as any,
+      //   mainHeight: '' as any,
+      //   subWidth: '' as any,
+      //   subHeight: '' as any
+      // });
+
+
+        // boxBoundaryInfo.isBoundary = true;
+        // boxBoundaryInfo.isBoundaryType= 'right'
+
+        setTimeout(()=>{
+
+          subdEl.style.transition = ''
+          initBoxRectInfo(subdEl, boxBoundaryInfo);
+          initBoundaryWrap(subdEl, boxBoundaryInfo);
+          console.log('resize')
+          subdEl.style.display = 'block'
+        },100)
+
+
+
+
+
+    }
+    onUnmounted(()=>{
+      window.removeEventListener("resize", resetSize);
+    })
     const initBoundaryWrap = (target: any, wrapInfo: any) => {
       target.addEventListener('mouseenter', () => {
         if (wrapInfo.isBoundary) {

+ 5 - 1
src/custom-plugins/guide-page/attent-guide.tsx

@@ -138,7 +138,11 @@ export default defineComponent({
     const getAllGuidance = async()=>{
       try{
         const res = await getGuidance({guideTag:'teacher-guideInfo'})
-        guideInfo.value = JSON.parse(res.data?.guideValue)
+        if(res.data){
+          guideInfo.value = JSON.parse(res.data?.guideValue) || null
+        }else{
+          guideInfo.value = {}
+        }
         if (guideInfo.value &&guideInfo.value.attentGuide) {
           tipShow.value = false;
         } else {

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

@@ -101,7 +101,11 @@ export default defineComponent({
     const getAllGuidance = async()=>{
       try{
         const res = await getGuidance({guideTag:'teacher-guideInfo'})
-        guideInfo.value = JSON.parse(res.data?.guideValue)
+        if(res.data){
+          guideInfo.value = JSON.parse(res.data?.guideValue) || null
+        }else{
+          guideInfo.value = {}
+        }
         if (guideInfo.value && guideInfo.value.classGuide) {
           tipShow.value = false;
         } else {

+ 5 - 1
src/custom-plugins/guide-page/data-guide.tsx

@@ -112,7 +112,11 @@ export default defineComponent({
     const getAllGuidance = async()=>{
       try{
         const res = await getGuidance({guideTag:'teacher-guideInfo'})
-        guideInfo.value = JSON.parse(res.data?.guideValue)
+        if(res.data){
+          guideInfo.value = JSON.parse(res.data?.guideValue) || null
+        }else{
+          guideInfo.value = {}
+        }
         if (guideInfo.value && guideInfo.value.dataGuide) {
           tipShow.value = false;
         } else {

+ 7 - 1
src/custom-plugins/guide-page/home-guide.tsx

@@ -178,7 +178,13 @@ export default defineComponent({
     const getAllGuidance = async()=>{
       try{
         const res = await getGuidance({guideTag:'teacher-guideInfo'})
-        guideInfo.value = JSON.parse(res.data?.guideValue)
+        if(res.data){
+          guideInfo.value = JSON.parse(res.data?.guideValue) || null
+        }else{
+          guideInfo.value = {}
+        }
+
+
         if (guideInfo.value && guideInfo.value.homeGuide) {
           tipShow.value = false;
         } else {

+ 5 - 1
src/custom-plugins/guide-page/lessons-guide.tsx

@@ -150,7 +150,11 @@ export default defineComponent({
     const getAllGuidance = async()=>{
       try{
         const res = await getGuidance({guideTag:'teacher-guideInfo'})
-        guideInfo.value = JSON.parse(res.data?.guideValue)
+        if(res.data){
+          guideInfo.value = JSON.parse(res.data?.guideValue) || null
+        }else{
+          guideInfo.value = {}
+        }
         if (guideInfo.value && guideInfo.value.lessonsGuide) {
           tipShow.value = false;
         } else {

+ 5 - 1
src/custom-plugins/guide-page/music-guide.tsx

@@ -107,7 +107,11 @@ export default defineComponent({
     const getAllGuidance = async()=>{
       try{
         const res = await getGuidance({guideTag:'teacher-guideInfo'})
-        guideInfo.value = JSON.parse(res.data?.guideValue)
+        if(res.data){
+          guideInfo.value = JSON.parse(res.data?.guideValue) || null
+        }else{
+          guideInfo.value = {}
+        }
         if (guideInfo.value && guideInfo.value.musicGuide) {
           tipShow.value = false;
         } else {

+ 5 - 1
src/custom-plugins/guide-page/myColloge-guide.tsx

@@ -59,7 +59,11 @@ export default defineComponent({
     const getAllGuidance = async()=>{
       try{
         const res = await getGuidance({guideTag:'teacher-guideInfo'})
-        guideInfo.value = JSON.parse(res.data?.guideValue)
+        if(res.data){
+          guideInfo.value = JSON.parse(res.data?.guideValue) || null
+        }else{
+          guideInfo.value = {}
+        }
         if (guideInfo.value && guideInfo.value.myColloge) {
           tipShow.value = false;
         } else {

+ 5 - 1
src/custom-plugins/guide-page/myResources-guide.tsx

@@ -64,7 +64,11 @@ export default defineComponent({
     const getAllGuidance = async()=>{
       try{
         const res = await getGuidance({guideTag:'teacher-guideInfo'})
-        guideInfo.value = JSON.parse(res.data?.guideValue)
+        if(res.data){
+          guideInfo.value = JSON.parse(res.data?.guideValue) || null
+        }else{
+          guideInfo.value = {}
+        }
         if (guideInfo.value && guideInfo.value.myResourcesGuide) {
           tipShow.value = false;
         } else {

+ 5 - 1
src/custom-plugins/guide-page/shareResources-guide.tsx

@@ -88,7 +88,11 @@ export default defineComponent({
     const getAllGuidance = async()=>{
       try{
         const res = await getGuidance({guideTag:'teacher-guideInfo'})
-        guideInfo.value = JSON.parse(res.data?.guideValue)
+        if(res.data){
+          guideInfo.value = JSON.parse(res.data?.guideValue) || null
+        }else{
+          guideInfo.value = {}
+        }
         if (guideInfo.value && guideInfo.value.shareResourcesGuide) {
           tipShow.value = false;
         } else {

+ 5 - 1
src/custom-plugins/guide-page/student-guide.tsx

@@ -84,7 +84,11 @@ export default defineComponent({
     const getAllGuidance = async()=>{
       try{
         const res = await getGuidance({guideTag:'teacher-guideInfo'})
-        guideInfo.value = JSON.parse(res.data?.guideValue)
+        if(res.data){
+          guideInfo.value = JSON.parse(res.data?.guideValue) || null
+        }else{
+          guideInfo.value = {}
+        }
         if (guideInfo.value && guideInfo.value.studentGuide) {
           tipShow.value = false;
         } else {

+ 5 - 1
src/custom-plugins/guide-page/teacher-guide.tsx

@@ -93,7 +93,11 @@ export default defineComponent({
     const getAllGuidance = async()=>{
       try{
         const res = await getGuidance({guideTag:'teacher-guideInfo'})
-        guideInfo.value = JSON.parse(res.data?.guideValue)
+        if(res.data){
+          guideInfo.value = JSON.parse(res.data?.guideValue) || null
+        }else{
+          guideInfo.value = {}
+        }
         if (guideInfo.value && guideInfo.value.teacherGuide) {
           tipShow.value = false;
         } else {

+ 5 - 1
src/custom-plugins/guide-page/train-guide.tsx

@@ -61,7 +61,11 @@ export default defineComponent({
     const getAllGuidance = async()=>{
       try{
         const res = await getGuidance({guideTag:'teacher-guideInfo'})
-        guideInfo.value = JSON.parse(res.data?.guideValue)
+        if(res.data){
+          guideInfo.value = JSON.parse(res.data?.guideValue) || null
+        }else{
+          guideInfo.value = {}
+        }
         if (guideInfo.value && guideInfo.value.trainGuide) {
           tipShow.value = false;
         } else {