Browse Source

修改问题

lex-xin 4 months ago
parent
commit
cab419ae02

BIN
src/img/cloudPractice/icon-left-active.png


+ 1 - 1
src/views/cloudTextbooks/chooseDialog.vue

@@ -55,7 +55,7 @@
                   class="queryIpt"
                   class="queryIpt"
                   v-model="queryStr"
                   v-model="queryStr"
                   :height="40"
                   :height="40"
-                  placeholder="请输入素材关键"
+                  placeholder="请输入素材关键"
                   clearable
                   clearable
                   @handleQuery="handleQuery"
                   @handleQuery="handleQuery"
                   @keyup.enter="handleQuery"
                   @keyup.enter="handleQuery"

+ 8 - 8
src/views/cloudTextbooks/searchCollapse/searchCollapse.vue

@@ -279,14 +279,14 @@ function handleClick(value: any) {
          padding: 0;
          padding: 0;
          margin-bottom: 6px;
          margin-bottom: 6px;
          cursor: pointer;
          cursor: pointer;
-         &.isActive {
-            background: #f0f0f0;
-            border-radius: 7px;
-            .courseTitleCon {
-               color: #f67146;
-               font-weight: 600;
-            }
-         }
+         // &.isActive {
+         // background: #f0f0f0;
+         // border-radius: 7px;
+         // .courseTitleCon {
+         //    color: #f67146;
+         //    font-weight: 600;
+         // }
+         // }
          .courseTitleCon {
          .courseTitleCon {
             padding: 12px 0 0 10px;
             padding: 12px 0 0 10px;
             flex-grow: 1;
             flex-grow: 1;

+ 7 - 1
src/views/cloudTextbooks/useData.ts

@@ -209,6 +209,7 @@ export const useDataDetailList = () => {
    let coursewareDetailController: AbortController
    let coursewareDetailController: AbortController
    const listData = shallowRef<listDetail[][]>([])
    const listData = shallowRef<listDetail[][]>([])
    const listSearchData = shallowRef<any[]>([])
    const listSearchData = shallowRef<any[]>([])
+   const flattenCoursewareList = ref<any[]>([]) // 扁平化coursewareList
    const activeCollapse = ref<any>({
    const activeCollapse = ref<any>({
       parentData: {
       parentData: {
          ids: []
          ids: []
@@ -235,6 +236,7 @@ export const useDataDetailList = () => {
    function handlePage(type: "next" | "prev") {
    function handlePage(type: "next" | "prev") {
       type === "next" ? pageNum.value++ : pageNum.value--
       type === "next" ? pageNum.value++ : pageNum.value--
    }
    }
+   const flattenCoursewareListData: any[] = []
    // 获取管乐迷
    // 获取管乐迷
    function handleGetDetaList_gym(id: string, isSearch = false, search?: string) {
    function handleGetDetaList_gym(id: string, isSearch = false, search?: string) {
       if (coursewareDetailController) {
       if (coursewareDetailController) {
@@ -264,7 +266,10 @@ export const useDataDetailList = () => {
                item.name = item.coursewareDetailName
                item.name = item.coursewareDetailName
             })
             })
             listSearchData.value = filterPointList(resultList)
             listSearchData.value = filterPointList(resultList)
-            activeCollapse.value = { parentData: { ids: listSearchData.value.length > 0 ? [listSearchData.value[0].id] : [] } }
+            flattenCoursewareList.value = flattenCoursewareListData
+            if (flattenCoursewareList.value[0]) {
+               activeCollapse.value = flattenCoursewareList.value[0]
+            }
          }
          }
       })
       })
    }
    }
@@ -317,6 +322,7 @@ export const useDataDetailList = () => {
                      ids: [...(parentData?.ids || []), point.id],
                      ids: [...(parentData?.ids || []), point.id],
                      name: point.name
                      name: point.name
                   }
                   }
+                  flattenCoursewareListData.push(item)
                   return item
                   return item
                })
                })
             })
             })

+ 23 - 4
src/views/coursewarePlay/coursewarePlay.vue

@@ -109,7 +109,7 @@
                   class="queryIpt"
                   class="queryIpt"
                   v-model="searchObj.queryStr"
                   v-model="searchObj.queryStr"
                   :height="36"
                   :height="36"
-                  placeholder="请输入素材关键"
+                  placeholder="请输入素材关键"
                   clearable
                   clearable
                   @handleQuery="handleQuery"
                   @handleQuery="handleQuery"
                   @keyup.enter="handleQuery"
                   @keyup.enter="handleQuery"
@@ -122,6 +122,13 @@
             <img class="close" @click="close" src="@/img/coursewarePlay/close.png" />
             <img class="close" @click="close" src="@/img/coursewarePlay/close.png" />
          </template>
          </template>
          <ElScrollbar class="elScrollbar" v-loading="searchObj.loading">
          <ElScrollbar class="elScrollbar" v-loading="searchObj.loading">
+            <!-- <tempCoursewareList -->
+            <el-empty
+               class="empty"
+               v-if="!tempCoursewareList.length && !searchObj.loading"
+               :image="require('@/img/layout/empty.png')"
+               description="暂无搜索结果"
+            />
             <courseCollapse
             <courseCollapse
                :activeCollapse="activeCourseware"
                :activeCollapse="activeCourseware"
                :search="searchObj.search"
                :search="searchObj.search"
@@ -372,10 +379,10 @@ function handlePointList(pointList: any[], isSearch?: boolean) {
          })
          })
          index > -1 && (activeCoursewareIndex.value = index)
          index > -1 && (activeCoursewareIndex.value = index)
       }
       }
-      flattenCoursewareList.value = flattenCoursewareListData
+      flattenCoursewareList.value = deepCopy(flattenCoursewareListData)
    }
    }
    tempCoursewareList.value = list
    tempCoursewareList.value = list
-   tempFlattenCoursewareList.value = flattenCoursewareListData
+   tempFlattenCoursewareList.value = deepCopy(flattenCoursewareListData)
 }
 }
 function filterPointList(pointList: any[], parentData?: { ids: string[]; name: string }): any[] {
 function filterPointList(pointList: any[], parentData?: { ids: string[]; name: string }): any[] {
    // 设置父级及以上id数组和父级name
    // 设置父级及以上id数组和父级name
@@ -422,6 +429,7 @@ function handleChangeCourseware(index: -1 | 1) {
 }
 }
 function handleCourseClick(value: any) {
 function handleCourseClick(value: any) {
    // 选择之后初始化数据
    // 选择之后初始化数据
+   searchObj.search = JSON.parse(JSON.stringify(searchObj.queryStr))
    coursewareList.value = deepCopy(tempCoursewareList.value)
    coursewareList.value = deepCopy(tempCoursewareList.value)
    flattenCoursewareList.value = deepCopy(tempFlattenCoursewareList.value)
    flattenCoursewareList.value = deepCopy(tempFlattenCoursewareList.value)
    activeCoursewareIndex.value = flattenCoursewareList.value.findIndex((item: any) => {
    activeCoursewareIndex.value = flattenCoursewareList.value.findIndex((item: any) => {
@@ -533,6 +541,7 @@ function handleToolClick(type: string) {
       drawerMenuShow.value = true
       drawerMenuShow.value = true
    } else if (type === "point") {
    } else if (type === "point") {
       tempCoursewareList.value = deepCopy(coursewareList.value)
       tempCoursewareList.value = deepCopy(coursewareList.value)
+      searchObj.queryStr = JSON.parse(JSON.stringify(searchObj.search))
       drawerShow.value = true
       drawerShow.value = true
    }
    }
 }
 }
@@ -661,7 +670,6 @@ function onTitleTip(type: "phaseGoals" | "checkItem", text: string) {
 
 
 function handleQuery() {
 function handleQuery() {
    //
    //
-   // handleGetDetailList(props.modalData.id, true, queryStr.value)
    searchObj.isSearch = true
    searchObj.isSearch = true
    getLessCoursewareList()
    getLessCoursewareList()
 }
 }
@@ -922,4 +930,15 @@ function handleQuery() {
       }
       }
    }
    }
 }
 }
+.empty {
+   height: calc(100vh - 54px);
+   :deep(.el-empty__image) {
+      width: 238px;
+   }
+
+   :deep(.el-empty__description) {
+      font-size: 18px;
+      color: #aaa;
+   }
+}
 </style>
 </style>