Commit 76f51f9d by Lyan

页面样式更改

parent 5efb5239
...@@ -434,13 +434,37 @@ img { ...@@ -434,13 +434,37 @@ img {
>.el-form,>.table-list,>.add-btn,.form-list,.sub-btn{ >.el-form,>.table-list,>.add-btn,.form-list,.sub-btn{
width: 96%; width: 96%;
margin-left: 2%; // margin-left: 2%;
background-color: #fff; background-color: #fff;
} }
.avatar-uploader>.el-upload {
border: 2px dashed #666666;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
.avatar-uploader-icon {
font-size: 40px;
color: #666666;
width: 64px;
height: 64px;
line-height: 64px;
text-align: center;
}
.avatar {
width: 64px;
height: 64px;
display: block;
}
.form-list{ .form-list{
margin-top: 20px; // margin-top: 20px;
padding: 40px 0 100px 20%; // padding: 40px 0 100px 20%;
color: rgba(0, 0, 0, 0.847058823529412); color: rgba(0, 0, 0, 0.847058823529412);
.base-info{ .base-info{
font-family: 'PingFangSC-Semibold', 'PingFang SC Semibold', 'PingFang SC'; font-family: 'PingFangSC-Semibold', 'PingFang SC Semibold', 'PingFang SC';
...@@ -488,29 +512,7 @@ img { ...@@ -488,29 +512,7 @@ img {
.el-form-item{ .el-form-item{
margin-bottom:32px; margin-bottom:32px;
} }
.avatar-uploader>.el-upload {
border: 2px dashed #666666;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
.avatar-uploader-icon {
font-size: 40px;
color: #666666;
width: 64px;
height: 64px;
line-height: 64px;
text-align: center;
}
.avatar {
width: 64px;
height: 64px;
display: block;
}
} }
.sub-btn{ .sub-btn{
margin-top: 20px; margin-top: 20px;
...@@ -527,7 +529,7 @@ img { ...@@ -527,7 +529,7 @@ img {
} }
>.el-form{ >.el-form{
position: relative; position: relative;
margin-top: 25px; // margin-top: 25px;
padding-top: 25px; padding-top: 25px;
border-bottom: 1px solid rgba(242, 242, 242, 1); border-bottom: 1px solid rgba(242, 242, 242, 1);
...@@ -572,14 +574,14 @@ img { ...@@ -572,14 +574,14 @@ img {
border-top-color:#666 border-top-color:#666
} }
.cell { .cell {
white-space: pre-line; // white-space: pre-line;
} }
} }
.el-table td.is-center, .el-table th.is-center{ .el-table td.is-center, .el-table th.is-center{
text-align: left; text-align: left;
font-weight: 500; font-weight: 500;
font-style: normal; font-style: normal;
font-size: 14px; // font-size: 14px;
color: #656565; color: #656565;
line-height: 18px; line-height: 18px;
} }
...@@ -592,6 +594,12 @@ img { ...@@ -592,6 +594,12 @@ img {
} }
} }
.el-dialog__body{
p{
font-size: 12px;
line-height: 12px;
}
}
} }
......
...@@ -36,6 +36,8 @@ const mainRoutes = { ...@@ -36,6 +36,8 @@ const mainRoutes = {
// 提示: 如需要通过iframe嵌套展示内容, 但不通过tab打开, 请自行创建组件使用iframe处理! // 提示: 如需要通过iframe嵌套展示内容, 但不通过tab打开, 请自行创建组件使用iframe处理!
{ path: '/home', component: _import('common/home'), name: 'home', meta: { title: '首页' } }, { path: '/home', component: _import('common/home'), name: 'home', meta: { title: '首页' } },
{ path: '/theme', component: _import('common/theme'), name: 'theme', meta: { title: '主题' } }, { path: '/theme', component: _import('common/theme'), name: 'theme', meta: { title: '主题' } },
{ path: '/demo-echarts', component: _import('demo/echarts'), name: 'demo-echarts', meta: { title: 'demo-echarts', isTab: true } },
{ path: '/demo-ueditor', component: _import('demo/ueditor'), name: 'demo-ueditor', meta: { title: 'demo-ueditor', isTab: true } },
{ path: '/picture-add', component: _import('modules/info/picture-add-or-update'), name: 'picture-add', meta: { title: '图片资讯添加', isTab: true } }, { path: '/picture-add', component: _import('modules/info/picture-add-or-update'), name: 'picture-add', meta: { title: '图片资讯添加', isTab: true } },
{ path: '/picture-update', component: _import('modules/info/picture-add-or-update'), name: 'picture-update', meta: { title: '图片资讯编辑', isTab: true } }, { path: '/picture-update', component: _import('modules/info/picture-add-or-update'), name: 'picture-update', meta: { title: '图片资讯编辑', isTab: true } },
......
<template> <template>
<div class="mod-config"> <el-dialog
<div class="title">{{title}}</div> :title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'"
<div class="form-list"> :close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="100px" v-loading='loading'> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" 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="请输入标题" size="small" v-show="!showInfo"></el-input> <el-input v-model="dataForm.title" placeholder="请输入标题" size="small" v-show="!showInfo"></el-input>
...@@ -80,14 +81,11 @@ ...@@ -80,14 +81,11 @@
<p><img :src="imgUrlStr" class="avatar" v-show="showInfo"></p> <p><img :src="imgUrlStr" class="avatar" v-show="showInfo"></p>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> <span slot="footer" class="dialog-footer" v-show="!showInfo">
<div class="sub-btn" v-show="!showInfo"> <el-button @click="visible = false">取消</el-button>
<span slot='footer' class='dialog-footer'> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<el-button @click='clearInp()'>重置</el-button> </span>
<el-button type='primary' @click='dataFormSubmit()'>确定</el-button> </el-dialog>
</span>
</div>
</div>
</template> </template>
<script> <script>
...@@ -95,7 +93,8 @@ ...@@ -95,7 +93,8 @@
data () { data () {
return { return {
loading: false, loading: false,
showInfo: !!this.$route.query.showInfo, showInfo: false,
visible: false,
title: '', title: '',
dataForm: { dataForm: {
id: 0, id: 0,
...@@ -167,25 +166,19 @@ ...@@ -167,25 +166,19 @@
mounted () { mounted () {
}, },
activated () {
if (this.$route.query.id) {
this.init(this.$route.query.id)
} else {
this.clearInp()
}
this.title = !this.$route.query.id ? '添加首页轮播' : '修改首页轮播'
},
created () { created () {
this.$route.meta.title = !this.$route.query.id ? '添加首页轮播' : '修改首页轮播' this.$route.meta.title = !this.$route.query.id ? '添加首页轮播' : '修改首页轮播'
}, },
methods: { methods: {
init (id) { init (id, showInfo) {
this.loading = true
this.dataForm.id = id || 0 this.dataForm.id = id || 0
this.visible = true this.visible = true
this.showInfo = showInfo
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.clearInp()
if (this.dataForm.id) { if (this.dataForm.id) {
this.loading = true
this.$http({ this.$http({
url: this.$http.adornUrl(`/office/indexCarouselManage/info/${this.dataForm.id}`), url: this.$http.adornUrl(`/office/indexCarouselManage/info/${this.dataForm.id}`),
method: 'get', method: 'get',
...@@ -235,7 +228,8 @@ ...@@ -235,7 +228,8 @@
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.$router.push({name: 'info-indexcarouselmanage'}) this.visible = false
this.$emit('refreshDataList')
} }
}) })
} else { } else {
......
<template> <template>
<div class="mod-config mod-list-form"> <div class="mod-config mod-list-form">
<div class="title">首页轮播图管理</div>
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item label='标题' prop='title'> <el-form-item label='标题' prop='title'>
<el-input v-model='dataForm.title' placeholder='请输入标题' size="small" clearable></el-input> <el-input v-model='dataForm.title' placeholder='请输入标题' size="small" clearable></el-input>
...@@ -50,7 +49,7 @@ ...@@ -50,7 +49,7 @@
<el-button class="seach-btn" @click="getDataList()" type="primary" size="small">搜索</el-button> <el-button class="seach-btn" @click="getDataList()" type="primary" size="small">搜索</el-button>
</el-form> </el-form>
<div class="add-btn"> <div class="add-btn">
<el-button v-if="isAuth('manage:picture:save')" type="primary" @click="addOrUpdateHandle()"> + 添加首页轮播</el-button> <el-button v-if="isAuth('manage:picture:save')" type="primary" @click="addOrUpdateHandle()"> + 添加</el-button>
</div> </div>
<div class="table-list"> <div class="table-list">
<el-table <el-table
...@@ -135,8 +134,8 @@ ...@@ -135,8 +134,8 @@
<el-button type="text" @click="checkHandle(scope.row.id,1)">[成功]</el-button> <el-button type="text" @click="checkHandle(scope.row.id,1)">[成功]</el-button>
<el-button type="text" @click="checkHandle(scope.row.id,-1)">[失败]</el-button> <el-button type="text" @click="checkHandle(scope.row.id,-1)">[失败]</el-button>
<br /> <br />
<el-button type="text" @click="infoHandle(scope.row.id)">预览</el-button> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id,true)">预览</el-button>
<el-button type="text" @click="updateHandle(scope.row.id)">修改</el-button> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" @click="deleteHandle(scope.row.id)">删除</el-button> <el-button type="text" @click="deleteHandle(scope.row.id)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
...@@ -150,188 +149,183 @@ ...@@ -150,188 +149,183 @@
:total="totalPage" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper"> layout="total, sizes, prev, pager, next, jumper">
</el-pagination> </el-pagination>
</div> <!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</div> </div>
</template> </template>
<script> <script>
export default { import AddOrUpdate from './indexcarouselmanage-add-or-update'
data () { export default {
return { components: {
dataForm: { AddOrUpdate
title: '', },
levels: '0', data () {
status: '', return {
classnum: '', addOrUpdateVisible: false,
inputdate: '' dataForm: {
}, title: '',
dataList: [], levels: '0',
pageIndex: 1, status: '',
pageSize: 10, classnum: '',
totalPage: 0, inputdate: ''
dataListLoading: false, },
dataListSelections: [], dataList: [],
addOrUpdateVisible: false, pageIndex: 1,
statusList: [ pageSize: 10,
{ totalPage: 0,
value: '0', dataListLoading: false,
label: '待审核' dataListSelections: [],
}, statusList: [
{ {
value: '-1', value: '0',
label: '失败' label: '待审核'
}, },
{ {
value: '1', value: '-1',
label: '成功' label: '失败'
} },
], {
levelList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], value: '1',
classnumList: [ label: '成功'
{ }
label: '大轮播' ],
}, levelList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
{ classnumList: [
label: '小轮播' {
} label: '大轮播'
], },
releaseDate: [] {
} label: '小轮播'
}, }
activated () { ],
this.getDataList() releaseDate: []
}, }
methods: { },
activated () {
this.getDataList()
},
methods: {
// 获取数据列表 // 获取数据列表
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/office/indexCarouselManage/list'), url: this.$http.adornUrl('/office/indexCarouselManage/list'),
method: 'post', method: 'post',
data: this.$http.adornParams({ data: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,
'limit': this.pageSize, 'limit': this.pageSize,
'title': this.dataForm.title, 'title': this.dataForm.title,
'status': this.dataForm.status, 'status': this.dataForm.status,
'levels': this.dataForm.levels, 'levels': this.dataForm.levels,
'classnum': this.dataForm.classnum, 'classnum': this.dataForm.classnum,
'inputDataStart': this.releaseDate === null ? '' : this.releaseDate[0], 'inputDataStart': this.releaseDate === null ? '' : this.releaseDate[0],
'inputDataEnd': this.releaseDate === null ? '' : this.releaseDate[1] 'inputDataEnd': this.releaseDate === null ? '' : this.releaseDate[1]
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.page.list
this.totalPage = data.page.totalCount this.totalPage = data.page.totalCount
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// 每页数 // 每页数
sizeChangeHandle (val) { sizeChangeHandle (val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// 当前页 // 当前页
currentChangeHandle (val) { currentChangeHandle (val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// 多选 // 多选
selectionChangeHandle (val) { selectionChangeHandle (val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// 新增 // 新增 / 修改
addOrUpdateHandle () { addOrUpdateHandle (id, showInfo) {
this.$nextTick(() => { this.addOrUpdateVisible = true
this.$router.push({name: 'indexcarouselmanage-add'}) this.$nextTick(() => {
}) this.$refs.addOrUpdate.init(id, showInfo)
}, })
// 修改 },
updateHandle (id) {
this.$nextTick(() => {
this.$router.push({name: 'indexcarouselmanage-update', query: {id: id}})
})
},
// 详情
infoHandle (id) {
this.$nextTick(() => {
this.$router.push({name: 'indexcarouselmanage-info', query: {id: id, showInfo: true}})
})
},
// 删除 // 删除
deleteHandle (id) { deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id return item.id
}) })
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/office/indexcarouselmanage/delete'), url: this.$http.adornUrl('/office/indexcarouselmanage/delete'),
method: 'post', method: 'post',
data: this.$http.adornData(ids, false) data: this.$http.adornData(ids, false)
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList() this.getDataList()
} }
}) })
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
}).catch(() => {}) }).catch(() => {})
}, },
// 审核 // 审核
checkHandle (id, status) { checkHandle (id, status) {
let str = '' let str = ''
if (status === 1) { if (status === 1) {
str = '成功' str = '成功'
} else { } else {
str = '失败' str = '失败'
} }
this.$confirm(`确定对[id=${id}]进行['审核${str}']操作?`, '提示', { this.$confirm(`确定对[id=${id}]进行['审核${str}']操作?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/office/indexCarouselManage/verifyIndexCarouselManage'), url: this.$http.adornUrl('/office/indexCarouselManage/verifyIndexCarouselManage'),
method: 'post', method: 'post',
data: this.$http.adornData({ data: this.$http.adornData({
'id': id, 'id': id,
'checkflagIndex': 1 'checkflagIndex': 1
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList() this.getDataList()
} }
}) })
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
}).catch(() => {}) }).catch(() => {})
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
.el-select-dropdown__item{ .el-select-dropdown__item{
......
<template> <template>
<div class="mod-config"> <el-dialog
<div class="title">{{title}}</div> :title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'"
<div class="form-list"> :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 :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px" v-loading='loading'>
<div class="base-info">基本信息</div>
<el-form-item label="原始标题:" prop="titleOld"> <el-form-item label="原始标题:" prop="titleOld">
<el-input v-model="dataForm.titleOld" placeholder="请输入原始标题" v-show="!showInfo" size="small"></el-input> <el-input v-model="dataForm.titleOld" placeholder="请输入原始标题" v-show="!showInfo" size="small"></el-input>
<p v-show="showInfo">{{dataForm.titleOld}}</p> <p v-show="showInfo">{{dataForm.titleOld}}</p>
...@@ -101,14 +101,11 @@ ...@@ -101,14 +101,11 @@
<div v-show="showInfo" v-html="dataForm.content"></div> <div v-show="showInfo" v-html="dataForm.content"></div>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> <span slot="footer" class="dialog-footer" v-show="!showInfo">
<div class="sub-btn" v-show="!showInfo"> <el-button @click="visible = false">取消</el-button>
<span slot='footer' class='dialog-footer'> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<el-button @click='clearInp()'>重置</el-button> </span>
<el-button type='primary' @click='dataFormSubmit()'>确定</el-button> </el-dialog>
</span>
</div>
</div>
</template> </template>
<script> <script>
...@@ -120,7 +117,8 @@ ...@@ -120,7 +117,8 @@
data () { data () {
return { return {
loading: false, loading: false,
showInfo: this.$route.query.showInfo, showInfo: false,
visible: false,
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'label' label: 'label'
...@@ -200,17 +198,9 @@ ...@@ -200,17 +198,9 @@
cclassName: '' cclassName: ''
} }
}, },
activated () {
this.getClassList([])
if (this.$route.query.id) {
this.init(this.$route.query.id)
} else {
this.clearInp()
}
this.title = !this.$route.query.id ? '添加文章' : '修改文章'
},
created () {
created () {
this.getClassList([])
}, },
mounted () { mounted () {
console.log(this.classidList) console.log(this.classidList)
...@@ -222,12 +212,14 @@ ...@@ -222,12 +212,14 @@
}) })
return arr[0].name return arr[0].name
}, },
init (id) { init (id, showInfo) {
this.loading = true
this.dataForm.id = id || 0 this.dataForm.id = id || 0
this.visible = true
this.showInfo = showInfo
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.clearInp()
if (this.dataForm.id) { if (this.dataForm.id) {
this.loading = true
this.$http({ this.$http({
url: this.$http.adornUrl(`/office/news/info/${this.dataForm.id}`), url: this.$http.adornUrl(`/office/news/info/${this.dataForm.id}`),
method: 'get', method: 'get',
...@@ -279,7 +271,8 @@ ...@@ -279,7 +271,8 @@
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.$router.push({name: 'info-news'}) this.visible = false
this.$emit('refreshDataList')
} }
}) })
} else { } else {
...@@ -357,7 +350,7 @@ ...@@ -357,7 +350,7 @@
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
this.imgUrlStr = '' this.imgUrlStr = ''
this.dialogVisible = false this.dialogVisible = false
this.dataForm.content = '' this.ueditor.value = ''
}, },
// 更新父子组件内容 // 更新父子组件内容
editorReady (instance) { editorReady (instance) {
...@@ -370,7 +363,7 @@ ...@@ -370,7 +363,7 @@
} }
</script> </script>
<style scoped> <style scoped>
.form-list{ /* .form-list{
padding-left: 4%!important; padding-left: 4%!important;
} }
.el-form-item__content{ .el-form-item__content{
...@@ -381,5 +374,5 @@ ...@@ -381,5 +374,5 @@
} }
.edui-editor{ .edui-editor{
width: 100%; width: 100%;
} } */
</style> </style>
\ No newline at end of file
<template> <template>
<div class="mod-config mod-list-form"> <div class="mod-config mod-list-form">
<div class="title">文章管理</div>
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item label='标题' prop='title'> <el-form-item label='标题' prop='title'>
<el-input v-model='dataForm.title' placeholder='请输入标题' size="small" clearable></el-input> <el-input v-model='dataForm.title' placeholder='请输入标题' size="small" clearable></el-input>
...@@ -61,7 +60,7 @@ ...@@ -61,7 +60,7 @@
<el-button class="seach-btn" @click="getDataList()" type="primary" size="small">搜索</el-button> <el-button class="seach-btn" @click="getDataList()" type="primary" size="small">搜索</el-button>
</el-form> </el-form>
<div class="add-btn"> <div class="add-btn">
<el-button v-if="isAuth('manage:news:save')" type="primary" @click="addOrUpdateHandle()"> + 添加文章</el-button> <el-button v-if="isAuth('manage:news:save')" type="primary" @click="addOrUpdateHandle()"> + 添加</el-button>
</div> </div>
<div class="table-list"> <div class="table-list">
<el-table <el-table
...@@ -73,6 +72,7 @@ ...@@ -73,6 +72,7 @@
prop="levels" prop="levels"
header-align="center" header-align="center"
align="center" align="center"
width="50px"
label="级别"> label="级别">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -145,12 +145,12 @@ ...@@ -145,12 +145,12 @@
width="150" width="150"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="checkHandle(scope.row.id,1)">[成功]</el-button> <el-button type="text" size="small" @click="checkHandle(scope.row.id,1)">[成功]</el-button>
<el-button type="text" @click="checkHandle(scope.row.id,-1)">[失败]</el-button> <el-button type="text" size="small" @click="checkHandle(scope.row.id,-1)">[失败]</el-button>
<br /> <br />
<el-button type="text" @click="infoHandle(scope.row.id)">预览</el-button> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id,true)">预览</el-button>
<el-button type="text" @click="updateHandle(scope.row.id)">修改</el-button> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" @click="deleteHandle(scope.row.id)">删除</el-button> <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -164,183 +164,181 @@ ...@@ -164,183 +164,181 @@
:total="totalPage" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper"> layout="total, sizes, prev, pager, next, jumper">
</el-pagination> </el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { import AddOrUpdate from './news-add-or-update'
data () { export default {
return { components: {
dataForm: { AddOrUpdate
'title': '', },
'levels': '0', data () {
'author': '', return {
'editor': '', addOrUpdateVisible: false,
'keyword': '', dataForm: {
'status': '', 'title': '',
'auditor': '' 'levels': '0',
}, 'author': '',
dataList: [], 'editor': '',
pageIndex: 1, 'keyword': '',
pageSize: 10, 'status': '',
totalPage: 0, 'auditor': ''
dataListLoading: false, },
dataListSelections: [], dataList: [],
statusList: [ pageIndex: 1,
{ pageSize: 10,
value: '0', totalPage: 0,
label: '待审核' dataListLoading: false,
}, dataListSelections: [],
{ statusList: [
value: '-1', {
label: '失败' value: '0',
}, label: '待审核'
{ },
value: '1', {
label: '成功' value: '-1',
} label: '失败'
], },
piclevelList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], {
updateDate: [], value: '1',
releaseDate: [] label: '成功'
} }
}, ],
activated () { piclevelList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
this.getDataList() updateDate: [],
}, releaseDate: []
methods: { }
},
activated () {
this.getDataList()
},
methods: {
// 获取数据列表 // 获取数据列表
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/office/news/list'), url: this.$http.adornUrl('/office/news/list'),
method: 'post', method: 'post',
data: this.$http.adornParams({ data: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,
'limit': this.pageSize, 'limit': this.pageSize,
'title': this.dataForm.title, 'title': this.dataForm.title,
'levels': this.dataForm.levels, 'levels': this.dataForm.levels,
'author': this.dataForm.author, 'author': this.dataForm.author,
'editor': this.dataForm.editor, 'editor': this.dataForm.editor,
'keyword': this.dataForm.keyword, 'keyword': this.dataForm.keyword,
'status': this.dataForm.status, 'status': this.dataForm.status,
'releaseTimeStart': this.releaseDate === null ? '' : this.releaseDate[0], 'releaseTimeStart': this.releaseDate === null ? '' : this.releaseDate[0],
'releaseTimeEnd': this.releaseDate === null ? '' : this.releaseDate[1], 'releaseTimeEnd': this.releaseDate === null ? '' : this.releaseDate[1],
'updateTimeStart': this.updateDate === null ? '' : this.updateDate[0], 'updateTimeStart': this.updateDate === null ? '' : this.updateDate[0],
'updateTimeEnd': this.updateDate === null ? '' : this.updateDate[1], 'updateTimeEnd': this.updateDate === null ? '' : this.updateDate[1],
'auditor': this.dataForm.auditor 'auditor': this.dataForm.auditor
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.page.list
this.totalPage = data.page.totalCount this.totalPage = data.page.totalCount
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// 每页数 // 每页数
sizeChangeHandle (val) { sizeChangeHandle (val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// 当前页 // 当前页
currentChangeHandle (val) { currentChangeHandle (val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// 多选 // 多选
selectionChangeHandle (val) { selectionChangeHandle (val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// 新增 // 新增 / 修改
addOrUpdateHandle () { addOrUpdateHandle (id, showInfo) {
this.$nextTick(() => { this.addOrUpdateVisible = true
this.$router.push({name: 'news-add'}) this.$nextTick(() => {
}) this.$refs.addOrUpdate.init(id, showInfo)
}, })
// 修改 },
updateHandle (id) {
this.$nextTick(() => {
this.$router.push({name: 'news-update', query: {id: id}})
})
},
// 详情
infoHandle (id) {
this.$nextTick(() => {
this.$router.push({name: 'news-info', query: {id: id, showInfo: true}})
})
},
// 删除 // 删除
deleteHandle (id) { deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id return item.id
}) })
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/office/news/delete'), url: this.$http.adornUrl('/office/news/delete'),
method: 'post', method: 'post',
data: this.$http.adornData(ids, false) data: this.$http.adornData(ids, false)
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList() this.getDataList()
} }
}) })
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
}).catch(() => {}) }).catch(() => {})
}, },
// 审核 // 审核
checkHandle (id, status) { checkHandle (id, status) {
let str = '' let str = ''
if (status === 1) { if (status === 1) {
str = '成功' str = '成功'
} else { } else {
str = '失败' str = '失败'
} }
this.$confirm(`确定对[id=${id}]进行['审核${str}']操作?`, '提示', { this.$confirm(`确定对[id=${id}]进行['审核${str}']操作?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/office/news/verifyNews'), url: this.$http.adornUrl('/office/news/verifyNews'),
method: 'post', method: 'post',
data: this.$http.adornData({ data: this.$http.adornData({
'id': id, 'id': id,
'status': status 'status': status
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList() this.getDataList()
} }
}) })
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
}).catch(() => {}) }).catch(() => {})
} }
} }
} }
</script> </script>
<template> <template>
<div class="mod-config"> <el-dialog
<div class="title">{{title}}</div> :title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'"
<div class="form-list"> :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 :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px" v-loading='loading'>
<div class="base-info">基本信息</div> <div class="base-info">基本信息</div>
<el-form-item label="原始标题:" prop="titleOld"> <el-form-item label="原始标题:" prop="titleOld">
...@@ -93,14 +94,11 @@ ...@@ -93,14 +94,11 @@
<div v-show="showInfo" v-html="dataForm.content"></div> <div v-show="showInfo" v-html="dataForm.content"></div>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> <span slot="footer" class="dialog-footer" v-show="!showInfo">
<div class="sub-btn" v-show="!showInfo"> <el-button @click="visible = false">取消</el-button>
<span slot='footer' class='dialog-footer'> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<el-button @click='clearInp()'>重置</el-button> </span>
<el-button type='primary' @click='dataFormSubmit()'>确定</el-button> </el-dialog>
</span>
</div>
</div>
</template> </template>
<script> <script>
...@@ -112,7 +110,8 @@ ...@@ -112,7 +110,8 @@
data () { data () {
return { return {
loading: false, loading: false,
showInfo: !!this.$route.query.showInfo, showInfo: false,
visible: false,
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'label' label: 'label'
...@@ -185,25 +184,20 @@ ...@@ -185,25 +184,20 @@
title: '' title: ''
} }
}, },
activated () {
if (this.$route.query.id) {
this.init(this.$route.query.id)
} else {
this.clearInp()
}
this.title = !this.$route.query.id ? '添加视频' : '修改视频'
},
created () { created () {
}, },
mounted () { mounted () {
}, },
methods: { methods: {
init (id) { init (id, showInfo) {
this.loading = true
this.dataForm.id = id || 0 this.dataForm.id = id || 0
this.visible = true
this.showInfo = showInfo
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.clearInp()
if (this.dataForm.id) { if (this.dataForm.id) {
this.loading = true
this.$http({ this.$http({
url: this.$http.adornUrl(`/office/news/info/${this.dataForm.id}`), url: this.$http.adornUrl(`/office/news/info/${this.dataForm.id}`),
method: 'get', method: 'get',
...@@ -264,7 +258,8 @@ ...@@ -264,7 +258,8 @@
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.$router.push({name: 'info-newsmovie'}) this.visible = false
this.$emit('refreshDataList')
} }
}) })
} else { } else {
...@@ -328,7 +323,7 @@ ...@@ -328,7 +323,7 @@
this.videoUrlStr = windowURL.createObjectURL(file) this.videoUrlStr = windowURL.createObjectURL(file)
this.dialogVisible2 = true this.dialogVisible2 = true
this.videoUrl.append('file', file) this.videoUrl.append('file', file)
console.log(this.videUrl.get('file')) console.log(file)
} }
}, },
UploadVideo () { UploadVideo () {
......
<template> <template>
<div class="mod-config mod-list-form"> <div class="mod-config mod-list-form">
<div class="title">视频管理</div>
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item label='显示标题' prop='title'> <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"></el-input>
...@@ -181,12 +180,12 @@ ...@@ -181,12 +180,12 @@
width="150" width="150"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="checkHandle(scope.row.id,1)">[成功]</el-button> <el-button type="text" size="small" @click="checkHandle(scope.row.id,1)">[成功]</el-button>
<el-button type="text" @click="checkHandle(scope.row.id,-1)">[失败]</el-button> <el-button type="text" size="small" @click="checkHandle(scope.row.id,-1)">[失败]</el-button>
<br /> <br />
<el-button type="text" @click="infoHandle(scope.row.id)">预览</el-button> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id,true)">预览</el-button>
<el-button type="text" @click="updateHandle(scope.row.id)">修改</el-button> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" @click="deleteHandle(scope.row.id)">删除</el-button> <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -200,185 +199,181 @@ ...@@ -200,185 +199,181 @@
:total="totalPage" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper"> layout="total, sizes, prev, pager, next, jumper">
</el-pagination> </el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { import AddOrUpdate from './newsmovie-add-or-update'
data () { export default {
return { components: {
dataForm: { AddOrUpdate
'title': '', },
'author': '', data () {
'editor': '', return {
'keyword': '', addOrUpdateVisible: false,
'status': '', dataForm: {
'clanguage': '', 'title': '',
'levels': '0' 'author': '',
}, 'editor': '',
dataList: [], 'keyword': '',
pageIndex: 1, 'status': '',
pageSize: 10, 'clanguage': '',
totalPage: 0, 'levels': '0'
dataListLoading: false, },
dataListSelections: [], dataList: [],
statusList: [ pageIndex: 1,
{ pageSize: 10,
value: '0', totalPage: 0,
label: '待审核' dataListLoading: false,
}, dataListSelections: [],
{ statusList: [
value: '-1', {
label: '失败' value: '0',
}, label: '待审核'
{ },
value: '1', {
label: '成功' value: '-1',
} label: '失败'
], },
levelList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], {
clanguageList: ['中文'], value: '1',
updateDate: [], label: '成功'
releaseDate: [] }
} ],
}, levelList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
activated () { clanguageList: ['中文'],
this.getDataList() updateDate: [],
}, releaseDate: []
methods: { }
},
activated () {
this.getDataList()
},
methods: {
// 获取数据列表 // 获取数据列表
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/office/newsmovie/list'), url: this.$http.adornUrl('/office/newsmovie/list'),
method: 'post', method: 'post',
data: this.$http.adornParams({ data: this.$http.adornParams({
'page': this.pageIndex + '', 'page': this.pageIndex + '',
'limit': this.pageSize + '', 'limit': this.pageSize + '',
'title': this.dataForm.title, 'title': this.dataForm.title,
'levels': this.dataForm.levels, 'levels': this.dataForm.levels,
'author': this.dataForm.author, 'author': this.dataForm.author,
'editor': this.dataForm.editor, 'editor': this.dataForm.editor,
'keyword': this.dataForm.keyword, 'keyword': this.dataForm.keyword,
'status': this.dataForm.status, 'status': this.dataForm.status,
'clanguage': this.dataForm.clanguage, 'clanguage': this.dataForm.clanguage,
'releaseTimeStart': this.releaseDate === null ? '' : this.releaseDate[0], 'releaseTimeStart': this.releaseDate === null ? '' : this.releaseDate[0],
'releaseTimeEnd': this.releaseDate === null ? '' : this.releaseDate[1], 'releaseTimeEnd': this.releaseDate === null ? '' : this.releaseDate[1],
'updateTimeStart': this.updateDate === null ? '' : this.updateDate[0], 'updateTimeStart': this.updateDate === null ? '' : this.updateDate[0],
'updateTimeEnd': this.updateDate === null ? '' : this.updateDate[1], 'updateTimeEnd': this.updateDate === null ? '' : this.updateDate[1],
'auditor': this.dataForm.auditor 'auditor': this.dataForm.auditor
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.page.list
this.totalPage = data.page.totalCount this.totalPage = data.page.totalCount
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// 每页数 // 每页数
sizeChangeHandle (val) { sizeChangeHandle (val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// 当前页 // 当前页
currentChangeHandle (val) { currentChangeHandle (val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// 多选 // 多选
selectionChangeHandle (val) { selectionChangeHandle (val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// 新增 // 新增 / 修改
addOrUpdateHandle () { addOrUpdateHandle (id, showInfo) {
this.$nextTick(() => { this.addOrUpdateVisible = true
this.$router.push({name: 'newsmovie-add'}) this.$nextTick(() => {
}) this.$refs.addOrUpdate.init(id, showInfo)
}, })
// 修改 },
updateHandle (id) {
this.$nextTick(() => {
this.$router.push({name: 'newsmovie-update', query: {id: id}})
})
},
// 详情
infoHandle (id) {
this.$nextTick(() => {
this.$router.push({name: 'newsmovie-info', query: {id: id, showInfo: true}})
})
},
// 删除 // 删除
deleteHandle (id) { deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id return item.id
}) })
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/office/newsmovie/delete'), url: this.$http.adornUrl('/office/newsmovie/delete'),
method: 'post', method: 'post',
data: this.$http.adornData(ids, false) data: this.$http.adornData(ids, false)
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList() this.getDataList()
} }
}) })
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
}).catch(() => {}) }).catch(() => {})
}, },
// 审核 // 审核
checkHandle (id, status) { checkHandle (id, status) {
let str = '' let str = ''
if (status === 1) { if (status === 1) {
str = '成功' str = '成功'
} else { } else {
str = '失败' str = '失败'
} }
this.$confirm(`确定对[id=${id}]进行['审核${str}']操作?`, '提示', { this.$confirm(`确定对[id=${id}]进行['审核${str}']操作?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/office/newsmovie/verify'), url: this.$http.adornUrl('/office/newsmovie/verify'),
method: 'post', method: 'post',
data: this.$http.adornData({ data: this.$http.adornData({
'id': id, 'id': id,
'status': status 'status': status
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList() this.getDataList()
} }
}) })
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
}).catch(() => {}) }).catch(() => {})
} }
} }
} }
</script> </script>
<template> <template>
<div class="mod-config"> <el-dialog
<div class="title">{{title}}</div> :title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'"
<div class="form-list"> :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 :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px" v-loading='loading'>
<div class="base-info">基本信息</div> <div class="base-info">基本信息</div>
<el-form-item label="专题描述:" prop="title"> <el-form-item label="专题描述:" prop="title">
...@@ -84,14 +85,11 @@ ...@@ -84,14 +85,11 @@
<div v-show="showInfo" v-html="dataForm.content"></div> <div v-show="showInfo" v-html="dataForm.content"></div>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> <span slot="footer" class="dialog-footer" v-show="!showInfo">
<div class="sub-btn" v-show="!showInfo"> <el-button @click="visible = false">取消</el-button>
<span slot='footer' class='dialog-footer'> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<el-button @click='clearInp()'>重置</el-button> </span>
<el-button type='primary' @click='dataFormSubmit()'>确定</el-button> </el-dialog>
</span>
</div>
</div>
</template> </template>
<script> <script>
...@@ -103,7 +101,8 @@ ...@@ -103,7 +101,8 @@
data () { data () {
return { return {
loading: false, loading: false,
showInfo: !!this.$route.query.showInfo, showInfo: false,
visible: false,
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'label' label: 'label'
...@@ -178,14 +177,7 @@ ...@@ -178,14 +177,7 @@
watch: { watch: {
}, },
activated () {
if (this.$route.query.id) {
this.init(this.$route.query.id)
} else {
this.clearInp()
}
this.title = !this.$route.query.id ? '添加深度专题' : '修改深度专题'
},
created () { created () {
this.getClassList([]) this.getClassList([])
}, },
...@@ -193,12 +185,14 @@ ...@@ -193,12 +185,14 @@
}, },
methods: { methods: {
init (id) { init (id, showInfo) {
this.loading = true
this.dataForm.id = id || 0 this.dataForm.id = id || 0
this.visible = true
this.showInfo = showInfo
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.clearInp()
if (this.dataForm.id) { if (this.dataForm.id) {
this.loading = true
this.$http({ this.$http({
url: this.$http.adornUrl(`/office/newtopic/info/${this.dataForm.id}`), url: this.$http.adornUrl(`/office/newtopic/info/${this.dataForm.id}`),
method: 'get', method: 'get',
...@@ -244,7 +238,8 @@ ...@@ -244,7 +238,8 @@
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.$router.push({name: 'info-newtopic'}) this.visible = false
this.$emit('refreshDataList')
} }
}) })
} else { } else {
...@@ -314,7 +309,7 @@ ...@@ -314,7 +309,7 @@
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
this.imgUrlStr = '' this.imgUrlStr = ''
this.dialogVisible = false this.dialogVisible = false
this.$refs.ue.setClearUEContent('') this.ueditor.value = ''
}, },
// 更新父子组件内容 // 更新父子组件内容
editorReady (instance) { editorReady (instance) {
......
<template> <template>
<div class="mod-config mod-list-form"> <div class="mod-config mod-list-form">
<div class="title">深度专题管理</div>
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item label='标题' prop='title'> <el-form-item label='标题' prop='title'>
<el-input v-model='dataForm.title' placeholder='请输入标题' size="small" clearable></el-input> <el-input v-model='dataForm.title' placeholder='请输入标题' size="small" clearable></el-input>
...@@ -40,7 +39,7 @@ ...@@ -40,7 +39,7 @@
<el-button class="seach-btn" @click="getDataList()" type="primary" size="small">搜索</el-button> <el-button class="seach-btn" @click="getDataList()" type="primary" size="small">搜索</el-button>
</el-form> </el-form>
<div class="add-btn"> <div class="add-btn">
<el-button v-if="isAuth('manage:news:save')" type="primary" @click="addOrUpdateHandle()"> + 添加专题</el-button> <el-button v-if="isAuth('manage:news:save')" type="primary" @click="addOrUpdateHandle()"> + 添加</el-button>
</div> </div>
<div class="table-list"> <div class="table-list">
<el-table <el-table
...@@ -121,8 +120,8 @@ ...@@ -121,8 +120,8 @@
<el-button type="text" @click="checkHandle(scope.row.classid,1)">[成功]</el-button> <el-button type="text" @click="checkHandle(scope.row.classid,1)">[成功]</el-button>
<el-button type="text" @click="checkHandle(scope.row.classid,-1)">[失败]</el-button> <el-button type="text" @click="checkHandle(scope.row.classid,-1)">[失败]</el-button>
<br /> <br />
<el-button type="text" @click="infoHandle(scope.row.classid)">预览</el-button> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.classid,true)">预览</el-button>
<el-button type="text" @click="updateHandle(scope.row.classid)">修改</el-button> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.classid)">修改</el-button>
<el-button type="text" @click="deleteHandle(scope.row.classid)">删除</el-button> <el-button type="text" @click="deleteHandle(scope.row.classid)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
...@@ -136,174 +135,170 @@ ...@@ -136,174 +135,170 @@
:total="totalPage" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper"> layout="total, sizes, prev, pager, next, jumper">
</el-pagination> </el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { import AddOrUpdate from './news-add-or-update'
data () { export default {
return { components: {
dataForm: { AddOrUpdate
title: '', },
levels: '0', data () {
status: '', return {
classnum: '', addOrUpdateVisible: false,
inputdate: '' dataForm: {
}, title: '',
dataList: [], levels: '0',
pageIndex: 1, status: '',
pageSize: 10, classnum: '',
totalPage: 0, inputdate: ''
dataListLoading: false, },
dataListSelections: [], dataList: [],
statusList: [ pageIndex: 1,
{ pageSize: 10,
value: '0', totalPage: 0,
label: '待审核' dataListLoading: false,
}, dataListSelections: [],
{ statusList: [
value: '-1', {
label: '失败' value: '0',
}, label: '待审核'
{ },
value: '1', {
label: '成功' value: '-1',
} label: '失败'
], },
levelList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], {
releaseDate: [] value: '1',
} label: '成功'
}, }
activated () { ],
this.getDataList() levelList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
}, releaseDate: []
methods: { }
},
activated () {
this.getDataList()
},
methods: {
// 获取数据列表 // 获取数据列表
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/office/newtopic/list'), url: this.$http.adornUrl('/office/newtopic/list'),
method: 'post', method: 'post',
data: this.$http.adornParams({ data: this.$http.adornParams({
'page': this.pageIndex + '', 'page': this.pageIndex + '',
'limit': this.pageSize + '', 'limit': this.pageSize + '',
'title': this.dataForm.title, 'title': this.dataForm.title,
'status': this.dataForm.status, 'status': this.dataForm.status,
'levels': this.dataForm.levels, 'levels': this.dataForm.levels,
'inputDataStart': this.releaseDate === null ? '' : this.releaseDate[0], 'inputDataStart': this.releaseDate === null ? '' : this.releaseDate[0],
'inputDataEnd': this.releaseDate === null ? '' : this.releaseDate[1] 'inputDataEnd': this.releaseDate === null ? '' : this.releaseDate[1]
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.page.list
this.totalPage = data.page.totalCount this.totalPage = data.page.totalCount
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// 每页数 // 每页数
sizeChangeHandle (val) { sizeChangeHandle (val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// 当前页 // 当前页
currentChangeHandle (val) { currentChangeHandle (val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// 多选 // 多选
selectionChangeHandle (val) { selectionChangeHandle (val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// 新增 // 新增 / 修改
addOrUpdateHandle () { addOrUpdateHandle (id, showInfo) {
this.$nextTick(() => { this.addOrUpdateVisible = true
this.$router.push({name: 'newtopic-add'}) this.$nextTick(() => {
}) this.$refs.addOrUpdate.init(id, showInfo)
}, })
// 修改 },
updateHandle (id) {
this.$nextTick(() => {
this.$router.push({name: 'newtopic-update', query: {id: id}})
})
},
// 详情
infoHandle (id) {
this.$nextTick(() => {
this.$router.push({name: 'newtopic-info', query: {id: id, showInfo: true}})
})
},
// 删除 // 删除
deleteHandle (id) { deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id ? [id] : this.dataListSelections.map(item => {
return item.classid return item.classid
}) })
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/office/newtopic/delete'), url: this.$http.adornUrl('/office/newtopic/delete'),
method: 'post', method: 'post',
data: this.$http.adornData(ids, false) data: this.$http.adornData(ids, false)
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList() this.getDataList()
} }
}) })
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
}).catch(() => {}) }).catch(() => {})
}, },
// 审核 // 审核
checkHandle (id, status) { checkHandle (id, status) {
let str = '' let str = ''
if (status === 1) { if (status === 1) {
str = '成功' str = '成功'
} else { } else {
str = '失败' str = '失败'
} }
this.$confirm(`确定对[id=${id}]进行['审核${str}']操作?`, '提示', { this.$confirm(`确定对[id=${id}]进行['审核${str}']操作?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/office/newtopic/verify'), url: this.$http.adornUrl('/office/newtopic/verify'),
method: 'post', method: 'post',
data: this.$http.adornData({ data: this.$http.adornData({
'id': id, 'id': id,
'status': status 'status': status
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList() this.getDataList()
} }
}) })
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
}).catch(() => {}) }).catch(() => {})
} }
} }
} }
</script> </script>
<template> <template>
<div class="mod-config"> <el-dialog
<div class="title">{{title}}</div> :title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'"
<div class="form-list"> :close-on-click-modal="false"
:visible.sync="visible">
<el-form <el-form
:model='dataForm' :model='dataForm'
:rules='dataRule' :rules='dataRule'
...@@ -70,15 +71,11 @@ ...@@ -70,15 +71,11 @@
<p><img :src="imgUrlStr" class="avatar" v-show="showInfo"></p> <p><img :src="imgUrlStr" class="avatar" v-show="showInfo"></p>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> <span slot="footer" class="dialog-footer" v-show="!showInfo">
<div class="sub-btn" v-show="!showInfo"> <el-button @click="visible = false">取消</el-button>
<span slot='footer' class='dialog-footer'> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<el-button @click='clearInp()' >重置</el-button>
<el-button type='primary' @click='dataFormSubmit()'>确定</el-button>
</span> </span>
</div> </el-dialog>
</div>
</template> </template>
<script> <script>
...@@ -86,9 +83,11 @@ export default { ...@@ -86,9 +83,11 @@ export default {
data () { data () {
return { return {
loading: false, loading: false,
showInfo: !!this.$route.query.showInfo, visible: false,
showInfo: false,
title: '', title: '',
dataForm: { dataForm: {
id: 0,
title: '', title: '',
pictureType: '', pictureType: '',
picFile: '', picFile: '',
...@@ -176,26 +175,22 @@ export default { ...@@ -176,26 +175,22 @@ export default {
dialogVisible: false dialogVisible: false
} }
}, },
activated () {
if (this.$route.query.id) {
this.init(this.$route.query.id)
} else {
this.clearInp()
}
},
created () { created () {
}, },
methods: { methods: {
init (id) { init (id, showInfo) {
this.loading = true this.dataForm.id = id || 0
this.dataForm.pictureid = id || 0 this.visible = true
this.showInfo = showInfo
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.clearInp()
if (this.dataForm.pictureid) { if (this.dataForm.id) {
this.loading = true
this.$http({ this.$http({
url: this.$http.adornUrl( url: this.$http.adornUrl(
`/office/picture/info/${this.dataForm.pictureid}` `/office/picture/info/${this.dataForm.id}`
), ),
method: 'get', method: 'get',
params: this.$http.adornParams() params: this.$http.adornParams()
...@@ -245,7 +240,8 @@ export default { ...@@ -245,7 +240,8 @@ export default {
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.$router.push({name: 'info-picture'}) this.visible = false
this.$emit('refreshDataList')
} }
}) })
} else { } else {
...@@ -296,7 +292,9 @@ export default { ...@@ -296,7 +292,9 @@ export default {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
this.imgUrlStr = '' this.imgUrlStr = ''
this.dialogVisible = false this.dialogVisible = false
this.ueditor.value = ''
} }
} }
} }
</script> </script>
......
<template> <template>
<div class="mod-config mod-list-form"> <div class="mod-config mod-list-form">
<div class="title">图片资讯管理</div>
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item label='标题' prop='title'> <el-form-item label='标题' prop='title'>
<el-input size="small" v-model='dataForm.title' placeholder='请输入标题' clearable></el-input> <el-input size="small" v-model='dataForm.title' placeholder='请输入标题' clearable></el-input>
...@@ -56,7 +55,7 @@ ...@@ -56,7 +55,7 @@
<el-button class="seach-btn" @click="getDataList()" type="primary" size="small">搜索</el-button> <el-button class="seach-btn" @click="getDataList()" type="primary" size="small">搜索</el-button>
</el-form> </el-form>
<div class="add-btn"> <div class="add-btn">
<el-button v-if="isAuth('manage:picture:save')" type="primary" @click="addOrUpdateHandle()"> + 添加图片</el-button> <el-button v-if="isAuth('manage:picture:save')" type="primary" @click="addOrUpdateHandle()"> + 添加</el-button>
</div> </div>
<div class="table-list"> <div class="table-list">
<el-table <el-table
...@@ -66,7 +65,7 @@ ...@@ -66,7 +65,7 @@
@selection-change="selectionChangeHandle" @selection-change="selectionChangeHandle"
> >
<el-table-column prop="piclevel" header-align="center" label="级别"> </el-table-column> <el-table-column prop="piclevel" header-align="center" label="级别"> </el-table-column>
<el-table-column prop="title" header-align="center" :show-overflow-tooltip="true" label="标题"> <el-table-column prop="title" header-align="center" label="标题">
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
{{scope.row.title}} {{scope.row.title}}
...@@ -74,7 +73,7 @@ ...@@ -74,7 +73,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="pictureType" header-align="center" label="分类"> </el-table-column> <el-table-column prop="pictureType" header-align="center" label="分类"> </el-table-column>
<el-table-column prop="showtime" header-align="center" sortable show-overflow-tooltip label="显示时间"> </el-table-column> <el-table-column prop="showtime" header-align="center" sortable label="显示时间"> </el-table-column>
<el-table-column prop="inputdate" header-align="center" sortable label="发布时间"> </el-table-column> <el-table-column prop="inputdate" header-align="center" sortable label="发布时间"> </el-table-column>
<el-table-column prop="keyword" header-align="center" label="关键字"> </el-table-column> <el-table-column prop="keyword" header-align="center" label="关键字"> </el-table-column>
<el-table-column prop="editor" header-align="center" label="编辑"> </el-table-column> <el-table-column prop="editor" header-align="center" label="编辑"> </el-table-column>
...@@ -94,12 +93,12 @@ ...@@ -94,12 +93,12 @@
width="150" width="150"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="checkHandle(scope.row.pictureid,1)">[成功]</el-button> <el-button type="text" size="small" @click="checkHandle(scope.row.pictureid,1)">[成功]</el-button>
<el-button type="text" @click="checkHandle(scope.row.pictureid,-1)">[失败]</el-button> <el-button type="text" size="small" @click="checkHandle(scope.row.pictureid,-1)">[失败]</el-button>
<br /> <br />
<el-button type="text" @click="infoHandle(scope.row.pictureid)">预览</el-button> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.pictureid,true)">预览</el-button>
<el-button type="text" @click="updateHandle(scope.row.pictureid)">修改</el-button> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.pictureid)">修改</el-button>
<el-button type="text" @click="deleteHandle(scope.row.pictureid)">删除</el-button> <el-button type="text" size="small" @click="deleteHandle(scope.row.pictureid)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -112,187 +111,183 @@ ...@@ -112,187 +111,183 @@
:total="totalPage" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper"> layout="total, sizes, prev, pager, next, jumper">
</el-pagination> </el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { import AddOrUpdate from './picture-add-or-update'
data () { export default {
return { data () {
dataForm: { return {
title: '', addOrUpdateVisible: false,
pictureLevel: '0', dataForm: {
editor: '', title: '',
keyword: '', pictureLevel: '0',
status: '', editor: '',
pictureType: '' keyword: '',
}, status: '',
dataList: [], pictureType: ''
pageIndex: 1, },
pageSize: 10, dataList: [],
totalPage: 0, pageIndex: 1,
dataListLoading: false, pageSize: 10,
dataListSelections: [], totalPage: 0,
statusList: [ dataListLoading: false,
{ dataListSelections: [],
value: '0', statusList: [
label: '待审核' {
}, value: '0',
{ label: '待审核'
value: '-1', },
label: '失败' {
}, value: '-1',
{ label: '失败'
value: '1', },
label: '成功' {
} value: '1',
], label: '成功'
pictureLevel: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], }
pictureTypeList: [ ],
{ pictureLevel: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
value: '1', pictureTypeList: [
label: '图片信息' {
} value: '1',
], label: '图片信息'
releaseDate: [] }
} ],
}, releaseDate: []
}
activated () { },
this.getDataList() components: {
}, AddOrUpdate
methods: { },
activated () {
this.getDataList()
},
methods: {
// 获取数据列表 // 获取数据列表
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/office/picture/list'), url: this.$http.adornUrl('/office/picture/list'),
method: 'post', method: 'post',
data: this.$http.adornParams({ data: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,
'limit': this.pageSize, 'limit': this.pageSize,
'title': this.dataForm.title, 'title': this.dataForm.title,
'pictureLevel': this.dataForm.pictureLevel, 'pictureLevel': this.dataForm.pictureLevel,
'editor': this.dataForm.editor, 'editor': this.dataForm.editor,
'keyword': this.dataForm.keyword, 'keyword': this.dataForm.keyword,
'status': this.dataForm.status, 'status': this.dataForm.status,
'pictureType': this.dataForm.pictureType, 'pictureType': this.dataForm.pictureType,
'inputDataStart': this.releaseDate === null ? '' : this.releaseDate[0], 'inputDataStart': this.releaseDate === null ? '' : this.releaseDate[0],
'inputDataEnd': this.releaseDate === null ? '' : this.releaseDate[1] 'inputDataEnd': this.releaseDate === null ? '' : this.releaseDate[1]
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.page.list
this.totalPage = data.page.totalCount this.totalPage = data.page.totalCount
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// 每页数 // 每页数
sizeChangeHandle (val) { sizeChangeHandle (val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// 当前页 // 当前页
currentChangeHandle (val) { currentChangeHandle (val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// 多选 // 多选
selectionChangeHandle (val) { selectionChangeHandle (val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// 新增 / 修改 // 新增 / 修改
addOrUpdateHandle () { addOrUpdateHandle (id, showInfo) {
this.$nextTick(() => { this.addOrUpdateVisible = true
this.$router.push({name: 'picture-add'}) this.$nextTick(() => {
}) this.$refs.addOrUpdate.init(id, showInfo)
}, })
// 修改 },
updateHandle (id) {
this.$nextTick(() => {
this.$router.push({name: 'picture-update', query: {id: id}})
})
},
// 详情
infoHandle (id) {
this.$nextTick(() => {
this.$router.push({name: 'picture-info', query: {id: id, showInfo: true}})
})
},
// 删除 // 删除
deleteHandle (id) { deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id return item.id
}) })
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/office/picture/delete'), url: this.$http.adornUrl('/office/picture/delete'),
method: 'post', method: 'post',
data: this.$http.adornData(ids, false) data: this.$http.adornData(ids, false)
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList() this.getDataList()
} }
}) })
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
}).catch(e => e) }).catch(e => e)
}, },
// 审核 // 审核
checkHandle (id, status) { checkHandle (id, status) {
let str = '' let str = ''
if (status === 1) { if (status === 1) {
str = '成功' str = '成功'
} else { } else {
str = '失败' str = '失败'
} }
this.$confirm(`确定对[id=${id}]进行['审核${str}']操作?`, '提示', { this.$confirm(`确定对[id=${id}]进行['审核${str}']操作?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/office/picture/verifyPicture'), url: this.$http.adornUrl('/office/picture/verifyPicture'),
method: 'post', method: 'post',
data: this.$http.adornData({ data: this.$http.adornData({
'pictureid': id, 'pictureid': id,
'status': status 'status': status
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList() this.getDataList()
} }
}) })
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
}).catch(e => e) }).catch(e => e)
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
.el-select-dropdown__item{ .el-select-dropdown__item{
......
<template> <template>
<div class="mod-config"> <el-dialog
<div class="title">{{title}}</div> :title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'"
<div class="form-list"> :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 :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px" v-loading='loading'>
<div class="base-info">基本信息</div>
<el-form-item label="原始标题:" prop="oldtitle"> <el-form-item label="原始标题:" prop="oldtitle">
<el-input v-model="dataForm.oldtitle" placeholder="请输入显示标题" v-show="!showInfo" size="small"></el-input> <el-input v-model="dataForm.oldtitle" placeholder="请输入显示标题" v-show="!showInfo" size="small"></el-input>
<p v-show="showInfo">{{dataForm.titleOld}}</p> <p v-show="showInfo">{{dataForm.titleOld}}</p>
...@@ -81,14 +81,11 @@ ...@@ -81,14 +81,11 @@
<div v-show="showInfo" v-html="dataForm.content"></div> <div v-show="showInfo" v-html="dataForm.content"></div>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> <span slot="footer" class="dialog-footer" v-show="!showInfo">
<div class="sub-btn" v-show="!showInfo"> <el-button @click="visible = false">取消</el-button>
<span slot='footer' class='dialog-footer'> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<el-button @click='clearInp()'>重置</el-button>
<el-button type='primary' @click='dataFormSubmit()'>确定</el-button>
</span> </span>
</div> </el-dialog>
</div>
</template> </template>
<script> <script>
...@@ -100,7 +97,8 @@ ...@@ -100,7 +97,8 @@
data () { data () {
return { return {
loading: false, loading: false,
showInfo: this.$route.query.showInfo || false, visible: false,
showInfo: false,
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'label' label: 'label'
...@@ -182,23 +180,17 @@ ...@@ -182,23 +180,17 @@
title: '' title: ''
} }
}, },
activated () {
if (this.$route.query.id) {
this.init(this.$route.query.id)
} else {
this.clearInp()
}
this.title = !this.$route.query.id ? '新增' : '修改'
},
created () { created () {
this.getMedicalTypeList() this.getMedicalTypeList()
}, },
methods: { methods: {
init (id) { init (id, showInfo) {
this.loading = true
this.dataForm.id = id || 0 this.dataForm.id = id || 0
this.visible = true
this.showInfo = showInfo
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.clearInp()
if (this.dataForm.id) { if (this.dataForm.id) {
this.$http({ this.$http({
url: this.$http.adornUrl(`/office/logistics/info/${this.dataForm.id}`), url: this.$http.adornUrl(`/office/logistics/info/${this.dataForm.id}`),
...@@ -252,7 +244,8 @@ ...@@ -252,7 +244,8 @@
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.$router.push({name: 'logistics-logistics'}) this.visible = false
this.$emit('refreshDataList')
} }
}) })
} else { } else {
...@@ -267,7 +260,7 @@ ...@@ -267,7 +260,7 @@
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
this.imgUrlStr = '' this.imgUrlStr = ''
this.dialogVisible = false this.dialogVisible = false
this.dataForm.value = '' this.ueditor.value = ''
}, },
// 获取医疗管理列表 // 获取医疗管理列表
getMedicalTypeList () { getMedicalTypeList () {
...@@ -285,17 +278,3 @@ ...@@ -285,17 +278,3 @@
} }
} }
</script> </script>
<style scoped>
.form-list{
padding-left: 4%!important;
}
.el-form-item__content{
width: 50%;
}
.el-select,.el-input{
width: 241px!important;
}
.edui-editor{
width: 100%;
}
</style>
\ No newline at end of file
<template> <template>
<div class="mod-config mod-list-form"> <div class="mod-config mod-list-form">
<div class="title">物流管理</div>
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item label='标题' prop='title'> <el-form-item label='标题' prop='title'>
<el-input v-model='dataForm.title' placeholder='请输入标题' size="small" clearable></el-input> <el-input v-model='dataForm.title' placeholder='请输入标题' size="small" clearable></el-input>
...@@ -87,12 +86,12 @@ ...@@ -87,12 +86,12 @@
width="150" width="150"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="checkHandle(scope.row.id,1)">[成功]</el-button> <el-button type="text" size="small" @click="checkHandle(scope.row.id,1)">[成功]</el-button>
<el-button type="text" @click="checkHandle(scope.row.id,-1)">[失败]</el-button> <el-button type="text" size="small" @click="checkHandle(scope.row.id,-1)">[失败]</el-button>
<br /> <br />
<!-- <el-button type="text" @click="infoHandle(scope.row.id)">详情</el-button> --> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id,true)">预览</el-button>
<el-button type="text" @click="updateHandle(scope.row.id)">编辑</el-button> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" @click="deleteHandle(scope.row.id)">删除</el-button> <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -106,187 +105,183 @@ ...@@ -106,187 +105,183 @@
:total="totalPage" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper"> layout="total, sizes, prev, pager, next, jumper">
</el-pagination> </el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { import AddOrUpdate from './logistics-add-or-update'
data () { export default {
return { components: {
dataForm: { AddOrUpdate
title: '', },
type: '', data () {
keyword: '' return {
}, addOrUpdateVisible: false,
dataList: [], dataForm: {
pageIndex: 1, title: '',
pageSize: 10, type: '',
totalPage: 0, keyword: ''
dataListLoading: false, },
dataListSelections: [], dataList: [],
typeList: [ pageIndex: 1,
{ pageSize: 10,
typeName: '标准' totalPage: 0,
}, dataListLoading: false,
{ dataListSelections: [],
typeName: '指南&案例' typeList: [
}, {
{ typeName: '标准'
typeName: '政策法规&行业资讯' },
}, {
{ typeName: '指南&案例'
typeName: '常见问题' },
} {
] typeName: '政策法规&行业资讯'
} },
}, {
activated () { typeName: '常见问题'
this.getDataList() }
}, ]
created () { }
this.getMedicalTypeList() },
}, activated () {
methods: { this.getDataList()
},
created () {
this.getMedicalTypeList()
},
methods: {
// 获取数据列表 // 获取数据列表
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/office/logistics/list'), url: this.$http.adornUrl('/office/logistics/list'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,
'limit': this.pageSize, 'limit': this.pageSize,
'title': this.dataForm.title, 'title': this.dataForm.title,
'type': this.dataForm.type === null ? '' : this.dataForm.type, 'type': this.dataForm.type === null ? '' : this.dataForm.type,
'keyword': this.dataForm.keyword 'keyword': this.dataForm.keyword
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.page.list
this.totalPage = data.page.totalCount this.totalPage = data.page.totalCount
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// 每页数 // 每页数
sizeChangeHandle (val) { sizeChangeHandle (val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// 当前页 // 当前页
currentChangeHandle (val) { currentChangeHandle (val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// 多选 // 多选
selectionChangeHandle (val) { selectionChangeHandle (val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// 新增 // 新增 / 修改
addOrUpdateHandle () { addOrUpdateHandle (id, showInfo) {
this.$nextTick(() => { this.addOrUpdateVisible = true
this.$router.push({name: 'logistics-add'}) this.$nextTick(() => {
}) this.$refs.addOrUpdate.init(id, showInfo)
}, })
// 修改 },
updateHandle (id) {
this.$nextTick(() => {
this.$router.push({name: 'logistics-update', query: {id: id}})
})
},
// 详情
infoHandle (id) {
this.$nextTick(() => {
this.$router.push({name: 'logistics-info', query: {id: id, showInfo: true}})
})
},
// 删除 // 删除
deleteHandle (id) { deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id return item.id
}) })
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/office/logistics/delete'), url: this.$http.adornUrl('/office/logistics/delete'),
method: 'post', method: 'post',
data: this.$http.adornData(ids, false) data: this.$http.adornData(ids, false)
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList() this.getDataList()
} }
}) })
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
}).catch(() => {}) }).catch(() => {})
}, },
// 获取医疗管理列表 // 获取医疗管理列表
getMedicalTypeList () { getMedicalTypeList () {
this.$http({ this.$http({
url: this.$http.adornUrl('/office/medical/getMedicalTypeList'), url: this.$http.adornUrl('/office/medical/getMedicalTypeList'),
method: 'get' method: 'get'
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.typeList = data.list this.typeList = data.list
} else { } else {
this.typeList = [] this.typeList = []
} }
}) })
}, },
// 审核 // 审核
checkHandle (id, status) { checkHandle (id, status) {
let str = '' let str = ''
if (status === 1) { if (status === 1) {
str = '成功' str = '成功'
} else { } else {
str = '失败' str = '失败'
} }
this.$confirm(`确定对[id=${id}]进行['审核${str}']操作?`, '提示', { this.$confirm(`确定对[id=${id}]进行['审核${str}']操作?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/office/logistics/verifyLogistics'), url: this.$http.adornUrl('/office/logistics/verifyLogistics'),
method: 'post', method: 'post',
data: this.$http.adornData({ data: this.$http.adornData({
'id': id, 'id': id,
'status': 1 'status': 1
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList() this.getDataList()
} }
}) })
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
}).catch(() => {}) }).catch(() => {})
} }
} }
} }
</script> </script>
<template> <template>
<div class="mod-config"> <el-dialog
<div class="title">{{title}}</div> :title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'"
<div class="form-list"> :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 :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px" v-loading='loading'>
<div class="base-info">基本信息</div>
<el-form-item label="标题:" prop="title"> <el-form-item label="标题:" prop="title">
<el-input v-model="dataForm.title" placeholder="请输入显示标题" v-show="!showInfo" size="small"></el-input> <el-input v-model="dataForm.title" placeholder="请输入显示标题" v-show="!showInfo" size="small"></el-input>
<p v-show="showInfo">{{dataForm.title}}</p> <p v-show="showInfo">{{dataForm.title}}</p>
...@@ -77,14 +77,11 @@ ...@@ -77,14 +77,11 @@
<div v-show="showInfo" v-html="dataForm.content"></div> <div v-show="showInfo" v-html="dataForm.content"></div>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> <span slot="footer" class="dialog-footer" v-show="!showInfo">
<div class="sub-btn" v-show="!showInfo"> <el-button @click="visible = false">取消</el-button>
<span slot='footer' class='dialog-footer'> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<el-button @click='clearInp()'>重置</el-button>
<el-button type='primary' @click='dataFormSubmit()'>确定</el-button>
</span> </span>
</div> </el-dialog>
</div>
</template> </template>
<script> <script>
...@@ -96,7 +93,8 @@ ...@@ -96,7 +93,8 @@
data () { data () {
return { return {
loading: false, loading: false,
showInfo: this.$route.query.showInfo || false, visible: false,
showInfo: false,
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'label' label: 'label'
...@@ -161,14 +159,6 @@ ...@@ -161,14 +159,6 @@
title: '' title: ''
} }
}, },
activated () {
if (this.$route.query.id) {
this.init(this.$route.query.id)
} else {
this.clearInp()
}
this.title = !this.$route.query.id ? '新增' : '修改'
},
created () { created () {
this.getMedicalTypeList() this.getMedicalTypeList()
...@@ -176,11 +166,12 @@ ...@@ -176,11 +166,12 @@
mounted () { mounted () {
}, },
methods: { methods: {
init (id) { init (id, showInfo) {
this.loading = true
this.dataForm.id = id || 0 this.dataForm.id = id || 0
this.visible = true
this.showInfo = showInfo
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.clearInp()
if (this.dataForm.id) { if (this.dataForm.id) {
this.$http({ this.$http({
url: this.$http.adornUrl(`/office/medical/info/${this.dataForm.id}`), url: this.$http.adornUrl(`/office/medical/info/${this.dataForm.id}`),
...@@ -233,7 +224,8 @@ ...@@ -233,7 +224,8 @@
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.$router.push({name: 'medical-medical'}) this.visible = false
this.$emit('refreshDataList')
} }
}) })
} else { } else {
...@@ -261,22 +253,8 @@ ...@@ -261,22 +253,8 @@
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
this.imgUrlStr = '' this.imgUrlStr = ''
this.dialogVisible = false this.dialogVisible = false
this.dataForm.value = '' this.ueditor.value = ''
} }
} }
} }
</script> </script>
<style scoped>
.form-list{
padding-left: 4%!important;
}
.el-form-item__content{
width: 50%;
}
.el-select,.el-input{
width: 241px!important;
}
.edui-editor{
width: 100%;
}
</style>
\ No newline at end of file
<template> <template>
<div class="mod-config mod-list-form"> <div class="mod-config mod-list-form">
<div class="title">医疗管理</div>
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item label='标题' prop='title'> <el-form-item label='标题' prop='title'>
<el-input v-model='dataForm.title' placeholder='请输入标题' size="small" clearable></el-input> <el-input v-model='dataForm.title' placeholder='请输入标题' size="small" clearable></el-input>
...@@ -85,12 +84,12 @@ ...@@ -85,12 +84,12 @@
width="150" width="150"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button type="text" @click="infoHandle(scope.row.id)">详情</el-button> --> <el-button type="text" size="small" @click="checkHandle(scope.row.id,1)">[成功]</el-button>
<el-button type="text" @click="checkHandle(scope.row.id,1)">[成功]</el-button> <el-button type="text" size="small" @click="checkHandle(scope.row.id,-1)">[失败]</el-button>
<el-button type="text" @click="checkHandle(scope.row.id,-1)">[失败]</el-button>
<br /> <br />
<el-button type="text" @click="updateHandle(scope.row.id)">编辑</el-button> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id,true)">预览</el-button>
<el-button type="text" @click="deleteHandle(scope.row.id)">删除</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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -104,168 +103,164 @@ ...@@ -104,168 +103,164 @@
:total="totalPage" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper"> layout="total, sizes, prev, pager, next, jumper">
</el-pagination> </el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { import AddOrUpdate from './medical-add-or-update'
data () { export default {
return { components: {
dataForm: { AddOrUpdate
title: '', },
type: '' data () {
}, return {
dataList: [], addOrUpdateVisible: false,
pageIndex: 1, dataForm: {
pageSize: 10, title: '',
totalPage: 0, type: ''
dataListLoading: false, },
dataListSelections: [], dataList: [],
typeList: [] pageIndex: 1,
} pageSize: 10,
}, totalPage: 0,
activated () { dataListLoading: false,
this.getMedicalTypeList() dataListSelections: [],
this.getDataList() typeList: []
}, }
methods: { },
activated () {
this.getMedicalTypeList()
this.getDataList()
},
methods: {
// 获取数据列表 // 获取数据列表
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/office/medical/list'), url: this.$http.adornUrl('/office/medical/list'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,
'limit': this.pageSize, 'limit': this.pageSize,
'title': this.dataForm.title, 'title': this.dataForm.title,
'type': this.dataForm.type === null ? '' : this.dataForm.type 'type': this.dataForm.type === null ? '' : this.dataForm.type
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.page.list
this.totalPage = data.page.totalCount this.totalPage = data.page.totalCount
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// 每页数 // 每页数
sizeChangeHandle (val) { sizeChangeHandle (val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// 当前页 // 当前页
currentChangeHandle (val) { currentChangeHandle (val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// 多选 // 多选
selectionChangeHandle (val) { selectionChangeHandle (val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// 新增 // 新增 / 修改
addOrUpdateHandle () { addOrUpdateHandle (id, showInfo) {
this.$nextTick(() => { this.addOrUpdateVisible = true
this.$router.push({name: 'medical-add'}) this.$nextTick(() => {
}) this.$refs.addOrUpdate.init(id, showInfo)
}, })
// 修改 },
updateHandle (id) {
this.$nextTick(() => {
this.$router.push({name: 'medical-update', query: {id: id}})
})
},
// 详情
infoHandle (id) {
this.$nextTick(() => {
this.$router.push({name: 'medical-info', query: {id: id, showInfo: true}})
})
},
// 删除 // 删除
deleteHandle (id) { deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id return item.id
}) })
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/office/medical/delete'), url: this.$http.adornUrl('/office/medical/delete'),
method: 'post', method: 'post',
data: this.$http.adornData(ids, false) data: this.$http.adornData(ids, false)
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList() this.getDataList()
} }
}) })
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
}).catch(() => {}) }).catch(() => {})
}, },
// 获取医疗管理列表 // 获取医疗管理列表
getMedicalTypeList () { getMedicalTypeList () {
this.$http({ this.$http({
url: this.$http.adornUrl('/office/medical/getMedicalTypeList'), url: this.$http.adornUrl('/office/medical/getMedicalTypeList'),
method: 'get' method: 'get'
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.typeList = data.list this.typeList = data.list
} else { } else {
this.typeList = [] this.typeList = []
} }
}) })
}, },
// 审核 // 审核
checkHandle (id, status) { checkHandle (id, status) {
let str = '' let str = ''
if (status === 1) { if (status === 1) {
str = '成功' str = '成功'
} else { } else {
str = '失败' str = '失败'
} }
this.$confirm(`确定对[id=${id}]进行['审核${str}']操作?`, '提示', { this.$confirm(`确定对[id=${id}]进行['审核${str}']操作?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/office/medical/verifyMedical'), url: this.$http.adornUrl('/office/medical/verifyMedical'),
method: 'post', method: 'post',
data: this.$http.adornData({ data: this.$http.adornData({
'id': id, 'id': id,
'status': 1 'status': 1
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList() this.getDataList()
} }
}) })
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
}).catch(() => {}) }).catch(() => {})
} }
} }
} }
</script> </script>
<template> <template>
<div class="mod-config"> <el-dialog
<div class="title">{{title}}</div> :title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'"
<div class="form-list"> :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 :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px" v-loading='loading'>
<div class="base-info">基本信息</div>
<el-form-item label="原始标题:" prop="titleOld"> <el-form-item label="原始标题:" prop="titleOld">
<el-input v-model="dataForm.titleOld" placeholder="请输入原始标题" v-show="!showInfo" size="small"></el-input> <el-input v-model="dataForm.titleOld" placeholder="请输入原始标题" v-show="!showInfo" size="small"></el-input>
<p v-show="showInfo">{{dataForm.titleOld}}</p> <p v-show="showInfo">{{dataForm.titleOld}}</p>
...@@ -75,14 +75,11 @@ ...@@ -75,14 +75,11 @@
<div v-show="showInfo" v-html="dataForm.content"></div> <div v-show="showInfo" v-html="dataForm.content"></div>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> <span slot="footer" class="dialog-footer" v-show="!showInfo">
<div class="sub-btn" v-show="!showInfo"> <el-button @click="visible = false">取消</el-button>
<span slot='footer' class='dialog-footer'> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<el-button @click='clearInp()'>重置</el-button> </span>
<el-button type='primary' @click='dataFormSubmit()'>确定</el-button> </el-dialog>
</span>
</div>
</div>
</template> </template>
<script> <script>
...@@ -94,7 +91,8 @@ ...@@ -94,7 +91,8 @@
data () { data () {
return { return {
loading: false, loading: false,
showInfo: this.$route.query.showInfo, visible: false,
showInfo: false,
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'label' label: 'label'
...@@ -163,22 +161,15 @@ ...@@ -163,22 +161,15 @@
title: '' title: ''
} }
}, },
activated () {
if (this.$route.query.id) {
this.init(this.$route.query.id)
} else {
this.clearInp()
}
this.title = !this.$route.query.id ? '添加' : '修改'
},
created () { created () {
}, },
methods: { methods: {
init (id) { init (id, showInfo) {
this.loading = true
this.dataForm.id = id || 0 this.dataForm.id = id || 0
this.visible = true
this.showInfo = showInfo
this.$nextTick(() => { this.$nextTick(() => {
// this.$refs['dataForm'].resetFields()
this.clearInp() this.clearInp()
if (this.dataForm.id) { if (this.dataForm.id) {
this.$http({ this.$http({
...@@ -230,7 +221,8 @@ ...@@ -230,7 +221,8 @@
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.$router.push({name: 'party-center'}) this.visible = false
this.$emit('refreshDataList')
} }
}) })
} else { } else {
...@@ -290,7 +282,7 @@ ...@@ -290,7 +282,7 @@
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
this.imgUrlStr = '' this.imgUrlStr = ''
this.dialogVisible = false this.dialogVisible = false
this.dataForm.content = '' this.ueditor.value = ''
}, },
// 更新父子组件内容 // 更新父子组件内容
editorReady (instance) { editorReady (instance) {
...@@ -302,17 +294,3 @@ ...@@ -302,17 +294,3 @@
} }
} }
</script> </script>
<style scoped>
.form-list{
padding-left: 4%!important;
}
.el-form-item__content{
width: 50%;
}
.el-select,.el-input{
width: 241px!important;
}
.edui-editor{
width: 100%;
}
</style>
\ No newline at end of file
...@@ -145,12 +145,12 @@ ...@@ -145,12 +145,12 @@
width="150" width="150"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="checkHandle(scope.row.id,1)">[成功]</el-button> <el-button type="text" size="small" @click="checkHandle(scope.row.id,1)">[成功]</el-button>
<el-button type="text" @click="checkHandle(scope.row.id,-1)">[失败]</el-button> <el-button type="text" size="small" @click="checkHandle(scope.row.id,-1)">[失败]</el-button>
<br /> <br />
<el-button type="text" @click="infoHandle(scope.row.id)" >预览</el-button> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id,true)">预览</el-button>
<el-button type="text" @click="updateHandle(scope.row.id)">修改</el-button> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" @click="deleteHandle(scope.row.id)">删除</el-button> <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -164,182 +164,178 @@ ...@@ -164,182 +164,178 @@
:total="totalPage" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper"> layout="total, sizes, prev, pager, next, jumper">
</el-pagination> </el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { import AddOrUpdate from './center-add-or-update'
data () { export default {
return { components: {
dataForm: { AddOrUpdate
title: '', },
author: '', data () {
editor: '', return {
keyword: '', addOrUpdateVisible: false,
status: '', dataForm: {
levels: '0' title: '',
}, author: '',
dataList: [], editor: '',
pageIndex: 1, keyword: '',
pageSize: 10, status: '',
totalPage: 0, levels: '0'
dataListLoading: false, },
dataListSelections: [], dataList: [],
statusList: [ pageIndex: 1,
{ pageSize: 10,
value: '0', totalPage: 0,
label: '待审核' dataListLoading: false,
}, dataListSelections: [],
{ statusList: [
value: '-1', {
label: '失败' value: '0',
}, label: '待审核'
{ },
value: '1', {
label: '成功' value: '-1',
} label: '失败'
], },
levelList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], {
updateDate: [], value: '1',
releaseDate: [] label: '成功'
} }
}, ],
activated () { levelList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
this.getDataList() updateDate: [],
}, releaseDate: []
methods: { }
},
activated () {
this.getDataList()
},
methods: {
// 获取数据列表 // 获取数据列表
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/office/center/list'), url: this.$http.adornUrl('/office/center/list'),
method: 'post', method: 'post',
data: this.$http.adornData({ data: this.$http.adornData({
'page': this.pageIndex, 'page': this.pageIndex,
'limit': this.pageSize, 'limit': this.pageSize,
'title': this.dataForm.title, 'title': this.dataForm.title,
'levels': this.dataForm.levels, 'levels': this.dataForm.levels,
'author': this.dataForm.author, 'author': this.dataForm.author,
'editor': this.dataForm.editor, 'editor': this.dataForm.editor,
'keyword': this.dataForm.keyword, 'keyword': this.dataForm.keyword,
'status': this.dataForm.status, 'status': this.dataForm.status,
'releaseTimeStart': this.releaseDate[0] === undefined ? '' : this.releaseDate[0], 'releaseTimeStart': this.releaseDate[0] === undefined ? '' : this.releaseDate[0],
'releaseTimeEnd': this.releaseDate[1] === undefined ? '' : this.releaseDate[1], 'releaseTimeEnd': this.releaseDate[1] === undefined ? '' : this.releaseDate[1],
'updateTimeStart': this.updateDate[0] === undefined ? '' : this.updateDate[0], 'updateTimeStart': this.updateDate[0] === undefined ? '' : this.updateDate[0],
'updateTimeEnd': this.updateDate[1] === undefined ? '' : this.updateDate[1] 'updateTimeEnd': this.updateDate[1] === undefined ? '' : this.updateDate[1]
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.page.list
this.totalPage = data.page.totalCount this.totalPage = data.page.totalCount
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// 每页数 // 每页数
sizeChangeHandle (val) { sizeChangeHandle (val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// 当前页 // 当前页
currentChangeHandle (val) { currentChangeHandle (val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// 多选 // 多选
selectionChangeHandle (val) { selectionChangeHandle (val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// 新增 // 新增 / 修改
addOrUpdateHandle () { addOrUpdateHandle (id, showInfo) {
this.$nextTick(() => { this.addOrUpdateVisible = true
this.$router.push({name: 'center-add'}) this.$nextTick(() => {
}) this.$refs.addOrUpdate.init(id, showInfo)
}, })
// 修改 },
updateHandle (id) {
this.$nextTick(() => {
this.$router.push({name: 'center-update', query: {id: id}})
})
},
// 详情
infoHandle (id) {
this.$nextTick(() => {
this.$router.push({name: 'center-info', query: {id: id, showInfo: true}})
})
},
// 删除 // 删除
deleteHandle (id) { deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id return item.id
}) })
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/office/center/delete'), url: this.$http.adornUrl('/office/center/delete'),
method: 'post', method: 'post',
data: this.$http.adornData(ids, false) data: this.$http.adornData(ids, false)
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList() this.getDataList()
} }
}) })
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
}).catch(() => {}) }).catch(() => {})
}, },
// 审核 // 审核
checkHandle (id, status) { checkHandle (id, status) {
let str = '' let str = ''
if (status === 1) { if (status === 1) {
str = '成功' str = '成功'
} else { } else {
str = '失败' str = '失败'
} }
this.$confirm(`确定对[id=${id}]进行['审核${str}']操作?`, '提示', { this.$confirm(`确定对[id=${id}]进行['审核${str}']操作?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/office/center/verifyTopic'), url: this.$http.adornUrl('/office/center/verifyTopic'),
method: 'post', method: 'post',
data: this.$http.adornData({ data: this.$http.adornData({
'id': id, 'id': id,
'status': status 'status': status
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList() this.getDataList()
} }
}) })
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
}).catch(() => {}) }).catch(() => {})
} }
} }
} }
</script> </script>
<template> <template>
<div class="mod-config"> <el-dialog
<div class="title">{{title}}</div> :title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'"
<div class="form-list"> :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 :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px" v-loading='loading'>
<div class="base-info">基本信息</div>
<el-form-item label="原始标题:" prop="titleOld"> <el-form-item label="原始标题:" prop="titleOld">
<el-input v-model="dataForm.titleOld" placeholder="请输入原始标题" v-show="!showInfo" size="small"></el-input> <el-input v-model="dataForm.titleOld" placeholder="请输入原始标题" v-show="!showInfo" size="small"></el-input>
<p v-show="showInfo">{{dataForm.titleOld}}</p> <p v-show="showInfo">{{dataForm.titleOld}}</p>
...@@ -75,14 +75,11 @@ ...@@ -75,14 +75,11 @@
<div v-show="showInfo" v-html="dataForm.content"></div> <div v-show="showInfo" v-html="dataForm.content"></div>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> <span slot="footer" class="dialog-footer" v-show="!showInfo">
<div class="sub-btn" v-show="!showInfo"> <el-button @click="visible = false">取消</el-button>
<span slot='footer' class='dialog-footer'> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<el-button @click='clearInp()'>重置</el-button> </span>
<el-button type='primary' @click='dataFormSubmit()'>确定</el-button> </el-dialog>
</span>
</div>
</div>
</template> </template>
<script> <script>
...@@ -94,7 +91,8 @@ ...@@ -94,7 +91,8 @@
data () { data () {
return { return {
loading: false, loading: false,
showInfo: this.$route.query.showInfo, visible: false,
showInfo: false,
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'label' label: 'label'
...@@ -160,22 +158,16 @@ ...@@ -160,22 +158,16 @@
title: '' title: ''
} }
}, },
activated () {
if (this.$route.query.id) {
this.init(this.$route.query.id)
} else {
this.clearInp()
}
this.title = !this.$route.query.id ? '添加' : '修改'
},
created () { created () {
}, },
methods: { methods: {
init (id) { init (id, showInfo) {
this.loading = true
this.dataForm.id = id || 0 this.dataForm.id = id || 0
this.visible = true
this.showInfo = showInfo
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.clearInp()
if (this.dataForm.id) { if (this.dataForm.id) {
this.$http({ this.$http({
url: this.$http.adornUrl(`/office/news/info/${this.dataForm.id}`), url: this.$http.adornUrl(`/office/news/info/${this.dataForm.id}`),
...@@ -226,7 +218,8 @@ ...@@ -226,7 +218,8 @@
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.$router.push({name: 'party-hotFlow'}) this.visible = false
this.$emit('refreshDataList')
} }
}) })
} else { } else {
...@@ -286,7 +279,7 @@ ...@@ -286,7 +279,7 @@
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
this.imgUrlStr = '' this.imgUrlStr = ''
this.dialogVisible = false this.dialogVisible = false
this.dataForm.content = '' this.ueditor.value = ''
}, },
// 更新父子组件内容 // 更新父子组件内容
editorReady (instance) { editorReady (instance) {
...@@ -298,17 +291,3 @@ ...@@ -298,17 +291,3 @@
} }
} }
</script> </script>
<style scoped>
.form-list{
padding-left: 4%!important;
}
.el-form-item__content{
width: 50%;
}
.el-select,.el-input{
width: 241px!important;
}
.edui-editor{
width: 100%;
}
</style>
\ No newline at end of file
...@@ -145,12 +145,12 @@ ...@@ -145,12 +145,12 @@
width="150" width="150"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="checkHandle(scope.row.id,1)">[成功]</el-button> <el-button type="text" size="small" @click="checkHandle(scope.row.id,1)">[成功]</el-button>
<el-button type="text" @click="checkHandle(scope.row.id,-1)">[失败]</el-button> <el-button type="text" size="small" @click="checkHandle(scope.row.id,-1)">[失败]</el-button>
<br /> <br />
<el-button type="text" @click="infoHandle(scope.row.id)" >预览</el-button> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id,true)">预览</el-button>
<el-button type="text" @click="updateHandle(scope.row.id)">修改</el-button> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" @click="deleteHandle(scope.row.id)">删除</el-button> <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -164,181 +164,177 @@ ...@@ -164,181 +164,177 @@
:total="totalPage" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper"> layout="total, sizes, prev, pager, next, jumper">
</el-pagination> </el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { import AddOrUpdate from './hotFlow-add-or-update'
data () { export default {
return { components: {
dataForm: { AddOrUpdate
title: '', },
author: '', data () {
editor: '', return {
keyword: '', addOrUpdateVisible: false,
status: '', dataForm: {
levels: '0' title: '',
}, author: '',
dataList: [], editor: '',
pageIndex: 1, keyword: '',
pageSize: 10, status: '',
totalPage: 0, levels: '0'
dataListLoading: false, },
dataListSelections: [], dataList: [],
statusList: [ pageIndex: 1,
{ pageSize: 10,
value: '0', totalPage: 0,
label: '待审核' dataListLoading: false,
}, dataListSelections: [],
{ statusList: [
value: '-1', {
label: '失败' value: '0',
}, label: '待审核'
{ },
value: '1', {
label: '成功' value: '-1',
} label: '失败'
], },
levelList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], {
updateDate: [], value: '1',
releaseDate: [] label: '成功'
} }
}, ],
activated () { levelList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
this.getDataList() updateDate: [],
}, releaseDate: []
methods: { }
},
activated () {
this.getDataList()
},
methods: {
// 获取数据列表 // 获取数据列表
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/office/hotFlow/list'), url: this.$http.adornUrl('/office/hotFlow/list'),
method: 'post', method: 'post',
data: this.$http.adornData({ data: this.$http.adornData({
'page': this.pageIndex, 'page': this.pageIndex,
'limit': this.pageSize, 'limit': this.pageSize,
'title': this.dataForm.title, 'title': this.dataForm.title,
'levels': this.dataForm.levels, 'levels': this.dataForm.levels,
'author': this.dataForm.author, 'author': this.dataForm.author,
'editor': this.dataForm.editor, 'editor': this.dataForm.editor,
'keyword': this.dataForm.keyword, 'keyword': this.dataForm.keyword,
'status': this.dataForm.status, 'status': this.dataForm.status,
'releaseTimeStart': this.releaseDate[0] === undefined ? '' : this.releaseDate[0], 'releaseTimeStart': this.releaseDate[0] === undefined ? '' : this.releaseDate[0],
'releaseTimeEnd': this.releaseDate[1] === undefined ? '' : this.releaseDate[1], 'releaseTimeEnd': this.releaseDate[1] === undefined ? '' : this.releaseDate[1],
'updateTimeStart': this.updateDate[0] === undefined ? '' : this.updateDate[0], 'updateTimeStart': this.updateDate[0] === undefined ? '' : this.updateDate[0],
'updateTimeEnd': this.updateDate[1] === undefined ? '' : this.updateDate[1] 'updateTimeEnd': this.updateDate[1] === undefined ? '' : this.updateDate[1]
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.page.list
this.totalPage = data.page.totalCount this.totalPage = data.page.totalCount
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// 每页数 // 每页数
sizeChangeHandle (val) { sizeChangeHandle (val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// 当前页 // 当前页
currentChangeHandle (val) { currentChangeHandle (val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// 多选 // 多选
selectionChangeHandle (val) { selectionChangeHandle (val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// 新增 // 新增 / 修改
addOrUpdateHandle () { addOrUpdateHandle (id, showInfo) {
this.$nextTick(() => { this.addOrUpdateVisible = true
this.$router.push({name: 'hotFlow-add'}) this.$nextTick(() => {
}) this.$refs.addOrUpdate.init(id, showInfo)
}, })
// 修改 },
updateHandle (id) {
this.$nextTick(() => {
this.$router.push({name: 'hotFlow-update', query: {id: id}})
})
},
// 详情
infoHandle (id) {
this.$nextTick(() => {
this.$router.push({name: 'hotFlow-info', query: {id: id, showInfo: true}})
})
},
// 删除 // 删除
deleteHandle (id) { deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id return item.id
}) })
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/office/hotFlow/delete'), url: this.$http.adornUrl('/office/hotFlow/delete'),
method: 'post', method: 'post',
data: this.$http.adornData(ids, false) data: this.$http.adornData(ids, false)
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList() this.getDataList()
} }
}) })
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
}).catch(() => {}) }).catch(() => {})
}, },
// 审核 // 审核
checkHandle (id, status) { checkHandle (id, status) {
let str = '' let str = ''
if (status === 1) { if (status === 1) {
str = '成功' str = '成功'
} else { } else {
str = '失败' str = '失败'
} }
this.$confirm(`确定对[id=${id}]进行['审核${str}']操作?`, '提示', { this.$confirm(`确定对[id=${id}]进行['审核${str}']操作?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/office/hotFlow/verifyTopic'), url: this.$http.adornUrl('/office/hotFlow/verifyTopic'),
method: 'post', method: 'post',
data: this.$http.adornData({ data: this.$http.adornData({
'id': id, 'id': id,
'status': status 'status': status
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList() this.getDataList()
} }
}) })
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
}).catch(() => {}) }).catch(() => {})
} }
} }
} }
</script> </script>
<template> <template>
<div class="mod-config"> <el-dialog
<div class="title">{{title}}</div> :title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'"
<div class="form-list"> :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 :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px" v-loading='loading'>
<div class="base-info">基本信息</div>
<el-form-item label="原始标题:" prop="titleOld"> <el-form-item label="原始标题:" prop="titleOld">
<el-input v-model="dataForm.titleOld" placeholder="请输入原始标题" v-show="!showInfo" size="small"></el-input> <el-input v-model="dataForm.titleOld" placeholder="请输入原始标题" v-show="!showInfo" size="small"></el-input>
<p v-show="showInfo">{{dataForm.titleOld}}</p> <p v-show="showInfo">{{dataForm.titleOld}}</p>
...@@ -75,14 +75,11 @@ ...@@ -75,14 +75,11 @@
<div v-show="showInfo" v-html="dataForm.content"></div> <div v-show="showInfo" v-html="dataForm.content"></div>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> <span slot="footer" class="dialog-footer" v-show="!showInfo">
<div class="sub-btn" v-show="!showInfo"> <el-button @click="visible = false">取消</el-button>
<span slot='footer' class='dialog-footer'> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<el-button @click='clearInp()'>重置</el-button> </span>
<el-button type='primary' @click='dataFormSubmit()'>确定</el-button> </el-dialog>
</span>
</div>
</div>
</template> </template>
<script> <script>
...@@ -94,7 +91,8 @@ ...@@ -94,7 +91,8 @@
data () { data () {
return { return {
loading: false, loading: false,
showInfo: this.$route.query.showInfo, visible: false,
showInfo: false,
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'label' label: 'label'
...@@ -163,22 +161,16 @@ ...@@ -163,22 +161,16 @@
title: '' title: ''
} }
}, },
activated () {
if (this.$route.query.id) {
this.init(this.$route.query.id)
} else {
this.clearInp()
}
this.title = !this.$route.query.id ? '添加' : '修改'
},
created () { created () {
}, },
methods: { methods: {
init (id) { init (id, showInfo) {
this.loading = true
this.dataForm.id = id || 0 this.dataForm.id = id || 0
this.visible = true
this.showInfo = showInfo
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.clearInp()
if (this.dataForm.id) { if (this.dataForm.id) {
this.$http({ this.$http({
url: this.$http.adornUrl(`/office/news/info/${this.dataForm.id}`), url: this.$http.adornUrl(`/office/news/info/${this.dataForm.id}`),
...@@ -229,7 +221,8 @@ ...@@ -229,7 +221,8 @@
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.$router.push({name: 'party-rules'}) this.visible = false
this.$emit('refreshDataList')
} }
}) })
} else { } else {
...@@ -281,7 +274,7 @@ ...@@ -281,7 +274,7 @@
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
this.imgUrlStr = '' this.imgUrlStr = ''
this.dialogVisible = false this.dialogVisible = false
this.dataForm.content = '' this.ueditor.value = ''
}, },
// 更新父子组件内容 // 更新父子组件内容
editorReady (instance) { editorReady (instance) {
...@@ -293,17 +286,3 @@ ...@@ -293,17 +286,3 @@
} }
} }
</script> </script>
<style scoped>
.form-list{
padding-left: 4%!important;
}
.el-form-item__content{
width: 50%;
}
.el-select,.el-input{
width: 241px!important;
}
.edui-editor{
width: 100%;
}
</style>
\ No newline at end of file
...@@ -145,12 +145,12 @@ ...@@ -145,12 +145,12 @@
width="150" width="150"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="checkHandle(scope.row.id,1)">[成功]</el-button> <el-button type="text" size="small" @click="checkHandle(scope.row.id,1)">[成功]</el-button>
<el-button type="text" @click="checkHandle(scope.row.id,-1)">[失败]</el-button> <el-button type="text" size="small" @click="checkHandle(scope.row.id,-1)">[失败]</el-button>
<br /> <br />
<el-button type="text" @click="infoHandle(scope.row.id)" >预览</el-button> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id,true)">预览</el-button>
<el-button type="text" @click="updateHandle(scope.row.id)">修改</el-button> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" @click="deleteHandle(scope.row.id)">删除</el-button> <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -164,181 +164,177 @@ ...@@ -164,181 +164,177 @@
:total="totalPage" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper"> layout="total, sizes, prev, pager, next, jumper">
</el-pagination> </el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { import AddOrUpdate from './rules-add-or-update'
data () { export default {
return { components: {
dataForm: { AddOrUpdate
title: '', },
author: '', data () {
editor: '', return {
keyword: '', addOrUpdateVisible: false,
status: '', dataForm: {
levels: '0' title: '',
}, author: '',
dataList: [], editor: '',
pageIndex: 1, keyword: '',
pageSize: 10, status: '',
totalPage: 0, levels: '0'
dataListLoading: false, },
dataListSelections: [], dataList: [],
statusList: [ pageIndex: 1,
{ pageSize: 10,
value: '0', totalPage: 0,
label: '待审核' dataListLoading: false,
}, dataListSelections: [],
{ statusList: [
value: '-1', {
label: '失败' value: '0',
}, label: '待审核'
{ },
value: '1', {
label: '成功' value: '-1',
} label: '失败'
], },
levelList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], {
updateDate: [], value: '1',
releaseDate: [] label: '成功'
} }
}, ],
activated () { levelList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
this.getDataList() updateDate: [],
}, releaseDate: []
methods: { }
},
activated () {
this.getDataList()
},
methods: {
// 获取数据列表 // 获取数据列表
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/office/rules/list'), url: this.$http.adornUrl('/office/rules/list'),
method: 'post', method: 'post',
data: this.$http.adornData({ data: this.$http.adornData({
'page': this.pageIndex, 'page': this.pageIndex,
'limit': this.pageSize, 'limit': this.pageSize,
'title': this.dataForm.title, 'title': this.dataForm.title,
'levels': this.dataForm.levels, 'levels': this.dataForm.levels,
'author': this.dataForm.author, 'author': this.dataForm.author,
'editor': this.dataForm.editor, 'editor': this.dataForm.editor,
'keyword': this.dataForm.keyword, 'keyword': this.dataForm.keyword,
'status': this.dataForm.status, 'status': this.dataForm.status,
'releaseTimeStart': this.releaseDate === null ? '' : this.releaseDate[0], 'releaseTimeStart': this.releaseDate === null ? '' : this.releaseDate[0],
'releaseTimeEnd': this.releaseDate === null ? '' : this.releaseDate[1], 'releaseTimeEnd': this.releaseDate === null ? '' : this.releaseDate[1],
'updateTimeStart': this.updateDate === null ? '' : this.updateDate[0], 'updateTimeStart': this.updateDate === null ? '' : this.updateDate[0],
'updateTimeEnd': this.updateDate === null ? '' : this.updateDate[1] 'updateTimeEnd': this.updateDate === null ? '' : this.updateDate[1]
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.page.list
this.totalPage = data.page.totalCount this.totalPage = data.page.totalCount
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// 每页数 // 每页数
sizeChangeHandle (val) { sizeChangeHandle (val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// 当前页 // 当前页
currentChangeHandle (val) { currentChangeHandle (val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// 多选 // 多选
selectionChangeHandle (val) { selectionChangeHandle (val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// 新增 // 新增 / 修改
addOrUpdateHandle () { addOrUpdateHandle (id, showInfo) {
this.$nextTick(() => { this.addOrUpdateVisible = true
this.$router.push({name: 'rules-add'}) this.$nextTick(() => {
}) this.$refs.addOrUpdate.init(id, showInfo)
}, })
// 修改 },
updateHandle (id) {
this.$nextTick(() => {
this.$router.push({name: 'rules-update', query: {id: id}})
})
},
// 详情
infoHandle (id) {
this.$nextTick(() => {
this.$router.push({name: 'rules-info', query: {id: id, showInfo: true}})
})
},
// 删除 // 删除
deleteHandle (id) { deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id return item.id
}) })
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/office/rules/delete'), url: this.$http.adornUrl('/office/rules/delete'),
method: 'post', method: 'post',
data: this.$http.adornData(ids, false) data: this.$http.adornData(ids, false)
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList() this.getDataList()
} }
}) })
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
}).catch(() => {}) }).catch(() => {})
}, },
// 审核 // 审核
checkHandle (id, status) { checkHandle (id, status) {
let str = '' let str = ''
if (status === 1) { if (status === 1) {
str = '成功' str = '成功'
} else { } else {
str = '失败' str = '失败'
} }
this.$confirm(`确定对[id=${id}]进行['审核${str}']操作?`, '提示', { this.$confirm(`确定对[id=${id}]进行['审核${str}']操作?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/office/rules/verifyTopic'), url: this.$http.adornUrl('/office/rules/verifyTopic'),
method: 'post', method: 'post',
data: this.$http.adornData({ data: this.$http.adornData({
'id': id, 'id': id,
'status': status 'status': status
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList() this.getDataList()
} }
}) })
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
}).catch(() => {}) }).catch(() => {})
} }
} }
} }
</script> </script>
<template> <template>
<div class="mod-config"> <el-dialog
<div class="title">{{title}}</div> :title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'"
<div class="form-list"> :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 :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px" v-loading='loading'>
<div class="base-info">基本信息</div>
<el-form-item label="原始标题:" prop="titleOld"> <el-form-item label="原始标题:" prop="titleOld">
<el-input v-model="dataForm.titleOld" placeholder="请输入原始标题" v-show="!showInfo" size="small"></el-input> <el-input v-model="dataForm.titleOld" placeholder="请输入原始标题" v-show="!showInfo" size="small"></el-input>
<p v-show="showInfo">{{dataForm.titleOld}}</p> <p v-show="showInfo">{{dataForm.titleOld}}</p>
...@@ -75,14 +75,11 @@ ...@@ -75,14 +75,11 @@
<div v-show="showInfo" v-html="dataForm.content"></div> <div v-show="showInfo" v-html="dataForm.content"></div>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> <span slot="footer" class="dialog-footer" v-show="!showInfo">
<div class="sub-btn" v-show="!showInfo"> <el-button @click="visible = false">取消</el-button>
<span slot='footer' class='dialog-footer'> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<el-button @click='clearInp()'>重置</el-button> </span>
<el-button type='primary' @click='dataFormSubmit()'>确定</el-button> </el-dialog>
</span>
</div>
</div>
</template> </template>
<script> <script>
...@@ -94,7 +91,8 @@ ...@@ -94,7 +91,8 @@
data () { data () {
return { return {
loading: false, loading: false,
showInfo: this.$route.query.showInfo, visible: false,
showInfo: false,
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'label' label: 'label'
...@@ -163,23 +161,16 @@ ...@@ -163,23 +161,16 @@
title: '' title: ''
} }
}, },
activated () {
if (this.$route.query.id) {
this.init(this.$route.query.id)
} else {
this.clearInp()
}
this.title = !this.$route.query.id ? '添加' : '修改'
},
created () { created () {
}, },
methods: { methods: {
init (id) { init (id, showInfo) {
this.loading = true
this.dataForm.id = id || 0 this.dataForm.id = id || 0
this.visible = true
this.showInfo = showInfo
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.clearInp()
if (this.dataForm.id) { if (this.dataForm.id) {
this.$http({ this.$http({
url: this.$http.adornUrl(`/office/news/info/${this.dataForm.id}`), url: this.$http.adornUrl(`/office/news/info/${this.dataForm.id}`),
...@@ -230,7 +221,8 @@ ...@@ -230,7 +221,8 @@
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.$router.push({name: 'party-topicnews'}) this.visible = false
this.$emit('refreshDataList')
} }
}) })
} else { } else {
...@@ -282,7 +274,7 @@ ...@@ -282,7 +274,7 @@
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
this.imgUrlStr = '' this.imgUrlStr = ''
this.dialogVisible = false this.dialogVisible = false
this.dataForm.content = '' this.ueditor.value = ''
}, },
// 更新父子组件内容 // 更新父子组件内容
editorReady (instance) { editorReady (instance) {
...@@ -294,17 +286,3 @@ ...@@ -294,17 +286,3 @@
} }
} }
</script> </script>
<style scoped>
.form-list{
padding-left: 4%!important;
}
.el-form-item__content{
width: 50%;
}
.el-select,.el-input{
width: 241px!important;
}
.edui-editor{
width: 100%;
}
</style>
\ No newline at end of file
...@@ -145,12 +145,12 @@ ...@@ -145,12 +145,12 @@
width="150" width="150"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="checkHandle(scope.row.id,1)">[成功]</el-button> <el-button type="text" size="small" @click="checkHandle(scope.row.id,1)">[成功]</el-button>
<el-button type="text" @click="checkHandle(scope.row.id,-1)">[失败]</el-button> <el-button type="text" size="small" @click="checkHandle(scope.row.id,-1)">[失败]</el-button>
<br /> <br />
<el-button type="text" @click="infoHandle(scope.row.id)" >预览</el-button> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id,true)">预览</el-button>
<el-button type="text" @click="updateHandle(scope.row.id)">修改</el-button> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" @click="deleteHandle(scope.row.id)">删除</el-button> <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -164,181 +164,177 @@ ...@@ -164,181 +164,177 @@
:total="totalPage" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper"> layout="total, sizes, prev, pager, next, jumper">
</el-pagination> </el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { import AddOrUpdate from './topicnews-add-or-update'
data () { export default {
return { components: {
dataForm: { AddOrUpdate
title: '', },
author: '', data () {
editor: '', return {
keyword: '', addOrUpdateVisible: false,
status: '', dataForm: {
levels: '0' title: '',
}, author: '',
dataList: [], editor: '',
pageIndex: 1, keyword: '',
pageSize: 10, status: '',
totalPage: 0, levels: '0'
dataListLoading: false, },
dataListSelections: [], dataList: [],
statusList: [ pageIndex: 1,
{ pageSize: 10,
value: '0', totalPage: 0,
label: '待审核' dataListLoading: false,
}, dataListSelections: [],
{ statusList: [
value: '-1', {
label: '失败' value: '0',
}, label: '待审核'
{ },
value: '1', {
label: '成功' value: '-1',
} label: '失败'
], },
levelList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], {
updateDate: [], value: '1',
releaseDate: [] label: '成功'
} }
}, ],
activated () { levelList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
this.getDataList() updateDate: [],
}, releaseDate: []
methods: { }
},
activated () {
this.getDataList()
},
methods: {
// 获取数据列表 // 获取数据列表
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/office/topicnews/list'), url: this.$http.adornUrl('/office/topicnews/list'),
method: 'post', method: 'post',
data: this.$http.adornData({ data: this.$http.adornData({
'page': this.pageIndex, 'page': this.pageIndex,
'limit': this.pageSize, 'limit': this.pageSize,
'title': this.dataForm.title, 'title': this.dataForm.title,
'levels': this.dataForm.levels, 'levels': this.dataForm.levels,
'author': this.dataForm.author, 'author': this.dataForm.author,
'editor': this.dataForm.editor, 'editor': this.dataForm.editor,
'keyword': this.dataForm.keyword, 'keyword': this.dataForm.keyword,
'status': this.dataForm.status, 'status': this.dataForm.status,
'releaseTimeStart': this.releaseDate === null ? '' : this.releaseDate[0], 'releaseTimeStart': this.releaseDate === null ? '' : this.releaseDate[0],
'releaseTimeEnd': this.releaseDate === null ? '' : this.releaseDate[1], 'releaseTimeEnd': this.releaseDate === null ? '' : this.releaseDate[1],
'updateTimeStart': this.updateDate === null ? '' : this.updateDate[0], 'updateTimeStart': this.updateDate === null ? '' : this.updateDate[0],
'updateTimeEnd': this.updateDate === null ? '' : this.updateDate[1] 'updateTimeEnd': this.updateDate === null ? '' : this.updateDate[1]
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.page.list
this.totalPage = data.page.totalCount this.totalPage = data.page.totalCount
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// 每页数 // 每页数
sizeChangeHandle (val) { sizeChangeHandle (val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// 当前页 // 当前页
currentChangeHandle (val) { currentChangeHandle (val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// 多选 // 多选
selectionChangeHandle (val) { selectionChangeHandle (val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// 新增 // 新增 / 修改
addOrUpdateHandle () { addOrUpdateHandle (id, showInfo) {
this.$nextTick(() => { this.addOrUpdateVisible = true
this.$router.push({name: 'topicnews-add'}) this.$nextTick(() => {
}) this.$refs.addOrUpdate.init(id, showInfo)
}, })
// 修改 },
updateHandle (id) {
this.$nextTick(() => {
this.$router.push({name: 'topicnews-update', query: {id: id}})
})
},
// 详情
infoHandle (id) {
this.$nextTick(() => {
this.$router.push({name: 'topicnews-info', query: {id: id, showInfo: true}})
})
},
// 删除 // 删除
deleteHandle (id) { deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id return item.id
}) })
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/office/topicnews/delete'), url: this.$http.adornUrl('/office/topicnews/delete'),
method: 'post', method: 'post',
data: this.$http.adornData(ids, false) data: this.$http.adornData(ids, false)
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList() this.getDataList()
} }
}) })
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
}).catch(() => {}) }).catch(() => {})
}, },
// 审核 // 审核
checkHandle (id, status) { checkHandle (id, status) {
let str = '' let str = ''
if (status === 1) { if (status === 1) {
str = '成功' str = '成功'
} else { } else {
str = '失败' str = '失败'
} }
this.$confirm(`确定对[id=${id}]进行['审核${str}']操作?`, '提示', { this.$confirm(`确定对[id=${id}]进行['审核${str}']操作?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/office/topicnews/verifyTopic'), url: this.$http.adornUrl('/office/topicnews/verifyTopic'),
method: 'post', method: 'post',
data: this.$http.adornData({ data: this.$http.adornData({
'id': id, 'id': id,
'status': status 'status': status
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList() this.getDataList()
} }
}) })
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
}).catch(() => {}) }).catch(() => {})
} }
} }
} }
</script> </script>
<template> <template>
<div class="mod-config"> <el-dialog
<div class="title">{{title}}</div> :title="!dataForm.id ? '新增' : this.showInfo?'详情':'修改'"
<div class="form-list"> :close-on-click-modal="false"
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px"> :visible.sync="visible">
<div class="base-info">基本信息</div> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px" v-loading='loading'>
<el-form-item label="原始标题:" prop="titleOld"> <el-form-item label="原始标题:" prop="titleOld">
<el-input v-model="dataForm.titleOld" placeholder="请输入显示标题" v-show="!showInfo" size="small"></el-input> <el-input v-model="dataForm.titleOld" placeholder="请输入显示标题" v-show="!showInfo" size="small"></el-input>
<p v-show="showInfo">{{dataForm.titleOld}}</p> <p v-show="showInfo">{{dataForm.titleOld}}</p>
...@@ -81,14 +81,11 @@ ...@@ -81,14 +81,11 @@
<div v-show="showInfo" v-html="dataForm.content"></div> <div v-show="showInfo" v-html="dataForm.content"></div>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> <span slot="footer" class="dialog-footer" v-show="!showInfo">
<div class="sub-btn" v-show="!showInfo"> <el-button @click="visible = false">取消</el-button>
<span slot='footer' class='dialog-footer'> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<el-button @click='clearInp()'>重置</el-button> </span>
<el-button type='primary' @click='dataFormSubmit()'>确定</el-button> </el-dialog>
</span>
</div>
</div>
</template> </template>
<script> <script>
...@@ -99,7 +96,9 @@ ...@@ -99,7 +96,9 @@
}, },
data () { data () {
return { return {
showInfo: this.$route.query.showInfo || false, loading: false,
visible: false,
showInfo: false,
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'label' label: 'label'
...@@ -176,25 +175,23 @@ ...@@ -176,25 +175,23 @@
title: '' title: ''
} }
}, },
activated () {
if (this.$route.query.id) {
this.init(this.$route.query.id)
}
this.title = !this.$route.query.id ? '新增' : '修改'
},
created () { created () {
}, },
methods: { methods: {
init (id) { init (id, showInfo) {
this.dataForm.id = id || 0 this.dataForm.id = id || 0
this.visible = true
this.showInfo = showInfo
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.clearInp()
if (this.dataForm.id) { if (this.dataForm.id) {
this.$http({ this.$http({
url: this.$http.adornUrl(`/office/policy/info/${this.dataForm.id}`), url: this.$http.adornUrl(`/office/policy/info/${this.dataForm.id}`),
method: 'get', method: 'get',
params: this.$http.adornParams() params: this.$http.adornParams()
}).then(({data}) => { }).then(({data}) => {
this.loading = false
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataForm = data.policy this.dataForm = data.policy
this.dataForm.publicdate = data.policy.releasedate this.dataForm.publicdate = data.policy.releasedate
...@@ -214,6 +211,7 @@ ...@@ -214,6 +211,7 @@
}, },
// 表单提交 // 表单提交
dataFormSubmit () { dataFormSubmit () {
this.loading = true
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
if (valid) { if (valid) {
this.$http({ this.$http({
...@@ -235,13 +233,15 @@ ...@@ -235,13 +233,15 @@
'startdate': this.dataForm.startdate 'startdate': this.dataForm.startdate
}) })
}).then(({data}) => { }).then(({data}) => {
this.loading = false
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.$router.push({name: 'policy-policy'}) this.visible = false
this.$emit('refreshDataList')
} }
}) })
} else { } else {
...@@ -254,25 +254,9 @@ ...@@ -254,25 +254,9 @@
clearInp () { clearInp () {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
this.imgUrlStr = '' this.ueditor.value = ''
this.dialogVisible = false
this.dataForm.value = ''
} }
} }
} }
</script> </script>
<style scoped>
.form-list{
padding-left: 4%!important;
}
.el-form-item__content{
width: 50%;
}
.el-select,.el-input{
width: 241px!important;
}
.edui-editor{
width: 100%;
}
</style>
\ No newline at end of file
<template> <template>
<div class="mod-config mod-list-form"> <div class="mod-config mod-list-form">
<div class="title">政策法规管理</div>
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item label='标题' prop='title'> <el-form-item label='标题' prop='title'>
<el-input v-model='dataForm.title' placeholder='请输入标题' size="small" clearable></el-input> <el-input v-model='dataForm.title' placeholder='请输入标题' size="small" clearable></el-input>
...@@ -135,12 +134,12 @@ ...@@ -135,12 +134,12 @@
width="150" width="150"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="checkHandle(scope.row.id,1)">[成功]</el-button> <el-button type="text" size="small" @click="checkHandle(scope.row.id,1)">[成功]</el-button>
<el-button type="text" @click="checkHandle(scope.row.id,-1)">[失败]</el-button> <el-button type="text" size="small" @click="checkHandle(scope.row.id,-1)">[失败]</el-button>
<br /> <br />
<el-button type="text" @click="infoHandle(scope.row.id)">预览</el-button> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id,true)">预览</el-button>
<el-button type="text" @click="updateHandle(scope.row.id)">修改</el-button> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" @click="deleteHandle(scope.row.id)">删除</el-button> <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -154,191 +153,187 @@ ...@@ -154,191 +153,187 @@
:total="totalPage" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper"> layout="total, sizes, prev, pager, next, jumper">
</el-pagination> </el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { import AddOrUpdate from './policy-add-or-update'
data () { export default {
return { components: {
dataForm: { AddOrUpdate
'title': '', },
'levels': '0', data () {
'class1': '', return {
'editor': '', addOrUpdateVisible: false,
'keyword': '', dataForm: {
'status': '', 'title': '',
'auditor': '' 'levels': '0',
}, 'class1': '',
dataList: [], 'editor': '',
pageIndex: 1, 'keyword': '',
pageSize: 10, 'status': '',
totalPage: 0, 'auditor': ''
dataListLoading: false, },
dataListSelections: [], dataList: [],
statusList: [ pageIndex: 1,
{ pageSize: 10,
value: '0', totalPage: 0,
label: '待审核' dataListLoading: false,
}, dataListSelections: [],
{ statusList: [
value: '-1', {
label: '失败' value: '0',
}, label: '待审核'
{ },
value: '1', {
label: '成功' value: '-1',
} label: '失败'
], },
piclevelList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], {
updateDate: [], value: '1',
typeList: [ label: '成功'
{ }
typeName: '法律法规' ],
}, piclevelList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
{ updateDate: [],
typeName: '相关标准' typeList: [
} {
] typeName: '法律法规'
} },
}, {
activated () { typeName: '相关标准'
this.getDataList() }
}, ]
created () { }
},
}, activated () {
methods: { this.getDataList()
},
created () {
},
methods: {
// 获取数据列表 // 获取数据列表
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/office/policy/list'), url: this.$http.adornUrl('/office/policy/list'),
method: 'post', method: 'post',
data: this.$http.adornData({ data: this.$http.adornData({
'page': this.pageIndex, 'page': this.pageIndex,
'limit': this.pageSize, 'limit': this.pageSize,
'title': this.dataForm.title, 'title': this.dataForm.title,
'levels': this.dataForm.levels, 'levels': this.dataForm.levels,
'class1': this.dataForm.class1, 'class1': this.dataForm.class1,
'editor': this.dataForm.editor, 'editor': this.dataForm.editor,
'keyword': this.dataForm.keyword, 'keyword': this.dataForm.keyword,
'status': this.dataForm.status, 'status': this.dataForm.status,
'updateTimeStart': this.updateDate[0] === undefined ? '' : this.updateDate[0], 'updateTimeStart': this.updateDate[0] === undefined ? '' : this.updateDate[0],
'updateTimeEnd': this.updateDate[1] === undefined ? '' : this.updateDate[1] 'updateTimeEnd': this.updateDate[1] === undefined ? '' : this.updateDate[1]
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.page.list
this.totalPage = data.page.totalCount this.totalPage = data.page.totalCount
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// 每页数 // 每页数
sizeChangeHandle (val) { sizeChangeHandle (val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// 当前页 // 当前页
currentChangeHandle (val) { currentChangeHandle (val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// 多选 // 多选
selectionChangeHandle (val) { selectionChangeHandle (val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// 新增 // 新增 / 修改
addOrUpdateHandle () { addOrUpdateHandle (id, showInfo) {
this.$nextTick(() => { this.addOrUpdateVisible = true
this.$router.push({name: 'policy-add'}) this.$nextTick(() => {
}) this.$refs.addOrUpdate.init(id, showInfo)
}, })
// 修改 },
updateHandle (id) {
this.$nextTick(() => {
this.$router.push({name: 'policy-update', query: {id: id}})
})
},
// 详情
infoHandle (id) {
this.$nextTick(() => {
this.$router.push({name: 'policy-info', query: {id: id, showInfo: true}})
})
},
// 删除 // 删除
deleteHandle (id) { deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id return item.id
}) })
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/office/policy/delete'), url: this.$http.adornUrl('/office/policy/delete'),
method: 'post', method: 'post',
data: this.$http.adornData(ids, false) data: this.$http.adornData(ids, false)
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList() this.getDataList()
} }
}) })
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
}).catch(() => {}) }).catch(() => {})
}, },
// 审核 // 审核
checkHandle (id, status) { checkHandle (id, status) {
let str = '' let str = ''
if (status === 1) { if (status === 1) {
str = '成功' str = '成功'
} else { } else {
str = '失败' str = '失败'
} }
this.$confirm(`确定对[id=${id}]进行['审核${str}']操作?`, '提示', { this.$confirm(`确定对[id=${id}]进行['审核${str}']操作?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/office/policy/verifyPolicy'), url: this.$http.adornUrl('/office/policy/verifyPolicy'),
method: 'post', method: 'post',
data: this.$http.adornData({ data: this.$http.adornData({
'id': id, 'id': id,
'status': status 'status': status
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList() this.getDataList()
} }
}) })
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
}).catch(() => {}) }).catch(() => {})
} }
} }
} }
</script> </script>
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
'searchreplace', // 查询替换 'searchreplace', // 查询替换
// 'map', // Baidu地图 // 'map', // Baidu地图
// 'gmap', // Google地图 // 'gmap', // Google地图
// 'insertvideo', // 视频 'insertvideo', // 视频
// 'help', // 帮助 // 'help', // 帮助
'justifyleft', // 居左对齐 'justifyleft', // 居左对齐
'justifyright', // 居右对齐 'justifyright', // 居右对齐
......
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