Procházet zdrojové kódy

没有功能引导的页面小工具不要功能引导按钮

lex před 1 rokem
rodič
revize
70d0842e4a

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

@@ -5,7 +5,8 @@ import {
   ref,
   reactive,
   onUnmounted,
-  watch
+  watch,
+  computed
 } from 'vue';
 import LayoutSilder from './layoutSilder';
 import LayoutTop from './layoutTop';
@@ -347,6 +348,27 @@ export default defineComponent({
         }
       }
     );
+
+    // 帮助指引状态
+    const helpNoteList = reactive({
+      baseListTab: ''
+    });
+    const helpNoteStatus = computed(() => {
+      const routePath = route.path;
+      const hidePath = [
+        '/classDetail',
+        '/classStudentDetail',
+        '/notation',
+        '/xiaoku-ai'
+      ];
+      // 单独判断个人信息页面[学校设置]有引导
+      if (route.path === '/setting') {
+        return helpNoteList.baseListTab === 'school' ? true : false;
+      } else {
+        return hidePath.includes(routePath) ? false : true;
+      }
+    });
+
     onMounted(() => {
       initMoveable();
       // // initMoveableClass();
@@ -360,6 +382,10 @@ export default defineComponent({
       initBoxRectInfo(subdEl, boxBoundaryInfo);
       // // initBoundaryWrap(classEl, classBoundaryInfo);
       window.addEventListener('resize', resetSize);
+
+      eventGlobal.on('base-setting-emit', (val: string) => {
+        helpNoteList.baseListTab = val;
+      });
     });
 
     const resetSize = () => {
@@ -674,12 +700,15 @@ export default defineComponent({
               </div>
             </div>
             <div>
-              <div
-                class={styles.booxToolItem}
-                onClick={() => startShowModal('iconNote')}>
-                <img src={iconNote} alt="" />
-                帮助指引
-              </div>
+              {helpNoteStatus.value && (
+                <div
+                  class={styles.booxToolItem}
+                  onClick={() => startShowModal('iconNote')}>
+                  <img src={iconNote} alt="" />
+                  帮助指引
+                </div>
+              )}
+
               <div
                 class={styles.booxToolItem}
                 onClick={() => startShowModal('iconPen')}>

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

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

+ 8 - 2
src/views/setting/index.tsx

@@ -5,6 +5,7 @@ import PersonInfo from './components/personInfo';
 import SchoolInfo from './components/schoolInfo/index';
 import { useUserStore } from '/src/store/modules/users';
 import { useRoute } from 'vue-router';
+import { eventGlobal } from '/src/utils';
 export default defineComponent({
   name: 'base-setting',
   setup(props, { emit, attrs }) {
@@ -13,11 +14,13 @@ export default defineComponent({
     const route = useRoute();
     if (route.query.activeTab) {
       activeTab.value = route.query.activeTab;
+      eventGlobal.emit('base-setting-emit', activeTab.value);
     }
     watch(
       () => route.query.activeTab,
       val => {
         activeTab.value = val;
+        eventGlobal.emit('base-setting-emit', val);
       }
     );
     return () => (
@@ -26,9 +29,12 @@ export default defineComponent({
           class={styles.customTabs}
           v-model:value={activeTab.value}
           size="large"
-          animated
+          // animated
           pane-wrapper-style="margin: 0 -4px"
-          pane-style="padding-left: 4px; padding-right: 4px; box-sizing: border-box;">
+          pane-style="padding-left: 4px; padding-right: 4px; box-sizing: border-box;"
+          onUpdate:value={(val: any) => {
+            eventGlobal.emit('base-setting-emit', val);
+          }}>
           <NTabPane name="person" tab="个人信息">
             <PersonInfo></PersonInfo>
           </NTabPane>