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

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

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

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

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