讲书视频,用户权限,图书分类

This commit is contained in:
徐哼唧L
2024-01-15 18:00:28 +08:00
parent 359e704506
commit ef51aadc74
5 changed files with 1489 additions and 1404 deletions

View File

@@ -1,7 +1,7 @@
<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="name">
<el-input v-model="dataForm.name" placeholder="书名"></el-input>
</el-form-item>
@@ -43,18 +43,9 @@
</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
<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 v-for="item in publisherList" :key="item.value + ''" :label="item.value" :value="item.id + ''">
</el-option>
</el-select>
</el-form-item>
@@ -69,7 +60,8 @@
</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 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">
@@ -78,15 +70,13 @@
<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="type">
<!-- <el-select v-model="dataForm.type" placeholder="图书分类">
<el-option v-for="item in bookList" :key="item.dictType + ''" :label="item.dictValue"
:value="item.dictType + ''">
</el-option>
</el-select> -->
<el-checkbox-group v-model="dataForm.type">
<el-checkbox v-for="item in bookList" :key="item.dictType" :label="item.dictType" :value="item.dictType">{{item.dictValue}}</el-checkbox>
</el-checkbox-group>
<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-row>
<!-- <el-col :span="12">
@@ -101,19 +91,15 @@
<!-- </el-col> -->
<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 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-input v-model="dataForm.salePrice" placeholder="优惠价格"></el-input> -->
<el-switch
style="display: block"
v-model="dataForm.canListen"
active-color="#13ce66"
inactive-color="#ff4949"
active-text="可听"
inactive-text="不可听">
<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>
@@ -162,28 +148,15 @@
<el-input v-model="dataForm.publisherId" placeholder="出版商名称"></el-input>
</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-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="images">
<el-upload
:action= "baseUrl + '/oss/fileoss'"
list-type="picture-card"
:on-preview="handlePictureCardPreview"
:file-list="fileList"
:on-success="handlePicSuccess"
:on-remove="handleRemove">
<el-upload :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>
</el-upload>
<el-dialog :visible.sync="dialogVisible" :append-to-body="true">
@@ -219,14 +192,43 @@ export default {
return {
baseUrl: global.baseUrl,
visible: false,
bookList: [],
medicaldesBookTypeList:[
{dictType:1,dictValue:"中医基础"},
{dictType:2,dictValue:"中医经典"},
{dictType:3,dictValue:"各家学说"},
{dictType:4,dictValue:"中医临床"},
{dictType:5,dictValue:"文学"},
{dictType:6,dictValue:"哲学"},
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: '',
@@ -248,6 +250,7 @@ export default {
authorId: [],
description: '',
title: '',
bookType: 0,
content: '',
type: [],
medicaldesBookType: [],
@@ -342,13 +345,16 @@ export default {
url: this.$http.adornUrl(`/book/book/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({ data }) => {
}).then(({
data
}) => {
if (data && data.code === 0) {
this.dataForm.name = data.book.name
this.dataForm.publisherName = data.book.dataForm
// this.dataForm.authorId = data.book.authorId
this.dataForm.description = data.book.description
this.dataForm.title = data.book.title
this.dataForm.bookType = data.book.bookType
this.dataForm.content = data.book.content
// this.dataForm.type = data.book.type
// this.dataForm.price = data.book.price
@@ -388,13 +394,19 @@ export default {
console.log(this.dataForm.type)
console.log('2222222222', this.dataForm.medicaldesBookType)
if (data.book.images != "") {
var img = { name: '', url: data.book.images }
var img = {
name: '',
url: data.book.images
}
var attr = []
attr.push(img)
this.fileList = attr
}
if (data.book.novel != "" && data.book.novel != null && data.book.novel != 'undefined') {
var novel = { name: '电子书文件', url: data.book.novel }
var novel = {
name: '电子书文件',
url: data.book.novel
}
var attr = []
attr.push(novel)
this.fileListNovel = attr
@@ -422,6 +434,7 @@ export default {
'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(','),
@@ -446,7 +459,9 @@ export default {
'clockIn': this.dataForm.clockIn,
'teachIn': this.dataForm.teachIn
})
}).then(({ data }) => {
}).then(({
data
}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
@@ -480,16 +495,20 @@ export default {
// params: this.$http.adornParams({
// 'type': 'book_type',
// })
}).then(({ data }) => {
}).then(({
data
}) => {
console.log(data)
this.bookList = data.dataList
// this.bookList = data.dataList
})
// 获取图书拆分类型
this.$http({
url: this.$http.adornUrl('/book/sysdictdata/selectByType/splitsType'),
method: 'get',
}).then(({ data }) => {
}).then(({
data
}) => {
this.splitsTypeList = data.dataList
})
},
@@ -539,13 +558,17 @@ export default {
this.$http({
url: this.$http.adornUrl('/book/author/bookAuthorList'),
method: 'get',
}).then(({ data }) => {
}).then(({
data
}) => {
this.authorList = data.list
})
this.$http({
url: this.$http.adornUrl('/book/publisher/publisherList'),
method: 'get',
}).then(({ data }) => {
}).then(({
data
}) => {
this.publisherList = data.list
})

View File

@@ -1,18 +1,7 @@
<template>
<el-dialog
:title="!dataForm.productId ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible"
@close="handlereset"
lock-scroll
width="750px"
>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
label-width="100px"
>
<el-dialog :title="!dataForm.productId ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible"
@close="handlereset" lock-scroll width="750px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="100px">
<!-- <el-form-item label="所属分类" prop="poids">
<el-cascader v-model="dataForm.poids" :options="categorys" :props="props" clearable></el-cascader>
</el-form-item> -->
@@ -24,72 +13,53 @@
</el-form-item> -->
<!-- 关联的图书ids -->
<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 label="讲书章节" prop="chapter" :required="true">
<el-input
style="width: 150px;"
v-model.number="dataForm.chapter"
@input="numberChange"
placeholder="请输入章节序号"
type="number"
min="1"
></el-input>
<el-input style="width: 150px;" v-model.number="dataForm.chapter" @input="numberChange" placeholder="请输入章节序号"
type="number" min="1"></el-input>
<br /><span style="color: #999;">请输入大于0的整数,且为必填项</span>
</el-form-item>
<el-form-item label="音频">
<el-upload
:limit="1"
class="el-uploadvideo "
v-loading="loading"
element-loading-text="正在保存到服务器请勿离开..."
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(255, 255, 255, 0.8)"
:class="{
<el-upload :limit="1" class="el-uploadvoices" v-loading="voicesLoading" element-loading-text="正在保存到服务器,请勿离开..."
element-loading-spinner="el-icon-loading" element-loading-background="rgba(255, 255, 255, 0.8)" :class="{
uoloadSty: dataForm.showBtnDealImg,
disUoloadSty: dataForm.noneBtnImg
}"
:action="baseUrl + '/oss/fileoss'"
:file-list="voiceList"
:on-success="videohandlePicSuccess"
accept=".mp3"
:on-remove="videohandleRemove"
:show-file-list="true"
:on-progress="uploadVideoProcess"
>
}" :action="baseUrl + '/oss/fileoss'" :file-list="voiceList" :on-success="voicesSuccess" accept=".mp3"
:on-remove="voicesRemove" :show-file-list="true" :on-progress="voicesProcess">
<!-- <i class="el-icon-plus"></i> -->
<el-button slot="trigger" size="small" type="primary"
>上传文件</el-button
>
<el-button slot="trigger" size="small" type="primary">上传文件</el-button>
</el-upload>
<el-progress
v-show="progressFlag"
:percentage="loadProgress"
></el-progress>
<el-progress v-show="voicesFlag" :percentage="voicesLoad"></el-progress>
<div>
<audio
id="resource"
:src="dataForm.voices"
controls
v-show="true"
></audio>
<audio id="resource" :src="dataForm.voices" controls v-show="true"></audio>
</div>
</el-form-item>
<el-form-item label="视频">
<el-upload :limit="1" class="el-uploadvideo " v-loading="videoLoading" element-loading-text="正在保存到服务器,请勿离开..."
element-loading-spinner="el-icon-loading" element-loading-background="rgba(255, 255, 255, 0.8)"
:class="{ uoloadSty: dataForm.showBtnDealImg, disUoloadSty: dataForm.noneBtnImg }"
:action="baseUrl + '/oss/fileoss'" :file-list="videoList" :on-success="videoSuccess" accept=".mp4"
:on-remove="videoRemove" :show-file-list="true" :on-progress="uploadVideo">
<!-- <i class="el-icon-plus"></i> -->
<el-button slot="trigger" size="small" type="primary">上传文件</el-button>
</el-upload>
<el-progress v-show="videoFlag" :percentage="videoLoad"></el-progress>
<div>
<video controls width="250" v-if="dataForm.video != ''">
<source :src="dataForm.video" type="video/mp4" />
</video>
</div>
</el-form-item>
<el-form-item label="轮播图" prop="images">
<el-upload
:limit="3"
class="el-uploadfeng"
:action="baseUrl + '/oss/fileoss'"
list-type="picture-card"
:file-list="swiperfileList"
:on-success="bannerHandlePicSuccess"
accept=".jpeg,.jpg,.gif,.png"
:on-remove="bannerHandleRemove"
>
<el-upload :limit="3" class="el-uploadfeng" :action="baseUrl + '/oss/fileoss'" list-type="picture-card"
:file-list="swiperfileList" :on-success="bannerHandlePicSuccess" accept=".jpeg,.jpg,.gif,.png"
:on-remove="bannerHandleRemove">
<i class="el-icon-plus"></i>
</el-upload>
<!-- <el-dialog :visible.sync="dialogVisible" :append-to-body="true">
@@ -99,15 +69,9 @@
</el-form-item>
<el-form-item label="内容" prop="content">
<quill-editor
v-model="dataForm.content"
ref="myQuillEditor"
:options="editorOption"
@blur="onEditorBlur($event)"
@focus="onEditorFocus($event)"
@ready="onEditorReady($event)"
class="shangpin_editor"
>
<quill-editor v-model="dataForm.content" ref="myQuillEditor" :options="editorOption"
@blur="onEditorBlur($event)" @focus="onEditorFocus($event)" @ready="onEditorReady($event)"
class="shangpin_editor">
</quill-editor>
</el-form-item>
<!-- <el-form-item label="排序" prop="sort">
@@ -116,15 +80,15 @@
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="handlereset">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()" :disabled="loading"
>确定</el-button
>
<el-button type="primary" @click="dataFormSubmit()" :disabled="loading">确定</el-button>
</span>
</el-dialog>
</template>
<script>
import { quillEditor } from "vue-quill-editor";
import {
quillEditor
} from "vue-quill-editor";
import global from "../../common/common.vue"; //引入共用组间
import "quill/dist/quill.core.css";
@@ -152,8 +116,12 @@ export default {
};
return {
loading: false,
progressFlag: false,
loadProgress: 0,
voicesLoading: false,
videoLoading: false,
voicesFlag: false,
voicesLoad: 0,
videoFlag: false,
videoLoad: 0,
baseUrl: global.baseUrl,
visible: false,
categorys: [],
@@ -173,27 +141,25 @@ export default {
title: "",
productPid: "",
voices: "",
video: "",
chapter: null,
content: "",
images: []
},
voiceList: [],
videoList: [],
swiperfileList: [],
dataRule: {
title: [
{
title: [{
required: true,
message: "书评标题不能为空",
trigger: "blur"
}
],
}],
chapter: [
{
chapter: [{
validator: checkMoney,
trigger: "blur"
}
]
}]
},
// 富文本编辑器配置
@@ -202,45 +168,38 @@ export default {
toolbar: [
["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线
["blockquote", "code-block"], // 引用 代码块
[
{
[{
header: 1
},
{
header: 2
}
], // 1、2 级标题
[
{
[{
list: "ordered"
},
{
list: "bullet"
}
], // 有序、无序列表
[
{
[{
script: "sub"
},
{
script: "super"
}
], // 上标/下标
[
{
[{
indent: "-1"
},
{
indent: "+1"
}
], // 缩进
[
{
[{
direction: "rtl"
}
], // 文本方向
[
{
}], // 文本方向
[{
size: [
"12",
"14",
@@ -253,15 +212,11 @@ export default {
"32",
"36"
]
}
], // 字体大小
[
{
}], // 字体大小
[{
header: [1, 2, 3, 4, 5, 6]
}
], // 标题
[
{
}], // 标题
[{
color: []
},
{
@@ -269,13 +224,11 @@ export default {
}
], // 字体颜色、字体背景颜色
// [{ font: ['songti'] }], // 字体种类
[
{
[{
align: []
}
], // 对齐方式
}], // 对齐方式
["clean"], // 清除文本格式
["image", "video"] // 链接、图片、视频
["image", "voices"] // 链接、图片、视频
]
},
placeholder: "请输入正文"
@@ -299,11 +252,14 @@ export default {
params: this.$http.adornParams({
teachId: id
})
}).then(({ data }) => {
}).then(({
data
}) => {
// console.log(data, 666);
if (data && data.code === 0) {
this.dataForm.title = data.bookTeach.title;
this.dataForm.voices = data.bookTeach.voices;
this.dataForm.video = data.bookTeach.video;
this.dataForm.content = data.bookTeach.content;
this.dataForm.chapter = data.bookTeach.chapter;
if (data.bookTeach.images != '') {
@@ -323,6 +279,12 @@ export default {
url: data.bookTeach.voices
});
}
if (this.dataForm.video != '') {
this.videoList.push({
name: data.bookTeach.title,
url: data.bookTeach.video
})
}
// else {
// console.log(data.bookBuyConfig.productImageList)
// let arr = []
@@ -397,12 +359,15 @@ export default {
chapter: this.dataForm.chapter,
title: this.dataForm.title,
voices: this.dataForm.voices,
video: this.dataForm.video,
content: this.dataForm.content,
images: imageslist, // 轮播图
// 'video': "https://ehh-private-01.oss-cn-beijing.aliyuncs.com…3/08/28/91fd5a4c35c34763abca5d2929637164movie.mp4",
// 'voices': "https://ehh-private-01.oss-cn-beijing.aliyuncs.com…3/08/28/91fd5a4c35c34763abca5d2929637164movie.mp4",
teachId: this.dataForm.talkid || undefined
})
}).then(({ data }) => {
}).then(({
data
}) => {
if (data && data.code === 0) {
this.$message({
message: "操作成功",
@@ -411,6 +376,7 @@ export default {
onClose: () => {
this.visible = false;
this.dataForm.productDetails = "";
this.dataForm.voices = "";
this.dataForm.video = "";
this.voiceList = [];
this.swiperfileList = []
@@ -441,33 +407,21 @@ export default {
return arr.toString();
}
},
handlePicSuccess(res, file) {
// console.log(res,'res')
if (res.msg == "success") {
// this.dataForm.productImages = res.url;
this.fileList.push({
name: file.name,
url: res.url
});
this.dataForm.voices = res.url;
console.log(this.dataForm.voices, "voices");
this.$message.success("上传成功");
} else {
this.$message.error("上传失败");
}
},
uploadVideoProcess(event, file, fileList) {
this.progressFlag = true; // 显示进度条
this.loadProgress = parseInt(event.percent); // 动态获取文件上传进度
console.log("this.loadProgress", this.loadProgress);
if (this.loadProgress >= 100) {
this.loadProgress = 99;
// 音频
voicesProcess(event, file, fileList) {
this.voicesFlag = true; // 显示进度条
this.voicesLoad = parseInt(event.percent); // 动态获取文件上传进度
console.log("this.voicesLoad", this.voicesLoad);
if (this.voicesLoad >= 100) {
this.voicesLoad = 99;
this.voicesloading = true;
this.loading = true;
// setTimeout( () => {this.progressFlag = false}, 1000) // 一秒后关闭进度条
// setTimeout( () => {this.voicesFlag = false}, 1000) // 一秒后关闭进度条
}
},
videohandlePicSuccess(res, file) {
voicesSuccess(res, file) {
console.log(res, "res");
if (res.msg == "success") {
// this.dataForm.productImages = res.url;
@@ -477,9 +431,10 @@ export default {
});
this.dataForm.voices = res.url;
// console.log(this.dataForm.productImages,'productImages')
this.loadProgress = 100;
this.voicesLoad = 100;
setTimeout(() => {
this.progressFlag = false;
this.voicesFlag = false;
this.voicesloading = false;
this.loading = false;
this.$message.success("上传成功");
}, 1000); // 一秒后关闭进度条
@@ -488,27 +443,74 @@ export default {
}
},
handleRemove(file, fileList) {
this.dataForm.productImages = "";
this.fileList = fileList;
this.dataForm.noneBtnImg = fileList.length >= this.dataForm.limitCountImg;
},
videohandleRemove(file, fileList) {
voicesRemove(file, fileList) {
this.dataForm.voices = "";
this.voiceList = fileList;
},
// 视频
uploadVideo(event, file, fileList) {
this.videoFlag = true; // 显示进度条
this.videoLoad = parseInt(event.percent); // 动态获取文件上传进度
console.log('this.loadProgress', this.videoLoad)
if (this.videoLoad >= 100) {
this.videoLoad = 99
this.videoloading = true;
this.loading = true
// setTimeout( () => {this.progressFlag = false}, 1000) // 一秒后关闭进度条
}
},
videoSuccess(res, file) {
console.log(res, 'res')
if (res.msg == "success") {
// this.dataForm.productImages = res.url;
this.videoList.push({
name: file.name,
url: res.url
})
this.dataForm.video = res.url
// console.log(this.dataForm.productImages,'productImages')
this.loadProgress = 100
setTimeout(() => {
this.progressFlag = false;
this.videoloading = false;
this.loading = false;
this.$message.success("上传成功");
}, 1000) // 一秒后关闭进度条
} else {
this.$message.error("上传失败");
}
},
videoRemove(file, fileList) {
this.dataForm.video = '';
this.videoList = fileList
},
// 清空
handlereset() {
(this.fileList = []), (this.voiceList = []); // 清空视频列表
(this.fileList = []), (this.voiceList = []), (this.videoList = []); // 清空视频列表
this.dataForm.voices = "";
this.visible = false;
this.swiperfileList = []
this.dataForm.images = []
this.$refs["dataForm"].resetFields();
this.dataForm.productDetails = "";
this.progressFlag = false;
this.voicesFlag = false;
this.videoFlag = false;
this.voicesloading = false;
this.videoloading = false;
this.loading = false;
// this.$refs['dataForm'].reset()
},
// 失去焦点事件
onEditorBlur(quill) {
console.log("editor blur!", quill);
@@ -528,9 +530,9 @@ export default {
mounted() {
this.$bus.$on("haveBookIds", data => {
// console.log('haveBookIds', data)
data.bookIds.length > 0
? (this.dataForm.Books = data.bookIds)
: (this.dataForm.Books = []);
data.bookIds.length > 0 ?
(this.dataForm.Books = data.bookIds) :
(this.dataForm.Books = []);
});
},
@@ -546,9 +548,10 @@ export default {
</script>
<style lang="less">
/deep/ .el-uploadvideo .el-upload-list li {
/deep/ .el-uploadvoices .el-upload-list li {
height: auto !important;
}
// .disUoloadSty {
// .el-upload--picture-card {
// display: none;
@@ -561,11 +564,12 @@ export default {
// font-size: 12px;
// }
// }
.el-uploadvideo {
.el-uploadvoices {
.el-progress {
display: none !important;
}
}
.el-uploadfeng {
.el-upload-list__item {
width: 120px;

View File

@@ -43,6 +43,16 @@
<audio v-else id="resource" :src="scope.row.voices" controls v-show='true' style="width: 350px;"></audio>
</template>
</el-table-column>
<el-table-column width="200"
prop="video"
header-align="center"
align="center"
label="视频">
<template slot-scope="scope">
<span v-if="scope.row.video == ''">暂未上传视频</span>
<span else>{{scope.row.video}}</span>
</template>
</el-table-column>
<!-- <el-table-column
prop="createTime"
header-align="center"
@@ -213,4 +223,3 @@
}
}
</script>

View File

@@ -15,15 +15,8 @@
<el-button v-if="isAuth('book:shopproduct:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
header-align="center"
align="center"
label="分类">
<el-table :data="dataList" border v-loading="dataListLoading" style="width: 100%;">
<el-table-column header-align="center" align="center" label="分类">
<template slot-scope="scope">
{{ filterAA(scope.row.typeId) }}
</template>
@@ -33,29 +26,20 @@
{{ scope.row.book.name }}
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="editOrUpdateHandle(scope.row)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</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"
<el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" :current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]" :page-size="pageSize" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<el-dialog :visible.sync="addOrUpdateVisible" :append-to-body="true" :title="titlesub" width="50%" @close="cancleClose">
<el-dialog :visible.sync="addOrUpdateVisible" :append-to-body="true" :title="titlesub" width="50%"
@close="cancleClose">
<el-form :inline="true" :model="addForm" ref="addFormRef" :rules="addFormRule">
<el-row type="flex" justify="center">
<el-form-item label="分类" prop="typeId">
@@ -106,8 +90,14 @@ export default {
},
editId: '',
addFormRule: {
typeId: [{required: true, message: "请选择分类" }],
bookId: [{required: true, message: "请选择书名"}]
typeId: [{
required: true,
message: "请选择分类"
}],
bookId: [{
required: true,
message: "请选择书名"
}]
},
dataList: [],
// publishStatus: false,
@@ -134,7 +124,9 @@ export default {
this.$http({
url: this.$http.adornUrl('/book/medicaldes/typeList?label=medicaldesBookType'),
method: 'post',
}).then(({data}) => {
}).then(({
data
}) => {
if (data && data.code === 0) {
this.typeList = data.result
@@ -155,7 +147,9 @@ export default {
"current": this.pageIndex,
"limit": this.pageSize
})
}).then(({data}) => {
}).then(({
data
}) => {
if (data && data.code === 0) {
this.dataList = data.result.records
this.totalPage = data.result.total
@@ -169,7 +163,7 @@ export default {
getbookname() {
// 获取数据列表
this.$http({
url: this.$http.adornUrl('/book/book/list'),
url: this.$http.adornUrl('/book/medicaldes/bookList'),
method: 'get',
params: this.$http.adornParams({
'page': 1,
@@ -178,7 +172,9 @@ export default {
'publisherName': '',
'authorName': ''
})
}).then(({ data }) => {
}).then(({
data
}) => {
if (data && data.code === 0) {
this.booknameList = data.page.list
} else {
@@ -243,7 +239,9 @@ export default {
this.$http({
url: this.$http.adornUrl(`/book/medicaldes/delBookRelation?id=${id}`),
method: 'post',
}).then(({data}) => {
}).then(({
data
}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
@@ -271,7 +269,9 @@ export default {
"typeId": this.addForm.typeId,
"sort": this.addForm.sort
})
}).then(({data}) => {
}).then(({
data
}) => {
if (data && data.code === 0) {
this.$message.success("成功");
this.addOrUpdateVisible = false

View File

@@ -1,7 +1,8 @@
<template>
<el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible" @close="handlereset">
<el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible"
@close="handlereset">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
label-width="80px">
label-width="120px">
<el-form-item label="姓名" prop="name">
<el-input v-model="dataForm.name" placeholder="姓名"></el-input>
</el-form-item>
@@ -23,9 +24,8 @@
</el-form-item>
<el-form-item label="头像" prop="avatar">
<!-- <el-input v-model="dataForm.avatar" placeholder="头像"></el-input> -->
<el-upload :action= "baseUrl + '/oss/fileoss'" list-type="picture-card"
:on-preview="handlePictureCardPreview" :file-list="fileList" :on-success="handlePicSuccess"
:on-remove="handleRemove">
<el-upload :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>
</el-upload>
<el-dialog :visible.sync="dialogVisible" :append-to-body="true">
@@ -70,6 +70,26 @@
<el-form-item label="删除标记" prop="delFlag">
<el-input v-model="dataForm.delFlag" placeholder="删除标记"></el-input>
</el-form-item> -->
<el-form-item label="脉六权限" prop="pointPower">
<el-radio v-model="dataForm.pointPower" :label='0'></el-radio>
<el-radio v-model="dataForm.pointPower" :label='1'></el-radio>
</el-form-item>
<el-form-item label="时辰取穴权限" prop="tgdzPower">
<el-radio v-model="dataForm.tgdzPower" :label='0'></el-radio>
<el-radio v-model="dataForm.tgdzPower" :label='1'></el-radio>
</el-form-item>
<el-form-item label="五运六气权限" prop="wylqPower">
<el-radio v-model="dataForm.wylqPower" :label='0'></el-radio>
<el-radio v-model="dataForm.wylqPower" :label='1'></el-radio>
</el-form-item>
<el-form-item label="吴门验方权限" prop="prescriptAPower">
<el-radio v-model="dataForm.prescriptAPower" :label='0'></el-radio>
<el-radio v-model="dataForm.prescriptAPower" :label='1'></el-radio>
</el-form-item>
<el-form-item label="肿瘤古方权限" prop="prescriptBPower">
<el-radio v-model="dataForm.prescriptBPower" :label='0'></el-radio>
<el-radio v-model="dataForm.prescriptBPower" :label='1'></el-radio>
</el-form-item>
</div>
</el-form>
<span slot="footer" class="dialog-footer">
@@ -127,14 +147,23 @@ export default {
createTime: '',
updateTime: '',
delFlag: '',
pointPower: 0,
tgdzPower: 0,
wylqPower: 0,
prescriptAPower: 0,
prescriptBPower: 0,
},
dataRule: {
name: [
{ required: true, message: '姓名不能为空', trigger: 'blur' }
],
password: [
{ required: true, message: '密码不能为空', trigger: 'blur' }
],
name: [{
required: true,
message: '姓名不能为空',
trigger: 'blur'
}],
password: [{
required: true,
message: '密码不能为空',
trigger: 'blur'
}],
// age: [
// { required: true, message: '年龄不能为空', trigger: 'blur' }
// ],
@@ -147,8 +176,11 @@ export default {
// nickname: [
// { required: true, message: '昵称不能为空', trigger: 'blur' }
// ],
tel: [
{ required: true, message: '电话不能为空', trigger: 'blur' },
tel: [{
required: true,
message: '电话不能为空',
trigger: 'blur'
},
{
validator: function(rule, value, callback) {
if (/^1[34578]\d{9}$/.test(value) == false) {
@@ -201,7 +233,9 @@ export default {
url: this.$http.adornUrl(`/book/user/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({ data }) => {
}).then(({
data
}) => {
if (data && data.code === 0) {
this.dataForm.name = data.user.name
this.dataForm.age = data.user.age
@@ -218,8 +252,16 @@ export default {
this.dataForm.createTime = data.user.createTime
this.dataForm.updateTime = data.user.updateTime
this.dataForm.delFlag = data.user.delFlag
this.dataForm.pointPower = data.user.pointPower
this.dataForm.tgdzPower = data.user.tgdzPower
this.dataForm.wylqPower = data.user.wylqPower
this.dataForm.prescriptAPower = data.user.prescriptAPower
this.dataForm.prescriptBPower = data.user.prescriptBPower
if (data.user.avatar && data.user.avatar != "") {
var img = { name: '', url: data.user.avatar }
var img = {
name: '',
url: data.user.avatar
}
var attr = []
attr.push(img)
this.fileList = attr
@@ -247,6 +289,11 @@ export default {
'avatar': this.dataForm.avatar,
'nickname': this.dataForm.nickname,
'tel': this.dataForm.tel,
'pointPower': this.dataForm.pointPower,
'tgdzPower': this.dataForm.tgdzPower,
'wylqPower': this.dataForm.wylqPower,
'prescriptAPower': this.dataForm.prescriptAPower,
'prescriptBPower': this.dataForm.prescriptBPower,
// 'password': this.dataForm.password,
// 'vip': this.dataForm.vip,
// 'vipValidtime': this.dataForm.vipValidtime,
@@ -264,7 +311,9 @@ export default {
url: this.$http.adornUrl(`/book/user/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData(myData)
}).then(({ data }) => {
}).then(({
data
}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',