From 5dcb12f26a2bed2938eeb7f3a98054205fa14c83 Mon Sep 17 00:00:00 2001 From: huweihang Date: Wed, 10 Dec 2025 15:05:13 +0800 Subject: [PATCH] =?UTF-8?q?Enhance=20ManageListRemote.vue:=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E8=BE=93=E5=85=A5=E6=A1=86=E5=8D=A0=E4=BD=8D=E7=AC=A6?= =?UTF-8?q?=EF=BC=8C=E5=BC=BA=E5=88=B6=E8=AE=BE=E7=BD=AE=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E6=A1=86=E6=9C=80=E5=A4=A7=E9=95=BF=E5=BA=A6=EF=BC=8C=E6=94=B9?= =?UTF-8?q?=E8=BF=9B=E6=95=99=E5=B8=88=E4=B8=8E=E5=88=9B=E4=BD=9C=E8=80=85?= =?UTF-8?q?=E9=80=89=E9=A1=B9=E6=A0=87=E7=AD=BE=EF=BC=8C=E5=B9=B6=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E8=87=AA=E5=AE=9A=E4=B9=89=E6=BB=9A=E5=8A=A8=E6=9D=A1?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BB=A5=E6=8F=90=E5=8D=87=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E4=B8=80=E8=87=B4=E6=80=A7=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/course/ManageListRemote.vue | 94 +++++++++++++++++---------- 1 file changed, 61 insertions(+), 33 deletions(-) diff --git a/src/views/course/ManageListRemote.vue b/src/views/course/ManageListRemote.vue index 7ecfc881..333f769e 100644 --- a/src/views/course/ManageListRemote.vue +++ b/src/views/course/ManageListRemote.vue @@ -5,14 +5,15 @@
- @@ -27,7 +28,7 @@ reserve-keyword placeholder="授课教师" :multiple-limit="5" - collapse-tags + maxlength="50" :remote-method="remoteSearchTeacher" :loading="teacherLoading" @change="handleTeacherChange" @@ -36,9 +37,12 @@ + > + {{ item.teacherName }} + ({{ item.teacherCode }}) +
@@ -78,7 +82,7 @@ >
- + @@ -94,6 +98,7 @@ placeholder="全部资源归属" clearable filterable + maxlength="200" v-model="resOwner" :props="defaultProps" :options="resOwnerListMap" @@ -110,7 +115,7 @@ reserve-keyword :multiple-limit="5" placeholder="创建人" - collapse-tags + maxlength="50" :remote-method="remoteSearchCreator" :loading="creatorLoading" @change="handleCreatorChange" @@ -119,9 +124,12 @@ + > + {{ item.name }} + ({{ item.code }}) + @@ -201,7 +209,7 @@ {{ scope.row.published == true ? '已发布' : '未发布' }} - + @@ -544,6 +552,7 @@ export default { }, extendRefId: '', extendRefType: '', + scrollbarStyleApplied: false, }; }, created() { @@ -578,23 +587,41 @@ export default { //已经加载tree的情况下,不需要再单独的加载一次 this.loadResOwners(); this.loadSysTypes(); - document.querySelector('#app').style.overflow = 'hidden'; + document.querySelector('#app').style.overflowX = 'hidden'; + this.applyAppScrollbarStyle(); }, methods: { toggleAdvancedFilter() { this.showAdvancedFilter = !this.showAdvancedFilter; }, + applyAppScrollbarStyle() { + if (this.scrollbarStyleApplied || typeof document === 'undefined') return; + if (document.getElementById('app-scrollbar-style')) { + this.scrollbarStyleApplied = true; + return; + } + const style = document.createElement('style'); + style.id = 'app-scrollbar-style'; + style.innerHTML = ` + #app::-webkit-scrollbar { + width: 6px; + height: 8px; + } + #app::-webkit-scrollbar-thumb { + border-radius: 6px; + background-color: rgb(78, 166, 255); + } + `; + document.head.appendChild(style); + this.scrollbarStyleApplied = true; + }, async remoteSearchTeacher(keyword) { const query = (keyword || '').trim(); if (!query || query.length <= 1) { this.teacherOptions = []; return; } - if (query.length > 50) { - this.$message.warning('超过50个字的内容不让输入'); - return; - } this.teacherLoading = true; try { const res = await apiTeacher.findByNameNew(query); @@ -639,10 +666,6 @@ export default { this.creatorOptions = []; return; } - if (query.length > 50) { - this.$message.warning('创建人搜索最多50个字符'); - return; - } this.creatorLoading = true; try { const res = await apiUserbasic.selectUser(query); @@ -1135,17 +1158,14 @@ export default { }, // 课程查询 searchData(pageReset) { - if (this.params.name && this.params.name.length > 50) { - this.$message.warning('课程名称最多50个字符'); - return; - } if (pageReset) { this.page.pageIndex = 1; } if (!this.validateLearningTimeRange()) { return; } - console.log('apiCourse', apiCourse) + console.log('apiCourse', apiCourse); + console.log('buildQueryParams', this.buildQueryParams()); const query = this.buildQueryParams(); apiCourse.managePage(query).then(rs => { if (rs.status == 200) { @@ -1351,9 +1371,19 @@ export default {