添加app下载地址管理
This commit is contained in:
361
src/views/modules/appManage/course-add-or-update.vue
Normal file
361
src/views/modules/appManage/course-add-or-update.vue
Normal file
@@ -0,0 +1,361 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
width="800px"
|
||||||
|
:title="!dataForm.id ? '新增' : '修改'"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:visible.sync="visible"
|
||||||
|
@close="handlereset"
|
||||||
|
style="height: auto;"
|
||||||
|
>
|
||||||
|
<div style="margin-bottom: 60px;">
|
||||||
|
<el-form
|
||||||
|
style="height: auto;"
|
||||||
|
class="addFormBox"
|
||||||
|
:model="dataForm"
|
||||||
|
:rules="dataRule"
|
||||||
|
ref="dataForm"
|
||||||
|
label-width="80px"
|
||||||
|
>
|
||||||
|
<el-form-item label="APP名称" prop="title">
|
||||||
|
{{ dataForm.title }}
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="链接地址" prop="url">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.url"
|
||||||
|
placeholder="链接地址"
|
||||||
|
:rows="3"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="handlereset">取消</el-button>
|
||||||
|
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import global from "../../common/common.vue"; //引入共用组间
|
||||||
|
import { quillEditor } from "vue-quill-editor";
|
||||||
|
import "quill/dist/quill.core.css";
|
||||||
|
import "quill/dist/quill.snow.css";
|
||||||
|
import "quill/dist/quill.bubble.css";
|
||||||
|
const toolbarOptions = [
|
||||||
|
["bold", "italic", "underline", "strike"], // 加粗,斜体,下划线,删除线
|
||||||
|
["blockquote", "code-block"], //引用,代码块
|
||||||
|
[{ header: 1 }, { header: 2 }], // 几级标题
|
||||||
|
[{ list: "ordered" }, { list: "bullet" }], // 有序列表,无序列表
|
||||||
|
[{ script: "sub" }, { script: "super" }], // 下角标,上角标
|
||||||
|
[{ indent: "-1" }, { indent: "+1" }], // 缩进
|
||||||
|
[{ direction: "rtl" }], // 文字输入方向
|
||||||
|
[{ size: ["small", false, "large", "huge"] }], // 字体大小
|
||||||
|
[{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
|
||||||
|
[{ color: [] }, { background: [] }], // 颜色选择
|
||||||
|
[
|
||||||
|
{
|
||||||
|
font: [
|
||||||
|
"SimSun",
|
||||||
|
"SimHei",
|
||||||
|
"Microsoft-YaHei",
|
||||||
|
"KaiTi",
|
||||||
|
"FangSong",
|
||||||
|
"Arial"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
], // 字体
|
||||||
|
[{ align: [] }], // 居中
|
||||||
|
["clean"], // 清除样式,
|
||||||
|
["link", "image"] // 上传图片、上传视频
|
||||||
|
];
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
baseUrl: global.baseUrl,
|
||||||
|
visible: false,
|
||||||
|
// 富文本编辑器配置
|
||||||
|
editorOption: {
|
||||||
|
modules: {
|
||||||
|
history: {
|
||||||
|
delay: 1000,
|
||||||
|
maxStack: 50,
|
||||||
|
userOnly: false
|
||||||
|
},
|
||||||
|
toolbar: {
|
||||||
|
container: toolbarOptions,
|
||||||
|
handlers: {
|
||||||
|
image: function(value) {
|
||||||
|
if (value) {
|
||||||
|
// 调用element的图片上传组件
|
||||||
|
document
|
||||||
|
.querySelector(".chapter-avatar-uploader input")
|
||||||
|
.click();
|
||||||
|
} else {
|
||||||
|
this.quill.format("image", false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
placeholder: "请输入正文"
|
||||||
|
},
|
||||||
|
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: ""
|
||||||
|
},
|
||||||
|
gushuList: [],
|
||||||
|
linkList: [{ label: "外链", value: 1 }, { label: "富文本", value: 0 }],
|
||||||
|
restaurants: [],
|
||||||
|
author: "",
|
||||||
|
publisherList: [],
|
||||||
|
fileList: [],
|
||||||
|
fileListNovel: [],
|
||||||
|
dialogImageUrl: "",
|
||||||
|
dialogVisible: false,
|
||||||
|
dataForm: {
|
||||||
|
type: 1,
|
||||||
|
title: "",
|
||||||
|
isBook: 0, //是否是疯子读书
|
||||||
|
isMedical: 0, //是否是吴门医述
|
||||||
|
isSociology: 0 //是否是众妙之门
|
||||||
|
},
|
||||||
|
APPList: [
|
||||||
|
{ label: "疯子读书", value: 2, valueName: "isBook" },
|
||||||
|
{ label: "吴门医述", value: 3, valueName: "isMedical" },
|
||||||
|
{ label: "众妙之门", value: 1, valueName: "isSociology" }
|
||||||
|
],
|
||||||
|
dataRule: {
|
||||||
|
// url: [{ required: true, message: "链接地址不能为空", trigger: "blur" }]
|
||||||
|
},
|
||||||
|
urlList: {
|
||||||
|
// info: "/master/message/getMessageById",
|
||||||
|
add: "/master/apkConfig/setConfig"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
quillEditor
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
mounted() {
|
||||||
|
// this.restaurants = this.loadAll();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
changeType(e) {
|
||||||
|
console.log("e at line 256:", e);
|
||||||
|
if (e == 0) {
|
||||||
|
this.dataForm.content = "";
|
||||||
|
} else {
|
||||||
|
this.dataForm.url = "";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
contentUploadSuccess(res, file) {
|
||||||
|
// console.log(res)
|
||||||
|
let quill = this.$refs.myQuillEditor.quill;
|
||||||
|
// 如果上传成功
|
||||||
|
if (res) {
|
||||||
|
// 获取光标所在位置
|
||||||
|
let length = quill.getSelection().index;
|
||||||
|
// 插入图片,res为服务器返回的图片链接地址
|
||||||
|
quill.insertEmbed(length, "image", res.url);
|
||||||
|
// 调整光标到最后
|
||||||
|
quill.setSelection(length + 1);
|
||||||
|
} else {
|
||||||
|
// 提示信息,需引入Message
|
||||||
|
this.$message.error("图片插入失败!");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 失去焦点事件
|
||||||
|
onEditorBlur(quill) {
|
||||||
|
// console.log('editor blur!', quill)
|
||||||
|
},
|
||||||
|
// 获得焦点事件
|
||||||
|
onEditorFocus(quill) {
|
||||||
|
//console.log('editor focus!', quill)
|
||||||
|
},
|
||||||
|
// 准备富文本编辑器
|
||||||
|
onEditorReady(quill) {
|
||||||
|
// console.log('editor ready!', quill)
|
||||||
|
},
|
||||||
|
init(row) {this.dataForm = { ...row };this.visible = true;
|
||||||
|
this.$refs.dataForm.clearValidate();
|
||||||
|
|
||||||
|
|
||||||
|
// this.dataForm.id = row.id || 0
|
||||||
|
// this.dataForm.title = row.title || ''
|
||||||
|
|
||||||
|
},
|
||||||
|
// 表单提交
|
||||||
|
dataFormSubmit() {
|
||||||
|
this.$refs["dataForm"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (
|
||||||
|
this.dataForm.isBook == 0 &&
|
||||||
|
this.dataForm.isMedical == 0 &&
|
||||||
|
this.dataForm.isSociology == 0
|
||||||
|
) {
|
||||||
|
this.$message.error("请选择发布APP");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.log("this.dataForm.type at line 332:", this.dataForm);
|
||||||
|
if (
|
||||||
|
this.dataForm.type == 1 &&
|
||||||
|
(this.dataForm.url == "" || !this.dataForm.url)
|
||||||
|
) {
|
||||||
|
this.$message.error("请输入链接地址");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$http
|
||||||
|
.request({
|
||||||
|
url: this.$http.adornUrl(this.urlList.add),
|
||||||
|
method: "POST",
|
||||||
|
data: this.dataForm,
|
||||||
|
header: {
|
||||||
|
//默认 无 说明:请求头
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.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("上传失败");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleRemove(file, fileList) {
|
||||||
|
this.dataForm.image = "";
|
||||||
|
this.fileList = [];
|
||||||
|
this.dataForm.noneBtnImg = fileList.length >= this.dataForm.limitCountImg;
|
||||||
|
},
|
||||||
|
handlePictureCardPreview(file) {
|
||||||
|
this.dataForm.image = 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);
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
::v-deep .isUpload {
|
||||||
|
.el-uploadfeng {
|
||||||
|
.el-upload--picture-card {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/deep/ .addFormBox.el-form-item {
|
||||||
|
margin-bottom: 10px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .ql-container {
|
||||||
|
min-height: 400px !important ;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
304
src/views/modules/appManage/urlList.vue
Normal file
304
src/views/modules/appManage/urlList.vue
Normal file
@@ -0,0 +1,304 @@
|
|||||||
|
<template>
|
||||||
|
<div class="mod-config" style="height: calc(100vh - 180px );">
|
||||||
|
<div style="height: calc(100% - 80px );">
|
||||||
|
<el-table
|
||||||
|
:data="dataList"
|
||||||
|
border
|
||||||
|
height="90%"
|
||||||
|
v-loading="dataListLoading"
|
||||||
|
style="width: 100%;"
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
prop="title"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="APP"
|
||||||
|
width="200"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div>
|
||||||
|
{{ scope.row.title }}
|
||||||
|
<!-- <span v-if="scope.row.type == 0">疯子读书</span>
|
||||||
|
<span v-if="scope.row.type == 1">吴门医述</span>
|
||||||
|
<span v-if="scope.row.type == 2">众妙之门</span> -->
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="title"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="安装包下载地址(安卓)"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div>
|
||||||
|
{{ scope.row.url }}
|
||||||
|
<!-- <span v-if="scope.row.type == 0">富文本</span>
|
||||||
|
<span v-if="scope.row.type == 1">外链</span> -->
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<!-- <el-table-column
|
||||||
|
width="200"
|
||||||
|
prop="createTime"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="创建日期"
|
||||||
|
>
|
||||||
|
</el-table-column> -->
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
fixed="right"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
width="180"
|
||||||
|
label="操作"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div>
|
||||||
|
<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: 10px 0; text-align: center;"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
>
|
||||||
|
</el-pagination> -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 弹窗, 新增 / 修改 -->
|
||||||
|
<add-or-update
|
||||||
|
v-if="addOrUpdateVisible"
|
||||||
|
ref="addOrUpdate"
|
||||||
|
@refreshDataList="getDataList"
|
||||||
|
></add-or-update>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import AddOrUpdate from "./course-add-or-update";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
linkList: [{ label: "外链", value: 1 }, { label: "富文本", value: 0 }],
|
||||||
|
selectQueryApp: null,
|
||||||
|
APPList: [
|
||||||
|
{ label: "疯子读书", value: 2, valueName: "isBook" },
|
||||||
|
{ label: "吴门医述", value: 3, valueName: "isMedical" },
|
||||||
|
{ label: "众妙之门", value: 1, valueName: "isSociology" }
|
||||||
|
],
|
||||||
|
dataForm: {
|
||||||
|
key: ""
|
||||||
|
},
|
||||||
|
query: {
|
||||||
|
type: "",
|
||||||
|
title: ""
|
||||||
|
},
|
||||||
|
dataList: [],
|
||||||
|
delFlag: false,
|
||||||
|
pageIndex: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
totalPage: 0,
|
||||||
|
dataListLoading: false,
|
||||||
|
dataListSelections: [],
|
||||||
|
addOrUpdateVisible: false,
|
||||||
|
urlList: {
|
||||||
|
list: "/master/apkConfig/getConfig"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
AddOrUpdate
|
||||||
|
},
|
||||||
|
activated() {
|
||||||
|
if (this.$route.query.upPageInde != null) {
|
||||||
|
this.pageIndex = this.$route.query.upPageIndex;
|
||||||
|
console.log(this.pageIndex);
|
||||||
|
}
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 获取数据列表
|
||||||
|
getDataList() {
|
||||||
|
console.log("this.selectQueryApp at line 195:", this.selectQueryApp);
|
||||||
|
this.dataListLoading = true;
|
||||||
|
this.$http
|
||||||
|
.request({
|
||||||
|
url: this.$http.adornUrl(this.urlList.list),
|
||||||
|
method: "POST",
|
||||||
|
data: {},
|
||||||
|
header: {
|
||||||
|
//默认 无 说明:请求头
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
this.dataList = data.list.configs;
|
||||||
|
// this.totalPage = data.result.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);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 删除
|
||||||
|
deleteHandle(id) {
|
||||||
|
this.$confirm(
|
||||||
|
`确定对[id=${id}]进行[${id ? "删除" : "删除"}]操作?`,
|
||||||
|
"提示",
|
||||||
|
{
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning"
|
||||||
|
}
|
||||||
|
).then(() => {
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/master/message/delMessage?id=" + id),
|
||||||
|
method: "post"
|
||||||
|
// data: this.$http.adornData(ids, false)
|
||||||
|
}).then(({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
this.$message({
|
||||||
|
message: "操作成功",
|
||||||
|
type: "success",
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.getDataList();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$message.error(data.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 开关变化
|
||||||
|
SwitchChange(event) {
|
||||||
|
/*点击时他会自动把你绑定的值变更,直接去请求数据就可以了*/
|
||||||
|
var parms = {
|
||||||
|
delFlag: event.delFlag,
|
||||||
|
id: event.id
|
||||||
|
};
|
||||||
|
this.$http({
|
||||||
|
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);
|
||||||
|
},
|
||||||
|
chapterHandle(id, row) {
|
||||||
|
if (row.novel == "") {
|
||||||
|
this.$alert("请上传电子书文件后在进行此操作", "提示", {
|
||||||
|
confirmButtonText: "好的"
|
||||||
|
});
|
||||||
|
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"
|
||||||
|
});
|
||||||
|
this.loading = false;
|
||||||
|
this.getDataList();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
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"
|
||||||
|
});
|
||||||
|
this.loading = false;
|
||||||
|
this.getDataList();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
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"
|
||||||
|
});
|
||||||
|
this.loading = false;
|
||||||
|
this.getDataList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
Reference in New Issue
Block a user