Commit 0a1d36ef by dongjipeng

add

parent 50870ee6
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"build": "vue-cli-service build", "alpha": "vue-cli-service build --mode alpha",
"build": "vue-cli-service build --mode build",
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {
......
...@@ -23,27 +23,59 @@ Vue.prototype.$qs = QS ...@@ -23,27 +23,59 @@ Vue.prototype.$qs = QS
const DOMAIN_NAME = 'cfldcn' const DOMAIN_NAME = 'cfldcn'
// const DOMAIN_NAME = 'cfldpe' // const DOMAIN_NAME = 'cfldpe'
var ssoHttp = '' var ssoHttp = ''
// if (process.env.NODE_ENV === 'development') { // 开发
// ssoHttp = 'http://sso.' + DOMAIN_NAME + '.com/'
// Vue.prototype.$ssoHttp = ssoHttp
// axios.defaults.baseURL = 'http://10.2.98.32:8091/admin/'
// Vue.prototype.$baseURL = 'http://10.2.98.32:8091/admin/'
// Vue.prototype.$imgUrl = 'http://10.2.98.32:8091/admin/images/'
// Vue.prototype.$imgUrlFitness = 'http://10.2.98.32:8091/admin/exerciseImages/'
// } else { // 生产
// ssoHttp = 'http://sso.' + DOMAIN_NAME + '.com/'
// Vue.prototype.$ssoHttp = ssoHttp
// // cookie
// getCookie(ssoHttp)
// axios.defaults.baseURL = 'http://happy.' + DOMAIN_NAME + '.com/admin/'
// Vue.prototype.$baseURL = 'http://happy.' + DOMAIN_NAME + '.com/admin/'
// Vue.prototype.$imgUrl = 'http://happy.' + DOMAIN_NAME + '.com/admin/images/'
// Vue.prototype.$imgUrlFitness = 'http://happy.' + DOMAIN_NAME + '.com/admin/exerciseImages/'
// }
if (process.env.NODE_ENV === 'development') { // 开发 // 判断环境变量,执行对应打包命令
ssoHttp = 'http://sso.' + DOMAIN_NAME + '.com/' console.log('当前环境变量', process.env.VUE_APP_TITLE)
Vue.prototype.$ssoHttp = ssoHttp switch (process.env.VUE_APP_TITLE) {
axios.defaults.baseURL = 'http://10.2.98.32:8091/admin/' case 'development':
Vue.prototype.$baseURL = 'http://10.2.98.32:8091/admin/' ssoHttp = 'http://sso.' + DOMAIN_NAME + '.com/'
Vue.prototype.$imgUrl = 'http://10.2.98.32:8091/admin/images/' Vue.prototype.$ssoHttp = ssoHttp
Vue.prototype.$imgUrlFitness = 'http://10.2.98.32:8091/admin/exerciseImages/' axios.defaults.baseURL = 'http://10.2.98.32:8091/admin/'
} else { // 生产 Vue.prototype.$baseURL = 'http://10.2.98.32:8091/admin/'
ssoHttp = 'http://sso.' + DOMAIN_NAME + '.com/' Vue.prototype.$imgUrl = 'http://10.2.98.32:8091/admin/images/'
Vue.prototype.$ssoHttp = ssoHttp Vue.prototype.$imgUrlFitness = 'http://10.2.98.32:8091/admin/exerciseImages/'
// cookie break
getCookie(ssoHttp) case 'alpha': // 注意这里的名字要和步骤二中设置的环境名字对应起来
axios.defaults.baseURL = 'http://happy.' + DOMAIN_NAME + '.com/admin/' ssoHttp = 'http://sso.' + DOMAIN_NAME + '.com/'
Vue.prototype.$baseURL = 'http://happy.' + DOMAIN_NAME + '.com/admin/' Vue.prototype.$ssoHttp = ssoHttp
Vue.prototype.$imgUrl = 'http://happy.' + DOMAIN_NAME + '.com/admin/images/' axios.defaults.baseURL = 'http://10.2.98.32:8081/admin/'
Vue.prototype.$imgUrlFitness = 'http://happy.' + DOMAIN_NAME + '.com/admin/exerciseImages/' Vue.prototype.$baseURL = 'http://10.2.98.32:8081/admin/'
Vue.prototype.$imgUrl = 'http://10.2.98.32:8081/admin/images/'
Vue.prototype.$imgUrlFitness = 'http://10.2.98.32:8081/admin/exerciseImages/'
break
case 'production':
ssoHttp = 'http://sso.' + DOMAIN_NAME + '.com/'
Vue.prototype.$ssoHttp = ssoHttp
getCookie(ssoHttp)
axios.defaults.baseURL = 'http://happy.' + DOMAIN_NAME + '.com/admin/'
Vue.prototype.$baseURL = 'http://happy.' + DOMAIN_NAME + '.com/admin/'
Vue.prototype.$imgUrl = 'http://happy.' + DOMAIN_NAME + '.com/admin/images/'
Vue.prototype.$imgUrlFitness = 'http://happy.' + DOMAIN_NAME + '.com/admin/exerciseImages/'
break
} }
axios.defaults.timeout = 50000
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'
axios.defaults.withCredentials = true
// Loading效果 // Loading效果
const elemLoading = { const elemLoading = {
loading: null, loading: null,
...@@ -55,10 +87,6 @@ const elemLoading = { ...@@ -55,10 +87,6 @@ const elemLoading = {
} }
} }
axios.defaults.timeout = 50000
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'
axios.defaults.withCredentials = true
// 请求拦截器 // 请求拦截器
axios.interceptors.request.use(request => { axios.interceptors.request.use(request => {
elemLoading.start({ elemLoading.start({
......
...@@ -24,10 +24,10 @@ ...@@ -24,10 +24,10 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
width="400" width="350"
label="活动照片"> label="活动照片">
<template scope="scope"> <template scope="scope">
<img :src="$imgUrlFitness + scope.row.submitPhotoPath" width="220" height="60" style="margin: auto" /> <img :src="$imgUrlFitness + scope.row.submitPhotoPath" @click="imgHandle(scope.row.submitPhotoPath)" width="260" height="60" style="margin: auto" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -48,7 +48,8 @@ ...@@ -48,7 +48,8 @@
label="操作" label="操作"
width="100"> width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="primary" size="small" @click="onShenhe(scope.row)">审核</el-button> <el-button type="primary" size="small" v-if="scope.row.isCheck == 0" @click="onShenhe(scope.row)">审核</el-button>
<el-button type="primary" disabled size="small" v-else>已审核</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -62,6 +63,14 @@ ...@@ -62,6 +63,14 @@
:total="totalPage"> :total="totalPage">
</el-pagination> </el-pagination>
</div> </div>
<el-dialog
title="活动照片"
:visible.sync="imgDialogVisible"
width="45%">
<div class="img_warp">
<img :src="$imgUrlFitness + bigImg" alt="" style="width: 100%; height: auto">
</div>
</el-dialog>
</div> </div>
</template> </template>
...@@ -85,7 +94,9 @@ export default { ...@@ -85,7 +94,9 @@ export default {
personIdMdm: '', personIdMdm: '',
dept: '', dept: '',
p: '', p: '',
c: '' c: '',
bigImg: '',
imgDialogVisible: false
} }
}, },
mounted () { mounted () {
...@@ -97,41 +108,47 @@ export default { ...@@ -97,41 +108,47 @@ export default {
}, },
handleCurrentChange: function (currentPage) { handleCurrentChange: function (currentPage) {
this.currentPage = currentPage this.currentPage = currentPage
this._getPhotoList() this.getActivityList()
}, },
getActivityList () { getActivityList () {
this.$axios.get('/exercise/exerciseActivityApplySubmitList', { this.$axios.get('/exercise/exerciseActivityApplySubmitList', {
params: { params: {
'p': this.currentPage, 'p': this.currentPage,
'c': this.pageSize, 'c': this.pageSize
'personIdMdm': this.$store.state.userInfor.personIdMdm,
'dept': this.$store.state.userInfor.deptId
} }
}).then(res => { }).then(res => {
console.log(res)
if (res) { if (res) {
this.totalPage = res.count this.totalPage = res.count
this.photoList = res.list let list = res.list
list.map(item => {
item.activityTitle = '第五届华夏幸福长跑节线上赛'
})
this.photoList = list
} }
}) })
}, },
onShenhe (data) { onShenhe (data) {
console.log(data) if (data.id && data.checkSubmitDistance) {
this.$axios.get('/exercise/exerciseActivityApplySubmitCheck', { this.$axios.get('/exercise/exerciseActivityApplySubmitCheck', {
params: { params: {
'applySubmitId': data.id, 'applySubmitId': data.id,
'checkSubmitDistance': data.checkSubmitDistance 'checkSubmitDistance': data.checkSubmitDistance
} }
}).then(res => { }).then(res => {
if (res) { if (res) {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '审核成功!' message: '审核成功!'
}) })
this.getActivityList() this.getActivityList()
} }
}) })
} }
},
imgHandle (imgUrl) { // 查看大图
this.bigImg = imgUrl
this.imgDialogVisible = true
},
} }
} }
</script> </script>
......
<template> <template>
<div> <div>
<div class="btn-warp tr mb20"> <div class="btn-warp tr mb20">
<!-- <el-button type="primary" size="small">导出</el-button> --> <el-button type="primary" class="el-button-link">
<a :href="$baseURL + 'exercise/exerciseActivityApplyExport'">导出</a>
</el-button>
<el-button type="primary" class="el-button-link"><router-link to="/fitness/activityShenhe" style="color: #fff">活动审核</router-link></el-button> <el-button type="primary" class="el-button-link"><router-link to="/fitness/activityShenhe" style="color: #fff">活动审核</router-link></el-button>
</div> </div>
<el-table <el-table
...@@ -14,8 +16,7 @@ ...@@ -14,8 +16,7 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="activityTime" prop="activityTime"
align="center" width="270"
width="160"
label="活动时间"> label="活动时间">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -85,20 +86,23 @@ export default { ...@@ -85,20 +86,23 @@ export default {
}, },
handleCurrentChange: function (currentPage) { handleCurrentChange: function (currentPage) {
this.currentPage = currentPage this.currentPage = currentPage
this._getPhotoList() this.getActivityList()
}, },
getActivityList () { getActivityList () {
this.$axios.get('/exercise/exerciseActivityApplyList', { this.$axios.get('/exercise/exerciseActivityApplyList', {
params: { params: {
'p': this.currentPage, 'p': this.currentPage,
'c': this.pageSize, 'c': this.pageSize
'personIdMdm': this.$store.state.userInfor.personIdMdm,
'dept': this.$store.state.userInfor.deptId
} }
}).then(res => { }).then(res => {
if (res) { if (res) {
this.totalPage = res.count this.totalPage = res.count
this.photoList = res.list let list = res.list
list.map(item => {
item.activityTitle = '第五届华夏幸福长跑节线上赛'
item.activityTime = '2020年4月30日 16:30 -- 5月5日 22:00'
})
this.photoList = list
} }
}) })
} }
......
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