|
|
@@ -104,14 +104,11 @@
|
|
|
<el-icon class="el-input__icon"><search /></el-icon>
|
|
|
</template>
|
|
|
<!-- 下拉项模板 -->
|
|
|
- <template #popper-append-to-body>
|
|
|
- <el-option
|
|
|
- class="scrollbar"
|
|
|
- v-for="item in filteredTitles"
|
|
|
- :key="item.id"
|
|
|
- :label="item.ctType"
|
|
|
- :value="item"
|
|
|
- ></el-option>
|
|
|
+ <template #default="{ item }">
|
|
|
+ <div class="scrollbar">
|
|
|
+ <!-- 序号和标题 -->
|
|
|
+ {{ item.ctTypeSort }} {{ item.ctType }}
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</el-autocomplete>
|
|
|
</div>
|
|
|
@@ -289,7 +286,7 @@ const getCourseTitle = index => {
|
|
|
const courseTitles = computed(() => {
|
|
|
const data = showPracticalCourse.value ? ClassOutlineScData.value : classOutlineData.value
|
|
|
return data.map(item => {
|
|
|
- return `${item.ctTypeSort}${item.ctType}`;
|
|
|
+ return `${item.ctTypeSort} ${item.ctType}`;
|
|
|
});
|
|
|
})
|
|
|
|
|
|
@@ -317,7 +314,9 @@ const querySearch = (queryString, cb) => {
|
|
|
const data = showPracticalCourse.value ? ClassOutlineScData.value : classOutlineData.value
|
|
|
const results = queryString
|
|
|
? data.filter(item => {
|
|
|
- return item.ctType.toLowerCase().includes(queryString.toLowerCase())
|
|
|
+ // 课程标题和序号查询
|
|
|
+ return item.ctType.toLowerCase().includes(queryString.toLowerCase()) ||
|
|
|
+ item.ctTypeSort.includes(queryString)
|
|
|
})
|
|
|
: data
|
|
|
cb(results)
|
|
|
@@ -335,7 +334,8 @@ const filteredTitles = computed(() => {
|
|
|
return data
|
|
|
}
|
|
|
return data.filter(title =>
|
|
|
- title.ctType.toLowerCase().includes(SearchInput.value.toLowerCase())
|
|
|
+ title.ctType.toLowerCase().includes(SearchInput.value.toLowerCase()) ||
|
|
|
+ title.ctTypeSort.includes(SearchInput.value)
|
|
|
)
|
|
|
})
|
|
|
|