Commit b25b1108 by dongjipeng

add

parent 556c010d
File added
...@@ -43,6 +43,7 @@ button {outline: none; border: none; background: transparent; cursor: pointer} ...@@ -43,6 +43,7 @@ button {outline: none; border: none; background: transparent; cursor: pointer}
.tr {text-align: right} .tr {text-align: right}
/* margin */ /* margin */
.ma {margin: auto}
.mt10 {margin-top: 10px;} .mt10 {margin-top: 10px;}
.mt30 {margin-top: 30px;} .mt30 {margin-top: 30px;}
.mt50 {margin-top: 50px;} .mt50 {margin-top: 50px;}
...@@ -50,6 +51,8 @@ button {outline: none; border: none; background: transparent; cursor: pointer} ...@@ -50,6 +51,8 @@ button {outline: none; border: none; background: transparent; cursor: pointer}
.mb15 {margin-bottom: 15px;} .mb15 {margin-bottom: 15px;}
.mb20 {margin-bottom: 20px;} .mb20 {margin-bottom: 20px;}
.mb30 {margin-bottom: 30px;} .mb30 {margin-bottom: 30px;}
.mr10 {margin-right: 10px;}
.mr20 {margin-right: 20px;}
.mr30 {margin-right: 30px;} .mr30 {margin-right: 30px;}
.ml30 {margin-left: 30px;} .ml30 {margin-left: 30px;}
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="header_inner"> <div class="header_inner">
<h2>华夏幸福+ 平台管理系统</h2> <h2>华夏幸福+ 平台管理系统</h2>
<ul> <ul>
<li><a href="">郭玉洁</a></li> <li class="user_self"><a href="">郭玉洁</a></li>
<li class="exit_app"><a href="">退出登录</a></li> <li class="exit_app"><a href="">退出登录</a></li>
<li class="change_pwd"><a href="">修改密码</a></li> <li class="change_pwd"><a href="">修改密码</a></li>
</ul> </ul>
...@@ -20,7 +20,7 @@ export default { ...@@ -20,7 +20,7 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.header { .header {
height: 70px!important; height: 70px!important;
padding: 0 17px; padding: 0 20px;
background: #314057; background: #314057;
box-sizing: border-box; box-sizing: border-box;
position: fixed; position: fixed;
...@@ -29,7 +29,19 @@ export default { ...@@ -29,7 +29,19 @@ export default {
left: 0; left: 0;
top: 0; top: 0;
.header_inner {display: flex; align-items: center; justify-content: space-between; height: 100%; color: #FEFEFE; .header_inner {display: flex; align-items: center; justify-content: space-between; height: 100%; color: #FEFEFE;
h2 {font-size: 22px; font-weight: normal; padding-left: 100px; color: #ddd} h2 {font-size: 22px; font-weight: normal; padding-left: 82px; color: #ddd; position: relative;
&:before {
content: "";
display: block;
width: 68px;
height: 50px;
background: url("../assets/img/logo.png") no-repeat center/cover;
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
}
}
ul {float: right; ul {float: right;
li {display: inline-block; vertical-align: middle; font-size: 14px; position: relative; padding: 0 15px; li {display: inline-block; vertical-align: middle; font-size: 14px; position: relative; padding: 0 15px;
a { color: #ddd; a { color: #ddd;
...@@ -47,6 +59,21 @@ export default { ...@@ -47,6 +59,21 @@ export default {
transform: translateY(-50%); transform: translateY(-50%);
} }
} }
&.user_self {
padding-left: 34px;
position: relative;
&:before {
content: "";
display: block;
width: 24px;
height: 24px;
background: url("../assets/img/icon/ico_user.png") no-repeat center/cover;
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
}
}
} }
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<el-container style="height: 100%"> <el-container style="height: 100%">
<Header></Header> <Header></Header>
<el-container class="el_content"> <el-container class="el_content">
<el-aside width="200px"> <el-aside width="220px">
<el-menu <el-menu
menu-trigger="hover" menu-trigger="hover"
:default-active="$route.path" :default-active="$route.path"
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</el-submenu> </el-submenu>
<el-submenu index="2"> <el-submenu index="2">
<template slot="title"><div class="tc">幸福餐厅</div></template> <template slot="title"><div class="tc">幸福餐厅</div></template>
<el-menu-item index="/restaurant/ationalRestaurant"><div class="tc">全国餐厅</div></el-menu-item> <el-menu-item index="/restaurant/rationalRestaurant"><div class="tc">全国餐厅</div></el-menu-item>
<el-menu-item index="/restaurant/restaurantMenus"><div class="tc">餐厅菜单</div></el-menu-item> <el-menu-item index="/restaurant/restaurantMenus"><div class="tc">餐厅菜单</div></el-menu-item>
<!--<el-menu-item index="/restaurant/foodVideo"><div class="tc">美食视频</div></el-menu-item>--> <!--<el-menu-item index="/restaurant/foodVideo"><div class="tc">美食视频</div></el-menu-item>-->
<el-menu-item index="/restaurant/solarCalendar"><div class="tc">节气日历</div></el-menu-item> <el-menu-item index="/restaurant/solarCalendar"><div class="tc">节气日历</div></el-menu-item>
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<el-submenu index="5"> <el-submenu index="5">
<template slot="title"><div class="tc">幸福洗衣</div></template> <template slot="title"><div class="tc">幸福洗衣</div></template>
<el-menu-item index="/wash/washBranches"><div class="tc">洗衣网点</div></el-menu-item> <el-menu-item index="/wash/washBranches"><div class="tc">洗衣网点</div></el-menu-item>
<el-menu-item index="/wash/newBranches"><div class="tc">新增网点</div></el-menu-item> <el-menu-item index="/wash/newBranches"><div class="tc">网点编辑</div></el-menu-item>
<el-menu-item index="/wash/commonSense"><div class="tc">洗衣小常识</div></el-menu-item> <el-menu-item index="/wash/commonSense"><div class="tc">洗衣小常识</div></el-menu-item>
</el-submenu> </el-submenu>
<el-submenu index="6"> <el-submenu index="6">
......
...@@ -10,37 +10,72 @@ import 'quill/dist/quill.snow.css' ...@@ -10,37 +10,72 @@ import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css' import 'quill/dist/quill.bubble.css'
import ElementUi from 'element-ui' import ElementUi from 'element-ui'
import './element-variables.scss' import './element-variables.scss'
import rules from './util/validator'
import '../src/assets/css/reset.scss' import '../src/assets/css/reset.scss'
import '../src/assets/css/main.scss' import '../src/assets/css/main.scss'
Vue.use(VueQuillEditor) Vue.use(VueQuillEditor)
Vue.use(ElementUi, { size: 'small' }) Vue.use(ElementUi, { size: 'small' })
Vue.prototype.$rules = rules
Vue.prototype.$axios = axios Vue.prototype.$axios = axios
Vue.prototype.$qs = QS Vue.prototype.$qs = QS
// cookie
function getCookie () {
if (document.cookie.length > 0) {
if (document.cookie.indexOf('AuthUser_LoginId') === '-1' || document.cookie.indexOf('AuthUser_AuthNum') === '-1' ||
document.cookie.indexOf('AuthUser_AuthToken') === '-1' || document.cookie.indexOf('AuthUser_LoginId') === '-1'
) {
let h = window.location.href
window.location.href = 'http://sso.cfldcn.com/LoginLight.aspx?flag=3&systemCode=CRS271&RetutnUrl=' + h
}
} else {
let h = window.location.href
window.location.href = 'http://sso.cfldcn.com/LoginLight.aspx?flag=3&systemCode=CRS271&RetutnUrl=' + h
}
}
axios.defaults.timeout = 50000 axios.defaults.timeout = 50000
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8' axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'
axios.defaults.withCredentials = true axios.defaults.withCredentials = true
if (process.env.VUE_APP_API_PREFIX === 'development') { // 开发 if (process.env.VUE_APP_API_PREFIX === 'development') { // 开发
axios.defaults.baseURL = 'http://10.2.98.32:8081/admin/' axios.defaults.baseURL = 'http://10.2.98.32:8091/admin/'
Vue.prototype.$baseURL = 'http://10.2.98.32:8081/admin/' Vue.prototype.$baseURL = 'http://10.2.98.32:8091/admin/'
Vue.prototype.$imgUrl = 'http://10.2.98.32:8081/admin/images/' Vue.prototype.$imgUrl = 'http://10.2.98.32:8091/admin/images/'
Vue.prototype.$export = 'http://10.2.98.32:8081/admin/export/'
} else { // 生产 } else { // 生产
getCookie()
axios.defaults.baseURL = 'http://happy.cfldpe.com/admin/' axios.defaults.baseURL = 'http://happy.cfldpe.com/admin/'
Vue.prototype.$baseURL = 'http://happy.cfldpe.com/admin/' Vue.prototype.$baseURL = 'http://happy.cfldpe.com/admin/'
Vue.prototype.$imgUrl = 'http://happy.cfldpe.com/admin/images/' Vue.prototype.$imgUrl = 'http://happy.cfldpe.com/admin/images/'
Vue.prototype.$export = 'http://happy.cfldpe.com/admin/export/'
} }
var loading
function startLoading () {
loading = Vue.prototype.$loading({
lock: true,
text: '加载中...',
fullscreen: true,
background: 'rgba(255, 255, 255, 0)'
})
}
function endLoading () {
loading.close()
}
// 添加请求拦截器
axios.interceptors.request.use(request => {
startLoading()
return request
}, err => {
return Promise.reject(err)
})
// 添加响应拦截器
axios.interceptors.response.use(function (response) { axios.interceptors.response.use(function (response) {
endLoading()
if (response.data.code === '0') { if (response.data.code === '0') {
return response.data.data return response.data.data
} else { } else {
Vue.prototype.$message({ Vue.prototype.$message.error(response.data.msg)
type: 'error', return Promise.reject(response.data)
message: '操作失败!'
})
} }
}) })
......
...@@ -145,7 +145,7 @@ export default new Router({ ...@@ -145,7 +145,7 @@ export default new Router({
name: 'newBranches', name: 'newBranches',
component: NewBranches, component: NewBranches,
meta: { meta: {
title: '新增网点' title: '网点编辑'
} }
}, },
{ {
...@@ -285,8 +285,8 @@ export default new Router({ ...@@ -285,8 +285,8 @@ export default new Router({
}, },
children: [ children: [
{ {
path: '/restaurant/ationalRestaurant', path: '/restaurant/rationalRestaurant',
name: 'ationalRestaurant', name: 'rationalRestaurant',
component: r => { require(['./views/restaurant/NationalRestaurant'], r) }, component: r => { require(['./views/restaurant/NationalRestaurant'], r) },
meta: { meta: {
title: '全国餐厅' title: '全国餐厅'
......
export default {
common: {
imgFilePath: { // 图片上传不能为空
required: true,
message: '请上传图片',
trigger: 'blur'
}
}
}
...@@ -85,26 +85,27 @@ ...@@ -85,26 +85,27 @@
<el-dialog <el-dialog
title="幸福社团" title="幸福社团"
:visible.sync="centerDialogVisible" :visible.sync="centerDialogVisible"
width="35%" width="40%"
center> center>
<el-form :model="form"> <el-form :model="form" ref="myForm" :rules="$rules.common" :inline-message="true">
<el-form-item label="图片上传" :label-width="formLabelWidth"> <el-form-item label="图片上传" :label-width="formLabelWidth" prop="imgFilePath">
<el-col :sm="24"> <el-col :sm="18">
<el-row class="img_load"> <el-upload
<el-col :sm="18"> class="avatar-uploader"
<el-upload :action="$baseURL + 'team/upload'"
class="avatar-uploader" :show-file-list="false"
:action="$baseURL + 'team/upload'" :multiple="true"
:show-file-list="false" :on-success="handleAvatarSuccess"
:multiple="true" :before-upload="beforeAvatarUpload">
:on-success="handleAvatarSuccess" <img v-if="form.imgFilePath" :src="$imgUrl + form.imgFilePath" class="avatar">
:before-upload="beforeAvatarUpload"> <i v-else class="el-icon-plus avatar-uploader-icon"></i>
<img v-if="form.picturePath" :src="$imgUrl + form.picturePath" class="avatar"> </el-upload>
<i v-else class="el-icon-plus avatar-uploader-icon"></i> <p style="font-size: 12px; line-height: 14px">*请上传尺寸为 <em>1920*502</em>,大小不超过5M的图片</p>
</el-upload> </el-col>
<p style="font-size: 12px; line-height: 14px">*请上传尺寸为 <em>1920*502</em>,大小不超过5M的图片</p> </el-form-item>
</el-col> <el-form-item label="图片名称" :label-width="formLabelWidth">
</el-row> <el-col :sm="18">
<el-input v-model="form.pictureOriginalName" autocomplete="off" disabled="disabled"></el-input>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="图片大小" :label-width="formLabelWidth"> <el-form-item label="图片大小" :label-width="formLabelWidth">
...@@ -112,11 +113,11 @@ ...@@ -112,11 +113,11 @@
<el-input v-model="form.pictureSize" autocomplete="off" disabled="disabled"></el-input> <el-input v-model="form.pictureSize" autocomplete="off" disabled="disabled"></el-input>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="图片排序" :label-width="formLabelWidth"> <!-- <el-form-item label="图片排序" :label-width="formLabelWidth">
<el-col :sm="18"> <el-col :sm="18">
<el-input-number v-model="form.pictureOrder" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.pictureOrder" controls-position="right" :min="1"></el-input-number>
</el-col> </el-col>
</el-form-item> </el-form-item>-->
<el-form-item label="备注" :label-width="formLabelWidth"> <el-form-item label="备注" :label-width="formLabelWidth">
<el-col :sm="18"> <el-col :sm="18">
<el-input v-model="form.pictureMark" autocomplete="off"></el-input> <el-input v-model="form.pictureMark" autocomplete="off"></el-input>
...@@ -128,7 +129,7 @@ ...@@ -128,7 +129,7 @@
<el-col :sm="10"> <el-col :sm="10">
<div class="btn-warp"> <div class="btn-warp">
<el-button @click="centerDialogVisible = false">取 消</el-button> <el-button @click="centerDialogVisible = false">取 消</el-button>
<el-button type="danger" @click="savePicture">确 定</el-button> <el-button type="danger" @click="savePicture('myForm')">确 定</el-button>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
...@@ -174,14 +175,14 @@ export default { ...@@ -174,14 +175,14 @@ export default {
classifyId: '', // 图集ID classifyId: '', // 图集ID
qjClassifyId: '', qjClassifyId: '',
currentPage: 1, currentPage: 1,
pageSize: 5, pageSize: 10,
totalPage: null, totalPage: null,
photoList: [], photoList: [],
centerDialogVisible: false, centerDialogVisible: false,
formLabelWidth: '120px', formLabelWidth: '120px',
form: { form: {
pictureName: '', pictureName: '',
picturePath: '', imgFilePath: '',
pictureOriginalName: '', pictureOriginalName: '',
pictureSize: '', pictureSize: '',
pictureOrder: '', pictureOrder: '',
...@@ -280,7 +281,7 @@ export default { ...@@ -280,7 +281,7 @@ export default {
this.form.pictureName = res.data[0].fileName this.form.pictureName = res.data[0].fileName
this.form.pictureOriginalName = res.data[0].fileOriginalName this.form.pictureOriginalName = res.data[0].fileOriginalName
this.form.pictureSize = res.data[0].fileSize this.form.pictureSize = res.data[0].fileSize
this.form.picturePath = res.data[0].filePath this.form.imgFilePath = res.data[0].filePath
}, },
beforeAvatarUpload (file) { beforeAvatarUpload (file) {
const isLt5M = file.size / 1024 / 1024 < 5 const isLt5M = file.size / 1024 / 1024 < 5
...@@ -289,24 +290,28 @@ export default { ...@@ -289,24 +290,28 @@ export default {
} }
return isLt5M return isLt5M
}, },
savePicture () { // 新增 savePicture (myForm) { // 新增
let _this = this this.$refs[myForm].validate((valid) => {
let params = { if (valid) {
'classifyId': _this.classifyId, let _this = this
'pictureMark': _this.form.pictureMark, let params = {
'pictureName': _this.form.pictureName, 'classifyId': _this.classifyId,
'pictureOrder': _this.form.pictureOrder, 'pictureMark': _this.form.pictureMark,
'pictureOriginalName': _this.form.pictureOriginalName, 'pictureName': _this.form.pictureName,
'picturePath': _this.form.picturePath, // 'pictureOrder': _this.form.pictureOrder,
'pictureSize': _this.form.pictureSize 'pictureOriginalName': _this.form.pictureOriginalName,
} 'picturePath': _this.form.imgFilePath,
this.$axios.post('/team/save', params) 'pictureSize': _this.form.pictureSize
.then(function (res) {
if (res) {
_this._getPhotoList()
_this.centerDialogVisible = false
} }
}) this.$axios.post('/team/save', params)
.then(function (res) {
if (res) {
_this._getPhotoList()
_this.centerDialogVisible = false
}
})
} else { return false }
})
}, },
pictureDel (item) { // 删除 pictureDel (item) { // 删除
this.$confirm('确定删除这条数据吗?', '提示', { this.$confirm('确定删除这条数据吗?', '提示', {
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<el-table-column <el-table-column
prop="pictureOriginalName" prop="pictureOriginalName"
align="center" align="center"
label="标题"> label="名称">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="classifyName" prop="classifyName"
...@@ -55,10 +55,9 @@ ...@@ -55,10 +55,9 @@
<el-table-column <el-table-column
align="center" align="center"
label="操作" label="操作"
width="200"> width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button icon="el-icon-delete" size="small" @click="photoDel(scope.row)"></el-button> <el-button icon="el-icon-delete" size="small" @click="photoDel(scope.row)" class="ma"></el-button>
<el-button icon="el-icon-download" size="small"></el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -75,26 +74,22 @@ ...@@ -75,26 +74,22 @@
<el-dialog <el-dialog
title="幸福农场" title="幸福农场"
:visible.sync="centerDialogVisible" :visible.sync="centerDialogVisible"
width="35%" width="40%"
center> center>
<el-form :model="form1"> <el-form :model="form1" ref="myForm" :rules="$rules.common" :inline-message="true">
<el-form-item label="图片上传" :label-width="formLabelWidth"> <el-form-item label="图片上传" :label-width="formLabelWidth" prop="imgFilePath">
<el-col :sm="24"> <el-col :sm="18">
<el-row class="img_load"> <el-upload
<el-col :sm="18"> class="avatar-uploader"
<el-upload :action="$baseURL + '/farm/photoUpdate'"
class="avatar-uploader" :show-file-list="false"
:action="$baseURL + '/farm/photoUpdate'" name="img"
:show-file-list="false" :on-success="handleAvatarSuccess"
name="img" :before-upload="beforeAvatarUpload">
:on-success="handleAvatarSuccess" <img v-if="form1.imgFilePath" :src="$imgUrl + form1.imgFilePath" class="avatar">
:before-upload="beforeAvatarUpload"> <i v-else class="el-icon-plus avatar-uploader-icon"></i>
<img v-if="form1.picturePath" :src="$imgUrl + form1.picturePath" class="avatar"> </el-upload>
<i v-else class="el-icon-plus avatar-uploader-icon"></i> <p style="font-size: 12px; line-height: 14px">*请上传尺寸为 <em>1920*502</em>,大小不超过5M的图片</p>
</el-upload>
<p style="font-size: 12px; line-height: 14px">*请上传尺寸为 <em>1920*502</em>,大小不超过5M的图片</p>
</el-col>
</el-row>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="图片名称" :label-width="formLabelWidth"> <el-form-item label="图片名称" :label-width="formLabelWidth">
...@@ -113,7 +108,7 @@ ...@@ -113,7 +108,7 @@
<el-col :sm="10"> <el-col :sm="10">
<div class="btn-warp"> <div class="btn-warp">
<el-button @click="centerDialogVisible = false">取 消</el-button> <el-button @click="centerDialogVisible = false">取 消</el-button>
<el-button type="danger" @click="uploadImg">确 定</el-button> <el-button type="danger" @click="uploadImg('myForm')">确 定</el-button>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
...@@ -132,17 +127,17 @@ export default { ...@@ -132,17 +127,17 @@ export default {
centerDialogVisible: false, centerDialogVisible: false,
imgInter: '', imgInter: '',
currentPage: 1, currentPage: 1,
pageSize: 5, pageSize: 10,
totalPage: null, totalPage: null,
photoList: [], photoList: [],
form1: { form1: {
pictureName: '', pictureName: '',
pictureOriginalName: '', pictureOriginalName: '',
pictureSize: '', pictureSize: '',
picturePath: '', imgFilePath: '',
pictureMark: '' pictureMark: ''
}, },
formLabelWidth: '120px' formLabelWidth: '100px'
} }
}, },
mounted () { mounted () {
...@@ -179,7 +174,7 @@ export default { ...@@ -179,7 +174,7 @@ export default {
handleAvatarSuccess (res, file) { // 图片上传 handleAvatarSuccess (res, file) { // 图片上传
this.form1.pictureName = res.data.fileName this.form1.pictureName = res.data.fileName
this.form1.pictureOriginalName = res.data.fileOriginalName this.form1.pictureOriginalName = res.data.fileOriginalName
this.form1.picturePath = res.data.filePath this.form1.imgFilePath = res.data.filePath
this.form1.pictureSize = res.data.fileSize this.form1.pictureSize = res.data.fileSize
}, },
beforeAvatarUpload (file) { beforeAvatarUpload (file) {
...@@ -192,27 +187,31 @@ export default { ...@@ -192,27 +187,31 @@ export default {
addClassifyImg (item) { addClassifyImg (item) {
this.classifyId = item.id this.classifyId = item.id
this.form1.pictureOriginalName = '' this.form1.pictureOriginalName = ''
this.form1.picturePath = '' this.form1.imgFilePath = ''
this.form1.pictureMark = '' this.form1.pictureMark = ''
this.centerDialogVisible = true this.centerDialogVisible = true
}, },
uploadImg () { // 图片添加 uploadImg (myForm) { // 图片添加
let _this = this this.$refs[myForm].validate((valid) => {
let params = { if (valid) {
'classifyId': _this.classifyId, let _this = this
'pictureMark': _this.form1.pictureMark, let params = {
'pictureName': _this.form1.pictureName, 'classifyId': _this.classifyId,
'pictureOriginalName': _this.form1.pictureOriginalName, 'pictureMark': _this.form1.pictureMark,
'picturePath': _this.form1.picturePath, 'pictureName': _this.form1.pictureName,
'pictureSize': _this.form1.pictureSize 'pictureOriginalName': _this.form1.pictureOriginalName,
} 'picturePath': _this.form1.imgFilePath,
this.$axios.post('/farm/photoAdd', params) 'pictureSize': _this.form1.pictureSize
.then(function (res) {
if (res) {
_this._getPhotoList()
_this.centerDialogVisible = false
} }
}) this.$axios.post('/farm/photoAdd', params)
.then(function (res) {
if (res) {
_this._getPhotoList()
_this.centerDialogVisible = false
}
})
} else { return false }
})
}, },
photoDel (item) { // 图片删除 photoDel (item) { // 图片删除
this.$confirm('确定删除这条数据吗?', '提示', { this.$confirm('确定删除这条数据吗?', '提示', {
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<el-table-column <el-table-column
prop="updateTime" prop="updateTime"
align="center" align="center"
label="上传日期"> label="更新日期">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
width="300"> width="300">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button icon="el-icon-download" size="small" @click="importCoolRunHandle(scope.row.id)"></el-button>--> <!-- <el-button icon="el-icon-download" size="small" @click="importCoolRunHandle(scope.row.id)"></el-button>-->
<el-button icon="el-icon-download" size="small"><a :href="$baseURL + '/exercise/dailyDateExport?exerciseDailyId=' + scope.row.id"></a></el-button> <a :href="$baseURL + '/exercise/dailyDateExport?exerciseDailyId=' + scope.row.id"><el-button icon="el-icon-download" size="small"></el-button></a>
<el-switch <el-switch
v-model="scope.row.isShow" v-model="scope.row.isShow"
@change="switchChange(scope.row)" @change="switchChange(scope.row)"
...@@ -78,7 +78,7 @@ export default { ...@@ -78,7 +78,7 @@ export default {
data () { data () {
return { return {
currentPage: 1, currentPage: 1,
pageSize: 5, pageSize: 10,
totalPage: null, totalPage: null,
dailyList: [], dailyList: [],
marathonExportHref: '' marathonExportHref: ''
...@@ -161,7 +161,7 @@ export default { ...@@ -161,7 +161,7 @@ export default {
}, },
handleSuccessMarathon (response, file) { // 酷跑导入数据 handleSuccessMarathon (response, file) { // 酷跑导入数据
if (response.data === 'OK') { if (response.data === 'OK') {
this._getMarathonList() this._getDailyList()
this.$message.success('导入成功!') this.$message.success('导入成功!')
} else { } else {
this.$message.success('导入失败!') this.$message.success('导入失败!')
......
...@@ -30,16 +30,16 @@ ...@@ -30,16 +30,16 @@
<img :src="$imgUrl + scope.row.picturePath" width="220" height="60" /> <img :src="$imgUrl + scope.row.picturePath" width="220" height="60" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <!--<el-table-column
prop="pictureOriginalName" prop="pictureOriginalName"
align="center" align="center"
label="名称"> label="名称">
</el-table-column> </el-table-column>-->
<el-table-column <!--<el-table-column
prop="pictureOrder" prop="pictureOrder"
align="center" align="center"
label="图片排序"> label="图片排序">
</el-table-column> </el-table-column>-->
<el-table-column <el-table-column
prop="pictureSize" prop="pictureSize"
align="center" align="center"
...@@ -52,9 +52,9 @@ ...@@ -52,9 +52,9 @@
width="180"> width="180">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="updateUser" prop="createUser"
align="center" align="center"
label="操作人"> label="创建人">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="pictureMark" prop="pictureMark"
...@@ -83,30 +83,26 @@ ...@@ -83,30 +83,26 @@
<el-dialog <el-dialog
title="幸福长跑" title="幸福长跑"
:visible.sync="centerDialogVisible" :visible.sync="centerDialogVisible"
width="35%" width="40%"
center> center>
<el-form :model="form"> <el-form :model="form" ref="myForm" :rules="$rules.common" :inline-message="true">
<el-form-item label="图片上传" :label-width="formLabelWidth"> <el-form-item label="图片上传" :label-width="formLabelWidth" prop="imgFilePath">
<el-col :sm="24"> <el-col :sm="18">
<el-row class="img_load"> <el-upload
<el-col :sm="18"> class="avatar-uploader"
<el-upload :action="$baseURL + '/exercise/photoUpdate'"
class="avatar-uploader" name="img"
:action="$baseURL + '/exercise/photoUpdate'" :show-file-list="false"
name="img" :multiple="true"
:show-file-list="false" :on-success="handleAvatarSuccess"
:multiple="true" :before-upload="beforeAvatarUpload">
:on-success="handleAvatarSuccess" <img v-if="form.imgFilePath" :src="$imgUrl + form.imgFilePath" class="avatar">
:before-upload="beforeAvatarUpload"> <i v-else class="el-icon-plus avatar-uploader-icon"></i>
<img v-if="form.picturePath" :src="$imgUrl + form.picturePath" class="avatar"> </el-upload>
<i v-else class="el-icon-plus avatar-uploader-icon"></i> <p style="font-size: 12px; line-height: 14px">*请上传尺寸为 <em>1920*502</em>,大小不超过5M的图片</p>
</el-upload>
<p style="font-size: 12px; line-height: 14px">*请上传尺寸为 <em>1920*502</em>,大小不超过5M的图片</p>
</el-col>
</el-row>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="标题" :label-width="formLabelWidth"> <el-form-item label="图片名称" :label-width="formLabelWidth">
<el-col :sm="18"> <el-col :sm="18">
<el-input v-model="form.pictureOriginalName" autocomplete="off" disabled="disabled"></el-input> <el-input v-model="form.pictureOriginalName" autocomplete="off" disabled="disabled"></el-input>
</el-col> </el-col>
...@@ -116,11 +112,11 @@ ...@@ -116,11 +112,11 @@
<el-input v-model="form.pictureSize" autocomplete="off" disabled="disabled"></el-input> <el-input v-model="form.pictureSize" autocomplete="off" disabled="disabled"></el-input>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="图片排序" :label-width="formLabelWidth"> <!-- <el-form-item label="图片排序" :label-width="formLabelWidth">
<el-col :sm="18"> <el-col :sm="18">
<el-input-number v-model="form.pictureOrder" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.pictureOrder" controls-position="right" :min="1"></el-input-number>
</el-col> </el-col>
</el-form-item> </el-form-item>-->
<el-form-item label="备注" :label-width="formLabelWidth"> <el-form-item label="备注" :label-width="formLabelWidth">
<el-col :sm="18"> <el-col :sm="18">
<el-input v-model="form.pictureMark" autocomplete="off"></el-input> <el-input v-model="form.pictureMark" autocomplete="off"></el-input>
...@@ -132,7 +128,7 @@ ...@@ -132,7 +128,7 @@
<el-col :sm="10"> <el-col :sm="10">
<div class="btn-warp"> <div class="btn-warp">
<el-button @click="centerDialogVisible = false">取 消</el-button> <el-button @click="centerDialogVisible = false">取 消</el-button>
<el-button type="danger" @click="savePicture">确 定</el-button> <el-button type="danger" @click="savePicture('myForm')">确 定</el-button>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
...@@ -157,7 +153,7 @@ export default { ...@@ -157,7 +153,7 @@ export default {
form: { form: {
pictureName: '', pictureName: '',
pictureOriginalName: '', pictureOriginalName: '',
picturePath: '', imgFilePath: '',
pictureSize: '', pictureSize: '',
pictureOrder: '', pictureOrder: '',
pictureMark: '' pictureMark: ''
...@@ -194,7 +190,7 @@ export default { ...@@ -194,7 +190,7 @@ export default {
params: { params: {
'p': _this.currentPage, 'p': _this.currentPage,
'c': _this.pageSize, 'c': _this.pageSize,
'exerciseClassifyId': _this.classifyId 'classifyId': _this.classifyId
} }
}).then(function (res) { }).then(function (res) {
_this.totalPage = res.count _this.totalPage = res.count
...@@ -204,7 +200,7 @@ export default { ...@@ -204,7 +200,7 @@ export default {
handleAvatarSuccess (res, file) { // 上传 handleAvatarSuccess (res, file) { // 上传
this.form.pictureName = res.data.fileName this.form.pictureName = res.data.fileName
this.form.pictureOriginalName = res.data.fileOriginalName this.form.pictureOriginalName = res.data.fileOriginalName
this.form.picturePath = res.data.filePath this.form.imgFilePath = res.data.filePath
this.form.pictureSize = res.data.fileSize this.form.pictureSize = res.data.fileSize
}, },
beforeAvatarUpload (file) { beforeAvatarUpload (file) {
...@@ -214,23 +210,27 @@ export default { ...@@ -214,23 +210,27 @@ export default {
} }
return isLt5M return isLt5M
}, },
savePicture () { // 新增 savePicture (myForm) { // 新增
let _this = this this.$refs[myForm].validate((valid) => {
let params = { if (valid) {
'classifyId': _this.classifyId, let _this = this
'pictureMark': _this.form.pictureMark, let params = {
'pictureName': _this.form.pictureName, 'classifyId': _this.classifyId,
'pictureOriginalName': _this.form.pictureOriginalName, 'pictureMark': _this.form.pictureMark,
'picturePath': _this.form.picturePath, 'pictureName': _this.form.pictureName,
'pictureSize': _this.form.pictureSize 'pictureOriginalName': _this.form.pictureOriginalName,
} 'picturePath': _this.form.imgFilePath,
this.$axios.post('/exercise/photoAdd', params) 'pictureSize': _this.form.pictureSize
.then(function (res) {
if (res) {
_this._getPhotoList()
_this.centerDialogVisible = false
} }
}) this.$axios.post('/exercise/photoAdd', params)
.then(function (res) {
if (res) {
_this._getPhotoList()
_this.centerDialogVisible = false
}
})
} else { return false }
})
}, },
pictureDel (item) { // 删除 pictureDel (item) { // 删除
this.$confirm('确定删除这条数据吗?', '提示', { this.$confirm('确定删除这条数据吗?', '提示', {
......
...@@ -91,7 +91,7 @@ export default { ...@@ -91,7 +91,7 @@ export default {
return { return {
exerciseMarathonName: '', exerciseMarathonName: '',
currentPageMarathon: 1, currentPageMarathon: 1,
pageSizeMarathon: 8, pageSizeMarathon: 10,
totalPageMarathon: null, totalPageMarathon: null,
marathonExportHref: '', marathonExportHref: '',
marathonData: [] marathonData: []
......
...@@ -17,17 +17,13 @@ ...@@ -17,17 +17,13 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="bannerImg" prop="bannerImg"
align="center"
label="banner缩略图"> label="banner缩略图">
<template slot-scope="scope"> <template slot-scope="scope">
<img :src="$imgUrl + scope.row.bannerPath" width="200" height="70" /> <img :src="$imgUrl + scope.row.bannerPath" width="200" height="70" style="margin: auto" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="bannerName"
label="名称"
width="180">
</el-table-column>
<el-table-column
prop="bannerOrder" prop="bannerOrder"
align="center" align="center"
label="轮播排序"> label="轮播排序">
...@@ -50,7 +46,7 @@ ...@@ -50,7 +46,7 @@
<el-table-column <el-table-column
align="center" align="center"
label="操作" label="操作"
width="300"> width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<div @click.stop="deleteVisible = true"> <div @click.stop="deleteVisible = true">
<el-button icon="el-icon-edit" size="small" @click="bannerEdit(scope.row)"></el-button> <el-button icon="el-icon-edit" size="small" @click="bannerEdit(scope.row)"></el-button>
...@@ -68,7 +64,7 @@ ...@@ -68,7 +64,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination" v-if="bannerList.length">
<el-pagination <el-pagination
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
...@@ -81,25 +77,21 @@ ...@@ -81,25 +77,21 @@
<el-dialog <el-dialog
:title="dialogTitle" :title="dialogTitle"
:visible.sync="centerDialogVisible" :visible.sync="centerDialogVisible"
width="35%" width="40%"
center> center>
<el-form :model="form"> <el-form :model="form" ref="myForm" :rules="$rules.common" :inline-message="true">
<el-form-item label="图片上传" :label-width="formLabelWidth"> <el-form-item label="图片上传" :label-width="formLabelWidth" prop="imgFilePath">
<el-col :sm="24"> <el-col :sm="18">
<el-row class="img_load"> <el-upload
<el-col :sm="18"> class="avatar-uploader"
<el-upload :action="$baseURL + '/index/banner/upload'"
class="avatar-uploader" :show-file-list="false"
:action="$uploaderUrl + '/index/banner/upload'" :on-success="handleAvatarSuccess"
:show-file-list="false" :before-upload="beforeAvatarUpload">
:on-success="handleAvatarSuccess" <img v-if="form.imgFilePath" :src="$imgUrl + form.imgFilePath" class="avatar">
:before-upload="beforeAvatarUpload"> <i v-else class="el-icon-plus avatar-uploader-icon"></i>
<img v-if="form.imgFilePath" :src="$imgUrl + form.imgFilePath" class="avatar"> </el-upload>
<i v-else class="el-icon-plus avatar-uploader-icon"></i> <p style="font-size: 12px; line-height: 14px">*请上传尺寸为 <em>1920*502</em>,大小不超过5M的图片</p>
</el-upload>
<p style="font-size: 12px; line-height: 14px">*请上传尺寸为 <em>1920*502</em>,大小不超过5M的图片</p>
</el-col>
</el-row>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="图片大小" :label-width="formLabelWidth"> <el-form-item label="图片大小" :label-width="formLabelWidth">
...@@ -117,19 +109,13 @@ ...@@ -117,19 +109,13 @@
</el-form-item> </el-form-item>
<el-form-item label="轮播排序" :label-width="formLabelWidth"> <el-form-item label="轮播排序" :label-width="formLabelWidth">
<el-col :sm="18"> <el-col :sm="18">
<el-select v-model="form.bannerOrder" placeholder="请选择活动区域" style="width: 100%"> <el-input-number v-model="form.bannerOrder" :min="1" :max="8" label="排序"></el-input-number>
<el-option label="1" value="1"></el-option>
<el-option label="2" value="2"></el-option>
<el-option label="3" value="3"></el-option>
<el-option label="4" value="4"></el-option>
<el-option label="5" value="5"></el-option>
</el-select>
<p style="font-size: 12px">*首页轮播图最多8张</p> <p style="font-size: 12px">*首页轮播图最多8张</p>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="外链文章" :label-width="formLabelWidth"> <el-form-item label="外链文章" :label-width="formLabelWidth">
<el-col :sm="18"> <el-col :sm="18">
<el-input v-model="form.bannerLinks" autocomplete="off"></el-input> <el-input v-model="form.bannerLinks"></el-input>
</el-col> </el-col>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -138,7 +124,7 @@ ...@@ -138,7 +124,7 @@
<el-col :sm="10"> <el-col :sm="10">
<div class="btn-warp"> <div class="btn-warp">
<el-button @click="centerDialogVisible = false">取 消</el-button> <el-button @click="centerDialogVisible = false">取 消</el-button>
<el-button type="danger" @click="bannerAddHandle">确 定</el-button> <el-button type="danger" @click="bannerAddHandle('myForm')">确 定</el-button>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
...@@ -148,6 +134,8 @@ ...@@ -148,6 +134,8 @@
</template> </template>
<script> <script>
import rules from '../../util/validator'
export default { export default {
name: 'bannerManage', name: 'bannerManage',
data () { data () {
...@@ -168,6 +156,7 @@ export default { ...@@ -168,6 +156,7 @@ export default {
bannerFileName: '', bannerFileName: '',
bannerOriginalName: '' bannerOriginalName: ''
}, },
rules: rules,
bannerStatus: '1', bannerStatus: '1',
bannerPixel: '1920*502', bannerPixel: '1920*502',
formLabelWidth: '100px', formLabelWidth: '100px',
...@@ -264,48 +253,52 @@ export default { ...@@ -264,48 +253,52 @@ export default {
this.dialogTitle = '编辑banner' this.dialogTitle = '编辑banner'
this.centerDialogVisible = true this.centerDialogVisible = true
}, },
bannerAddHandle () { // 编辑 or 添加 bannerAddHandle (myForm) { // 编辑 or 添加
var _this = this this.$refs[myForm].validate((valid) => {
var paramsAdd = { if (valid) {
'bannerLinks': _this.form.bannerLinks, var _this = this
'bannerName': _this.form.bannerFileName, var paramsAdd = {
'bannerOrder': _this.form.bannerOrder, 'bannerLinks': _this.form.bannerLinks,
'bannerPath': _this.form.imgFilePath, 'bannerName': _this.form.bannerFileName,
'bannerPixel': _this.bannerPixel, 'bannerOrder': _this.form.bannerOrder,
'bannerSize': _this.form.bannerSize, 'bannerPath': _this.form.imgFilePath,
'bannerStatus': _this.bannerStatus 'bannerPixel': _this.bannerPixel,
} 'bannerSize': _this.form.bannerSize,
var paramsEdit = { 'bannerStatus': _this.bannerStatus
'bannerLinks': _this.form.bannerLinks, }
'bannerName': _this.form.bannerFileName, var paramsEdit = {
'bannerOrder': _this.form.bannerOrder, 'bannerLinks': _this.form.bannerLinks,
'bannerPath': _this.form.imgFilePath, 'bannerName': _this.form.bannerFileName,
'bannerPixel': _this.bannerPixel, 'bannerOrder': _this.form.bannerOrder,
'bannerSize': _this.form.bannerSize, 'bannerPath': _this.form.imgFilePath,
'bannerStatus': _this.bannerStatus, 'bannerPixel': _this.bannerPixel,
'indexBannerId': _this.indexBannerId 'bannerSize': _this.form.bannerSize,
} 'bannerStatus': _this.bannerStatus,
if (_this.dialogTitle === '新增banner') { 'indexBannerId': _this.indexBannerId
this.$axios.post('/index/banner/add', paramsAdd) }
.then(function (res) { if (_this.dialogTitle === '新增banner') {
_this.searchImgList() this.$axios.post('/index/banner/add', paramsAdd)
_this.$message({ .then(function (res) {
type: 'success', _this.searchImgList()
message: '添加成功!' _this.$message({
}) type: 'success',
_this.centerDialogVisible = false message: '添加成功!'
}) })
} else { _this.centerDialogVisible = false
this.$axios.post('/index/banner/update', paramsEdit) })
.then(function (res) { } else {
_this.searchImgList() this.$axios.post('/index/banner/update', paramsEdit)
_this.$message({ .then(function (res) {
type: 'success', _this.searchImgList()
message: '修改成功!' _this.$message({
}) type: 'success',
_this.centerDialogVisible = false message: '修改成功!'
}) })
} _this.centerDialogVisible = false
})
}
} else { return false }
})
} }
} }
} }
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<el-table-column <el-table-column
align="center" align="center"
label="操作" label="操作"
width="200"> width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<div @click.stop="deleteVisible = true"> <div @click.stop="deleteVisible = true">
<el-button icon="el-icon-edit" size="small" @click="editLink(scope.row)"></el-button> <el-button icon="el-icon-edit" size="small" @click="editLink(scope.row)"></el-button>
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination" v-if="linkList.length">
<el-pagination <el-pagination
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
<el-row class="mb20"> <el-row class="mb20">
<el-col :span="4" align="center">链接名称</el-col> <el-col :span="4" align="center">链接名称</el-col>
<el-col :span="12"> <el-col :span="12">
<el-input v-model="linkName" placeholder="请输入图片描述" maxlength="20"></el-input> <el-input v-model="linkName" placeholder="请输入图片描述" maxlength="8"></el-input>
</el-col> </el-col>
<el-col :span="7" :offset="1"> <el-col :span="7" :offset="1">
<p>*链接名称最多8个汉字</p> <p>*链接名称最多8个汉字</p>
...@@ -82,13 +82,14 @@ ...@@ -82,13 +82,14 @@
<el-row class="mb20"> <el-row class="mb20">
<el-col :span="4" align="center">链接排序</el-col> <el-col :span="4" align="center">链接排序</el-col>
<el-col :span="12"> <el-col :span="12">
<el-select v-model="linkOrder" placeholder="请选择"> <!--<el-select v-model="linkOrder" placeholder="请选择">
<el-option <el-option
v-for="item in 10" v-for="item in 10"
:key="item" :key="item"
:value="item"> :value="item">
</el-option> </el-option>
</el-select> </el-select>-->
<el-input-number v-model="linkOrder" :min="1"></el-input-number>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
...@@ -108,16 +109,6 @@ ...@@ -108,16 +109,6 @@
</el-row> </el-row>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog
title="提示"
:visible.sync="dialogVisible"
width="30%">
<span>确认删除这条信息吗?</span>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="ensureDelete">确 定</el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
...@@ -136,7 +127,6 @@ export default { ...@@ -136,7 +127,6 @@ export default {
linkName: '', linkName: '',
linkOrder: '', linkOrder: '',
linkUrl: '', linkUrl: '',
dialogVisible: false,
linkItemId: '', linkItemId: '',
isAdd: true isAdd: true
} }
...@@ -192,25 +182,32 @@ export default { ...@@ -192,25 +182,32 @@ export default {
.then(function (res) { .then(function (res) {
if (res === 'OK') { if (res === 'OK') {
_this._getCommonList() _this._getCommonList()
_this.$message('操作成功!') _this.$message({
type: 'success',
message: '操作成功!'
})
_this.centerDialogVisible = false _this.centerDialogVisible = false
} }
}) })
}, },
deleteLink (item) { deleteLink (item) { // 删除
this.linkItemId = item.id this.$confirm('确定删除这条数据吗?', '提示', {
this.dialogVisible = true confirmButtonText: '确定',
}, cancelButtonText: '取消',
ensureDelete () { // 删除 type: 'warning'
let _this = this }).then(() => {
this.$axios.get('/used/links/delete/' + _this.linkItemId) let _this = this
.then(function (res) { _this.$axios.get('/used/links/delete/' + item.id)
if (res === 'OK') { .then(function (res) {
_this._getCommonList() if (res) {
_this.$message('删除成功!') _this._getCommonList()
_this.dialogVisible = false _this.$message({
} type: 'success',
}) message: '删除成功!'
})
}
})
})
}, },
editLink (item) { // 编辑 editLink (item) { // 编辑
this.centerDialogVisible = true this.centerDialogVisible = true
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="message-management"> <div class="message-management">
<el-row type="flex" justify="space-between" class="mb20"> <el-row type="flex" justify="space-between" class="mb20">
<el-col :span="6"> <el-col :span="6">
<el-select v-model="moduleVal" placeholder="请选择" size="small"> <el-select v-model="moduleVal" placeholder="请选择" size="small" @change="_getMessageList">
<el-option <el-option
v-for="(item, key, index) in moduleList" v-for="(item, key, index) in moduleList"
:key="index" :key="index"
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination" v-if="messageList.length">
<el-pagination <el-pagination
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
...@@ -161,12 +161,12 @@ export default { ...@@ -161,12 +161,12 @@ export default {
moduleList: {}, moduleList: {},
moduleVal: '', moduleVal: '',
currentPage: 1, currentPage: 1,
pageSize: 5, pageSize: 10,
count: null, count: null,
messageList: [], messageList: [],
leaveMessageId: '', leaveMessageId: '',
centerDialogVisible: false, centerDialogVisible: false,
remarks: '', remarks: ''
} }
}, },
mounted () { mounted () {
......
...@@ -26,11 +26,11 @@ ...@@ -26,11 +26,11 @@
align="center" align="center"
label="名称"> label="名称">
</el-table-column> </el-table-column>
<el-table-column <!--<el-table-column
prop="pictureOrder" prop="pictureOrder"
align="center" align="center"
label="图片排序"> label="图片排序">
</el-table-column> </el-table-column>-->
<el-table-column <el-table-column
prop="pictureSize" prop="pictureSize"
align="center" align="center"
...@@ -74,31 +74,27 @@ ...@@ -74,31 +74,27 @@
<el-dialog <el-dialog
title="无忧办公" title="无忧办公"
:visible.sync="centerDialogVisible" :visible.sync="centerDialogVisible"
width="35%" width="40%"
center> center>
<el-form :model="form"> <el-form :model="form" ref="myForm" :rules="$rules.common" :inline-message="true">
<el-form-item label="标题" :label-width="formLabelWidth"> <el-form-item label="图片上传" :label-width="formLabelWidth" prop="imgFilePath">
<el-col :sm="18"> <el-col :sm="18">
<el-input v-model="form.pictureOriginalName" autocomplete="off" disabled="disabled"></el-input> <el-upload
class="avatar-uploader"
:action="$baseURL + '/roomofmother/picture/upload'"
:show-file-list="false"
:multiple="true"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload">
<img v-if="form.imgFilePath" :src="$imgUrl + form.imgFilePath" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<p style="font-size: 12px; line-height: 14px">*请上传尺寸为 <em>1920*502</em>,大小不超过5M的图片</p>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="图片上传" :label-width="formLabelWidth"> <el-form-item label="图片名称" :label-width="formLabelWidth">
<el-col :sm="24"> <el-col :sm="18">
<el-row class="img_load"> <el-input v-model="form.pictureOriginalName" autocomplete="off" disabled="disabled"></el-input>
<el-col :sm="18">
<el-upload
class="avatar-uploader"
:action="$baseURL + '/roomofmother/picture/upload'"
:show-file-list="false"
:multiple="true"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload">
<img v-if="form.picturePath" :src="$imgUrl + form.picturePath" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<p style="font-size: 12px; line-height: 14px">*请上传尺寸为 <em>1920*502</em>,大小不超过5M的图片</p>
</el-col>
</el-row>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="图片大小" :label-width="formLabelWidth"> <el-form-item label="图片大小" :label-width="formLabelWidth">
...@@ -106,11 +102,11 @@ ...@@ -106,11 +102,11 @@
<el-input v-model="form.pictureSize" autocomplete="off" disabled="disabled"></el-input> <el-input v-model="form.pictureSize" autocomplete="off" disabled="disabled"></el-input>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="图片排序" :label-width="formLabelWidth"> <!-- <el-form-item label="图片排序" :label-width="formLabelWidth">
<el-col :sm="18"> <el-col :sm="18">
<el-input-number v-model="form.pictureOrder" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.pictureOrder" controls-position="right" :min="1"></el-input-number>
</el-col> </el-col>
</el-form-item> </el-form-item>-->
<el-form-item label="备注" :label-width="formLabelWidth"> <el-form-item label="备注" :label-width="formLabelWidth">
<el-col :sm="18"> <el-col :sm="18">
<el-input v-model="form.pictureMark" autocomplete="off"></el-input> <el-input v-model="form.pictureMark" autocomplete="off"></el-input>
...@@ -122,7 +118,7 @@ ...@@ -122,7 +118,7 @@
<el-col :sm="10"> <el-col :sm="10">
<div class="btn-warp"> <div class="btn-warp">
<el-button @click="centerDialogVisible = false">取 消</el-button> <el-button @click="centerDialogVisible = false">取 消</el-button>
<el-button type="danger" @click="savePicture">确 定</el-button> <el-button type="danger" @click="savePicture('myForm')">确 定</el-button>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
...@@ -138,7 +134,7 @@ export default { ...@@ -138,7 +134,7 @@ export default {
return { return {
classifyId: '', // 图集ID classifyId: '', // 图集ID
currentPage: 1, currentPage: 1,
pageSize: 5, pageSize: 10,
totalPage: null, totalPage: null,
photoList: [], photoList: [],
centerDialogVisible: false, centerDialogVisible: false,
...@@ -188,7 +184,7 @@ export default { ...@@ -188,7 +184,7 @@ export default {
this.form.pictureName = res.data[0].fileName this.form.pictureName = res.data[0].fileName
this.form.pictureOriginalName = res.data[0].fileOriginalName this.form.pictureOriginalName = res.data[0].fileOriginalName
this.form.pictureSize = res.data[0].fileSize this.form.pictureSize = res.data[0].fileSize
this.form.picturePath = res.data[0].filePath this.form.imgFilePath = res.data[0].filePath
}, },
beforeAvatarUpload (file) { beforeAvatarUpload (file) {
const isLt5M = file.size / 1024 / 1024 < 5 const isLt5M = file.size / 1024 / 1024 < 5
...@@ -197,24 +193,28 @@ export default { ...@@ -197,24 +193,28 @@ export default {
} }
return isLt5M return isLt5M
}, },
savePicture () { // 新增 savePicture (myForm) { // 新增
let _this = this this.$refs[myForm].validate((valid) => {
let params = { if (valid) {
'classifyId': _this.classifyId, let _this = this
'pictureMark': _this.form.pictureMark, let params = {
'pictureName': _this.form.pictureName, 'classifyId': _this.classifyId,
'pictureOrder': _this.form.pictureOrder, 'pictureMark': _this.form.pictureMark,
'pictureOriginalName': _this.form.pictureOriginalName, 'pictureName': _this.form.pictureName,
'picturePath': _this.form.picturePath, // 'pictureOrder': _this.form.pictureOrder,
'pictureSize': _this.form.pictureSize 'pictureOriginalName': _this.form.pictureOriginalName,
} 'picturePath': _this.form.imgFilePath,
this.$axios.post('/roomofmother/picture/save', params) 'pictureSize': _this.form.pictureSize
.then(function (res) {
if (res === 'ok') {
_this._getPhotoList()
_this.centerDialogVisible = false
} }
}) this.$axios.post('/roomofmother/picture/save', params)
.then(function (res) {
if (res === 'ok') {
_this._getPhotoList()
_this.centerDialogVisible = false
}
})
} else { return false }
})
}, },
pictureDel (item) { // 删除 pictureDel (item) { // 删除
this.$confirm('确定删除这条数据吗?', '提示', { this.$confirm('确定删除这条数据吗?', '提示', {
......
...@@ -35,11 +35,11 @@ ...@@ -35,11 +35,11 @@
align="center" align="center"
label="名称"> label="名称">
</el-table-column> </el-table-column>
<el-table-column <!--<el-table-column
prop="pictureOrder" prop="pictureOrder"
align="center" align="center"
label="图片排序"> label="图片排序">
</el-table-column> </el-table-column>-->
<el-table-column <el-table-column
prop="pictureSize" prop="pictureSize"
align="center" align="center"
...@@ -83,32 +83,28 @@ ...@@ -83,32 +83,28 @@
<el-dialog <el-dialog
title="无忧办公" title="无忧办公"
:visible.sync="centerDialogVisible" :visible.sync="centerDialogVisible"
width="35%" width="40%"
center> center>
<el-form :model="form"> <el-form :model="form" ref="myForm" :rules="$rules.common" :inline-message="true">
<el-form-item label="标题" :label-width="formLabelWidth"> <el-form-item label="图片上传" :label-width="formLabelWidth" prop="imgFilePath">
<el-col :sm="18"> <el-col :sm="18">
<el-input v-model="form.pictureOriginalName" autocomplete="off" disabled="disabled"></el-input> <el-upload
class="avatar-uploader"
:action="$baseURL + '/office/picture/upload'"
name="files"
:show-file-list="false"
:multiple="true"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload">
<img v-if="form.imgFilePath" :src="$imgUrl + form.imgFilePath" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<p style="font-size: 12px; line-height: 14px">*请上传尺寸为 <em>1920*502</em>,大小不超过5M的图片</p>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="图片上传" :label-width="formLabelWidth"> <el-form-item label="图片名称" :label-width="formLabelWidth">
<el-col :sm="24"> <el-col :sm="18">
<el-row class="img_load"> <el-input v-model="form.pictureOriginalName" autocomplete="off" disabled="disabled"></el-input>
<el-col :sm="18">
<el-upload
class="avatar-uploader"
:action="$baseURL + '/office/picture/upload'"
name="files"
:show-file-list="false"
:multiple="true"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload">
<img v-if="form.picturePath" :src="$imgUrl + form.picturePath" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<p style="font-size: 12px; line-height: 14px">*请上传尺寸为 <em>1920*502</em>,大小不超过5M的图片</p>
</el-col>
</el-row>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="图片大小" :label-width="formLabelWidth"> <el-form-item label="图片大小" :label-width="formLabelWidth">
...@@ -116,11 +112,11 @@ ...@@ -116,11 +112,11 @@
<el-input v-model="form.pictureSize" autocomplete="off" disabled="disabled"></el-input> <el-input v-model="form.pictureSize" autocomplete="off" disabled="disabled"></el-input>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="图片排序" :label-width="formLabelWidth"> <!--<el-form-item label="图片排序" :label-width="formLabelWidth">
<el-col :sm="18"> <el-col :sm="18">
<el-input-number v-model="form.pictureOrder" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.pictureOrder" controls-position="right" :min="1"></el-input-number>
</el-col> </el-col>
</el-form-item> </el-form-item>-->
<el-form-item label="备注" :label-width="formLabelWidth"> <el-form-item label="备注" :label-width="formLabelWidth">
<el-col :sm="18"> <el-col :sm="18">
<el-input v-model="form.pictureMark" autocomplete="off"></el-input> <el-input v-model="form.pictureMark" autocomplete="off"></el-input>
...@@ -132,7 +128,7 @@ ...@@ -132,7 +128,7 @@
<el-col :sm="10"> <el-col :sm="10">
<div class="btn-warp"> <div class="btn-warp">
<el-button @click="centerDialogVisible = false">取 消</el-button> <el-button @click="centerDialogVisible = false">取 消</el-button>
<el-button type="danger" @click="savePicture">确 定</el-button> <el-button type="danger" @click="savePicture('myForm')">确 定</el-button>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
...@@ -204,7 +200,7 @@ export default { ...@@ -204,7 +200,7 @@ export default {
this.form.pictureName = res.data[0].fileName this.form.pictureName = res.data[0].fileName
this.form.pictureOriginalName = res.data[0].fileOriginalName this.form.pictureOriginalName = res.data[0].fileOriginalName
this.form.pictureSize = res.data[0].fileSize this.form.pictureSize = res.data[0].fileSize
this.form.picturePath = res.data[0].filePath this.form.imgFilePath = res.data[0].filePath
}, },
beforeAvatarUpload (file) { beforeAvatarUpload (file) {
console.log(file) console.log(file)
...@@ -214,24 +210,28 @@ export default { ...@@ -214,24 +210,28 @@ export default {
} }
return isLt5M return isLt5M
}, },
savePicture () { // 新增 savePicture (myForm) { // 新增
let _this = this this.$refs[myForm].validate((valid) => {
let params = { if (valid) {
'classifyId': _this.classifyId, let _this = this
'pictureMark': _this.form.pictureMark, let params = {
'pictureName': _this.form.pictureName, 'classifyId': _this.classifyId,
'pictureOrder': _this.form.pictureOrder, 'pictureMark': _this.form.pictureMark,
'pictureOriginalName': _this.form.pictureOriginalName, 'pictureName': _this.form.pictureName,
'picturePath': _this.form.picturePath, // 'pictureOrder': _this.form.pictureOrder,
'pictureSize': _this.form.pictureSize 'pictureOriginalName': _this.form.pictureOriginalName,
} 'picturePath': _this.form.imgFilePath,
this.$axios.post('/office/picture/save', params) 'pictureSize': _this.form.pictureSize
.then(function (res) {
if (res === 'OK') {
_this._getPhotoList()
_this.centerDialogVisible = false
} }
}) this.$axios.post('/office/picture/save', params)
.then(function (res) {
if (res === 'OK') {
_this._getPhotoList()
_this.centerDialogVisible = false
}
})
} else { return false }
})
}, },
pictureDel (item) { // 删除 pictureDel (item) { // 删除
this.$confirm('确定删除这条数据吗?', '提示', { this.$confirm('确定删除这条数据吗?', '提示', {
......
...@@ -69,30 +69,26 @@ ...@@ -69,30 +69,26 @@
<el-dialog <el-dialog
title="幸福传递" title="幸福传递"
:visible.sync="centerDialogVisible" :visible.sync="centerDialogVisible"
width="35%" width="40%"
center> center>
<el-form :model="form"> <el-form :model="form" ref="myForm" :rules="$rules.common" :inline-message="true">
<el-form-item label="图片上传" :label-width="formLabelWidth"> <el-form-item label="图片上传" :label-width="formLabelWidth" prop="imgFilePath">
<el-col :sm="24"> <el-col :sm="18">
<el-row class="img_load"> <el-upload
<el-col :sm="18"> class="avatar-uploader"
<el-upload :action="$baseURL + 'warmth/pictureUpdate'"
class="avatar-uploader" name="img"
:action="$baseURL + 'warmth/pictureUpdate'" :show-file-list="false"
name="img" :multiple="true"
:show-file-list="false" :on-success="handleAvatarSuccess"
:multiple="true" :before-upload="beforeAvatarUpload">
:on-success="handleAvatarSuccess" <img v-if="form.imgFilePath" :src="$imgUrl + form.imgFilePath" class="avatar">
:before-upload="beforeAvatarUpload"> <i v-else class="el-icon-plus avatar-uploader-icon"></i>
<img v-if="form.picturePath" :src="$imgUrl + form.picturePath" class="avatar"> </el-upload>
<i v-else class="el-icon-plus avatar-uploader-icon"></i> <p style="font-size: 12px; line-height: 14px">*请上传尺寸为 <em>1920*502</em>,大小不超过5M的图片</p>
</el-upload>
<p style="font-size: 12px; line-height: 14px">*请上传尺寸为 <em>1920*502</em>,大小不超过5M的图片</p>
</el-col>
</el-row>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="标题" :label-width="formLabelWidth"> <el-form-item label="图片名称" :label-width="formLabelWidth">
<el-col :sm="18"> <el-col :sm="18">
<el-input v-model="form.pictureOriginalName" autocomplete="off" disabled="disabled"></el-input> <el-input v-model="form.pictureOriginalName" autocomplete="off" disabled="disabled"></el-input>
</el-col> </el-col>
...@@ -102,11 +98,6 @@ ...@@ -102,11 +98,6 @@
<el-input v-model="form.pictureSize" autocomplete="off" disabled="disabled"></el-input> <el-input v-model="form.pictureSize" autocomplete="off" disabled="disabled"></el-input>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="图片排序" :label-width="formLabelWidth">
<el-col :sm="18">
<el-input-number v-model="form.pictureOrder" controls-position="right" :min="1"></el-input-number>
</el-col>
</el-form-item>
<el-form-item label="备注" :label-width="formLabelWidth"> <el-form-item label="备注" :label-width="formLabelWidth">
<el-col :sm="18"> <el-col :sm="18">
<el-input v-model="form.pictureMark" autocomplete="off"></el-input> <el-input v-model="form.pictureMark" autocomplete="off"></el-input>
...@@ -118,7 +109,7 @@ ...@@ -118,7 +109,7 @@
<el-col :sm="10"> <el-col :sm="10">
<div class="btn-warp"> <div class="btn-warp">
<el-button @click="centerDialogVisible = false">取 消</el-button> <el-button @click="centerDialogVisible = false">取 消</el-button>
<el-button type="danger" @click="savePicture">确 定</el-button> <el-button type="danger" @click="savePicture('myForm')">确 定</el-button>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
...@@ -142,7 +133,7 @@ export default { ...@@ -142,7 +133,7 @@ export default {
form: { form: {
pictureName: '', pictureName: '',
pictureOriginalName: '', pictureOriginalName: '',
picturePath: '', imgFilePath: '',
pictureSize: '', pictureSize: '',
pictureOrder: '', pictureOrder: '',
pictureMark: '' pictureMark: ''
...@@ -185,7 +176,7 @@ export default { ...@@ -185,7 +176,7 @@ export default {
this.form.pictureName = res.data.fileName this.form.pictureName = res.data.fileName
this.form.pictureOriginalName = res.data.fileOriginalName this.form.pictureOriginalName = res.data.fileOriginalName
this.form.pictureSize = res.data.fileSize this.form.pictureSize = res.data.fileSize
this.form.picturePath = res.data.filePath this.form.imgFilePath = res.data.filePath
}, },
beforeAvatarUpload (file) { beforeAvatarUpload (file) {
const isLt5M = file.size / 1024 / 1024 < 5 const isLt5M = file.size / 1024 / 1024 < 5
...@@ -194,24 +185,28 @@ export default { ...@@ -194,24 +185,28 @@ export default {
} }
return isLt5M return isLt5M
}, },
savePicture () { // 新增 savePicture (myForm) { // 新增
let _this = this this.$refs[myForm].validate((valid) => {
let params = { if (valid) {
'classifyId': _this.classifyId, let _this = this
'pictureMark': _this.form.pictureMark, let params = {
'pictureName': _this.form.pictureName, 'classifyId': _this.classifyId,
// 'pictureOrder': _this.form.pictureOrder, 'pictureMark': _this.form.pictureMark,
'pictureOriginalName': _this.form.pictureOriginalName, 'pictureName': _this.form.pictureName,
'picturePath': _this.form.picturePath, // 'pictureOrder': _this.form.pictureOrder,
'pictureSize': _this.form.pictureSize 'pictureOriginalName': _this.form.pictureOriginalName,
} 'picturePath': _this.form.imgFilePath,
this.$axios.post('/warmth/warmthPictureAdd', params) 'pictureSize': _this.form.pictureSize
.then(function (res) {
if (res === 'OK') {
_this._getPhotoList()
_this.centerDialogVisible = false
} }
}) this.$axios.post('/warmth/warmthPictureAdd', params)
.then(function (res) {
if (res === 'OK') {
_this._getPhotoList()
_this.centerDialogVisible = false
}
})
} else { return false }
})
}, },
pictureDel (item) { // 删除 pictureDel (item) { // 删除
this.$confirm('确定删除这条数据吗?', '提示', { this.$confirm('确定删除这条数据吗?', '提示', {
......
...@@ -175,7 +175,7 @@ export default { ...@@ -175,7 +175,7 @@ export default {
author: '' author: ''
}, },
currentPage: 1, currentPage: 1,
pageSize: 5, pageSize: 10,
totalPage: null, totalPage: null,
bookList: [], bookList: [],
bookDialogVisible: false, bookDialogVisible: false,
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<el-button @click="searchRestaurant">搜索</el-button> <el-button @click="searchRestaurant">搜索</el-button>
</el-form-item> </el-form-item>
<el-form-item style="float: right"> <el-form-item style="float: right">
<el-button type="primary"><router-link to="/restaurant/restaurantAdd" style="color: #fff">新增餐厅</router-link></el-button> <el-button type="primary" class="el-button-link"><router-link to="/restaurant/restaurantAdd" style="color: #fff">新增餐厅</router-link></el-button>
<el-button size="small" class="el-button-link"> <el-button size="small" class="el-button-link">
<a :href="$baseURL + '/diningroom/export/?diningRoomName=' + diningRoomName + '&provinceId=' + provinceId + '&cityId=' + cityId">导出</a> <a :href="$baseURL + '/diningroom/export/?diningRoomName=' + diningRoomName + '&provinceId=' + provinceId + '&cityId=' + cityId">导出</a>
</el-button> </el-button>
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination" v-if="restaurantList.length > 0"> <div class="pagination" v-if="restaurantList.length">
<el-pagination <el-pagination
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
...@@ -114,31 +114,27 @@ ...@@ -114,31 +114,27 @@
:visible.sync="restaurantImgDialogVisible" :visible.sync="restaurantImgDialogVisible"
width="40%" width="40%"
center> center>
<el-form label-width="100px"> <el-form :model="ruleForm" label-width="100px" ref="myForm" :rules="$rules.common" :inline-message="true">
<el-form-item label="图片上传"> <el-form-item label="图片上传" prop="imgFilePath">
<el-col :sm="24"> <el-col :sm="18">
<el-row class="img_load"> <el-upload
<el-col :sm="18"> class="avatar-uploader"
<el-upload :action="$baseURL + 'diningroom/menu/upload'"
class="avatar-uploader" :show-file-list="false"
action="http://10.2.98.32:8081/admin/diningroom/menu/upload" :on-success="handleAvatarSuccess">
:show-file-list="false" <img v-if="ruleForm.imgFilePath" :src="$imgUrl + ruleForm.imgFilePath" class="avatar">
:on-success="handleAvatarSuccess"> <i v-else class="el-icon-plus avatar-uploader-icon"></i>
<img v-if="imageUrl" :src="$imgUrl + imageUrl" class="avatar"> </el-upload>
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-col>
</el-row>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="名称"> <el-form-item label="名称">
<el-col :sm="8"> <el-col :sm="8">
<el-input v-model="resImgName" disabled="disabled"></el-input> <el-input v-model="ruleForm.resImgName" disabled="disabled"></el-input>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="日期"> <el-form-item label="日期">
<el-col :sm="8"> <el-col :sm="8">
<el-date-picker style="width: 100%" v-model="imgDate" type="date" value-format="yyyy-MM-dd" placeholder="选择日期"> <el-date-picker style="width: 100%" v-model="ruleForm.imgDate" type="date" value-format="yyyy-MM-dd" placeholder="选择日期">
</el-date-picker> </el-date-picker>
</el-col> </el-col>
</el-form-item> </el-form-item>
...@@ -148,7 +144,7 @@ ...@@ -148,7 +144,7 @@
<el-col :sm="10"> <el-col :sm="10">
<div class="btn-warp"> <div class="btn-warp">
<el-button @click="restaurantImgDialogVisible = false" class="mr30">取 消</el-button> <el-button @click="restaurantImgDialogVisible = false" class="mr30">取 消</el-button>
<el-button type="danger" @click="addNewResImg">确 定</el-button> <el-button type="danger" @click="addNewResImg('myForm')">确 定</el-button>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
...@@ -159,7 +155,7 @@ ...@@ -159,7 +155,7 @@
<script> <script>
export default { export default {
name: 'ationalRestaurant', name: 'rationalRestaurant',
data () { data () {
return { return {
provinceId: '', provinceId: '',
...@@ -173,9 +169,11 @@ export default { ...@@ -173,9 +169,11 @@ export default {
pageSize: 10, pageSize: 10,
totalPage: null, totalPage: null,
restaurantImgDialogVisible: false, restaurantImgDialogVisible: false,
imageUrl: '', ruleForm: {
imgDate: '', imgFilePath: '',
resImgName: '', resImgName: '',
imgDate: ''
},
diningRoomId: '', diningRoomId: '',
diningRoomNameDia: '' diningRoomNameDia: ''
} }
...@@ -265,27 +263,31 @@ export default { ...@@ -265,27 +263,31 @@ export default {
this.diningRoomNameDia = item.diningRoomName this.diningRoomNameDia = item.diningRoomName
}, },
handleAvatarSuccess (res, file) { // 图片上传 handleAvatarSuccess (res, file) { // 图片上传
this.imageUrl = res.data.filePath this.ruleForm.imgFilePath = res.data.filePath
this.resImgName = res.data.fileOriginalName this.ruleForm.resImgName = res.data.fileOriginalName
}, },
addNewResImg () { // 添加餐厅菜单 addNewResImg (myForm) { // 添加餐厅菜单
let _this = this this.$refs[myForm].validate((valid) => {
let params = { if (valid) {
'diningRoomId': _this.diningRoomId, let _this = this
'menuDate': _this.imgDate, let params = {
'menuUrl': _this.imageUrl, 'diningRoomId': _this.diningRoomId,
'type': 2 'menuDate': _this.ruleForm.imgDate,
} 'menuUrl': _this.ruleForm.imgFilePath,
this.$axios.post('/diningroom/menu/add', params) 'type': 2
.then(function (res) {
if (res === 'ok') {
_this.$message({
type: 'success',
message: '菜单添加成功!'
})
_this.$router.push({ name: 'restaurantMenus' })
} }
}) this.$axios.post('/diningroom/menu/add', params)
.then(function (res) {
if (res === 'ok') {
_this.$message({
type: 'success',
message: '菜单添加成功!'
})
_this.$router.push({ name: 'restaurantMenus' })
}
})
} else { return false }
})
} }
} }
} }
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
<el-col :span="3" :offset="2"> <el-col :span="3" :offset="2">
<el-row type="flex" justify="space-between"> <el-row type="flex" justify="space-between">
<el-col :sm="2"> <el-col :sm="2">
<el-button size="small">取消</el-button> <el-button size="small" @click="$router.go(-1)">取消</el-button>
</el-col> </el-col>
<el-col :sm="2"> <el-col :sm="2">
<el-button type="danger" size="small" @click="saveHandle" v-if="!$route.params.itemObj">确 认</el-button> <el-button type="danger" size="small" @click="saveHandle" v-if="!$route.params.itemObj">确 认</el-button>
......
...@@ -160,17 +160,18 @@ ...@@ -160,17 +160,18 @@
</el-form-item> </el-form-item>
<el-form-item label="所在经度"> <el-form-item label="所在经度">
<el-col :sm="4"> <el-col :sm="4">
<el-input v-model="Latitude"></el-input> <el-input v-model="longitude"></el-input>
</el-col> </el-col>
<el-col :sm="5" :offset="1"> <el-col :sm="5">
<div style="position: relative; width: 100%; height: 100%"> <div style="position: relative; width: 450px; height: 100%">
<div class="map" id="map" ref="allmap" style="width: 100%; height: 200px; position: absolute"></div> <el-button type="text" style="position: absolute; left: 20px; top: 0" icon="el-icon-refresh" @click="searchMap"></el-button>
<div class="map" id="map" ref="allmap" style="width: 100%; height: 200px; position: absolute; left: 60px"></div>
</div> </div>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="所在纬度"> <el-form-item label="所在纬度">
<el-col :sm="4"> <el-col :sm="4">
<el-input v-model="longitude"></el-input> <el-input v-model="latitude"></el-input>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="餐厅名称"> <el-form-item label="餐厅名称">
...@@ -190,7 +191,7 @@ ...@@ -190,7 +191,7 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-col :sm="4" style="text-align: center"> <el-col :sm="4" style="text-align: center">
<el-button class="mr30">取消</el-button> <el-button class="mr30" @click="$router.go(-1)">取消</el-button>
<el-button type="danger" v-if="$route.params.itemObj" @click="updataRestaurantHandle">保存</el-button> <el-button type="danger" v-if="$route.params.itemObj" @click="updataRestaurantHandle">保存</el-button>
<el-button type="danger" v-if="!$route.params.itemObj" @click="saveRestaurantHandle">确认</el-button> <el-button type="danger" v-if="!$route.params.itemObj" @click="saveRestaurantHandle">确认</el-button>
</el-col> </el-col>
...@@ -210,8 +211,8 @@ export default { ...@@ -210,8 +211,8 @@ export default {
cityId: '', cityId: '',
countyName: '', countyName: '',
detailedAddress: '', detailedAddress: '',
Latitude: '', longitude: '', // 经度
longitude: '', latitude: '', // 维度
restaurantName: '', restaurantName: '',
responsibleMan: '', responsibleMan: '',
contactWay: '', contactWay: '',
...@@ -224,18 +225,24 @@ export default { ...@@ -224,18 +225,24 @@ export default {
} }
}, },
mounted () { mounted () {
this.createMap() this.createMap(116.404, 39.915)
this._getProvinceList() this._getProvinceList()
this._getRestaurantDetail() this._getRestaurantDetail()
}, },
methods: { methods: {
createMap () { createMap (longitude, latitude) {
/* eslint-disable */ /* eslint-disable */
var map = new BMap.Map('map') // 创建地图实例 let map = new BMap.Map('map')
var point = new BMap.Point(116.404, 39.915) // 创建点坐标 map.enableScrollWheelZoom(true)
map.centerAndZoom(point, 15) let point = new BMap.Point(longitude, latitude)
let marker = new BMap.Marker(point) // 创建标注
map.addOverlay(marker) // 将标注添加到地图中
map.centerAndZoom(point, 12)
/* eslint-disable */ /* eslint-disable */
}, },
searchMap () { // 更新地图坐标
this.createMap(this.longitude, this.latitude)
},
_getProvinceList () { // 获取省份列表 _getProvinceList () { // 获取省份列表
let _this = this let _this = this
this.$axios.get('/diningroom/province/list') this.$axios.get('/diningroom/province/list')
...@@ -351,8 +358,8 @@ export default { ...@@ -351,8 +358,8 @@ export default {
"cityId": _this.cityId, "cityId": _this.cityId,
"countyName": _this.countyName, "countyName": _this.countyName,
"diningRoomName": _this.restaurantName, "diningRoomName": _this.restaurantName,
"lat": _this.Latitude,
"lng": _this.longitude, "lng": _this.longitude,
"lat": _this.latitude,
"personMobile": _this.contactWay, "personMobile": _this.contactWay,
"personName": _this.responsibleMan, "personName": _this.responsibleMan,
"provinceId": _this.selectProvinceId "provinceId": _this.selectProvinceId
...@@ -364,7 +371,7 @@ export default { ...@@ -364,7 +371,7 @@ export default {
type: 'success', type: 'success',
message: '添加成功!' message: '添加成功!'
}) })
// _this.$router.go(-1) _this.$router.go(-1)
} }
}) })
}, },
...@@ -374,11 +381,12 @@ export default { ...@@ -374,11 +381,12 @@ export default {
this.cityId = this.$route.params.itemObj.cityId this.cityId = this.$route.params.itemObj.cityId
this.countyName = this.$route.params.itemObj.countyName this.countyName = this.$route.params.itemObj.countyName
this.detailedAddress = this.$route.params.itemObj.address this.detailedAddress = this.$route.params.itemObj.address
this.Latitude = this.$route.params.itemObj.lat this.latitude = this.$route.params.itemObj.lat
this.longitude = this.$route.params.itemObj.lng this.longitude = this.$route.params.itemObj.lng
this.restaurantName = this.$route.params.itemObj.diningRoomName this.restaurantName = this.$route.params.itemObj.diningRoomName
this.responsibleMan = this.$route.params.itemObj.personName this.responsibleMan = this.$route.params.itemObj.personName
this.contactWay = this.$route.params.itemObj.personMobile this.contactWay = this.$route.params.itemObj.personMobile
this.createMap(this.longitude, this.latitude)
} }
}, },
updataRestaurantHandle () { // 修改 updataRestaurantHandle () { // 修改
...@@ -402,6 +410,7 @@ export default { ...@@ -402,6 +410,7 @@ export default {
type: 'success', type: 'success',
message: '修改成功!' message: '修改成功!'
}) })
_this.$router.go(-1)
} }
}) })
} }
......
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
<el-col :sm="5"> <el-col :sm="5">
<el-upload <el-upload
class="avatar-uploader" class="avatar-uploader"
:action="$uploaderUrl + '/diningroom/picture/upload'" :action="$baseURL + '/diningroom/picture/upload'"
:show-file-list="false" :show-file-list="false"
:multiple="true" :multiple="true"
name="files" name="files"
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
<el-col :span="3" :offset="2"> <el-col :span="3" :offset="2">
<el-row type="flex" justify="space-between"> <el-row type="flex" justify="space-between">
<el-col :sm="2"> <el-col :sm="2">
<el-button size="small">取消</el-button> <el-button size="small" @click="$router.go(-1)">取消</el-button>
</el-col> </el-col>
<el-col :sm="2"> <el-col :sm="2">
<el-button type="danger" size="small" @click="saveHandle">确认</el-button> <el-button type="danger" size="small" @click="saveHandle">确认</el-button>
......
...@@ -95,19 +95,15 @@ ...@@ -95,19 +95,15 @@
center> center>
<el-form label-width="100px"> <el-form label-width="100px">
<el-form-item label="图片上传"> <el-form-item label="图片上传">
<el-col :sm="24"> <el-col :sm="18">
<el-row class="img_load"> <el-upload
<el-col :sm="18"> class="avatar-uploader"
<el-upload action="http://10.2.98.32:8081/admin/diningroom/menu/upload"
class="avatar-uploader" :show-file-list="false"
action="http://10.2.98.32:8081/admin/diningroom/menu/upload" :on-success="handleAvatarSuccess">
:show-file-list="false" <img v-if="imageUrl" :src="$imgUrl + imageUrl" class="avatar">
:on-success="handleAvatarSuccess"> <i v-else class="el-icon-plus avatar-uploader-icon"></i>
<img v-if="imageUrl" :src="$imgUrl + imageUrl" class="avatar"> </el-upload>
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-col>
</el-row>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="日期"> <el-form-item label="日期">
...@@ -141,7 +137,7 @@ export default { ...@@ -141,7 +137,7 @@ export default {
diningRoomName: '', diningRoomName: '',
menuImg: [], menuImg: [],
currentPage: 1, currentPage: 1,
pageSize: 5, pageSize: 10,
totalPage: null, totalPage: null,
imgDialogVisible: false, imgDialogVisible: false,
bigImg: '', bigImg: '',
......
...@@ -116,7 +116,7 @@ export default { ...@@ -116,7 +116,7 @@ export default {
termYear: '', termYear: '',
solarTerm: '', solarTerm: '',
currentPage: 1, currentPage: 1,
pageSize: 5, pageSize: 10,
totalPage: null, totalPage: null,
solarList: [] solarList: []
} }
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="行政对接人"> <!-- <el-form-item label="行政对接人">
<el-col :sm="4"> <el-col :sm="4">
<el-input v-model="docking"></el-input> <el-input v-model="docking"></el-input>
</el-col> </el-col>
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
</el-col> </el-col>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form-item> </el-form-item>-->
<el-form-item label="房型&价格"> <el-form-item label="房型&价格">
<el-col :sm="11"> <el-col :sm="11">
<div class="room_warp"> <div class="room_warp">
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="是否合同期内"> <!--<el-form-item label="是否合同期内">
<el-col :sm="4"> <el-col :sm="4">
<el-select v-model="contractperiod" style="width: 100%"> <el-select v-model="contractperiod" style="width: 100%">
<el-option label="是" value="0"></el-option> <el-option label="是" value="0"></el-option>
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
</el-col> </el-col>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form-item> </el-form-item>-->
<el-form-item label="备注"> <el-form-item label="备注">
<el-col :sm="11"> <el-col :sm="11">
<el-input type="textarea" v-model="remarks" :rows="5"></el-input> <el-input type="textarea" v-model="remarks" :rows="5"></el-input>
...@@ -209,14 +209,15 @@ export default { ...@@ -209,14 +209,15 @@ export default {
_this.contactsphone = res[0].contactsphone _this.contactsphone = res[0].contactsphone
_this.person = res[0].person _this.person = res[0].person
_this.persontel = res[0].persontel _this.persontel = res[0].persontel
_this.docking = res[0].docking // _this.docking = res[0].docking
_this.dockingphone = res[0].dockingphone // _this.dockingphone = res[0].dockingphone
_this.classMap = res[0].classMap _this.classMap = res[0].classMap
_this.starclass = res[0].starclass _this.starclass = res[0].starclass
_this.isrecommend = res[0].isrecommend _this.isrecommend = res[0].isrecommend
_this.contractperiod = res[0].contractperiod _this.contractperiod = res[0].contractperiod
_this.termofvalidity = res[0].termofvalidity _this.termofvalidity = res[0].termofvalidity
_this.remarks = res[0].remarks _this.remarks = res[0].remarks
_this.createMap(_this.longitude, _this.latitudel)
}) })
} }
}, },
...@@ -253,8 +254,8 @@ export default { ...@@ -253,8 +254,8 @@ export default {
'contacts': _this.contacts, 'contacts': _this.contacts,
'contactsphone': _this.contactsphone, 'contactsphone': _this.contactsphone,
'contractperiod': _this.contractperiod, 'contractperiod': _this.contractperiod,
'docking': _this.docking, // 'docking': _this.docking,
'dockingphone': _this.dockingphone, // 'dockingphone': _this.dockingphone,
'hotelname': _this.hotelname, 'hotelname': _this.hotelname,
'isrecommend': _this.isrecommend, 'isrecommend': _this.isrecommend,
'latitudel': _this.latitudel, 'latitudel': _this.latitudel,
...@@ -288,8 +289,8 @@ export default { ...@@ -288,8 +289,8 @@ export default {
'contacts': _this.contacts, 'contacts': _this.contacts,
'contactsphone': _this.contactsphone, 'contactsphone': _this.contactsphone,
'contractperiod': _this.contractperiod, 'contractperiod': _this.contractperiod,
'docking': _this.docking, // 'docking': _this.docking,
'dockingphone': _this.dockingphone, // 'dockingphone': _this.dockingphone,
'hotelname': _this.hotelname, 'hotelname': _this.hotelname,
'isrecommend': _this.isrecommend, 'isrecommend': _this.isrecommend,
'latitudel': _this.latitudel, 'latitudel': _this.latitudel,
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<el-form-item> <el-form-item>
<el-select v-model="starclass" placeholder="星级"> <el-select v-model="starclass" placeholder="星级">
<el-option label="快捷" value="快捷"></el-option> <el-option label="快捷" value="快捷"></el-option>
<el-option label="商务" value="商务"></el-option>
<el-option label="三星" value="三星"></el-option> <el-option label="三星" value="三星"></el-option>
<el-option label="四星" value="四星"></el-option> <el-option label="四星" value="四星"></el-option>
<el-option label="五星" value="五星"></el-option> <el-option label="五星" value="五星"></el-option>
...@@ -121,6 +122,15 @@ ...@@ -121,6 +122,15 @@
label="星级"> label="星级">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="isrecommend"
align="center"
width="100"
label="是否推荐">
<template slot-scope="scope">
<span v-if="scope.row.isrecommend">{{scope.row.isrecommend === '0' ? '是' : '否'}}</span>
</template>
</el-table-column>
<el-table-column
prop="handleMan" prop="handleMan"
align="center" align="center"
width="100" width="100"
......
<template> <template>
<div class="commonSense"> <div class="commonSense">
<el-row class="title-warp mb15" type="flex" justify="center"> <el-row class="title-warp mb20" type="flex" justify="center">
<el-col :sm="6"> <el-col :sm="6">
<el-input v-model="title" placeholder="请输入内容" size="medium"></el-input> <!--<el-input v-model="title" placeholder="请输入内容" size="medium" disabled="disabled"></el-input>-->
<h3>{{title}}</h3>
</el-col> </el-col>
</el-row> </el-row>
<div class="mb20"> <div class="mb20">
......
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
<el-col :span="3" :offset="2"> <el-col :span="3" :offset="2">
<el-row type="flex" justify="space-between"> <el-row type="flex" justify="space-between">
<el-col :sm="2"> <el-col :sm="2">
<el-button size="small">取消</el-button> <el-button size="small" @click="$router.go(-1)">取消</el-button>
</el-col> </el-col>
<el-col :sm="2"> <el-col :sm="2">
<el-button type="danger" size="small" @click="save">确认</el-button> <el-button type="danger" size="small" @click="save">确认</el-button>
...@@ -113,12 +113,12 @@ export default { ...@@ -113,12 +113,12 @@ export default {
data () { data () {
return { return {
laundryId: '', laundryId: '',
province: '河北省', province: '',
city: '全部', city: '',
laundryName: '', laundryName: '',
detailAddress: '', detailAddress: '',
longitude: '116.487057', longitude: '',
latitude: '40.004086', latitude: '',
pickWay: '1', pickWay: '1',
contactMan: '', contactMan: '',
contactNumber: '', contactNumber: '',
...@@ -137,12 +137,14 @@ export default { ...@@ -137,12 +137,14 @@ export default {
}, },
methods: { methods: {
createMap (longitude, latitude) { createMap (longitude, latitude) {
/* eslint-disable */
let map = new BMap.Map('map') let map = new BMap.Map('map')
map.enableScrollWheelZoom(true) map.enableScrollWheelZoom(true)
let point = new BMap.Point(longitude, latitude) let point = new BMap.Point(longitude, latitude)
let marker = new BMap.Marker(point) // 创建标注 let marker = new BMap.Marker(point) // 创建标注
map.addOverlay(marker) // 将标注添加到地图中 map.addOverlay(marker) // 将标注添加到地图中
map.centerAndZoom(point, 15) map.centerAndZoom(point, 15)
/* eslint-disable */
}, },
searchMap () { // 更新地图坐标 searchMap () { // 更新地图坐标
this.createMap(this.longitude, this.latitude) this.createMap(this.longitude, this.latitude)
...@@ -195,24 +197,25 @@ export default { ...@@ -195,24 +197,25 @@ export default {
} }
this.$axios.post('/laundry/add', params) this.$axios.post('/laundry/add', params)
.then(function (res) { .then(function (res) {
if (res === 'OK') { if (res) {
_this.$message({ _this.$message({
type: 'success', type: 'success',
message: '添加成功!' message: '添加成功!'
}) })
_this.province = '' _this.$router.go(-1)
_this.city = '' // _this.province = ''
_this.laundryName = '' // _this.city = ''
_this.detailAddress = '' // _this.laundryName = ''
_this.longitude = '' // _this.detailAddress = ''
_this.latitude = '' // _this.longitude = ''
_this.pickWay = '' // _this.latitude = ''
_this.contactMan = '' // _this.pickWay = ''
_this.contactNumber = '' // _this.contactMan = ''
_this.principal = '' // _this.contactNumber = ''
_this.principalNumber = '' // _this.principal = ''
_this.businessHours = '' // _this.principalNumber = ''
_this.supplier = '' // _this.businessHours = ''
// _this.supplier = ''
} }
}) })
}, },
...@@ -242,6 +245,7 @@ export default { ...@@ -242,6 +245,7 @@ export default {
type: 'success', type: 'success',
message: '修改成功!' message: '修改成功!'
}) })
_this.$router.go(-1)
} }
}) })
} }
......
...@@ -60,6 +60,9 @@ ...@@ -60,6 +60,9 @@
align="center" align="center"
label="送取方式" label="送取方式"
width="100"> width="100">
<template slot-scope="scope">
<span>{{scope.row.pickWay === 1 ? '集中送取' : '自由送取'}}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="detailAddress" prop="detailAddress"
...@@ -124,7 +127,7 @@ export default { ...@@ -124,7 +127,7 @@ export default {
laundryName: '' laundryName: ''
}, },
currentPage: 1, currentPage: 1,
pageSize: 8, pageSize: 10,
totalPage: null, totalPage: null,
tableData: [] tableData: []
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment