Browse Source

Merge branch 'master' into feature/points

feature/syp_points
liuchuang 5 years ago
parent
commit
ba2635aafa
  1. 2
      public/index.html
  2. BIN
      src/assets/img/login_bg5.png
  3. 4
      src/assets/scss/modules/home.scss
  4. 2
      src/assets/scss/pages/login.scss
  5. 2
      src/i18n/zh-CN.js
  6. 189
      src/views/modules/api/startuppage-add-or-update.vue
  7. 84
      src/views/modules/api/startuppage.vue
  8. 2
      src/views/modules/home.vue
  9. 2
      src/views/pages/login.vue

2
public/index.html

@ -53,7 +53,7 @@
<!-- 生产环境 -->
<% if (process.env.VUE_APP_NODE_ENV === 'prod') { %>
<script>
window.SITE_CONFIG['apiURL'] = 'https://epdc-shibei.elinkservice.cn/epdc-api'
window.SITE_CONFIG['apiURL'] = 'https://epdc-jinshui.elinkservice.cn/epdc-api'
</script>
<% } %>
</head>

BIN
src/assets/img/login_bg5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 MiB

4
src/assets/scss/modules/home.scss

@ -6,6 +6,8 @@
}
.home_bg_img {
background: url(~@/assets/img/home_bg.png) no-repeat;
background: url(~@/assets/img/login_bg5.png) no-repeat;
background-position: center;
background-size: 100% 100%;
// position: relative;
}

2
src/assets/scss/pages/login.scss

@ -12,7 +12,7 @@
}
&::before {
background: url(~@/assets/img/login_bg.jpg) no-repeat;
background: url(~@/assets/img/login_bg5.png) no-repeat;
background-size: 100% 100%;
}

2
src/i18n/zh-CN.js

@ -3,7 +3,7 @@ const t = {}
t.loading = '加载中...'
t.brand = {}
t.brand.lg = '精致锦水党建引领管理后台'
t.brand.lg = 'e锦水党建引领基层智慧治理平台'
t.brand.mini = '党群'
t.add = '新增'

189
src/views/modules/api/startuppage-add-or-update.vue

@ -0,0 +1,189 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'">
<el-form-item prop="imgUrl"
v-loading="loading"
label="图片">
<el-upload class="avatar-uploader"
:action="uploadUrl"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:on-error="handelError"
:before-upload="beforeAvatarUpload">
<img v-if="dataForm.imgUrl"
:src="dataForm.imgUrl"
class="avatar">
<i v-else
class="el-icon-plus avatar-uploader-icon"></i>
<div slot="tip"
class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
</el-form-item>
<el-form-item label="停留时长(秒)" prop="duration" label-width="100">
<el-input-number v-model="dataForm.duration" :min="1" ></el-input-number>
</el-form-item>
<el-form-item label="是否启用" prop="enableFlag">
<el-select v-model="dataForm.enableFlag" placeholder="是否启用" clearable>
<el-option v-for="item in enableFlagArr"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input type="textarea"
:rows="3"
v-model="dataForm.remark" placeholder="备注"
maxlength="2000"></el-input>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()" :disabled="btnAble">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import Cookies from 'js-cookie'
import debounce from 'lodash/debounce'
export default {
data () {
return {
visible: false,
dataForm: {
id: '',
imgUrl: '',
duration: '',
enableFlag: '',
remark: '',
revision: '',
createdBy: '',
createdTime: '',
updatedBy: '',
updatedTime: '',
delFlag: ''
},
uploadUrl: '',
loading: false,
enableFlagArr: [
{
label: '是',
value: '1'
},
{
label: '否',
value: '0'
}
],
btnAble: false
}
},
computed: {
dataRule () {
return {
imgUrl: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
duration: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
enableFlag: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
created () {
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
this.dataForm.imgUrl = ''
},
methods: {
handleAvatarSuccess (res, file) {
this.loading = false
this.dataForm.imgUrl = res.data.url
this.btnAble = false
},
beforeAvatarUpload (file) {
this.loading = true
this.btnAble = true
},
handelError () {
this.loading = false
},
init () {
this.dataForm.imgUrl = ''
this.btnAble = false
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
//
getInfo () {
this.$http.get(`/api/startuppage/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
}).catch(() => {})
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.btnAble = true
this.$http[!this.dataForm.id ? 'post' : 'put']('/api/startuppage/', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.btnAble = false
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {})
})
}, 1000, { 'leading': true, 'trailing': false })
}
}
</script>
<style>
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
</style>

84
src/views/modules/api/startuppage.vue

@ -0,0 +1,84 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-__startuppage}">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-button v-if="$hasPermission('api:startuppage:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column label="序号" header-align="center" align="center" width="50px">
<template slot-scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<el-table-column prop="imgUrl" label="图片" header-align="center" align="center">
<template slot-scope="scope">
<el-image
style="width: 100px; height: 100px"
:src="scope.row.imgUrl"
:preview-src-list="scope.row.imgUrlList">
</el-image>
</template>
</el-table-column>
<el-table-column prop="duration" label="停留时长(秒)" header-align="center" align="center"></el-table-column>
<el-table-column prop="enableFlag" label="是否启用" header-align="center" align="center" :formatter="enableFlagFormat"></el-table-column>
<el-table-column prop="remark" label="备注" header-align="center" align="center" :show-overflow-tooltip='true'></el-table-column>
<el-table-column prop="createdTime" label="创建时间" header-align="center" align="center"></el-table-column>
<el-table-column prop="updatedTime" label="更新时间" header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button v-if="$hasPermission('api:startuppage:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './startuppage-add-or-update'
import 'element-ui/lib/theme-chalk/image.css'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/api/startuppage/page',
getDataListIsPage: true,
deleteURL: '/api/startuppage',
deleteIsBatch: true
},
dataForm: {
id: ''
},
previewImgList: []
}
},
components: {
AddOrUpdate
},
methods: {
enableFlagFormat: function (row, column) {
let enableFlag = row.enableFlag
if (enableFlag === '0') {
return '否'
} else if (enableFlag === '1') {
return '是'
}
}
}
}
</script>

2
src/views/modules/home.vue

@ -2,7 +2,7 @@
<el-card shadow="never"
class="aui-card--fill home_bg_img">
<div class="mod-home">
<h1>欢迎使用精致锦水党建引领管理后台</h1>
<h1 style="color: #fff;">欢迎使用e锦水党建引领管理后台</h1>
</div>
</el-card>
</template>

2
src/views/pages/login.vue

@ -4,7 +4,7 @@
<main class="aui-content">
<div class="login-header">
<h2 class="login-brand"
style="text-transform: none;color:red;">{{ $t('brand.lg') }}</h2>
style="text-transform: none;font-weight: bold;color:#D61618;">{{ $t('brand.lg') }}</h2>
</div>
<div class="login-body">
<h3 class="login-title">{{ $t('login.title') }}</h3>

Loading…
Cancel
Save