|
|
|
@ -1,52 +1,133 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div style="text-align: center;margin-top: 50px;">
|
|
|
|
|
<el-transfer
|
|
|
|
|
style="text-align: left; display: inline-block"
|
|
|
|
|
v-model="value4"
|
|
|
|
|
filterable
|
|
|
|
|
:left-default-checked="[2, 3]"
|
|
|
|
|
:right-default-checked="[1]"
|
|
|
|
|
:titles="['Source', 'Target']"
|
|
|
|
|
:button-texts="['到左边', '到右边']"
|
|
|
|
|
:format="{
|
|
|
|
|
noChecked: '${total}',
|
|
|
|
|
hasChecked: '${checked}/${total}'
|
|
|
|
|
}"
|
|
|
|
|
@change="handleChange"
|
|
|
|
|
:data="data">
|
|
|
|
|
<span slot-scope="{ option }"> {{ option.label }}</span>
|
|
|
|
|
</el-transfer>
|
|
|
|
|
<div>
|
|
|
|
|
<el-card class="box-card">
|
|
|
|
|
<el-form ref="form" :model="form" label-width="80px" class="demo-form-inline" :inline="true">
|
|
|
|
|
<el-form-item label="课程名称">
|
|
|
|
|
<el-input v-model="form.cName" ></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="课程类型">
|
|
|
|
|
<el-input v-model="form.cType" ></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="老师名称">
|
|
|
|
|
<el-input v-model="form.tName" ></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item size="large">
|
|
|
|
|
<el-button type="primary" @click="search">查询</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
</el-card>
|
|
|
|
|
<el-card class="box-card" style="margin-top: 20px;">
|
|
|
|
|
<el-table
|
|
|
|
|
:data="tableData"
|
|
|
|
|
border
|
|
|
|
|
show-header
|
|
|
|
|
stripe
|
|
|
|
|
style="width: 100%">
|
|
|
|
|
<el-table-column
|
|
|
|
|
fixed
|
|
|
|
|
prop="tid__course__name"
|
|
|
|
|
label="课程名称"
|
|
|
|
|
width="200">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="tid__course__type"
|
|
|
|
|
label="课程类型"
|
|
|
|
|
width="180">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="tid__course__credit"
|
|
|
|
|
label="课程学分"
|
|
|
|
|
width="150">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="tid__name"
|
|
|
|
|
label="教师名称"
|
|
|
|
|
width="180">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="tid__title"
|
|
|
|
|
label="教师职称"
|
|
|
|
|
width="180">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="tid__dept"
|
|
|
|
|
label="教师院系"
|
|
|
|
|
width="220">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="操作"
|
|
|
|
|
width="150">
|
|
|
|
|
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-popconfirm
|
|
|
|
|
confirm-button-text='选择'
|
|
|
|
|
cancel-button-text='取消'
|
|
|
|
|
icon="el-icon-info"
|
|
|
|
|
title="确定选择该教师开设的课程?"
|
|
|
|
|
@confirm="select(scope.row)"
|
|
|
|
|
>
|
|
|
|
|
<el-button slot="reference" type="text" size="small">选择</el-button>
|
|
|
|
|
</el-popconfirm>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
<el-pagination
|
|
|
|
|
background
|
|
|
|
|
style="text-align: center;"
|
|
|
|
|
layout="prev, pager, next"
|
|
|
|
|
:total="total"
|
|
|
|
|
:page-size="10"
|
|
|
|
|
@current-change="changePage"
|
|
|
|
|
>
|
|
|
|
|
</el-pagination>
|
|
|
|
|
</el-card>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
const generateData = _ => {
|
|
|
|
|
const data = [];
|
|
|
|
|
for (let i = 1; i <= 15; i++) {
|
|
|
|
|
data.push({
|
|
|
|
|
key: i,
|
|
|
|
|
label: `备选项 ${ i }`,
|
|
|
|
|
disabled: i % 4 === 0
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
return data;
|
|
|
|
|
};
|
|
|
|
|
return {
|
|
|
|
|
data: generateData(),
|
|
|
|
|
value: [1],
|
|
|
|
|
value4: [1],
|
|
|
|
|
renderFunc(h, option) {
|
|
|
|
|
return <span>{ option.key } - { option.label }</span>;
|
|
|
|
|
total: 0,
|
|
|
|
|
currentPage: 1,
|
|
|
|
|
form: {
|
|
|
|
|
cName: "",
|
|
|
|
|
tName: "",
|
|
|
|
|
cType: ""
|
|
|
|
|
},
|
|
|
|
|
tableData: [{
|
|
|
|
|
|
|
|
|
|
}]
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|
handleChange(value, direction, movedKeys) {
|
|
|
|
|
console.log(value, direction, movedKeys);
|
|
|
|
|
getAllCourse() {
|
|
|
|
|
this.$axios.get("/course/seacherCourse?currentPage=" + this.currentPage + "&cName=" + this.form.cName
|
|
|
|
|
+ "&tName="+ this.form.tName + "&cType=" + this.form.cType).then(resp => {
|
|
|
|
|
if (resp.data.code === 0){
|
|
|
|
|
this.tableData = resp.data.data
|
|
|
|
|
}else {
|
|
|
|
|
this.$message({message: resp.data.message, type: "error"})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
search() {
|
|
|
|
|
this.getAllCourse()
|
|
|
|
|
},
|
|
|
|
|
changePage(val) {
|
|
|
|
|
this.currentPage = val
|
|
|
|
|
},
|
|
|
|
|
select(row) {
|
|
|
|
|
console.log(row)
|
|
|
|
|
row.username = sessionStorage.getItem("username")
|
|
|
|
|
this.$axios.post("/student/selectCourse", row).then(resp => {
|
|
|
|
|
this.$message({message: resp.data.message, type: resp.data.code===0 ? "success" : "error"})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.getAllCourse()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|