功能细化

This commit is contained in:
@fawn-nine
2024-06-12 16:41:22 +08:00
parent 83987414aa
commit 3e8e5cf7e4
5 changed files with 163 additions and 60 deletions

View File

@@ -91,16 +91,18 @@
</quill-editor>
</el-form-item>
<!-- <el-form-item prop="sort" label-width="0"> -->
<div v-if="this.dataForm.id">
<div
class="flexbox videoBox"
v-for="(item, index) in video_audio_url"
:key="index"
>
<div style="width:120px">视频/音频ID</div>
<div style="width:120px">视频/音频ID</div>
<div style="width:300px; margin-right:10px; margin-left:10px">
<el-input
style=""
v-model="item.url"
v-model="item.video"
placeholder="请输入视频/音频ID"
></el-input>
</div>
@@ -125,9 +127,9 @@
<el-button @click="delItem(index)" plain type="danger" size="mini">删除</el-button>
</div>
<!-- </el-form-item> -->
<div style="text-align:center">
<div style="text-align:center" >
<el-button @click="addItem">添加一条音/视频</el-button>
</div>
</div></div>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="handlereset">取消</el-button>
@@ -238,11 +240,12 @@ export default {
// ]
},
video_audio_url: [
{url:'454545',type:0}
{ video: "" ,type:0,id:0}
],
obj:{ url: "" ,type:0},
obj:{ video: "" ,type:0,id:0},
splitsTypeList: [],
dataRule: {}
dataRule: {},
chapterId:null,
};
},
components: {
@@ -256,9 +259,9 @@ export default {
// console.log(this.video_audio_url,'删除后的')
},
addItem() {
var jj = {...this.obj}
this.video_audio_url.push({...jj});
// 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) {
@@ -295,10 +298,11 @@ export default {
this.dataForm.courseId = courseid ? courseid : "";
this.dataForm.catalogueId = catalogue_id ? catalogue_id : "";
this.visible = true;
if(this.dataForm.video_audio_url && this.dataForm.video_audio_url.length > 0){
this.video_audio_url = {...this.dataForm.video_audio_url}
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 = []
// this.video_audio_url = []
}
if (this.dataForm.imgUrl && this.dataForm.imgUrl != "") {
var img = {
@@ -334,10 +338,11 @@ export default {
content: this.dataForm.content,
sort: this.dataForm.sort,
isAudition: this.dataForm.isAudition,
video_audio_url:this.video_audio_url,
videoList:this.video_audio_url,
})
}).then(({ data }) => {
if (data && data.code === 0) {
// this.video_audio_url = []
this.$message({
message: "操作成功",
type: "success",
@@ -373,7 +378,8 @@ export default {
console.log(file);
},
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) {
console.log(file);

View File

@@ -77,7 +77,14 @@
</div>
</template>
</el-table-column>
<el-table-column
prop="buyPeoples"
header-align="center"
align="center"
label="购买人数"
width="80"
>
</el-table-column>
<el-table-column
prop="sort"
header-align="center"
@@ -142,8 +149,7 @@
@click.native="handleCreateProduct(scope.row.id)"
>创建商品</el-dropdown-item
>
<el-dropdown-item
@click.native="migrate(scope.row)"
<el-dropdown-item @click.native="migrate(scope.row)"
>迁移本部</el-dropdown-item
>
</el-dropdown-menu>
@@ -163,8 +169,9 @@
@refreshDataList="getDataList"
></add-or-update>
<move-course
v-if="drawerVisible"
ref="moveCourse" @mycloseDrawer="mycloseDrawer"
v-if="drawerVisible" :catalogueId="catalogueId" :catalogueTitle = "catalogueTitle"
ref="moveCourse"
@mycloseDrawer="mycloseDrawer"
></move-course>
<price
v-if="priceVisible"
@@ -190,7 +197,7 @@ export default {
sociologyId: "",
keywords: ""
},
drawerVisible:false,
drawerVisible: false,
dataList: [],
delFlag: false,
pageIndex: 1,
@@ -202,7 +209,10 @@ export default {
priceVisible: false,
urlList: {
createProduct: "/master/course/createProductForCatalogue"
}
},
catalogueId:null, // 操作的目录id,
courseId:null, // 勾选的课程id,
catalogueTitle:'' //迁移的课程名称
};
},
components: {
@@ -245,30 +255,29 @@ export default {
this.dataListLoading = false;
});
},
mycloseDrawer(val){
console.log('999999',val)
this.drawerVisible = false
this.getDataList()
mycloseDrawer(val) {
console.log("999999", val);
this.drawerVisible = false;
this.getDataList();
},
migrate(item){
migrate(item) {
// 课程迁移
console.log(item)
this.$confirm('您正在进行课程迁移操作, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.drawerVisible = true
this.$nextTick(() => {
this.$refs["moveCourse"].getDataList();
});
// this.$message({
// type: 'success',
// message: '删除成功!'
// });
}).catch(() => {
// console.log(item);
})
// this.$confirm("您正在进行课程迁移操作, 是否继续?", "提示", {
// confirmButtonText: "确定",
// cancelButtonText: "取消",
// type: "warning"
// })
// .then(() => {
this.catalogueId = item.id
this.catalogueTitle = item.title
this.drawerVisible = true;
this.$nextTick(() => {
this.$refs["moveCourse"].getDataList();
});
// })
// .catch(() => {});
},
// 每页数
sizeChangeHandle(val) {
@@ -294,7 +303,7 @@ export default {
});
},
handleCreateProduct(id) {
console.log('id at line 260:', id)
console.log("id at line 260:", id);
this.$http
.request({
url: this.$http.adornUrl(`${this.urlList.createProduct}`),

View File

@@ -70,13 +70,6 @@
<template slot-scope="scope">
<div>
<span>{{ scope.row.title }}</span>
<el-tooltip placement="bottom" effect="light">
<div slot="content">多行信息<br />第二行信息多行信息<br />第二行信息多行信息<br />第二行信息多行信息第二行信息多行信息<br />第二行信息</div>
<i
class="el-icon-paperclip"
style=" color:#17B3A3; margin-left:15px"
></i>
</el-tooltip>
</div>
</template>
</el-table-column>
@@ -263,7 +256,7 @@
fixed="right"
header-align="center"
align="center"
width="160"
width="240"
label="操作"
>
<template slot-scope="scope">
@@ -317,6 +310,9 @@
@click="addOrUpdateHandle(scope.row)"
>修改</el-button
>
<el-button type="text" size="small" @click="showLinkTags(scope.row)"
>查看引用</el-button
>
<el-button
type="text"
size="small"
@@ -344,6 +340,44 @@
ref="addOrUpdate"
@refreshDataList="getDataList"
></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>
</template>
@@ -390,7 +424,9 @@ export default {
urlList: {
medicalList: "/master/courseMedical/getCourseMedicalList", //医学
sociologyList: "/master/courseSociology/getCourseSociologyList" //国学
}
},
resList: [],
resListVisible: false
};
},
components: {
@@ -406,6 +442,27 @@ export default {
this.getTreeList(this.urlList.sociologyList, 2);
},
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) {
console.log(value, "989999999");
},

View File

@@ -98,7 +98,9 @@
<script>
export default {
props: ["catalogueId","catalogueTitle"],
data() {
return {
drawerVisible: true,
selectType: [],
@@ -164,15 +166,43 @@ export default {
this.$message.error("只可以选择一门课程进行迁移哦~");
} else {
this.$confirm(
`即将迁移到 ${this.multipleSelection[0].title}课程内, 是否继续?'`,
`${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.drawerHandleClose()
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();
// });

View File

@@ -404,6 +404,7 @@ export default {
this.$message.error("请输入标签名称");
return false;
}
this.addForm.content = ''
await this.$refs[formName].validate(async valid => {
if (valid) {
await this.$http({