暂存
This commit is contained in:
@@ -69,8 +69,13 @@
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<span style="font-weight:bold; font-size:16px">{{ scope.row.title }}</span><br>
|
||||
<span style="color:#999">( 创建时间:{{ scope.row.createTime}} )</span>
|
||||
<span style="font-weight:bold; font-size:16px">{{
|
||||
scope.row.title
|
||||
}}</span
|
||||
><br />
|
||||
<span style="color:#999"
|
||||
>( 创建时间:{{ scope.row.createTime }} )</span
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -159,7 +164,7 @@
|
||||
align="center"
|
||||
label="排序"
|
||||
>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
@@ -183,15 +188,44 @@
|
||||
@click="addOrUpdateHandle(scope.row)"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button type="text" size="small" @click="showLinkTags(scope.row)"
|
||||
>查看引用</el-button
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="showLinkTags(scope.row)"
|
||||
>查看引用</el-button
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="deleteHandle(scope.row.id)"
|
||||
>删除</el-button
|
||||
>
|
||||
<!-- <el-dropdown>
|
||||
<span
|
||||
class="el-dropdown-link"
|
||||
style="color:#17B3A3 ; cursor:pointer"
|
||||
>
|
||||
更多操作<i class="el-icon-arrow-down el-icon--right"></i>
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item>
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="showLinkTags(scope.row)"
|
||||
>查看引用</el-button
|
||||
>
|
||||
</el-dropdown-item> -->
|
||||
<!-- <el-dropdown-item>
|
||||
<el-button
|
||||
@click="showDirectorShow(scope.row)"
|
||||
type="text"
|
||||
size="small"
|
||||
>教务主任管理</el-button
|
||||
>
|
||||
</el-dropdown-item> -->
|
||||
<!-- </el-dropdown-menu>
|
||||
</el-dropdown> -->
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -211,9 +245,9 @@
|
||||
<add-or-update
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
:relationProducts = relationProducts
|
||||
@pclose = "pclose"
|
||||
@showProTable = "showProTable"
|
||||
:relationProducts="relationProducts"
|
||||
@pclose="pclose"
|
||||
@showProTable="showProTable"
|
||||
@refreshDataList="getDataList"
|
||||
></add-or-update>
|
||||
<commonShopTable
|
||||
@@ -230,25 +264,26 @@
|
||||
>
|
||||
<div>
|
||||
<div v-if="resList.length > 0">
|
||||
<div style="margin-bottom:20px">当前课程共有 {{resList.length}} 个标签引用</div>
|
||||
<div style="margin-bottom:20px">
|
||||
当前课程共有 {{ resList.length }} 个标签引用
|
||||
</div>
|
||||
<div v-for="(item, index) in resList" :key="index">
|
||||
{{index + 1}}、 {{ item.title }}
|
||||
{{ index + 1 }}、 {{ item.title }}
|
||||
<span v-if="item.isLast != 1">
|
||||
<span v-for="(item1, index1) in item.children" :key="index1"
|
||||
> > {{ item1.title }}
|
||||
<span v-for="(item1, index1) in item.children" :key="index1">
|
||||
> {{ item1.title }}
|
||||
<span v-if="item1.isLast != 1">
|
||||
<span
|
||||
v-for="(item2, index2) in item1.children"
|
||||
:key="index2"
|
||||
> > {{ item2.title }}
|
||||
<span v-for="(item2, index2) in item1.children" :key="index2">
|
||||
> {{ item2.title }}
|
||||
<span v-if="item2.isLast != 1">
|
||||
<span
|
||||
v-for="(item3, index3) in item2.children"
|
||||
:key="index3"
|
||||
> > {{ item3.title }}</span
|
||||
>
|
||||
</span>
|
||||
<span
|
||||
v-for="(item3, index3) in item2.children"
|
||||
:key="index3"
|
||||
>
|
||||
> {{ item3.title }}</span
|
||||
>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
@@ -260,6 +295,65 @@
|
||||
<el-button type="primary" @click="closeLink">好 的</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<!-- 教务主任设置 -->
|
||||
<el-dialog
|
||||
title="教务主任管理"
|
||||
:visible.sync="directorShow"
|
||||
width="40%"
|
||||
@close="closeDirector"
|
||||
>
|
||||
<div class="">
|
||||
<h3>当前操作的课程:{{ optCourse.title }}</h3>
|
||||
<el-form ref="director" :model="director" label-width="100px">
|
||||
<el-form-item label="主任设置:" prop="director">
|
||||
<el-select
|
||||
v-model="director.director"
|
||||
filterable
|
||||
remote
|
||||
clearable
|
||||
reserve-keyword
|
||||
placeholder="请输入手机号"
|
||||
:remote-method="remoteMethod"
|
||||
:loading="remoteMethodLoading"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in userList"
|
||||
:key="item.tel"
|
||||
:label="item.tel"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="副主任设置:" prop="ddirector">
|
||||
<el-select
|
||||
v-model="director.ddirector"
|
||||
filterable
|
||||
remote
|
||||
clearable
|
||||
reserve-keyword
|
||||
placeholder="请输入手机号"
|
||||
:remote-method="remoteMethod"
|
||||
:loading="remoteMethodLoading"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in userList"
|
||||
:key="item.tel"
|
||||
:label="item.tel"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<span v-show="isSameOne" style="color:red"
|
||||
>主任和副主任不可以是同一个人</span
|
||||
>
|
||||
</el-form-item></el-form
|
||||
>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="saveDirector">提 交</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -270,6 +364,15 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
selectType: [],
|
||||
director: {
|
||||
director: null,
|
||||
ddirector: null
|
||||
},
|
||||
directorShow: false,
|
||||
remoteMethodLoading: false,
|
||||
miniClassVisible: false,
|
||||
personSeting: false,
|
||||
userList: [],
|
||||
options: [
|
||||
{
|
||||
id: "all",
|
||||
@@ -287,11 +390,11 @@ export default {
|
||||
children: []
|
||||
}
|
||||
],
|
||||
courseId:"0",
|
||||
courseId: "0",
|
||||
dataForm: {
|
||||
key: "",
|
||||
key: ""
|
||||
},
|
||||
relationProducts:[],
|
||||
relationProducts: [],
|
||||
query: {
|
||||
type: "",
|
||||
categoryId: "",
|
||||
@@ -311,7 +414,8 @@ export default {
|
||||
sociologyList: "/master/courseSociology/getCourseSociologyList" //国学
|
||||
},
|
||||
resList: [],
|
||||
resListVisible: false
|
||||
resListVisible: false,
|
||||
optCourse: {}
|
||||
};
|
||||
},
|
||||
components: {
|
||||
@@ -328,28 +432,176 @@ export default {
|
||||
this.getTreeList(this.urlList.sociologyList, 2);
|
||||
},
|
||||
methods: {
|
||||
delPro(val){
|
||||
console.log(val,this.relationProducts)
|
||||
let list = this.relationProducts
|
||||
delPro(val) {
|
||||
console.log(val, this.relationProducts);
|
||||
let list = this.relationProducts;
|
||||
|
||||
this.relationProducts = list.slice(1, 1);
|
||||
},
|
||||
saveDirector() {
|
||||
if(this.director.director == this.director.ddirector && this.director.director != null){
|
||||
this.$message.error('主任与副主任不能是同一人')
|
||||
return
|
||||
}
|
||||
var director = 0;
|
||||
var ddirector = 0;
|
||||
if (this.director.director) {
|
||||
director = this.director.director;
|
||||
}
|
||||
if (this.director.ddirector) {
|
||||
ddirector = this.director.ddirector;
|
||||
}
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/master/course/editCourseDirector"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
courseId: this.optCourse.id,
|
||||
director: director, //主任,清空时传0
|
||||
ddirector: ddirector //副主任,清空时传0
|
||||
})
|
||||
})
|
||||
.then(res => {
|
||||
if (res.data.code == 0) {
|
||||
this.$message.success("操作成功!");
|
||||
this.closeDirector();
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.$message.error("获取课程信息失败");
|
||||
_info = null;
|
||||
});
|
||||
},
|
||||
closeDirector() {
|
||||
this.directorShow = false;
|
||||
setTimeout(() => {
|
||||
this.$nextTick(() => {
|
||||
this.$refs["director"].resetFields();
|
||||
this.director = {
|
||||
director: null,
|
||||
ddirector: null
|
||||
};
|
||||
this.userList = []
|
||||
this.optCourse = {};
|
||||
console.log("director关闭了吗", this.director);
|
||||
})
|
||||
|
||||
},200)
|
||||
|
||||
this.relationProducts = list.slice(1,1)
|
||||
|
||||
|
||||
},
|
||||
pclose(){
|
||||
this.relationProducts = []
|
||||
this.courseId = null
|
||||
console.log('关闭了 ')
|
||||
async showDirectorShow(data) {
|
||||
this.optCourse = data;
|
||||
var obj = await this.getDirectorInfo(data.id);
|
||||
console.log("教务信息", obj);
|
||||
if (obj) {
|
||||
// console.log("有绑定", obj.data.director.tel);
|
||||
if (obj.data.director != null) {
|
||||
var list = this.userList.map( item => { return item.id})
|
||||
console.log('list',list)
|
||||
var i = list.find(function(elem){
|
||||
return elem == obj.data.director.id;
|
||||
});
|
||||
if(!i){
|
||||
this.userList.push({
|
||||
id:obj.data.director.id,
|
||||
tel:obj.data.director.tel
|
||||
})
|
||||
}
|
||||
this.director.director = obj.data.director.id;
|
||||
}
|
||||
else {
|
||||
// this.director.director = null;
|
||||
}
|
||||
if (obj.data.ddirector != null) {
|
||||
console.log('jinlailema')
|
||||
var list = this.userList.map( item => { return item.id})
|
||||
console.log('list',list)
|
||||
var i = list.find(function(elem){
|
||||
return elem == obj.data.ddirector.id;
|
||||
});
|
||||
if(!i){
|
||||
this.userList.push({
|
||||
id:obj.data.ddirector.id,
|
||||
tel:obj.data.ddirector.tel
|
||||
})
|
||||
}
|
||||
this.director.ddirector = obj.data.ddirector.id;
|
||||
}
|
||||
else {
|
||||
// this.ddirector.director = null;
|
||||
}
|
||||
|
||||
} else {
|
||||
console.log("没有绑定");
|
||||
this.director = {
|
||||
director: null,
|
||||
ddirector: null
|
||||
};
|
||||
}
|
||||
this.directorShow = true;
|
||||
},
|
||||
linkList(data){
|
||||
console.log('父级',data)
|
||||
if(data && data.length > 0){
|
||||
this.relationProducts = data
|
||||
// 检索教务信息
|
||||
getDirectorInfo(id) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/master/course/getCourseDirector"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
courseId: id
|
||||
})
|
||||
})
|
||||
.then(res => {
|
||||
resolve(res);
|
||||
// if (res.code === 0) {
|
||||
// _info = res.director;
|
||||
// console.log('教务信息++++res', res.director)
|
||||
// }
|
||||
})
|
||||
.catch(e => {
|
||||
this.$message.error("获取课程信息失败");
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
// 搜索用户列表
|
||||
remoteMethod(query) {
|
||||
if (query !== "") {
|
||||
this.remoteMethodLoading = true;
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/book/user/getUserList"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
page: 1,
|
||||
limit: 10,
|
||||
key: query
|
||||
})
|
||||
})
|
||||
.then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.userList = data.user.records;
|
||||
this.remoteMethodLoading = false;
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.userList = [];
|
||||
this.remoteMethodLoading = false;
|
||||
});
|
||||
} else {
|
||||
this.userList = [];
|
||||
}
|
||||
},
|
||||
showProTable(data){
|
||||
console.log('data',data)
|
||||
pclose() {
|
||||
this.relationProducts = [];
|
||||
this.courseId = null;
|
||||
console.log("关闭了 ");
|
||||
},
|
||||
linkList(data) {
|
||||
console.log("父级", data);
|
||||
if (data && data.length > 0) {
|
||||
this.relationProducts = data;
|
||||
}
|
||||
},
|
||||
showProTable(data) {
|
||||
console.log("data", data);
|
||||
this.$nextTick(() => {
|
||||
this.$refs.commonShopTable.open();
|
||||
});
|
||||
@@ -359,7 +611,6 @@ export default {
|
||||
this.resList = [];
|
||||
},
|
||||
showLinkTags(row) {
|
||||
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/master/course/getCourseLableLinkList"),
|
||||
method: "post",
|
||||
@@ -370,7 +621,6 @@ export default {
|
||||
this.resListVisible = true;
|
||||
if (res.data.code == 0 && res.data.resList.length > 0) {
|
||||
this.resList = res.data.resList;
|
||||
|
||||
}
|
||||
// console.log(row, "row" , res.data.resList,this.resList);
|
||||
});
|
||||
@@ -404,7 +654,7 @@ export default {
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.relationProducts = []
|
||||
this.relationProducts = [];
|
||||
var data = {
|
||||
page: this.pageIndex,
|
||||
limit: this.pageSize,
|
||||
@@ -466,8 +716,8 @@ export default {
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle(row) {
|
||||
this.addOrUpdateVisible = true;
|
||||
row ? this.courseId = row.id : ''
|
||||
this.addOrUpdateVisible = true;
|
||||
row ? (this.courseId = row.id) : "";
|
||||
// this.courseId = row.id
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(row);
|
||||
@@ -592,6 +842,15 @@ export default {
|
||||
this.getDataList();
|
||||
});
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isSameOne() {
|
||||
if(this.director.ddirector == this.director.director && this.director.ddirector != null){
|
||||
return true
|
||||
}else{
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -601,4 +860,7 @@ export default {
|
||||
color: #149f97;
|
||||
}
|
||||
}
|
||||
.flexbox {
|
||||
display: flex;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user