Merge branch 'martekSort'
This commit is contained in:
@@ -66,7 +66,6 @@
|
|||||||
:inactive-value="0"
|
:inactive-value="0"
|
||||||
active-text="是"
|
active-text="是"
|
||||||
inactive-text="否"
|
inactive-text="否"
|
||||||
|
|
||||||
>
|
>
|
||||||
</el-switch>
|
</el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -91,10 +90,46 @@
|
|||||||
>
|
>
|
||||||
</quill-editor>
|
</quill-editor>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item label="视频/音频ID" prop="sort">
|
<!-- <el-form-item prop="sort" label-width="0"> -->
|
||||||
<el-input v-model="dataForm.sort" placeholder="请输入视频/音频ID"></el-input>
|
<div v-if="this.dataForm.id">
|
||||||
</el-form-item>
|
<div
|
||||||
<div><span>添加一项</span></div> --->
|
class="flexbox videoBox"
|
||||||
|
v-for="(item, index) in video_audio_url"
|
||||||
|
:key="index"
|
||||||
|
|
||||||
|
>
|
||||||
|
<div style="width:120px">视频/音频ID</div>
|
||||||
|
<div style="width:300px; margin-right:10px; margin-left:10px">
|
||||||
|
<el-input
|
||||||
|
style=""
|
||||||
|
v-model="item.video"
|
||||||
|
placeholder="请输入视频/音频ID"
|
||||||
|
></el-input>
|
||||||
|
</div>
|
||||||
|
<div style="margin-right:10px; height:38px">
|
||||||
|
<el-form-item label="加密类型" prop="type">
|
||||||
|
<el-select
|
||||||
|
v-model="item.type"
|
||||||
|
filterable
|
||||||
|
placeholder="请选择类型"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in typeList"
|
||||||
|
:key="item.dictType"
|
||||||
|
:label="item.dictValue"
|
||||||
|
:value="item.dictType"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-button @click="delItem(index)" plain type="danger" size="mini">删除</el-button>
|
||||||
|
</div>
|
||||||
|
<!-- </el-form-item> -->
|
||||||
|
<div style="text-align:center" >
|
||||||
|
<el-button @click="addItem">添加一条音/视频</el-button>
|
||||||
|
</div></div>
|
||||||
</el-form>
|
</el-form>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="handlereset">取消</el-button>
|
<el-button @click="handlereset">取消</el-button>
|
||||||
@@ -171,6 +206,18 @@ export default {
|
|||||||
dictType: "",
|
dictType: "",
|
||||||
dictValue: ""
|
dictValue: ""
|
||||||
},
|
},
|
||||||
|
typeList: [
|
||||||
|
//类型0普通1加密
|
||||||
|
|
||||||
|
{
|
||||||
|
dictType: 0,
|
||||||
|
dictValue: "普通"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dictType: 1,
|
||||||
|
dictValue: "加密"
|
||||||
|
}
|
||||||
|
],
|
||||||
gushuList: [],
|
gushuList: [],
|
||||||
authorList: [],
|
authorList: [],
|
||||||
restaurants: [],
|
restaurants: [],
|
||||||
@@ -187,10 +234,18 @@ export default {
|
|||||||
title: "",
|
title: "",
|
||||||
imgUrl: "",
|
imgUrl: "",
|
||||||
content: "",
|
content: "",
|
||||||
sort: 1
|
sort: 1,
|
||||||
|
// video_audio_url: [
|
||||||
|
// {url:'454545',type:0}
|
||||||
|
// ]
|
||||||
},
|
},
|
||||||
|
video_audio_url: [
|
||||||
|
{ video: "" ,type:0,id:0}
|
||||||
|
],
|
||||||
|
obj:{ video: "" ,type:0,id:0},
|
||||||
splitsTypeList: [],
|
splitsTypeList: [],
|
||||||
dataRule: {}
|
dataRule: {},
|
||||||
|
chapterId:null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@@ -199,6 +254,16 @@ export default {
|
|||||||
created() {},
|
created() {},
|
||||||
mounted() {},
|
mounted() {},
|
||||||
methods: {
|
methods: {
|
||||||
|
delItem(index){
|
||||||
|
this.video_audio_url.splice(index, 1)
|
||||||
|
// console.log(this.video_audio_url,'删除后的')
|
||||||
|
},
|
||||||
|
addItem() {
|
||||||
|
// var jj = {...this.obj}
|
||||||
|
console.log(this.video_audio_url.length,'this.dataForm.video_audio_url--------')
|
||||||
|
this.video_audio_url.push({'chapterId':this.chapterId, ...this.obj});
|
||||||
|
console.log(this.video_audio_url,'this.dataForm.video_audio_url')
|
||||||
|
},
|
||||||
contentUploadSuccess(res, file) {
|
contentUploadSuccess(res, file) {
|
||||||
// console.log(res)
|
// console.log(res)
|
||||||
let quill = this.$refs.myQuillEditor.quill;
|
let quill = this.$refs.myQuillEditor.quill;
|
||||||
@@ -233,6 +298,12 @@ export default {
|
|||||||
this.dataForm.courseId = courseid ? courseid : "";
|
this.dataForm.courseId = courseid ? courseid : "";
|
||||||
this.dataForm.catalogueId = catalogue_id ? catalogue_id : "";
|
this.dataForm.catalogueId = catalogue_id ? catalogue_id : "";
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
|
this.chapterId = this.dataForm.id
|
||||||
|
if(this.dataForm.videoList && this.dataForm.videoList.length > 0){
|
||||||
|
this.video_audio_url = [...this.dataForm.videoList]
|
||||||
|
}else{
|
||||||
|
// this.video_audio_url = []
|
||||||
|
}
|
||||||
if (this.dataForm.imgUrl && this.dataForm.imgUrl != "") {
|
if (this.dataForm.imgUrl && this.dataForm.imgUrl != "") {
|
||||||
var img = {
|
var img = {
|
||||||
name: "",
|
name: "",
|
||||||
@@ -267,9 +338,11 @@ export default {
|
|||||||
content: this.dataForm.content,
|
content: this.dataForm.content,
|
||||||
sort: this.dataForm.sort,
|
sort: this.dataForm.sort,
|
||||||
isAudition: this.dataForm.isAudition,
|
isAudition: this.dataForm.isAudition,
|
||||||
|
videoList:this.video_audio_url,
|
||||||
})
|
})
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
|
// this.video_audio_url = []
|
||||||
this.$message({
|
this.$message({
|
||||||
message: "操作成功",
|
message: "操作成功",
|
||||||
type: "success",
|
type: "success",
|
||||||
@@ -305,7 +378,8 @@ export default {
|
|||||||
console.log(file);
|
console.log(file);
|
||||||
},
|
},
|
||||||
handlereset() {
|
handlereset() {
|
||||||
(this.fileList = []), (this.fileListNovel = []), (this.visible = false);
|
// this.video_audio_url = []
|
||||||
|
(this.fileList = []), (this.fileListNovel = []), (this.visible = false),(this.video_audio_url = []);
|
||||||
},
|
},
|
||||||
handlePreview(file) {
|
handlePreview(file) {
|
||||||
console.log(file);
|
console.log(file);
|
||||||
@@ -345,3 +419,11 @@ export default {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.flexbox {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.videoBox { width: 100%;
|
||||||
|
margin-bottom: 15px; align-items: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -77,7 +77,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="buyPeoples"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="购买人数"
|
||||||
|
width="80"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="sort"
|
prop="sort"
|
||||||
header-align="center"
|
header-align="center"
|
||||||
@@ -142,8 +149,7 @@
|
|||||||
@click.native="handleCreateProduct(scope.row.id)"
|
@click.native="handleCreateProduct(scope.row.id)"
|
||||||
>创建商品</el-dropdown-item
|
>创建商品</el-dropdown-item
|
||||||
>
|
>
|
||||||
<el-dropdown-item
|
<el-dropdown-item @click.native="migrate(scope.row)"
|
||||||
@click.native="migrate(scope.row)"
|
|
||||||
>迁移本部</el-dropdown-item
|
>迁移本部</el-dropdown-item
|
||||||
>
|
>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
@@ -162,6 +168,11 @@
|
|||||||
ref="addOrUpdate"
|
ref="addOrUpdate"
|
||||||
@refreshDataList="getDataList"
|
@refreshDataList="getDataList"
|
||||||
></add-or-update>
|
></add-or-update>
|
||||||
|
<move-course
|
||||||
|
v-if="drawerVisible" :catalogueId="catalogueId" :catalogueTitle = "catalogueTitle"
|
||||||
|
ref="moveCourse"
|
||||||
|
@mycloseDrawer="mycloseDrawer"
|
||||||
|
></move-course>
|
||||||
<price
|
<price
|
||||||
v-if="priceVisible"
|
v-if="priceVisible"
|
||||||
ref="priceUpdate"
|
ref="priceUpdate"
|
||||||
@@ -171,6 +182,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import moveCourse from "./moveCourse.vue";
|
||||||
import AddOrUpdate from "./catalogue-add-or-update";
|
import AddOrUpdate from "./catalogue-add-or-update";
|
||||||
import price from "./catalogue-price";
|
import price from "./catalogue-price";
|
||||||
export default {
|
export default {
|
||||||
@@ -185,6 +197,7 @@ export default {
|
|||||||
sociologyId: "",
|
sociologyId: "",
|
||||||
keywords: ""
|
keywords: ""
|
||||||
},
|
},
|
||||||
|
drawerVisible: false,
|
||||||
dataList: [],
|
dataList: [],
|
||||||
delFlag: false,
|
delFlag: false,
|
||||||
pageIndex: 1,
|
pageIndex: 1,
|
||||||
@@ -196,12 +209,16 @@ export default {
|
|||||||
priceVisible: false,
|
priceVisible: false,
|
||||||
urlList: {
|
urlList: {
|
||||||
createProduct: "/master/course/createProductForCatalogue"
|
createProduct: "/master/course/createProductForCatalogue"
|
||||||
}
|
},
|
||||||
|
catalogueId:null, // 操作的目录id,
|
||||||
|
courseId:null, // 勾选的课程id,
|
||||||
|
catalogueTitle:'' //迁移的课程名称
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
AddOrUpdate,
|
AddOrUpdate,
|
||||||
price
|
price,
|
||||||
|
moveCourse
|
||||||
},
|
},
|
||||||
activated() {
|
activated() {
|
||||||
this.courseid = this.$route.query.id;
|
this.courseid = this.$route.query.id;
|
||||||
@@ -238,24 +255,29 @@ export default {
|
|||||||
this.dataListLoading = false;
|
this.dataListLoading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
migrate(item){
|
mycloseDrawer(val) {
|
||||||
|
console.log("999999", val);
|
||||||
|
this.drawerVisible = false;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
migrate(item) {
|
||||||
// 课程迁移
|
// 课程迁移
|
||||||
console.log(item)
|
// console.log(item);
|
||||||
this.$confirm('您正在进行课程迁移操作, 是否继续?', '提示', {
|
|
||||||
confirmButtonText: '确定',
|
// this.$confirm("您正在进行课程迁移操作, 是否继续?", "提示", {
|
||||||
cancelButtonText: '取消',
|
// confirmButtonText: "确定",
|
||||||
type: 'warning'
|
// cancelButtonText: "取消",
|
||||||
}).then(() => {
|
// type: "warning"
|
||||||
// this.$message({
|
// })
|
||||||
// type: 'success',
|
// .then(() => {
|
||||||
// message: '删除成功!'
|
this.catalogueId = item.id
|
||||||
// });
|
this.catalogueTitle = item.title
|
||||||
}).catch(() => {
|
this.drawerVisible = true;
|
||||||
// this.$message({
|
this.$nextTick(() => {
|
||||||
// type: 'info',
|
this.$refs["moveCourse"].getDataList();
|
||||||
// message: '已取消删除'
|
});
|
||||||
// });
|
// })
|
||||||
})
|
// .catch(() => {});
|
||||||
},
|
},
|
||||||
// 每页数
|
// 每页数
|
||||||
sizeChangeHandle(val) {
|
sizeChangeHandle(val) {
|
||||||
@@ -281,7 +303,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleCreateProduct(id) {
|
handleCreateProduct(id) {
|
||||||
console.log('id at line 260:', id)
|
console.log("id at line 260:", id);
|
||||||
this.$http
|
this.$http
|
||||||
.request({
|
.request({
|
||||||
url: this.$http.adornUrl(`${this.urlList.createProduct}`),
|
url: this.$http.adornUrl(`${this.urlList.createProduct}`),
|
||||||
|
|||||||
@@ -67,6 +67,11 @@
|
|||||||
align="center"
|
align="center"
|
||||||
label="课程名"
|
label="课程名"
|
||||||
>
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div>
|
||||||
|
<span>{{ scope.row.title }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<!-- <el-table-column prop="authorName" header-align="center" align="center" label="作者姓名">
|
<!-- <el-table-column prop="authorName" header-align="center" align="center" label="作者姓名">
|
||||||
@@ -163,10 +168,7 @@
|
|||||||
width="600"
|
width="600"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div
|
<div style=" " v-if="scope.row.courseCatalogueEntityList.length == 0">
|
||||||
style=" "
|
|
||||||
v-if="scope.row.courseCatalogueEntityList.length == 0"
|
|
||||||
>
|
|
||||||
该课程还未添加目录
|
该课程还未添加目录
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
@@ -183,7 +185,6 @@
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
style="width: 90px;float: left;font-weight: 800;border: 1px solid #bbbb; border-radius: 4px;line-height: 30px;"
|
style="width: 90px;float: left;font-weight: 800;border: 1px solid #bbbb; border-radius: 4px;line-height: 30px;"
|
||||||
|
|
||||||
>
|
>
|
||||||
<!-- <el-tag type="success" > -->
|
<!-- <el-tag type="success" > -->
|
||||||
{{ v.title }}
|
{{ v.title }}
|
||||||
@@ -198,10 +199,13 @@
|
|||||||
}px);float: right;`
|
}px);float: right;`
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<div v-if="v.productList.length==0">
|
<div v-if="v.productList.length == 0">
|
||||||
暂未关联商品
|
暂未关联商品
|
||||||
</div>
|
</div>
|
||||||
<div v-for="(item, i) in v.productList" v-if="v.productList.length>0">
|
<div
|
||||||
|
v-for="(item, i) in v.productList"
|
||||||
|
v-if="v.productList.length > 0"
|
||||||
|
>
|
||||||
{{ item.productName }}
|
{{ item.productName }}
|
||||||
<span style="color: #ff5b36;"
|
<span style="color: #ff5b36;"
|
||||||
>¥{{
|
>¥{{
|
||||||
@@ -252,7 +256,7 @@
|
|||||||
fixed="right"
|
fixed="right"
|
||||||
header-align="center"
|
header-align="center"
|
||||||
align="center"
|
align="center"
|
||||||
width="160"
|
width="240"
|
||||||
label="操作"
|
label="操作"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@@ -306,6 +310,9 @@
|
|||||||
@click="addOrUpdateHandle(scope.row)"
|
@click="addOrUpdateHandle(scope.row)"
|
||||||
>修改</el-button
|
>修改</el-button
|
||||||
>
|
>
|
||||||
|
<el-button type="text" size="small" @click="showLinkTags(scope.row)"
|
||||||
|
>查看引用</el-button
|
||||||
|
>
|
||||||
<el-button
|
<el-button
|
||||||
type="text"
|
type="text"
|
||||||
size="small"
|
size="small"
|
||||||
@@ -333,6 +340,44 @@
|
|||||||
ref="addOrUpdate"
|
ref="addOrUpdate"
|
||||||
@refreshDataList="getDataList"
|
@refreshDataList="getDataList"
|
||||||
></add-or-update>
|
></add-or-update>
|
||||||
|
<el-dialog
|
||||||
|
title="课程引用一览"
|
||||||
|
:visible.sync="resListVisible"
|
||||||
|
width="60%"
|
||||||
|
@close="closeLink"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<div v-if="resList.length > 0">
|
||||||
|
<div style="margin-bottom:20px">当前课程共有 {{resList.length}} 个标签引用</div>
|
||||||
|
<div v-for="(item, index) in resList" :key="index">
|
||||||
|
{{index + 1}}、 {{ item.title }}
|
||||||
|
<span v-if="item.isLast != 1">
|
||||||
|
<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-if="item2.isLast != 1">
|
||||||
|
<span
|
||||||
|
v-for="(item3, index3) in item2.children"
|
||||||
|
:key="index3"
|
||||||
|
> > {{ item3.title }}</span
|
||||||
|
>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else>这门课程还没有被标签引用哦~</div>
|
||||||
|
</div>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="closeLink">好 的</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -379,7 +424,9 @@ export default {
|
|||||||
urlList: {
|
urlList: {
|
||||||
medicalList: "/master/courseMedical/getCourseMedicalList", //医学
|
medicalList: "/master/courseMedical/getCourseMedicalList", //医学
|
||||||
sociologyList: "/master/courseSociology/getCourseSociologyList" //国学
|
sociologyList: "/master/courseSociology/getCourseSociologyList" //国学
|
||||||
}
|
},
|
||||||
|
resList: [],
|
||||||
|
resListVisible: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@@ -395,6 +442,27 @@ export default {
|
|||||||
this.getTreeList(this.urlList.sociologyList, 2);
|
this.getTreeList(this.urlList.sociologyList, 2);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
closeLink() {
|
||||||
|
this.resListVisible = false;
|
||||||
|
this.resList = [];
|
||||||
|
},
|
||||||
|
showLinkTags(row) {
|
||||||
|
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/master/course/getCourseLableLinkList"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData({
|
||||||
|
courseId: row.id
|
||||||
|
})
|
||||||
|
}).then(res => {
|
||||||
|
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);
|
||||||
|
});
|
||||||
|
},
|
||||||
handleChange(value) {
|
handleChange(value) {
|
||||||
console.log(value, "989999999");
|
console.log(value, "989999999");
|
||||||
},
|
},
|
||||||
|
|||||||
288
src/views/modules/course/moveCourse.vue
Normal file
288
src/views/modules/course/moveCourse.vue
Normal file
@@ -0,0 +1,288 @@
|
|||||||
|
<template>
|
||||||
|
<el-drawer
|
||||||
|
ref="drawer"
|
||||||
|
title="课程迁移"
|
||||||
|
:visible.sync="drawerVisible"
|
||||||
|
direction="rtl"
|
||||||
|
:before-close="drawerHandleClose"
|
||||||
|
>
|
||||||
|
<!-- ------------------------- -->
|
||||||
|
<div style="padding:15px">
|
||||||
|
<el-form
|
||||||
|
:inline="true"
|
||||||
|
:model="dataForm"
|
||||||
|
@keyup.enter.native="getDataList()"
|
||||||
|
>
|
||||||
|
<div style="display:flex;align-items:end">
|
||||||
|
<el-form-item label="课程名称">
|
||||||
|
<el-input
|
||||||
|
v-model="query.courseName"
|
||||||
|
placeholder="课程名称"
|
||||||
|
clearable
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="平台分类">
|
||||||
|
<el-cascader
|
||||||
|
clearable
|
||||||
|
:props="{
|
||||||
|
label: 'title',
|
||||||
|
value: 'id',
|
||||||
|
checkStrictly: true
|
||||||
|
}"
|
||||||
|
v-model="selectType"
|
||||||
|
:options="options"
|
||||||
|
>
|
||||||
|
</el-cascader>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label=" ">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
@click="
|
||||||
|
pageIndex = 1;
|
||||||
|
getDataList();
|
||||||
|
"
|
||||||
|
>查询</el-button
|
||||||
|
>
|
||||||
|
<!-- <el-button type="primary" @click="addOrUpdateHandle()"
|
||||||
|
>新增</el-button
|
||||||
|
> -->
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</el-form>
|
||||||
|
<el-table
|
||||||
|
:data="dataList"
|
||||||
|
border
|
||||||
|
v-loading="dataListLoading"
|
||||||
|
style="width: 100%;"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55"> </el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="title"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="课程名"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div>
|
||||||
|
<span>{{ scope.row.title }}</span>
|
||||||
|
<!-- <el-tooltip placement="bottom" effect="light">
|
||||||
|
<div slot="content">多行信息<br />第二行信息多行信息<br />第二行信息多行信息<br />第二行信息多行信息第二行信息多行信息第二行信息</div>
|
||||||
|
<i
|
||||||
|
class="el-icon-paperclip"
|
||||||
|
style=" color:#17B3A3; margin-left:15px"
|
||||||
|
></i>
|
||||||
|
</el-tooltip> -->
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-pagination
|
||||||
|
@size-change="sizeChangeHandle"
|
||||||
|
@current-change="currentChangeHandle"
|
||||||
|
:current-page="pageIndex"
|
||||||
|
:page-sizes="[10, 20, 50, 100]"
|
||||||
|
:page-size="pageSize"
|
||||||
|
:total="totalPage"
|
||||||
|
style="padding: 30px 0; text-align: center;"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
>
|
||||||
|
</el-pagination>
|
||||||
|
<div style="text-align:center">
|
||||||
|
<el-button type="primary" @click="moveCourseBtn">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- ----------------------------- -->
|
||||||
|
</el-drawer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: ["catalogueId","catalogueTitle"],
|
||||||
|
data() {
|
||||||
|
|
||||||
|
return {
|
||||||
|
drawerVisible: true,
|
||||||
|
selectType: [],
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
id: "all",
|
||||||
|
title: "全部",
|
||||||
|
children: undefined
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
title: "医学",
|
||||||
|
children: []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
title: "国学",
|
||||||
|
children: []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
dataForm: {
|
||||||
|
key: ""
|
||||||
|
},
|
||||||
|
multipleSelection: [],
|
||||||
|
query: {
|
||||||
|
type: "",
|
||||||
|
categoryId: "",
|
||||||
|
sociologyId: "",
|
||||||
|
courseName: ""
|
||||||
|
},
|
||||||
|
dataList: [],
|
||||||
|
delFlag: false,
|
||||||
|
pageIndex: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
totalPage: 0,
|
||||||
|
dataListLoading: false,
|
||||||
|
dataListSelections: [],
|
||||||
|
addOrUpdateVisible: false,
|
||||||
|
urlList: {
|
||||||
|
medicalList: "/master/courseMedical/getCourseMedicalList", //医学
|
||||||
|
sociologyList: "/master/courseSociology/getCourseSociologyList" //国学
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init() {},
|
||||||
|
drawerHandleClose() {
|
||||||
|
this.$emit("mycloseDrawer", "drawer");
|
||||||
|
},
|
||||||
|
handleSelectionChange(val) {
|
||||||
|
if (val.length > 1) {
|
||||||
|
this.$message.error("只可以选择一门课程进行迁移哦~");
|
||||||
|
} else {
|
||||||
|
this.multipleSelection = val;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(22, this.multipleSelection);
|
||||||
|
},
|
||||||
|
moveCourseBtn() {
|
||||||
|
if (this.multipleSelection.length == 0) {
|
||||||
|
this.$message.error("请选择您要迁移的目标课程!");
|
||||||
|
} else if (this.multipleSelection.length > 1) {
|
||||||
|
this.$message.error("只可以选择一门课程进行迁移哦~");
|
||||||
|
} else {
|
||||||
|
this.$confirm(
|
||||||
|
`${this.catalogueTitle}目录 即将迁移到 ${this.multipleSelection[0].title}课程内, 是否继续?`,
|
||||||
|
{
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning"
|
||||||
|
}
|
||||||
|
).then(() => {
|
||||||
|
|
||||||
|
if(!this.catalogueId){
|
||||||
|
this.$message.error('请重新选择您要转移的课程目录')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// console.log(this.catalogueId, this.multipleSelection[0].id)
|
||||||
|
// 走接口 并关闭
|
||||||
|
this.$http
|
||||||
|
.request({
|
||||||
|
url: this.$http.adornUrl(
|
||||||
|
`/master/course/courseCatalogueTransfer`
|
||||||
|
),
|
||||||
|
method: "POST",
|
||||||
|
data: {
|
||||||
|
courseId: this.multipleSelection[0].id, //新课程id
|
||||||
|
catalogueId: this.catalogueId //目录id
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
//默认 无 说明:请求头
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
|
console.log("********:", res);
|
||||||
|
this.$message.success('操作成功')
|
||||||
|
this.drawerHandleClose()
|
||||||
|
}).catch(()=>{
|
||||||
|
this.$message.error('操作失败')
|
||||||
|
});
|
||||||
|
|
||||||
|
// this.$nextTick(() => {
|
||||||
|
// this.$refs["moveCourse"].getDataList();
|
||||||
|
// });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// checkSelectable(row){
|
||||||
|
// return row.auditStatus === '0'
|
||||||
|
// console.log(row,'row')
|
||||||
|
// },
|
||||||
|
// 获取数据列表
|
||||||
|
getDataList() {
|
||||||
|
var data = {
|
||||||
|
page: this.pageIndex,
|
||||||
|
limit: this.pageSize,
|
||||||
|
courseName: this.query.courseName //关键字
|
||||||
|
};
|
||||||
|
|
||||||
|
if (this.selectType.length == 0) {
|
||||||
|
data.type = 0;
|
||||||
|
data.medicalId = "";
|
||||||
|
data.sociologyId = "";
|
||||||
|
} else if (this.selectType.length >= 1) {
|
||||||
|
data.type = this.selectType[0] == "all" ? 0 : this.selectType[0];
|
||||||
|
if (this.selectType.length == 1) {
|
||||||
|
data.medicalId = "";
|
||||||
|
data.sociologyId = "";
|
||||||
|
}
|
||||||
|
if (this.selectType.length > 1) {
|
||||||
|
if (this.selectType[0] == 1) {
|
||||||
|
data.medicalId = this.selectType[this.selectType.length - 1];
|
||||||
|
data.sociologyId = "";
|
||||||
|
}
|
||||||
|
if (this.selectType[0] == 2) {
|
||||||
|
data.medicalId = "";
|
||||||
|
data.sociologyId = this.selectType[this.selectType.length - 1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.dataListLoading = true;
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/master/course/getCourseList"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData(data)
|
||||||
|
}).then(({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
this.dataList = data.page.records;
|
||||||
|
this.totalPage = data.page.total;
|
||||||
|
} else {
|
||||||
|
this.dataList = [];
|
||||||
|
this.totalPage = 0;
|
||||||
|
}
|
||||||
|
this.dataListLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 每页数
|
||||||
|
sizeChangeHandle(val) {
|
||||||
|
this.pageSize = val;
|
||||||
|
this.pageIndex = 1;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
// 当前页
|
||||||
|
currentChangeHandle(val) {
|
||||||
|
this.pageIndex = val;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
// 多选
|
||||||
|
selectionChangeHandle(val) {
|
||||||
|
this.dataListSelections = val;
|
||||||
|
}
|
||||||
|
// 新增 / 修改
|
||||||
|
// addOrUpdateHandle(row) {
|
||||||
|
// this.addOrUpdateVisible = true;
|
||||||
|
// this.$nextTick(() => {
|
||||||
|
// this.$refs.addOrUpdate.init(row);
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style></style>
|
||||||
@@ -404,6 +404,7 @@ export default {
|
|||||||
this.$message.error("请输入标签名称");
|
this.$message.error("请输入标签名称");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
this.addForm.content = ''
|
||||||
await this.$refs[formName].validate(async valid => {
|
await this.$refs[formName].validate(async valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
await this.$http({
|
await this.$http({
|
||||||
|
|||||||
Reference in New Issue
Block a user