import { getEventDynamicTop10, getGroupDynamicTop10 ,getGroupEffectTop10} from '../../../../../../api/partyInteract' Component({ data: { orderType: 'asc', conditionList: [], choosedCondition: {}, conditionVisible: false, pageId: '', selectTab: '', getEventDynamicTop10: [],//党员参与议事排行Top10 getGroupEffectTop10: [],//党群成效排名Top10 getGroupDynamicTop10: [],//社群引领排行Top10 }, properties: { }, methods: { getList: function (opinion) { let that = this; that.setData({ pageId: opinion.pageId selectTab: opinion.selectTab }) if (opinion.pageId == 'issueJoin'){//党员议事参与 that.setData({ conditionList: [ { title: '参与议事人数', id: '1', select: true }, { title: '参与议事人次', id: '2', select: false }, { title: '发起议题总数', id: '3', select: false }, { title: '转项目数', id: '4', select: false }, { title: '解决项目数', id: '5', select: false }, { title: '好评项目数', id: '6', select: false } ], choosedCondition: { title: '参与议事人数', id: '1' }, }) let params = { orderType: '1', orderStyle: '1',//排序类型(1.参与议事人数,2.参与议事人次,3.发起议题总数,4.转项目数,5.解决项目数,6.好评项目数) deptId: '',//wx.getStorageSync('childrenID') someMonthsType: opinion.conditionList[0].id,//数据时间类型(1:最近1个月,2:最近3个月,3:最近半年,4:最近一年) } getEventDynamicTop10(params).then((res: any) => {//党员参与议事排行Top10 that.setData({ getEventDynamicTop10: res.data.dataList }) console.log('党员议事参与::::::::::' + JSON.stringify(res.data)) }) }else{//党员群团情况 if (opinion.selectTab == 'tab1'){//社群引领排行 that.setData({ conditionList: [ { title: '党员参与人数', id: '1', select: true }, { title: '党员参与人次', id: '2', select: false }, { title: '党员建群数', id: '3', select: false }, { title: '群成员数', id: '4', select: false }, { title: '发布话题数', id: '5', select: false }, { title: '转议题数', id: '6', select: false }, { title: '转话题数', id: '7', select: false }, { title: '引导解决数', id: '8', select: false }, ], choosedCondition: { title: '党员参与人数', id: '1' }, }); let params = { orderType: '1', orderStyle: '1', deptId: '',//wx.getStorageSync('childrenID') someMonthsType: opinion.conditionList[0].id,//数据时间类型(1:最近1个月,2:最近3个月,3:最近半年,4:最近一年) } getGroupDynamicTop10(params).then((res: any) => {//社群引领排行Top10 that.setData({ getGroupDynamicTop10: res.data.dataList }) console.log('社群引领排行::::::::::' + JSON.stringify(res.data)) }) } else if (opinion.selectTab == 'tab3'){//党群成效排行 that.setData({ conditionList: [ { title: '引导解决项目数', id: '1', select: true }, { title: '项目好评数', id: '2', select: false } ], choosedCondition: { title: '引导解决项目数', id: '1' }, }); let params = { orderType: '1', orderStyle: '1', deptId: '',//wx.getStorageSync('childrenID') someMonthsType: opinion.conditionList[0].id,//数据时间类型(1:最近1个月,2:最近3个月,3:最近半年,4:最近一年) } getGroupEffectTop10(params).then((res: any) => {//党群成效排名Top10 that.setData({ getGroupEffectTop10: res.data.list }) console.log('党群成效排行::::::::::' + JSON.stringify(res.data)) }) } } }, // 显示条件下拉框 showCondition() { this.setData({ conditionVisible: !this.data.conditionVisible }) }, // 改变查询项 onChnageCondition(e: AnyObject) { const list = this.data.conditionList list.forEach(item => { if (item.id === e.currentTarget.dataset.id) { item.select = true this.setData({ 'choosedCondition.title': item.title, 'choosedCondition.id': item.id }) } else { item.select = false } }) this.setData({ conditionList: list }) }, // 正序倒序切换 changeOrder() { let type = 'asc' if (this.data.orderType === 'asc') { type = 'desc' } else if (this.data.orderType === 'desc') { type = 'asc' } this.setData({ orderType: type, }) }, } })