试听修改
This commit is contained in:
@@ -1,7 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible"
|
<el-dialog
|
||||||
@close="handlereset">
|
:title="!dataForm.id ? '新增' : '修改'"
|
||||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="80px">
|
: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-form-item label="章节名" prop="title">
|
||||||
<el-input v-model="dataForm.title" placeholder="章节名"></el-input>
|
<el-input v-model="dataForm.title" placeholder="章节名"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -27,138 +36,63 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row> -->
|
</el-row> -->
|
||||||
<el-form-item label="插图" prop="imgUrl">
|
<el-form-item label="插图" prop="imgUrl">
|
||||||
<el-upload :action="baseUrl + '/oss/fileoss'" list-type="picture-card" :on-preview="handlePictureCardPreview"
|
<el-upload
|
||||||
:file-list="fileList" :on-success="handlePicSuccess" :on-remove="handleRemove">
|
:action="baseUrl + '/oss/fileoss'"
|
||||||
|
list-type="picture-card"
|
||||||
|
:on-preview="handlePictureCardPreview"
|
||||||
|
:file-list="fileList"
|
||||||
|
:on-success="handlePicSuccess"
|
||||||
|
:on-remove="handleRemove"
|
||||||
|
>
|
||||||
<i class="el-icon-plus"></i>
|
<i class="el-icon-plus"></i>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<el-dialog :visible.sync="dialogVisible" :append-to-body="true">
|
<el-dialog :visible.sync="dialogVisible" :append-to-body="true">
|
||||||
<img width="100%" :src="dataForm.imgUrl" alt="">
|
<img width="100%" :src="dataForm.imgUrl" alt="" />
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="排序" prop="sort">
|
<el-form-item label="排序" prop="sort">
|
||||||
<el-input v-model="dataForm.sort" placeholder="排序"></el-input>
|
<el-input v-model="dataForm.sort" placeholder="排序"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
label="是否试听"
|
||||||
|
prop="isLast"
|
||||||
|
label-width="120px"
|
||||||
|
class="form_item"
|
||||||
|
>
|
||||||
|
<el-switch
|
||||||
|
v-model="dataForm.isAudition"
|
||||||
|
active-color="#13ce66"
|
||||||
|
:active-value="1"
|
||||||
|
:inactive-value="0"
|
||||||
|
active-text="是"
|
||||||
|
inactive-text="否"
|
||||||
|
|
||||||
|
>
|
||||||
|
</el-switch>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="内容" prop="content" class="custom-chapter-height">
|
<el-form-item label="内容" prop="content" class="custom-chapter-height">
|
||||||
<!-- <el-input v-model="dataForm.content" placeholder="内容"></el-input> -->
|
<!-- <el-input v-model="dataForm.content" placeholder="内容"></el-input> -->
|
||||||
<el-upload class="chapter-avatar-uploader" :action="baseUrl + '/oss/fileoss'" accept=".jpeg,.jpg,.gif,.png" :show-file-list="false" :on-success="contentUploadSuccess" >
|
<el-upload
|
||||||
|
class="chapter-avatar-uploader"
|
||||||
|
:action="baseUrl + '/oss/fileoss'"
|
||||||
|
accept=".jpeg,.jpg,.gif,.png"
|
||||||
|
:show-file-list="false"
|
||||||
|
:on-success="contentUploadSuccess"
|
||||||
|
>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<quill-editor v-model="dataForm.content" ref="myQuillEditor" :options="editorOption"
|
<quill-editor
|
||||||
@blur="onEditorBlur($event)" @focus="onEditorFocus($event)"
|
v-model="dataForm.content"
|
||||||
@ready="onEditorReady($event)" class="chapter_editor">
|
ref="myQuillEditor"
|
||||||
|
:options="editorOption"
|
||||||
|
@blur="onEditorBlur($event)"
|
||||||
|
@focus="onEditorFocus($event)"
|
||||||
|
@ready="onEditorReady($event)"
|
||||||
|
class="chapter_editor"
|
||||||
|
>
|
||||||
</quill-editor>
|
</quill-editor>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<!-- <el-row>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="作者" prop="authorId">
|
|
||||||
<el-select
|
|
||||||
v-model="dataForm.authorId"
|
|
||||||
multiple
|
|
||||||
filterable
|
|
||||||
allow-create
|
|
||||||
size="small"
|
|
||||||
default-first-option
|
|
||||||
placeholder="请输入作者姓名">
|
|
||||||
<el-option
|
|
||||||
v-for="item in authorList"
|
|
||||||
:key="item.value + ''"
|
|
||||||
:label="item.value"
|
|
||||||
:value="item.id + ''">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="出版社" prop="publisherId">
|
|
||||||
<el-select v-model="dataForm.publisherId" multiple filterable allow-create default-first-option
|
|
||||||
placeholder="请输入出版社名称">
|
|
||||||
<el-option v-for="item in publisherList" :key="item.value + ''" :label="item.value" :value="item.id + ''">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-form-item label="序言" prop="title">
|
|
||||||
<el-input v-model="dataForm.title" placeholder="序言" :rows="3" type="textarea"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="拆分类型" prop="splits">
|
|
||||||
<el-radio-group v-model="dataForm.splits">
|
|
||||||
<el-radio v-for="item in splitsTypeList" :key="item.dictType" :label="item.dictType"
|
|
||||||
:value="item.dictType">{{item.dictValue}}</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="目录" prop="content">
|
|
||||||
<el-input v-model="dataForm.content" placeholder="目录" :rows="5" type="textarea"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="简介" prop="description">
|
|
||||||
<el-input v-model="dataForm.description" placeholder="简介" :rows="5" type="textarea"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="图书分类" prop="bookType">
|
|
||||||
<el-radio-group v-model="dataForm.bookType">
|
|
||||||
<el-radio :label="0">普通</el-radio>
|
|
||||||
<el-radio :label="1">中医经典</el-radio>
|
|
||||||
<el-radio :label="2">国学经典</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="相关古书" prop="relationId">
|
|
||||||
<el-select v-model="dataForm.relationId" filterable allow-create default-first-option
|
|
||||||
placeholder="请选择古书">
|
|
||||||
<el-option :key="0" label="无" :value="0"></el-option>
|
|
||||||
<el-option v-for="item in gushuList" :key="item.id" :label="item.name" :value="item.id">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-row>
|
|
||||||
<el-form-item label="图书类型" prop="medicaldesBookType">
|
|
||||||
<el-checkbox-group v-model="dataForm.medicaldesBookType">
|
|
||||||
<el-checkbox v-for="item in medicaldesBookTypeList" :key="item.dictType" :label="item.dictType"
|
|
||||||
:value="item.dictType">{{item.dictValue}}</el-checkbox>
|
|
||||||
</el-checkbox-group>
|
|
||||||
</el-form-item>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="是否可听">
|
|
||||||
<el-switch style="display: block" v-model="dataForm.canListen" active-color="#13ce66"
|
|
||||||
inactive-color="#ff4949" active-text="可听" inactive-text="不可听">
|
|
||||||
</el-switch>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-form-item label="是否参与打卡" prop="clockIn" label-width="250">
|
|
||||||
<el-radio-group v-model="dataForm.clockIn">
|
|
||||||
<el-radio :label="1">参与打卡</el-radio>
|
|
||||||
<el-radio :label="2">不参与打卡</el-radio>
|
|
||||||
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="是否参与讲书" prop="teachIn" label-width="250">
|
|
||||||
<el-radio-group v-model="dataForm.teachIn">
|
|
||||||
<el-radio :label="1">参与</el-radio>
|
|
||||||
<el-radio :label="0">不参与</el-radio>
|
|
||||||
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="付费类型" prop="isVip">
|
|
||||||
<el-radio-group v-model="dataForm.isVip">
|
|
||||||
<el-radio :label="2">付费</el-radio>
|
|
||||||
<el-radio :label="1">会免</el-radio>
|
|
||||||
<el-radio :label="0">免费</el-radio>
|
|
||||||
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="免费章节数" prop="freeChapterCount" label-width="250">
|
|
||||||
<el-input-number v-model="dataForm.freeChapterCount" :min="0" :max="10" label="免费章节数"></el-input-number>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="文件上传" prop="novel">
|
|
||||||
<el-upload class="upload-demo" :action="baseUrl + '/oss/fileoss'" :on-preview="handlePreview"
|
|
||||||
:on-remove="handleRemoveNovel" :before-remove="beforeRemove" :on-success="handleNovelSuccess" multiple
|
|
||||||
:limit="3" :on-exceed="handleExceed" :file-list="fileListNovel">
|
|
||||||
<el-button size="small" type="primary">点击上传</el-button>
|
|
||||||
</el-upload>
|
|
||||||
</el-form-item> -->
|
|
||||||
<!-- <el-form-item label="排序" prop="sort">
|
|
||||||
<el-input v-model="dataForm.sort" placeholder="排序"></el-input>
|
|
||||||
</el-form-item> -->
|
|
||||||
</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>
|
||||||
@@ -167,236 +101,245 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import global from '../../common/common.vue' //引入共用组间
|
import global from "../../common/common.vue"; //引入共用组间
|
||||||
import {
|
import { quillEditor } from "vue-quill-editor";
|
||||||
quillEditor
|
import "quill/dist/quill.core.css";
|
||||||
} from 'vue-quill-editor'
|
import "quill/dist/quill.snow.css";
|
||||||
import 'quill/dist/quill.core.css'
|
import "quill/dist/quill.bubble.css";
|
||||||
import 'quill/dist/quill.snow.css'
|
const toolbarOptions = [
|
||||||
import 'quill/dist/quill.bubble.css'
|
["bold", "italic", "underline", "strike"], // 加粗,斜体,下划线,删除线
|
||||||
const toolbarOptions = [
|
["blockquote", "code-block"], //引用,代码块
|
||||||
['bold', 'italic', 'underline', 'strike'], // 加粗,斜体,下划线,删除线
|
[{ header: 1 }, { header: 2 }], // 几级标题
|
||||||
['blockquote', 'code-block'], //引用,代码块
|
[{ list: "ordered" }, { list: "bullet" }], // 有序列表,无序列表
|
||||||
[{ 'header': 1 }, { 'header': 2 }], // 几级标题
|
[{ script: "sub" }, { script: "super" }], // 下角标,上角标
|
||||||
[{ 'list': 'ordered' }, { 'list': 'bullet' }], // 有序列表,无序列表
|
[{ indent: "-1" }, { indent: "+1" }], // 缩进
|
||||||
[{ 'script': 'sub' }, { 'script': 'super' }], // 下角标,上角标
|
[{ direction: "rtl" }], // 文字输入方向
|
||||||
[{ 'indent': '-1' }, { 'indent': '+1' }], // 缩进
|
[{ size: ["small", false, "large", "huge"] }], // 字体大小
|
||||||
[{ 'direction': 'rtl' }], // 文字输入方向
|
[{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
|
||||||
[{ 'size': ['small', false, 'large', 'huge'] }], // 字体大小
|
[{ color: [] }, { background: [] }], // 颜色选择
|
||||||
[{ 'header': [1, 2, 3, 4, 5, 6, false] }],// 标题
|
[
|
||||||
[{ 'color': [] }, { 'background': [] }], // 颜色选择
|
{
|
||||||
[{ 'font': ['SimSun', 'SimHei', 'Microsoft-YaHei', 'KaiTi', 'FangSong', 'Arial'] }],// 字体
|
font: [
|
||||||
[{ 'align': [] }], // 居中
|
"SimSun",
|
||||||
['clean'], // 清除样式,
|
"SimHei",
|
||||||
['link', 'image'], // 上传图片、上传视频
|
"Microsoft-YaHei",
|
||||||
]
|
"KaiTi",
|
||||||
export default {
|
"FangSong",
|
||||||
data() {
|
"Arial"
|
||||||
return {
|
]
|
||||||
baseUrl: global.baseUrl,
|
}
|
||||||
// 富文本编辑器配置
|
], // 字体
|
||||||
editorOption: {
|
[{ align: [] }], // 居中
|
||||||
modules: {
|
["clean"], // 清除样式,
|
||||||
history: {
|
["link", "image"] // 上传图片、上传视频
|
||||||
delay: 1000,
|
];
|
||||||
maxStack: 50,
|
export default {
|
||||||
userOnly: false
|
data() {
|
||||||
},
|
return {
|
||||||
toolbar: {
|
baseUrl: global.baseUrl,
|
||||||
container: toolbarOptions,
|
// 富文本编辑器配置
|
||||||
handlers: {
|
editorOption: {
|
||||||
image: function (value) {
|
modules: {
|
||||||
if (value) {
|
history: {
|
||||||
// 调用element的图片上传组件
|
delay: 1000,
|
||||||
document.querySelector('.chapter-avatar-uploader input').click()
|
maxStack: 50,
|
||||||
} else {
|
userOnly: false
|
||||||
this.quill.format('image', 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: '请输入正文',
|
|
||||||
},
|
},
|
||||||
visible: false,
|
placeholder: "请输入正文"
|
||||||
props: {
|
},
|
||||||
dictType: '',
|
visible: false,
|
||||||
dictValue: ''
|
props: {
|
||||||
},
|
dictType: "",
|
||||||
gushuList:[],
|
dictValue: ""
|
||||||
authorList: [],
|
},
|
||||||
restaurants: [],
|
gushuList: [],
|
||||||
author: '',
|
authorList: [],
|
||||||
publisherList: [],
|
restaurants: [],
|
||||||
fileList: [],
|
author: "",
|
||||||
fileListNovel: [],
|
publisherList: [],
|
||||||
dialogImageUrl: '',
|
fileList: [],
|
||||||
dialogVisible: false,
|
fileListNovel: [],
|
||||||
dataForm: {
|
dialogImageUrl: "",
|
||||||
"courseId": 0,
|
dialogVisible: false,
|
||||||
"catalogueId": 0,
|
dataForm: {
|
||||||
"title": "",
|
courseId: 0,
|
||||||
"imgUrl": "",
|
isAudition: 0,
|
||||||
"content": "",
|
catalogueId: 0,
|
||||||
"sort": 1,
|
title: "",
|
||||||
},
|
imgUrl: "",
|
||||||
splitsTypeList: [],
|
content: "",
|
||||||
dataRule: {
|
sort: 1
|
||||||
|
},
|
||||||
|
splitsTypeList: [],
|
||||||
}
|
dataRule: {}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
quillEditor
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
mounted() {},
|
||||||
|
methods: {
|
||||||
|
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("图片插入失败!");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
// 失去焦点事件
|
||||||
quillEditor
|
onEditorBlur(quill) {
|
||||||
|
// console.log('editor blur!', quill)
|
||||||
},
|
},
|
||||||
created() {
|
// 获得焦点事件
|
||||||
|
onEditorFocus(quill) {
|
||||||
|
//console.log('editor focus!', quill)
|
||||||
},
|
},
|
||||||
mounted() {
|
// 准备富文本编辑器
|
||||||
|
onEditorReady(quill) {
|
||||||
|
// console.log('editor ready!', quill)
|
||||||
},
|
},
|
||||||
methods: {
|
init(row, catalogue_id, courseid) {
|
||||||
contentUploadSuccess(res, file) {
|
console.log("row21", row);
|
||||||
// console.log(res)
|
this.dataForm = row ? JSON.parse(JSON.stringify(row)) : {};
|
||||||
let quill = this.$refs.myQuillEditor.quill
|
this.dataForm.courseId = courseid ? courseid : "";
|
||||||
// 如果上传成功
|
this.dataForm.catalogueId = catalogue_id ? catalogue_id : "";
|
||||||
if (res) {
|
this.visible = true;
|
||||||
// 获取光标所在位置
|
if (this.dataForm.imgUrl && this.dataForm.imgUrl != "") {
|
||||||
let length = quill.getSelection().index;
|
var img = {
|
||||||
// 插入图片,res为服务器返回的图片链接地址
|
name: "",
|
||||||
quill.insertEmbed(length, 'image', res.url)
|
url: this.dataForm.imgUrl
|
||||||
// 调整光标到最后
|
};
|
||||||
quill.setSelection(length + 1)
|
var attr = [];
|
||||||
} else {
|
attr.push(img);
|
||||||
// 提示信息,需引入Message
|
this.fileList = attr;
|
||||||
this.$message.error('图片插入失败!')
|
} else {
|
||||||
}
|
this.fileList = [];
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 失去焦点事件
|
// 表单提交
|
||||||
onEditorBlur(quill) {
|
dataFormSubmit() {
|
||||||
// console.log('editor blur!', quill)
|
this.$refs["dataForm"].validate(valid => {
|
||||||
},
|
if (valid) {
|
||||||
// 获得焦点事件
|
this.$http({
|
||||||
onEditorFocus(quill) {
|
url: this.$http.adornUrl(
|
||||||
//console.log('editor focus!', quill)
|
`${
|
||||||
},
|
!this.dataForm.id
|
||||||
// 准备富文本编辑器
|
? "/master/course/addCourseCatalogueChapter"
|
||||||
onEditorReady(quill) {
|
: "/master/course/editCourseCatalogueChapter"
|
||||||
// console.log('editor ready!', quill)
|
}`
|
||||||
},
|
),
|
||||||
init(row, catalogue_id, courseid) {
|
method: "post",
|
||||||
console.log('row21', row)
|
data: this.$http.adornData({
|
||||||
this.dataForm =row? JSON.parse(JSON.stringify(row)): {}
|
id: this.dataForm.id || undefined,
|
||||||
this.dataForm.courseId = courseid?courseid : ''
|
courseId: this.dataForm.courseId || undefined,
|
||||||
this.dataForm.catalogueId = catalogue_id?catalogue_id : ''
|
catalogueId: this.dataForm.catalogueId || undefined,
|
||||||
this.visible = true
|
title: this.dataForm.title,
|
||||||
if (this.dataForm.imgUrl && this.dataForm.imgUrl != "") {
|
imgUrl: this.dataForm.imgUrl,
|
||||||
var img = {
|
content: this.dataForm.content,
|
||||||
name: '',
|
sort: this.dataForm.sort,
|
||||||
url: this.dataForm.imgUrl
|
isAudition: this.dataForm.isAudition,
|
||||||
}
|
|
||||||
var attr = []
|
|
||||||
attr.push(img)
|
|
||||||
this.fileList = attr
|
|
||||||
}else{
|
|
||||||
this.fileList = []
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
// 表单提交
|
|
||||||
dataFormSubmit() {
|
|
||||||
this.$refs['dataForm'].validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
this.$http({
|
|
||||||
url: this.$http.adornUrl(`${!this.dataForm.id ? '/master/course/addCourseCatalogueChapter' : '/master/course/editCourseCatalogueChapter'}`),
|
|
||||||
method: 'post',
|
|
||||||
data: this.$http.adornData({
|
|
||||||
"id": this.dataForm.id || undefined,
|
|
||||||
'courseId': this.dataForm.courseId || undefined,
|
|
||||||
'catalogueId': this.dataForm.catalogueId || undefined,
|
|
||||||
'title': this.dataForm.title,
|
|
||||||
"imgUrl": this.dataForm.imgUrl,
|
|
||||||
"content": this.dataForm.content,
|
|
||||||
"sort": this.dataForm.sort,
|
|
||||||
})
|
|
||||||
}).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)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}).then(({ data }) => {
|
||||||
})
|
if (data && data.code === 0) {
|
||||||
},
|
this.$message({
|
||||||
handlePicSuccess(res, file) {
|
message: "操作成功",
|
||||||
if (res.msg == "success") {
|
type: "success",
|
||||||
this.dataForm.imgUrl = res.url;
|
duration: 1500,
|
||||||
this.$message.success("上传成功");
|
onClose: () => {
|
||||||
} else {
|
this.visible = false;
|
||||||
this.$message.error("上传失败");
|
this.$emit("refreshDataList");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$message.error(data.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
});
|
||||||
handleRemove(file) {
|
},
|
||||||
this.dataForm.imgUrl = '';
|
handlePicSuccess(res, file) {
|
||||||
},
|
if (res.msg == "success") {
|
||||||
handlePictureCardPreview(file) {
|
this.dataForm.imgUrl = res.url;
|
||||||
this.dataForm.imgUrl = file.url;
|
this.$message.success("上传成功");
|
||||||
this.dialogVisible = true;
|
} else {
|
||||||
},
|
this.$message.error("上传失败");
|
||||||
handleDownload(file) {
|
}
|
||||||
console.log(file)
|
},
|
||||||
},
|
handleRemove(file) {
|
||||||
handlereset() {
|
this.dataForm.imgUrl = "";
|
||||||
this.fileList = [],
|
},
|
||||||
this.fileListNovel = [],
|
handlePictureCardPreview(file) {
|
||||||
this.visible = false
|
this.dataForm.imgUrl = file.url;
|
||||||
},
|
this.dialogVisible = true;
|
||||||
handlePreview(file) {
|
},
|
||||||
console.log(file);
|
handleDownload(file) {
|
||||||
},
|
console.log(file);
|
||||||
handleExceed(files, fileList) {
|
},
|
||||||
this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
|
handlereset() {
|
||||||
},
|
(this.fileList = []), (this.fileListNovel = []), (this.visible = false);
|
||||||
beforeRemove(file, fileList) {
|
},
|
||||||
return this.$confirm(`确定移除 ${ file.name }?`);
|
handlePreview(file) {
|
||||||
},
|
console.log(file);
|
||||||
handleRemoveNovel(file) {
|
},
|
||||||
this.dataForm.novel = '';
|
handleExceed(files, fileList) {
|
||||||
},
|
this.$message.warning(
|
||||||
handleNovelSuccess(file) {
|
`当前限制选择 3 个文件,本次选择了 ${
|
||||||
this.dataForm.novel = file.url
|
files.length
|
||||||
},
|
} 个文件,共选择了 ${files.length + fileList.length} 个文件`
|
||||||
// querySearch(queryString, cb) {
|
);
|
||||||
// var restaurants = this.restaurants;
|
},
|
||||||
// var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
|
beforeRemove(file, fileList) {
|
||||||
// // 调用 callback 返回建议列表的数据
|
return this.$confirm(`确定移除 ${file.name}?`);
|
||||||
// console.log(results)
|
},
|
||||||
// cb(results);
|
handleRemoveNovel(file) {
|
||||||
// },
|
this.dataForm.novel = "";
|
||||||
// createFilter(queryString) {
|
},
|
||||||
// return (restaurant) => {
|
handleNovelSuccess(file) {
|
||||||
// return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
|
this.dataForm.novel = file.url;
|
||||||
// };
|
|
||||||
// },
|
|
||||||
// handleSelect(item) {
|
|
||||||
// this.dataForm.authorId = item.id
|
|
||||||
// console.log(item);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
// 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>
|
</script>
|
||||||
|
|||||||
@@ -71,6 +71,18 @@
|
|||||||
align="center"
|
align="center"
|
||||||
label="排序"
|
label="排序"
|
||||||
>
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="sort"
|
||||||
|
width="100"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="是否试听"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.isAudition==1?'是':'否'}}
|
||||||
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
fixed="right"
|
fixed="right"
|
||||||
|
|||||||
Reference in New Issue
Block a user