|
|
|
@ -5,11 +5,17 @@ |
|
|
|
<el-form :inline="true" |
|
|
|
:model="dataForm" |
|
|
|
@keyup.enter.native="getDataList()"> |
|
|
|
<el-form-item> |
|
|
|
<el-form-item label="标题" prop="noticeTitle"> |
|
|
|
<el-input v-model="dataForm.noticeTitle" |
|
|
|
placeholder="标题" |
|
|
|
clearable></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="栏目" prop="allTypeId"> |
|
|
|
<el-cascader v-model="allTypeId" :options="moduleOptions" @change="changeHandle" |
|
|
|
:props="{ checkStrictly: true, multiple: false, emitPath: true }" |
|
|
|
clearable> |
|
|
|
</el-cascader> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button @click="getDataList()">{{ $t('query') }}</el-button> |
|
|
|
</el-form-item> |
|
|
|
@ -32,6 +38,9 @@ |
|
|
|
<el-table-column type="selection" |
|
|
|
header-align="center" |
|
|
|
align="center"></el-table-column> |
|
|
|
<el-table-column type="index" |
|
|
|
width="50" |
|
|
|
label="序号" align="center"></el-table-column> |
|
|
|
<el-table-column prop="noticeTitle" |
|
|
|
label="标题" |
|
|
|
header-align="center" |
|
|
|
@ -42,7 +51,13 @@ |
|
|
|
label="发布部门" |
|
|
|
header-align="center" |
|
|
|
min-width="150px" |
|
|
|
align="left"></el-table-column> |
|
|
|
align="center"></el-table-column> |
|
|
|
<el-table-column prop="typeName" |
|
|
|
label="所属栏目" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
min-width="130px" |
|
|
|
show-overflow-tooltip></el-table-column> |
|
|
|
<el-table-column prop="readingAmount" |
|
|
|
label="阅读量" |
|
|
|
header-align="center" |
|
|
|
@ -52,7 +67,7 @@ |
|
|
|
label="创建人" |
|
|
|
header-align="center" |
|
|
|
width="100px" |
|
|
|
align="left"></el-table-column> |
|
|
|
align="center"></el-table-column> |
|
|
|
<el-table-column prop="createdTime" |
|
|
|
label="创建时间" |
|
|
|
header-align="center" |
|
|
|
@ -75,6 +90,12 @@ |
|
|
|
align="center" |
|
|
|
width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button type="text" size="small" @click="handleIsTop(scope.row)"> |
|
|
|
{{scope.row.topFlag=='0'?'推荐':'取消推荐'}} |
|
|
|
</el-button> |
|
|
|
<el-button type="text" size="small" @click="handleIsUpDown(scope.row)"> |
|
|
|
{{scope.row.noticeUpDownState=='0'?'上架':'下架'}} |
|
|
|
</el-button> |
|
|
|
<el-button v-if="$hasPermission('news:notice:update')" |
|
|
|
type="text" |
|
|
|
size="small" |
|
|
|
@ -120,14 +141,74 @@ export default { |
|
|
|
deleteIsBatch: true |
|
|
|
}, |
|
|
|
dataForm: { |
|
|
|
noticeTitle: '' |
|
|
|
} |
|
|
|
noticeTitle: '', |
|
|
|
typeId:'', |
|
|
|
}, |
|
|
|
allTypeId:[], |
|
|
|
moduleOptions:[], |
|
|
|
} |
|
|
|
}, |
|
|
|
components: { |
|
|
|
AddOrUpdate |
|
|
|
}, |
|
|
|
created: function () { |
|
|
|
this.getModuleTypeInfo() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
changeHandle(value){ |
|
|
|
this.dataForm.typeId = this.allTypeId[value.length-1] |
|
|
|
}, |
|
|
|
//获取栏目分类 |
|
|
|
getModuleTypeInfo() { |
|
|
|
this.$http.get(`news/moduletype/getModuleListByRole`).then(({data: res}) => { |
|
|
|
this.moduleOptions = res.data.moduleOptions |
|
|
|
}).catch(() => { |
|
|
|
}) |
|
|
|
}, |
|
|
|
//推荐设置 |
|
|
|
handleIsTop (val) { |
|
|
|
this.$confirm(this.$t('prompt.info', { 'handle': '推荐相关' }), this.$t('推荐'), { |
|
|
|
confirmButtonText: this.$t('confirm'), |
|
|
|
cancelButtonText: this.$t('cancel'), |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
this.$http['put']('/news/notice/handleIsTop', val).then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
|
this.$message({ |
|
|
|
message: this.$t('prompt.success'), |
|
|
|
type: 'success', |
|
|
|
duration: 500, |
|
|
|
onClose: () => { |
|
|
|
this.getDataList() |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch(() => { }) |
|
|
|
}).catch(() => { }) |
|
|
|
}, |
|
|
|
//上下架设置 |
|
|
|
handleIsUpDown (val) { |
|
|
|
this.$confirm(this.$t('prompt.info', { 'handle': '上下架' }), this.$t('上下架'), { |
|
|
|
confirmButtonText: this.$t('confirm'), |
|
|
|
cancelButtonText: this.$t('cancel'), |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
this.$http['put']('/news/notice/handleIsUpDown', val).then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
|
this.$message({ |
|
|
|
message: this.$t('prompt.success'), |
|
|
|
type: 'success', |
|
|
|
duration: 500, |
|
|
|
onClose: () => { |
|
|
|
this.getDataList() |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch(() => { }) |
|
|
|
}).catch(() => { }) |
|
|
|
}, |
|
|
|
// 发布 |
|
|
|
noticePublishHandle (id) { |
|
|
|
this.$confirm(this.$t('prompt.info', { 'handle': '发布' }), this.$t('发布'), { |
|
|
|
|