[FIX]授课教师、全部资源归属、创建人最大长度修改

This commit is contained in:
huweihang
2025-12-10 18:54:04 +08:00
parent 5dcb12f26a
commit 2bd430aee2

View File

@@ -20,6 +20,7 @@
<div class="teacher-select-wrapper">
<el-select
class="creator-select"
ref="teacherSelect"
v-model="teacherSelected"
multiple
filterable
@@ -28,7 +29,6 @@
reserve-keyword
placeholder="授课教师"
:multiple-limit="5"
maxlength="50"
:remote-method="remoteSearchTeacher"
:loading="teacherLoading"
@change="handleTeacherChange"
@@ -98,7 +98,8 @@
placeholder="全部资源归属"
clearable
filterable
maxlength="200"
ref="resOwnerCascader"
:filter-method="resOwnerFilterMethod"
v-model="resOwner"
:props="defaultProps"
:options="resOwnerListMap"
@@ -107,6 +108,7 @@
<el-form-item class="creator-filter">
<el-select
class="creator-select"
ref="creatorSelect"
v-model="creatorSelected"
multiple
filterable
@@ -115,7 +117,6 @@
reserve-keyword
:multiple-limit="5"
placeholder="创建人"
maxlength="50"
:remote-method="remoteSearchCreator"
:loading="creatorLoading"
@change="handleCreatorChange"
@@ -617,7 +618,11 @@ export default {
this.scrollbarStyleApplied = true;
},
async remoteSearchTeacher(keyword) {
const query = (keyword || '').trim();
const limited = (keyword || '').slice(0, 50);
if (this.$refs.teacherSelect && this.$refs.teacherSelect.query !== limited) {
this.$refs.teacherSelect.query = limited;
}
const query = limited.trim();
if (!query || query.length <= 1) {
this.teacherOptions = [];
return;
@@ -661,7 +666,11 @@ export default {
this.params.teacherId = '';
},
async remoteSearchCreator(keyword) {
const query = (keyword || '').trim();
const limited = (keyword || '').slice(0, 50);
if (this.$refs.creatorSelect && this.$refs.creatorSelect.query !== limited) {
this.$refs.creatorSelect.query = limited;
}
const query = limited.trim();
if (!query || query.length <= 1) {
this.creatorOptions = [];
return;
@@ -1093,6 +1102,15 @@ export default {
if (code == '') { return ''; }
return this.resOwnerMap.get(code);
},
resOwnerFilterMethod(node, keyword = '') {
const limited = keyword.slice(0, 200);
if (this.$refs.resOwnerCascader && this.$refs.resOwnerCascader.inputValue !== limited) {
this.$refs.resOwnerCascader.inputValue = limited;
}
if (!limited) return true;
const text = node.label || node.text || '';
return text.toLowerCase().includes(limited.toLowerCase());
},
sysTypeName(code) {
if (code == '') { return ''; }
return this.sysTypeMap.get(code);