Compare commits

...

10 Commits

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

@ -4,4 +4,4 @@ ENV = 'production'
# base api # 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://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,42 @@
import request from '@/utils/request'
export function index(params) {
return request({
url: '/api/admin/cultural-relic2/index',
method: 'get',
params: params
})
}
export function store(data) {
return request({
url: '/api/admin/cultural-relic2/store',
method: 'post',
data
})
}
export function save(data) {
return request({
url: '/api/admin/cultural-relic2/save',
method: 'post',
data
})
}
export function show(params) {
return request({
url: '/api/admin/cultural-relic2/show',
method: 'get',
params
})
}
export function destroy(params) {
return request({
url: '/api/admin/cultural-relic2/destroy',
method: 'get',
params
})
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

@ -31,7 +31,6 @@ import LxHeader from "@/components/LxHeader/index"
Vue.component('lx-header',LxHeader) Vue.component('lx-header',LxHeader)
import XyTable from "@/components/XyTable" import XyTable from "@/components/XyTable"
Vue.component('xy-table',XyTable) Vue.component('xy-table',XyTable)
Vue.component('xy-table',XyTable)
import XyDialog from "@/components/XyDialog" import XyDialog from "@/components/XyDialog"
Vue.component('xy-dialog',XyDialog) Vue.component('xy-dialog',XyDialog)
// import AvueMap from 'avue-plugin-map' // import AvueMap from 'avue-plugin-map'

@ -7,12 +7,19 @@ import store from '@/store'
import { import {
getToken getToken
} from '@/utils/auth' } from '@/utils/auth'
// create an axios instance
const service = axios.create({ let baseUrl = ''
baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url if(window.location.origin.indexOf('localhost')>-1){
// withCredentials: true, // send cookies when cross-domain requests baseUrl = process.env.VUE_APP_BASE_API
timeout: 50000 // request timeout }else{
baseUrl = window.location.origin + '/'
}
const service = axios.create({
baseURL: baseUrl, // url = base url + request url
// withCredentials: true, // send cookies when cross-domain requests
timeout: 50000, // request timeout
// isLoading:true
}) })
// request interceptor // request interceptor

@ -662,7 +662,7 @@
reject(error) reject(error)
}) })
} else { } else {
this.form.rules_list.splice(index, 1); this.form.numbers_list.splice(index, 1);
} }
}, },
// //
@ -819,11 +819,13 @@
that.$message.error('请选择活动场次时间'); that.$message.error('请选择活动场次时间');
return false; return false;
} }
let checktime = that.compareDate(k.start_time, k.end_plan);
if (!checktime) { // let checktime = that.compareDate(k.start_time, k.end_plan);
that.$message.error('截止时间不能晚于开始时间'); // if (!checktime) {
return false; // that.$message.error('');
} // return false;
// }
upTotal += parseInt(k.total) upTotal += parseInt(k.total)
} }
that.form.total = upTotal that.form.total = upTotal

@ -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>

@ -79,7 +79,7 @@
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>开始时间 <span style="color: red;font-weight: 600;padding-right: 4px;"></span>开始时间
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-date-picker style="width: 300px;" v-model="form.start_time" value-format="yyyy-MM-dd HH:mm:ss" <el-date-picker style="width: 300px;" default-time="09:00:00" v-model="form.start_time" value-format="yyyy-MM-dd HH:mm:ss"
type="datetime" placeholder="选择开始时间"> type="datetime" placeholder="选择开始时间">
</el-date-picker> </el-date-picker>
</div> </div>
@ -91,9 +91,11 @@
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>结束时间 <span style="color: red;font-weight: 600;padding-right: 4px;"></span>结束时间
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-date-picker style="width: 300px;" v-model="form.over_time" value-format="yyyy-MM-dd HH:mm:ss" <el-input v-model="form.over_time" placeholder="请输入结束时间" clearable style="width: 300px;"></el-input>
<!-- <el-date-picker style="width: 300px;" default-time="16:00:00" v-model="form.over_time" value-format="yyyy-MM-dd HH:mm:ss"
type="datetime" placeholder="选择日期时间"> type="datetime" placeholder="选择日期时间">
</el-date-picker> </el-date-picker> -->
</div> </div>
</div> </div>
</template> </template>
@ -107,7 +109,16 @@
</div> </div>
</div> </div>
</template> </template>
<template v-slot:organizer>
<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.organizer" placeholder="请输入主办单位" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:sponsor> <template v-slot:sponsor>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <div class="xy-table-item-label">
@ -172,7 +183,8 @@
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>引导图 <span style="color: red;font-weight: 600;padding-right: 4px;"></span>引导图
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-upload :action="action" <el-upload :action="action"
list-type="picture-card"
:file-list="guidePictureList" ref="pictureUpload" :limit="1" :auto-upload="true" :data="uploadOther" :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-success="function(responsose,file,fileList) {return handlesuccess(responsose,file,fileList,'guide')}"
:on-preview="handlePictureCardPreview" :on-preview="handlePictureCardPreview"
@ -240,7 +252,8 @@
state: 1, state: 1,
start_time: '', start_time: '',
over_time: '', over_time: '',
member_sum: '', member_sum: '',
organizer:'',
sponsor: '', sponsor: '',
guidance_unit: '', guidance_unit: '',
bear_unit: '', bear_unit: '',
@ -311,7 +324,8 @@
state: res?.state, state: res?.state,
start_time: res?.start_time, start_time: res?.start_time,
over_time: res?.over_time, over_time: res?.over_time,
member_sum: res?.member_sum, member_sum: res?.member_sum,
organizer:res?.organizer,
sponsor: res?.sponsor, sponsor: res?.sponsor,
guidance_unit: res?.guidance_unit, guidance_unit: res?.guidance_unit,
bear_unit: res?.bear_unit, bear_unit: res?.bear_unit,
@ -340,10 +354,10 @@
} }
if (this.guidePictureList.length > 0) { if (this.guidePictureList.length > 0) {
for (var g of this.guidePictureList) { for (var g of this.guidePictureList) {
if (h.response) { if (g.response) {
this.form.guide_picture = h.response.id this.form.guide_picture = g.response.id
} else { } else {
this.form.guide_picture = h.id this.form.guide_picture = g.id
} }
} }
} else { } else {

@ -62,35 +62,18 @@ export default {
label:"展览名称", label:"展览名称",
prop:'name', prop:'name',
align:'left', align:'left',
}, width:240,
{ fixed:'left'
label:"举办展厅",
prop:'hall.name',
align:'center',
}, },
{ {
label:"展览类型", label:"展览类型",
prop:'type', prop:'type',
align:'center', align:'center',
width:120,
formatter(value){ formatter(value){
return value==1?'陈列展览':'临时展览' return value==1?'陈列展览':'临时展览'
} }
}, },
{
label:"开始时间",
prop:'start_time',
align:'center',
},
{
label:"结束时间",
prop:'over_time',
align:'center',
},
{
label:"容纳人数",
prop:'member_sum',
align:'center',
},
{ {
label:"展览状态", label:"展览状态",
prop:'state', prop:'state',
@ -113,7 +96,7 @@ export default {
// }> // }>
// </el-switch> // </el-switch>
// ) // )
if(row.state===1){ if(row.state===1){
return ( < div style = { return ( < div style = {
{ {
@ -133,9 +116,39 @@ export default {
} }
} >已结束</div > ) } >已结束</div > )
} }
} }
}, },
{
label:"开始时间",
prop:'start_time',
align:'center',
width:180,
},
{
label:"结束时间",
prop:'over_time',
align:'center',
width:180,
},
{
label:"举办展厅",
prop:'hall.name',
align:'center',
width:120,
},
{
label:"容纳人数",
prop:'member_sum',
align:'center',
width:100,
},
{
label:"发布时间",
prop:'release_time',
align:'center',
width:180,
},
] ]
} }
}, },
@ -144,10 +157,11 @@ export default {
const res = await index({ const res = await index({
page_size:this.select.pageSize, page_size:this.select.pageSize,
page:this.select.pageIndex, page:this.select.pageIndex,
title:this.select.name, name:this.select.name,
sort_name:'state', sort_name:'state',
sort_name_tow:'release_time', sort_name_tow:'release_time',
sort_type:"DESC" sort_type:"DESC",
sort_type_tow:'DESC'
}) })
this.list = res.data this.list = res.data
this.total = res.total this.total = res.total

@ -35,7 +35,7 @@
store, store,
show, show,
save save
} from "@/api/relic" } from "@/api/guide"
import { import {
Message Message
} from 'element-ui' } from 'element-ui'

@ -70,7 +70,7 @@
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>头图 <span style="color: red;font-weight: 600;padding-right: 4px;"></span>头图
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-upload :action="action" :file-list="heatPictureList" ref="pictureUpload" <el-upload :action="action" list-type="picture-card" :file-list="heatPictureList" ref="pictureUpload"
style="width:600px" style="width:600px"
:limit="1" :auto-upload="true" :data="uploadOther" :limit="1" :auto-upload="true" :data="uploadOther"
:on-success="function(responsose,file,fileList) {return handlesuccess(responsose,file,fileList,'heat')}" :on-success="function(responsose,file,fileList) {return handlesuccess(responsose,file,fileList,'heat')}"

@ -1,44 +1,46 @@
<template> <template>
<div class="login-container"> <div class="login-container">
<img src="../../assets/imgs/bg_bottom.png" class="bg_bottom" /> <img src="../../assets/bg.png" alt="" class='bg_left'>
<!-- <img src="../../assets/imgs/bg_bottom.png" class="bg_bottom" />
<img src="../../assets/imgs/bg_left.png" class="bg_left" /> <img src="../../assets/imgs/bg_left.png" class="bg_left" />
<img src="../../assets/imgs/footer_logo.png" class="footer_logo" /> <img src="../../assets/imgs/footer_logo.png" class="footer_logo" />:style="{marginTop:marginTop+'px'}" -->
<div class="formBox" ref="formBox"> <div class="formBox" ref="formBox">
<el-form ref="loginForm" :model="loginForm" :style="{marginTop:marginTop+'px'}" :rules="loginRules" <el-form ref="loginForm" :model="loginForm" :rules="loginRules"
class="login-form" auto-complete="on" label-position="left"> class="login-form" auto-complete="on" label-position="left">
<div class="title-container"> <!-- <div class="title-container">
<h3 class="title">预约管理系统</h3> <h3 class="title">预约管理系统</h3>
</div> </div> -->
<img src="../../assets/imgs/bg_box.png" width="100%" /> <!-- <img src="../../assets/imgs/bg_box.png" width="100%" /> -->
<div class="box_middle"> <div class="box_middle">
<el-form-item prop="username"> <img src="../../assets/loginlogo.png" alt="" class='loginlogo'>
<span class="svg-container"> <el-form-item prop="username" class='username'>
<!-- <span class="svg-container">
<svg-icon icon-class="user" /> <svg-icon icon-class="user" />
</span> </span> -->
<el-input ref="username" v-model="loginForm.username" placeholder="请输入登录名" name="username" type="text" <el-input ref="username" v-model="loginForm.username" placeholder="" name="username" type="text"
tabindex="1" auto-complete="off" /> tabindex="1" auto-complete="off" />
</el-form-item> </el-form-item>
<el-form-item prop="password"> <el-form-item prop="password" class='password'>
<span class="svg-container"> <!-- <span class="svg-container">
<svg-icon icon-class="password" /> <svg-icon icon-class="password" />
</span> </span> -->
<el-input :key="passwordType" ref="password" v-model="loginForm.password" :type="passwordType" <el-input :key="passwordType" show-password ref="password" v-model="loginForm.password" :type="passwordType"
placeholder="请输入密码" name="password" tabindex="2" auto-complete="off" @keyup.enter.native="handleLogin" /> placeholder="" name="password" tabindex="2" auto-complete="off" @keyup.enter.native="handleLogin" />
</el-form-item> </el-form-item>
<el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;" <el-button :loading="loading" type="primary" style="width:50%;margin-bottom:30px;"
@click.native.prevent="handleLogin">登录</el-button> @click.native.prevent="handleLogin">登录</el-button>
</div> </div>
<img src="../../assets/imgs/bg_box_bottom.png" width="100%" /> <!-- <img src="../../assets/imgs/bg_box_bottom.png" width="100%" /> -->
</el-form> </el-form>
</div> </div>
<div class="footer"> <!-- <div class="footer">
2023 © 苏州革命博物馆 2023 © 苏州革命博物馆
</div> </div> -->
</div> </div>
</template> </template>
@ -66,6 +68,7 @@
} }
return { return {
windowHeight: document.documentElement.clientHeight, // windowHeight: document.documentElement.clientHeight, //
windowWidth: document.documentElement.clientWidth,
loginForm: { loginForm: {
username: '', username: '',
password: '' password: ''
@ -99,6 +102,10 @@
windowHeight(val) { windowHeight(val) {
let that = this; let that = this;
console.log("实时屏幕高度:", val, that.windowHeight); console.log("实时屏幕高度:", val, that.windowHeight);
},
windowWidth(val) {
let that = this;
console.log("实时屏幕宽度:", val, that.windowHeight);
} }
}, },
@ -113,12 +120,20 @@
var that = this; var that = this;
let height = this.$refs.formBox.offsetHeight; //100 let height = this.$refs.formBox.offsetHeight; //100
that.formHeight = height; that.formHeight = height;
that.marginTop = (that.windowHeight - height * 1.5) / 2; that.marginTop = (that.windowHeight - height * 1.5) / 3;
window.fullHeight = document.documentElement.clientHeight;
that.windowHeight = window.fullHeight; //
window.fullWidth = document.documentElement.clientWidth;
that.windowWidth = window.fullWidth; //
console.log(that.windowWidth, that.windowHeight)
// <!--window.onresizemounted--> // <!--window.onresizemounted-->
window.onresize = () => { window.onresize = () => {
return (() => { return (() => {
window.fullHeight = document.documentElement.clientHeight; window.fullHeight = document.documentElement.clientHeight;
that.windowHeight = window.fullHeight; // that.windowHeight = window.fullHeight; //
window.fullWidth = document.documentElement.clientWidth;
that.windowWidth = window.fullWidth; //
console.log(that.windowWidth, that.windowHeight)
})() })()
}; };
}, },
@ -161,9 +176,9 @@
/* 修复input 背景不协调 和光标变色 */ /* 修复input 背景不协调 和光标变色 */
/* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */ /* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */
$bg:#ffffff; $bg: #ffffff;
$light_gray:#55320f; $light_gray: #cf995a;
$cursor: #55320f; $cursor: #cf995a;
@supports (-webkit-mask: none) and (not (cater-color: $cursor)) { @supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
.login-container .el-input input { .login-container .el-input input {
@ -186,10 +201,11 @@
} }
.box_middle { .box_middle {
background: url("../../assets/imgs/bg_box_line.png") repeat-y; // background: url("../../assets/imgs/bg_box_line.png") repeat-y;
background-size: 100% 100%; // background-size: 100% 100%;
padding: 20px 60px; padding: 20px 30px;
margin-top: -10px; margin-top: -10px;
text-align: center;
} }
@ -221,18 +237,18 @@
} }
.el-form-item { .el-form-item {
border: 1px solid rgba(255, 255, 255, 0.1); // border: 1px solid rgba(255, 255, 255, 0.1);
background: rgba(0, 0, 0, 0.1); // background: rgba(0, 0, 0, 0.1);
border-radius: 5px; // border-radius: 5px;
color: #454545; color: #454545;
} }
} }
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
$bg:#f9efe5; $bg: #fff;
$dark_gray:#55320f; $dark_gray: #55320f;
$light_gray:#55320f; $light_gray: #55320f;
.bg_bottom { .bg_bottom {
position: absolute; position: absolute;
@ -244,7 +260,40 @@
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
height: 90%; height: 100%;
width: 70%
}
.loginlogo {
width: 100%;
max-width: 288px;
margin-bottom: 70px;
}
.formBox {
position: absolute;
top: 50%;
right: 0;
width: 30%;
transform: translate(0%, -50%);
}
.username {
width: 100%;
max-width: 300px;
background-image: url(../../assets/username.png);
background-size: 100% 100%;
display: inline-block;
margin-bottom: 40px;
}
.password {
width: 100%;
max-width: 300px;
background-image: url(../../assets/password.png);
background-size: 100% 100%;
display: inline-block;
margin-bottom: 60px;
} }
.login-container { .login-container {
@ -261,6 +310,10 @@
padding: 20px 35px 0; padding: 20px 35px 0;
margin: 0 auto; margin: 0 auto;
overflow: hidden; overflow: hidden;
.el-input {
line-height: 53px;
}
} }
.tips { .tips {

@ -261,20 +261,20 @@
window.open("https://" + url, '_blank') window.open("https://" + url, '_blank')
that.searchFields.is_export = 0 that.searchFields.is_export = 0
return; return;
}else{
that.tableData = res.data
that.paginations.total = res.total
for (var m of res.data) {
let startT = m.activity_order.activity.start_time?m.activity_order.activity.start_time:''
let endT = m.activity_order.activity.end_time?m.activity_order.activity.end_time:''
m.date = startT + "至" + this.$moment(endT).format("HH:mm:ss")
m.activity_name = m.activity_order.activity.name?m.activity_order.activity.name:''
m.typeName = m.activity_order.type == 1 ? "团体" : "个人"
m.unit = m.activity_order.type == 1 ? m.activity_order.unit : "无"
m.leader = m.activity_order.type == 1 ? m.activity_order.leader : "无"
}
} }
let _data = [];
// let result = Object.assign(_data, res.data);
for (var m of res.data) {
m.date = m.activity_order.activity.start_time + "至" + this.$moment(m.activity_order.activity
.end_time).format("HH:mm:ss");
m.activity_name = m.activity_order.activity.name;
m.typeName = m.activity_order.type == 1 ? "团体" : "个人"
m.unit = m.activity_order.type == 1 ? m.activity_order.unit : "无"
m.leader = m.activity_order.type == 1 ? m.activity_order.leader : "无"
_data.push(m);
}
that.tableData = _data;
that.paginations.total = res.total
}).catch(error => { }).catch(error => {
}) })

@ -43,8 +43,8 @@
<Button ghost size="small" @click="show(scope.row)" type="primary" <Button ghost size="small" @click="show(scope.row)" type="primary"
style="margin-left: 10px;">查看</Button> style="margin-left: 10px;">查看</Button>
<Button v-if="scope.row['orderno']==null" ghost size="small" @click="appointmentOrder(scope.row)" type="info" <!-- <Button v-if="scope.row['orderno']==null" ghost size="small" @click="appointmentOrder(scope.row)" type="info"
style="margin-left: 10px;">第三方下单</Button> style="margin-left: 10px;">第三方下单</Button> -->
</div> </div>
<div v-else-if="column.type=='type'"> <div v-else-if="column.type=='type'">
<div v-if="scope.row[column.field]==1"></div> <div v-if="scope.row[column.field]==1"></div>

@ -56,11 +56,11 @@
</div> </div>
<el-tag v-if="scope.row[column.field]==1" type="success"></el-tag> <el-tag v-if="scope.row[column.field]==1" type="success"></el-tag>
</div> </div>
<div v-else-if="column.type=='type'" v-for="item in parameters.visitType"> <!-- <div v-else-if="column.type=='type'" v-for="item in parameters.visitType">
<div v-if="item.id==scope.row[column.field]"> <div v-if="item.id==scope.row[column.field]">
{{item.value}} {{item.value}}
</div> </div>
</div> </div> -->
<div v-else-if="column.type=='status'" v-for="item in parameters.status_list"> <div v-else-if="column.type=='status'" v-for="item in parameters.status_list">
<div v-if="item.id==scope.row[column.field]"> <div v-if="item.id==scope.row[column.field]">
<el-tag v-if="scope.row[column.field]==1" type="warning">{{item.value}}</el-tag> <el-tag v-if="scope.row[column.field]==1" type="warning">{{item.value}}</el-tag>
@ -89,13 +89,16 @@
{{form.date+" "+form.time}} {{form.date+" "+form.time}}
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="类型" prop="type"> <el-form-item label="类型" prop="type">
<el-tag v-if="form.type==1" type="" effect="dark"> <el-tag type="" effect="dark">
{{form.type_name}}
</el-tag>
<!-- <el-tag v-if="form.type==1" type="" effect="dark">
团体 团体
</el-tag> </el-tag>
<el-tag v-if="form.type==2" type="" effect="dark"> <el-tag v-if="form.type==2" type="" effect="dark">
个人 个人
</el-tag> </el-tag> -->
</el-form-item> </el-form-item>
<el-form-item label="联系方式" prop="mobile"> <el-form-item label="联系方式" prop="mobile">
<div> <div>
@ -302,9 +305,9 @@
align: "center" align: "center"
}, },
{ {
field: "type", field: "type_name",
title: "类型", title: "类型",
type: "type", type: "string",
align: "center" align: "center"
}, },
{ {
@ -369,7 +372,6 @@
let tokens = getToken(); let tokens = getToken();
if (isExcel) { if (isExcel) {
var url = "/api/admin/visit/order-index?token=" + tokens var url = "/api/admin/visit/order-index?token=" + tokens
console.log(url)
for (var m in that.searchFields) { for (var m in that.searchFields) {
url += "&" + m + "=" + that.searchFields[m] url += "&" + m + "=" + that.searchFields[m]
} }
@ -377,6 +379,15 @@
window.open("https://" + url, '_blank') window.open("https://" + url, '_blank')
that.searchFields.is_export = 0 that.searchFields.is_export = 0
return; return;
}
for(var k of res.data){
let typeName = ''
let isFast = ''
if(k.user_id==0){
isFast = '快速入场-'
}
typeName = k.type==1?'团队':'个人'
k.type_name = isFast + typeName
} }
this.tableData = res.data; this.tableData = res.data;
this.paginations.total = res.total this.paginations.total = res.total
@ -396,7 +407,14 @@
info(obj) { info(obj) {
var that = this; var that = this;
get(obj.id).then(res => { get(obj.id).then(res => {
let result = Object.assign(that.form, res); let result = Object.assign(that.form, res);
let typeName = ''
let isFast = ''
if(result.user_id==0){
isFast = '快速入场-'
}
typeName = result.type==1?'团队':'个人'
result.type_name = isFast + typeName
that.form = result; that.form = result;
that.form.details_list = result.details; that.form.details_list = result.details;
}).catch(error => { }).catch(error => {

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

@ -62,22 +62,40 @@ export default {
label:"名称", label:"名称",
prop:'name', prop:'name',
align:'left', align:'left',
// width:240,
fixed:'left'
}, },
{ {
label:"文物年限", label:"列表显示",
prop:'history_time', prop:'show_list',
align:'center', align:'center',
width:100,
}, },
// {
// label:"",
// prop:'grade',
// align:'center',
// width:100,
// },
// {
// label:"",
// prop:'contain',
// align:'center',
// width:240,
// },
// {
// label:"",
// prop:'history_time',
// align:'center',
// width:120,
// },
{ {
label:"文物等级", label:"发布时间",
prop:'grade', prop:'release_time',
align:'center', align:'center',
width:180,
}, },
{
label:"文物组成",
prop:'contain',
align:'center',
}
] ]
} }
}, },
@ -89,7 +107,9 @@ export default {
const res = await index({ const res = await index({
page_size:this.select.pageSize, page_size:this.select.pageSize,
page:this.select.pageIndex, page:this.select.pageIndex,
name:this.select.name name:this.select.name,
sort_name:'release_time',
sort_type:"DESC",
}) })
this.list = res.data this.list = res.data
this.total = res.total this.total = res.total

@ -0,0 +1,608 @@
<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: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>文物年限
</div>
<div class="xy-table-item-content">
<el-date-picker style="width: 300px;" v-model="form.history_time" value-format="yyyy" type="year"
placeholder="选择文物年限">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:contain>
<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.contain" placeholder="请输入文物组成" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:grade>
<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.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>fbx文件
</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:jpg2_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>jpg文件2
</div>
<div class="xy-table-item-content">
<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: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="">
</el-dialog>
</div>
</template>
<script>
import xyTinymce from "@/components/XyTinymce/index.vue";
import {
store,
show,
save,
index
} from "@/api/relic2"
import {
Message
} from 'element-ui'
import {
getToken
} from '@/utils/auth'
export default {
components: {
xyTinymce
},
data() {
return {
isShow: false,
type: 'add',
id: '',
dialogVisible: false,
dialogImageUrl: '',
relicList: [],
form: {
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: '',
},
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: '请输入来源'
}]
}
}
},
created() {
this.uploadOther.token = getToken();
this.getRelic()
},
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 : '苏州革命博物馆',
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.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.jpg2_id = ''
}
console.log(this.form)
// return
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
},
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: {
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.voiceList = []
this.threedList = []
this.fbxList = []
this.jpgList = []
this.jpg2List = []
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,142 @@
<template>
<div style="padding: 0 20px">
<div ref="lxHeader">
<lx-header icon="md-apps" text="文物馆藏2" 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="getRelic"></Button>
<Button icon="ios-add" type="primary" style="margin-left: 10px;" @click="$refs['addRelic'].isShow = true,$refs['addRelic'].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>
<addRelic ref="addRelic" @refresh="getRelic"></addRelic>
</div>
</template>
<script>
import {index,destroy} from "@/api/relic2"
import addRelic from '@/views/relic2/component/addRelic'
import { Message } from 'element-ui'
export default {
components:{
addRelic
},
data() {
return {
select:{
pageSize:10,
pageIndex:1,
name:""
},
total:0,
list:[],
table:[
{
label:"名称",
prop:'name',
align:'left',
// width:240,
fixed:'left'
},
{
label:"列表显示",
prop:'show_list',
align:'center',
width:100,
},
// {
// 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',
align:'center',
width:180,
},
]
}
},
mounted() {
this.getRelic()
},
methods: {
async getRelic(){
const res = await index({
page_size:this.select.pageSize,
page:this.select.pageIndex,
name:this.select.name,
sort_name:'release_time',
sort_type:"DESC",
})
this.list = res.data
this.total = res.total
},
pageChange(e){
this.select.pageIndex = e
this.getRelic()
},
deleteActivity(row){
destroy({id:row.id}).then(res => {
Message({
type:'success',
message:'删除文物成功'
})
this.getRelic()
})
},
editorActivity(id,type){
this.$refs['addRelic'].id = id
this.$refs['addRelic'].type = type
this.$refs['addRelic'].isShow = true
},
}
}
</script>
<style scoped lang="scss">
</style>

@ -7,14 +7,14 @@
<div slot="content"></div> <div slot="content"></div>
<slot> <slot>
<div> <div>
<el-date-picker <!-- <el-date-picker
v-model="searchFields.year" v-model="searchFields.year"
type="year" type="year"
value-format="yyyy" value-format="yyyy"
placeholder="选择年份"> placeholder="选择年份">
</el-date-picker> </el-date-picker>
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button> <Button type="primary" @click="load" style="margin-left: 10px">查询</Button> -->
<Button type="primary" @click="viewPart" style="margin-left: 10px">{{btnText}}</Button> <Button type="primary" @click="viewPart" style="margin-left: 10px">{{btnText}}</Button>
<Button type="primary" style="margin-left: 10px" @click="handleGo"></Button> <Button type="primary" style="margin-left: 10px" @click="handleGo"></Button>
</div> </div>

@ -10,6 +10,8 @@
<el-date-picker <el-date-picker
v-model="daterange" v-model="daterange"
type="daterange" type="daterange"
value-format="yyyy-MM-dd"
@change='dateChange'
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期"> end-placeholder="结束日期">
@ -66,10 +68,10 @@
}, },
mounted() {}, mounted() {},
data() { data() {
return { return {
daterange:"",
showData: false, showData: false,
searchFields: {}, daterange:[],
select: {},
tableData: [], tableData: [],
tableHeight: 0, tableHeight: 0,
btnText:"数据展示", btnText:"数据展示",
@ -109,11 +111,23 @@
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20; let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
that.tableHeight = tableHeight; that.tableHeight = tableHeight;
that.chartHeight = that.tableHeight + "px" that.chartHeight = that.tableHeight + "px"
},
dateChange(e){
if(e){
this.select.start_date = e[0]
this.select.end_date = e[1]
}else{
this.select.start_date = ''
this.select.end_date = ''
}
}, },
load() { load() {
// this.showData = true; // this.showData = true;
var arr = []; var arr = [];
ageRpt().then((res) => { ageRpt({
start_date:this.select.start_date,
end_date:this.select.end_date
}).then((res) => {
for (var m of res) { for (var m of res) {
m.per = ((m.use_total / (m.plan_total == 0 ? 1 : m.plan_total)) * 100).toFixed(2) + "%" m.per = ((m.use_total / (m.plan_total == 0 ? 1 : m.plan_total)) * 100).toFixed(2) + "%"

@ -10,6 +10,8 @@
<el-date-picker <el-date-picker
v-model="daterange" v-model="daterange"
type="daterange" type="daterange"
value-format="yyyy-MM-dd"
@change='dateChange'
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期"> end-placeholder="结束日期">
@ -18,7 +20,7 @@
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button> <Button type="primary" @click="load" style="margin-left: 10px">查询</Button>
<Button type="primary" @click="viewPart" style="margin-left: 10px">{{btnText}}</Button> <Button type="primary" @click="viewPart" style="margin-left: 10px">{{btnText}}</Button>
<Button type="primary" style="margin-left: 10px" @click="handleGo"></Button> <Button type="primary" style="margin-left: 10px" @click="handleGo"></Button>
</div> </div>
</slot> </slot>
</LxHeader> </LxHeader>
@ -68,8 +70,8 @@
data() { data() {
return { return {
showData: false, showData: false,
daterange:"", daterange:[],
searchFields: {}, select: {},
tableData: [], tableData: [],
tableHeight: 0, tableHeight: 0,
chartHeight:"", chartHeight:"",
@ -112,13 +114,25 @@
that.tableHeight = tableHeight; that.tableHeight = tableHeight;
that.chartHeight = tableHeight+"px" that.chartHeight = tableHeight+"px"
},
dateChange(e){
if(e){
this.select.start_date = e[0]
this.select.end_date = e[1]
}else{
this.select.start_date = ''
this.select.end_date = ''
}
}, },
load() { load() {
// this.showData = true; // this.showData = true;
var xarr = []; var xarr = [];
var planarr=[]; var planarr=[];
var usearr=[]; var usearr=[];
visitdetailRpt().then((res) => { visitdetailRpt({
start_date:this.select.start_date,
end_date:this.select.end_date
}).then((res) => {
for (var m of res) { for (var m of res) {
m.per = ((m.use_total / (m.plan_total == 0 ? 1 : m.plan_total)) * 100).toFixed(2) + "%" m.per = ((m.use_total / (m.plan_total == 0 ? 1 : m.plan_total)) * 100).toFixed(2) + "%"
xarr.push(m.date); xarr.push(m.date);

@ -7,14 +7,14 @@
<div slot="content"></div> <div slot="content"></div>
<slot> <slot>
<div> <div>
<el-date-picker <!-- <el-date-picker
v-model="searchFields.year" v-model="searchFields.year"
type="year" type="year"
value-format="yyyy" value-format="yyyy"
placeholder="选择年份"> placeholder="选择年份">
</el-date-picker> </el-date-picker>
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button> <Button type="primary" @click="load" style="margin-left: 10px">查询</Button> -->
<Button type="primary" @click="viewPart" style="margin-left: 10px">{{btnText}}</Button> <Button type="primary" @click="viewPart" style="margin-left: 10px">{{btnText}}</Button>
<Button type="primary" style="margin-left: 10px" @click="handleGo"></Button> <Button type="primary" style="margin-left: 10px" @click="handleGo"></Button>

@ -8,7 +8,7 @@
<slot> <slot>
<div> <div>
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button> <!-- <Button type="primary" @click="load" style="margin-left: 10px">查询</Button> -->
<Button type="primary" @click="viewPart" style="margin-left: 10px">{{btnText}}</Button> <Button type="primary" @click="viewPart" style="margin-left: 10px">{{btnText}}</Button>
<Button type="primary" style="margin-left: 10px" @click="handleGo"></Button> <Button type="primary" style="margin-left: 10px" @click="handleGo"></Button>

@ -225,9 +225,9 @@
}, },
resetForm(formName) { resetForm(formName) {
var that = this; var that = this;
this.$refs.tiny.setContent(""); // this.$refs.tiny.setContent("");
this.$refs.tiny1.setContent(""); // this.$refs.tiny1.setContent("");
this.$refs.tiny2.setContent(""); // this.$refs.tiny2.setContent("");
this.$refs[formName].resetFields(); this.$refs[formName].resetFields();
that.dialogFormVisible = false; that.dialogFormVisible = false;
}, },

@ -251,7 +251,8 @@
resetForm(formName) { resetForm(formName) {
var that = this; var that = this;
this.$refs[formName].resetFields(); this.$refs[formName].resetFields();
that.dialogFormVisible = false; that.dialogFormVisible = false;
that.dialogFormEditVisible = false
}, },
handleCurrentChange(page) { handleCurrentChange(page) {
this.paginations.page = page; this.paginations.page = page;

@ -7,8 +7,8 @@
<div slot="content"></div> <div slot="content"></div>
<slot> <slot>
<div> <div>
<Input style="width: 200px; margin-right: 10px" v-model.number="searchFields.Name" placeholder="关键字搜索" /> <!-- <Input style="width: 200px; margin-right: 10px" v-model.number="searchFields.Name" placeholder="关键字搜索" />
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button> <Button type="primary" @click="load" style="margin-left: 10px">查询</Button> -->
<Button type="primary" @click="edit()" style="margin-left: 10px">新增菜单</Button> <Button type="primary" @click="edit()" style="margin-left: 10px">新增菜单</Button>
</div> </div>
</slot> </slot>

@ -7,8 +7,8 @@
<div slot="content"></div> <div slot="content"></div>
<slot> <slot>
<div> <div>
<Input style="width: 200px; margin-right: 10px" v-model.number="searchFields.Name" placeholder="关键字搜索" /> <!-- <Input style="width: 200px; margin-right: 10px" v-model.number="searchFields.Name" placeholder="关键字搜索" />
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button> <Button type="primary" @click="load" style="margin-left: 10px">查询</Button> -->
<Button type="primary" @click="edit()" style="margin-left: 10px">新增角色</Button> <Button type="primary" @click="edit()" style="margin-left: 10px">新增角色</Button>
</div> </div>
</slot> </slot>

@ -7,8 +7,8 @@
<div slot="content"></div> <div slot="content"></div>
<slot> <slot>
<div> <div>
<Input style="width: 200px; margin-right: 10px" v-model.number="searchFields.Name" placeholder="关键字搜索" /> <!-- <Input style="width: 200px; margin-right: 10px" v-model.number="searchFields.keyword" placeholder="关键字搜索" />
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button> <Button type="primary" @click="load" style="margin-left: 10px">查询</Button> -->
<Button type="primary" @click="edit()" style="margin-left: 10px">新增用户</Button> <Button type="primary" @click="edit()" style="margin-left: 10px">新增用户</Button>
</div> </div>
</slot> </slot>
@ -143,7 +143,7 @@
tableHeight: 0, tableHeight: 0,
// //
searchFields: { searchFields: {
KeyWord: "" keyword: ""
}, },
tableData: [] tableData: []
} }

Loading…
Cancel
Save