1、课程加图片

2、新增运营标签绑定课程
This commit is contained in:
2024-04-19 10:34:01 +08:00
parent bb89348ea7
commit 298edb2c53
10 changed files with 5155 additions and 408 deletions

View File

@@ -1,13 +1,50 @@
<template>
<el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible"
@close="handlereset">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="80px">
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible"
@close="handlereset"
>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
label-width="80px"
>
<el-form-item label="课程名" prop="title">
<el-input v-model="dataForm.title" placeholder="课程名"></el-input>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model="dataForm.sort" placeholder="排序"></el-input>
</el-form-item>
<el-form-item
label="课程图"
prop="image"
:class="fileList.length > 0 ? 'isUpload' : ''"
>
<el-upload
:limit="1"
class="el-uploadfeng "
:class="{
uoloadSty: dataForm.showBtnDealImg,
disUoloadSty: dataForm.noneBtnImg
}"
:action="baseUrl + '/oss/fileoss'"
list-type="picture-card"
:on-preview="handlePictureCardPreview"
:file-list="fileList"
:on-success="handlePicSuccess"
accept=".jpeg,.jpg,.gif,.png"
:on-remove="handleRemove"
>
<i class="el-icon-plus"></i>
</el-upload>
<el-dialog :visible.sync="dialogVisible" :append-to-body="true">
<img width="100%" :src="dataForm.image" alt="" />
</el-dialog>
</el-form-item>
<!-- <el-row>
<el-col :span="12">
<el-form-item label="作者" prop="authorId">
@@ -136,281 +173,303 @@
</el-dialog>
</template>
<script>
import global from '../../common/common.vue' //引入共用组间
export default {
data() {
return {
baseUrl: global.baseUrl,
visible: false,
bookList: [{
dictType: 0,
dictValue: "普通"
},
{
dictType: 1,
dictValue: "中医经典"
},
{
dictType: 2,
dictValue: "国学经典"
}
],
medicaldesBookTypeList: [{
dictType: 1,
dictValue: "中医基础"
},
{
dictType: 2,
dictValue: "中医经典"
},
{
dictType: 3,
dictValue: "各家学说"
},
{
dictType: 4,
dictValue: "中医临床"
},
{
dictType: 5,
dictValue: "文学"
},
{
dictType: 6,
dictValue: "哲学"
},
],
props: {
dictType: '',
dictValue: ''
import global from "../../common/common.vue"; //引入共用组间
export default {
data() {
return {
baseUrl: global.baseUrl,
visible: false,
bookList: [
{
dictType: 0,
dictValue: "普通"
},
gushuList:[],
authorList: [],
restaurants: [],
author: '',
publisherList: [],
fileList: [],
fileListNovel: [],
dialogImageUrl: '',
dialogVisible: false,
dataForm: {
id: 0,
title: '',
// publisherName: '',
// splits: 0,
// authorId: [],
// description: '',
// title: '',
// bookType: 0,
// content: '',
// type: [],
// medicaldesBookType: [],
// // price: '',
// salePrice: '',
// // istop: '',
// isVip: 0,
// freeChapterCount: 0,
// // isSale: '',
// publisherId: [],
// images: '',
// pid: '',
// level: '',
// createTime: '',
// updateTime: '',
// sort: '',
// delFlag: '',
// novel: '',
// canListen: false,
// clockIn: 2,
// teachIn: 0,
// relationId:0,
{
dictType: 1,
dictValue: "中医经典"
},
splitsTypeList: [],
dataRule: {
// name: [
// { required: true, message: '书名不能为空', trigger: 'blur' }
// ],
// authorId: [
// { required: true, message: '作者id不能为空', trigger: 'blur' }
// ],
// description: [
// { required: true, message: '简介不能为空', trigger: 'blur' }
// ],
// title: [
// { required: true, message: '序言不能为空', trigger: 'blur' }
// ],
// content: [
// { required: true, message: '内容不能为空', trigger: 'blur' }
// ],
// type: [
// { required: true, message: '类型不能为空', trigger: 'blur' }
// ],
// price: [
// { required: true, message: '价格不能为空', trigger: 'blur' }
// ],
// istop: [
// { required: true, message: '置顶不能为空', trigger: 'blur' }
// ],
// publisherId: [
// { required: true, message: '出版商id不能为空', trigger: 'blur' }
// ],
// images: [
// { required: true, message: '插图不能为空', trigger: 'blur' }
// ],
// pid: [
// { required: true, message: '父id不能为空', trigger: 'blur' }
// ],
// level: [
// { required: true, message: '层级不能为空', trigger: 'blur' }
// ],
// createTime: [
// { required: true, message: '创建日期不能为空', trigger: 'blur' }
// ],
// updateTime: [
// { required: true, message: '更新日期不能为空', trigger: 'blur' }
// ],
// sort: [
// { required: true, message: '排序不能为空', trigger: 'blur' }
// ],
// splits: [
// { required: true, message: '拆分类类型不能为空', trigger: 'blur' }
// ]
{
dictType: 2,
dictValue: "国学经典"
}
],
medicaldesBookTypeList: [
{
dictType: 1,
dictValue: "中医基础"
},
{
dictType: 2,
dictValue: "中医经典"
},
{
dictType: 3,
dictValue: "各家学说"
},
{
dictType: 4,
dictValue: "中医临床"
},
{
dictType: 5,
dictValue: "文学"
},
{
dictType: 6,
dictValue: "哲学"
}
],
props: {
dictType: "",
dictValue: ""
},
gushuList: [],
authorList: [],
restaurants: [],
author: "",
publisherList: [],
fileList: [],
fileListNovel: [],
dialogImageUrl: "",
dialogVisible: false,
dataForm: {
id: 0,
title: ""
// publisherName: '',
// splits: 0,
// authorId: [],
// description: '',
// title: '',
// bookType: 0,
// content: '',
// type: [],
// medicaldesBookType: [],
// // price: '',
// salePrice: '',
// // istop: '',
// isVip: 0,
// freeChapterCount: 0,
// // isSale: '',
// publisherId: [],
// images: '',
// pid: '',
// level: '',
// createTime: '',
// updateTime: '',
// sort: '',
// delFlag: '',
// novel: '',
// canListen: false,
// clockIn: 2,
// teachIn: 0,
// relationId:0,
},
splitsTypeList: [],
dataRule: {
// name: [
// { required: true, message: '书名不能为空', trigger: 'blur' }
// ],
// authorId: [
// { required: true, message: '作者id不能为空', trigger: 'blur' }
// ],
// description: [
// { required: true, message: '简介不能为空', trigger: 'blur' }
// ],
// title: [
// { required: true, message: '序言不能为空', trigger: 'blur' }
// ],
// content: [
// { required: true, message: '内容不能为空', trigger: 'blur' }
// ],
// type: [
// { required: true, message: '类型不能为空', trigger: 'blur' }
// ],
// price: [
// { required: true, message: '价格不能为空', trigger: 'blur' }
// ],
// istop: [
// { required: true, message: '置顶不能为空', trigger: 'blur' }
// ],
// publisherId: [
// { required: true, message: '出版商id不能为空', trigger: 'blur' }
// ],
// images: [
// { required: true, message: '插图不能为空', trigger: 'blur' }
// ],
// pid: [
// { required: true, message: '父id不能为空', trigger: 'blur' }
// ],
// level: [
// { required: true, message: '层级不能为空', trigger: 'blur' }
// ],
// createTime: [
// { required: true, message: '创建日期不能为空', trigger: 'blur' }
// ],
// updateTime: [
// { required: true, message: '更新日期不能为空', trigger: 'blur' }
// ],
// sort: [
// { required: true, message: '排序不能为空', trigger: 'blur' }
// ],
// splits: [
// { required: true, message: '拆分类类型不能为空', trigger: 'blur' }
// ]
}
};
},
created() {},
mounted() {
// this.restaurants = this.loadAll();
},
methods: {
init(row) {
console.log("11111", row);
this.dataForm = row || {};
// this.dataForm.id = row.id || 0
// this.dataForm.title = row.title || ''
this.visible = true;
},
// 表单提交
dataFormSubmit() {
// console.log('11111', this.dataForm.medicaldesBookType)
// if (this.dataForm.medicaldesBookType.length == 0) {
// this.$message.error("请选择图书类型");
// return
// }
this.$refs["dataForm"].validate(valid => {
if (valid) {
this.$http({
url: this.$http.adornUrl(
`${
!this.dataForm.id
? "/master/course/addCourse"
: "/master/course/editCourse"
}`
),
method: "post",
data: this.$http.adornData({
id: this.dataForm.id || undefined,
title: this.dataForm.title,
sort: this.dataForm.sort,
image:this.dataForm.image,
// 'authorId': this.dataForm.authorId.join(','),
// 'description': this.dataForm.description,
// 'title': this.dataForm.title,
// 'bookType': this.dataForm.bookType,
// 'publisherName': this.dataForm.publisherName,
// 'content': this.dataForm.content,
// 'type': this.dataForm.type.join(','),
// "medicaldesBookType": this.dataForm.medicaldesBookType.join(','),
// 'isVip': this.dataForm.isVip,
// 'freeChapterCount': this.dataForm.freeChapterCount,
// 'publisherId': this.dataForm.publisherId.join(','),
// 'images': this.dataForm.images,
// 'pid': this.dataForm.pid,
// 'level': this.dataForm.level,
// 'createTime': this.dataForm.createTime,
// 'updateTime': this.dataForm.updateTime,
// 'sort': this.dataForm.sort,
// 'delFlag': this.dataForm.delFlag,
// 'novel': this.dataForm.novel,
// 'splits': this.dataForm.splits,
// 'canListen': this.dataForm.canListen,
// 'relationId': this.dataForm.relationId,
// 'clockIn': this.dataForm.clockIn,
// 'teachIn': this.dataForm.teachIn
})
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.visible = false;
this.$emit("refreshDataList");
}
});
} else {
this.$message.error(data.msg);
}
});
}
});
},
handlePicSuccess(res, file) {
// console.log(res,'res')
if (res.msg == "success") {
this.dataForm.image = res.url;
this.fileList.push({
name: file.name,
url: res.url
});
// console.log(this.dataForm.image,'image')
this.$message.success("上传成功");
} else {
this.$message.error("上传失败");
}
},
created() {
handleRemove(file, fileList) {
this.dataForm.image = "";
this.fileList = [];
this.dataForm.noneBtnImg = fileList.length >= this.dataForm.limitCountImg;
},
mounted() {
// this.restaurants = this.loadAll();
handlePictureCardPreview(file) {
this.dataForm.image = file.url;
this.dialogVisible = true;
},
methods: {
init(row) {
console.log('11111', row)
this.dataForm = row || {}
// this.dataForm.id = row.id || 0
// this.dataForm.title = row.title || ''
this.visible = true
},
// 表单提交
dataFormSubmit() {
// console.log('11111', this.dataForm.medicaldesBookType)
// if (this.dataForm.medicaldesBookType.length == 0) {
// this.$message.error("请选择图书类型");
// return
// }
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`${!this.dataForm.id ? '/master/course/addCourse' : '/master/course/editCourse'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'title': this.dataForm.title,
'sort': this.dataForm.sort,
// 'authorId': this.dataForm.authorId.join(','),
// 'description': this.dataForm.description,
// 'title': this.dataForm.title,
// 'bookType': this.dataForm.bookType,
// 'publisherName': this.dataForm.publisherName,
// 'content': this.dataForm.content,
// 'type': this.dataForm.type.join(','),
// "medicaldesBookType": this.dataForm.medicaldesBookType.join(','),
// 'isVip': this.dataForm.isVip,
// 'freeChapterCount': this.dataForm.freeChapterCount,
// 'publisherId': this.dataForm.publisherId.join(','),
// 'images': this.dataForm.images,
// 'pid': this.dataForm.pid,
// 'level': this.dataForm.level,
// 'createTime': this.dataForm.createTime,
// 'updateTime': this.dataForm.updateTime,
// 'sort': this.dataForm.sort,
// 'delFlag': this.dataForm.delFlag,
// 'novel': this.dataForm.novel,
// 'splits': this.dataForm.splits,
// 'canListen': this.dataForm.canListen,
// 'relationId': this.dataForm.relationId,
// 'clockIn': this.dataForm.clockIn,
// 'teachIn': this.dataForm.teachIn
})
}).then(({
data
}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
},
handlePicSuccess(res, file) {
if (res.msg == "success") {
this.dataForm.images = res.url;
this.$message.success("上传成功");
} else {
this.$message.error("上传失败");
}
},
handleRemove(file) {
this.dataForm.images = '';
},
handlePictureCardPreview(file) {
this.dataForm.images = file.url;
this.dialogVisible = true;
},
handleDownload(file) {
console.log(file)
},
handlereset() {
this.fileList = [],
this.fileListNovel = [],
this.visible = false
},
handlePreview(file) {
console.log(file);
},
handleExceed(files, fileList) {
this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${ file.name }`);
},
handleRemoveNovel(file) {
this.dataForm.novel = '';
},
handleNovelSuccess(file) {
this.dataForm.novel = file.url
},
// querySearch(queryString, cb) {
// var restaurants = this.restaurants;
// var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
// // 调用 callback 返回建议列表的数据
// console.log(results)
// cb(results);
// },
// createFilter(queryString) {
// return (restaurant) => {
// return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
// };
// },
// handleSelect(item) {
// this.dataForm.authorId = item.id
// console.log(item);
// }
handleDownload(file) {
console.log(file);
},
handlereset() {
(this.fileList = []), (this.fileListNovel = []), (this.visible = false);
},
handlePreview(file) {
console.log(file);
},
handleExceed(files, fileList) {
this.$message.warning(
`当前限制选择 3 个文件,本次选择了 ${
files.length
} 个文件,共选择了 ${files.length + fileList.length} 个文件`
);
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemoveNovel(file) {
this.dataForm.novel = "";
},
handleNovelSuccess(file) {
this.dataForm.novel = file.url;
}
// querySearch(queryString, cb) {
// var restaurants = this.restaurants;
// var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
// // 调用 callback 返回建议列表的数据
// console.log(results)
// cb(results);
// },
// createFilter(queryString) {
// return (restaurant) => {
// return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
// };
// },
// handleSelect(item) {
// this.dataForm.authorId = item.id
// console.log(item);
// }
}
};
</script>
<style lang="scss" scoped>
::v-deep .isUpload {
.el-uploadfeng {
.el-upload--picture-card {
display: none !important;
}
}
}
</style>

View File

@@ -148,7 +148,7 @@ export default {
url: this.$http.adornUrl('/master/course/delCourseCatalogueChapter'),
method: 'post',
data: this.$http.adornData({
'chapterId': id
'id': id
})
}).then(({ data }) => {
if (data && data.code === 0) {

View File

@@ -1,8 +1,16 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form
:inline="true"
:model="dataForm"
@keyup.enter.native="getDataList()"
>
<el-form-item label="课程名称">
<el-input v-model="query.keywords" placeholder="课程名称" clearable></el-input>
<el-input
v-model="query.keywords"
placeholder="课程名称"
clearable
></el-input>
</el-form-item>
<!-- <el-form-item label="出版社名称">
<el-input v-model="query.publisherName" placeholder="出版社名称" clearable></el-input>
@@ -11,15 +19,24 @@
<el-input v-model="query.authorName" placeholder="作者姓名" clearable></el-input>
</el-form-item> -->
<el-form-item>
<el-button @click="pageIndex = 1;getDataList()">查询</el-button>
<el-button
@click="
pageIndex = 1;
getDataList();
"
>查询</el-button
>
<el-button type="primary" @click="addOrUpdateHandle()">新增</el-button>
<!-- <el-button v-if="isAuth('book:book:delete')" type="danger" @click="deleteHandle()"
:disabled="dataListSelections.length <= 0">批量删除</el-button> -->
</el-form-item>
</el-form>
<el-table :data="dataList" border v-loading="dataListLoading"
style="width: 100%;">
<el-table
:data="dataList"
border
v-loading="dataListLoading"
style="width: 100%;"
>
<!-- <el-table-column min-width="155px
" prop="delFlag" header-align="center" align="center" label="状态">
<template slot-scope="scope">
@@ -29,8 +46,15 @@
</el-switch>
</template>
</el-table-column> -->
<el-table-column prop="title" header-align="center" align="center" label="课程名">
<el-table-column
prop="title"
header-align="center"
align="center"
label="课程名"
>
</el-table-column>
<!-- <el-table-column prop="authorName" header-align="center" align="center" label="作者姓名">
</el-table-column>
<el-table-column header-align="center" align="center" label="插图">
@@ -100,7 +124,28 @@
align="center"
label="层级">
</el-table-column> -->
<el-table-column prop="createTime" header-align="center" align="center" label="创建日期">
<el-table-column label="课程图" header-align="center" align="center">
<template slot-scope="scope">
<div v-if="scope.row.image" style="width:100%;display: flex;
align-items: center;justify-content: center;">
<img
:src="scope.row.image"
alt=""
width="80px"
height="80px"
/>
</div>
</template>
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建日期"
>
</el-table-column>
<!-- <el-table-column prop="updateTime" header-align="center" align="center" label="更新日期">
</el-table-column> -->
@@ -116,9 +161,15 @@
align="center"
label="删除标记">
</el-table-column> -->
<el-table-column fixed="right" header-align="center" align="center" width="250" label="操作">
<el-table-column
fixed="right"
header-align="center"
align="center"
width="250"
label="操作"
>
<template slot-scope="scope">
<!-- <el-dropdown style="border: 1px solid #17B3A3; border-radius: 5px; padding: 4px;">
<!-- <el-dropdown style="border: 1px solid #17B3A3; border-radius: 5px; padding: 4px;">
<span class="el-dropdown-link" style="color:#17B3A3">
操作管理<i class="el-icon-arrow-down el-icon--right"></i>
</span>
@@ -150,41 +201,67 @@
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown> -->
<!-- <el-button v-if="scope.row.chapterStatus == '未处理' || scope.row.chapterStatus == '失败'" type="text" size="small" @click="chapterHandle(scope.row.id,scope.row)">章节拆分</el-button> -->
<!-- <el-button v-if="scope.row.chapterStatus == '成功' && (scope.row.contentStatus == '未处理' || scope.row.contentStatus == '失败') " type="text" size="small" @click="contentHandle(scope.row.id)">单句拆分</el-button> -->
<!-- <el-button v-if="scope.row.contentStatus == '成功' && (scope.row.voicesStatus == '未处理' || scope.row.voicesStatus == '失败') " type="text" size="small" @click="voicesHandle(scope.row.id)">音频处理</el-button> -->
<div>
<router-link :to="{path: 'course-courseCatalogue' , query:{ id : scope.row.id , pageIndex} }">
<el-button type="text" size="small">目录管理</el-button>
</router-link>
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</div>
<!-- <el-button v-if="scope.row.chapterStatus == '未处理' || scope.row.chapterStatus == '失败'" type="text" size="small" @click="chapterHandle(scope.row.id,scope.row)">章节拆分</el-button> -->
<!-- <el-button v-if="scope.row.chapterStatus == '成功' && (scope.row.contentStatus == '未处理' || scope.row.contentStatus == '失败') " type="text" size="small" @click="contentHandle(scope.row.id)">单句拆分</el-button> -->
<!-- <el-button v-if="scope.row.contentStatus == '成功' && (scope.row.voicesStatus == '未处理' || scope.row.voicesStatus == '失败') " type="text" size="small" @click="voicesHandle(scope.row.id)">音频处理</el-button> -->
<div>
<router-link
:to="{
path: 'course-courseCatalogue',
query: { id: scope.row.id, pageIndex }
}"
>
<el-button type="text" size="small">目录管理</el-button>
</router-link>
<el-button
type="text"
size="small"
@click="addOrUpdateHandle(scope.row)"
>修改</el-button
>
<el-button
type="text"
size="small"
@click="deleteHandle(scope.row.id)"
>删除</el-button
>
</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
@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>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList"
></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './course-add-or-update'
import AddOrUpdate from "./course-add-or-update";
export default {
data() {
return {
dataForm: {
key: ''
key: ""
},
query:{
type:'',
categoryId:'',
sociologyId:'',
keywords:''
query: {
type: "",
categoryId: "",
sociologyId: "",
keywords: ""
},
dataList: [],
delFlag: false,
@@ -194,95 +271,101 @@ export default {
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
};
},
components: {
AddOrUpdate
},
activated() {
if(this.$route.query.upPageInde != null){
this.pageIndex = this.$route.query.upPageIndex;
console.log(this.pageIndex)
if (this.$route.query.upPageInde != null) {
this.pageIndex = this.$route.query.upPageIndex;
console.log(this.pageIndex);
}
this.getDataList()
this.getDataList();
},
methods: {
// 获取数据列表
getDataList() {
this.dataListLoading = true
this.dataListLoading = true;
this.$http({
url: this.$http.adornUrl('/master/course/getCourseList'),
method: 'post',
url: this.$http.adornUrl("/master/course/getCourseList"),
method: "post",
data: this.$http.adornData({
'page': this.pageIndex,
'limit': this.pageSize,
"type": this.query.type||0, //类型0全部1医学2国学
"categoryId": this.query.categoryId, //医学类型id当type为1时为必填项;为0时代表全部
"sociologyId": this.query.sociologyId, //国学类型id,当type为2时为必填项为0代表全部
"keywords": this.query.keywords //关键字
page: this.pageIndex,
limit: this.pageSize,
type: this.query.type || 0, //类型0全部1医学2国学
categoryId: this.query.categoryId, //医学类型id当type为1时为必填项;为0时代表全部
sociologyId: this.query.sociologyId, //国学类型id,当type为2时为必填项为0代表全部
keywords: this.query.keywords //关键字
})
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataList = data.page.records
this.totalPage = data.page.total
this.dataList = data.page.records;
this.totalPage = data.page.total;
} else {
this.dataList = []
this.totalPage = 0
this.dataList = [];
this.totalPage = 0;
}
this.dataListLoading = false
})
this.dataListLoading = false;
});
},
// 每页数
sizeChangeHandle(val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
this.pageSize = val;
this.pageIndex = 1;
this.getDataList();
},
// 当前页
currentChangeHandle(val) {
this.pageIndex = val
this.getDataList()
this.pageIndex = val;
this.getDataList();
},
// 多选
selectionChangeHandle(val) {
this.dataListSelections = val
this.dataListSelections = val;
},
// 新增 / 修改
addOrUpdateHandle(row) {
this.addOrUpdateVisible = true
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(row)
})
this.$refs.addOrUpdate.init(row);
});
},
// 删除
deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var ids = id
? [id]
: this.dataListSelections.map(item => {
return item.id;
});
this.$confirm(
`确定对[id=${ids.join(",")}]进行[${id ? "删除" : "批量删除"}]操作?`,
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}
).then(() => {
this.$http({
url: this.$http.adornUrl('/master/course/delCourse?id='+ ids),
method: 'post',
// data: this.$http.adornData(ids, false)
url: this.$http.adornUrl("/master/course/delCourse?id=" + ids),
method: "post"
// data: this.$http.adornData(ids, false)
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.getDataList()
this.getDataList();
}
})
});
} else {
this.$message.error(data.msg)
this.$message.error(data.msg);
}
})
})
});
});
},
// 开关变化
SwitchChange(event) {
@@ -290,81 +373,83 @@ export default {
var parms = {
delFlag: event.delFlag,
id: event.id
}
};
this.$http({
url: this.$http.adornUrl('/book/book/update'),
method: 'post',
url: this.$http.adornUrl("/book/book/update"),
method: "post",
data: parms
}).then(res => {
this.$message({
message: '成功',
type: 'success'
})
this.loading = false
this.getDataList()
}).catch(error => {
this.loading = false
console.log(error)
})
console.log(event)
.then(res => {
this.$message({
message: "成功",
type: "success"
});
this.loading = false;
this.getDataList();
})
.catch(error => {
this.loading = false;
console.log(error);
});
console.log(event);
},
chapterHandle(id, row) {
if (row.novel == '') {
this.$alert('请上传电子书文件后在进行此操作', '提示', {
confirmButtonText: '好的',
if (row.novel == "") {
this.$alert("请上传电子书文件后在进行此操作", "提示", {
confirmButtonText: "好的"
});
return false
return false;
}
this.$http({
url: this.$http.adornUrl('/book/book/getChapter'),
method: 'get',
params: this.$http.adornParams({
'id':id
})
}).then(res => {
this.$message({
message: '成功',
type: 'success'
url: this.$http.adornUrl("/book/book/getChapter"),
method: "get",
params: this.$http.adornParams({
id: id
})
this.loading = false
this.getDataList()
})
}).then(res => {
this.$message({
message: "成功",
type: "success"
});
this.loading = false;
this.getDataList();
});
},
contentHandle(id){
contentHandle(id) {
this.$http({
url: this.$http.adornUrl('/book/bookchaptercontent/getBookVoices'),
method: 'get',
params: this.$http.adornParams({
'id':id
})
}).then(res => {
this.$message({
message: '成功',
type: 'success'
url: this.$http.adornUrl("/book/bookchaptercontent/getBookVoices"),
method: "get",
params: this.$http.adornParams({
id: id
})
this.loading = false
this.getDataList()
})
}).then(res => {
this.$message({
message: "成功",
type: "success"
});
this.loading = false;
this.getDataList();
});
},
voicesHandle(id){
voicesHandle(id) {
//allVoices
this.$http({
// url: this.$http.adornUrl('/book/bookchaptercontent/allVoices'),
url: this.$http.adornUrl('/book/bookchaptercontent/AllVOices'),
method: 'get',
params: this.$http.adornParams({
'id':id
})
}).then(res => {
console.log('book/bookchaptercontent/AllVOices')
this.$message({
message: '成功',
type: 'success'
// url: this.$http.adornUrl('/book/bookchaptercontent/allVoices'),
url: this.$http.adornUrl("/book/bookchaptercontent/AllVOices"),
method: "get",
params: this.$http.adornParams({
id: id
})
this.loading = false
this.getDataList()
})
}).then(res => {
console.log("book/bookchaptercontent/AllVOices");
this.$message({
message: "成功",
type: "success"
});
this.loading = false;
this.getDataList();
});
}
}
}
};
</script>

File diff suppressed because it is too large Load Diff