mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-09 19:06:43 +08:00
提交
This commit is contained in:
@@ -5,7 +5,18 @@
|
||||
v-for="(item,index) in teacherValueList"
|
||||
:key="item.teacherId"
|
||||
@close="handleClose(item,index)">{{item.teacherName}}</el-tag>
|
||||
<el-select
|
||||
<el-input
|
||||
placeholder="请输入授课教师姓名"
|
||||
v-model="teacherValues"
|
||||
clearable>
|
||||
<el-button :loading="loading" slot="append" icon="el-icon-search" @click="remoteFindTeacher()"></el-button>
|
||||
</el-input>
|
||||
<div class="choice-box" v-if="teacherDownList.length>0">
|
||||
<ul>
|
||||
<li v-for="te in teacherDownList" :key="te.key" @click="changeTeachers(te)">{{te.teacherName + te.teacherCode}}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- <el-select
|
||||
style="width: 100%;"
|
||||
v-model="teacherValues"
|
||||
filterable
|
||||
@@ -19,7 +30,7 @@
|
||||
:remote-method="remoteFindTeacher"
|
||||
:loading="loading">
|
||||
<el-option v-for="item in teacherDownList" :key="item.teacherId" :label="item.teacherName + item.teacherCode" :value="item"></el-option>
|
||||
</el-select>
|
||||
</el-select> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -39,7 +50,7 @@
|
||||
data(){
|
||||
return {
|
||||
teacherValueList:[],
|
||||
teacherValues:{},
|
||||
teacherValues:'',
|
||||
loading:false,
|
||||
teacherDownList:[],
|
||||
}
|
||||
@@ -60,23 +71,24 @@
|
||||
if(t) {
|
||||
let isCan = this.teacherValueList.some(it=>it.teacherId == t.teacherId);
|
||||
if(isCan){
|
||||
this.teacherValues = {};
|
||||
this.teacherValues = '';
|
||||
this.teacherDownList = [];
|
||||
this.$message.warning('教师重复,请重新选择!')
|
||||
return;
|
||||
}
|
||||
this.teacherValueList.push(t);
|
||||
this.teacherDownList = [];
|
||||
this.teacherValues = {};
|
||||
this.teacherValues = '';
|
||||
this.$emit('getTeacherList',this.teacherValueList);
|
||||
}
|
||||
},
|
||||
// 教师列标,远程查询
|
||||
async remoteFindTeacher(query) {
|
||||
if (query) {
|
||||
async remoteFindTeacher() {
|
||||
console.log("2222");
|
||||
if (this.teacherValues !== '') {
|
||||
this.loading = true;
|
||||
try {
|
||||
const { result, message, status } = await apiTeacher.findByName(query);
|
||||
const { result, message, status } = await apiTeacher.findByName(this.teacherValues);
|
||||
this.loading = false;
|
||||
if (status === 200) {
|
||||
let list = [];
|
||||
@@ -104,10 +116,28 @@
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.choice{
|
||||
position: relative;
|
||||
.el-tag--info{
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
}
|
||||
.choice-box{
|
||||
position: absolute;
|
||||
// top: 40px;
|
||||
width: 280px;
|
||||
z-index: 999;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #eee;
|
||||
box-shadow: 3px 3px 3px 3px #eee;
|
||||
ul{
|
||||
margin: 0;
|
||||
padding:0 10px;
|
||||
}
|
||||
li{
|
||||
list-style: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ import {userAvatarText,cutFullName} from "@/utils/tools.js";
|
||||
mounted() {
|
||||
this.sex = this.userInfo.sex;
|
||||
// 判断路由是进入的学员默认页面就重置setCurIdentity
|
||||
if(this.$route.path == '/uc/study/task'){
|
||||
if(this.$route.path == '/uc/study/task' || this.$route.path == '/study/index'){
|
||||
this.setCurIdentity(1);
|
||||
}
|
||||
//let testName='京东方科技集团股份有限公司/北京中祥英科技有限公司/技术中心';
|
||||
|
||||
Reference in New Issue
Block a user