Browse Source

后台内容管理模块修改

origin/feature/monitoring
Jackwang 4 years ago
parent
commit
4459f53895
  1. 25
      src/views/modules/news/notice-add-or-update.vue
  2. 91
      src/views/modules/news/notice.vue

25
src/views/modules/news/notice-add-or-update.vue

@ -7,7 +7,7 @@
:rules="dataRule" :rules="dataRule"
ref="dataForm" ref="dataForm"
:label-width="$i18n.locale === 'en-US' ? '120px' : '80px'"> :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'">
<el-form-item label="所属部门" <el-form-item label="所属组织"
prop="allDeptIdsShow"> prop="allDeptIdsShow">
<el-cascader v-model="dataForm.allDeptIdsShow" <el-cascader v-model="dataForm.allDeptIdsShow"
:options="options" :options="options"
@ -15,6 +15,12 @@
clearable clearable
collapse-tags></el-cascader> collapse-tags></el-cascader>
</el-form-item> </el-form-item>
<el-form-item label="栏目" prop="allTypeId">
<el-cascader v-model="dataForm.allTypeId" :options="moduleOptions" @change="changeHandle"
:props="{ checkStrictly: true, multiple: false, emitPath: true }"
clearable>
</el-cascader>
</el-form-item>
<el-form-item label="标题" <el-form-item label="标题"
prop="noticeTitle"> prop="noticeTitle">
<el-input v-model="dataForm.noticeTitle" <el-input v-model="dataForm.noticeTitle"
@ -68,7 +74,8 @@ export default {
grid: null, grid: null,
noticeTitle: '', noticeTitle: '',
noticeContent: '', noticeContent: '',
allDeptIdsShow: [] allDeptIdsShow: [],
allTypeId:[],
}, },
value: '', value: '',
// //
@ -92,7 +99,8 @@ export default {
streetList: [], streetList: [],
communityList: [], communityList: [],
gridList: [], gridList: [],
options: [] options: [],
moduleOptions:[],
} }
}, },
computed: { computed: {
@ -127,6 +135,16 @@ export default {
this.getDeptInfoList('street', localStorage.getItem('street') === null ? '1169154711480528897' : localStorage.getItem('street')) this.getDeptInfoList('street', localStorage.getItem('street') === null ? '1169154711480528897' : localStorage.getItem('street'))
}, },
methods: { methods: {
//
getModuleTypeInfo() {
this.$http.get(`news/moduletype/getModuleListByRole`).then(({data: res}) => {
this.moduleOptions = res.data.moduleOptions
}).catch(() => {
})
},
changeHandle(value){
this.dataForm.typeId = this.dataForm.allTypeId[value.length-1]
},
// //
quillEditorHandle () { quillEditorHandle () {
this.quillEditor = new Quill('#J_quillEditor', { this.quillEditor = new Quill('#J_quillEditor', {
@ -162,6 +180,7 @@ export default {
this.quillEditor.insertEmbed(this.quillEditor.getSelection().index, 'image', res.data.url) this.quillEditor.insertEmbed(this.quillEditor.getSelection().index, 'image', res.data.url)
}, },
init () { init () {
this.getModuleTypeInfo()
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
this.dataForm.communityId = this.dataForm.streetId = this.dataForm.gridId = null this.dataForm.communityId = this.dataForm.streetId = this.dataForm.gridId = null

91
src/views/modules/news/notice.vue

@ -5,11 +5,17 @@
<el-form :inline="true" <el-form :inline="true"
:model="dataForm" :model="dataForm"
@keyup.enter.native="getDataList()"> @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item label="标题" prop="noticeTitle">
<el-input v-model="dataForm.noticeTitle" <el-input v-model="dataForm.noticeTitle"
placeholder="标题" placeholder="标题"
clearable></el-input> clearable></el-input>
</el-form-item> </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-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button> <el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item> </el-form-item>
@ -32,6 +38,9 @@
<el-table-column type="selection" <el-table-column type="selection"
header-align="center" header-align="center"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column type="index"
width="50"
label="序号" align="center"></el-table-column>
<el-table-column prop="noticeTitle" <el-table-column prop="noticeTitle"
label="标题" label="标题"
header-align="center" header-align="center"
@ -42,7 +51,13 @@
label="发布部门" label="发布部门"
header-align="center" header-align="center"
min-width="150px" 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" <el-table-column prop="readingAmount"
label="阅读量" label="阅读量"
header-align="center" header-align="center"
@ -52,7 +67,7 @@
label="创建人" label="创建人"
header-align="center" header-align="center"
width="100px" width="100px"
align="left"></el-table-column> align="center"></el-table-column>
<el-table-column prop="createdTime" <el-table-column prop="createdTime"
label="创建时间" label="创建时间"
header-align="center" header-align="center"
@ -75,6 +90,12 @@
align="center" align="center"
width="150"> width="150">
<template slot-scope="scope"> <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')" <el-button v-if="$hasPermission('news:notice:update')"
type="text" type="text"
size="small" size="small"
@ -120,14 +141,74 @@ export default {
deleteIsBatch: true deleteIsBatch: true
}, },
dataForm: { dataForm: {
noticeTitle: '' noticeTitle: '',
} typeId:'',
},
allTypeId:[],
moduleOptions:[],
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
created: function () {
this.getModuleTypeInfo()
},
methods: { 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) { noticePublishHandle (id) {
this.$confirm(this.$t('prompt.info', { 'handle': '发布' }), this.$t('发布'), { this.$confirm(this.$t('prompt.info', { 'handle': '发布' }), this.$t('发布'), {

Loading…
Cancel
Save