Commit d493a532 by Lyan

后台管理

parent aa109009
......@@ -14,7 +14,8 @@ module.exports = {
// 代理列表, 是否开启代理通过[./dev.env.js]配置
proxyTable: devEnv.OPEN_PROXY === false ? {} : {
'/proxyApi': {
target: 'http://81.68.189.225:9091/',
// target: 'http://81.68.189.225:9091/',
target: 'http://192.168.0.77/',
changeOrigin: true,
pathRewrite: {
'^/proxyApi': '/'
......
......@@ -228,34 +228,34 @@ export const menuData = {
'list': null
}
]
},
{
'menuId': 18,
'parentId': 1,
'parentName': null,
'name': '服务管理',
'url': null,
'perms': null,
'type': 0,
'icon': 'suoding',
'orderNum': 0,
'open': null,
'list': [
{
'menuId': 19,
'parentId': 1,
'parentName': null,
'name': '文档管理',
'url': 'service/doc',
'perms': 'manage:doc:save',
'type': 1,
'icon': null,
'orderNum': 1,
'open': null,
'list': null
}
]
}
// {
// 'menuId': 18,
// 'parentId': 1,
// 'parentName': null,
// 'name': '标准服务提供商管理',
// 'url': null,
// 'perms': null,
// 'type': 0,
// 'icon': 'suoding',
// 'orderNum': 0,
// 'open': null,
// 'list': [
// {
// 'menuId': 19,
// 'parentId': 1,
// 'parentName': null,
// 'name': '提供商管理',
// 'url': 'service/partners',
// 'perms': 'manage:logistics:save',
// 'type': 1,
// 'icon': null,
// 'orderNum': 1,
// 'open': null,
// 'list': null
// }
// ]
// }
],
permissions: [
......
......@@ -144,8 +144,8 @@
position: absolute;
top: 0;
right: 50%;
margin-right: -225px;
width: 449px;
margin-right: -275px;
width: 549px;
min-height: 100%;
}
.login-title {
......
......@@ -2,19 +2,19 @@
<div class="mod-config mod-list-form">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item label='显示标题' prop='title'>
<el-input v-model='dataForm.title' placeholder='请输入标题' size="small"></el-input>
<el-input v-model='dataForm.title' placeholder='请输入标题' size="small" clearable></el-input>
</el-form-item>
<el-form-item label='演讲人' prop='author'>
<el-input v-model='dataForm.author' placeholder='请输入演讲人' size="small"></el-input>
<el-input v-model='dataForm.author' placeholder='请输入演讲人' size="small" clearable></el-input>
</el-form-item>
<el-form-item label='编辑' prop='editor'>
<el-input v-model='dataForm.editor' placeholder='请输入编辑' size="small"></el-input>
<el-input v-model='dataForm.editor' placeholder='请输入编辑' size="small" clearable></el-input>
</el-form-item>
<el-form-item label='关键字' prop='keyword'>
<el-input v-model='dataForm.keyword' placeholder='请输入关键字' size="small"></el-input>
<el-input v-model='dataForm.keyword' placeholder='请输入关键字' size="small" clearable></el-input>
</el-form-item>
<el-form-item label='状态' prop='status'>
<el-select v-model="dataForm.status" placeholder="请选择状态" size="small">
<el-select v-model="dataForm.status" placeholder="请选择状态" size="small" clearable>
<el-option
v-for="item in statusList"
:key="item.value"
......@@ -24,7 +24,7 @@
</el-select>
</el-form-item>
<el-form-item label='语种' prop='clanguage'>
<el-select v-model="dataForm.clanguage" placeholder="请输入级别" size="small">
<el-select v-model="dataForm.clanguage" placeholder="请输入级别" size="small" clearable>
<el-option
v-for="item in clanguageList"
:key="item"
......@@ -34,7 +34,7 @@
</el-select>
</el-form-item>
<el-form-item label='级别' prop='levels'>
<el-select v-model="dataForm.levels" placeholder="请输入级别" size="small">
<el-select v-model="dataForm.levels" placeholder="请输入级别" size="small" clearable>
<el-option
v-for="item in levelList"
:key="item"
......@@ -43,9 +43,10 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label='更新日期' prop='updateDate'>
<el-form-item label='更新日期' prop='updateDate' >
<el-date-picker
size="small"
clearable
v-model="updateDate"
type="daterange"
start-placeholder="开始日期"
......@@ -57,6 +58,7 @@
<el-form-item label='发布日期' prop='releaseDate'>
<el-date-picker
size="small"
clearable
v-model="releaseDate"
type="daterange"
start-placeholder="开始日期"
......@@ -263,7 +265,7 @@
'page': this.pageIndex + '',
'limit': this.pageSize + '',
'title': this.dataForm.title,
'levels': this.dataForm.levels,
'levels': this.dataForm.levels + '',
'author': this.dataForm.author,
'editor': this.dataForm.editor,
'keyword': this.dataForm.keyword,
......
<template>
<el-dialog
:title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px" v-loading='loading'>
<el-form-item label="标题:" prop="title">
<el-input v-model="dataForm.title" placeholder="请输入显示标题" size="small" v-show="!showInfo"></el-input>
<p v-show="showInfo">{{dataForm.title}}</p>
</el-form-item>
<el-form-item label='级别:' prop='levels'>
<el-select v-model="dataForm.levels" placeholder="请输入级别" size="small" v-show="!showInfo">
<el-option
v-for="item in levelList"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
<p v-show="showInfo">{{dataForm.levels}}</p>
</el-form-item>
<el-form-item label='类型:' prop='category'>
<el-select v-model="dataForm.category" placeholder="请输入类型" size="small" v-show="!showInfo" @change="changeType">
<el-option label='表格下载' value="1">表格下载</el-option>
<el-option label="分支机构培训计划" value="2">分支机构培训计划</el-option>
</el-select>
<p v-show="showInfo">{{dataForm.category}}</p>
</el-form-item>
<el-form-item label="作者:" prop="author">
<el-input v-model="dataForm.author" placeholder="请输入作者" size="small" v-show="!showInfo"></el-input>
<p v-show="showInfo">{{dataForm.author}}</p>
</el-form-item>
<el-form-item label="文件:" prop="file">
<el-upload
class="upload-demo"
drag
action=""
:show-file-list="false"
:http-request="UploadFile"
:before-upload="beforeUploadFile">
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
</el-upload>
<p v-show="showInfo"><a :href="fileUrlStr"></a></p>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer" v-show="!showInfo">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
loading: false,
showInfo: false,
visible: false,
dataForm: {
id: 0,
title: '',
author: '',
levels: '',
file: '',
category: ''
},
dataRule: {
title: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
author: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
levels: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
category: [
{ required: true, message: '不能为空', trigger: 'blur' }
]
},
fileUrl: new FormData(),
fileUrlStr: '',
dialogVisible: false,
levelList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
typeList: [
{
value: '1',
label: '表格下载'
},
{
value: '2',
label: '分支机构培训计划'
}
],
id: [],
title: ''
}
},
created () {
},
mounted () {
},
methods: {
init (id, showInfo) {
this.dataForm.id = id || 0
this.visible = true
this.showInfo = showInfo
this.$nextTick(() => {
this.clearInp()
if (this.dataForm.id) {
this.loading = true
this.$http({
url: this.$http.adornUrl(`/office/doc/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
this.loading = false
if (data && data.code === 0) {
this.dataForm = data.newsmovie
// this.dataForm.title = data.newsmovie.title
// this.dataForm.titleOld = data.newsmovie.titleOld
// this.dataForm.keyword = data.newsmovie.keyword
// this.dataForm.longStr = data.newsmovie.longStr
// this.dataForm.stdate = data.newsmovie.stdate
// this.dataForm.clanguage = data.newsmovie.clanguage
// this.dataForm.author = data.newsmovie.author
// this.dataForm.levels = data.newsmovie.levels
// this.dataForm.directpath = data.newsmovie.directpath
// this.dataForm.pic = data.newsmovie.pic
// this.dataForm.wavname = data.newsmovie.wavname
// this.dataForm.content = data.newsmovie.content
this.imgUrlStr = data.newsmovie.pic
this.dialogVisible = true
this.videoUrlStr = data.newsmovie.wavname
this.ueditor.value = this.dataForm.content
}
})
}
})
},
// 表单提交
dataFormSubmit () {
this.loading = true
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/office/doc/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'title': this.dataForm.title,
'levels': this.dataForm.levels,
'author': this.dataForm.author,
'docfile': this.dataForm.file
})
}).then(({data}) => {
this.loading = false
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
},
beforeUploadFile (file) {
const isLt100M = file.size / 1024 / 1024 < 10
var index = file.name.lastIndexOf('.')
// 获取后缀
var ext = file.name.substr(index + 1).toLowerCase()
// 输出结果
var extarr = ['doc', 'excel', 'pdf', 'xlsx', 'docx', 'xls']
if (extarr.indexOf(ext) === -1) {
this.$message.error('上传文件只能是doc/docx/excel/xlsx/xls/pdf格式!')
return false
}
alert(file.type)
if (!isLt100M) {
this.$message.error('上传视频大小不能超过100MB哦!')
return false
}
if (file) {
var windowURL = window.URL || window.webkitURL
this.fileUrlStr = windowURL.createObjectURL(file)
this.dialogVisible = true
this.fileUrl.append('file', file)
console.log(this.fileUrlStr)
console.log(file)
}
},
UploadFile () {
this.$http({
url: this.$http.adornUrl('/office/file/uploadFile'),
method: 'post',
data: this.videoUrl,
headers: {
'Content-Type': 'multipart/form-data'
}
})
.then(res => {
console.log(res)
this.dataForm.file = res.data.data
}).catch(err => {
console.log(err)
})
},
clearInp () {
this.$refs['dataForm'].resetFields()
this.fileUrlStr = ''
this.dialogVisible = false
},
changeType (e) {
console.log(e)
}
}
}
</script>
<style scoped>
.form-list{
padding-left: 4%!important;
}
.el-form-item__content{
width: 50%;
}
.el-select,.el-input{
width: 100%;
}
.edui-editor{
width: 100%;
}
</style>
\ No newline at end of file
<template>
<div class="mod-config mod-list-form">
<div class="title">文档管理</div>
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item label='标题' prop='title'>
<el-input v-model='dataForm.title' placeholder='请输入标题' size="small"></el-input>
</el-form-item>
<el-form-item label='级别' prop='levels' >
<el-select v-model="dataForm.levels" placeholder="请输入级别" size="small" clearable>
<el-option
v-for="item in levelList"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</el-form-item>
<el-form-item label='类型' prop='category'>
<el-select v-model="dataForm.category" placeholder="请选择类型" size="small">
<el-option
v-for="item in typeList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-button class="seach-btn" @click="getDataList()" type="primary" size="small">搜索</el-button>
</el-form>
<div class="add-btn">
<el-button v-if="isAuth('manage:news:save')" type="primary" @click="addOrUpdateHandle()"> + 添加</el-button>
</div>
<div class="table-list">
<el-table
:data="dataList"
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
>
<el-table-column
prop="levels"
header-align="center"
align="center"
label="级别">
</el-table-column>
<el-table-column
prop="title"
header-align="center"
align="center"
label="标题">
<template slot-scope="scope">
<div>
<a href="scope.row.docfile">{{scope.row.title}}</a>
</div>
</template>
</el-table-column>
<el-table-column
prop="author"
header-align="center"
align="center"
label="作者">
</el-table-column>
<el-table-column
prop="category"
header-align="center"
align="center"
label="状态">
<template slot-scope="scope">
<div>
<span v-if="scope.row.category === 1">表格下载</span>
<span v-if="scope.row.category === 2">分支机构培训计划</span>
</div>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="checkHandle(scope.row.id,1)">[成功]</el-button>
<el-button type="text" size="small" @click="checkHandle(scope.row.id,-1)">[失败]</el-button>
<br />
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id,true)">预览</el-button>
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</div>
</template>
<script>
import AddOrUpdate from './doc-add-or-update'
export default {
components: {
AddOrUpdate
},
data () {
return {
addOrUpdateVisible: false,
dataForm: {
'title': '',
'category': '',
'levels': ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
typeList: [
{
value: '1',
label: '表格下载'
},
{
value: '2',
label: '分支机构培训计划'
}
],
levelList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
}
},
activated () {
this.getDataList()
},
methods: {
// 获取数据列表
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/office/doc/list'),
method: 'post',
data: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'title': this.dataForm.title,
'levels': this.dataForm.levels,
'type': this.dataForm.type
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle (val) {
this.dataListSelections = val
},
// 新增 / 修改
addOrUpdateHandle (id, showInfo) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id, showInfo)
})
},
// 删除
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/office/doc/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
},
// 审核
checkHandle (id, status) {
let str = ''
if (status === 1) {
str = '成功'
} else {
str = '失败'
}
this.$confirm(`确定对[id=${id}]进行['审核${str}']操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/office/doc/verify'),
method: 'post',
data: this.$http.adornData({
'id': id,
'status': status
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>
......@@ -2,13 +2,15 @@
* 生产环境
*/
;(function () {
window.SITE_CONFIG = {};
window.SITE_CONFIG = {}
// api接口请求地址
window.SITE_CONFIG['baseUrl'] = 'http://demo.open.renren.io/renren-fast-server';
// window.SITE_CONFIG['baseUrl'] = 'http://demo.open.renren.io/renren-fast-server';
// window.SITE_CONFIG['baseUrl'] = 'http://192.168.0.77:9091'
window.SITE_CONFIG['baseUrl'] = ' http://81.68.189.225:9091'
// cdn地址 = 域名 + 版本号
window.SITE_CONFIG['domain'] = './'; // 域名
window.SITE_CONFIG['version'] = ''; // 版本号(年月日时分)
window.SITE_CONFIG['cdnUrl'] = window.SITE_CONFIG.domain + window.SITE_CONFIG.version;
})();
window.SITE_CONFIG['domain'] = './' // 域名
window.SITE_CONFIG['version'] = '' // 版本号(年月日时分)
window.SITE_CONFIG['cdnUrl'] = window.SITE_CONFIG.domain + window.SITE_CONFIG.version
})()
......@@ -2,13 +2,15 @@
* 验收环境
*/
;(function () {
window.SITE_CONFIG = {};
window.SITE_CONFIG = {}
// api接口请求地址
window.SITE_CONFIG['baseUrl'] = 'http://localhost:8080/renren-fast';
// window.SITE_CONFIG['baseUrl'] = 'http://localhost:8080/renren-fast';
// window.SITE_CONFIG['baseUrl'] = ' http://192.168.0.77:9091'
window.SITE_CONFIG['baseUrl'] = ' http://81.68.189.225:9091'
// cdn地址 = 域名 + 版本号
window.SITE_CONFIG['domain'] = './'; // 域名
window.SITE_CONFIG['version'] = ''; // 版本号(年月日时分)
window.SITE_CONFIG['cdnUrl'] = window.SITE_CONFIG.domain + window.SITE_CONFIG.version;
})();
window.SITE_CONFIG['domain'] = './' // 域名
window.SITE_CONFIG['version'] = '' // 版本号(年月日时分)
window.SITE_CONFIG['cdnUrl'] = window.SITE_CONFIG.domain + window.SITE_CONFIG.version
})()
......@@ -2,13 +2,13 @@
* 开发环境
*/
;(function () {
window.SITE_CONFIG = {};
window.SITE_CONFIG = {}
// api接口请求地址
window.SITE_CONFIG['baseUrl'] = 'http://81.68.189.225:9091';
// window.SITE_CONFIG['baseUrl'] = 'http://81.68.189.225:9091'
window.SITE_CONFIG['baseUrl'] = ' http://192.168.0.77:9091'
// cdn地址 = 域名 + 版本号
window.SITE_CONFIG['domain'] = './'; // 域名
window.SITE_CONFIG['version'] = ''; // 版本号(年月日时分)
window.SITE_CONFIG['cdnUrl'] = window.SITE_CONFIG.domain + window.SITE_CONFIG.version;
})();
window.SITE_CONFIG['domain'] = './' // 域名
window.SITE_CONFIG['version'] = '' // 版本号(年月日时分)
window.SITE_CONFIG['cdnUrl'] = window.SITE_CONFIG.domain + window.SITE_CONFIG.version
})()
......@@ -30,7 +30,8 @@
// 服务器统一请求接口路径
// serverUrl: URL + 'jsp/controller.jsp',
serverUrl: 'http://81.68.189.225:9091/office/ueditorConfig',
// serverUrl: 'http://81.68.189.225:9091/office/ueditorConfig',
serverUrl: window.SITE_CONFIG.baseUrl + '/office/ueditorConfig',
// 工具栏上的所有的功能按钮和下拉框,可以在new编辑器的实例时选择自己需要的重新定义
toolbars: [[
......
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 to comment