lex-xin hai 1 día
pai
achega
fedfad0c08

+ 4 - 1
src/components/TheSearch/index.tsx

@@ -25,7 +25,7 @@ export default defineComponent({
       default: ''
     }
   },
-  emits: ['search'],
+  emits: ['search', 'update:value'],
   setup(props, { emit }) {
     const searchData = reactive({
       value: props.value || ''
@@ -45,6 +45,9 @@ export default defineComponent({
         placeholder={props.placeholder}
         clearable
         v-model:value={searchData.value}
+        onUpdate:value={(val: string) => {
+          emit("update:value", val)
+        }}
         onClear={() => emit('search', '')}
         onKeyup={(e: KeyboardEvent) => {
           e.stopPropagation();

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

@@ -446,7 +446,6 @@ export default defineComponent({
         subdEl.style.transition = '';
         initBoxRectInfo(subdEl, boxBoundaryInfo);
         initBoundaryWrap(subdEl, boxBoundaryInfo);
-        console.log('resize');
         subdEl.style.display = 'block';
       }, 100);
     };

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

@@ -224,7 +224,6 @@ export default defineComponent({
         const width = data.steps[data.step].eleRectPadding?.width || 0;
         const height = data.steps[data.step].eleRectPadding?.height || 0;
 
-        console.log(eleRect, height);
         data.box = {
           left: eleRect.x - left + 'px',
           top: eleRect.y - top + 'px',

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

@@ -91,7 +91,6 @@ export default defineComponent({
       const ele: HTMLElement = document.getElementById(`lessons-${data.step}`)!;
       if (ele) {
         const eleRect = ele.getBoundingClientRect();
-        console.log(ele, eleRect, 'eleRect');
 
         const left = data.steps[data.step].eleRectPadding?.left || 0;
         const top = data.steps[data.step].eleRectPadding?.top || 0;

+ 4 - 1
src/router/router-guards.ts

@@ -98,7 +98,10 @@ export function createRouterGuards(router: Router) {
       return;
     }
 
-    await userStore.getInfo();
+    if(!userStore.getNickname) {
+      await userStore.getInfo();
+    }
+    
 
     // const redirectPath = (from.query.redirect || to.path) as string;
     // const redirect = decodeURIComponent(redirectPath);

+ 5 - 1
src/views/content-information/content-instrument/components/list/search-group-resources.tsx

@@ -22,7 +22,7 @@ export default defineComponent({
       default: ''
     }
   },
-  emits: ['search', 'add'],
+  emits: ['search', 'add', 'update:searchValue'],
   expose: ['init'],
   setup(props, { emit }) {
     // const catchStore = useCatchStore();
@@ -82,6 +82,10 @@ export default defineComponent({
           <TheSearch
             class={styles.inputSearch}
             value={props.searchValue}
+            onUpdate:value={(val: string) => {
+              forms.keyword = val
+              emit("update:searchValue", val)
+            }}
             placeholder="请输入乐器名称"
             round
             onSearch={(val: string) => {

+ 3 - 0
src/views/content-information/content-music/components/list/index.tsx

@@ -102,6 +102,9 @@ export default defineComponent({
           wikiCategoryId={state.searchGroup.wikiCategoryId}
           defaultWikiCategoryId={props.categoryId}
           searchValue={state.searchGroup.keyword}
+          onUpdate:searchValue={(val: string) => {
+            state.searchGroup.keyword = val
+          }}
           onSearch={(item: any) => onSearch(item)}
         />
 

+ 6 - 2
src/views/content-information/content-music/components/list/search-group-resources.tsx

@@ -23,7 +23,7 @@ export default defineComponent({
       default: ''
     }
   },
-  emits: ['search', 'add'],
+  emits: ['search', 'add', 'update:searchValue'],
   expose: ['init'],
   setup(props, { emit }) {
     // const catchStore = useCatchStore();
@@ -95,7 +95,7 @@ export default defineComponent({
               childrenList: []
             },
             ...temps
-          ] || []
+          ]
         );
       }
       return [];
@@ -183,6 +183,10 @@ export default defineComponent({
           <TheSearch
             class={styles.inputSearch}
             value={props.searchValue}
+            onUpdate:value={(val:string) => {
+              forms.keyword = val
+              emit("update:searchValue", val)
+            }}
             placeholder="请输入曲目名称"
             round
             onSearch={(val: string) => {

+ 5 - 1
src/views/content-information/content-musician/components/list/search-group-resources.tsx

@@ -22,7 +22,7 @@ export default defineComponent({
       default: ''
     }
   },
-  emits: ['search', 'add'],
+  emits: ['search', 'add', 'update:searchValue'],
   expose: ['init'],
   setup(props, { emit }) {
     // const catchStore = useCatchStore();
@@ -85,6 +85,10 @@ export default defineComponent({
           <TheSearch
             class={styles.inputSearch}
             value={props.searchValue}
+            onUpdate:value={(val: string) => {
+              forms.keyword = val
+              emit("update:searchValue", val)
+            }}
             placeholder="请输入音乐家名称"
             round
             onSearch={(val: string) => {

+ 4 - 0
src/views/natural-resources/components/my-collect/search-group-resources.tsx

@@ -314,6 +314,10 @@ export default defineComponent({
           <TheSearch
             class={styles.inputSearch}
             round
+            value={forms.name}
+            onUpdate:value={(val: string) => {
+              forms.name = val
+            }}
             onSearch={(val: string) => {
               forms.name = val;
               onSearch();

+ 4 - 0
src/views/natural-resources/components/my-resources/search-group-resources.tsx

@@ -271,6 +271,10 @@ export default defineComponent({
 
           <TheSearch
             class={styles.inputSearch}
+            value={forms.name}
+            onUpdate:value={(val: string) => {
+              forms.name = val
+            }}
             round
             onSearch={(val: string) => {
               forms.name = val;

+ 4 - 0
src/views/natural-resources/components/share-resources/search-group-resources.tsx

@@ -449,6 +449,10 @@ export default defineComponent({
           <TheSearch
             class={styles.inputSearch}
             round
+            value={forms.name}
+            onUpdate:value={(val: string) => {
+              forms.name = val
+            }}
             onSearch={(val: string) => {
               forms.name = val;
               onSearch();

+ 9 - 7
src/views/prepare-lessons/components/lesson-main/courseware/addCourseware.tsx

@@ -84,6 +84,7 @@ export default defineComponent({
         }
       ] as any,
       loadingStatus: false,
+      dragLoadingStatus: false, // 拖动时
       showAttendClass: false,
       attendClassType: 'change', //
       removeIds: [] as any, // 临时删除的编号
@@ -431,6 +432,7 @@ export default defineComponent({
     // 拖拽添加数据
     const addDragCoursewareItem = async (item: any, newIndex: number) => {
       clearTimeout(timer);
+      forms.dragLoadingStatus = true;
       const materialList: any[] = [];
       try {
         const { data } = await api_materialDetail(item.materialId);
@@ -455,7 +457,6 @@ export default defineComponent({
       } catch {
         //
       }
-
       nextTick(() => {
         const array: any = forms.coursewareList[item.index || 0].list || [];
         array[newIndex] = item;
@@ -463,7 +464,6 @@ export default defineComponent({
           array.splice(newIndex + 1, 0, m);
         });
         forms.coursewareList[item.index || 0].list = array;
-
         if(item.isError) {
           message.error('您添加的资源与适用乐器不符')
         }
@@ -472,6 +472,8 @@ export default defineComponent({
           // 内容有更新 - 相关资源会刷新
           eventGlobal.emit('onCoursewareUpdate');
         }, 100);
+
+        forms.dragLoadingStatus = false;
       });
     };
 
@@ -889,8 +891,9 @@ export default defineComponent({
                     group="description"
                     scroll={true}
                     animation={200}
-                    onAdd={(evt: any) => {
-                      // console.log(
+                    onAdd={async (evt: any) => {
+                      // 锁
+                      if(forms.dragLoadingStatus) return
                       const list = forms.coursewareList[index].list;
                       const dropItem = list[evt.newDraggableIndex];
                       if (dropItem.sourceForm === 'resource-item') {
@@ -900,8 +903,8 @@ export default defineComponent({
                           eventGlobal.emit('checkCoursewareForm', 'subject')
                           return
                         }
-
-                        addDragCoursewareItem(
+                        
+                        await addDragCoursewareItem(
                           {
                             materialId: dropItem.id,
                             coverImg: dropItem.coverImg,
@@ -1075,7 +1078,6 @@ export default defineComponent({
                     index: select
                   });
                 });
-                console.log(forms.addCoursewareItem, '----', forms.subjects)
                 forms.addCoursewareVisiable = false;
 
                 checkCurrentInstrumentTip(forms.addCoursewareItem.isError)

+ 12 - 0
src/views/xiaoku-list/detail.tsx

@@ -295,6 +295,18 @@ export default defineComponent({
                   placeholder="请输入曲目名称"
                   round
                   value={searchValue.value}
+                  onUpdate:value={(val: string) => {
+                    // 重置搜索条件
+                    if (state.tabName === 'RECOMMEND') {
+                     state.recommendSearch.name = val
+                    } else if (state.tabName === 'HOT') {
+                     state.hotSearch.name = val
+                    } else if (state.tabName === 'NEW') {
+                     state.newSearch.name = val
+                    } else {
+                     state.allSearch.name = val
+                    }
+                  }}
                   class={styles.inputSearch}
                   onSearch={val => {
                     if (state.tabName === 'RECOMMEND') {

+ 6 - 0
src/views/xiaoku-list/index.tsx

@@ -265,6 +265,7 @@ export default defineComponent({
                     scrollable
                     onUpdate:value={() => {
                       state.instrumentId = data.tagIndex;
+                      state.isSearch = state.keyword ? true : false
                       if (state.isSearch) {
                         onSearch();
                       } else {
@@ -295,6 +296,7 @@ export default defineComponent({
                     onClick={() => {
                       data.tagIndex = item.value || 0;
                       state.instrumentId = item.value;
+                      state.isSearch = state.keyword ? true : false
                       if (state.isSearch) {
                         onSearch();
                       } else {
@@ -311,6 +313,10 @@ export default defineComponent({
             round
             class={styles.searchInput}
             placeholder="请输入曲目名称"
+            value={state.keyword}
+            onUpdate:value={(val: string) => {
+              state.keyword = val
+            }}
             onSearch={val => {
               if (val && val.trim()) {
                 state.keyword = val.trim();

+ 14 - 0
src/views/xiaoku-music/component/play-item/index.module.less

@@ -11,6 +11,12 @@
   box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1);
   z-index: 10;
   transition: all .3s;
+  // transform: translateY(100%);
+  display: none;
+  &.item {
+     opacity: 0;
+     display: none;
+  }
 
   &.previewcontainer {
     left: 0;
@@ -30,6 +36,14 @@
      display: none;
   }
 }
+.show {
+  transform: translateY(0);
+  display: flex;
+  &.item {
+    opacity: 1;
+    display: block;
+  }
+}
 
 .item {
   position: relative;