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