图书 文物

master
lion 1 year ago
parent 15cbe835dd
commit 82a37e0d12

@ -2,7 +2,7 @@
ENV = 'development'
# base api
#VUE_APP_BASE_API = 'https://gb-test.ali251.langye.net'
VUE_APP_BASE_API = 'https://gb-test.ali251.langye.net'
VUE_APP_BASE_API = 'https://gbyuyue.szgmbwg.org.cn'
#VUE_APP_BASE_API = 'https://gbyuyue.szgmbwg.org.cn'

@ -3,5 +3,5 @@ ENV = 'production'
# base api
#VUE_APP_BASE_API = 'https://gb-test.ali251.langye.net'
VUE_APP_BASE_API = 'https://gbyuyue.szgmbwg.org.cn'
VUE_APP_BASE_API = 'https://gb-test.ali251.langye.net'
#VUE_APP_BASE_API = 'https://gbyuyue.szgmbwg.org.cn'

@ -0,0 +1,34 @@
import request from '@/utils/request'
export function index(params) {
return request({
url: '/api/admin/book/index',
method: 'get',
params: params
})
}
export function save(data) {
return request({
url: '/api/admin/book/save',
method: 'post',
data
})
}
export function show(params) {
return request({
url: '/api/admin/book/show',
method: 'get',
params
})
}
export function destroy(params) {
return request({
url: '/api/admin/book/destroy',
method: 'get',
params
})
}

@ -0,0 +1,294 @@
<template>
<div>
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增书籍' : '编辑书籍'" :form="form"
:rules="rules" @submit="submit">
<template v-slot:name>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>名称
</div>
<div class="xy-table-item-content">
<el-input v-model="form.name" placeholder="请输入书籍名称" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:datetime>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>发布时间
</div>
<div class="xy-table-item-content">
<el-date-picker style="width: 300px;" v-model="form.datetime" value-format="yyyy-MM-dd HH:mm:ss"
type="datetime" placeholder="选择发布时间">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:from>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>来源
</div>
<div class="xy-table-item-content">
<el-input v-model="form.from" placeholder="请输入来源" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:image_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>头图
</div>
<div class="xy-table-item-content">
<el-upload :action="action"
:file-list="headPictureList"
list-type="picture-card"
style="width:600px"
:limit="1" :auto-upload="true" :data="uploadOther"
:on-success="handlesuccess"
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove">
<i slot="default" class="el-icon-plus"></i>
</el-upload>
</div>
</div>
</template>
<template v-slot:content>
<div class="xy-table-item">
<div class="xy-table-item-label">
内容:
</div>
<div class="xy-table-item-content" style="width:680px">
<xyTinymce v-if="isShow" v-model="form.content"></xyTinymce>
</div>
</div>
</template>
</xy-dialog>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="">
</el-dialog>
</div>
</template>
<script>
import xyTinymce from "@/components/XyTinymce/index.vue";
import {
show,
save
} from "@/api/book"
import {
Message
} from 'element-ui'
import {
getToken
} from '@/utils/auth'
export default {
components: {
xyTinymce
},
data() {
return {
isShow: false,
type: 'add',
id: '',
dialogVisible:false,
dialogImageUrl:'',
form: {
name: '',
datetime:'',
from:'',
image_id: '',
content: ''
},
uploadOther: {
token: ""
},
action:`${process.env.VUE_APP_BASE_API}/api/admin/upload-file`,
headPictureList:[],
rules: {
name: [{
required: true,
message: '请输入书籍名称'
}],
datetime: [{
required: true,
message: '请选择发布时间'
}]
}
}
},
created() {
this.uploadOther.token = getToken();
},
methods: {
getDatetimeValue(){
const now = new Date();
const year = now.getFullYear();
const month = now.getMonth() + 1;
const day = now.getDate();
const hour = now.getHours();
const minute = now.getMinutes();
const second = now.getSeconds();
const currentTime = `${year}-${month >= 10 ? month : '0' + month}-${day >= 10 ? day : '0' + day} ${hour >= 10 ? hour : '0' + hour}:${minute >= 10 ? minute : '0' + minute}:${second >= 10 ? second : '0' + second}`;
return currentTime;
},
async getDetail() {
const res = await show({
id: this.id
})
this.form = {
name: res?.name,
datetime:res.datetime?res.datetime:this.getDatetimeValue(),
from:res.from?res.from:'苏州革命博物馆',
image_id: res?.image_id,
content: res?.content
}
res.image?this.headPictureList.push(res.image):''
},
submit() {
if(this.headPictureList.length>0){
for(var h of this.headPictureList){
if(h.response){
this.form.image_id = h.response.id
}else{
this.form.image_id = h.id
}
}
}else{
this.form.image_id = ''
}
if (this.type === 'add') {
save({
...this.form
}).then(res => {
Message({
type: 'success',
message: '新增书籍成功'
})
this.isShow = false
this.$emit('refresh')
})
return
}
if (this.type === 'editor') {
save({
id: this.id,
...this.form
}).then(res => {
Message({
type: 'success',
message: '编辑书籍成功'
})
this.isShow = false
this.$emit('refresh')
})
}
},
handleRemove(file,fileList) {
this.headPictureList = fileList
},
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
handlesuccess(response, file, fileList) {
this.headPictureList = fileList
},
},
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
}else{
this.form.from = '苏州革命博物馆'
this.form.datetime = this.getDatetimeValue()
}
} else {
this.id = ''
this.type = ''
this.headPictureList = []
this.$refs['dialog'].reset()
}
}
}
}
</script>
<style scoped lang="scss">
.xy-table-item-label {
width: 160px;
}
.img__delete {
transform: scale(0.8, 0.8);
position: absolute;
top: 4px;
right: 4px;
}
::v-deep .avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
::v-deep .avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
::v-deep .el-upload--picture-card {
font-size: 28px;
color: #8c939d;
width: 80px !important;
height: 80px !important;
line-height: 80px !important;
text-align: center;
}
::v-deep .avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 80px !important;
height: 80px !important;
line-height: 80px !important;
text-align: center;
}
::v-deep .avatar {
width: 80px !important;
display: block;
border-radius: 6px;
}
::v-deep .xy-table-item-label {
width: 160px !important;
}
::v-deep .el-date-editor .el-range-separator {
width: auto !important;
}
::v-deep .el-input-number .el-input__inner {
text-align: left !important;
}
.searchCompanys {
display: flex;
justify-content: space-between;
margin-bottom: 16px;
.el-input {
width: 80%
}
}
</style>

@ -0,0 +1,123 @@
<template>
<div style="padding: 0 20px">
<div ref="lxHeader">
<lx-header icon="md-apps" text="党史书籍" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<Input v-model="select.name" style="width: 200px;margin-right: 10px;" placeholder="关键字搜索" />
<Button type="primary" @click="getBook"></Button>
<Button icon="ios-add" type="primary" style="margin-left: 10px;" @click="$refs['addBook'].isShow = true,$refs['addBook'].type = 'add'">添加</Button>
</div>
</slot>
</lx-header>
</div>
<xy-table
:list="list"
:total="total"
@pageSizeChange="e => select.pageSize = e"
@pageIndexChange="pageChange"
:table-item="table">
<template v-slot:btns>
<el-table-column fixed="right" label="操作" width="260" header-align="center">
<template slot-scope="scope">
<Button type="primary" size="small" @click="editorBook(scope.row.id,'editor')"></Button>
<Poptip
transfer
confirm
title="确认要删除吗?"
@on-ok="deleteActivity(scope.row)">
<Button type="primary" style="margin-left: 10px;" size="small" ghost>删除</Button>
</Poptip>
</template>
</el-table-column>
</template>
</xy-table>
<addBook ref="addBook" @refresh="getBook"></addBook>
</div>
</template>
<script>
import {index,destroy} from "@/api/book"
import addBook from '@/views/book/component/addBook'
import { Message } from 'element-ui'
export default {
components:{
addBook
},
data() {
return {
select:{
pageSize:10,
pageIndex:1,
name:""
},
total:0,
list:[],
table:[
{
label:"名称",
prop:'name',
align:'left',
// width:240,
fixed:'left'
},
{
label:"来源",
prop:'from',
align:'center',
width:100,
},
{
label:"发布时间",
prop:'datetime',
align:'center',
width:180,
}
]
}
},
mounted() {
this.getBook()
},
methods: {
async getBook(){
const res = await index({
page_size:this.select.pageSize,
page:this.select.pageIndex,
name:this.select.name,
sort_name:'datetime',
sort_type:"ASC",
})
this.list = res.data
this.total = res.total
},
pageChange(e){
this.select.pageIndex = e
this.getBook()
},
deleteActivity(row){
destroy({id:row.id}).then(res => {
Message({
type:'success',
message:'删除书籍成功'
})
this.getBook()
})
},
editorBook(id,type){
this.$refs['addBook'].id = id
this.$refs['addBook'].type = type
this.$refs['addBook'].isShow = true
},
}
}
</script>
<style scoped lang="scss">
</style>

@ -11,30 +11,57 @@
<el-input v-model="form.name" placeholder="请输入文物名称" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:release_time>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>发布时间
</div>
<div class="xy-table-item-content">
<el-date-picker style="width: 300px;" v-model="form.release_time" value-format="yyyy-MM-dd HH:mm:ss"
type="datetime" placeholder="选择发布时间">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:source>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>来源
</div>
<div class="xy-table-item-content">
<el-input v-model="form.source" placeholder="请输入来源" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:history_time>
<template v-slot:release_time>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>发布时间
</div>
<div class="xy-table-item-content">
<el-date-picker style="width: 300px;" v-model="form.release_time" value-format="yyyy-MM-dd HH:mm:ss"
type="datetime" placeholder="选择发布时间">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:source>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>来源
</div>
<div class="xy-table-item-content">
<el-input v-model="form.source" placeholder="请输入来源" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:link_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>关联文物
</div>
<div class="xy-table-item-content">
<el-select v-model="form.link_id" placeholder="请选择">
<el-option v-for="item in relicList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-date-picker>
</div>
</div>
</template>
<template v-slot:show_list>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>列表显示
</div>
<div class="xy-table-item-content">
<el-radio-group v-model="form.show_list">
<el-radio :label="1">显示</el-radio>
<el-radio :label="0">不显示</el-radio>
</el-radio-group>
</div>
</div>
</template>
<!-- <template v-slot:history_time>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>文物年限
@ -65,146 +92,341 @@
<el-input v-model="form.grade" placeholder="请输入文物等级" clearable style="width: 300px;"></el-input>
</div>
</div>
</template> -->
<template v-slot:url_3d>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>fbx别名
</div>
<div class="xy-table-item-content">
<el-input v-model="form.url_3d" placeholder="请输入fbx别名" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:threed_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>3D图
</div>
<div class="xy-table-item-content">
<el-upload :action="action" class="upload-demo" :file-list="threedList" style="width:600px" :limit="1"
:auto-upload="true" :data="uploadOther"
:on-success="(response, file, fileList)=>{handlesuccessVoice(response, file, fileList,'threed')}"
:on-remove="(file,fileList,type)=>{handleRemoveVoice(file,fileList,'threed')}">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</div>
</div>
</template>
<template v-slot:fbx_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>obj文件
</div>
<div class="xy-table-item-content">
<el-upload :action="action" class="upload-demo" :file-list="fbxList" style="width:600px" :limit="1"
:auto-upload="true" :data="uploadOther"
:on-success="(response, file, fileList)=>{handlesuccessVoice(response, file, fileList,'fbx')}"
:on-remove="(file,fileList,type)=>{handleRemoveVoice(file,fileList,'fbx')}">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</div>
</div>
</template>
<template v-slot:jpg_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>jpg文件
</div>
<div class="xy-table-item-content">
<el-upload :action="action" class="upload-demo" :file-list="jpgList" style="width:600px" :limit="1"
:auto-upload="true" :data="uploadOther"
:on-success="(response, file, fileList)=>{handlesuccessVoice(response, file, fileList,'jpg')}"
:on-remove="(file,fileList,type)=>{handleRemoveVoice(file,fileList,'jpg')}">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</div>
</div>
</template>
<template v-slot:head_picture>
<template v-slot:jpg2_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>头图
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>jpg文件2
</div>
<div class="xy-table-item-content">
<el-upload :action="action"
:file-list="heatPictureList"
list-type="picture-card"
style="width:600px"
:limit="1" :auto-upload="true" :data="uploadOther"
:on-success="handlesuccess"
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove">
<i slot="default" class="el-icon-plus"></i>
<el-upload :action="action" class="upload-demo" :file-list="jpg2List" style="width:600px" :limit="1"
:auto-upload="true" :data="uploadOther"
:on-success="(response, file, fileList)=>{handlesuccessVoice(response, file, fileList,'jpg2')}"
:on-remove="(file,fileList,type)=>{handleRemoveVoice(file,fileList,'jpg2')}">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</div>
</div>
</template>
<template v-slot:content>
<div class="xy-table-item">
<div class="xy-table-item-label">
内容:
</div>
<div class="xy-table-item-content" style="width:680px">
<xyTinymce v-if="isShow" v-model="form.content"></xyTinymce>
</div>
</div>
</template>
<template v-slot:voice>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>语音文件
</div>
<div class="xy-table-item-content">
<el-upload :action="action" class="upload-demo" :file-list="voiceList" style="width:600px" :limit="1"
:auto-upload="true" :data="uploadOther"
:on-success="(response, file, fileList)=>{handlesuccessVoice(response, file, fileList,'voice')}"
:on-remove="(file,fileList,type)=>{handleRemoveVoice(file,fileList,'voice')}">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</div>
</div>
</template>
<template v-slot:head_picture>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>关联头图
</div>
<div class="xy-table-item-content">
<el-upload :action="action" :file-list="headPictureList" list-type="picture-card" style="width:600px"
:limit="1" :auto-upload="true" :data="uploadOther" :on-success="handlesuccess"
:on-preview="handlePictureCardPreview" :on-remove="handleRemove">
<i slot="default" class="el-icon-plus"></i>
</el-upload>
</div>
</div>
</template>
<template v-slot:content>
<div class="xy-table-item">
<div class="xy-table-item-label">
内容:
</div>
<div class="xy-table-item-content" style="width:680px">
<xyTinymce v-if="isShow" v-model="form.content"></xyTinymce>
</div>
</div>
</template>
</xy-dialog>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="">
</xy-dialog>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="">
</el-dialog>
</div>
</template>
<script>
<script>
import xyTinymce from "@/components/XyTinymce/index.vue";
import {
store,
show,
save
save,
index
} from "@/api/relic"
import {
Message
} from 'element-ui'
import {
getToken
} from 'element-ui'
import {
getToken
} from '@/utils/auth'
export default {
components: {
xyTinymce
export default {
components: {
xyTinymce
},
data() {
return {
isShow: false,
type: 'add',
id: '',
dialogVisible:false,
dialogImageUrl:'',
id: '',
dialogVisible: false,
dialogImageUrl: '',
relicList: [],
form: {
name: '',
release_time:'',
source:'',
name: '',
release_time: '',
source: '',
link_id: '',
show_list: 1,
url_3d: '',
threed_id: '',
fbx_id: '',
jpg_id: '',
voice: '',
head_picture: '',
content: '',
history_time: '',
contain: '',
grade: '',
head_picture: '',
content: ''
},
uploadOther: {
token: ""
},
action:`${process.env.VUE_APP_BASE_API}/api/admin/upload-file`,
heatPictureList:[],
},
uploadOther: {
token: ""
},
action: `${process.env.VUE_APP_BASE_API}/api/admin/upload-file`,
headPictureList: [],
threedList: [],
fbxList: [],
jpgList: [],
jpg2List: [],
voiceList: [],
rules: {
name: [{
required: true,
message: '请输入文物名称'
}],
release_time: [{
required: true,
message: '请选择发布时间'
}],
source: [{
required: true,
message: '请输入来源'
}],
release_time: [{
required: true,
message: '请选择发布时间'
}],
source: [{
required: true,
message: '请输入来源'
}]
}
}
},
created() {
this.uploadOther.token = getToken();
created() {
this.uploadOther.token = getToken();
this.getRelic()
},
methods: {
getDatetimeValue(){
const now = new Date();
const year = now.getFullYear();
const month = now.getMonth() + 1;
const day = now.getDate();
const hour = now.getHours();
const minute = now.getMinutes();
const second = now.getSeconds();
const currentTime = `${year}-${month >= 10 ? month : '0' + month}-${day >= 10 ? day : '0' + day} ${hour >= 10 ? hour : '0' + hour}:${minute >= 10 ? minute : '0' + minute}:${second >= 10 ? second : '0' + second}`;
return currentTime;
methods: {
async getRelic() {
const res = await index({
page_size: 999,
page: 1,
name: '',
sort_name: 'release_time',
sort_type: "DESC",
})
this.relicList = res.data
},
getDatetimeValue() {
const now = new Date();
const year = now.getFullYear();
const month = now.getMonth() + 1;
const day = now.getDate();
const hour = now.getHours();
const minute = now.getMinutes();
const second = now.getSeconds();
const currentTime =
`${year}-${month >= 10 ? month : '0' + month}-${day >= 10 ? day : '0' + day} ${hour >= 10 ? hour : '0' + hour}:${minute >= 10 ? minute : '0' + minute}:${second >= 10 ? second : '0' + second}`;
return currentTime;
},
async getDetail() {
const res = await show({
id: this.id
})
this.form = {
name: res?.name,
release_time:res.release_time?res.release_time:this.getDatetimeValue(),
source:res.source?res.source:'苏州革命博物馆',
history_time: res?.history_time,
contain: res?.contain,
grade: res?.grade,
head_picture: res?.head_picture,
content: res?.content
}
res.head_upload?this.heatPictureList.push(res.head_upload):''
console.log("this.heatPictureList",this.heatPictureList)
name: res?.name,
release_time: res.release_time ? res.release_time : this.getDatetimeValue(),
source: res.source ? res.source : '苏州革命博物馆',
link_id: res?.link_id,
show_list: res.show_list===0 ? 0 : 1,
url_3d: res?.url_3d,
threed_id: res?.threed_id,
fbx_id: res?.fbx_id,
jpg_id: res?.jpg_id,
jpg2_id: res?.jpg_id,
voice: res?.voice,
head_picture: res?.head_picture,
content: res?.content,
history_time: res?.history_time,
contain: res?.contain,
grade: res?.grade,
}
res.head_upload ? this.headPictureList.push(res.head_upload) : ''
res.voice_upload ? this.voiceList.push({
id: res.voice_upload.id,
name: res.voice_upload.original_name,
url: res.voice_upload.url
}) : ''
res.threed ? this.threedList.push({
id: res.threed.id,
name: res.threed.original_name,
url: res.threed.url
}) : ''
res.fbx ? this.fbxList.push({
id: res.fbx.id,
name: res.fbx.original_name,
url: res.fbx.url
}) : ''
res.jpg ? this.jpgList.push({
id: res.jpg.id,
name: res.jpg.original_name,
url: res.jpg.url
}) : ''
res.jpg2 ? this.jpg2List.push({
id: res.jpg2.id,
name: res.jpg2.original_name,
url: res.jpg2.url
}) : ''
},
submit() {
if(this.heatPictureList.length>0){
for(var h of this.heatPictureList){
if(h.response){
this.form.head_picture = h.response.id
}else{
this.form.head_picture = h.id
submit() {
if (this.headPictureList.length > 0) {
for (var h of this.headPictureList) {
if (h.response) {
this.form.head_picture = h.response.id
} else {
this.form.head_picture = h.id
}
}
} else {
this.form.head_picture = ''
}
if (this.voiceList.length > 0) {
for (var h of this.voiceList) {
if (h.response) {
this.form.voice = h.response.id
} else {
this.form.voice = h.id
}
}
} else {
this.form.voice = ''
}
if (this.threedList.length > 0) {
for (var h of this.threedList) {
if (h.response) {
this.form.threed_id = h.response.id
} else {
this.form.threed_id = h.id
}
}
} else {
this.form.threed_id = ''
}
if (this.fbxList.length > 0) {
for (var h of this.fbxList) {
if (h.response) {
this.form.fbx_id = h.response.id
} else {
this.form.fbx_id = h.id
}
}
} else {
this.form.fbx_id = ''
}
if (this.jpgList.length > 0) {
for (var h of this.jpgList) {
if (h.response) {
this.form.jpg_id = h.response.id
} else {
this.form.jpg_id = h.id
}
}
} else {
this.form.jpg_id = ''
}
if (this.jpg2List.length > 0) {
for (var h of this.jpg2List) {
if (h.response) {
this.form.jpg2_id = h.response.id
} else {
this.form.jpg2_id = h.id
}
}
}else{
this.form.head_picture = ''
} else {
this.form.jpg2_id = ''
}
console.log(this.form)
// return
if (this.type === 'add') {
store({
...this.form
@ -231,16 +453,60 @@
this.$emit('refresh')
})
}
},
handleRemove(file,fileList) {
this.heatPictureList = fileList
},
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
handlesuccess(response, file, fileList) {
this.heatPictureList = fileList
},
handleRemove(file, fileList) {
this.headPictureList = fileList
},
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
handlesuccess(response, file, fileList) {
this.headPictureList = fileList
},
handleRemoveVoice(file, fileList, type) {
console.log(file, fileList, type)
switch (type) {
case 'voice':
this.voiceList = fileList
break;
case 'threed':
this.threedList = fileList
break;
case 'fbx':
this.fbxList = fileList
break;
case 'jpg':
this.jpgList = fileList
break;
case 'jpg2':
this.jpg2List = fileList
break;
default:
break;
}
},
handlesuccessVoice(response, file, fileList, type) {
console.log(response, file, fileList, type)
switch (type) {
case 'voice':
this.voiceList = fileList
break;
case 'threed':
this.threedList = fileList
break;
case 'fbx':
this.fbxList = fileList
break;
case 'jpg':
this.jpgList = fileList
break;
case 'jpg2':
this.jpg2List = fileList
break;
default:
break;
}
},
},
watch: {
@ -248,14 +514,19 @@
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
}else{
this.form.source = '苏州革命博物馆'
this.form.release_time = this.getDatetimeValue()
} else {
this.form.source = '苏州革命博物馆'
this.form.release_time = this.getDatetimeValue()
}
} else {
this.id = ''
this.type = ''
this.heatPictureList = []
this.type = ''
this.headPictureList = []
this.voiceList = []
this.threedList = []
this.fbxList = []
this.jpgList = []
this.jpg2List = []
this.$refs['dialog'].reset()
}
}

@ -66,23 +66,30 @@ export default {
fixed:'left'
},
{
label:"文物等级",
prop:'grade',
label:"列表显示",
prop:'show_list',
align:'center',
width:100,
},
{
label:"文物组成",
prop:'contain',
align:'center',
width:240,
},
{
label:"文物年限",
prop:'history_time',
align:'center',
width:120,
},
// {
// label:"",
// prop:'grade',
// align:'center',
// width:100,
// },
// {
// label:"",
// prop:'contain',
// align:'center',
// width:240,
// },
// {
// label:"",
// prop:'history_time',
// align:'center',
// width:120,
// },
{
label:"发布时间",
prop:'release_time',

Loading…
Cancel
Save