From fd5d6333d6d22519968be1c17fc5407bac993ab8 Mon Sep 17 00:00:00 2001 From: jiangyy Date: Wed, 26 Jan 2022 12:23:17 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B1=BB=E5=88=AB=E5=88=86=E6=9E=90=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E3=80=81=E5=B1=85=E6=B0=91=E7=83=AD=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scss/modules/visual/personCategory.scss | 26 ------- .../visual/basicinfo/personCategory/index.vue | 28 ++------ .../basicinfo/personCategory/recordList.vue | 69 ++++++++++++++----- .../visual/communityGovern/resiPieOption.js | 23 ++++++- .../visual/communityGovern/resibuzz.vue | 19 +++-- .../visual/communityGovern/typeAnalyze.vue | 1 + 6 files changed, 88 insertions(+), 78 deletions(-) diff --git a/src/assets/scss/modules/visual/personCategory.scss b/src/assets/scss/modules/visual/personCategory.scss index 7af912e5..3a9d5913 100644 --- a/src/assets/scss/modules/visual/personCategory.scss +++ b/src/assets/scss/modules/visual/personCategory.scss @@ -138,31 +138,5 @@ height: calc(100% - 300px); min-height: 300px; margin-top: 60px; - - .pagination { - box-sizing: border-box; - margin-top: 20px; - width: 100%; - height: 40px; - display: flex; - justify-content: flex-end; - - /deep/ .el-pagination.is-background .el-pager li:not(.disabled).active { - background: #0266d1; - color: #000d3f; - } - - /deep/ .el-pagination .el-pager li { - background: #002e74; - } - - /deep/ .el-pagination .btn-prev { - background: #002e74; - } - - /deep/ .el-pagination .btn-next { - background: #002e74; - } - } } } diff --git a/src/views/modules/visual/basicinfo/personCategory/index.vue b/src/views/modules/visual/basicinfo/personCategory/index.vue index 6ae43934..09a5e1bc 100644 --- a/src/views/modules/visual/basicinfo/personCategory/index.vue +++ b/src/views/modules/visual/basicinfo/personCategory/index.vue @@ -73,16 +73,7 @@
- +
@@ -131,9 +122,7 @@ export default { categoryList: [], - pageNo: 1, - pageSize: 10, - total: 0, + activeIndex: 0, }; @@ -195,7 +184,6 @@ export default { onClickList (item, index) { this.activeIndex = index; - this.pageNo = 1; this.categoryKey = item.categoryKey this.loadRecordList() @@ -203,7 +191,7 @@ export default { }, loadRecordList () { - this.$refs.ref_recordlist.getRecordlist(this.dateId, this.categoryKey, this.pageNo, this.pageSize, this.agencyId, this.level) + this.$refs.ref_recordlist.getRecordlist(this.dateId, this.categoryKey, this.agencyId, this.level) }, @@ -242,15 +230,7 @@ export default { this.getApiData() }, - pageSizeChangeHandleNew (val) { - this.pageNo = 1; - this.pageSize = val; - this.loadRecordList() - }, - pageCurrentChangeHandleNew (val) { - this.pageNo = val; - this.loadRecordList() - }, + }, watch: { dateIdShow () { diff --git a/src/views/modules/visual/basicinfo/personCategory/recordList.vue b/src/views/modules/visual/basicinfo/personCategory/recordList.vue index 4c11cbd4..c0303141 100644 --- a/src/views/modules/visual/basicinfo/personCategory/recordList.vue +++ b/src/views/modules/visual/basicinfo/personCategory/recordList.vue @@ -68,6 +68,16 @@ + @@ -90,26 +100,14 @@ export default { showTypeSelect: false, widthList: ['5%', '10%', '15%', '10%', '20%', '30%'], - typeList: [ - { - value: '1', - label: '迁入' - }, - { - value: '2', - label: '迁出' - }, - { - value: '3', - label: '新增' - }, - ], + typeList: [], typeShow: '全部', selType: '', dateId: '', categoryKey: '', - pageNo: '', - pageSize: '', + pageNo: 1, + pageSize: 10, + total: 0 }; }, watch: { @@ -160,15 +158,14 @@ export default { }, //具体流动列表 - async getRecordlist (dateId, categoryKey, pageNo, pageSize, orgId, orgType) { + async getRecordlist (dateId, categoryKey, orgId, orgType) { this.visibleLoading = true if (dateId) { this.dateId = dateId this.categoryKey = categoryKey - this.pageNo = pageNo - this.pageSize = pageSize this.orgId = orgId this.orgType = orgType + this.pageNo = 1 } let tableData = []; const url = "/epmetuser/icuserchangerecord/category-analysis-list"; @@ -212,6 +209,15 @@ export default { this.getRecordlist() this.showTypeSelect = !this.showTypeSelect }, + pageSizeChangeHandleNew (val) { + this.pageNo = 1; + this.pageSize = val; + this.getRecordlist() + }, + pageCurrentChangeHandleNew (val) { + this.pageNo = val; + this.getRecordlist() + }, }, @@ -347,6 +353,31 @@ export default { } } } + .pagination { + box-sizing: border-box; + margin-top: 20px; + width: 100%; + height: 40px; + display: flex; + justify-content: flex-end; + + /deep/ .el-pagination.is-background .el-pager li:not(.disabled).active { + background: #0266d1; + color: #000d3f; + } + + /deep/ .el-pagination .el-pager li { + background: #002e74; + } + + /deep/ .el-pagination .btn-prev { + background: #002e74; + } + + /deep/ .el-pagination .btn-next { + background: #002e74; + } + } } .user_list { diff --git a/src/views/modules/visual/communityGovern/resiPieOption.js b/src/views/modules/visual/communityGovern/resiPieOption.js index 7c66d041..93967b68 100644 --- a/src/views/modules/visual/communityGovern/resiPieOption.js +++ b/src/views/modules/visual/communityGovern/resiPieOption.js @@ -1,5 +1,5 @@ -export function pieOption (_charts) { +export function pieOption (_charts,data) { const center= ['50%', '250px'] return { title: { @@ -33,6 +33,23 @@ const center= ['50%', '250px'] fontSize: 16, lineHeight: 20, }, + formatter: function(name) {//这里的name表示图例中的元素名称 + let str1='';//定义一个文本变量 + for(let i in data) {//对图例数组进行遍历 + + let item=data[i] + + if(item.name===name){ + str1 = item.name + '('+item.count+')'; + return str1; + } + // break + + + } + + } + }, series: [ @@ -83,12 +100,12 @@ const center= ['50%', '250px'] position: 'outside', alignTo: 'edge', // formatter: '{a|{c}}\n\n{name|{b}}', - formatter: '{a|{c}}\n{r|}\n{name|{b}}', + formatter: '{a|{c}%}\n{r|}\n{name|{b}}', minMargin: 5, edgeDistance: -20, lineHeight: 15, color: '#fff', - fontSize: 12, + fontSize: 10, // distanceToLabelLine: -60, rich: { name: { diff --git a/src/views/modules/visual/communityGovern/resibuzz.vue b/src/views/modules/visual/communityGovern/resibuzz.vue index 487d6487..8c88805e 100644 --- a/src/views/modules/visual/communityGovern/resibuzz.vue +++ b/src/views/modules/visual/communityGovern/resibuzz.vue @@ -57,7 +57,7 @@ :page-size="demand.pageSize" :total="demand.total" background - layout="prev, pager, next" + layout="prev, pager, next,total" @current-change="handlePageNoChange_demand"> @@ -327,6 +327,7 @@ export default { element.label = { show: true, + }; element.labelLine = { show: true, @@ -353,6 +354,7 @@ export default { } }); + this.pieOption.series[1].data = this.pieData this.$refs.pieChart.setOption(this.pieOption) @@ -379,14 +381,18 @@ export default { this.pieData.forEach((item, index) => { item.name = item.categoryName - debugger + let aa = parseInt(item.count) / parseInt(this.pieTotal) - let percent = new Number(parseInt(item.count) / parseInt(this.pieTotal)).toFixed(4) * 100 + '%' + + let percent = (aa * 100).toFixed(1) + + // percent = percent + '%' + item.value = percent this.colorArray.push(item.color) - if (item.value > maxValue) { - maxValue = item.value + if (item.count > maxValue) { + maxValue = item.count maxIndex = index item.selected = true } else if (index !== 0) { @@ -395,7 +401,7 @@ export default { }); // 获取pieChart配置 - this.pieOption = pieOption(this.pieChartS) + this.pieOption = pieOption(this.pieChartS, this.pieData) this.pieOption.title.text = this.pieTotal this.pieOption.series[1].itemStyle = { color: function (params) { @@ -453,6 +459,7 @@ export default { this.demand.loading = false; if (code === 0) { + this.demand.total = data.total; this.tableList = data.list this.demand.list = data.list.map((item) => { diff --git a/src/views/modules/visual/communityGovern/typeAnalyze.vue b/src/views/modules/visual/communityGovern/typeAnalyze.vue index 4099e5b8..fa663444 100644 --- a/src/views/modules/visual/communityGovern/typeAnalyze.vue +++ b/src/views/modules/visual/communityGovern/typeAnalyze.vue @@ -414,6 +414,7 @@ export default { this.demand.loading = false; if (code === 0) { + this.demand.total = data.total; this.tableList = data.list if (data.list && data.list.length > 0) {