From 397258c9aa6e0ebb46dd422208ea6e71567ad191 Mon Sep 17 00:00:00 2001 From: songyunpeng Date: Thu, 19 Mar 2020 09:34:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=9D=E9=A2=98=E9=80=9A=E7=9F=A5=20?= =?UTF-8?q?=E5=92=8C=20=20=E8=AF=9D=E9=A2=98=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../master/masternotice-add-or-update.vue | 97 ++++--- src/views/modules/master/masternotice.vue | 229 +++++++++++++++-- .../modules/master/masternoticedetail.vue | 117 +++++++++ .../modules/master/masternoticeroute.vue | 30 +++ src/views/modules/master/mastertopic.vue | 240 ++++++++++++++++-- .../modules/master/mastertopiccomment.vue | 101 ++++++-- .../modules/master/mastertopicdetail.vue | 106 ++++++++ src/views/modules/master/mastertopicroute.vue | 32 +++ 8 files changed, 843 insertions(+), 109 deletions(-) create mode 100755 src/views/modules/master/masternoticedetail.vue create mode 100644 src/views/modules/master/masternoticeroute.vue create mode 100755 src/views/modules/master/mastertopicdetail.vue create mode 100644 src/views/modules/master/mastertopicroute.vue diff --git a/src/views/modules/master/masternotice-add-or-update.vue b/src/views/modules/master/masternotice-add-or-update.vue index fa4b811b..4994ec80 100755 --- a/src/views/modules/master/masternotice-add-or-update.vue +++ b/src/views/modules/master/masternotice-add-or-update.vue @@ -1,46 +1,39 @@ diff --git a/src/views/modules/master/masternotice.vue b/src/views/modules/master/masternotice.vue index 6007cd6e..b14f61c3 100755 --- a/src/views/modules/master/masternotice.vue +++ b/src/views/modules/master/masternotice.vue @@ -2,37 +2,68 @@
- - + + - - {{ $t('query') }} - - - {{ $t('add') }} - - - {{ $t('deleteBatch') }} + + + + + +
+ + + + + + + + + + {{ $t('query') }} + + + {{ $t('add') }} + +
- - - + + + - - - - - - - - + + + + + + + 置顶 + 取消置顶 + 关闭 + 查看 + + 置顶后,话题会被群成员优先看到,查看内容 + + 取 消 + 确 定 + + + + 取消置顶后,话题会被按照发布时间排序,需要滑动查找内容 + + 取 消 + 确 定 + + + + 关闭后,在移动端不显示话题内容,管理后台将保留数据,可以查看 + + 取 消 + 确 定 + +
@@ -58,18 +119,132 @@ export default { data () { return { mixinViewModuleOptions: { - getDataListURL: '//masternotice/page', + getDataListURL: '/cloudAnalysis/masternotice/page', getDataListIsPage: true, - deleteURL: '//masternotice', + deleteURL: '/cloudAnalysis/masternotice', deleteIsBatch: true }, dataForm: { id: '' - } + }, + optionForm: { + id: '', + state: '' + }, + toTopDialog: false, + cancelToTopDialog: false, + closeDialog: false, + isTop: true, + toGrey: false, + pickerBeginDateBefore: { + disabledDate: time => { + let beginDateVal = this.dataForm.startTime + if (beginDateVal) { + return time.getTime() > new Date(beginDateVal).getTime() + } + } + }, + pickerBeginDateAfter: { + disabledDate: time => { + let EndDateVal = this.dataForm.endTime + if (EndDateVal) { + return time.getTime() < new Date(EndDateVal).getTime() + } + } + }, + stateArr: [ + { + label: '全部', + value: '-1' + }, + { + label: '进行中', + value: '1' + }, + { + label: '关闭', + value: '0' + } + ] } }, components: { AddOrUpdate + }, + mounted () { + this.getDataList() + }, + methods: { + stateFormat: function (row, column) { + let state = row.state + if (state === '0') { + return '已关闭' + } else if (state === '1' || state === '2') { + return '进行中' + } + }, + readCountFormat: function (row, column) { + let readCount = row.readCount + if (readCount === '') { + return '0' + } else { + return row.readCount + } + }, + unReadCountFormat: function (row, column) { + let unreadCount = row.unReadCount + if (unreadCount === '') { + return '0' + } else { + return row.unReadCount + } + }, + manageFlagFormat: function (row, column) { + let manageFlag = row.manageFlag + if (manageFlag === '0') { + return '群成员' + } else if (manageFlag === '1') { + return '管理员' + } + }, + openToTopDialog (value, row) { + this.toTopDialog = true + this.optionForm.id = row.id + this.optionForm.state = 2 + }, + openCancelToTopDialog (value, row) { + this.cancelToTopDialog = true + this.optionForm.id = row.id + this.optionForm.state = 1 + }, + toTopOrCancelToTop () { + this.toGrey = true + this.$http.put(`/cloudAnalysis/masternotice`, this.optionForm).then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } + this.$message({ + type: 'success', + message: '修改成功!', + onClose: () => { + this.toTopDialog = false + this.cancelToTopDialog = false + this.closeDialog = false + this.toGrey = false + this.getDataList() + } + }) + }) + }, + openCloseTopicDialog (value, row) { + this.closeDialog = true + this.optionForm.id = row.id + this.optionForm.state = 0 + }, + manageHandle (noticeId) { + this.$parent.selectComponent = 'Masternoticedetail' + this.$router.push({ path: '/master-masternoticeroute', query: { noticeId: noticeId } }) + } } } diff --git a/src/views/modules/master/masternoticedetail.vue b/src/views/modules/master/masternoticedetail.vue new file mode 100755 index 00000000..8a6b58aa --- /dev/null +++ b/src/views/modules/master/masternoticedetail.vue @@ -0,0 +1,117 @@ + + + diff --git a/src/views/modules/master/masternoticeroute.vue b/src/views/modules/master/masternoticeroute.vue new file mode 100644 index 00000000..ff4fbf12 --- /dev/null +++ b/src/views/modules/master/masternoticeroute.vue @@ -0,0 +1,30 @@ + + + + diff --git a/src/views/modules/master/mastertopic.vue b/src/views/modules/master/mastertopic.vue index 05d6836f..ee57d5ef 100755 --- a/src/views/modules/master/mastertopic.vue +++ b/src/views/modules/master/mastertopic.vue @@ -2,12 +2,62 @@
- - + + - - {{ $t('query') }} + + + + + + + + + + + + + + + +
+ + + + + + + + + {{ $t('query') }} + + + {{ $t('export') }} + +
+ {{ $t('add') }} @@ -16,25 +66,26 @@
- - - - - - + + + + + - - - - - - - - + + + + + + @@ -49,6 +100,36 @@ + + 置顶后,话题会被群成员优先看到,查看内容 + + 取 消 + 确 定 + + + + 取消置顶后,话题会被按照发布时间排序,需要滑动查找内容 + + 取 消 + 确 定 + + + + 关闭后,在移动端不显示话题内容,管理后台将保留数据,可以查看 + + 取 消 + 确 定 + +
@@ -61,18 +142,131 @@ export default { data () { return { mixinViewModuleOptions: { - getDataListURL: '//mastertopic/page', + getDataListURL: '/cloudAnalysis/mastertopic/page', getDataListIsPage: true, - deleteURL: '//mastertopic', - deleteIsBatch: true + deleteURL: '/cloudAnalysis/mastertopic', + deleteIsBatch: true, + exportURL: '/cloudAnalysis/mastertopic/export' }, dataForm: { id: '' + }, + optionForm: { + id: '', + state: '' + }, + toTopDialog: false, + cancelToTopDialog: false, + closeDialog: false, + isTop: true, + toGrey: false, + orderByArr: [ + { + label: '总参与度', + value: '0' + }, + { + label: '浏览最多', + value: '1' + }, + { + label: '评论最多', + value: '2' + }, + { + label: '点赞最多', + value: '3' + }, + { + label: '点踩最多', + value: '4' + } + ], + stateArr: [ + { + label: '全部', + value: '-1' + }, + { + label: '进行中', + value: '1' + }, + { + label: '关闭', + value: '0' + } + ], + pickerBeginDateBefore: { + disabledDate: time => { + let beginDateVal = this.dataForm.startTime + if (beginDateVal) { + return time.getTime() > new Date(beginDateVal).getTime() + } + } + }, + pickerBeginDateAfter: { + disabledDate: time => { + let EndDateVal = this.dataForm.endTime + if (EndDateVal) { + return time.getTime() < new Date(EndDateVal).getTime() + } + } } } }, components: { AddOrUpdate + }, + mounted () { + this.getDataList() + }, + methods: { + stateFormat: function (row, column) { + let state = row.state + if (state === '0') { + return '已关闭' + } else if (state === '1' || state === '2') { + return '进行中' + } + }, + manageHandle (topicId) { + this.$parent.selectComponent = 'Mastertopicdetail' + this.$router.push({ path: '/master-mastertopicroute', query: { topicId: topicId } }) + }, + openToTopDialog (value, row) { + this.toTopDialog = true + this.optionForm.id = row.id + this.optionForm.state = 2 + }, + openCancelToTopDialog (value, row) { + this.cancelToTopDialog = true + this.optionForm.id = row.id + this.optionForm.state = 1 + }, + toTopOrCancelToTop () { + this.toGrey = true + this.$http.put(`/cloudAnalysis/mastertopic`, this.optionForm).then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } + this.$message({ + type: 'success', + message: '修改成功!', + onClose: () => { + this.toTopDialog = false + this.cancelToTopDialog = false + this.closeDialog = false + this.toGrey = false + this.getDataList() + } + }) + }) + }, + openCloseTopicDialog (value, row) { + this.closeDialog = true + this.optionForm.id = row.id + this.optionForm.state = 0 + } } } diff --git a/src/views/modules/master/mastertopiccomment.vue b/src/views/modules/master/mastertopiccomment.vue index 9f8a7319..30826c12 100755 --- a/src/views/modules/master/mastertopiccomment.vue +++ b/src/views/modules/master/mastertopiccomment.vue @@ -2,8 +2,35 @@
- - +
+ + 返回 + +
+ + + + + + + + + + {{ $t('query') }} @@ -16,33 +43,17 @@
- - - - - - - - - - - - - - - - - - - - - - + + + + + + + { + let beginDateVal = this.dataForm.startTime + if (beginDateVal) { + return time.getTime() > new Date(beginDateVal).getTime() + } + } + }, + pickerBeginDateAfter: { + disabledDate: time => { + let EndDateVal = this.dataForm.endTime + if (EndDateVal) { + return time.getTime() < new Date(EndDateVal).getTime() + } + } } } }, + mounted () { + this.dataForm.id = this.$route.query.topicId + this.getDataList() + }, components: { AddOrUpdate + }, + methods: { + commentTypeFormat (row) { + let state = row.commentType + if (state === '0') { + return '评论' + } else if (state === '1' || state === '2') { + return '回复' + } + }, + backToDeptList (topicId) { + this.$parent.selectComponent = 'Mastertopicdetail' + this.$router.push({ path: '/master-mastertopicroute', query: { topicId: topicId } }) + } } } diff --git a/src/views/modules/master/mastertopicdetail.vue b/src/views/modules/master/mastertopicdetail.vue new file mode 100755 index 00000000..459e5553 --- /dev/null +++ b/src/views/modules/master/mastertopicdetail.vue @@ -0,0 +1,106 @@ + + + diff --git a/src/views/modules/master/mastertopicroute.vue b/src/views/modules/master/mastertopicroute.vue new file mode 100644 index 00000000..b27879a7 --- /dev/null +++ b/src/views/modules/master/mastertopicroute.vue @@ -0,0 +1,32 @@ + + + +