讲书视频,用户权限,图书分类
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<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"
|
||||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm"
|
@close="handlereset">
|
||||||
label-width="80px">
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="80px">
|
||||||
<el-form-item label="书名" prop="name">
|
<el-form-item label="书名" prop="name">
|
||||||
<el-input v-model="dataForm.name" placeholder="书名"></el-input>
|
<el-input v-model="dataForm.name" placeholder="书名"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -38,23 +38,14 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
<el-form-item label="作者" prop="publisherName">
|
<el-form-item label="作者" prop="publisherName">
|
||||||
<el-input v-model="dataForm.publisherName" placeholder="请输入作者" ></el-input>
|
<el-input v-model="dataForm.publisherName" placeholder="请输入作者"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="出版社" prop="publisherId">
|
<el-form-item label="出版社" prop="publisherId">
|
||||||
<el-select
|
<el-select v-model="dataForm.publisherId" multiple filterable allow-create default-first-option
|
||||||
v-model="dataForm.publisherId"
|
|
||||||
multiple
|
|
||||||
filterable
|
|
||||||
allow-create
|
|
||||||
default-first-option
|
|
||||||
placeholder="请输入出版社名称">
|
placeholder="请输入出版社名称">
|
||||||
<el-option
|
<el-option v-for="item in publisherList" :key="item.value + ''" :label="item.value" :value="item.id + ''">
|
||||||
v-for="item in publisherList"
|
|
||||||
:key="item.value + ''"
|
|
||||||
:label="item.value"
|
|
||||||
:value="item.id + ''">
|
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -68,8 +59,9 @@
|
|||||||
<el-input v-model="dataForm.title" placeholder="序言" :rows="3" type="textarea"></el-input>
|
<el-input v-model="dataForm.title" placeholder="序言" :rows="3" type="textarea"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="拆分类型" prop="splits">
|
<el-form-item label="拆分类型" prop="splits">
|
||||||
<el-radio-group v-model="dataForm.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-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="目录" prop="content">
|
<el-form-item label="目录" prop="content">
|
||||||
@@ -78,15 +70,13 @@
|
|||||||
<el-form-item label="简介" prop="description">
|
<el-form-item label="简介" prop="description">
|
||||||
<el-input v-model="dataForm.description" placeholder="简介" :rows="5" type="textarea"></el-input>
|
<el-input v-model="dataForm.description" placeholder="简介" :rows="5" type="textarea"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="图书分类" prop="type">
|
<el-form-item label="图书分类" prop="bookType">
|
||||||
<!-- <el-select v-model="dataForm.type" placeholder="图书分类">
|
<el-radio-group v-model="dataForm.bookType">
|
||||||
<el-option v-for="item in bookList" :key="item.dictType + ''" :label="item.dictValue"
|
<el-radio :label="0">普通</el-radio>
|
||||||
:value="item.dictType + ''">
|
<el-radio :label="1">中医经典</el-radio>
|
||||||
</el-option>
|
<el-radio :label="2">国学经典</el-radio>
|
||||||
</el-select> -->
|
|
||||||
<el-checkbox-group v-model="dataForm.type">
|
</el-radio-group>
|
||||||
<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>
|
</el-form-item>
|
||||||
<el-row>
|
<el-row>
|
||||||
<!-- <el-col :span="12">
|
<!-- <el-col :span="12">
|
||||||
@@ -101,19 +91,15 @@
|
|||||||
<!-- </el-col> -->
|
<!-- </el-col> -->
|
||||||
<el-form-item label="图书类型" prop="medicaldesBookType">
|
<el-form-item label="图书类型" prop="medicaldesBookType">
|
||||||
<el-checkbox-group v-model="dataForm.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-checkbox-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="是否可听" >
|
<el-form-item label="是否可听">
|
||||||
<!-- <el-input v-model="dataForm.salePrice" placeholder="优惠价格"></el-input> -->
|
<!-- <el-input v-model="dataForm.salePrice" placeholder="优惠价格"></el-input> -->
|
||||||
<el-switch
|
<el-switch style="display: block" v-model="dataForm.canListen" active-color="#13ce66"
|
||||||
style="display: block"
|
inactive-color="#ff4949" active-text="可听" inactive-text="不可听">
|
||||||
v-model="dataForm.canListen"
|
|
||||||
active-color="#13ce66"
|
|
||||||
inactive-color="#ff4949"
|
|
||||||
active-text="可听"
|
|
||||||
inactive-text="不可听">
|
|
||||||
</el-switch>
|
</el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -162,28 +148,15 @@
|
|||||||
<el-input v-model="dataForm.publisherId" placeholder="出版商名称"></el-input>
|
<el-input v-model="dataForm.publisherId" placeholder="出版商名称"></el-input>
|
||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
<el-form-item label="文件上传" prop="novel">
|
<el-form-item label="文件上传" prop="novel">
|
||||||
<el-upload
|
<el-upload class="upload-demo" :action="baseUrl + '/oss/fileoss'" :on-preview="handlePreview"
|
||||||
class="upload-demo"
|
:on-remove="handleRemoveNovel" :before-remove="beforeRemove" :on-success="handleNovelSuccess" multiple
|
||||||
:action= "baseUrl + '/oss/fileoss'"
|
:limit="3" :on-exceed="handleExceed" :file-list="fileListNovel">
|
||||||
: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-button size="small" type="primary">点击上传</el-button>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="插图" prop="images">
|
<el-form-item label="插图" prop="images">
|
||||||
<el-upload
|
<el-upload :action="baseUrl + '/oss/fileoss'" list-type="picture-card" :on-preview="handlePictureCardPreview"
|
||||||
:action= "baseUrl + '/oss/fileoss'"
|
:file-list="fileList" :on-success="handlePicSuccess" :on-remove="handleRemove">
|
||||||
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">
|
||||||
@@ -213,49 +186,79 @@
|
|||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import global from '../../common/common.vue' //引入共用组间
|
import global from '../../common/common.vue' //引入共用组间
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
baseUrl:global.baseUrl,
|
baseUrl: global.baseUrl,
|
||||||
visible: false,
|
visible: false,
|
||||||
bookList: [],
|
bookList: [{
|
||||||
medicaldesBookTypeList:[
|
dictType: 0,
|
||||||
{dictType:1,dictValue:"中医基础"},
|
dictValue: "普通"
|
||||||
{dictType:2,dictValue:"中医经典"},
|
},
|
||||||
{dictType:3,dictValue:"各家学说"},
|
{
|
||||||
{dictType:4,dictValue:"中医临床"},
|
dictType: 1,
|
||||||
{dictType:5,dictValue:"文学"},
|
dictValue: "中医经典"
|
||||||
{dictType:6,dictValue:"哲学"},
|
},
|
||||||
|
{
|
||||||
|
dictType: 2,
|
||||||
|
dictValue: "国学经典"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
medicaldesBookTypeList: [{
|
||||||
|
dictType: 1,
|
||||||
|
dictValue: "中医基础"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dictType: 2,
|
||||||
|
dictValue: "中医经典"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dictType: 3,
|
||||||
|
dictValue: "各家学说"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dictType: 4,
|
||||||
|
dictValue: "中医临床"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dictType: 5,
|
||||||
|
dictValue: "文学"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dictType: 6,
|
||||||
|
dictValue: "哲学"
|
||||||
|
},
|
||||||
],
|
],
|
||||||
props: {
|
props: {
|
||||||
dictType: '',
|
dictType: '',
|
||||||
dictValue: ''
|
dictValue: ''
|
||||||
},
|
},
|
||||||
authorList:[],
|
authorList: [],
|
||||||
restaurants: [],
|
restaurants: [],
|
||||||
author:'',
|
author: '',
|
||||||
publisherList:[],
|
publisherList: [],
|
||||||
fileList:[],
|
fileList: [],
|
||||||
fileListNovel:[],
|
fileListNovel: [],
|
||||||
dialogImageUrl: '',
|
dialogImageUrl: '',
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
dataForm: {
|
dataForm: {
|
||||||
id: 0,
|
id: 0,
|
||||||
name: '',
|
name: '',
|
||||||
publisherName:'',
|
publisherName: '',
|
||||||
splits:0,
|
splits: 0,
|
||||||
authorId: [],
|
authorId: [],
|
||||||
description: '',
|
description: '',
|
||||||
title: '',
|
title: '',
|
||||||
|
bookType: 0,
|
||||||
content: '',
|
content: '',
|
||||||
type:[],
|
type: [],
|
||||||
medicaldesBookType:[],
|
medicaldesBookType: [],
|
||||||
// price: '',
|
// price: '',
|
||||||
salePrice:'',
|
salePrice: '',
|
||||||
// istop: '',
|
// istop: '',
|
||||||
isVip:0,
|
isVip: 0,
|
||||||
freeChapterCount:0,
|
freeChapterCount: 0,
|
||||||
// isSale: '',
|
// isSale: '',
|
||||||
publisherId: [],
|
publisherId: [],
|
||||||
images: '',
|
images: '',
|
||||||
@@ -270,7 +273,7 @@ export default {
|
|||||||
clockIn: 2,
|
clockIn: 2,
|
||||||
teachIn: 0,
|
teachIn: 0,
|
||||||
},
|
},
|
||||||
splitsTypeList:[],
|
splitsTypeList: [],
|
||||||
dataRule: {
|
dataRule: {
|
||||||
|
|
||||||
// name: [
|
// name: [
|
||||||
@@ -328,7 +331,7 @@ export default {
|
|||||||
this.getBookList()
|
this.getBookList()
|
||||||
this.loadAll()
|
this.loadAll()
|
||||||
},
|
},
|
||||||
mounted(){
|
mounted() {
|
||||||
// this.restaurants = this.loadAll();
|
// this.restaurants = this.loadAll();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -342,13 +345,16 @@ export default {
|
|||||||
url: this.$http.adornUrl(`/book/book/info/${this.dataForm.id}`),
|
url: this.$http.adornUrl(`/book/book/info/${this.dataForm.id}`),
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: this.$http.adornParams()
|
params: this.$http.adornParams()
|
||||||
}).then(({ data }) => {
|
}).then(({
|
||||||
|
data
|
||||||
|
}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataForm.name = data.book.name
|
this.dataForm.name = data.book.name
|
||||||
this.dataForm.publisherName = data.book.dataForm
|
this.dataForm.publisherName = data.book.dataForm
|
||||||
// this.dataForm.authorId = data.book.authorId
|
// this.dataForm.authorId = data.book.authorId
|
||||||
this.dataForm.description = data.book.description
|
this.dataForm.description = data.book.description
|
||||||
this.dataForm.title = data.book.title
|
this.dataForm.title = data.book.title
|
||||||
|
this.dataForm.bookType = data.book.bookType
|
||||||
this.dataForm.content = data.book.content
|
this.dataForm.content = data.book.content
|
||||||
// this.dataForm.type = data.book.type
|
// this.dataForm.type = data.book.type
|
||||||
// this.dataForm.price = data.book.price
|
// this.dataForm.price = data.book.price
|
||||||
@@ -373,28 +379,34 @@ export default {
|
|||||||
var medicaldeschecklist = data.book.medicaldesBookType
|
var medicaldeschecklist = data.book.medicaldesBookType
|
||||||
var authorList = data.book.authorId
|
var authorList = data.book.authorId
|
||||||
var publisherlish = data.book.publisherId
|
var publisherlish = data.book.publisherId
|
||||||
if(data.book.authorId != ""){
|
if (data.book.authorId != "") {
|
||||||
this.dataForm.authorId = authorList.split(',')
|
this.dataForm.authorId = authorList.split(',')
|
||||||
}
|
}
|
||||||
if(data.book.publisherId != ""){
|
if (data.book.publisherId != "") {
|
||||||
this.dataForm.publisherId = publisherlish.split(',')
|
this.dataForm.publisherId = publisherlish.split(',')
|
||||||
}
|
}
|
||||||
|
|
||||||
this.dataForm.type = checklist.split(',')
|
this.dataForm.type = checklist.split(',')
|
||||||
this.dataForm.medicaldesBookType = medicaldeschecklist.split(',')
|
this.dataForm.medicaldesBookType = medicaldeschecklist.split(',')
|
||||||
for (let i = 0; i < this.dataForm.medicaldesBookType .length; i++) {
|
for (let i = 0; i < this.dataForm.medicaldesBookType.length; i++) {
|
||||||
this.dataForm.medicaldesBookType [i] = parseInt(this.dataForm.medicaldesBookType [i]);
|
this.dataForm.medicaldesBookType[i] = parseInt(this.dataForm.medicaldesBookType[i]);
|
||||||
}
|
}
|
||||||
console.log(this.dataForm.type)
|
console.log(this.dataForm.type)
|
||||||
console.log('2222222222',this.dataForm.medicaldesBookType)
|
console.log('2222222222', this.dataForm.medicaldesBookType)
|
||||||
if (data.book.images != "") {
|
if (data.book.images != "") {
|
||||||
var img = { name: '', url: data.book.images }
|
var img = {
|
||||||
|
name: '',
|
||||||
|
url: data.book.images
|
||||||
|
}
|
||||||
var attr = []
|
var attr = []
|
||||||
attr.push(img)
|
attr.push(img)
|
||||||
this.fileList = attr
|
this.fileList = attr
|
||||||
}
|
}
|
||||||
if (data.book.novel != "" && data.book.novel != null && data.book.novel != 'undefined') {
|
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 = []
|
var attr = []
|
||||||
attr.push(novel)
|
attr.push(novel)
|
||||||
this.fileListNovel = attr
|
this.fileListNovel = attr
|
||||||
@@ -406,8 +418,8 @@ export default {
|
|||||||
},
|
},
|
||||||
// 表单提交
|
// 表单提交
|
||||||
dataFormSubmit() {
|
dataFormSubmit() {
|
||||||
console.log('11111',this.dataForm.medicaldesBookType)
|
console.log('11111', this.dataForm.medicaldesBookType)
|
||||||
if(this.dataForm.medicaldesBookType.length == 0){
|
if (this.dataForm.medicaldesBookType.length == 0) {
|
||||||
this.$message.error("请选择图书类型");
|
this.$message.error("请选择图书类型");
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -422,6 +434,7 @@ export default {
|
|||||||
'authorId': this.dataForm.authorId.join(','),
|
'authorId': this.dataForm.authorId.join(','),
|
||||||
'description': this.dataForm.description,
|
'description': this.dataForm.description,
|
||||||
'title': this.dataForm.title,
|
'title': this.dataForm.title,
|
||||||
|
'bookType': this.dataForm.bookType,
|
||||||
'publisherName': this.dataForm.publisherName,
|
'publisherName': this.dataForm.publisherName,
|
||||||
'content': this.dataForm.content,
|
'content': this.dataForm.content,
|
||||||
'type': this.dataForm.type.join(','),
|
'type': this.dataForm.type.join(','),
|
||||||
@@ -446,7 +459,9 @@ export default {
|
|||||||
'clockIn': this.dataForm.clockIn,
|
'clockIn': this.dataForm.clockIn,
|
||||||
'teachIn': this.dataForm.teachIn
|
'teachIn': this.dataForm.teachIn
|
||||||
})
|
})
|
||||||
}).then(({ data }) => {
|
}).then(({
|
||||||
|
data
|
||||||
|
}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '操作成功',
|
message: '操作成功',
|
||||||
@@ -480,16 +495,20 @@ export default {
|
|||||||
// params: this.$http.adornParams({
|
// params: this.$http.adornParams({
|
||||||
// 'type': 'book_type',
|
// 'type': 'book_type',
|
||||||
// })
|
// })
|
||||||
}).then(({ data }) => {
|
}).then(({
|
||||||
|
data
|
||||||
|
}) => {
|
||||||
console.log(data)
|
console.log(data)
|
||||||
this.bookList = data.dataList
|
// this.bookList = data.dataList
|
||||||
})
|
})
|
||||||
|
|
||||||
// 获取图书拆分类型
|
// 获取图书拆分类型
|
||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/book/sysdictdata/selectByType/splitsType'),
|
url: this.$http.adornUrl('/book/sysdictdata/selectByType/splitsType'),
|
||||||
method: 'get',
|
method: 'get',
|
||||||
}).then(({ data }) => {
|
}).then(({
|
||||||
|
data
|
||||||
|
}) => {
|
||||||
this.splitsTypeList = data.dataList
|
this.splitsTypeList = data.dataList
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -503,7 +522,7 @@ export default {
|
|||||||
handleDownload(file) {
|
handleDownload(file) {
|
||||||
console.log(file)
|
console.log(file)
|
||||||
},
|
},
|
||||||
handlereset(){
|
handlereset() {
|
||||||
this.fileList = [],
|
this.fileList = [],
|
||||||
this.fileListNovel = [],
|
this.fileListNovel = [],
|
||||||
this.visible = false
|
this.visible = false
|
||||||
@@ -520,7 +539,7 @@ export default {
|
|||||||
handleRemoveNovel(file) {
|
handleRemoveNovel(file) {
|
||||||
this.dataForm.novel = '';
|
this.dataForm.novel = '';
|
||||||
},
|
},
|
||||||
handleNovelSuccess(file){
|
handleNovelSuccess(file) {
|
||||||
this.dataForm.novel = file.url
|
this.dataForm.novel = file.url
|
||||||
},
|
},
|
||||||
// querySearch(queryString, cb) {
|
// querySearch(queryString, cb) {
|
||||||
@@ -539,13 +558,17 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/book/author/bookAuthorList'),
|
url: this.$http.adornUrl('/book/author/bookAuthorList'),
|
||||||
method: 'get',
|
method: 'get',
|
||||||
}).then(({ data }) => {
|
}).then(({
|
||||||
|
data
|
||||||
|
}) => {
|
||||||
this.authorList = data.list
|
this.authorList = data.list
|
||||||
})
|
})
|
||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/book/publisher/publisherList'),
|
url: this.$http.adornUrl('/book/publisher/publisherList'),
|
||||||
method: 'get',
|
method: 'get',
|
||||||
}).then(({ data }) => {
|
}).then(({
|
||||||
|
data
|
||||||
|
}) => {
|
||||||
this.publisherList = data.list
|
this.publisherList = data.list
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -556,5 +579,5 @@ export default {
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,18 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog
|
<el-dialog :title="!dataForm.productId ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible"
|
||||||
:title="!dataForm.productId ? '新增' : '修改'"
|
@close="handlereset" lock-scroll width="750px">
|
||||||
:close-on-click-modal="false"
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="100px">
|
||||||
: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-form-item label="所属分类" prop="poids">
|
||||||
<el-cascader v-model="dataForm.poids" :options="categorys" :props="props" clearable></el-cascader>
|
<el-cascader v-model="dataForm.poids" :options="categorys" :props="props" clearable></el-cascader>
|
||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
@@ -24,72 +13,53 @@
|
|||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
<!-- 关联的图书ids -->
|
<!-- 关联的图书ids -->
|
||||||
<el-form-item label="标题" prop="title">
|
<el-form-item label="标题" prop="title">
|
||||||
<el-input
|
<el-input v-model="dataForm.title" placeholder="请输入讲书标题"></el-input>
|
||||||
v-model="dataForm.title"
|
|
||||||
placeholder="请输入讲书标题"
|
|
||||||
></el-input>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="讲书章节" prop="chapter" :required="true">
|
<el-form-item label="讲书章节" prop="chapter" :required="true">
|
||||||
<el-input
|
<el-input style="width: 150px;" v-model.number="dataForm.chapter" @input="numberChange" placeholder="请输入章节序号"
|
||||||
style="width: 150px;"
|
type="number" min="1"></el-input>
|
||||||
v-model.number="dataForm.chapter"
|
|
||||||
@input="numberChange"
|
|
||||||
placeholder="请输入章节序号"
|
|
||||||
type="number"
|
|
||||||
min="1"
|
|
||||||
></el-input>
|
|
||||||
<br /><span style="color: #999;">请输入大于0的整数,且为必填项</span>
|
<br /><span style="color: #999;">请输入大于0的整数,且为必填项</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="音频">
|
<el-form-item label="音频">
|
||||||
<el-upload
|
<el-upload :limit="1" class="el-uploadvoices" v-loading="voicesLoading" element-loading-text="正在保存到服务器,请勿离开..."
|
||||||
:limit="1"
|
element-loading-spinner="el-icon-loading" element-loading-background="rgba(255, 255, 255, 0.8)" :class="{
|
||||||
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="{
|
|
||||||
uoloadSty: dataForm.showBtnDealImg,
|
uoloadSty: dataForm.showBtnDealImg,
|
||||||
disUoloadSty: dataForm.noneBtnImg
|
disUoloadSty: dataForm.noneBtnImg
|
||||||
}"
|
}" :action="baseUrl + '/oss/fileoss'" :file-list="voiceList" :on-success="voicesSuccess" accept=".mp3"
|
||||||
:action="baseUrl + '/oss/fileoss'"
|
:on-remove="voicesRemove" :show-file-list="true" :on-progress="voicesProcess">
|
||||||
:file-list="voiceList"
|
|
||||||
:on-success="videohandlePicSuccess"
|
|
||||||
accept=".mp3"
|
|
||||||
:on-remove="videohandleRemove"
|
|
||||||
:show-file-list="true"
|
|
||||||
:on-progress="uploadVideoProcess"
|
|
||||||
>
|
|
||||||
<!-- <i class="el-icon-plus"></i> -->
|
<!-- <i class="el-icon-plus"></i> -->
|
||||||
<el-button slot="trigger" size="small" type="primary"
|
<el-button slot="trigger" size="small" type="primary">上传文件</el-button>
|
||||||
>上传文件</el-button
|
|
||||||
>
|
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<el-progress
|
<el-progress v-show="voicesFlag" :percentage="voicesLoad"></el-progress>
|
||||||
v-show="progressFlag"
|
|
||||||
:percentage="loadProgress"
|
|
||||||
></el-progress>
|
|
||||||
<div>
|
<div>
|
||||||
<audio
|
<audio id="resource" :src="dataForm.voices" controls v-show="true"></audio>
|
||||||
id="resource"
|
|
||||||
:src="dataForm.voices"
|
|
||||||
controls
|
|
||||||
v-show="true"
|
|
||||||
></audio>
|
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</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-form-item label="轮播图" prop="images">
|
||||||
<el-upload
|
<el-upload :limit="3" class="el-uploadfeng" :action="baseUrl + '/oss/fileoss'" list-type="picture-card"
|
||||||
:limit="3"
|
:file-list="swiperfileList" :on-success="bannerHandlePicSuccess" accept=".jpeg,.jpg,.gif,.png"
|
||||||
class="el-uploadfeng"
|
:on-remove="bannerHandleRemove">
|
||||||
: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>
|
<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">
|
||||||
@@ -99,15 +69,9 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="内容" prop="content">
|
<el-form-item label="内容" prop="content">
|
||||||
<quill-editor
|
<quill-editor v-model="dataForm.content" ref="myQuillEditor" :options="editorOption"
|
||||||
v-model="dataForm.content"
|
@blur="onEditorBlur($event)" @focus="onEditorFocus($event)" @ready="onEditorReady($event)"
|
||||||
ref="myQuillEditor"
|
class="shangpin_editor">
|
||||||
:options="editorOption"
|
|
||||||
@blur="onEditorBlur($event)"
|
|
||||||
@focus="onEditorFocus($event)"
|
|
||||||
@ready="onEditorReady($event)"
|
|
||||||
class="shangpin_editor"
|
|
||||||
>
|
|
||||||
</quill-editor>
|
</quill-editor>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item label="排序" prop="sort">
|
<!-- <el-form-item label="排序" prop="sort">
|
||||||
@@ -116,22 +80,22 @@
|
|||||||
</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>
|
||||||
<el-button type="primary" @click="dataFormSubmit()" :disabled="loading"
|
<el-button type="primary" @click="dataFormSubmit()" :disabled="loading">确定</el-button>
|
||||||
>确定</el-button
|
|
||||||
>
|
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { quillEditor } from "vue-quill-editor";
|
import {
|
||||||
import global from "../../common/common.vue"; //引入共用组间
|
quillEditor
|
||||||
|
} from "vue-quill-editor";
|
||||||
|
import global from "../../common/common.vue"; //引入共用组间
|
||||||
|
|
||||||
import "quill/dist/quill.core.css";
|
import "quill/dist/quill.core.css";
|
||||||
import "quill/dist/quill.snow.css";
|
import "quill/dist/quill.snow.css";
|
||||||
import "quill/dist/quill.bubble.css";
|
import "quill/dist/quill.bubble.css";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
// 自定义校验规则
|
// 自定义校验规则
|
||||||
var checkMoney = (rule, value, callback) => {
|
var checkMoney = (rule, value, callback) => {
|
||||||
@@ -152,8 +116,12 @@ export default {
|
|||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
progressFlag: false,
|
voicesLoading: false,
|
||||||
loadProgress: 0,
|
videoLoading: false,
|
||||||
|
voicesFlag: false,
|
||||||
|
voicesLoad: 0,
|
||||||
|
videoFlag: false,
|
||||||
|
videoLoad: 0,
|
||||||
baseUrl: global.baseUrl,
|
baseUrl: global.baseUrl,
|
||||||
visible: false,
|
visible: false,
|
||||||
categorys: [],
|
categorys: [],
|
||||||
@@ -173,27 +141,25 @@ export default {
|
|||||||
title: "",
|
title: "",
|
||||||
productPid: "",
|
productPid: "",
|
||||||
voices: "",
|
voices: "",
|
||||||
|
video: "",
|
||||||
chapter: null,
|
chapter: null,
|
||||||
content: "",
|
content: "",
|
||||||
images:[]
|
images: []
|
||||||
},
|
},
|
||||||
voiceList: [],
|
voiceList: [],
|
||||||
swiperfileList:[],
|
videoList: [],
|
||||||
|
swiperfileList: [],
|
||||||
dataRule: {
|
dataRule: {
|
||||||
title: [
|
title: [{
|
||||||
{
|
|
||||||
required: true,
|
required: true,
|
||||||
message: "书评标题不能为空",
|
message: "书评标题不能为空",
|
||||||
trigger: "blur"
|
trigger: "blur"
|
||||||
}
|
}],
|
||||||
],
|
|
||||||
|
|
||||||
chapter: [
|
chapter: [{
|
||||||
{
|
|
||||||
validator: checkMoney,
|
validator: checkMoney,
|
||||||
trigger: "blur"
|
trigger: "blur"
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 富文本编辑器配置
|
// 富文本编辑器配置
|
||||||
@@ -202,45 +168,38 @@ export default {
|
|||||||
toolbar: [
|
toolbar: [
|
||||||
["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线
|
["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线
|
||||||
["blockquote", "code-block"], // 引用 代码块
|
["blockquote", "code-block"], // 引用 代码块
|
||||||
[
|
[{
|
||||||
{
|
|
||||||
header: 1
|
header: 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
header: 2
|
header: 2
|
||||||
}
|
}
|
||||||
], // 1、2 级标题
|
], // 1、2 级标题
|
||||||
[
|
[{
|
||||||
{
|
|
||||||
list: "ordered"
|
list: "ordered"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
list: "bullet"
|
list: "bullet"
|
||||||
}
|
}
|
||||||
], // 有序、无序列表
|
], // 有序、无序列表
|
||||||
[
|
[{
|
||||||
{
|
|
||||||
script: "sub"
|
script: "sub"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
script: "super"
|
script: "super"
|
||||||
}
|
}
|
||||||
], // 上标/下标
|
], // 上标/下标
|
||||||
[
|
[{
|
||||||
{
|
|
||||||
indent: "-1"
|
indent: "-1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
indent: "+1"
|
indent: "+1"
|
||||||
}
|
}
|
||||||
], // 缩进
|
], // 缩进
|
||||||
[
|
[{
|
||||||
{
|
|
||||||
direction: "rtl"
|
direction: "rtl"
|
||||||
}
|
}], // 文本方向
|
||||||
], // 文本方向
|
[{
|
||||||
[
|
|
||||||
{
|
|
||||||
size: [
|
size: [
|
||||||
"12",
|
"12",
|
||||||
"14",
|
"14",
|
||||||
@@ -253,15 +212,11 @@ export default {
|
|||||||
"32",
|
"32",
|
||||||
"36"
|
"36"
|
||||||
]
|
]
|
||||||
}
|
}], // 字体大小
|
||||||
], // 字体大小
|
[{
|
||||||
[
|
|
||||||
{
|
|
||||||
header: [1, 2, 3, 4, 5, 6]
|
header: [1, 2, 3, 4, 5, 6]
|
||||||
}
|
}], // 标题
|
||||||
], // 标题
|
[{
|
||||||
[
|
|
||||||
{
|
|
||||||
color: []
|
color: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -269,13 +224,11 @@ export default {
|
|||||||
}
|
}
|
||||||
], // 字体颜色、字体背景颜色
|
], // 字体颜色、字体背景颜色
|
||||||
// [{ font: ['songti'] }], // 字体种类
|
// [{ font: ['songti'] }], // 字体种类
|
||||||
[
|
[{
|
||||||
{
|
|
||||||
align: []
|
align: []
|
||||||
}
|
}], // 对齐方式
|
||||||
], // 对齐方式
|
|
||||||
["clean"], // 清除文本格式
|
["clean"], // 清除文本格式
|
||||||
["image", "video"] // 链接、图片、视频
|
["image", "voices"] // 链接、图片、视频
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
placeholder: "请输入正文"
|
placeholder: "请输入正文"
|
||||||
@@ -299,20 +252,23 @@ export default {
|
|||||||
params: this.$http.adornParams({
|
params: this.$http.adornParams({
|
||||||
teachId: id
|
teachId: id
|
||||||
})
|
})
|
||||||
}).then(({ data }) => {
|
}).then(({
|
||||||
|
data
|
||||||
|
}) => {
|
||||||
// console.log(data, 666);
|
// console.log(data, 666);
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataForm.title = data.bookTeach.title;
|
this.dataForm.title = data.bookTeach.title;
|
||||||
this.dataForm.voices = data.bookTeach.voices;
|
this.dataForm.voices = data.bookTeach.voices;
|
||||||
|
this.dataForm.video = data.bookTeach.video;
|
||||||
this.dataForm.content = data.bookTeach.content;
|
this.dataForm.content = data.bookTeach.content;
|
||||||
this.dataForm.chapter = data.bookTeach.chapter;
|
this.dataForm.chapter = data.bookTeach.chapter;
|
||||||
if(data.bookTeach.images != ''){
|
if (data.bookTeach.images != '') {
|
||||||
let arr = data.bookTeach.images.split(';');
|
let arr = data.bookTeach.images.split(';');
|
||||||
// console.log('转换成的数组',arr)
|
// console.log('转换成的数组',arr)
|
||||||
arr.forEach( (item,index) => {
|
arr.forEach((item, index) => {
|
||||||
this.swiperfileList.push({
|
this.swiperfileList.push({
|
||||||
name: index,
|
name: index,
|
||||||
url:item
|
url: item
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -323,6 +279,12 @@ export default {
|
|||||||
url: data.bookTeach.voices
|
url: data.bookTeach.voices
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (this.dataForm.video != '') {
|
||||||
|
this.videoList.push({
|
||||||
|
name: data.bookTeach.title,
|
||||||
|
url: data.bookTeach.video
|
||||||
|
})
|
||||||
|
}
|
||||||
// else {
|
// else {
|
||||||
// console.log(data.bookBuyConfig.productImageList)
|
// console.log(data.bookBuyConfig.productImageList)
|
||||||
// let arr = []
|
// let arr = []
|
||||||
@@ -378,13 +340,13 @@ export default {
|
|||||||
var imageslist = []
|
var imageslist = []
|
||||||
let arr = []
|
let arr = []
|
||||||
// console.log('this.swiperfileList',this.swiperfileList)
|
// console.log('this.swiperfileList',this.swiperfileList)
|
||||||
if(this.swiperfileList.length > 0){
|
if (this.swiperfileList.length > 0) {
|
||||||
arr = this.swiperfileList.map( item => {
|
arr = this.swiperfileList.map(item => {
|
||||||
return item.url
|
return item.url
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
imageslist = arr.join(";");
|
imageslist = arr.join(";");
|
||||||
console.log(imageslist,'imageslist')
|
console.log(imageslist, 'imageslist')
|
||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl(
|
url: this.$http.adornUrl(
|
||||||
`/book/teach/${
|
`/book/teach/${
|
||||||
@@ -397,12 +359,15 @@ export default {
|
|||||||
chapter: this.dataForm.chapter,
|
chapter: this.dataForm.chapter,
|
||||||
title: this.dataForm.title,
|
title: this.dataForm.title,
|
||||||
voices: this.dataForm.voices,
|
voices: this.dataForm.voices,
|
||||||
|
video: this.dataForm.video,
|
||||||
content: this.dataForm.content,
|
content: this.dataForm.content,
|
||||||
images:imageslist, // 轮播图
|
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
|
teachId: this.dataForm.talkid || undefined
|
||||||
})
|
})
|
||||||
}).then(({ data }) => {
|
}).then(({
|
||||||
|
data
|
||||||
|
}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: "操作成功",
|
message: "操作成功",
|
||||||
@@ -411,6 +376,7 @@ export default {
|
|||||||
onClose: () => {
|
onClose: () => {
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
this.dataForm.productDetails = "";
|
this.dataForm.productDetails = "";
|
||||||
|
this.dataForm.voices = "";
|
||||||
this.dataForm.video = "";
|
this.dataForm.video = "";
|
||||||
this.voiceList = [];
|
this.voiceList = [];
|
||||||
this.swiperfileList = []
|
this.swiperfileList = []
|
||||||
@@ -441,33 +407,21 @@ export default {
|
|||||||
return arr.toString();
|
return arr.toString();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handlePicSuccess(res, file) {
|
|
||||||
// console.log(res,'res')
|
// 音频
|
||||||
if (res.msg == "success") {
|
voicesProcess(event, file, fileList) {
|
||||||
// this.dataForm.productImages = res.url;
|
this.voicesFlag = true; // 显示进度条
|
||||||
this.fileList.push({
|
this.voicesLoad = parseInt(event.percent); // 动态获取文件上传进度
|
||||||
name: file.name,
|
console.log("this.voicesLoad", this.voicesLoad);
|
||||||
url: res.url
|
if (this.voicesLoad >= 100) {
|
||||||
});
|
this.voicesLoad = 99;
|
||||||
this.dataForm.voices = res.url;
|
this.voicesloading = true;
|
||||||
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;
|
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
// setTimeout( () => {this.progressFlag = false}, 1000) // 一秒后关闭进度条
|
// setTimeout( () => {this.voicesFlag = false}, 1000) // 一秒后关闭进度条
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
videohandlePicSuccess(res, file) {
|
voicesSuccess(res, file) {
|
||||||
console.log(res, "res");
|
console.log(res, "res");
|
||||||
if (res.msg == "success") {
|
if (res.msg == "success") {
|
||||||
// this.dataForm.productImages = res.url;
|
// this.dataForm.productImages = res.url;
|
||||||
@@ -477,9 +431,10 @@ export default {
|
|||||||
});
|
});
|
||||||
this.dataForm.voices = res.url;
|
this.dataForm.voices = res.url;
|
||||||
// console.log(this.dataForm.productImages,'productImages')
|
// console.log(this.dataForm.productImages,'productImages')
|
||||||
this.loadProgress = 100;
|
this.voicesLoad = 100;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.progressFlag = false;
|
this.voicesFlag = false;
|
||||||
|
this.voicesloading = false;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.$message.success("上传成功");
|
this.$message.success("上传成功");
|
||||||
}, 1000); // 一秒后关闭进度条
|
}, 1000); // 一秒后关闭进度条
|
||||||
@@ -488,27 +443,74 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
handleRemove(file, fileList) {
|
voicesRemove(file, fileList) {
|
||||||
this.dataForm.productImages = "";
|
|
||||||
this.fileList = fileList;
|
|
||||||
this.dataForm.noneBtnImg = fileList.length >= this.dataForm.limitCountImg;
|
|
||||||
},
|
|
||||||
videohandleRemove(file, fileList) {
|
|
||||||
this.dataForm.voices = "";
|
this.dataForm.voices = "";
|
||||||
this.voiceList = fileList;
|
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() {
|
handlereset() {
|
||||||
(this.fileList = []), (this.voiceList = []); // 清空视频列表
|
(this.fileList = []), (this.voiceList = []), (this.videoList = []); // 清空视频列表
|
||||||
this.dataForm.voices = "";
|
this.dataForm.voices = "";
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
this.swiperfileList = []
|
this.swiperfileList = []
|
||||||
this.dataForm.images = []
|
this.dataForm.images = []
|
||||||
this.$refs["dataForm"].resetFields();
|
this.$refs["dataForm"].resetFields();
|
||||||
this.dataForm.productDetails = "";
|
this.dataForm.productDetails = "";
|
||||||
this.progressFlag = false;
|
this.voicesFlag = false;
|
||||||
|
this.videoFlag = false;
|
||||||
|
this.voicesloading = false;
|
||||||
|
this.videoloading = false;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
// this.$refs['dataForm'].reset()
|
// this.$refs['dataForm'].reset()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
// 失去焦点事件
|
// 失去焦点事件
|
||||||
onEditorBlur(quill) {
|
onEditorBlur(quill) {
|
||||||
console.log("editor blur!", quill);
|
console.log("editor blur!", quill);
|
||||||
@@ -528,9 +530,9 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
this.$bus.$on("haveBookIds", data => {
|
this.$bus.$on("haveBookIds", data => {
|
||||||
// console.log('haveBookIds', data)
|
// console.log('haveBookIds', data)
|
||||||
data.bookIds.length > 0
|
data.bookIds.length > 0 ?
|
||||||
? (this.dataForm.Books = data.bookIds)
|
(this.dataForm.Books = data.bookIds) :
|
||||||
: (this.dataForm.Books = []);
|
(this.dataForm.Books = []);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -542,31 +544,33 @@ export default {
|
|||||||
deep: true
|
deep: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
/deep/ .el-uploadvideo .el-upload-list li {
|
/deep/ .el-uploadvoices .el-upload-list li {
|
||||||
height: auto !important;
|
height: auto !important;
|
||||||
}
|
}
|
||||||
// .disUoloadSty {
|
|
||||||
// .el-upload--picture-card {
|
|
||||||
// display: none;
|
|
||||||
// /* 上传按钮隐藏 */
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// .el-form-item {
|
// .disUoloadSty {
|
||||||
// /deep/ .el-form-item__label {
|
// .el-upload--picture-card {
|
||||||
// font-size: 12px;
|
// display: none;
|
||||||
// }
|
// /* 上传按钮隐藏 */
|
||||||
// }
|
// }
|
||||||
.el-uploadvideo {
|
// }
|
||||||
|
|
||||||
|
// .el-form-item {
|
||||||
|
// /deep/ .el-form-item__label {
|
||||||
|
// font-size: 12px;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
.el-uploadvoices {
|
||||||
.el-progress {
|
.el-progress {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.el-uploadfeng {
|
|
||||||
|
.el-uploadfeng {
|
||||||
.el-upload-list__item {
|
.el-upload-list__item {
|
||||||
width: 120px;
|
width: 120px;
|
||||||
height: 120px;
|
height: 120px;
|
||||||
@@ -577,9 +581,9 @@ export default {
|
|||||||
height: 120px;
|
height: 120px;
|
||||||
line-height: 120px;
|
line-height: 120px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.shangpin_editor .ql-editor {
|
.shangpin_editor .ql-editor {
|
||||||
height: 150px;
|
height: 150px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -43,6 +43,16 @@
|
|||||||
<audio v-else id="resource" :src="scope.row.voices" controls v-show='true' style="width: 350px;"></audio>
|
<audio v-else id="resource" :src="scope.row.voices" controls v-show='true' style="width: 350px;"></audio>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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
|
<!-- <el-table-column
|
||||||
prop="createTime"
|
prop="createTime"
|
||||||
header-align="center"
|
header-align="center"
|
||||||
@@ -213,4 +223,3 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -15,15 +15,8 @@
|
|||||||
<el-button v-if="isAuth('book:shopproduct:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
<el-button v-if="isAuth('book:shopproduct:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-table
|
<el-table :data="dataList" border v-loading="dataListLoading" style="width: 100%;">
|
||||||
:data="dataList"
|
<el-table-column header-align="center" align="center" label="分类">
|
||||||
border
|
|
||||||
v-loading="dataListLoading"
|
|
||||||
style="width: 100%;">
|
|
||||||
<el-table-column
|
|
||||||
header-align="center"
|
|
||||||
align="center"
|
|
||||||
label="分类">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ filterAA(scope.row.typeId) }}
|
{{ filterAA(scope.row.typeId) }}
|
||||||
</template>
|
</template>
|
||||||
@@ -33,29 +26,20 @@
|
|||||||
{{ scope.row.book.name }}
|
{{ scope.row.book.name }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
|
||||||
fixed="right"
|
|
||||||
header-align="center"
|
|
||||||
align="center"
|
|
||||||
width="150"
|
|
||||||
label="操作">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="text" size="small" @click="editOrUpdateHandle(scope.row)">修改</el-button>
|
<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>
|
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination
|
<el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" :current-page="pageIndex"
|
||||||
@size-change="sizeChangeHandle"
|
:page-sizes="[10, 20, 50, 100]" :page-size="pageSize" :total="totalPage"
|
||||||
@current-change="currentChangeHandle"
|
|
||||||
:current-page="pageIndex"
|
|
||||||
:page-sizes="[10, 20, 50, 100]"
|
|
||||||
:page-size="pageSize"
|
|
||||||
:total="totalPage"
|
|
||||||
layout="total, sizes, prev, pager, next, jumper">
|
layout="total, sizes, prev, pager, next, jumper">
|
||||||
</el-pagination>
|
</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-form :inline="true" :model="addForm" ref="addFormRef" :rules="addFormRule">
|
||||||
<el-row type="flex" justify="center">
|
<el-row type="flex" justify="center">
|
||||||
<el-form-item label="分类" prop="typeId">
|
<el-form-item label="分类" prop="typeId">
|
||||||
@@ -89,25 +73,31 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
typeList: [], //类型列表
|
typeList: [], //类型列表
|
||||||
booknameList: [],
|
booknameList: [],
|
||||||
dataForm: {
|
dataForm: {
|
||||||
dictType: '',//分类
|
dictType: '', //分类
|
||||||
bookName: '',//书名
|
bookName: '', //书名
|
||||||
},
|
},
|
||||||
addForm: {
|
addForm: {
|
||||||
"id": '',//新增不传
|
"id": '', //新增不传
|
||||||
"bookId": '',
|
"bookId": '',
|
||||||
"typeId": '',
|
"typeId": '',
|
||||||
"sort": ''
|
"sort": ''
|
||||||
},
|
},
|
||||||
editId: '',
|
editId: '',
|
||||||
addFormRule: {
|
addFormRule: {
|
||||||
typeId: [{required: true, message: "请选择分类" }],
|
typeId: [{
|
||||||
bookId: [{required: true, message: "请选择书名"}]
|
required: true,
|
||||||
|
message: "请选择分类"
|
||||||
|
}],
|
||||||
|
bookId: [{
|
||||||
|
required: true,
|
||||||
|
message: "请选择书名"
|
||||||
|
}]
|
||||||
},
|
},
|
||||||
dataList: [],
|
dataList: [],
|
||||||
// publishStatus: false,
|
// publishStatus: false,
|
||||||
@@ -117,7 +107,7 @@ export default {
|
|||||||
dataListLoading: false,
|
dataListLoading: false,
|
||||||
dataListSelections: [],
|
dataListSelections: [],
|
||||||
addOrUpdateVisible: false,
|
addOrUpdateVisible: false,
|
||||||
bookIds:[],
|
bookIds: [],
|
||||||
titlesub: '新增'
|
titlesub: '新增'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -125,16 +115,18 @@ export default {
|
|||||||
// AddOrUpdate,
|
// AddOrUpdate,
|
||||||
// chooseBook
|
// chooseBook
|
||||||
},
|
},
|
||||||
activated () {
|
activated() {
|
||||||
this.gettypeList()
|
this.gettypeList()
|
||||||
this.getDataList()
|
this.getDataList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
gettypeList () {
|
gettypeList() {
|
||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/book/medicaldes/typeList?label=medicaldesBookType'),
|
url: this.$http.adornUrl('/book/medicaldes/typeList?label=medicaldesBookType'),
|
||||||
method: 'post',
|
method: 'post',
|
||||||
}).then(({data}) => {
|
}).then(({
|
||||||
|
data
|
||||||
|
}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.typeList = data.result
|
this.typeList = data.result
|
||||||
|
|
||||||
@@ -144,7 +136,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
getDataList () {
|
getDataList() {
|
||||||
this.dataListLoading = true
|
this.dataListLoading = true
|
||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/book/medicaldes/bookRelationListByType'),
|
url: this.$http.adornUrl('/book/medicaldes/bookRelationListByType'),
|
||||||
@@ -155,7 +147,9 @@ export default {
|
|||||||
"current": this.pageIndex,
|
"current": this.pageIndex,
|
||||||
"limit": this.pageSize
|
"limit": this.pageSize
|
||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({
|
||||||
|
data
|
||||||
|
}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.result.records
|
this.dataList = data.result.records
|
||||||
this.totalPage = data.result.total
|
this.totalPage = data.result.total
|
||||||
@@ -169,16 +163,18 @@ export default {
|
|||||||
getbookname() {
|
getbookname() {
|
||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/book/book/list'),
|
url: this.$http.adornUrl('/book/medicaldes/bookList'),
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: this.$http.adornParams({
|
params: this.$http.adornParams({
|
||||||
'page': 1,
|
'page': 1,
|
||||||
'limit': 1000000,
|
'limit': 1000000,
|
||||||
'bookName': '',
|
'bookName': '',
|
||||||
'publisherName' : '',
|
'publisherName': '',
|
||||||
'authorName' : ''
|
'authorName': ''
|
||||||
})
|
})
|
||||||
}).then(({ data }) => {
|
}).then(({
|
||||||
|
data
|
||||||
|
}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.booknameList = data.page.list
|
this.booknameList = data.page.list
|
||||||
} else {
|
} else {
|
||||||
@@ -187,27 +183,27 @@ export default {
|
|||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
filterAA(val){
|
filterAA(val) {
|
||||||
var aa = this.typeList.filter(obj => obj.dictType == val)
|
var aa = this.typeList.filter(obj => obj.dictType == val)
|
||||||
return aa[0].dictValue
|
return aa[0].dictValue
|
||||||
},
|
},
|
||||||
// 每页数
|
// 每页数
|
||||||
sizeChangeHandle (val) {
|
sizeChangeHandle(val) {
|
||||||
this.pageSize = val
|
this.pageSize = val
|
||||||
this.pageIndex = 1
|
this.pageIndex = 1
|
||||||
this.getDataList()
|
this.getDataList()
|
||||||
},
|
},
|
||||||
// 当前页
|
// 当前页
|
||||||
currentChangeHandle (val) {
|
currentChangeHandle(val) {
|
||||||
this.pageIndex = val
|
this.pageIndex = val
|
||||||
this.getDataList()
|
this.getDataList()
|
||||||
},
|
},
|
||||||
// 多选
|
// 多选
|
||||||
selectionChangeHandle (val) {
|
selectionChangeHandle(val) {
|
||||||
this.dataListSelections = val
|
this.dataListSelections = val
|
||||||
},
|
},
|
||||||
// 新增 / 修改
|
// 新增 / 修改
|
||||||
editOrUpdateHandle (row) {
|
editOrUpdateHandle(row) {
|
||||||
this.titlesub = '修改'
|
this.titlesub = '修改'
|
||||||
this.getbookname()
|
this.getbookname()
|
||||||
this.editId = row.id
|
this.editId = row.id
|
||||||
@@ -227,14 +223,14 @@ export default {
|
|||||||
this.addOrUpdateVisible = false
|
this.addOrUpdateVisible = false
|
||||||
this.$refs["addFormRef"].resetFields();
|
this.$refs["addFormRef"].resetFields();
|
||||||
this.addForm = {
|
this.addForm = {
|
||||||
"id": '',//新增不传
|
"id": '', //新增不传
|
||||||
"bookId": '',
|
"bookId": '',
|
||||||
"typeId": '',
|
"typeId": '',
|
||||||
"sort": ''
|
"sort": ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 删除
|
// 删除
|
||||||
deleteHandle (id) {
|
deleteHandle(id) {
|
||||||
this.$confirm('请确认是否删除?', '提示', {
|
this.$confirm('请确认是否删除?', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
@@ -243,7 +239,9 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl(`/book/medicaldes/delBookRelation?id=${id}`),
|
url: this.$http.adornUrl(`/book/medicaldes/delBookRelation?id=${id}`),
|
||||||
method: 'post',
|
method: 'post',
|
||||||
}).then(({data}) => {
|
}).then(({
|
||||||
|
data
|
||||||
|
}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '操作成功',
|
message: '操作成功',
|
||||||
@@ -261,7 +259,7 @@ export default {
|
|||||||
},
|
},
|
||||||
addOreEditCate() {
|
addOreEditCate() {
|
||||||
this.$refs["addFormRef"].validate(valid => {
|
this.$refs["addFormRef"].validate(valid => {
|
||||||
if(valid) {
|
if (valid) {
|
||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/book/medicaldes/saveOrUpdateBookRelation'),
|
url: this.$http.adornUrl('/book/medicaldes/saveOrUpdateBookRelation'),
|
||||||
method: 'post',
|
method: 'post',
|
||||||
@@ -271,7 +269,9 @@ export default {
|
|||||||
"typeId": this.addForm.typeId,
|
"typeId": this.addForm.typeId,
|
||||||
"sort": this.addForm.sort
|
"sort": this.addForm.sort
|
||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({
|
||||||
|
data
|
||||||
|
}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message.success("成功");
|
this.$message.success("成功");
|
||||||
this.addOrUpdateVisible = false
|
this.addOrUpdateVisible = false
|
||||||
@@ -284,5 +284,5 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
<template>
|
<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()"
|
<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-form-item label="姓名" prop="name">
|
||||||
<el-input v-model="dataForm.name" placeholder="姓名"></el-input>
|
<el-input v-model="dataForm.name" placeholder="姓名"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -23,9 +24,8 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="头像" prop="avatar">
|
<el-form-item label="头像" prop="avatar">
|
||||||
<!-- <el-input v-model="dataForm.avatar" placeholder="头像"></el-input> -->
|
<!-- <el-input v-model="dataForm.avatar" placeholder="头像"></el-input> -->
|
||||||
<el-upload :action= "baseUrl + '/oss/fileoss'" list-type="picture-card"
|
<el-upload :action="baseUrl + '/oss/fileoss'" list-type="picture-card" :on-preview="handlePictureCardPreview"
|
||||||
:on-preview="handlePictureCardPreview" :file-list="fileList" :on-success="handlePicSuccess"
|
:file-list="fileList" :on-success="handlePicSuccess" :on-remove="handleRemove">
|
||||||
: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">
|
||||||
@@ -70,6 +70,26 @@
|
|||||||
<el-form-item label="删除标记" prop="delFlag">
|
<el-form-item label="删除标记" prop="delFlag">
|
||||||
<el-input v-model="dataForm.delFlag" placeholder="删除标记"></el-input>
|
<el-input v-model="dataForm.delFlag" placeholder="删除标记"></el-input>
|
||||||
</el-form-item> -->
|
</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>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
@@ -80,15 +100,15 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import global from '../../common/common.vue' //引入共用组间
|
import global from '../../common/common.vue' //引入共用组间
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
baseUrl:global.baseUrl,
|
baseUrl: global.baseUrl,
|
||||||
visible: false,
|
visible: false,
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
fileList: [],
|
fileList: [],
|
||||||
pickerOptions:{
|
pickerOptions: {
|
||||||
shortcuts: [{
|
shortcuts: [{
|
||||||
text: '今天',
|
text: '今天',
|
||||||
onClick(picker) {
|
onClick(picker) {
|
||||||
@@ -127,14 +147,23 @@ export default {
|
|||||||
createTime: '',
|
createTime: '',
|
||||||
updateTime: '',
|
updateTime: '',
|
||||||
delFlag: '',
|
delFlag: '',
|
||||||
|
pointPower: 0,
|
||||||
|
tgdzPower: 0,
|
||||||
|
wylqPower: 0,
|
||||||
|
prescriptAPower: 0,
|
||||||
|
prescriptBPower: 0,
|
||||||
},
|
},
|
||||||
dataRule: {
|
dataRule: {
|
||||||
name: [
|
name: [{
|
||||||
{ required: true, message: '姓名不能为空', trigger: 'blur' }
|
required: true,
|
||||||
],
|
message: '姓名不能为空',
|
||||||
password: [
|
trigger: 'blur'
|
||||||
{ required: true, message: '密码不能为空', trigger: 'blur' }
|
}],
|
||||||
],
|
password: [{
|
||||||
|
required: true,
|
||||||
|
message: '密码不能为空',
|
||||||
|
trigger: 'blur'
|
||||||
|
}],
|
||||||
// age: [
|
// age: [
|
||||||
// { required: true, message: '年龄不能为空', trigger: 'blur' }
|
// { required: true, message: '年龄不能为空', trigger: 'blur' }
|
||||||
// ],
|
// ],
|
||||||
@@ -147,8 +176,11 @@ export default {
|
|||||||
// nickname: [
|
// nickname: [
|
||||||
// { required: true, message: '昵称不能为空', trigger: 'blur' }
|
// { required: true, message: '昵称不能为空', trigger: 'blur' }
|
||||||
// ],
|
// ],
|
||||||
tel: [
|
tel: [{
|
||||||
{ required: true, message: '电话不能为空', trigger: 'blur' },
|
required: true,
|
||||||
|
message: '电话不能为空',
|
||||||
|
trigger: 'blur'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
validator: function(rule, value, callback) {
|
validator: function(rule, value, callback) {
|
||||||
if (/^1[34578]\d{9}$/.test(value) == false) {
|
if (/^1[34578]\d{9}$/.test(value) == false) {
|
||||||
@@ -201,7 +233,9 @@ export default {
|
|||||||
url: this.$http.adornUrl(`/book/user/info/${this.dataForm.id}`),
|
url: this.$http.adornUrl(`/book/user/info/${this.dataForm.id}`),
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: this.$http.adornParams()
|
params: this.$http.adornParams()
|
||||||
}).then(({ data }) => {
|
}).then(({
|
||||||
|
data
|
||||||
|
}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataForm.name = data.user.name
|
this.dataForm.name = data.user.name
|
||||||
this.dataForm.age = data.user.age
|
this.dataForm.age = data.user.age
|
||||||
@@ -218,8 +252,16 @@ export default {
|
|||||||
this.dataForm.createTime = data.user.createTime
|
this.dataForm.createTime = data.user.createTime
|
||||||
this.dataForm.updateTime = data.user.updateTime
|
this.dataForm.updateTime = data.user.updateTime
|
||||||
this.dataForm.delFlag = data.user.delFlag
|
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 != "") {
|
if (data.user.avatar && data.user.avatar != "") {
|
||||||
var img = { name: '', url: data.user.avatar }
|
var img = {
|
||||||
|
name: '',
|
||||||
|
url: data.user.avatar
|
||||||
|
}
|
||||||
var attr = []
|
var attr = []
|
||||||
attr.push(img)
|
attr.push(img)
|
||||||
this.fileList = attr
|
this.fileList = attr
|
||||||
@@ -233,12 +275,12 @@ export default {
|
|||||||
dataFormSubmit() {
|
dataFormSubmit() {
|
||||||
this.$refs['dataForm'].validate((valid) => {
|
this.$refs['dataForm'].validate((valid) => {
|
||||||
let myData = {}
|
let myData = {}
|
||||||
if(!this.dataForm.id){
|
if (!this.dataForm.id) {
|
||||||
myData = {
|
myData = {
|
||||||
'name': this.dataForm.name,
|
'name': this.dataForm.name,
|
||||||
'tel': this.dataForm.tel,
|
'tel': this.dataForm.tel,
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
myData = {
|
myData = {
|
||||||
'id': this.dataForm.id,
|
'id': this.dataForm.id,
|
||||||
'name': this.dataForm.name,
|
'name': this.dataForm.name,
|
||||||
@@ -247,6 +289,11 @@ export default {
|
|||||||
'avatar': this.dataForm.avatar,
|
'avatar': this.dataForm.avatar,
|
||||||
'nickname': this.dataForm.nickname,
|
'nickname': this.dataForm.nickname,
|
||||||
'tel': this.dataForm.tel,
|
'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,
|
// 'password': this.dataForm.password,
|
||||||
// 'vip': this.dataForm.vip,
|
// 'vip': this.dataForm.vip,
|
||||||
// 'vipValidtime': this.dataForm.vipValidtime,
|
// 'vipValidtime': this.dataForm.vipValidtime,
|
||||||
@@ -264,7 +311,9 @@ export default {
|
|||||||
url: this.$http.adornUrl(`/book/user/${!this.dataForm.id ? 'save' : 'update'}`),
|
url: this.$http.adornUrl(`/book/user/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: this.$http.adornData(myData)
|
data: this.$http.adornData(myData)
|
||||||
}).then(({ data }) => {
|
}).then(({
|
||||||
|
data
|
||||||
|
}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '操作成功',
|
message: '操作成功',
|
||||||
@@ -297,7 +346,7 @@ export default {
|
|||||||
handleRemove(file) {
|
handleRemove(file) {
|
||||||
this.dataForm.avatar = '';
|
this.dataForm.avatar = '';
|
||||||
},
|
},
|
||||||
handlereset(){
|
handlereset() {
|
||||||
// console.log('关闭了')
|
// console.log('关闭了')
|
||||||
this.$refs['dataForm'].resetFields()
|
this.$refs['dataForm'].resetFields()
|
||||||
this.dataForm.password = ''
|
this.dataForm.password = ''
|
||||||
@@ -305,5 +354,5 @@ export default {
|
|||||||
this.visible = false
|
this.visible = false
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
Reference in New Issue
Block a user