lion 3 years ago
parent 085442b116
commit e61c0f6b87

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

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

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

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

@ -42,7 +42,7 @@ export default {
font-size: 15px;
// color: #fff;
white-space: nowrap;
border-bottom: 2px solid #ef9525;
border-bottom: 2px solid #cf995a;
> span {
position: relative;
top: 2px;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

@ -26,7 +26,7 @@
},
data() {
return {
title: '智能工具箱管理平台',
title: '苏州革命博物馆',
logo: 'https://wpimg.wallstcn.com/69a1c46c-eb1c-4b46-8bd4-e9e686ef5251.png'
}
}

@ -1,5 +1,5 @@
/* 改变主题色变量 */
$--color-primary: #EF9525;
$--color-primary: #cf995a;
/* 改变 icon 字体路径变量,必需 */
$--font-path: '~element-ui/lib/theme-chalk/fonts';

@ -4,13 +4,13 @@ $menuActiveText:#fff;
$subMenuActiveText:#fff; //https://github.com/ElemeFE/element/issues/12951
$menuBg:#ffffff;//#304156
$menuHover:#ef9525;
$menuActiveBg:#ef9525;
$menuHover:#cf995a;
$menuActiveBg:#cf995a;
$subMenuBg:#ffffff;//#1f2d3d
$subMenuHover:#ef9525;
$submenuActiveBg:#ef9525;
$subMenuHover:#cf995a;
$submenuActiveBg:#cf995a;
$sideBarWidth: 210px;
$primaryColor: #c69845;

@ -1,4 +1,4 @@
@import '~view-design/src/styles/index.less';
// Here are the variables to cover, such as:
@primary-color: #EF9525;
@primary-color: #cf995a;

@ -0,0 +1,307 @@
<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: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:summary>
<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 type='textarea' v-model="form.summary" placeholder="请输入摘要" clearable style="width: 300px;"></el-input>
</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" list-type="picture-card" :file-list="headPictureList" ref="pictureUpload"
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">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>内容
</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 {
store,
show,
save
} from "@/api/achievement"
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: '',
release_time:'',
source:'',
summary: '',
head_picture: '',
content: ''
},
uploadOther: {
token: ""
},
action:`${process.env.VUE_APP_BASE_API}/api/admin/upload-file`,
headPictureList:[],
rules: {
name: [{
required: true,
message: '请输入成果名称'
}],
release_time: [{
required: true,
message: '请选择发布时间'
}],
source: [{
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,
release_time:res.release_time?res.release_time:this.getDatetimeValue(),
source:res.source?res.source:'苏州革命博物馆',
summary: res?.summary,
head_picture: res?.head_picture,
content:res?.content
}
res.head_picture?this.headPictureList.push(res.head_picture):''
},
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.picture = ''
}
if (this.type === 'add') {
store({
...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.source = '苏州革命博物馆'
this.form.release_time = 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,107 @@
<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="getAchievement"></Button>
<Button icon="ios-add" type="primary" style="margin-left: 10px;" @click="$refs['addAchievement'].isShow = true,$refs['addAchievement'].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="editorActivity(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>
<addAchievement ref="addAchievement" @refresh="getAchievement"></addAchievement>
</div>
</template>
<script>
import {index,destroy} from "@/api/achievement"
import addAchievement from '@/views/achievement/component/addAchievement'
import { Message } from 'element-ui'
export default {
components:{
addAchievement
},
data() {
return {
select:{
pageSize:10,
pageIndex:1,
name:""
},
total:0,
list:[],
table:[
{
label:"名称",
prop:'name',
align:'left',
}
]
}
},
mounted() {
this.getAchievement()
},
methods: {
async getAchievement(){
const res = await index({
page_size:this.select.pageSize,
page:this.select.pageIndex,
name:this.select.name
})
this.list = res.data
this.total = res.total
},
pageChange(e){
this.select.pageIndex = e
this.getAchievement()
},
deleteActivity(row){
destroy({id:row.id}).then(res => {
Message({
type:'success',
message:'删除成果成功'
})
this.getAchievement()
})
},
editorActivity(id,type){
this.$refs['addAchievement'].id = id
this.$refs['addAchievement'].type = type
this.$refs['addAchievement'].isShow = true
},
}
}
</script>
<style scoped lang="scss">
</style>

@ -11,6 +11,28 @@
<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:hall_id>
<div class="xy-table-item">
@ -89,30 +111,30 @@
<template v-slot:sponsor>
<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>承办单位
</div>
<div class="xy-table-item-content">
<el-input v-model="form.sponsor" placeholder="请输入主办方" clearable style="width: 300px;"></el-input>
<el-input v-model="form.sponsor" placeholder="请输入承办单位" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:guidance_unit>
<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>指导单位
</div>
<div class="xy-table-item-content">
<el-input v-model="form.guidance_unit" placeholder="请输入指导" clearable style="width: 300px;"></el-input>
<el-input v-model="form.guidance_unit" placeholder="请输入指导单位" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:bear_unit>
<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>协办单位
</div>
<div class="xy-table-item-content">
<el-input v-model="form.bear_unit" placeholder="请输入承接方" clearable style="width: 300px;"></el-input>
<el-input v-model="form.bear_unit" placeholder="请输入协办单位" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
@ -133,7 +155,7 @@
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>头图
</div>
<div class="xy-table-item-content">
<el-upload action="http://gb-test.ali251.langye.net/api/admin/upload-file" list-type="picture-card"
<el-upload :action="action" list-type="picture-card"
:file-list="heatPictureList" ref="pictureUpload" style="width:600px" :limit="1" :auto-upload="true"
:data="uploadOther"
:on-success="function(responsose,file,fileList) {return handlesuccess(responsose,file,fileList,'heat')}"
@ -150,7 +172,7 @@
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>引导图
</div>
<div class="xy-table-item-content">
<el-upload action="http://gb-test.ali251.langye.net/api/admin/upload-file" list-type="picture-card"
<el-upload :action="action"
:file-list="guidePictureList" ref="pictureUpload" :limit="1" :auto-upload="true" :data="uploadOther"
:on-success="function(responsose,file,fileList) {return handlesuccess(responsose,file,fileList,'guide')}"
:on-preview="handlePictureCardPreview"
@ -210,7 +232,9 @@
dialogVisible: false,
dialogImageUrl: '',
form: {
name: '',
name: '',
release_time:'',
source:'',
hall_id: '',
type: '',
state: 1,
@ -242,13 +266,22 @@
}],
uploadOther: {
token: ""
},
},
action:`${process.env.VUE_APP_BASE_API}/api/admin/upload-file`,
heatPictureList: [],
guidePictureList: [],
rules: {
name: [{
required: true,
message: '请输入展览名称'
}],
release_time: [{
required: true,
message: '请选择发布时间'
}],
source: [{
required: true,
message: '请输入来源'
}]
}
}
@ -270,7 +303,9 @@
id: this.id
})
this.form = {
name: res?.name,
name: res?.name,
release_time:res.release_time?res.release_time:this.getDatetimeValue(),
source:res.source?res.source:'苏州革命博物馆',
hall_id: res?.hall_id,
type: res?.type,
state: res?.state,
@ -340,6 +375,17 @@
this.$emit('refresh')
})
}
},
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;
},
handleRemove(file, fileList, type) {
if (type === 'heat') {
@ -365,6 +411,9 @@
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
}else{
this.form.source = '苏州革命博物馆'
this.form.release_time = this.getDatetimeValue()
}
} else {
this.id = ''

@ -65,9 +65,17 @@ export default {
},
{
label:"举办展厅",
prop:'hall_id',
prop:'hall.name',
align:'center',
},
{
label:"展览类型",
prop:'type',
align:'center',
formatter(value){
return value==1?'陈列展览':'临时展览'
}
},
{
label:"开始时间",
prop:'start_time',
@ -109,8 +117,8 @@ export default {
if(row.state===1){
return ( < div style = {
{
background:'orange',
padding:'5px 10px',
background:'#cf995a',
padding:'0px 10px',
borderRadius:'5px',
color:'#fff'
}
@ -136,7 +144,10 @@ export default {
const res = await index({
page_size:this.select.pageSize,
page:this.select.pageIndex,
title:this.select.name
title:this.select.name,
sort_name:'state',
sort_name_tow:'release_time',
sort_type:"DESC"
})
this.list = res.data
this.total = res.total

@ -70,7 +70,7 @@
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>头图
</div>
<div class="xy-table-item-content">
<el-upload action="http://gb-test.ali251.langye.net/api/admin/upload-file" list-type="picture-card" :file-list="heatPictureList" ref="pictureUpload"
<el-upload :action="action" :file-list="heatPictureList" ref="pictureUpload"
style="width:600px"
:limit="1" :auto-upload="true" :data="uploadOther"
:on-success="function(responsose,file,fileList) {return handlesuccess(responsose,file,fileList,'heat')}"
@ -87,7 +87,7 @@
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>引导图
</div>
<div class="xy-table-item-content">
<el-upload action="http://gb-test.ali251.langye.net/api/admin/upload-file" list-type="picture-card" :file-list="guidePictureList" ref="pictureUpload"
<el-upload :action="action" list-type="picture-card" :file-list="guidePictureList" ref="pictureUpload"
:limit="1" :auto-upload="true" :data="uploadOther"
:on-success="function(responsose,file,fileList) {return handlesuccess(responsose,file,fileList,'guide')}"
:on-preview="handlePictureCardPreview"
@ -157,6 +157,7 @@
uploadOther: {
token: ""
},
action:`${process.env.VUE_APP_BASE_API}/api/admin/upload-file`,
heatPictureList:[],
guidePictureList:[],
rules: {

@ -92,155 +92,11 @@
},
mobileList: [{
mobile: '18936139616'
},
{
mobile: '18936139616'
},
{
mobile: '13913553385'
},
{
mobile: '15606250566'
},
{
mobile: '18936139616'
},
{
mobile: '18936139616'
},
{
mobile: '18896803717'
},
{
mobile: '13862131217'
},
{
mobile: '13771928980'
},
{
mobile: '13806212507'
},
{
mobile: '18012744431'
},
{
mobile: '18012744431'
},
{
mobile: '18012744431'
},
{
mobile: '18051218702'
},
{
mobile: '15850056828'
},
{
mobile: '15850056828'
},
{
mobile: '13915557940'
},
{
mobile: '15995808679'
},
{
mobile: '18626109888'
},
{
mobile: '15250505058'
},
{
mobile: '15250505058'
},
{
mobile: '13776110523'
},
{
mobile: '13776110523'
},
{
mobile: '13776034799'
},
{
mobile: '15895464925'
},
{
mobile: '17715140912'
},
{
mobile: '17751654868'
},
{
mobile: '13913171771'
},
{
mobile: '13913171771'
},
{
mobile: '13913171771'
},
{
mobile: '13664165211'
},
{
mobile: '13915572008'
},
{
mobile: '13915572008'
},
{
mobile: '15895360418'
},
{
mobile: '13861794258'
},
{
mobile: '15006195598'
},
{
mobile: '13814889016'
},
{
mobile: '15995892928'
},
{
mobile: '13913516430'
},
{
mobile: '15370072868'
},
{
mobile: '18852675993'
},
{
mobile: '18251371032'
},
{
mobile: '15962454958'
},
{
mobile: '13915422122'
},
{
mobile: '18896716581'
},
{
mobile: '15962180796'
},
{
mobile: '13913056555'
},
{
mobile: '13906222159'
},
{
mobile: '18915580967'
}
],
paramesObj: {
name: "乐益大讲堂”第二讲《中国载人航天》",
time: "5月2日(本周二)14:00-16:00",
name: "",
time: "",
address: "苏州革命博物馆预约系统"
},
rules: {
@ -302,4 +158,4 @@
</script>
<style>
</style>
</style>

@ -11,6 +11,28 @@
<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>
<div class="xy-table-item">
@ -50,7 +72,7 @@
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>头图
</div>
<div class="xy-table-item-content">
<el-upload action="http://gb-test.ali251.langye.net/api/admin/upload-file" list-type="picture-card" :file-list="heatPictureList" ref="pictureUpload"
<el-upload :action="action"
style="width:600px"
:limit="1" :auto-upload="true" :data="uploadOther"
:on-success="handlesuccess"
@ -107,7 +129,9 @@
dialogVisible:false,
dialogImageUrl:'',
form: {
name: '',
name: '',
release_time:'',
source:'',
history_time: '',
contain: '',
grade: '',
@ -117,11 +141,20 @@
uploadOther: {
token: ""
},
action:`${process.env.VUE_APP_BASE_API}/api/admin/upload-file`,
heatPictureList:[],
rules: {
name: [{
required: true,
message: '请输入文物名称'
}],
release_time: [{
required: true,
message: '请选择发布时间'
}],
source: [{
required: true,
message: '请输入来源'
}]
}
}
@ -129,13 +162,26 @@
created() {
this.uploadOther.token = getToken();
},
methods: {
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,
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,
@ -199,6 +245,9 @@
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
}else{
this.form.source = '苏州革命博物馆'
this.form.release_time = this.getDatetimeValue()
}
} else {
this.id = ''

@ -3,7 +3,7 @@
<!-- 查询配置 -->
<div style="padding: 0px 20px">
<div ref="lxHeader">
<LxHeader icon="md-apps" text="支部旧址详情" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<LxHeader icon="md-apps" text="博物馆详情" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content"></div>
</LxHeader>
</div>

@ -0,0 +1,257 @@
<template>
<div>
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增VR' : '编辑VR'" :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:link>
<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.link" placeholder="请输入链接地址" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot: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" list-type="picture-card" :file-list="pictureList" ref="pictureUpload"
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:summary>
<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 type='textarea' v-model="form.summary" placeholder="请输入概要" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
</xy-dialog>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="">
</el-dialog>
</div>
</template>
<script>
import {
store,
show,
save
} from "@/api/vr"
import {
Message
} from 'element-ui'
import {
getToken
} from '@/utils/auth'
export default {
data() {
return {
isShow: false,
type: 'add',
id: '',
dialogVisible:false,
dialogImageUrl:'',
form: {
name: '',
link: '',
picture: '',
summary: ''
},
uploadOther: {
token: ""
},
action:`${process.env.VUE_APP_BASE_API}/api/admin/upload-file`,
pictureList:[],
rules: {
name: [{
required: true,
message: '请输入VR名称'
}]
}
}
},
created() {
this.uploadOther.token = getToken();
},
methods: {
async getDetail() {
const res = await show({
id: this.id
})
this.form = {
name: res?.name,
link:res?.link,
picture: res?.picture,
summary: res?.summary,
}
res.picture?this.pictureList.push(res.picture):''
},
submit() {
if(this.pictureList.length>0){
for(var h of this.pictureList){
if(h.response){
this.form.picture = h.response.id
}else{
this.form.picture = h.id
}
}
}else{
this.form.picture = ''
}
if (this.type === 'add') {
store({
...this.form
}).then(res => {
Message({
type: 'success',
message: '新增VR成功'
})
this.isShow = false
this.$emit('refresh')
})
return
}
if (this.type === 'editor') {
save({
id: this.id,
...this.form
}).then(res => {
Message({
type: 'success',
message: '编辑VR成功'
})
this.isShow = false
this.$emit('refresh')
})
}
},
handleRemove(file,fileList) {
this.pictureList = fileList
},
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
handlesuccess(response, file, fileList) {
this.pictureList = fileList
},
},
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
}
} else {
this.id = ''
this.type = ''
this.pictureList = []
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,112 @@
<template>
<div style="padding: 0 20px">
<div ref="lxHeader">
<lx-header icon="md-apps" text="VR管理" 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="getVr"></Button>
<Button icon="ios-add" type="primary" style="margin-left: 10px;" @click="$refs['addVr'].isShow = true,$refs['addVr'].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="editorActivity(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>
<addVr ref="addVr" @refresh="getVr"></addVr>
</div>
</template>
<script>
import {index,destroy} from "@/api/vr"
import addVr from '@/views/vr/component/addVr'
import { Message } from 'element-ui'
export default {
components:{
addVr
},
data() {
return {
select:{
pageSize:10,
pageIndex:1,
name:""
},
total:0,
list:[],
table:[
{
label:"名称",
prop:'name',
align:'left',
},
{
label:"链接地址",
prop:'link',
align:'left',
}
]
}
},
mounted() {
this.getVr()
},
methods: {
async getVr(){
const res = await index({
page_size:this.select.pageSize,
page:this.select.pageIndex,
name:this.select.name
})
this.list = res.data
this.total = res.total
},
pageChange(e){
this.select.pageIndex = e
this.getVr()
},
deleteActivity(row){
destroy({id:row.id}).then(res => {
Message({
type:'success',
message:'删除vr成功'
})
this.getVr()
})
},
editorActivity(id,type){
this.$refs['addVr'].id = id
this.$refs['addVr'].type = type
this.$refs['addVr'].isShow = true
},
}
}
</script>
<style scoped lang="scss">
</style>
Loading…
Cancel
Save