【修改】首页统计图 增加表格

This commit is contained in:
fengachen
2022-10-21 17:08:20 +08:00
parent 2124c7c84b
commit 34ca17da1d
5 changed files with 81 additions and 69 deletions
+2 -2
View File
@@ -258,7 +258,7 @@ export default {
name:'合同金额', name:'合同金额',
data: this.echartsData.allMoney, data: this.echartsData.allMoney,
type: 'bar', type: 'bar',
barMaxWidth:30, barMaxWidth:20,
itemStyle:{ itemStyle:{
borderRadius:[8,8,0,0] borderRadius:[8,8,0,0]
} }
@@ -267,7 +267,7 @@ export default {
name:'确认收入金额', name:'确认收入金额',
data: this.echartsData.confirmAmount, data: this.echartsData.confirmAmount,
type: 'bar', type: 'bar',
barMaxWidth:30, barMaxWidth:20,
itemStyle:{ itemStyle:{
borderRadius:[8,8,0,0] borderRadius:[8,8,0,0]
} }
+2 -2
View File
@@ -25,9 +25,9 @@
<section class="wrap"> <section class="wrap">
<!-- 未收账款统计 --> <!-- 营收账款统计 -->
<not-received-echarts class="m-t-10 not-receiced"></not-received-echarts> <not-received-echarts class="m-t-10 not-receiced"></not-received-echarts>
<!-- 未收账款统计 --> <!-- 营收账款统计 -->
<!-- 收入分类统计 --> <!-- 收入分类统计 -->
+35 -27
View File
@@ -27,33 +27,33 @@
</div> </div>
<div class="echarts-box" id="incomeSort"></div> <div class="echarts-box" id="incomeSort"></div>
<!-- 表格区域beign --> <!-- 表格区域beign -->
<!-- <div style="width: 100%">--> <div style="width: 100%">
<!-- <a-table--> <a-table
<!-- ref="table"--> ref="table"
<!-- size="middle"--> size="middle"
<!-- bordered--> bordered
<!-- rowKey="projectId"--> rowKey="projectId"
<!-- :columns="columns"--> :columns="columns"
<!-- :scroll="{x: 500}"--> :scroll="{x: 500}"
<!-- :dataSource="dataSource"--> :dataSource="dataSource"
<!-- :pagination="false"--> :pagination="false"
<!-- class="j-table-force-nowrap main-table">--> class="j-table-force-nowrap main-table">
<!-- <template slot="text" slot-scope="text">--> <template slot="text" slot-scope="text">
<!-- <a-tooltip>--> <a-tooltip>
<!-- <template slot="title">{{ text }}</template>--> <template slot="title">{{ text }}</template>
<!-- <div class="table-text">{{ text }}</div>--> <div class="table-text">{{ text }}</div>
<!-- </a-tooltip>--> </a-tooltip>
<!-- </template>--> </template>
<!-- <template slot="allMoney" slot-scope="text">--> <template slot="allMoney" slot-scope="text">
<!-- <a-tooltip>--> <a-tooltip>
<!-- <template slot="title">{{ formatMoney(text) }}</template>--> <template slot="title">{{ formatMoney(text) }}</template>
<!-- <div class="table-text">{{ formatMoney(text) }}</div>--> <div class="table-text">{{ formatMoney(text) }}</div>
<!-- </a-tooltip>--> </a-tooltip>
<!-- </template>--> </template>
<!-- </a-table>--> </a-table>
<!-- </div>--> </div>
<!-- 表格区域end --> <!-- 表格区域end -->
</div> </div>
@@ -202,8 +202,9 @@ export default {
}, },
legend: { legend: {
bottom: '2%', bottom: '2%',
right: '5%', right: '2%',
padding: [0, 10, 0, 20] padding: [0,70, 0, 70],
itemGap:40 // 图例之间的间距
}, },
labelLine: { labelLine: {
lineStyle: { lineStyle: {
@@ -267,6 +268,13 @@ export default {
scopedSlots: {customRender: 'allMoney'} scopedSlots: {customRender: 'allMoney'}
},) },)
}) })
// this.columns.push( {
// title: '总数',
// align: 'center',
// width: 70,
// dataIndex: 'allMoney',
// scopedSlots: {customRender: 'text'}
// },)
}, },
// 处理圆点 // 处理圆点
initPoint(data, color) { initPoint(data, color) {
+41 -37
View File
@@ -27,33 +27,33 @@
<!-- </div>--> <!-- </div>-->
<div class="echarts-box" id="notReceived"></div> <div class="echarts-box" id="notReceived"></div>
<!-- 表格区域beign --> <!-- 表格区域beign -->
<!-- <div style="width: 100%">--> <div style="width: 100%">
<!-- <a-table--> <a-table
<!-- ref="table"--> ref="table"
<!-- size="middle"--> size="middle"
<!-- bordered--> bordered
<!-- rowKey="projectId"--> rowKey="projectId"
<!-- :columns="columns"--> :columns="columns"
<!-- :scroll="{x: 500}"--> :scroll="{x: 500}"
<!-- :dataSource="dataSource"--> :dataSource="dataSource"
<!-- :pagination="false"--> :pagination="false"
<!-- class="j-table-force-nowrap main-table">--> class="j-table-force-nowrap main-table">
<!-- <template slot="text" slot-scope="text">--> <template slot="text" slot-scope="text">
<!-- <a-tooltip>--> <a-tooltip>
<!-- <template slot="title">{{ text }}</template>--> <template slot="title">{{ text }}</template>
<!-- <div class="table-text">{{ text }}</div>--> <div class="table-text">{{ text }}</div>
<!-- </a-tooltip>--> </a-tooltip>
<!-- </template>--> </template>
<!-- <template slot="allMoney" slot-scope="text">--> <template slot="allMoney" slot-scope="text">
<!-- <a-tooltip>--> <a-tooltip>
<!-- <template slot="title">{{ formatMoney(text) }}</template>--> <template slot="title">{{ formatMoney(text) }}</template>
<!-- <div class="table-text">{{ formatMoney(text) }}</div>--> <div class="table-text">{{ formatMoney(text) }}</div>
<!-- </a-tooltip>--> </a-tooltip>
<!-- </template>--> </template>
<!-- </a-table>--> </a-table>
<!-- </div>--> </div>
<!-- 表格区域end --> <!-- 表格区域end -->
</div> </div>
@@ -153,25 +153,21 @@ export default {
if (this.echartsInstace != null && this.echartsInstace != '' && this.echartsInstace != undefined) { if (this.echartsInstace != null && this.echartsInstace != '' && this.echartsInstace != undefined) {
this.echartsInstace.dispose()//销毁 this.echartsInstace.dispose()//销毁
} }
let typeEnum = {
allMoney: 1, getAction(this.url.list, {departCode:this.queryParam.departCode}).then(res => {
confirmAmount: 2,
income: 3
}
getAction(this.url.list, {type: typeEnum[this.activeIndex],departCode:this.queryParam.departCode}).then(res => {
if (res.success) { if (res.success) {
let dataSource = res.result let dataSource = res.result
this.initColumns(res.result) this.initColumns(res.result)
this.initEcharts(res.result) this.initEcharts(res.result)
// 将接口数据 转化成表格数据形式 // 将接口数据 转化成表格数据形式
let tableData = [ let tableData = [
{indexName: typeEnum[this.activeIndex] !== 2 ? '合同金额' : '确收金额'}, {indexName: '金额'},
{indexName: '百分比'} // {indexName: '百分比'}
] ]
dataSource.map((item, index) => { dataSource.map((item, index) => {
let dataIndex = 'key' + index let dataIndex = 'key' + index
tableData[0][dataIndex] = item.money tableData[0][dataIndex] = item.money
tableData[1][dataIndex] = item.value + '%' // tableData[1][dataIndex] = item.value + '%'
}) })
this.dataSource = tableData this.dataSource = tableData
} }
@@ -204,7 +200,8 @@ export default {
legend: { legend: {
bottom: '2%', bottom: '2%',
right: '5%', right: '5%',
padding: [0, 10, 0, 20] padding: [0, 80, 0, 80],
itemGap:75
}, },
labelLine: { labelLine: {
lineStyle: { lineStyle: {
@@ -261,13 +258,20 @@ export default {
] ]
data.map((item, index) => { data.map((item, index) => {
this.columns.push({ this.columns.push({
title: item.name_dictText, title: item.name,
align: 'center', align: 'center',
width: 85, width: 95,
dataIndex: 'key' + index, dataIndex: 'key' + index,
scopedSlots: {customRender: 'allMoney'} scopedSlots: {customRender: 'allMoney'}
},) },)
}) })
// this.columns.push( {
// title: '总数',
// align: 'center',
// width: 70,
// dataIndex: 'allmoney',
// scopedSlots: {customRender: 'text'}
// },)
}, },
// 处理圆点 // 处理圆点
initPoint(data, color) { initPoint(data, color) {
+1 -1
View File
@@ -268,7 +268,7 @@ export default {
name: '应收金额', name: '应收金额',
data: this.echartsData.allMoney, data: this.echartsData.allMoney,
type: 'bar', type: 'bar',
barMaxWidth: 30, barMaxWidth: 60,
itemStyle: { itemStyle: {
borderRadius: [8, 8, 0, 0] borderRadius: [8, 8, 0, 0]
} }