Browse Source

Merge branch 'dev_0814' of http://121.42.41.42:7070/r/esua-epdc-admin into dev_0814

master
管理员 6 years ago
parent
commit
0ced5d9be0
  1. 24
      src/views/modules/news/banner-add-or-update.vue
  2. 17
      src/views/modules/news/notice-add-or-update.vue
  3. 68
      src/views/modules/news/notice.vue

24
src/views/modules/news/banner-add-or-update.vue

@ -67,9 +67,9 @@
<el-select v-model="dataForm.position"
placeholder="请选择">
<el-option v-for="item in positionList"
:key="item.id"
:label="item.name"
:value="item.id">
:key="item.dictValue"
:label="item.dictName"
:value="item.dictValue">
</el-option>
</el-select>
</el-form-item>
@ -122,10 +122,7 @@ export default {
communityList: [],
gridList: [],
uploadUrl: '',
positionList: [
{ 'id': '0', 'name': '上面' },
{ 'id': '1', 'name': '中间' }
]
positionList: []
}
},
computed: {
@ -155,11 +152,12 @@ export default {
created () {
// 1169154711480528897 ID
this.getDeptInfoList('street', '1169154711480528897')
this.getListFromDict('bannerType')
this.getListFromDict('bannerPosition')
},
methods: {
init () {
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
this.getbannerType()
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
@ -217,12 +215,16 @@ export default {
},
beforeAvatarUpload (file) {
},
getbannerType () {
this.$http.get(`/sys/dict/listSimple/` + 'bannerType').then(({ data: res }) => {
getListFromDict (dictType) {
this.$http.get(`/sys/dict/listSimple/` + dictType).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.bannerOptions = res.data
if (dictType === 'bannerType') {
this.bannerOptions = res.data
} else if (dictType === 'bannerPosition') {
this.positionList = res.data
}
}).catch(() => { })
},
//

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

@ -49,8 +49,11 @@
</el-form-item>
<el-form-item prop="noticeContent"
label="通知内容">
<!-- 富文本编辑器, 容器 -->
<div id="J_quillEditor"></div>
<el-row style="height: 550px;">
<!-- 富文本编辑器, 容器 -->
<div id="J_quillEditor"
style="height: 500px;"></div>
</el-row>
<!-- 自定义上传图片功能 (使用element upload组件) -->
<el-upload :action="uploadUrl"
:show-file-list="false"
@ -95,12 +98,13 @@ export default {
quillEditor: null,
quillEditorToolbarOptions: [
['bold', 'italic', 'underline', 'strike'],
['blockquote', 'code-block', 'image'],
// ['blockquote', 'code-block', 'image'],
['image'],
[{ 'header': 1 }, { 'header': 2 }],
[{ 'list': 'ordered' }, { 'list': 'bullet' }],
[{ 'script': 'sub' }, { 'script': 'super' }],
[{ 'indent': '-1' }, { 'indent': '+1' }],
[{ 'direction': 'rtl' }],
// [{ 'direction': 'rtl' }],
[{ 'size': ['small', false, 'large', 'huge'] }],
[{ 'header': [1, 2, 3, 4, 5, 6, false] }],
[{ 'color': [] }, { 'background': [] }],
@ -273,8 +277,3 @@ export default {
}
}
</script>
<style>
.richText {
height: 500px;
}
</style>

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

@ -31,25 +31,22 @@
style="width: 100%;">
<el-table-column type="selection"
header-align="center"
align="center"
width="50"></el-table-column>
align="center"></el-table-column>
<el-table-column prop="noticeTitle"
label="通知标题"
header-align="center"
align="center"></el-table-column>
align="center"
width="350"></el-table-column>
<el-table-column prop="deptName"
label="发布通知部门"
header-align="center"
align="center"></el-table-column>
<el-table-column prop="noticeReleaseState"
label="已发布"
label="通知所属部门"
header-align="center"
:formatter="showIsPublishFormatter"
align="center"></el-table-column>
align="center"
:formatter="showDeptNameFormatter"></el-table-column>
<el-table-column prop="readingAmount"
label="阅读量"
header-align="center"
align="center"></el-table-column>
align="center"
width="100"></el-table-column>
<el-table-column prop="creatorName"
label="创建人"
header-align="center"
@ -58,6 +55,16 @@
label="创建时间"
header-align="center"
align="center"></el-table-column>
<el-table-column prop="noticeReleaseState"
label="已发布"
header-align="center"
:formatter="showIsPublishFormatter"
align="center"
width="100"></el-table-column>
<el-table-column prop="releaseTime"
label="发布时间"
header-align="center"
align="center"></el-table-column>
<el-table-column :label="$t('handle')"
fixed="right"
header-align="center"
@ -120,18 +127,24 @@ export default {
methods: {
//
noticePublishHandle (id) {
this.$http.post(`/news/notice/publish/${id}`).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()
this.$confirm(this.$t('prompt.info', { 'handle': '发布' }), this.$t('发布'), {
confirmButtonText: this.$t('confirm'),
cancelButtonText: this.$t('cancel'),
type: 'warning'
}).then(() => {
this.$http.post(`/news/notice/publish/${id}`).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(() => { })
},
showIsPublishFormatter: function (row, column) {
@ -139,6 +152,17 @@ export default {
return '否'
}
return '是'
},
showDeptNameFormatter: function (row, column) {
if (row.grid) {
return row.grid
}
if (row.community) {
return row.community
}
if (row.street) {
return row.street
}
}
}
}

Loading…
Cancel
Save