Commit 7578710d by dongjipeng

完成部分接口

parent 9abf1073
# element-pro # happiness-plus-platform-admin1
## Project setup ## Project setup
``` ```
......
This source diff could not be displayed because it is too large. You can view the blob instead.
{ {
"name": "element-pro", "name": "happiness-plus-platform-admin1",
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
"dependencies": { "dependencies": {
"axios": "^0.19.0", "axios": "^0.19.0",
"core-js": "^2.6.5", "core-js": "^2.6.5",
"element-theme": "^2.0.1",
"element-ui": "^2.4.11", "element-ui": "^2.4.11",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-quill-editor": "^3.0.6", "vue-quill-editor": "^3.0.6",
...@@ -18,16 +17,15 @@ ...@@ -18,16 +17,15 @@
"vuex": "^3.0.1" "vuex": "^3.0.1"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "^3.8.0", "@vue/cli-plugin-babel": "^3.9.0",
"@vue/cli-plugin-eslint": "^3.8.0", "@vue/cli-plugin-eslint": "^3.9.0",
"@vue/cli-service": "^3.8.0", "@vue/cli-service": "^3.9.0",
"@vue/eslint-config-standard": "^4.0.0", "@vue/eslint-config-standard": "^4.0.0",
"babel-eslint": "^10.0.1", "babel-eslint": "^10.0.1",
"element-theme-chalk": "^2.10.1",
"eslint": "^5.16.0", "eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0", "eslint-plugin-vue": "^5.0.0",
"less": "^3.0.4", "node-sass": "^4.9.0",
"less-loader": "^4.1.0", "sass-loader": "^7.1.0",
"vue-template-compiler": "^2.6.10" "vue-template-compiler": "^2.6.10"
} }
} }
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>幸福+后台</title> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<!--引入百度地图API--> <title>happiness-plus-platform-admin1</title>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=G26QdFgDIQjncc5YduSk2WWo8XE5kMpu" ></script> <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=yi2SzGm0IpVQEkcCG4y3ioGG" ></script>
</head> </head>
<body> <body>
<noscript> <noscript>
<strong>We're sorry but element-pro doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> <strong>We're sorry but happiness-plus-platform-admin1 doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
......
...@@ -12,5 +12,3 @@ export default { ...@@ -12,5 +12,3 @@ export default {
name: 'app' name: 'app'
} }
</script> </script>
<style lang="less">
</style>
...@@ -3,8 +3,10 @@ ...@@ -3,8 +3,10 @@
.img-warp {overflow: hidden; position: relative; .img-warp {overflow: hidden; position: relative;
img {width: 100%; height: auto; max-height: 100%} img {width: 100%; height: auto; max-height: 100%}
} }
.pagination {padding: 20px 0; text-align: center}
/* /*
element ui样式重置 element ui样式重置
*/ */
.el-table__body tr:hover>td {background-color: #ffffff !important} .el-table__body tr:hover>td {background-color: #ffffff !important}
.el-tooltip__popper{ max-width: 30% } .el-tooltip__popper{ max-width: 30% }
.el-button--small {font-size: 14px; padding-top: 8px; padding-bottom: 8px;}
html, body {width: 100%; height: 100%}
html, body, ul, li, ol, dl, dd, dt, p, h1, h2, h3, h4, h5, h6, form, fieldset, legend, img { margin:0; padding:0; }
fieldset, img { border:none; }
img{display: block;}
address, caption, cite, code, dfn, th, var { font-style:normal; font-weight:normal; }
ul, ol { list-style:none; }
input { padding-top:0; padding-bottom:0; font-family: "SimSun","宋体";}
input::-moz-focus-inner { border:none; padding:0; }
select, input { vertical-align:middle; }
select, input, textarea { font-size:12px; margin:0; }
input[type="text"], input[type="password"], textarea { outline-style:none; -webkit-appearance:none; }
textarea { resize:none; }
input,textarea{background: none; border: none;}
table { border-collapse:collapse; }
body { width: 100%; margin: 0 auto; color:#333; background:#fff; }
html, select, input, textarea {font-family: "FZLanTingHei-L-GBK", "Helvetica Neue", "微软雅黑", "黑体", Helvetica, STHeiTi, sans-serif;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);}
a { color:#666; text-decoration:none; }
a:visited { color:#1a1a1a; }
a:hover, a:active, a:focus {text-decoration:none; }
i, em, b {font-style: normal}
button {outline: none; border: none; background: transparent; cursor: pointer}
/*placeholder*/
::-webkit-input-placeholder {
color: #999;
font-size: 14px;
}
::-moz-placeholder {
color: #999;
font-size: 14px;
}
:-ms-input-placeholder {
color: #999;
font-size: 14px;
}
/*common*/
.link {color: #409EFF !important; text-decoration: underline; font-size: 12px}
/* align */
.tc {text-align: center}
.tl {text-align: left}
.tr {text-align: right}
/* margin */
.mt10 {margin-top: 10px;}
.mt30 {margin-top: 30px;}
.mt50 {margin-top: 50px;}
.mb10 {margin-bottom: 10px;}
.mb15 {margin-bottom: 15px;}
.mb20 {margin-bottom: 20px;}
.mb30 {margin-bottom: 30px;}
.mr30 {margin-right: 30px;}
.ml30 {margin-left: 30px;}
/*padding*/
.pl20 {padding-left: 30px}
/*float*/
.fl {float: left}
.fr {float: right}
...@@ -13,9 +13,9 @@ export default { ...@@ -13,9 +13,9 @@ export default {
} }
</script> </script>
<style scoped lang="less"> <style scoped lang="scss">
.guide_box {width: 100%;height: 100%; position: relative;overflow: hidden; .guide_box {width: 100%;height: 100%; position: relative;
.guide_inner {position: absolute; left: 50%; transform: translateX(-50%); top: 120px; .guide_inner {position: absolute; left: 50%; transform: translateX(-50%); top: 120px; z-index: 100;
em, img {display: inline-block; vertical-align: middle} em, img {display: inline-block; vertical-align: middle}
em {font-style: normal; font-size: 30px;} em {font-style: normal; font-size: 30px;}
img {width: 200px; height: auto} img {width: 200px; height: auto}
......
...@@ -17,7 +17,7 @@ export default { ...@@ -17,7 +17,7 @@ export default {
} }
</script> </script>
<style scoped lang="less"> <style scoped lang="scss">
.header { .header {
height: 70px!important; height: 70px!important;
padding: 0 17px; padding: 0 17px;
......
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
</script> </script>
<!-- Add "scoped" attribute to limit CSS to this component only --> <!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less"> <style scoped lang="scss">
h3 { h3 {
margin: 40px 0 0; margin: 40px 0 0;
} }
......
...@@ -7,13 +7,13 @@ ...@@ -7,13 +7,13 @@
menu-trigger="hover" menu-trigger="hover"
:default-active="$route.path" :default-active="$route.path"
:router="true" :router="true"
style="height: 100%"
:unique-opened="true" :unique-opened="true"
style="height: 100%"
active-text-color="#4A90E2"> active-text-color="#4A90E2">
<el-submenu index="1"> <el-submenu index="1">
<template slot="title"><i class="el-icon-message"></i>首页管理</template> <template slot="title"><i class="el-icon-message"></i>首页管理</template>
<el-menu-item index="/home/bannerManage">banner管理</el-menu-item> <el-menu-item index="/home/bannerManage">banner管理</el-menu-item>
<el-menu-item index="/home/activityPropaganda">活动宣传</el-menu-item> <el-menu-item :index="'/home/' + activityPath">活动宣传</el-menu-item>
<el-menu-item index="/home/commonLink">常用链接</el-menu-item> <el-menu-item index="/home/commonLink">常用链接</el-menu-item>
<el-menu-item index="/home/messageManagement">留言管理</el-menu-item> <el-menu-item index="/home/messageManagement">留言管理</el-menu-item>
</el-submenu> </el-submenu>
...@@ -71,6 +71,10 @@ ...@@ -71,6 +71,10 @@
<el-menu-item index="/restaurant/solarCalendar">节气日历</el-menu-item> <el-menu-item index="/restaurant/solarCalendar">节气日历</el-menu-item>
<el-menu-item index="/restaurant/themeActivities">主题活动</el-menu-item> <el-menu-item index="/restaurant/themeActivities">主题活动</el-menu-item>
</el-submenu> </el-submenu>
<el-menu-item index="/office"><i class="el-icon-setting"></i>幸福办公</el-menu-item>
<el-menu-item index="/mom"><i class="el-icon-setting"></i>萌妈工作室</el-menu-item>
<el-menu-item index="/pass"><i class="el-icon-setting"></i>幸福传递</el-menu-item>
<el-menu-item index="/community"><i class="el-icon-setting"></i>幸福社团</el-menu-item>
</el-menu> </el-menu>
</el-aside> </el-aside>
<el-main class="main"> <el-main class="main">
...@@ -111,6 +115,15 @@ export default { ...@@ -111,6 +115,15 @@ export default {
} }
} }
}, },
computed: {
activityPath () {
if (this.$route.path === '/home/textEditing') {
return 'textEditing'
} else {
return 'activityPropaganda'
}
}
},
watch: { watch: {
$route (to, from) { $route (to, from) {
this.getRouter() this.getRouter()
...@@ -124,9 +137,9 @@ export default { ...@@ -124,9 +137,9 @@ export default {
} }
</script> </script>
<style scoped lang="less"> <style scoped lang="scss">
.el_content {padding-top: 70px; width: 100%; box-sizing: border-box} .el_content {padding-top: 70px; width: 100%; box-sizing: border-box}
.main {background: #E5E9F2; .main {background: #E5E9F2;
.main_inner {padding: 20px 30px; box-sizing: border-box; background-color: #ffffff; height: calc(100% - 34px)} .main_inner {padding: 20px 30px; box-sizing: border-box; background-color: #ffffff; min-height: calc(100% - 34px)}
} }
</style> </style>
<template>
<div class="pagination">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-size="pageSize"
layout="prev, pager, next"
:total="totalPage">
</el-pagination>
</div>
</template>
<script>
export default {
name: 'Pagination',
props: ['currentPage', 'pageSize', 'totalPage']
}
</script>
<style scoped>
</style>
...@@ -35,6 +35,6 @@ export default { ...@@ -35,6 +35,6 @@ export default {
} }
</script> </script>
<style scoped lang="less"> <style scoped lang="scss">
.app-breadcrumb {margin-bottom: 20px} .app-breadcrumb {margin-bottom: 20px}
</style> </style>
/* 改变主题色变量 */
$--color-primary: #008fbd;
$--color-danger: #BD4C4C;
/* 改变 icon 字体路径变量,必需 */
$--font-path: '~element-ui/lib/theme-chalk/fonts';
@import "~element-ui/packages/theme-chalk/src/index";
...@@ -9,13 +9,14 @@ import 'quill/dist/quill.core.css' ...@@ -9,13 +9,14 @@ import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css' import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css' import 'quill/dist/quill.bubble.css'
import ElementUi from 'element-ui' import ElementUi from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css' import './element-variables.scss'
import '../src/assets/css/reset.css' import '../src/assets/css/reset.scss'
import '../src/assets/css/main.less' import '../src/assets/css/main.scss'
Vue.use(VueQuillEditor) Vue.use(VueQuillEditor)
Vue.use(ElementUi) Vue.use(ElementUi)
Vue.prototype.$axios = axios Vue.prototype.$axios = axios
Vue.prototype.$qs = QS Vue.prototype.$qs = QS
Vue.prototype.$imgUrl = 'http://10.2.98.32:8081/images/'
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'
......
import Vue from 'vue' import Vue from 'vue'
import Router from 'vue-router' import Router from 'vue-router'
import Layout from './components/Layout.vue' import Layout from './components/Layout.vue'
import Guide from './components/Guide'
import Home from './views/home/index' import Home from './views/home/index'
import BannerManage from './views/home/BannerManage' import BannerManage from './views/home/BannerManage'
...@@ -26,6 +25,14 @@ import Fitness from './views/fitness/index' ...@@ -26,6 +25,14 @@ import Fitness from './views/fitness/index'
import EventCalendar from './views/fitness/EventCalendar' import EventCalendar from './views/fitness/EventCalendar'
import HappyRunning from './views/fitness/HappyRunning' import HappyRunning from './views/fitness/HappyRunning'
import Office from './views/office/index'
import Mom from './views/mom/index'
import Pass from './views/pass/index'
import Community from './views/community/index'
Vue.use(Router) Vue.use(Router)
export default new Router({ export default new Router({
...@@ -170,6 +177,38 @@ export default new Router({ ...@@ -170,6 +177,38 @@ export default new Router({
] ]
}, },
{ {
path: '/office',
name: 'office',
component: Office,
meta: {
title: '无忧办公'
}
},
{
path: '/mom',
name: 'mom',
component: Mom,
meta: {
title: '萌妈工作室'
}
},
{
path: '/pass',
name: 'pass',
component: Pass,
meta: {
title: '幸福传递'
}
},
{
path: '/community',
name: 'community',
component: Community,
meta: {
title: '幸福传递'
}
},
{
path: '/fitness', path: '/fitness',
name: 'fitness', name: 'fitness',
component: Fitness, component: Fitness,
......
<template>
<div>GoodHarvest</div>
</template>
<script>
export default {
name: 'goodHarvest'
}
</script>
<style scoped>
</style>
<template>
<div>Maintenance</div>
</template>
<script>
export default {
name: 'maintenance'
}
</script>
<style scoped>
</style>
<template>
<div>Picking</div>
</template>
<script>
export default {
name: 'picking'
}
</script>
<style scoped>
</style>
<template>
<div>
<el-form ref="form">
<el-form-item label="活动状态:">
<el-col :sm="5">{{status}}</el-col>
</el-form-item>
<el-form-item label="活动期限:">
<el-col :span="3">
<el-date-picker type="datetime" placeholder="选择日期" v-model="startTime" style="width: 100%;"></el-date-picker>
</el-col>
<el-col class="line tc" :span="1"></el-col>
<el-col :span="3">
<el-date-picker type="datetime" placeholder="选择日期" v-model="endTime" style="width: 100%;"></el-date-picker>
</el-col>
</el-form-item>
<el-form-item label="活动介绍:">
<el-col :sm="6">
<el-upload
class="activity-upload"
action="http://10.2.98.32:8081/farm/activityFileUpdate"
:multiple="false"
:limit="1"
:file-list="introduceFile"
:on-success="introduceHandleAvatarSuccess"
:before-upload="introduceBeforeAvatarUpload">
<el-button size="small" type="text" icon="el-icon-upload2" class="btn-upload"></el-button>
<!--<div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>-->
</el-upload>
</el-col>
</el-form-item>
<el-form-item label="活动指引:">
<el-col :sm="6">
<el-upload
class="activity-upload"
action="http://10.2.98.32:8081/farm/activityFileUpdate"
:limit="1"
:multiple="false"
:file-list="guideFile"
:on-success="guideHandleAvatarSuccess"
:before-upload="guideBeforeAvatarUpload">
<el-button size="small" type="text" icon="el-icon-upload2" class="btn-upload"></el-button>
<!--<div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>-->
</el-upload>
</el-col>
</el-form-item>
<el-form-item label="二维码:">
<el-col :sm="6">
<el-upload
class="avatar-uploader"
action="http://10.2.98.32:8081/farm/activityFileUpdate"
:show-file-list="false"
:on-success="qrcodeHandleAvatarSuccess"
:before-upload="qrcodeBeforeAvatarUpload">
<img v-if="qrcodePath" :src="qrcodePath" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-col>
</el-form-item>
</el-form>
<el-row>
<el-col :span="5" class="tc" style="padding-top: 50px; padding-bottom: 30px">
<el-button type="danger" @click="saveHandle(item)">保 存</el-button>
</el-col>
</el-row>
</div>
</template>
<script>
export default {
name: 'plantingTrees',
data () {
return {
activityType: 1,
status: null,
startTime: '',
endTime: '',
qrcodePath: '',
introduceFile: [],
guideFile: []
}
},
mounted () {
this._getActivityDetail()
},
methods: {
_getActivityDetail (activityType) {
let _this = this
if (activityType) {
_this.activityType = activityType
} else {
_this.activityType = 1
}
this.$axios.get('/farm/activityDetail', {
params: {
'activityType': _this.activityType
}
}).then(function (res) {
_this.status = res.status
console.log(_this.status)
_this.startTime = res.startTime
_this.endTime = res.endTime
_this.qrcodePath = res.qrcodePath
_this.introduceFile = [
{
name: res.guideName,
url: res.guidePath
}
]
_this.guideFile = [
{
name: res.guideName,
url: res.guidePath
}
]
_this.qrcodePath = res.qrcodePath
})
},
introduceHandleAvatarSuccess (file) {
this.qrcodePath = URL.createObjectURL(file.raw)
},
introduceBeforeAvatarUpload () {},
guideHandleAvatarSuccess () {},
guideBeforeAvatarUpload () {},
qrcodeHandleAvatarSuccess () {},
qrcodeBeforeAvatarUpload () {},
saveHandle (item) { // 保存
let _this = this
let params = {
'activityType': _this.activeName,
'startTime': item.startTime,
'endTime': item.endTime,
'introduceFile': _this.file1 ? _this.file1 : item.introduceName,
'guideFile': _this.file2 ? _this.file2 : item.guideName,
'qrcodeFile': _this.file3 ? _this.file3 : item.qrcodeName
}
console.log(params)
this.$axios.post('/farm/activityAdd', params)
.then(function (res) {
console.log(res)
})
}
},
computed: {
activityStatusComp () {
if (this.status === 1) {
return '进行中'
} else if (this.status === 2) {
return '未开启'
} else if (this.status === 3) {
return '已结束'
} else { return false }
},
startTime1 () {
return this.itemData.startTime
},
endTime1 () {
return this.itemData.endTime
},
qrcodePath1 () {
return this.$imgUrl + this.itemData.qrcodePath
},
introduceFile1 () {
let file = []
file.push({
name: this.introduceName,
url: this.introducePath
})
return file
},
guideFile1 () {
let file = []
file.push({
name: this.guideName,
url: this.guidePath
})
return file
}
}
}
</script>
<style scoped>
</style>
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
<el-form-item label="文章类型"> <el-form-item label="文章类型">
<el-col :sm="6" :offset="1"> <el-col :sm="6" :offset="1">
<el-select v-model="form.articleType" style="width: 100%"> <el-select v-model="form.articleType" style="width: 100%">
<el-option label="专题1" value="专题1"></el-option> <el-option label="活动" value="1"></el-option>
<el-option label="专题2" value="专题2"></el-option> <el-option label="专题" value="2"></el-option>
</el-select> </el-select>
</el-col> </el-col>
</el-form-item> </el-form-item>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<el-col :sm="6" :offset="1"> <el-col :sm="6" :offset="1">
<el-button size="small">取消</el-button> <el-button size="small">取消</el-button>
<el-button type="primary" size="small">确认</el-button> <el-button type="primary" size="small">确认</el-button>
<el-button type="danger" size="small">发布</el-button> <el-button type="danger" size="small" @click="send">发布</el-button>
</el-col> </el-col>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -41,6 +41,21 @@ export default { ...@@ -41,6 +41,21 @@ export default {
articleLink: '' articleLink: ''
} }
} }
},
methods: {
send () {
let _this = this
let params = {
'activeStatus': 1,
'activeTitle': _this.form.articleTitle,
'activeType': _this.form.articleType,
'linkUrl': _this.form.articleLink
}
this.$axios.post('/active/add/links', params)
.then(function (res) {
console.log(res)
})
}
} }
} }
</script> </script>
......
...@@ -106,7 +106,7 @@ export default { ...@@ -106,7 +106,7 @@ export default {
} }
</script> </script>
<style lang="less"> <style lang="scss">
.banner-add {padding: 0 30px; box-sizing: border-box} .banner-add {padding: 0 30px; box-sizing: border-box}
.avatar-uploader .el-upload { .avatar-uploader .el-upload {
border: 1px dashed #d9d9d9; border: 1px dashed #d9d9d9;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<el-button type="primary" size="small" @click="addLink">新增链接</el-button> <el-button type="primary" size="small" @click="addLink">新增链接</el-button>
</div> </div>
<el-table <el-table
:data="tableData" :data="linkList"
class="mb20" class="mb20"
:header-cell-style="{'background-color': '#F5F7FA', 'color': '#333', 'line-height': '45px', 'height': '45px', 'padding': 0}" :header-cell-style="{'background-color': '#F5F7FA', 'color': '#333', 'line-height': '45px', 'height': '45px', 'padding': 0}"
style="width: 100%"> style="width: 100%">
...@@ -15,24 +15,24 @@ ...@@ -15,24 +15,24 @@
width="80"> width="80">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="linkName" prop="linksTitle"
align="center" align="center"
label="链接名称" label="链接名称"
width="240"> width="240">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="linkUrl" prop="linksUrl"
align="center" align="center"
label="链接地址"> label="链接地址">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="uploadTime" prop="createTime"
align="center" align="center"
label="上传日期" label="上传日期"
width="160"> width="160">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="uploadMan" prop="createUser"
align="center" align="center"
label="上传人" label="上传人"
width="120"> width="120">
...@@ -43,22 +43,26 @@ ...@@ -43,22 +43,26 @@
width="200"> 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"></el-button> <el-button icon="el-icon-edit" size="small" @click="editLink(scope.row)"></el-button>
<el-switch <!--<el-switch
v-model="scope.row.switchOption.value" v-model="scope.row.switchOption.value"
style="margin: 0 15px" style="margin: 0 15px"
active-color="#13ce66" active-color="#13ce66"
inactive-color="#ff4949"> inactive-color="#ff4949">
</el-switch> </el-switch>-->
<el-button icon="el-icon-delete" size="small"></el-button> <el-button icon="el-icon-delete" size="small" @click="deleteLink(scope.row)"></el-button>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="tc"> <div class="tc">
<el-pagination <el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-size="pageSize"
layout="prev, pager, next" layout="prev, pager, next"
:total="50"> :total="totalPage">
</el-pagination> </el-pagination>
</div> </div>
<el-dialog <el-dialog
...@@ -69,16 +73,28 @@ ...@@ -69,16 +73,28 @@
<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="imgInter" placeholder="请输入图片描述" maxlength="20"></el-input> <el-input v-model="linkName" placeholder="请输入图片描述" maxlength="20"></el-input>
</el-col> </el-col>
<el-col :span="7" :offset="1"> <el-col :span="7" :offset="1">
<p>*链接名称最多8个汉字</p> <p>*链接名称最多8个汉字</p>
</el-col> </el-col>
</el-row> </el-row>
<el-row class="mb20">
<el-col :span="4" align="center">链接排序</el-col>
<el-col :span="12">
<el-select v-model="linkOrder" placeholder="请选择">
<el-option
v-for="item in 10"
:key="item"
:value="item">
</el-option>
</el-select>
</el-col>
</el-row>
<el-row> <el-row>
<el-col :span="4" align="center">链接名称</el-col> <el-col :span="4" align="center">链接地址</el-col>
<el-col :span="18"> <el-col :span="18">
<el-input type="textarea" :rows="4" v-model="imgInter"></el-input> <el-input type="textarea" :rows="4" v-model="linkUrl"></el-input>
</el-col> </el-col>
</el-row> </el-row>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
...@@ -86,12 +102,22 @@ ...@@ -86,12 +102,22 @@
<el-col :span="10" :offset="7"> <el-col :span="10" :offset="7">
<div style="display: flex; justify-content: space-around"> <div style="display: flex; justify-content: space-around">
<el-button @click="centerDialogVisible = false">取 消</el-button> <el-button @click="centerDialogVisible = false">取 消</el-button>
<el-button type="danger">确 定</el-button> <el-button type="danger" @click="myLink">确 定</el-button>
</div> </div>
</el-col> </el-col>
</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>
...@@ -100,31 +126,28 @@ export default { ...@@ -100,31 +126,28 @@ export default {
name: 'commonLink', name: 'commonLink',
data () { data () {
return { return {
tableData: [{
linkName: 'OA行政云盘!',
linkUrl: 'http://yunpan.cfldcn.com/web/index#/home/file/mount?mountid=61320',
uploadTime: '',
uploadMan: '郭玉洁',
switchOption: {
value: true
}
}, {
linkName: '挂网制度!',
linkUrl: 'http://oa.cfldcn.com/km/institution/?categoryId=13bdbf8c79a672c7cf2f5f84786931f7#cri.q=docStatus:30',
uploadTime: '2019-04-09 11:29',
uploadMan: '郭玉洁',
switchOption: {
value: true
}
}],
deleteVisible: false, deleteVisible: false,
centerDialogVisible: false, centerDialogVisible: false,
imgInter: '' imgInter: '',
linkList: [],
currentPage: 1,
pageSize: 5,
totalPage: null,
linkName: '',
linkOrder: '',
linkUrl: '',
dialogVisible: false,
linkItemId: '',
isAdd: true
} }
}, },
mounted () {
this._getCommonList()
},
methods: { methods: {
addLink () { addLink () {
this.centerDialogVisible = true this.centerDialogVisible = true
this.isAdd = true
}, },
handleRemove (file, fileList) { handleRemove (file, fileList) {
console.log(file, fileList) console.log(file, fileList)
...@@ -137,6 +160,77 @@ export default { ...@@ -137,6 +160,77 @@ export default {
}, },
beforeRemove (file, fileList) { beforeRemove (file, fileList) {
return this.$confirm(`确定移除 ${file.name}?`) return this.$confirm(`确定移除 ${file.name}?`)
},
_getCommonList () {
let _this = this
this.$axios.get('/used/links/list', {
params: {
'p': _this.currentPage,
'c': _this.pageSize
}
}).then(function (res) {
console.log(res)
_this.totalPage = res.count
_this.linkList = res.list
})
},
handleSizeChange: function (size) {
this.pageSize = size
},
handleCurrentChange: function (currentPage) {
this.currentPage = currentPage
this._getCommonList()
},
myLink () { // 添加
let _this = this
var params = {}, requestUrl = ''
if (_this.isAdd) {
params = {
'linksOrder': _this.linkOrder,
'linksTitle': _this.linkName,
'linksUrl': _this.linkUrl
}
requestUrl = '/used/links/add'
} else {
params = {
'linksOrder': _this.linkOrder,
'linksTitle': _this.linkName,
'linksUrl': _this.linkUrl,
'usedLinksId': _this.linkItemId
}
requestUrl = '/used/links/update'
}
this.$axios.post(requestUrl, params)
.then(function (res) {
if (res === 'OK') {
_this._getCommonList()
_this.$message('操作成功!')
_this.centerDialogVisible = false
}
})
},
deleteLink (item) {
this.linkItemId = item.id
this.dialogVisible = true
},
ensureDelete () { // 删除
let _this = this
this.$axios.get('/used/links/delete/' + _this.linkItemId)
.then(function (res) {
if (res === 'OK') {
_this._getCommonList()
_this.$message('删除成功!')
_this.dialogVisible = false
}
})
},
editLink (item) { // 编辑
this.centerDialogVisible = true
this.isAdd = false
this.linkName = item.linksTitle
this.linkOrder = item.linksOrder
this.linkUrl = item.linksUrl
this.linkItemId = item.id
} }
} }
} }
......
...@@ -214,7 +214,7 @@ export default { ...@@ -214,7 +214,7 @@ export default {
} }
</script> </script>
<style scoped lang="less"> <style scoped lang="scss">
.a_hover { .a_hover {
display: block; display: block;
width: 100%; width: 100%;
......
<template> <template>
<div class="text-editing"> <div class="text-editing">
<div class="editor-head"> <el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-row> <el-row type="flex">
<el-col :span="17" :offset="1"> <el-col :sm="13">
<div class="input_warp"><input type="text" placeholder="请输入标题…" /></div> <div class="input_warp"><input type="text" placeholder="请输入标题…" v-model="formInline.activeTitle" /></div>
</el-col> </el-col>
<el-col :span="6"> <el-col :sm="5">
<div class="select-warp"> <el-form-item label="文章类型">
<el-select v-model="value" placeholder="请选择"> <el-select v-model="formInline.activeType">
<el-option <el-option label="活动" value="1"></el-option>
v-for="item in options" <el-option label="专题" value="2"></el-option>
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select> </el-select>
</div> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</div> </el-form>
<div style="min-height: 500px"> <div style="min-height: 500px">
<quill-editor <quill-editor
v-model="content" v-model="editorContent"
ref="myQuillEditor" ref="myQuillEditor"
:options="editorOption" :options="editorOption"
@blur="onEditorBlur($event)" @focus="onEditorFocus($event)" @blur="onEditorBlur($event)" @focus="onEditorFocus($event)"
@change="onEditorChange($event)"> @change="onEditorChange($event)">
</quill-editor> </quill-editor>
</div> </div>
<div class="btn-warp">
<el-button>取消</el-button>
<el-button type="primary">确认</el-button>
<el-button type="danger" @click="postActivityRest">发布</el-button>
</div>
</div> </div>
</template> </template>
...@@ -52,9 +53,12 @@ export default { ...@@ -52,9 +53,12 @@ export default {
value: '选项5', value: '选项5',
label: '北京烤鸭' label: '北京烤鸭'
}], }],
value: '', editorContent: '',
content: '1121212', editorOption: {},
editorOption: {} formInline: {
activeTitle: '',
activeType: '1'
}
} }
}, },
methods: { methods: {
...@@ -63,15 +67,27 @@ export default { ...@@ -63,15 +67,27 @@ export default {
onEditorFocus () { // 获得焦点事件 onEditorFocus () { // 获得焦点事件
}, },
onEditorChange () { // 内容改变事件 onEditorChange () { // 内容改变事件
},
postActivityRest () {
let _this = this
let params = {
'activeContent': _this.editorContent,
'activeStatus': 2,
'activeTitle': _this.formInline.activeTitle,
'activeType': 1
}
this.$axios.post('/active/add', params)
.then(function (res) {
console.log(res)
})
} }
} }
} }
</script> </script>
<style scoped lang="less"> <style scoped lang="scss">
.editor-head {margin-bottom: 20px; .input_warp {width: 100%; box-sizing: border-box; padding: 0 20px;
.input_warp {width: 100%; box-sizing: border-box; padding: 0 20px; input {width: 100%; border-bottom: 1px solid #ccc; padding: 10px; text-align: center; font-size: 16px; box-sizing: border-box; color: #666666; line-height: 24px}
input {width: 100%; border-bottom: 1px solid #ccc; padding: 10px; text-align: center; font-size: 16px; box-sizing: border-box; color: #666666; line-height: 24px}
}
} }
.btn-warp {padding: 30px 0; text-align: center}
</style> </style>
<template>
<div>
<div class="btn-warp tr mb20">
<el-button type="primary" size="small" @click="centerDialogVisible = true">新增</el-button>
</div>
<el-table
:data="photoList"
:header-cell-style="{'background-color': '#F5F7FA', 'color': '#333', 'line-height': '45px', 'height': '45px', 'padding': 0}"
style="width: 100%">
<el-table-column
type="index"
align="center"
label="序号"
width="100">
</el-table-column>
<el-table-column
align="center"
width="220"
label="照片">
<template scope="scope">
<img :src="$imgUrl + scope.row.picturePath" width="220" height="60" />
</template>
</el-table-column>
<el-table-column
prop="pictureOriginalName"
align="center"
label="名称">
</el-table-column>
<el-table-column
prop="pictureOrder"
align="center"
label="图片排序">
</el-table-column>
<el-table-column
prop="pictureSize"
align="center"
label="大小">
</el-table-column>
<el-table-column
prop="createTime"
align="center"
label="上传时间"
width="180">
</el-table-column>
<el-table-column
prop="updateUser"
align="center"
label="操作人">
</el-table-column>
<el-table-column
prop="pictureMark"
align="center"
label="图片备注">
</el-table-column>
<el-table-column
align="center"
label="操作"
width="100">
<template slot-scope="scope">
<el-button icon="el-icon-delete" size="small" @click="pictureDel(scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination" v-if="photoList && photoList.length">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-size="pageSize"
layout="prev, pager, next"
:total="totalPage">
</el-pagination>
</div>
<el-dialog
title="无忧办公"
:visible.sync="centerDialogVisible"
width="35%"
center>
<el-form :model="form">
<el-form-item label="标题" :label-width="formLabelWidth">
<el-col :sm="18">
<el-input v-model="form.pictureOriginalName" autocomplete="off" disabled="disabled"></el-input>
</el-col>
</el-form-item>
<el-form-item label="图片上传" :label-width="formLabelWidth">
<el-col :sm="24">
<el-row class="img_load">
<el-col :sm="18">
<el-upload
class="avatar-uploader"
action="http://10.2.98.32:8081/roomofmother/picture/upload"
:show-file-list="false"
:multiple="true"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload">
<img v-if="imageUrl" :src="imageUrl" 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-form-item>
<el-form-item label="图片大小" :label-width="formLabelWidth">
<el-col :sm="18">
<el-input v-model="form.pictureSize" autocomplete="off" disabled="disabled"></el-input>
</el-col>
</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-col :sm="18">
<el-input v-model="form.pictureMark" autocomplete="off"></el-input>
</el-col>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-row type="flex" justify="center">
<el-col :sm="10">
<div class="btn-warp">
<el-button @click="centerDialogVisible = false">取 消</el-button>
<el-button type="danger" @click="savePicture">确 定</el-button>
</div>
</el-col>
</el-row>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'index',
data () {
return {
classifyId: '', // 图集ID
currentPage: 1,
pageSize: 5,
totalPage: null,
photoList: [],
centerDialogVisible: false,
formLabelWidth: '120px',
form: {
pictureName: '',
pictureOriginalName: '',
pictureSize: '',
pictureOrder: '',
pictureMark: ''
},
imageUrl: ''
}
},
mounted () {
this._getClassify()
},
methods: {
_getClassify () {
let _this = this
this.$axios.get('/module/classify/萌妈工作室')
.then(function (res) {
_this.classifyId = res[0].id
_this._getPhotoList()
})
},
handleSizeChange: function (size) {
this.pageSize = size
},
handleCurrentChange: function (currentPage) {
this.currentPage = currentPage
this._getPhotoList()
},
_getPhotoList () { // 图集列表
let _this = this
this.$axios.get('/roomofmother/picture/list', {
params: {
'p': _this.currentPage,
'c': _this.pageSize,
'classifyId': _this.classifyId
}
}).then(function (res) {
_this.totalPage = res.count
_this.photoList = res.list
})
},
handleAvatarSuccess (res, file) { // 上传
this.imageUrl = URL.createObjectURL(file.raw)
this.form.pictureName = res.data[0].fileName
this.form.pictureOriginalName = res.data[0].fileOriginalName
this.form.pictureSize = res.data[0].fileSize
this.form.picturePath = res.data[0].filePath
},
beforeAvatarUpload (file) {
const isLt5M = file.size / 1024 / 1024 < 5
if (!isLt5M) {
this.$message.error('上传头像图片大小不能超过 5MB!')
}
return isLt5M
},
savePicture () { // 新增
let _this = this
let params = {
'classifyId': _this.classifyId,
'pictureMark': _this.form.pictureMark,
'pictureName': _this.form.pictureName,
'pictureOrder': _this.form.pictureOrder,
'pictureOriginalName': _this.form.pictureOriginalName,
'picturePath': _this.form.picturePath,
'pictureSize': _this.form.pictureSize
}
this.$axios.post('/roomofmother/picture/save', params)
.then(function (res) {
if (res === 'ok') {
_this._getPhotoList()
_this.centerDialogVisible = false
}
})
},
pictureDel (item) { // 删除
this.$confirm('确定删除这条数据吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let _this = this
this.$axios.get('/roomofmother/picture/delete/' + item.id)
.then(function (res) {
if (res === 'ok') {
_this._getPhotoList()
_this.$message({
type: 'success',
message: '删除成功!'
})
}
})
}).catch(() => { console.log('取消删除') })
}
}
}
</script>
<style scoped lang="scss">
.avatar {
width: 178px;
height: auto;
max-height: 100px;
overflow: hidden;
display: block;
margin: auto;
}
.upload_infor {
padding-left: 20px;
p {
em {color: #D0021B;}
}
}
</style>
<template>
<div>
<div class="btn-warp tr mb20">
<el-select v-model="classifyId" @change="_getPhotoList" placeholder="图集分类" size="small" class="mr30">
<el-option
v-for="item in classifyList"
:key="item.id"
:v="item.id"
:label="item.classifyName"
:value="item.id">
</el-option>
</el-select>
<el-button type="primary" size="small" @click="centerDialogVisible = true">新增</el-button>
<!--<el-button type="primary" size="small" @click="addClassifyImg(item)" v-for="(item, index) in classifyList" :key="index">{{item.classifyName}}</el-button>-->
</div>
<el-table
:data="photoList"
:header-cell-style="{'background-color': '#F5F7FA', 'color': '#333', 'line-height': '45px', 'height': '45px', 'padding': 0}"
style="width: 100%">
<el-table-column
type="index"
align="center"
label="序号"
width="100">
</el-table-column>
<el-table-column
align="center"
width="220"
label="照片">
<template scope="scope">
<img :src="$imgUrl + scope.row.picturePath" width="220" height="60" />
</template>
</el-table-column>
<el-table-column
prop="pictureOriginalName"
align="center"
label="名称">
</el-table-column>
<el-table-column
prop="pictureOrder"
align="center"
label="图片排序">
</el-table-column>
<el-table-column
prop="pictureSize"
align="center"
label="大小">
</el-table-column>
<el-table-column
prop="createTime"
align="center"
label="上传时间"
width="180">
</el-table-column>
<el-table-column
prop="updateUser"
align="center"
label="操作人">
</el-table-column>
<el-table-column
prop="pictureMark"
align="center"
label="图片备注">
</el-table-column>
<el-table-column
align="center"
label="操作"
width="100">
<template slot-scope="scope">
<el-button icon="el-icon-delete" size="small" @click="pictureDel(scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination" v-if="photoList && photoList.length">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-size="pageSize"
layout="prev, pager, next"
:total="totalPage">
</el-pagination>
</div>
<el-dialog
title="无忧办公"
:visible.sync="centerDialogVisible"
width="35%"
center>
<el-form :model="form">
<el-form-item label="标题" :label-width="formLabelWidth">
<el-col :sm="18">
<el-input v-model="form.pictureOriginalName" autocomplete="off" disabled="disabled"></el-input>
</el-col>
</el-form-item>
<el-form-item label="图片上传" :label-width="formLabelWidth">
<el-col :sm="24">
<el-row class="img_load">
<el-col :sm="18">
<el-upload
class="avatar-uploader"
action="http://10.2.98.32:8081/index/banner/upload"
:show-file-list="false"
:multiple="true"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload">
<img v-if="imageUrl" :src="imageUrl" 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-form-item>
<el-form-item label="图片大小" :label-width="formLabelWidth">
<el-col :sm="18">
<el-input v-model="form.pictureSize" autocomplete="off" disabled="disabled"></el-input>
</el-col>
</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-col :sm="18">
<el-input v-model="form.pictureMark" autocomplete="off"></el-input>
</el-col>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-row type="flex" justify="center">
<el-col :sm="10">
<div class="btn-warp">
<el-button @click="centerDialogVisible = false">取 消</el-button>
<el-button type="danger" @click="savePicture">确 定</el-button>
</div>
</el-col>
</el-row>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'index',
data () {
return {
classifyList: [], // 图集分类
classifyId: '', // 图集ID
currentPage: 1,
pageSize: 10,
totalPage: null,
photoList: [],
centerDialogVisible: false,
formLabelWidth: '120px',
form: {
pictureName: '',
pictureOriginalName: '',
pictureSize: '',
pictureOrder: '',
pictureMark: ''
},
imageUrl: ''
}
},
mounted () {
this._getClassify()
},
methods: {
_getClassify () {
let _this = this
this.$axios.get('/module/classify/无忧办公')
.then(function (res) {
_this.classifyId = res[0].id
_this.classifyList = res
_this._getPhotoList()
})
},
handleSizeChange: function (size) {
this.pageSize = size
},
handleCurrentChange: function (currentPage) {
this.currentPage = currentPage
this._getPhotoList()
},
_getPhotoList () { // 图集列表
let _this = this
this.$axios.get('/office/picture/list', {
params: {
'p': _this.currentPage,
'c': _this.pageSize,
'classifyId': _this.classifyId
}
}).then(function (res) {
_this.totalPage = res.count
_this.photoList = res.list
})
},
handleAvatarSuccess (res, file) { // 上传
this.imageUrl = URL.createObjectURL(file.raw)
this.form.pictureName = res.data.fileName
this.form.pictureOriginalName = res.data.fileOriginalName
this.form.pictureSize = res.data.fileSize
this.form.picturePath = res.data.filePath
},
beforeAvatarUpload (file) {
console.log(file)
const isLt5M = file.size / 1024 / 1024 < 5
if (!isLt5M) {
this.$message.error('上传头像图片大小不能超过 5MB!')
}
return isLt5M
},
savePicture () { // 新增
let _this = this
let params = {
'classifyId': _this.classifyId,
'pictureMark': _this.form.pictureMark,
'pictureName': _this.form.pictureName,
'pictureOrder': _this.form.pictureOrder,
'pictureOriginalName': _this.form.pictureOriginalName,
'picturePath': _this.form.picturePath,
'pictureSize': _this.form.pictureSize
}
this.$axios.post('/office/picture/save', params)
.then(function (res) {
if (res === 'OK') {
_this._getPhotoList()
_this.centerDialogVisible = false
}
})
},
pictureDel (item) { // 删除
this.$confirm('确定删除这条数据吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let _this = this
this.$axios.get('/office/picture/delete', {
params: {
'pictureId': item.id
}
})
.then(function (res) {
if (res === 'OK') {
_this._getPhotoList()
_this.$message({
type: 'success',
message: '删除成功!'
})
}
})
}).catch(() => { console.log('取消删除') })
}
}
}
</script>
<style scoped lang="scss">
.avatar {
width: 178px;
height: auto;
max-height: 100px;
overflow: hidden;
display: block;
margin: auto;
}
.upload_infor {
padding-left: 20px;
p {
em {color: #D0021B;}
}
}
</style>
<template>
<div>
<div class="btn-warp tr mb20">
<el-button type="primary" size="small" @click="centerDialogVisible = true">新增</el-button>
</div>
<el-table
:data="photoList"
:header-cell-style="{'background-color': '#F5F7FA', 'color': '#333', 'line-height': '45px', 'height': '45px', 'padding': 0}"
style="width: 100%">
<el-table-column
type="index"
align="center"
label="序号"
width="100">
</el-table-column>
<el-table-column
align="center"
width="220"
label="照片">
<template scope="scope">
<img :src="$imgUrl + scope.row.picturePath" width="220" height="60" />
</template>
</el-table-column>
<el-table-column
prop="pictureOriginalName"
align="center"
label="名称">
</el-table-column>
<!--<el-table-column
prop="pictureOrder"
align="center"
label="图片排序">
</el-table-column>-->
<el-table-column
prop="pictureSize"
align="center"
label="大小">
</el-table-column>
<el-table-column
prop="createTime"
align="center"
label="上传时间"
width="180">
</el-table-column>
<el-table-column
prop="createUser"
align="center"
label="操作人">
</el-table-column>
<el-table-column
prop="pictureMark"
align="center"
label="图片备注">
</el-table-column>
<el-table-column
align="center"
label="操作"
width="100">
<template slot-scope="scope">
<el-button icon="el-icon-delete" size="small" @click="pictureDel(scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination" v-if="photoList && photoList.length">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-size="pageSize"
layout="prev, pager, next"
:total="totalPage">
</el-pagination>
</div>
<el-dialog
title="无忧办公"
:visible.sync="centerDialogVisible"
width="35%"
center>
<el-form :model="form">
<el-form-item label="标题" :label-width="formLabelWidth">
<el-col :sm="18">
<el-input v-model="form.pictureOriginalName" autocomplete="off" disabled="disabled"></el-input>
</el-col>
</el-form-item>
<el-form-item label="图片上传" :label-width="formLabelWidth">
<el-col :sm="24">
<el-row class="img_load">
<el-col :sm="18">
<el-upload
class="avatar-uploader"
action="http://10.2.98.32:8081/roomofmother/picture/upload"
:show-file-list="false"
:multiple="true"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload">
<img v-if="imageUrl" :src="imageUrl" 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-form-item>
<el-form-item label="图片大小" :label-width="formLabelWidth">
<el-col :sm="18">
<el-input v-model="form.pictureSize" autocomplete="off" disabled="disabled"></el-input>
</el-col>
</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-col :sm="18">
<el-input v-model="form.pictureMark" autocomplete="off"></el-input>
</el-col>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-row type="flex" justify="center">
<el-col :sm="10">
<div class="btn-warp">
<el-button @click="centerDialogVisible = false">取 消</el-button>
<el-button type="danger" @click="savePicture">确 定</el-button>
</div>
</el-col>
</el-row>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'index',
data () {
return {
classifyId: '', // 图集ID
currentPage: 1,
pageSize: 5,
totalPage: null,
photoList: [],
centerDialogVisible: false,
formLabelWidth: '120px',
form: {
pictureName: '',
pictureOriginalName: '',
pictureSize: '',
pictureOrder: '',
pictureMark: ''
},
imageUrl: ''
}
},
mounted () {
this._getClassify()
},
methods: {
_getClassify () {
let _this = this
this.$axios.get('/module/classify/幸福传递')
.then(function (res) {
_this.classifyId = res[0].id
_this._getPhotoList()
})
},
handleSizeChange: function (size) {
this.pageSize = size
},
handleCurrentChange: function (currentPage) {
this.currentPage = currentPage
this._getPhotoList()
},
_getPhotoList () { // 图集列表
let _this = this
this.$axios.get('/warmth/warmthPictureList', {
params: {
'p': _this.currentPage,
'c': _this.pageSize
}
}).then(function (res) {
_this.totalPage = res.count
_this.photoList = res.list
})
},
handleAvatarSuccess (res, file) { // 上传
this.imageUrl = URL.createObjectURL(file.raw)
this.form.pictureName = res.data[0].fileName
this.form.pictureOriginalName = res.data[0].fileOriginalName
this.form.pictureSize = res.data[0].fileSize
this.form.picturePath = res.data[0].filePath
},
beforeAvatarUpload (file) {
const isLt5M = file.size / 1024 / 1024 < 5
if (!isLt5M) {
this.$message.error('上传头像图片大小不能超过 5MB!')
}
return isLt5M
},
savePicture () { // 新增
let _this = this
let params = {
'classifyId': _this.classifyId,
'pictureMark': _this.form.pictureMark,
'pictureName': _this.form.pictureName,
// 'pictureOrder': _this.form.pictureOrder,
'pictureOriginalName': _this.form.pictureOriginalName,
'picturePath': _this.form.picturePath,
'pictureSize': _this.form.pictureSize
}
this.$axios.post('/warmth/warmthPictureAdd', params)
.then(function (res) {
if (res === 'OK') {
_this._getPhotoList()
_this.centerDialogVisible = false
}
})
},
pictureDel (item) { // 删除
this.$confirm('确定删除这条数据吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let _this = this
this.$axios.get('/warmth/photoDelete/', {
params: {
'warmthPictureId': item.id
}
}).then(function (res) {
if (res === 'OK') {
_this._getPhotoList()
_this.$message({
type: 'success',
message: '删除成功!'
})
}
})
}).catch(() => { console.log('取消删除') })
}
}
}
</script>
<style scoped lang="scss">
.avatar {
width: 178px;
height: auto;
max-height: 100px;
overflow: hidden;
display: block;
margin: auto;
}
.upload_infor {
padding-left: 20px;
p {
em {color: #D0021B;}
}
}
</style>
...@@ -41,5 +41,5 @@ export default { ...@@ -41,5 +41,5 @@ export default {
} }
</script> </script>
<style scoped lang="less"> <style scoped lang="scss">
</style> </style>
<template> <template>
<div> <div>
<el-form ref="form" :model="form" label-width="100px"> <el-form ref="form" :model="form" label-width="100px" size="small">
<el-form-item label="所在省"> <el-form-item label="所在省">
<el-col :sm="5"> <el-col :sm="5">
<el-select v-model="form.region" placeholder="省份" style="width: 100%"> <el-select v-model="form.province" placeholder="省份" style="width: 100%">
<el-option label="区域一" value="shanghai"></el-option> <el-option label="河北省" value="河北省"></el-option>
<el-option label="区域二" value="beijing"></el-option>
</el-select> </el-select>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="所在市"> <el-form-item label="所在市">
<el-col :sm="5"> <el-col :sm="5">
<el-select v-model="form.region" placeholder="市区" style="width: 100%"> <el-select v-model="form.city" placeholder="市区" style="width: 100%">
<el-option label="区域一" value="shanghai"></el-option> <el-option label="全部" value="全部"></el-option>
<el-option label="区域二" value="beijing"></el-option> <el-option label="石家庄市" value="石家庄市"></el-option>
<el-option label="廊坊市" value="廊坊市"></el-option>
</el-select> </el-select>
</el-col> </el-col>
<el-col :sm="10"> <el-col :sm="10">
<div style="position: relative; width: 100%; height: 100%"> <div style="position: relative; width: 450px">
<div class="map" id="map" style="width: 450px; height: 220px; position: absolute; left: 50px"></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" style="width: 100%; height: 220px; position: absolute; left: 60px; top: 0"></div>
</div> </div>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="网点名称"> <el-form-item label="网点名称">
<el-col :sm="5"> <el-col :sm="5">
<el-input v-model="form.name"></el-input> <el-input v-model="form.laundryName"></el-input>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="详细地址"> <el-form-item label="详细地址">
<el-col :sm="5"> <el-col :sm="5">
<el-input v-model="form.name"></el-input> <el-input v-model="form.detailAddress"></el-input>
<a href="" class="link">点击此处查询地区经纬度</a> <a href="http://api.map.baidu.com/lbsapi/getpoint/index.html" target="_blank" class="link">点击此处查询地区经纬度</a>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="所在经度"> <el-form-item label="所在经度">
<el-col :sm="5"> <el-col :sm="5">
<el-input v-model="form.name"></el-input> <el-input v-model="form.longitude"></el-input>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="所在纬度"> <el-form-item label="所在纬度">
<el-col :sm="5"> <el-col :sm="5">
<el-input v-model="form.name"></el-input> <el-input v-model="form.latitude"></el-input>
</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="5">
<el-select v-model="form.region" placeholder="省份" style="width: 100%"> <el-select v-model="form.pickWay" style="width: 100%">
<el-option label="区域一" value="shanghai"></el-option> <el-option label="全部" value="0"></el-option>
<el-option label="区域二" value="beijing"></el-option> <el-option label="集中送取" value="1"></el-option>
<el-option label="自行送取" value="2"></el-option>
</el-select> </el-select>
</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="5">
<el-input v-model="form.name"></el-input> <el-input v-model="form.contactMan"></el-input>
</el-col> </el-col>
<el-col :sm="12" :offset="1"> <el-col :sm="6" :offset="1">
<el-form-item label="联系方式"> <el-form-item label="联系方式">
<el-col :sm="8"> <el-col :sm="24">
<el-input v-model="form.name"></el-input> <el-input v-model="form.contactNumber"></el-input>
</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="4"> <el-col :sm="5">
<el-input v-model="form.name"></el-input> <el-input v-model="form.principal"></el-input>
</el-col> </el-col>
<el-col :sm="12" :offset="1"> <el-col :sm="6" :offset="1">
<el-form-item label="对接人电话"> <el-form-item label="对接人电话">
<el-col :sm="8"> <el-col :sm="24">
<el-input v-model="form.name"></el-input> <el-input v-model="form.principalNumber"></el-input>
</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="5"> <el-col :sm="5">
<el-input v-model="form.name"></el-input> <el-date-picker
v-model="form.businessHours"
value-format="yyyy-MM-dd"
type="date"
style="width: 100%"
placeholder="选择日期">
</el-date-picker>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="供应商"> <el-form-item label="供应商">
<el-col :sm="5"> <el-col :sm="5">
<el-input v-model="form.name"></el-input> <el-input v-model="form.supplier"></el-input>
</el-col> </el-col>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row> <el-row style="margin-top: 50px">
<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 :span="2"> <el-col :sm="2">
<el-button>取消</el-button> <el-button size="small">取消</el-button>
</el-col> </el-col>
<el-col :span="2"> <el-col :sm="2">
<el-button type="danger">确认</el-button> <el-button type="danger" size="small" @click="addLundary">确认</el-button>
</el-col> </el-col>
</el-row> </el-row>
</el-col> </el-col>
...@@ -107,27 +115,43 @@ export default { ...@@ -107,27 +115,43 @@ export default {
data () { data () {
return { return {
form: { form: {
name: '', province: '河北省',
region: '', city: '全部',
date1: '', laundryName: '',
date2: '', detailAddress: '',
delivery: false, longitude: '',
type: [], latitude: '',
resource: '', pickWay: '0',
desc: '' contactMan: '',
contactNumber: '',
principal: '',
principalNumber: '',
businessHours: '',
supplier: ''
} }
} }
}, },
mounted () { mounted () {
this.createMap() this.createMap(116.404, 39.915)
}, },
methods: { methods: {
createMap () { createMap (longitude, latitude) {
/* eslint-disable */ var map = new BMap.Map('map')
var map = new BMap.Map('map') // 创建地图实例 map.enableScrollWheelZoom(true)
var point = new BMap.Point(116.404, 39.915) // 创建点坐标 var point = new BMap.Point(longitude, latitude)
let marker = new BMap.Marker(point) // 创建标注
map.addOverlay(marker) // 将标注添加到地图中
map.centerAndZoom(point, 15) map.centerAndZoom(point, 15)
/* eslint-disable */ },
searchMap () {
this.createMap(this.form.longitude, this.form.latitude)
},
addLundary () {
let _this = this
this.$axios.post('/team/save', _this.form)
.then(function (res) {
console.log(res)
})
} }
} }
} }
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
<div class="WashBranches"> <div class="WashBranches">
<el-form :inline="true" :model="formInline" class="demo-form-inline"> <el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item> <el-form-item>
<el-select v-model="formInline.region" placeholder="活动区域"> <el-select v-model="formInline.region">
<el-option label="区域一" value="shanghai"></el-option> <el-option label="北京" value="北京"></el-option>
<el-option label="区域二" value="beijing"></el-option> <el-option label="区域二" value="beijing"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-select v-model="formInline.region" placeholder="活动区域"> <el-select v-model="formInline.region">
<el-option label="区域一" value="shanghai"></el-option> <el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option> <el-option label="区域二" value="beijing"></el-option>
</el-select> </el-select>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<el-button>搜索</el-button> <el-button>搜索</el-button>
</el-form-item> </el-form-item>
<el-form-item style="float: right"> <el-form-item style="float: right">
<el-button type="primary">新增网点</el-button> <!--<el-button type="primary">新增网点</el-button>-->
<el-button>导出</el-button> <el-button>导出</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
......
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