From 351241938f1587fae95c09102c844e8d4ae38f2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=87=91=E9=B9=8F?= Date: Thu, 28 Nov 2019 16:37:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=9A=E7=BE=A4=E8=AE=AE=E4=BA=8B=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E5=88=97=E8=A1=A8=E7=BB=84=E7=BB=87=E6=9C=BA=E6=9E=84?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/events/issue-change-list.vue | 98 +++++-------------- src/views/modules/events/issue-close-list.vue | 98 +++++-------------- .../modules/events/issue-process-list.vue | 98 +++++-------------- .../modules/events/issue-reject-list.vue | 98 +++++-------------- .../modules/events/issue-review-list.vue | 98 +++++-------------- src/views/modules/events/item-close-list.vue | 98 +++++-------------- src/views/modules/events/item-deal-list.vue | 98 +++++-------------- src/views/modules/events/item-end-list.vue | 98 +++++-------------- src/views/modules/group/group.vue | 98 +++++-------------- src/views/modules/group/leaderboard.vue | 90 +++++------------ src/views/modules/group/topic-list.vue | 92 +++++------------ 11 files changed, 284 insertions(+), 780 deletions(-) diff --git a/src/views/modules/events/issue-change-list.vue b/src/views/modules/events/issue-change-list.vue index ef7c497d..ce408523 100644 --- a/src/views/modules/events/issue-change-list.vue +++ b/src/views/modules/events/issue-change-list.vue @@ -5,39 +5,9 @@ - - - - - - - - - - - - - - - - - + + + @@ -158,9 +128,8 @@ export default { gridId: '', state: '4' }, - streetOptions: [], - communityOptions: [], - gridOptions: [], + ids: [], + options: [], pickerBeginDateBefore: { disabledDate: (time) => { let beginDateVal = this.dataForm.startTime @@ -183,51 +152,36 @@ export default { Detail }, created: function () { - this.getStreetList() + this.getOptions() + }, + watch: { + 'ids': function (val) { + if (val.length === 1){ + this.dataForm.streetId = this.ids[0] + } + if (val.length === 2){ + this.dataForm.streetId = this.ids[0] + this.dataForm.communityId = this.ids[1] + } + if (val.length === 3){ + this.dataForm.streetId = this.ids[0] + this.dataForm.communityId = this.ids[1] + this.dataForm.gridId = this.ids[2] + } + } }, methods: { detailAction (id) { this.$parent.selectComponent = 'IssueCloseDetailView' this.$router.push({ path: '/events-issue-change', query: { id: id } }) }, - getStreetList () { - this.$http.get(`/sys/dept/sublist/` + (localStorage.getItem('street') === null ? '1169154711480528897' : localStorage.getItem('street'))).then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg) - } - this.streetOptions = res.data - }).catch(() => { }) - }, - getCommunityList () { - if (this.dataForm.streetId === '') { - this.communityOptions = [] - this.gridOptions = [] - this.dataForm.communityId = '' - this.dataForm.gridId = '' - return - } - this.dataForm.communityId = '' - this.dataForm.gridId = '' - this.$http.get(`/sys/dept/sublist/` + this.dataForm.streetId).then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg) - } - this.communityOptions = res.data - }).catch(() => { }) - }, - getGridList () { - if (this.dataForm.communityId === '') { - this.gridOptions = [] - this.dataForm.gridId = '' - return - } - this.dataForm.gridId = '' - this.$http.get(`/sys/dept/sublist/` + this.dataForm.communityId).then(({ data: res }) => { + getOptions () { + this.$http.get(`/sys/user/deptOptions/getByLoginUser`).then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) } - this.gridOptions = res.data - }).catch(() => { }) + this.options = res.data.options + }).catch(() => {}) } } } diff --git a/src/views/modules/events/issue-close-list.vue b/src/views/modules/events/issue-close-list.vue index 998e1ec3..76839320 100644 --- a/src/views/modules/events/issue-close-list.vue +++ b/src/views/modules/events/issue-close-list.vue @@ -5,39 +5,9 @@ - - - - - - - - - - - - - - - - - + + + @@ -159,9 +129,8 @@ export default { gridId: '', state: '2' }, - streetOptions: [], - communityOptions: [], - gridOptions: [], + ids: [], + options: [], pickerBeginDateBefore: { disabledDate: (time) => { let beginDateVal = this.dataForm.startTime @@ -184,51 +153,36 @@ export default { Detail }, created: function () { - this.getStreetList() + this.getOptions() + }, + watch: { + 'ids': function (val) { + if (val.length === 1){ + this.dataForm.streetId = this.ids[0] + } + if (val.length === 2){ + this.dataForm.streetId = this.ids[0] + this.dataForm.communityId = this.ids[1] + } + if (val.length === 3){ + this.dataForm.streetId = this.ids[0] + this.dataForm.communityId = this.ids[1] + this.dataForm.gridId = this.ids[2] + } + } }, methods: { detailAction (id) { this.$parent.selectComponent = 'IssueCloseDetailView' this.$router.push({ path: '/events-issue-close', query: { id: id } }) }, - getStreetList () { - this.$http.get(`/sys/dept/sublist/` + (localStorage.getItem('street') === null ? '1169154711480528897' : localStorage.getItem('street'))).then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg) - } - this.streetOptions = res.data - }).catch(() => { }) - }, - getCommunityList () { - if (this.dataForm.streetId === '') { - this.communityOptions = [] - this.gridOptions = [] - this.dataForm.communityId = '' - this.dataForm.gridId = '' - return - } - this.dataForm.communityId = '' - this.dataForm.gridId = '' - this.$http.get(`/sys/dept/sublist/` + this.dataForm.streetId).then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg) - } - this.communityOptions = res.data - }).catch(() => { }) - }, - getGridList () { - if (this.dataForm.communityId === '') { - this.gridOptions = [] - this.dataForm.gridId = '' - return - } - this.dataForm.gridId = '' - this.$http.get(`/sys/dept/sublist/` + this.dataForm.communityId).then(({ data: res }) => { + getOptions () { + this.$http.get(`/sys/user/deptOptions/getByLoginUser`).then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) } - this.gridOptions = res.data - }).catch(() => { }) + this.options = res.data.options + }).catch(() => {}) } } } diff --git a/src/views/modules/events/issue-process-list.vue b/src/views/modules/events/issue-process-list.vue index 283c3eb4..4057b941 100644 --- a/src/views/modules/events/issue-process-list.vue +++ b/src/views/modules/events/issue-process-list.vue @@ -5,39 +5,9 @@ - - - - - - - - - - - - - - - - - + + + @@ -168,9 +138,8 @@ export default { gridId: '', state: '0' }, - streetOptions: [], - communityOptions: [], - gridOptions: [], + ids: [], + options: [], pickerBeginDateBefore: { disabledDate: (time) => { let beginDateVal = this.dataForm.startTime @@ -194,7 +163,23 @@ export default { Detail }, created: function () { - this.getStreetList() + this.getOptions() + }, + watch: { + 'ids': function (val) { + if (val.length === 1){ + this.dataForm.streetId = this.ids[0] + } + if (val.length === 2){ + this.dataForm.streetId = this.ids[0] + this.dataForm.communityId = this.ids[1] + } + if (val.length === 3){ + this.dataForm.streetId = this.ids[0] + this.dataForm.communityId = this.ids[1] + this.dataForm.gridId = this.ids[2] + } + } }, methods: { detailAction (id) { @@ -205,44 +190,13 @@ export default { this.$parent.selectComponent = 'IssueProcessDetailView' this.$router.push({ path: '/events-issue-process', query: { id: id } }) }, - getStreetList () { - this.$http.get(`/sys/dept/sublist/` + (localStorage.getItem('street') === null ? '1169154711480528897' : localStorage.getItem('street'))).then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg) - } - this.streetOptions = res.data - }).catch(() => { }) - }, - getCommunityList () { - if (this.dataForm.streetId === '') { - this.communityOptions = [] - this.gridOptions = [] - this.dataForm.communityId = '' - this.dataForm.gridId = '' - return - } - this.dataForm.communityId = '' - this.dataForm.gridId = '' - this.$http.get(`/sys/dept/sublist/` + this.dataForm.streetId).then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg) - } - this.communityOptions = res.data - }).catch(() => { }) - }, - getGridList () { - if (this.dataForm.communityId === '') { - this.gridOptions = [] - this.dataForm.gridId = '' - return - } - this.dataForm.gridId = '' - this.$http.get(`/sys/dept/sublist/` + this.dataForm.communityId).then(({ data: res }) => { + getOptions () { + this.$http.get(`/sys/user/deptOptions/getByLoginUser`).then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) } - this.gridOptions = res.data - }).catch(() => { }) + this.options = res.data.options + }).catch(() => {}) } } } diff --git a/src/views/modules/events/issue-reject-list.vue b/src/views/modules/events/issue-reject-list.vue index 223beda8..dcac14c8 100644 --- a/src/views/modules/events/issue-reject-list.vue +++ b/src/views/modules/events/issue-reject-list.vue @@ -5,39 +5,9 @@ - - - - - - - - - - - - - - - - - + + + @@ -138,9 +108,8 @@ export default { communityId: '', gridId: '' }, - streetOptions: [], - communityOptions: [], - gridOptions: [], + ids: [], + options: [], pickerBeginDateBefore: { disabledDate: (time) => { let beginDateVal = this.dataForm.startTime @@ -163,51 +132,36 @@ export default { RejectDetail }, created: function () { - this.getStreetList() + this.getOptions() + }, + watch: { + 'ids': function (val) { + if (val.length === 1){ + this.dataForm.streetId = this.ids[0] + } + if (val.length === 2){ + this.dataForm.streetId = this.ids[0] + this.dataForm.communityId = this.ids[1] + } + if (val.length === 3){ + this.dataForm.streetId = this.ids[0] + this.dataForm.communityId = this.ids[1] + this.dataForm.gridId = this.ids[2] + } + } }, methods: { detailAction (id) { this.$parent.selectComponent = 'IssueRejectDetailView' this.$router.push({ path: '/events-issue-reject', query: { id: id } }) }, - getStreetList () { - this.$http.get(`/sys/dept/sublist/` + (localStorage.getItem('street') === null ? '1169154711480528897' : localStorage.getItem('street'))).then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg) - } - this.streetOptions = res.data - }).catch(() => { }) - }, - getCommunityList () { - if (this.dataForm.streetId === '') { - this.communityOptions = [] - this.gridOptions = [] - this.dataForm.communityId = '' - this.dataForm.gridId = '' - return - } - this.dataForm.communityId = '' - this.dataForm.gridId = '' - this.$http.get(`/sys/dept/sublist/` + this.dataForm.streetId).then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg) - } - this.communityOptions = res.data - }).catch(() => { }) - }, - getGridList () { - if (this.dataForm.communityId === '') { - this.gridOptions = [] - this.dataForm.gridId = '' - return - } - this.dataForm.gridId = '' - this.$http.get(`/sys/dept/sublist/` + this.dataForm.communityId).then(({ data: res }) => { + getOptions () { + this.$http.get(`/sys/user/deptOptions/getByLoginUser`).then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) } - this.gridOptions = res.data - }).catch(() => { }) + this.options = res.data.options + }).catch(() => {}) } } } diff --git a/src/views/modules/events/issue-review-list.vue b/src/views/modules/events/issue-review-list.vue index 5fa7df85..757d0c7b 100644 --- a/src/views/modules/events/issue-review-list.vue +++ b/src/views/modules/events/issue-review-list.vue @@ -5,39 +5,9 @@ - - - - - - - - - - - - - - - - - + + + @@ -138,9 +108,8 @@ export default { communityId: '', gridId: '' }, - streetOptions: [], - communityOptions: [], - gridOptions: [], + ids: [], + options: [], pickerBeginDateBefore: { disabledDate: (time) => { let beginDateVal = this.dataForm.startTime @@ -163,51 +132,36 @@ export default { ReviewDetail }, created: function () { - this.getStreetList() + this.getOptions() + }, + watch: { + 'ids': function (val) { + if (val.length === 1){ + this.dataForm.streetId = this.ids[0] + } + if (val.length === 2){ + this.dataForm.streetId = this.ids[0] + this.dataForm.communityId = this.ids[1] + } + if (val.length === 3){ + this.dataForm.streetId = this.ids[0] + this.dataForm.communityId = this.ids[1] + this.dataForm.gridId = this.ids[2] + } + } }, methods: { detailAction (id) { this.$parent.selectComponent = 'IssueReviewDetailView' this.$router.push({ path: '/events-issue-review', query: { id: id } }) }, - getStreetList () { - this.$http.get(`/sys/dept/sublist/` + (localStorage.getItem('street') === null ? '1169154711480528897' : localStorage.getItem('street'))).then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg) - } - this.streetOptions = res.data - }).catch(() => { }) - }, - getCommunityList () { - if (this.dataForm.streetId === '') { - this.communityOptions = [] - this.gridOptions = [] - this.dataForm.communityId = '' - this.dataForm.gridId = '' - return - } - this.dataForm.communityId = '' - this.dataForm.gridId = '' - this.$http.get(`/sys/dept/sublist/` + this.dataForm.streetId).then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg) - } - this.communityOptions = res.data - }).catch(() => { }) - }, - getGridList () { - if (this.dataForm.communityId === '') { - this.gridOptions = [] - this.dataForm.gridId = '' - return - } - this.dataForm.gridId = '' - this.$http.get(`/sys/dept/sublist/` + this.dataForm.communityId).then(({ data: res }) => { + getOptions () { + this.$http.get(`/sys/user/deptOptions/getByLoginUser`).then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) } - this.gridOptions = res.data - }).catch(() => { }) + this.options = res.data.options + }).catch(() => {}) } } } diff --git a/src/views/modules/events/item-close-list.vue b/src/views/modules/events/item-close-list.vue index 80e4f715..45f29869 100644 --- a/src/views/modules/events/item-close-list.vue +++ b/src/views/modules/events/item-close-list.vue @@ -5,39 +5,9 @@ - - - - - - - - - - - - - - - - - + + + @@ -158,10 +128,9 @@ export default { communityId: '', gridId: '' }, + ids: [], + options: [], detailVisible: false, - streetOptions: [], - communityOptions: [], - gridOptions: [], pickerBeginDateBefore: { disabledDate: (time) => { let beginDateVal = this.dataForm.startTime @@ -184,51 +153,36 @@ export default { Detail }, created: function () { - this.getStreetList() + this.getOptions() + }, + watch: { + 'ids': function (val) { + if (val.length === 1){ + this.dataForm.streetId = this.ids[0] + } + if (val.length === 2){ + this.dataForm.streetId = this.ids[0] + this.dataForm.communityId = this.ids[1] + } + if (val.length === 3){ + this.dataForm.streetId = this.ids[0] + this.dataForm.communityId = this.ids[1] + this.dataForm.gridId = this.ids[2] + } + } }, methods: { detailAction (id) { this.$parent.selectComponent = 'ItemCloseDetailView' this.$router.push({ path: '/events-item-close', query: { id: id } }) }, - getStreetList () { - this.$http.get(`/sys/dept/sublist/` + (localStorage.getItem('street') === null ? '1169154711480528897' : localStorage.getItem('street'))).then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg) - } - this.streetOptions = res.data - }).catch(() => { }) - }, - getCommunityList () { - if (this.dataForm.streetId === '') { - this.communityOptions = [] - this.gridOptions = [] - this.dataForm.communityId = '' - this.dataForm.gridId = '' - return - } - this.dataForm.communityId = '' - this.dataForm.gridId = '' - this.$http.get(`/sys/dept/sublist/` + this.dataForm.streetId).then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg) - } - this.communityOptions = res.data - }).catch(() => { }) - }, - getGridList () { - if (this.dataForm.communityId === '') { - this.gridOptions = [] - this.dataForm.gridId = '' - return - } - this.dataForm.gridId = '' - this.$http.get(`/sys/dept/sublist/` + this.dataForm.communityId).then(({ data: res }) => { + getOptions () { + this.$http.get(`/sys/user/deptOptions/getByLoginUser`).then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) } - this.gridOptions = res.data - }).catch(() => { }) + this.options = res.data.options + }).catch(() => {}) } } } diff --git a/src/views/modules/events/item-deal-list.vue b/src/views/modules/events/item-deal-list.vue index febf6228..915a3334 100644 --- a/src/views/modules/events/item-deal-list.vue +++ b/src/views/modules/events/item-deal-list.vue @@ -5,39 +5,9 @@ - - - - - - - - - - - - - - - - - + + + @@ -160,9 +130,8 @@ export default { communityId: '', gridId: '' }, - streetOptions: [], - communityOptions: [], - gridOptions: [], + ids: [], + options: [], pickerBeginDateBefore: { disabledDate: (time) => { let beginDateVal = this.dataForm.startTime @@ -185,51 +154,36 @@ export default { Detail }, created: function () { - this.getStreetList() + this.getOptions() + }, + watch: { + 'ids': function (val) { + if (val.length === 1){ + this.dataForm.streetId = this.ids[0] + } + if (val.length === 2){ + this.dataForm.streetId = this.ids[0] + this.dataForm.communityId = this.ids[1] + } + if (val.length === 3){ + this.dataForm.streetId = this.ids[0] + this.dataForm.communityId = this.ids[1] + this.dataForm.gridId = this.ids[2] + } + } }, methods: { dealAction (id) { this.$parent.selectComponent = 'ItemDealDetailView' this.$router.push({ path: '/events-item-deal', query: { id: id } }) }, - getStreetList () { - this.$http.get(`/sys/dept/sublist/` + (localStorage.getItem('street') === null ? '1169154711480528897' : localStorage.getItem('street'))).then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg) - } - this.streetOptions = res.data - }).catch(() => { }) - }, - getCommunityList () { - if (this.dataForm.streetId === '') { - this.communityOptions = [] - this.gridOptions = [] - this.dataForm.communityId = '' - this.dataForm.gridId = '' - return - } - this.dataForm.communityId = '' - this.dataForm.gridId = '' - this.$http.get(`/sys/dept/sublist/` + this.dataForm.streetId).then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg) - } - this.communityOptions = res.data - }).catch(() => { }) - }, - getGridList () { - if (this.dataForm.communityId === '') { - this.gridOptions = [] - this.dataForm.gridId = '' - return - } - this.dataForm.gridId = '' - this.$http.get(`/sys/dept/sublist/` + this.dataForm.communityId).then(({ data: res }) => { + getOptions () { + this.$http.get(`/sys/user/deptOptions/getByLoginUser`).then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) } - this.gridOptions = res.data - }).catch(() => { }) + this.options = res.data.options + }).catch(() => {}) } } } diff --git a/src/views/modules/events/item-end-list.vue b/src/views/modules/events/item-end-list.vue index e7803fbf..27f6f618 100644 --- a/src/views/modules/events/item-end-list.vue +++ b/src/views/modules/events/item-end-list.vue @@ -5,39 +5,9 @@ - - - - - - - - - - - - - - - - - + + + @@ -160,9 +130,8 @@ export default { gridId: '' }, detailVisible: false, - streetOptions: [], - communityOptions: [], - gridOptions: [], + ids: [], + options: [], pickerBeginDateBefore: { disabledDate: (time) => { let beginDateVal = this.dataForm.startTime @@ -185,51 +154,36 @@ export default { Detail }, created: function () { - this.getStreetList() + this.getOptions() + }, + watch: { + 'ids': function (val) { + if (val.length === 1){ + this.dataForm.streetId = this.ids[0] + } + if (val.length === 2){ + this.dataForm.streetId = this.ids[0] + this.dataForm.communityId = this.ids[1] + } + if (val.length === 3){ + this.dataForm.streetId = this.ids[0] + this.dataForm.communityId = this.ids[1] + this.dataForm.gridId = this.ids[2] + } + } }, methods: { detailAction1 (id) { this.$parent.selectComponent = 'ItemCloseDetailView' this.$router.push({ path: '/events-item-end', query: { id: id } }) }, - getStreetList () { - this.$http.get(`/sys/dept/sublist/` + (localStorage.getItem('street') === null ? '1169154711480528897' : localStorage.getItem('street'))).then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg) - } - this.streetOptions = res.data - }).catch(() => { }) - }, - getCommunityList () { - if (this.dataForm.streetId === '') { - this.communityOptions = [] - this.gridOptions = [] - this.dataForm.communityId = '' - this.dataForm.gridId = '' - return - } - this.dataForm.communityId = '' - this.dataForm.gridId = '' - this.$http.get(`/sys/dept/sublist/` + this.dataForm.streetId).then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg) - } - this.communityOptions = res.data - }).catch(() => { }) - }, - getGridList () { - if (this.dataForm.communityId === '') { - this.gridOptions = [] - this.dataForm.gridId = '' - return - } - this.dataForm.gridId = '' - this.$http.get(`/sys/dept/sublist/` + this.dataForm.communityId).then(({ data: res }) => { + getOptions () { + this.$http.get(`/sys/user/deptOptions/getByLoginUser`).then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) } - this.gridOptions = res.data - }).catch(() => { }) + this.options = res.data.options + }).catch(() => {}) } } } diff --git a/src/views/modules/group/group.vue b/src/views/modules/group/group.vue index 300b7fa5..389dd5f8 100644 --- a/src/views/modules/group/group.vue +++ b/src/views/modules/group/group.vue @@ -2,39 +2,9 @@
- - - - - - - - - - - - - - - - - + + + { + getOptions () { + this.$http.get(`/sys/user/deptOptions/getByLoginUser`).then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) } - this.streetOptions = res.data - }).catch(() => { }) - }, - getCommunityList () { - if (this.dataForm.streetId === '') { - this.communityOptions = [] - this.gridOptions = [] - this.dataForm.communityId = '' - this.dataForm.gridId = '' - return - } - this.dataForm.communityId = '' - this.dataForm.gridId = '' - this.$http.get(`/sys/dept/sublist/` + this.dataForm.streetId).then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg) - } - this.communityOptions = res.data - }).catch(() => { }) - }, - getGridList () { - if (this.dataForm.communityId === '') { - this.gridOptions = [] - this.dataForm.gridId = '' - return - } - this.dataForm.gridId = '' - this.$http.get(`/sys/dept/sublist/` + this.dataForm.communityId).then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg) - } - this.gridOptions = res.data - }).catch(() => { }) + this.options = res.data.options + }).catch(() => {}) } } } diff --git a/src/views/modules/group/leaderboard.vue b/src/views/modules/group/leaderboard.vue index 2123c99d..a285f29b 100644 --- a/src/views/modules/group/leaderboard.vue +++ b/src/views/modules/group/leaderboard.vue @@ -2,33 +2,9 @@
- - - - - - - - - - - - - - - - - + + + @@ -128,9 +104,8 @@ export default { } }, orderType: '0', - streetOptions: [], - communityOptions: [], - gridOptions: [], + ids: [], + options: [], orderTypeOptions: [{ id: '0', name: '按活跃度排名' @@ -148,53 +123,36 @@ export default { this.mixinViewModuleOptions.getDataListURL = '/group/group/member' } this.getDataList() + }, + 'ids': function (val) { + if (val.length === 1){ + this.dataForm.streetId = this.ids[0] + } + if (val.length === 2){ + this.dataForm.streetId = this.ids[0] + this.dataForm.communityId = this.ids[1] + } + if (val.length === 3){ + this.dataForm.streetId = this.ids[0] + this.dataForm.communityId = this.ids[1] + this.dataForm.gridId = this.ids[2] + } } }, components: { Close }, created: function () { - this.getStreetList() + this.getOptions() }, methods: { - getStreetList () { - this.$http.get(`/sys/dept/sublist/` + (localStorage.getItem('street') === null ? '1169154711480528897' : localStorage.getItem('street'))).then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg) - } - this.streetOptions = res.data - }).catch(() => { }) - }, - getCommunityList () { - if (this.dataForm.streetId === '') { - this.communityOptions = [] - this.gridOptions = [] - this.dataForm.communityId = '' - this.dataForm.gridId = '' - return - } - this.dataForm.communityId = '' - this.dataForm.gridId = '' - this.$http.get(`/sys/dept/sublist/` + this.dataForm.streetId).then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg) - } - this.communityOptions = res.data - }).catch(() => { }) - }, - getGridList () { - if (this.dataForm.communityId === '') { - this.gridOptions = [] - this.dataForm.gridId = '' - return - } - this.dataForm.gridId = '' - this.$http.get(`/sys/dept/sublist/` + this.dataForm.communityId).then(({ data: res }) => { + getOptions () { + this.$http.get(`/sys/user/deptOptions/getByLoginUser`).then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) } - this.gridOptions = res.data - }).catch(() => { }) + this.options = res.data.options + }).catch(() => {}) } } } diff --git a/src/views/modules/group/topic-list.vue b/src/views/modules/group/topic-list.vue index f733f6ad..9dc25349 100644 --- a/src/views/modules/group/topic-list.vue +++ b/src/views/modules/group/topic-list.vue @@ -2,33 +2,9 @@
- - - - - - - - - - - - - - - - - + + + @@ -149,9 +125,8 @@ export default { } } }, - streetOptions: [], - communityOptions: [], - gridOptions: [], + ids: [], + options: [], groupOptions: [], orderTypeOptions: [{ id: '0', @@ -169,9 +144,25 @@ export default { Close }, created: function () { - this.getStreetList() + this.getOptions() this.getGroupList() }, + watch: { + 'ids': function (val) { + if (val.length === 1){ + this.dataForm.streetId = this.ids[0] + } + if (val.length === 2){ + this.dataForm.streetId = this.ids[0] + this.dataForm.communityId = this.ids[1] + } + if (val.length === 3){ + this.dataForm.streetId = this.ids[0] + this.dataForm.communityId = this.ids[1] + this.dataForm.gridId = this.ids[2] + } + } + }, methods: { close (id) { this.closeVisible = true @@ -192,44 +183,13 @@ export default { this.groupOptions = res.data }).catch(() => { }) }, - getStreetList () { - this.$http.get(`/sys/dept/sublist/` + (localStorage.getItem('street') === null ? '1169154711480528897' : localStorage.getItem('street'))).then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg) - } - this.streetOptions = res.data - }).catch(() => { }) - }, - getCommunityList () { - if (this.dataForm.streetId === '') { - this.communityOptions = [] - this.gridOptions = [] - this.dataForm.communityId = '' - this.dataForm.gridId = '' - return - } - this.dataForm.communityId = '' - this.dataForm.gridId = '' - this.$http.get(`/sys/dept/sublist/` + this.dataForm.streetId).then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg) - } - this.communityOptions = res.data - }).catch(() => { }) - }, - getGridList () { - if (this.dataForm.communityId === '') { - this.gridOptions = [] - this.dataForm.gridId = '' - return - } - this.dataForm.gridId = '' - this.$http.get(`/sys/dept/sublist/` + this.dataForm.communityId).then(({ data: res }) => { + getOptions () { + this.$http.get(`/sys/user/deptOptions/getByLoginUser`).then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) } - this.gridOptions = res.data - }).catch(() => { }) + this.options = res.data.options + }).catch(() => {}) } } }