Commit 6666637e by Lyan

后台bug更改

parent efb57e1d
...@@ -3,13 +3,15 @@ import Vuex from 'vuex' ...@@ -3,13 +3,15 @@ import Vuex from 'vuex'
import cloneDeep from 'lodash/cloneDeep' import cloneDeep from 'lodash/cloneDeep'
import common from './modules/common' import common from './modules/common'
import user from './modules/user' import user from './modules/user'
import config from './modules/config'
Vue.use(Vuex) Vue.use(Vuex)
export default new Vuex.Store({ export default new Vuex.Store({
modules: { modules: {
common, common,
user user,
config
}, },
mutations: { mutations: {
// 重置vuex本地储存状态 // 重置vuex本地储存状态
......
export default {
namespaced: true,
state: {
urls: ''
},
mutations: {
updateUrls (state, urls) {
state.urls = urls
}
}
}
...@@ -7,6 +7,24 @@ ...@@ -7,6 +7,24 @@
<script> <script>
export default { export default {
data () {
return {
}
},
created () {
this.$http({
url: this.$http.adornUrl('/office/domain/api/list'),
method: 'get'
}).then(({data}) => {
if (data && data.code === 0) {
this.$store.commit('config/updateUrls', data.data)
console.log(this.$store.state.config.urls)
} else {
this.$message.error(data.msg)
}
}).catch(() => {})
}
} }
</script> </script>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
:close-on-click-modal="false" :close-on-click-modal="false"
:visible.sync="visible"> :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px" v-loading='loading'> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px">
<el-form-item label='分类:' prop='announcetype'> <el-form-item label='分类:' prop='announcetype'>
<el-select v-model="dataForm.announcetype" placeholder="请选择分类" clearable> <el-select v-model="dataForm.announcetype" placeholder="请选择分类" clearable>
<el-option <el-option
...@@ -61,8 +61,8 @@ ...@@ -61,8 +61,8 @@
:before-upload="beforeAvatarUpload"> :before-upload="beforeAvatarUpload">
<el-button size="small" type="primary">点击上传</el-button> <el-button size="small" type="primary">点击上传</el-button>
</el-upload> </el-upload>
<a v-if="fileUrlStr" :href="fileUrlStr" target="_blank">{{fileUrlStr}}</a> <a v-if="dataForm.fileurl" :href="dataForm.fileurl" target="_blank" style="line-height:18px">{{dataForm.fileurl}}</a>
<p v-show="showInfo"><a :href="fileUrlStr">{{fileUrlStr}}</a></p> <p v-show="showInfo"><a :href="dataForm.fileurl">{{dataForm.fileurl}}</a></p>
</el-form-item> </el-form-item>
<el-form-item label="文章内容:" prop="content" > <el-form-item label="文章内容:" prop="content" >
<Ueditor @ready="editorReady" :value="ueditor.value" :config="ueditor.config" ref="ue" v-show="!showInfo" ></Ueditor> <Ueditor @ready="editorReady" :value="ueditor.value" :config="ueditor.config" ref="ue" v-show="!showInfo" ></Ueditor>
...@@ -127,9 +127,9 @@ ...@@ -127,9 +127,9 @@
type: [ type: [
{ required: true, message: '不能为空', trigger: 'blur' } { required: true, message: '不能为空', trigger: 'blur' }
], ],
// fileurl: [ announcetype: [
// { required: true, message: '不能为空', trigger: 'blur' } { required: true, message: '不能为空', trigger: 'blur' }
// ], ],
showtime: [ showtime: [
{ required: true, message: '不能为空', trigger: 'blur' } { required: true, message: '不能为空', trigger: 'blur' }
...@@ -246,7 +246,6 @@ ...@@ -246,7 +246,6 @@
.then(res => { .then(res => {
console.log(res) console.log(res)
this.dataForm.fileurl = res.data.data this.dataForm.fileurl = res.data.data
this.fileUrlStr = res.data.data
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)
}) })
...@@ -254,7 +253,7 @@ ...@@ -254,7 +253,7 @@
clearInp () { clearInp () {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
this.fileUrlStr = '' this.dataForm.fileurl = ''
this.dialogVisible = false this.dialogVisible = false
this.ueditor.value = '' this.ueditor.value = ''
}, },
......
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
label="分类"> label="分类">
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
{{scope.row.announcetype==1?'中心公告':scope.row.announcetype==2?'地方公告':''}} {{scope.row.announcetype==1?'中心公告':scope.row.announcetype==3?'地方公告':''}}
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -205,11 +205,11 @@ ...@@ -205,11 +205,11 @@
], ],
typeList: [ typeList: [
{ {
value: '1', value: 1,
label: '中心公告' label: '中心公告'
}, },
{ {
value: '2', value: 3,
label: '地方公告' label: '地方公告'
} }
], ],
......
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
:title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'" :title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'"
:close-on-click-modal="false" :close-on-click-modal="false"
:visible.sync="visible"> :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px" v-loading='loading'> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px" >
<el-form-item label="标题:" prop="title"> <el-form-item label="标题:" prop="title">
<el-input v-model="dataForm.title" placeholder="请输入标题" v-show="!showInfo"></el-input> <el-input v-model="dataForm.title" placeholder="请输入标题" v-show="!showInfo"></el-input>
<p v-show="showInfo">{{dataForm.title}}</p> <p v-show="showInfo">{{dataForm.title}}</p>
</el-form-item> </el-form-item>
<el-form-item label="背景颜色:" prop="colorBackground" class=" setdes setdes1"> <el-form-item label="背景颜色:" prop="colorBackground" class=" setdes setdes1">
<el-row> <el-row v-show="!showInfo">
<el-col :span="22"> <el-col :span="22">
<el-select v-model="dataForm.colorBackground" placeholder="请选择背景颜色" v-show="!showInfo"> <el-select v-model="dataForm.colorBackground" placeholder="请选择背景颜色" v-show="!showInfo">
<el-option <el-option
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</el-form-item> </el-form-item>
<el-form-item label="按钮跳转色:" prop="colorMore" class="setdes setdes1"> <el-form-item label="按钮跳转色:" prop="colorMore" class="setdes setdes1">
<el-row> <el-row v-show="!showInfo">
<el-col :span="22"> <el-col :span="22">
<el-select v-model="dataForm.colorMore" placeholder="请选择背景颜色" v-show="!showInfo"> <el-select v-model="dataForm.colorMore" placeholder="请选择背景颜色" v-show="!showInfo">
<el-option <el-option
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
<p v-show="showInfo">{{dataForm.classnum}}</p> <p v-show="showInfo">{{dataForm.classnum}}</p>
</el-form-item> </el-form-item>
<el-form-item label='等级:' prop='levels' class="setdes setdes2"> <el-form-item label='等级:' prop='levels' class="setdes setdes2">
<el-row> <el-row v-show="!showInfo">
<el-col :span="22"> <el-col :span="22">
<el-select v-model="dataForm.levels" placeholder="请输入等级" v-show="!showInfo"> <el-select v-model="dataForm.levels" placeholder="请输入等级" v-show="!showInfo">
<el-option <el-option
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
<p v-show="showInfo">{{dataForm.directpath}}</p> <p v-show="showInfo">{{dataForm.directpath}}</p>
</el-form-item> </el-form-item>
<el-form-item label="轮播简介:" prop="brief" class="setdes setdes1"> <el-form-item label="轮播简介:" prop="brief" class="setdes setdes1">
<el-row> <el-row v-show="!showInfo">
<el-col :span="22"> <el-col :span="22">
<el-input type="textarea" rows="5" v-model="dataForm.brief" placeholder="请输入简介" v-show="!showInfo"></el-input> <el-input type="textarea" rows="5" v-model="dataForm.brief" placeholder="请输入简介" v-show="!showInfo"></el-input>
</el-col> </el-col>
......
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
<el-button v-if="isAuth('manage:indexcarouselmanage:check')" type="text" size="small" @click="checkHandle(scope.row.id,1)">[成功]</el-button> <el-button v-if="isAuth('manage:indexcarouselmanage:check')" type="text" size="small" @click="checkHandle(scope.row.id,1)">[成功]</el-button>
<el-button v-if="isAuth('manage:indexcarouselmanage:check')" type="text" size="small" @click="checkHandle(scope.row.id,-1)">[失败]</el-button> <el-button v-if="isAuth('manage:indexcarouselmanage:check')" type="text" size="small" @click="checkHandle(scope.row.id,-1)">[失败]</el-button>
<br v-if="isAuth('manage:indexcarouselmanage:check')"/> <br v-if="isAuth('manage:indexcarouselmanage:check')"/>
<el-button v-if="isAuth('manage:indexcarouselmanage:info')" type="text" size="small" @click="showMsg(scope.row.id)">预览</el-button> <el-button v-if="isAuth('manage:indexcarouselmanage:info')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id,true)">预览</el-button>
<el-button v-if="isAuth('manage:indexcarouselmanage:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button> <el-button v-if="isAuth('manage:indexcarouselmanage:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button v-if="isAuth('manage:indexcarouselmanage:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button> <el-button v-if="isAuth('manage:indexcarouselmanage:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template> </template>
...@@ -203,7 +203,8 @@ ...@@ -203,7 +203,8 @@
label: '小轮播' label: '小轮播'
} }
], ],
releaseDate: [] releaseDate: [],
urls: this.$store.state.config.urls
} }
}, },
activated () { activated () {
...@@ -262,7 +263,7 @@ ...@@ -262,7 +263,7 @@
}) })
}, },
showMsg (id) { showMsg (id) {
window.open(window.location.host + '/News/msg?id=' + id, '_blank') window.open(this.urls + '/News/msg?id=' + id, '_blank')
}, },
// 删除 // 删除
deleteHandle (id) { deleteHandle (id) {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
:title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'" :title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'"
:close-on-click-modal="false" :close-on-click-modal="false"
:visible.sync="visible"> :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px" v-loading='loading'> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px" >
<el-form-item label="原始标题:" prop="titleOld"> <el-form-item label="原始标题:" prop="titleOld">
<el-input v-model="dataForm.titleOld" placeholder="请输入原始标题" v-show="!showInfo"></el-input> <el-input v-model="dataForm.titleOld" placeholder="请输入原始标题" v-show="!showInfo"></el-input>
<p v-show="showInfo">{{dataForm.titleOld}}</p> <p v-show="showInfo">{{dataForm.titleOld}}</p>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
:title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'" :title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'"
:close-on-click-modal="false" :close-on-click-modal="false"
:visible.sync="visible"> :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="130px" v-loading='loading'> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="130px">
<el-form-item label="原始标题:" prop="titleOld"> <el-form-item label="原始标题:" prop="titleOld">
<el-input v-model="dataForm.titleOld" placeholder="请输入原始标题" v-show="!showInfo"></el-input> <el-input v-model="dataForm.titleOld" placeholder="请输入原始标题" v-show="!showInfo"></el-input>
</el-form-item> </el-form-item>
...@@ -190,6 +190,7 @@ ...@@ -190,6 +190,7 @@
}, },
methods: { methods: {
init (id, showInfo) { init (id, showInfo) {
this.ueditor.value = ''
this.dataForm.id = id || 0 this.dataForm.id = id || 0
this.visible = true this.visible = true
this.showInfo = showInfo this.showInfo = showInfo
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
:title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'" :title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'"
:close-on-click-modal="false" :close-on-click-modal="false"
:visible.sync="visible"> :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px" v-loading='loading'> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px" >
<el-form-item label="专题描述:" prop="title"> <el-form-item label="专题描述:" prop="title">
<el-input v-model="dataForm.title" placeholder="请输入专题描述" v-show="!showInfo"></el-input> <el-input v-model="dataForm.title" placeholder="请输入专题描述" v-show="!showInfo"></el-input>
<p v-show="showInfo">{{dataForm.title}}</p> <p v-show="showInfo">{{dataForm.title}}</p>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
ref='dataForm' ref='dataForm'
@keyup.enter.native='dataFormSubmit()' @keyup.enter.native='dataFormSubmit()'
label-width='100px' label-width='100px'
v-loading='loading'
> >
<el-form-item label='标题:' prop='title'> <el-form-item label='标题:' prop='title'>
<el-input v-model='dataForm.title' placeholder='请输入标题' v-show="!showInfo"></el-input> <el-input v-model='dataForm.title' placeholder='请输入标题' v-show="!showInfo"></el-input>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<p v-show="showInfo">{{dataForm.piclevel}}</p> <p v-show="showInfo">{{dataForm.piclevel}}</p>
</el-form-item> </el-form-item>
<el-form-item label='显示时间:' prop='showtime' class="setdes"> <el-form-item label='显示时间:' prop='showtime' class="setdes">
<el-row> <el-row v-show="!showInfo">
<el-col :span="22"> <el-col :span="22">
<el-date-picker <el-date-picker
v-show="!showInfo" v-show="!showInfo"
......
...@@ -66,12 +66,7 @@ ...@@ -66,12 +66,7 @@
border border
style="width: 100%; " style="width: 100%; "
> >
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column prop="piclevel" header-align="center" align="center" label="级别"> </el-table-column> <el-table-column prop="piclevel" header-align="center" align="center" label="级别"> </el-table-column>
<el-table-column prop="title" header-align="center" align="center" label="标题"> <el-table-column prop="title" header-align="center" align="center" label="标题">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -105,7 +100,7 @@ ...@@ -105,7 +100,7 @@
<el-button v-if="isAuth('manage:picture:check')" type="text" size="small" @click="checkHandle(scope.row.pictureid,1)">[成功]</el-button> <el-button v-if="isAuth('manage:picture:check')" type="text" size="small" @click="checkHandle(scope.row.pictureid,1)">[成功]</el-button>
<el-button v-if="isAuth('manage:picture:check')" type="text" size="small" @click="checkHandle(scope.row.pictureid,-1)">[失败]</el-button> <el-button v-if="isAuth('manage:picture:check')" type="text" size="small" @click="checkHandle(scope.row.pictureid,-1)">[失败]</el-button>
<br v-if="isAuth('manage:picture:check')" /> <br v-if="isAuth('manage:picture:check')" />
<el-button v-if="isAuth('manage:picture:info')" type="text" size="small" @click="showMsg(scope.row.pictureid)">预览</el-button> <el-button v-if="isAuth('manage:picture:info')" type="text" size="small" @click="addOrUpdateHandle(scope.row.pictureid,true)">预览</el-button>
<el-button v-if="isAuth('manage:picture:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.pictureid)">修改</el-button> <el-button v-if="isAuth('manage:picture:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.pictureid)">修改</el-button>
<el-button v-if="isAuth('manage:picture:delete')" type="text" size="small" @click="deleteHandle(scope.row.pictureid)">删除</el-button> <el-button v-if="isAuth('manage:picture:delete')" type="text" size="small" @click="deleteHandle(scope.row.pictureid)">删除</el-button>
</template> </template>
...@@ -229,7 +224,7 @@ ...@@ -229,7 +224,7 @@
}) })
}, },
showMsg (id) { showMsg (id) {
window.open(window.location.host + '/News/msg?id=' + id, '_blank') window.open(this.$store.state.config.urls + '/News/msg?id=' + id, '_blank')
}, },
// 删除 // 删除
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
:title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'" :title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'"
:close-on-click-modal="false" :close-on-click-modal="false"
:visible.sync="visible"> :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px" v-loading='loading'> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px" >
<el-form-item label="原始标题:" prop="oldtitle"> <el-form-item label="原始标题:" prop="oldtitle">
<el-input v-model="dataForm.oldtitle" placeholder="请输入显示标题" v-show="!showInfo"></el-input> <el-input v-model="dataForm.oldtitle" placeholder="请输入显示标题" v-show="!showInfo"></el-input>
<p v-show="showInfo">{{dataForm.titleOld}}</p> <p v-show="showInfo">{{dataForm.titleOld}}</p>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
:title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'" :title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'"
:close-on-click-modal="false" :close-on-click-modal="false"
:visible.sync="visible"> :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px" v-loading='loading'> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px" >
<el-form-item label="标题:" prop="title"> <el-form-item label="标题:" prop="title">
<el-input v-model="dataForm.title" placeholder="请输入显示标题" v-show="!showInfo"></el-input> <el-input v-model="dataForm.title" placeholder="请输入显示标题" v-show="!showInfo"></el-input>
<p v-show="showInfo">{{dataForm.title}}</p> <p v-show="showInfo">{{dataForm.title}}</p>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
:title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'" :title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'"
:close-on-click-modal="false" :close-on-click-modal="false"
:visible.sync="visible"> :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="130px" v-loading='loading'> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="130px" >
<el-form-item label="原始标题:" prop="titleOld"> <el-form-item label="原始标题:" prop="titleOld">
<el-input v-model="dataForm.titleOld" placeholder="请输入原始标题" v-show="!showInfo"></el-input> <el-input v-model="dataForm.titleOld" placeholder="请输入原始标题" v-show="!showInfo"></el-input>
<p v-show="showInfo">{{dataForm.titleOld}}</p> <p v-show="showInfo">{{dataForm.titleOld}}</p>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
:title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'" :title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'"
:close-on-click-modal="false" :close-on-click-modal="false"
:visible.sync="visible"> :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="130px" v-loading='loading'> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="130px" >
<el-form-item label="原始标题:" prop="titleOld"> <el-form-item label="原始标题:" prop="titleOld">
<el-input v-model="dataForm.titleOld" placeholder="请输入原始标题" v-show="!showInfo"></el-input> <el-input v-model="dataForm.titleOld" placeholder="请输入原始标题" v-show="!showInfo"></el-input>
<p v-show="showInfo">{{dataForm.titleOld}}</p> <p v-show="showInfo">{{dataForm.titleOld}}</p>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
:title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'" :title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'"
:close-on-click-modal="false" :close-on-click-modal="false"
:visible.sync="visible"> :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="130px" v-loading='loading'> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="130px" >
<el-form-item label="原始标题:" prop="titleOld"> <el-form-item label="原始标题:" prop="titleOld">
<el-input v-model="dataForm.titleOld" placeholder="请输入原始标题" v-show="!showInfo"></el-input> <el-input v-model="dataForm.titleOld" placeholder="请输入原始标题" v-show="!showInfo"></el-input>
<p v-show="showInfo">{{dataForm.titleOld}}</p> <p v-show="showInfo">{{dataForm.titleOld}}</p>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
:title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'" :title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'"
:close-on-click-modal="false" :close-on-click-modal="false"
:visible.sync="visible"> :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="130px" v-loading='loading'> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="130px" >
<el-form-item label="原始标题:" prop="titleOld"> <el-form-item label="原始标题:" prop="titleOld">
<el-input v-model="dataForm.titleOld" placeholder="请输入原始标题" v-show="!showInfo"></el-input> <el-input v-model="dataForm.titleOld" placeholder="请输入原始标题" v-show="!showInfo"></el-input>
<p v-show="showInfo">{{dataForm.titleOld}}</p> <p v-show="showInfo">{{dataForm.titleOld}}</p>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
:title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'" :title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'"
:close-on-click-modal="false" :close-on-click-modal="false"
:visible.sync="visible"> :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px" v-loading='loading'> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px" >
<el-form-item label="原始标题:" prop="titleOld"> <el-form-item label="原始标题:" prop="titleOld">
<el-input v-model="dataForm.titleOld" placeholder="请输入显示标题" v-show="!showInfo"></el-input> <el-input v-model="dataForm.titleOld" placeholder="请输入显示标题" v-show="!showInfo"></el-input>
<p v-show="showInfo">{{dataForm.titleOld}}</p> <p v-show="showInfo">{{dataForm.titleOld}}</p>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
:title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'" :title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'"
:close-on-click-modal="false" :close-on-click-modal="false"
:visible.sync="visible"> :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px" v-loading='loading'> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px" >
<el-form-item label="标题:" prop="title"> <el-form-item label="标题:" prop="title">
<el-input v-model="dataForm.title" placeholder="请输入显示标题" v-show="!showInfo"></el-input> <el-input v-model="dataForm.title" placeholder="请输入显示标题" v-show="!showInfo"></el-input>
<p v-show="showInfo">{{dataForm.title}}</p> <p v-show="showInfo">{{dataForm.title}}</p>
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<p v-show="showInfo">{{dataForm.author}}</p> <p v-show="showInfo">{{dataForm.author}}</p>
</el-form-item> </el-form-item>
<el-form-item label="文件:" prop="file"> <el-form-item label="文件:" prop="file">
<el-upload <!-- <el-upload
class="upload-demo" class="upload-demo"
drag drag
action="" action=""
...@@ -40,8 +40,18 @@ ...@@ -40,8 +40,18 @@
:before-upload="beforeUploadFile"> :before-upload="beforeUploadFile">
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
</el-upload> -->
<el-upload
v-show="!showInfo"
class="avatar-uploaderFile"
action=""
:show-file-list="false"
:http-request="UploadFile"
:before-upload="beforeUploadFile">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload> </el-upload>
<p v-show="showInfo"><a :href="fileUrlStr"></a></p> <a :href="dataForm.docfile" target="_blank">{{dataForm.docfile}}</a>
<p v-show="showInfo"><a :href="dataForm.docfile"></a></p>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -65,7 +75,7 @@ ...@@ -65,7 +75,7 @@
title: '', title: '',
author: '', author: '',
levels: '', levels: '',
file: '', docfile: '',
category: '' category: ''
}, },
dataRule: { dataRule: {
...@@ -89,11 +99,11 @@ ...@@ -89,11 +99,11 @@
levelList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], levelList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
typeList: [ typeList: [
{ {
value: '1', value: 1,
label: '表格下载' label: '表格下载'
}, },
{ {
value: '2', value: 2,
label: '分支机构培训计划' label: '分支机构培训计划'
} }
], ],
...@@ -122,7 +132,8 @@ ...@@ -122,7 +132,8 @@
}).then(({data}) => { }).then(({data}) => {
this.loading = false this.loading = false
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataForm = data.newsmovie this.dataForm = data.doc
this.dataForm.category = data.doc.category + ''
// this.dataForm.title = data.newsmovie.title // this.dataForm.title = data.newsmovie.title
// this.dataForm.titleOld = data.newsmovie.titleOld // this.dataForm.titleOld = data.newsmovie.titleOld
// this.dataForm.keyword = data.newsmovie.keyword // this.dataForm.keyword = data.newsmovie.keyword
...@@ -135,10 +146,6 @@ ...@@ -135,10 +146,6 @@
// this.dataForm.pic = data.newsmovie.pic // this.dataForm.pic = data.newsmovie.pic
// this.dataForm.wavname = data.newsmovie.wavname // this.dataForm.wavname = data.newsmovie.wavname
// this.dataForm.content = data.newsmovie.content // 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
} }
}) })
} }
...@@ -157,7 +164,7 @@ ...@@ -157,7 +164,7 @@
'title': this.dataForm.title, 'title': this.dataForm.title,
'levels': this.dataForm.levels, 'levels': this.dataForm.levels,
'author': this.dataForm.author, 'author': this.dataForm.author,
'docfile': this.dataForm.file 'docfile': this.dataForm.docfile
}) })
}).then(({data}) => { }).then(({data}) => {
this.loading = false this.loading = false
...@@ -185,13 +192,12 @@ ...@@ -185,13 +192,12 @@
// 获取后缀 // 获取后缀
var ext = file.name.substr(index + 1).toLowerCase() var ext = file.name.substr(index + 1).toLowerCase()
// 输出结果 // 输出结果
var extarr = ['doc', 'excel', 'pdf', 'xlsx', 'docx', 'xls'] var extarr = ['doc', 'excel', 'pdf', 'xlsx', 'docx', 'xls', 'txt', 'rar', 'zip']
if (extarr.indexOf(ext) === -1) { if (extarr.indexOf(ext) === -1) {
this.$message.error('上传文件只能是doc/docx/excel/xlsx/xls/pdf格式!') this.$message.error('上传文件只能是doc/docx/excel/xlsx/xls/pdf/txt/rar/zip格式!')
return false return false
} }
alert(file.type)
if (!isLt100M) { if (!isLt100M) {
this.$message.error('上传视频大小不能超过100MB哦!') this.$message.error('上传视频大小不能超过100MB哦!')
...@@ -217,9 +223,14 @@ ...@@ -217,9 +223,14 @@
}) })
.then(res => { .then(res => {
console.log(res) console.log(res)
this.dataForm.file = res.data.data if (res.data.code === 500) {
this.$message.error(res.data.message)
} else {
this.dataForm.docfile = res.data.data
}
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)
this.$message.error('上传失败')
}) })
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="mod-config mod-list-form"> <div class="mod-config mod-list-form">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()" label-width="80px"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()" label-width="80px">
<el-form-item label='标题' prop='title'> <el-form-item label='标题' prop='title'>
<el-input v-model='dataForm.title' placeholder='请输入标题' ></el-input> <el-input v-model='dataForm.title' placeholder='请输入标题' clearable ></el-input>
</el-form-item> </el-form-item>
<el-form-item label='级别' prop='levels' > <el-form-item label='级别' prop='levels' >
<el-select v-model="dataForm.levels" placeholder="请输入级别" clearable> <el-select v-model="dataForm.levels" placeholder="请输入级别" clearable>
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label='类型' prop='category'> <el-form-item label='类型' prop='category'>
<el-select v-model="dataForm.category" placeholder="请选择类型"> <el-select v-model="dataForm.category" placeholder="请选择类型" clearable>
<el-option <el-option
v-for="item in typeList" v-for="item in typeList"
:key="item.value" :key="item.value"
...@@ -48,11 +48,6 @@ ...@@ -48,11 +48,6 @@
header-align="center" header-align="center"
align="center" align="center"
label="标题"> label="标题">
<template slot-scope="scope">
<div>
<a href="scope.row.docfile">{{scope.row.title}}</a>
</div>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="author" prop="author"
...@@ -90,7 +85,7 @@ ...@@ -90,7 +85,7 @@
<el-button v-if="isAuth('manage:doc:check')" type="text" size="small" @click="checkHandle(scope.row.id,1)">[成功]</el-button> <el-button v-if="isAuth('manage:doc:check')" type="text" size="small" @click="checkHandle(scope.row.id,1)">[成功]</el-button>
<el-button v-if="isAuth('manage:doc:check')" type="text" size="small" @click="checkHandle(scope.row.id,-1)">[失败]</el-button> <el-button v-if="isAuth('manage:doc:check')" type="text" size="small" @click="checkHandle(scope.row.id,-1)">[失败]</el-button>
<br v-if="isAuth('manage:doc:check')"/> <br v-if="isAuth('manage:doc:check')"/>
<el-button v-if="isAuth('manage:doc:info')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id,true)">预览</el-button> <el-button v-if="isAuth('manage:doc:info')" type="text" size="small" @click="downFile(scope.row.docfile)">预览</el-button>
<el-button v-if="isAuth('manage:doc:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button> <el-button v-if="isAuth('manage:doc:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button v-if="isAuth('manage:doc:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button> <el-button v-if="isAuth('manage:doc:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template> </template>
...@@ -260,6 +255,9 @@ ...@@ -260,6 +255,9 @@
} }
}) })
}) })
},
downFile (file) {
window.open(file, '_blank')
} }
} }
} }
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
// api接口请求地址 // 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://192.168.0.77:9091'
window.SITE_CONFIG['baseUrl'] = ' http://81.68.189.225:9091' // window.SITE_CONFIG['baseUrl'] = ' http://81.68.189.225:9091'
// cdn地址 = 域名 + 版本号 // cdn地址 = 域名 + 版本号
window.SITE_CONFIG['domain'] = './' // 域名 window.SITE_CONFIG['domain'] = './' // 域名
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
window.SITE_CONFIG = {} window.SITE_CONFIG = {}
// api接口请求地址 // 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' window.SITE_CONFIG['baseUrl'] = 'http://192.168.0.77:9091'
// cdn地址 = 域名 + 版本号 // cdn地址 = 域名 + 版本号
window.SITE_CONFIG['domain'] = './' // 域名 window.SITE_CONFIG['domain'] = './' // 域名
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
// api接口请求地址 // 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://192.168.0.77:9091'
window.SITE_CONFIG['baseUrl'] = ' http://81.68.189.225:9091' // window.SITE_CONFIG['baseUrl'] = ' http://81.68.189.225:9091'
// cdn地址 = 域名 + 版本号 // cdn地址 = 域名 + 版本号
window.SITE_CONFIG['domain'] = './' // 域名 window.SITE_CONFIG['domain'] = './' // 域名
......
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