功能细化

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> </quill-editor>
</el-form-item> </el-form-item>
<!-- <el-form-item prop="sort" label-width="0"> --> <!-- <el-form-item prop="sort" label-width="0"> -->
<div v-if="this.dataForm.id">
<div <div
class="flexbox videoBox" class="flexbox videoBox"
v-for="(item, index) in video_audio_url" v-for="(item, index) in video_audio_url"
:key="index" :key="index"
> >
<div style="width:120px">视频/音频ID</div> <div style="width:120px">视频/音频ID</div>
<div style="width:300px; margin-right:10px; margin-left:10px"> <div style="width:300px; margin-right:10px; margin-left:10px">
<el-input <el-input
style="" style=""
v-model="item.url" v-model="item.video"
placeholder="请输入视频/音频ID" placeholder="请输入视频/音频ID"
></el-input> ></el-input>
</div> </div>
@@ -127,7 +129,7 @@
<!-- </el-form-item> --> <!-- </el-form-item> -->
<div style="text-align:center" > <div style="text-align:center" >
<el-button @click="addItem">添加一条音/视频</el-button> <el-button @click="addItem">添加一条音/视频</el-button>
</div> </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>
@@ -238,11 +240,12 @@ export default {
// ] // ]
}, },
video_audio_url: [ video_audio_url: [
{url:'454545',type:0} { video: "" ,type:0,id:0}
], ],
obj:{ url: "" ,type:0}, obj:{ video: "" ,type:0,id:0},
splitsTypeList: [], splitsTypeList: [],
dataRule: {} dataRule: {},
chapterId:null,
}; };
}, },
components: { components: {
@@ -256,9 +259,9 @@ export default {
// console.log(this.video_audio_url,'删除后的') // console.log(this.video_audio_url,'删除后的')
}, },
addItem() { addItem() {
var jj = {...this.obj} // var jj = {...this.obj}
console.log(this.video_audio_url.length,'this.dataForm.video_audio_url--------')
this.video_audio_url.push({...jj}); this.video_audio_url.push({'chapterId':this.chapterId, ...this.obj});
console.log(this.video_audio_url,'this.dataForm.video_audio_url') console.log(this.video_audio_url,'this.dataForm.video_audio_url')
}, },
contentUploadSuccess(res, file) { contentUploadSuccess(res, file) {
@@ -295,10 +298,11 @@ 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;
if(this.dataForm.video_audio_url && this.dataForm.video_audio_url.length > 0){ this.chapterId = this.dataForm.id
this.video_audio_url = {...this.dataForm.video_audio_url} if(this.dataForm.videoList && this.dataForm.videoList.length > 0){
this.video_audio_url = [...this.dataForm.videoList]
}else{ }else{
this.video_audio_url = [] // this.video_audio_url = []
} }
if (this.dataForm.imgUrl && this.dataForm.imgUrl != "") { if (this.dataForm.imgUrl && this.dataForm.imgUrl != "") {
var img = { var img = {
@@ -334,10 +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,
video_audio_url:this.video_audio_url, 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",
@@ -373,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);

View File

@@ -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>
@@ -163,8 +169,9 @@
@refreshDataList="getDataList" @refreshDataList="getDataList"
></add-or-update> ></add-or-update>
<move-course <move-course
v-if="drawerVisible" v-if="drawerVisible" :catalogueId="catalogueId" :catalogueTitle = "catalogueTitle"
ref="moveCourse" @mycloseDrawer="mycloseDrawer" ref="moveCourse"
@mycloseDrawer="mycloseDrawer"
></move-course> ></move-course>
<price <price
v-if="priceVisible" v-if="priceVisible"
@@ -202,7 +209,10 @@ 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: {
@@ -246,29 +256,28 @@ export default {
}); });
}, },
mycloseDrawer(val) { mycloseDrawer(val) {
console.log('999999',val) console.log("999999", val);
this.drawerVisible = false this.drawerVisible = false;
this.getDataList() this.getDataList();
}, },
migrate(item) { migrate(item) {
// 课程迁移 // 课程迁移
console.log(item) // console.log(item);
this.$confirm('您正在进行课程迁移操作, 是否继续?', '提示', {
confirmButtonText: '确定', // this.$confirm("您正在进行课程迁移操作, 是否继续?", "提示", {
cancelButtonText: '取消', // confirmButtonText: "确定",
type: 'warning' // cancelButtonText: "取消",
}).then(() => { // type: "warning"
this.drawerVisible = true // })
// .then(() => {
this.catalogueId = item.id
this.catalogueTitle = item.title
this.drawerVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs["moveCourse"].getDataList(); this.$refs["moveCourse"].getDataList();
}); });
// this.$message({ // })
// type: 'success', // .catch(() => {});
// message: '删除成功!'
// });
}).catch(() => {
})
}, },
// 每页数 // 每页数
sizeChangeHandle(val) { sizeChangeHandle(val) {
@@ -294,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}`),

View File

@@ -70,13 +70,6 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
<span>{{ scope.row.title }}</span> <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> </div>
</template> </template>
</el-table-column> </el-table-column>
@@ -263,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">
@@ -317,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"
@@ -344,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>
@@ -390,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: {
@@ -406,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");
}, },

View File

@@ -98,7 +98,9 @@
<script> <script>
export default { export default {
props: ["catalogueId","catalogueTitle"],
data() { data() {
return { return {
drawerVisible: true, drawerVisible: true,
selectType: [], selectType: [],
@@ -164,15 +166,43 @@ export default {
this.$message.error("只可以选择一门课程进行迁移哦~"); this.$message.error("只可以选择一门课程进行迁移哦~");
} else { } else {
this.$confirm( this.$confirm(
`即将迁移到 ${this.multipleSelection[0].title}课程内, 是否继续?'`, `${this.catalogueTitle}目录 即将迁移到 ${this.multipleSelection[0].title}课程内, 是否继续?`,
{ {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
} }
).then(() => { ).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() this.drawerHandleClose()
}).catch(()=>{
this.$message.error('操作失败')
});
// this.$nextTick(() => { // this.$nextTick(() => {
// this.$refs["moveCourse"].getDataList(); // this.$refs["moveCourse"].getDataList();
// }); // });

View File

@@ -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({