lex-xin преди 9 месеца
родител
ревизия
970890fcb1

+ 17 - 0
src/views/attend-class/index.tsx

@@ -1360,10 +1360,25 @@ export default defineComponent({
       //   id: 6
       // }
     ];
+    const mirrorAddressCatch = (type: 'get' | 'set'  = 'get', value?: string): any => {
+      const localStorageName = 'mirrorAddressCatch';
+      
+      if(type === "get") {
+        const catchName = localStorage.getItem(localStorageName)
+        return catchName || null
+      } else if(type === "set") {
+        localStorage.setItem(localStorageName, value || '')
+      }
+    }
     // 默认收起菜单
     const columnShow = ref(true);
     // 菜单位置
     const columnPos = ref<'left' | 'right'>('left');
+
+    if(mirrorAddressCatch()) {
+      columnPos.value = mirrorAddressCatch()
+    }
+
     watch(columnPos, () => {
       for (let i = 0; i < data.itemList.length; i++) {
         const activeItem = data.itemList[i];
@@ -1995,6 +2010,7 @@ export default defineComponent({
                 onClick={() => {
                   columnPos.value = 'right';
                   columnShow.value = true;
+                  mirrorAddressCatch('set', 'right')
                 }}
               />
             ),
@@ -2062,6 +2078,7 @@ export default defineComponent({
                 onClick={() => {
                   columnPos.value = 'left';
                   columnShow.value = true;
+                  mirrorAddressCatch('set', 'left')
                 }}
               />
             ),

+ 1 - 1
src/views/natural-resources/model/add-teaching/index.module.less

@@ -67,7 +67,7 @@
     p {
       padding-top: 32px;
       font-size: 18px;
-      color: #9EADD9;
+      color: #7799C0;
       line-height: 25px;
     }
   }

+ 24 - 3
src/views/natural-resources/model/add-teaching/index.tsx

@@ -73,6 +73,7 @@ const initState = () => ({
   coverImg: '', // 封面
   instruemntIds: [] as any,
   enableFlag: true, // 状态
+  bookTypes: [], // 册别
   type: 'COURSEWARE', // 教材类型:COURSEWARE,THEORY,可用值:COURSEWARE,THEORY
   lessonList: [] as any // 单元列表
 });
@@ -107,9 +108,10 @@ export default defineComponent({
     const handleSubmit = async () => {
       data.uploading = true;
       try {
-        const { currentGradeNum, instrumentIds, ...more } = form;
+        const { currentGradeNum, bookTypes, instrumentIds, ...more } = form;
         await api_lessonCoursewareSave({
           currentGradeNum: currentGradeNum.join(','),
+          bookTypes: bookTypes.join(','),
           instrumentIds: instrumentIds.join(','),
           ...more
         });
@@ -136,6 +138,7 @@ export default defineComponent({
         form.currentGradeNum = data.currentGradeNum
           ? data.currentGradeNum.split(',').map((item: any) => Number(item))
           : null;
+        form.bookTypes = data.bookTypes ? data.bookTypes.split(',') : null
         form.instrumentIds = data.instrumentIds
           ? data.instrumentIds.split(',').map((item: any) => item)
           : null;
@@ -249,6 +252,24 @@ export default defineComponent({
                   />
                 </NFormItem>
                 <NFormItem
+                  path="bookTypes">
+                  <NSelect
+                    style={{ minWidth: '360px' }}
+                    placeholder="请选择册别(选填)"
+                    options={[{
+                      label: '上册',
+                      value: 'LAST'
+                    }, {
+                      label: '下册',
+                      value: 'NEXT'
+                    }]}
+                    v-model:value={form.bookTypes}
+                    clearable
+                    multiple
+                    filterable
+                  />
+                </NFormItem>
+                <NFormItem
                   path="instrumentIds"
                   style={{ width: '360px' }}
                   rule={{
@@ -297,7 +318,7 @@ export default defineComponent({
               目录
             </div>
             <TransitionGroup name="list" tag="div">
-              {form.lessonList.map((item, index) => {
+              {form.lessonList.map((item: any, index: number) => {
                 return (
                   <NSpace
                     class={styles.lessonItem}
@@ -321,7 +342,7 @@ export default defineComponent({
                         clearable></NInput>
                     </NFormItem>
                     <TransitionGroup name="list" tag="div">
-                      {item.knowledgeList.map((know, knowIndex) => {
+                      {item.knowledgeList.map((know: any, knowIndex: number) => {
                         return (
                           <NFormItem
                             style={{

+ 10 - 1
src/views/prepare-lessons/api.ts

@@ -289,9 +289,18 @@ export const api_teacherChapterLessonCoursewareDetail = (id: string) => {
 };
 
 /**
- *  @description: 后台 素材详情
+ *  @description: 素材详情
  * @param params
  */
 export const api_materialDetail = (id: string) => {
   return request.get('/edu-app/material/detail/' + id);
 };
+
+
+/**
+ *  @description: 老师查询教材分类
+ * @param params
+ */
+export const api_lessonCoursewareTeacherCategory = () => {
+  return request.get('/edu-app/lessonCourseware/teacherCategory');
+};

BIN
src/views/prepare-lessons/components/directory-main/images/icon-upload-bg.png


+ 105 - 20
src/views/prepare-lessons/components/directory-main/select-lessonware/index.module.less

@@ -1,13 +1,12 @@
 .attendClassSearch {
   width: 100%;
-  display: flex;
-  align-items: center;
-  gap: 0 24px;
+  // display: flex;
+  // align-items: center;
+  // gap: 0 24px;
   margin-bottom: 6px;
   padding: 32px 40px 0;
 
   :global {
-
     .n-base-selection,
     .n-input {
       height: 52px;
@@ -20,17 +19,58 @@
     .n-cascader {
       min-width: 240px;
     }
+
+    .n-form {
+      position: relative;
+    }
+
+    .n-form-item {
+      .n-form-item-label {
+        font-size: max(17px, 13px);
+        font-weight: 600;
+        color: #131415;
+        line-height: 24px;
+      }
+
+      .n-button {
+        height: 32px;
+        font-size: max(17px, 12px);
+        border-radius: 8px;
+        color: rgba(0, 0, 0, 0.6);
+      }
+
+      .n-button--primary-type {
+        color: #131415;
+        background-color: #d2ecff !important;
+      }
+    }
+
+    .n-form-item-feedback-wrapper {
+      min-height: 14px;
+    }
   }
 
   .iconSearch {
     width: 16px;
     height: 17px;
   }
+
+  .spaceSection {
+    width: 75%;
+    transition: 1s all ease-in;
+  
+    &>div {
+      height: 34Px !important;
+      display: flex !important;
+      align-items: center;
+      line-height: var(--n-blank-height);
+    }
+  }
 }
 
 .classList {
-  min-height: 60vh;
-  max-height: 60vh;
+  min-height: 70vh;
+  max-height: 70vh;
 
   .content {
     min-height: 60vh;
@@ -46,7 +86,7 @@
   position: relative;
   width: 214px;
   cursor: pointer;
-  transition: all .3s;
+  transition: all 0.3s;
 
   .cover {
     position: relative;
@@ -59,7 +99,7 @@
       left: 0;
       width: 214px;
       height: 214px;
-      background: #DDF2FF;
+      background: #ddf2ff;
       border-radius: 50%;
     }
   }
@@ -136,7 +176,7 @@
     width: 158px;
     height: 223px;
     margin: auto;
-    background-color: #EDEFF2;
+    background-color: #edeff2;
     background-image: url('../images/icon_default.svg');
     background-repeat: no-repeat;
     background-position: center center;
@@ -149,7 +189,7 @@
       right: -4px;
       width: 4px;
       height: calc(100% - 8px);
-      background-color: #C5C5C5;
+      background-color: #c5c5c5;
       z-index: 1;
     }
 
@@ -160,7 +200,7 @@
       right: -2px;
       width: 4px;
       height: calc(100% - 4px);
-      background-color: #E7E7E7;
+      background-color: #e7e7e7;
       z-index: 2;
     }
 
@@ -172,7 +212,18 @@
       height: 100%;
       z-index: 4;
       background-repeat: no-repeat;
-      background-image: linear-gradient(to right, rgba(0, 0, 0, 0.2) 0, rgba(255, 255, 255, 0.08) 0%, transparent 0.5%), linear-gradient(to right, rgba(0, 0, 0, 0.1) 0.3%, rgba(255, 255, 255, 0.09) 1.1%, transparent 1.3%);
+      background-image: linear-gradient(
+          to right,
+          rgba(0, 0, 0, 0.2) 0,
+          rgba(255, 255, 255, 0.08) 0%,
+          transparent 0.5%
+        ),
+        linear-gradient(
+          to right,
+          rgba(0, 0, 0, 0.1) 0.3%,
+          rgba(255, 255, 255, 0.09) 1.1%,
+          transparent 1.3%
+        );
       background-size: 50% 100%, 50% 100%;
       background-position: 0% top, 9% top;
     }
@@ -187,20 +238,18 @@
     }
 
     img {
-      transition: opacity .3s;
+      transition: opacity 0.3s;
       opacity: 0;
     }
 
-    img[data-loaded="true"] {
+    img[data-loaded='true'] {
       opacity: 1;
     }
-
-
   }
 
   .itemName {
     margin-top: 16px;
-    font-size: max(16px, 13Px);
+    font-size: max(16px, 13px);
     font-weight: 600;
     color: #131415;
     text-align: center;
@@ -216,7 +265,7 @@
 
   :global {
     .n-card-header {
-      font-size: max(22px, 16Px);
+      font-size: max(22px, 16px);
     }
   }
 
@@ -224,13 +273,13 @@
     padding: 20px 40px 0;
 
     p {
-      font-size: max(18px, 14Px);
+      font-size: max(18px, 14px);
       color: #777777;
       line-height: 30px;
       text-align: center;
 
       span {
-        color: #EA4132;
+        color: #ea4132;
       }
     }
   }
@@ -246,3 +295,39 @@
     }
   }
 }
+
+.textBtn {
+  background: #fff;
+  border-radius: 8px;
+  padding: 4px 20px;
+  font-size: max(17px, 12px);
+  color: rgba(0, 0, 0, 0.6);
+  cursor: pointer;
+  display: flex;
+  align-items: center;
+  font-weight: 500;
+  line-height: 24px;
+
+  .iconArrow {
+    display: inline-block;
+    margin-left: 8px;
+    width: 8px;
+    height: 5px;
+    background: url('../../../../content-information/images/icon-arrow2.png')
+      no-repeat center center / contain;
+    transform: rotate(180deg);
+  }
+
+  &:hover,
+  &.textBtnActive {
+    background: #d2ecff;
+    font-weight: 500;
+    color: #131415;
+  }
+
+  &:hover {
+    .iconArrow {
+      transform: rotate(0deg);
+    }
+  }
+}

+ 182 - 25
src/views/prepare-lessons/components/directory-main/select-lessonware/index.tsx

@@ -3,9 +3,12 @@ import styles from './index.module.less';
 import {
   NButton,
   NCascader,
+  NForm,
+  NFormItem,
   NImage,
   NInput,
   NModal,
+  NPopselect,
   NScrollbar,
   NSelect,
   NSpace,
@@ -19,7 +22,9 @@ import AddTeaching, {
 import {
   lessonCoursewarePage,
   lessonCoursewareRemove,
-  bookVersionPage
+  bookVersionPage,
+  api_lessonCoursewarePage,
+  api_lessonCoursewareTeacherCategory
 } from '../../../api';
 import iconUploadBg from '../images/icon-upload-bg.png';
 import { useCatchStore } from '/src/store/modules/catchData';
@@ -43,11 +48,18 @@ export default defineComponent({
       selectItem: {} as any,
       bookVersionId: null,
       keyword: null,
-      currentGradeNum: null,
-      instrumentId: null,
+      currentGradeNum: '' as any,
+      instrumentId: '' as any,
       removeVisiable: false,
-      removeRow: {} as any
-      // bookType: null
+      removeRow: {} as any,
+      bookType: '' as any
+    });
+
+    const treeList = reactive({
+      tempSubjectId: null,
+      versionList: [] as any, // 教材
+      gradeList: [] as any, // 年级
+      bookTypeList: [] as any // 册别
     });
 
     const getLessonCourseware = async () => {
@@ -91,22 +103,50 @@ export default defineComponent({
       emit('close');
     };
 
+    const getSearchDetail = async () => {
+      try {
+        const { data } = await api_lessonCoursewareTeacherCategory();
+        console.log(data, 'data');
+
+        const result = data || []
+
+        treeList.versionList = [{
+          name: '全部',
+          id: ''
+        }, ...result]
+      } catch {
+        //
+      }
+    };
+
+    const selectChildObj = (item: any) => {
+      const obj: any = {};
+      item?.forEach((child: any) => {
+        if (child.id === forms.instrumentId) {
+          obj.selected = true;
+          obj.name = child.name;
+        }
+      });
+      return obj;
+    };
+
     onMounted(async () => {
       // 获取教材分类列表
       try {
         await catchStore.getSubjects();
-        const { data } = await bookVersionPage({
-          page: 1,
-          rows: 99,
-          type: 'COURSEWARE'
-        });
-        const temp = data.rows || [];
-        temp.forEach((item: any) => {
-          forms.musicTagList.push({
-            id: item.id,
-            name: item.name
-          });
-        });
+        // const { data } = await bookVersionPage({
+        //   page: 1,
+        //   rows: 99,
+        //   type: 'COURSEWARE'
+        // });
+        // const temp = data.rows || [];
+        // temp.forEach((item: any) => {
+        //   forms.musicTagList.push({
+        //     id: item.id,
+        //     name: item.name
+        //   });
+        // });
+        await getSearchDetail();
       } catch {
         //
       }
@@ -114,8 +154,126 @@ export default defineComponent({
     });
     return () => (
       <div class={styles.selectLessonware}>
-        <div class={styles.attendClassSearch}>
-          <NInput
+        <NScrollbar class={styles.classList}>
+          <div class={styles.attendClassSearch}>
+            <NForm labelAlign="left" labelPlacement="left">
+              {treeList.versionList.length > 0 && <NFormItem label="教程:">
+                <NSpace class={styles.spaceSection}>
+                  {treeList.versionList?.map((subject: any) => (
+                    <span
+                      class={[
+                        styles.textBtn,
+                        (forms.bookVersionId || '') ==
+                          subject.id && styles.textBtnActive
+                      ]}
+                      onClick={() => {
+                        treeList.bookTypeList = []
+                        forms.currentGradeNum = ''
+                        forms.bookType = ''
+                        if(subject.children && subject.children.length > 0) {
+                          treeList.gradeList = subject.children || []
+                        } else {
+                          treeList.gradeList = []
+                        }
+                      }}>
+                      {subject.name}
+                    </span>
+                  ))}
+                </NSpace>
+              </NFormItem>}
+              
+              {treeList.gradeList.length > 0 && <NFormItem label="年级:">
+                <NSpace class={styles.spaceSection}>
+                  {treeList.gradeList?.map((subject: any) => (
+                    <span
+                      class={[
+                        styles.textBtn,
+                        (forms.currentGradeNum || '') == subject.id &&
+                          styles.textBtnActive
+                      ]}
+                      onClick={() => {
+                        forms.bookType = ''
+                        if(subject.children && subject.children.length > 0) {
+                          treeList.bookTypeList = subject.children || []
+                        } else {
+                          treeList.bookTypeList = []
+                        }
+                      }}>
+                      {subject.name}
+                    </span>
+                  ))}
+                </NSpace>
+              </NFormItem>}
+              
+              {treeList.bookTypeList.length > 0 && <NFormItem label="册别:">
+                <NSpace class={styles.spaceSection}>
+                  {treeList.bookTypeList?.map((subject: any) => (
+                    <span
+                      class={[
+                        styles.textBtn,
+                        (forms.bookType || '') ==
+                          subject.id && styles.textBtnActive
+                      ]}
+                      onClick={() => {
+                        forms.bookType = subject.id
+                      }}>
+                      {subject.name}
+                    </span>
+                  ))}
+                </NSpace>
+              </NFormItem>}
+              
+
+              <NFormItem label="声部:">
+                <NSpace class={styles.spaceSection}>
+                  {[
+                    { name: '全部乐器', id: '' },
+                    ...catchStore.getSubjectList
+                  ].map((subject: any) =>
+                    subject.instruments && subject.instruments.length > 1 ? (
+                      <NPopselect
+                        options={subject.instruments}
+                        trigger="hover"
+                        scrollable
+                        v-model:value={treeList.tempSubjectId}
+                        onUpdate:value={() => {
+                          forms.instrumentId = treeList.tempSubjectId;
+                          // onSearch();
+                        }}
+                        key={subject.value}
+                        class={[styles.popSelect]}>
+                        <span
+                          class={[
+                            styles.textBtn,
+                            selectChildObj(subject.instruments).selected &&
+                              styles.textBtnActive
+                          ]}>
+                          {selectChildObj(subject.instruments).name ||
+                            subject.name}
+                          <i class={styles.iconArrow}></i>
+                        </span>
+                      </NPopselect>
+                    ) : (
+                      <span
+                        class={[
+                          styles.textBtn,
+                          forms.instrumentId === subject.value &&
+                            styles.textBtnActive
+                        ]}
+                        onClick={() => {
+                          forms.instrumentId = subject.value;
+
+                          treeList.tempSubjectId = null;
+                          // onSearch();
+                        }}>
+                        {subject.name}
+                      </span>
+                    )
+                  )}
+                </NSpace>
+              </NFormItem>
+            </NForm>
+            {/* <NInput
             placeholder="请输入教材名称"
             clearable
             v-model:value={forms.keyword}
@@ -174,8 +332,8 @@ export default defineComponent({
             clearable
             filterable
             onUpdate:value={() => throttledFn()}
-          />
-          {/* <NSelect
+          /> */}
+            {/* <NSelect
             placeholder="全部册别"
             options={
               [
@@ -187,8 +345,7 @@ export default defineComponent({
             clearable
             onUpdate:value={() => throttledFn()}
           /> */}
-        </div>
-        <NScrollbar class={styles.classList}>
+          </div>
           <NSpin show={forms.loading} class={styles.content}>
             <NSpace class={styles.teachingSpace}>
               <div
@@ -206,7 +363,7 @@ export default defineComponent({
                       src={iconUploadBg}
                       lazy
                       previewDisabled={true}
-                      onLoad={e => {
+                      onLoad={(e: any) => {
                         (e.target as any).dataset.loaded = 'true';
                       }}
                     />
@@ -227,7 +384,7 @@ export default defineComponent({
                           src={item.coverImg}
                           lazy
                           previewDisabled={true}
-                          onLoad={e => {
+                          onLoad={(e: any) => {
                             (e.target as any).dataset.loaded = 'true';
                           }}
                         />