|
|
@@ -4,12 +4,12 @@
|
|
|
<div class="title-main d-flex justify-content-between">
|
|
|
<div class="d-inline-block mr-2"></div>
|
|
|
<div>
|
|
|
- <a href="javascript:void(0)" title="全屏显示" id="showFull" class="text-white"><i class="fa fa-arrows-alt"></i></a>
|
|
|
+ <a href="javascript:void(0)" title="全屏显示" id="showFull" class="text-white"><i class="fa fa-arrows-alt"></i></a>
|
|
|
<div class="btn-group">
|
|
|
<button type="button" class="btn btn-sm btn-outline-dark text-white dropdown-toggle" data-toggle="dropdown" id="zhankai">投资总控</button>
|
|
|
<div class="dropdown-menu" aria-labelledby="zhankai">
|
|
|
<% for (const i of ctx.subProject.data_collect_pages) { %>
|
|
|
- <a class="dropdown-item" href="/sp/<%- ctx.subProject.id %>/datacollect/index/<%- i %>"><% if (i === '7') { %>成本管理<% } else if (i === '8') { %>投资总控<% } else { %>决策大屏<%- i %><% } %></a>
|
|
|
+ <a class="dropdown-item" href="/sp/<%- ctx.subProject.id %>/datacollect/index/<%- i %>"><% if (i === '7') { %>成本管理<% } else if (i === '8') { %>投资总控<% } else { %>决策大屏<%- i %><% } %></a>
|
|
|
<% } %>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -17,7 +17,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="content-wrap" id="big-data">
|
|
|
- <div style="height: 30px;background-color: #2c3237; display: none" id="exitfull-div">
|
|
|
+ <div style="height:30px;background-color:#2c3237;display:none" id="exitfull-div">
|
|
|
<div class="title-main d-flex">
|
|
|
<div class="ml-auto">
|
|
|
<div class="dropdown d-flex float-left mt-1 mr-2">
|
|
|
@@ -26,158 +26,131 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="c-body" style="background:#2c3237 !important;">
|
|
|
+ <div class="c-body" style="background:#2c3237 !important">
|
|
|
<div class="flex-content">
|
|
|
- <div class="row m-2">
|
|
|
- <div class="col-9 m-0 px-0 height-100">
|
|
|
- <div class="row m-0 px-0 mb-2 mr-2 bg-dark" style="height: 31vh;">
|
|
|
- <div class="col-12 text-white pt-2 pl-3">
|
|
|
- <div class="card-big-htext">| 公路总造价占比<span class="float-right mr-2">万元 </span></div>
|
|
|
- </div>
|
|
|
- <div class="col-12 row ml-0 mr-2 px-0" style="height: 88%">
|
|
|
- <div class="col-3 m-0 px-0 height-100">
|
|
|
- <div class="guchart" id="guchart" style="height: 100%; width: 100%;"></div>
|
|
|
- </div>
|
|
|
- <div class="col-3 m-0 px-0 height-100">
|
|
|
- <div class="gaichart" id="gaichart" style="height: 100%; width: 100%;"></div>
|
|
|
- </div>
|
|
|
- <div class="col-3 m-0 px-0 height-100">
|
|
|
- <div class="yuchart" id="yuchart" style="height: 100%; width: 100%;"></div>
|
|
|
- </div>
|
|
|
- <div class="col-3 m-0 px-0 height-100">
|
|
|
- <div class="ctrlchart" id="ctrlchart" style="height: 100%; width: 100%;"></div>
|
|
|
+ <style>
|
|
|
+ #big-data:fullscreen #investment-layout {
|
|
|
+ height: calc(100vh - 39px) !important;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+ <div class="row mx-2 mb-2" id="investment-layout" style="height: calc(100vh - 44px);">
|
|
|
+ <div class="col-12 px-0 height-100">
|
|
|
+ <div class="row m-0" style="height: 33.333333%;">
|
|
|
+ <div class="col-7 px-0 pr-1 pb-2 height-100">
|
|
|
+ <div class="row m-0 height-100 bg-dark">
|
|
|
+ <div class="col-12 text-white pt-2 pl-3">
|
|
|
+ <div class="card-big-htext d-flex align-items-center"><span class="flex-grow-1">| 全过程造价趋势</span><span class="text-nowrap mr-2">元</span></div>
|
|
|
+ </div>
|
|
|
+ <div class="col-12 m-0 px-0" style="height: 88%">
|
|
|
+ <div class="quanchart" id="quanchart" style="height: 100%; width: 100%;"></div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="row m-0 px-0 mb-2 mr-2 bg-dark" style="height: 31vh;">
|
|
|
- <div class="col-12 text-white pt-2 pl-3">
|
|
|
- <div class="card-big-htext">| 全过程造价趋势<span class="float-right mr-2">万元 </span></div>
|
|
|
- </div>
|
|
|
- <div class="col-12 m-0" style="height: 88%">
|
|
|
- <div class="quanchart" id="quanchart" style="height: 100%; width: 100%;"></div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="row m-0 px-0 mb-2 mr-2" style="height: 31vh;">
|
|
|
- <div class="col-5 px-0 pb-1 height-100 bg-dark">
|
|
|
- <div class="col-12 text-white pt-2 pl-3">
|
|
|
- <div class="card-big-htext">| 金额对比<span class="float-right mr-2">万元 </span></div>
|
|
|
- </div>
|
|
|
- <style>
|
|
|
- .table-scroll::-webkit-scrollbar {
|
|
|
- width: 6px;
|
|
|
- height: 6px;
|
|
|
- }
|
|
|
-
|
|
|
- .table-scroll::-webkit-scrollbar-track {
|
|
|
- background: transparent;
|
|
|
- }
|
|
|
+ <div class="col-5 px-0 pl-1 pb-2 height-100">
|
|
|
+ <div class="row m-0 height-100 bg-dark">
|
|
|
+ <div class="col-12 text-white pt-2 pl-3">
|
|
|
+ <div class="card-big-htext d-flex align-items-center"><span class="flex-grow-1">| 金额对比</span><span class="text-nowrap mr-2">万元</span></div>
|
|
|
+ </div>
|
|
|
+ <style>
|
|
|
+ .table-scroll::-webkit-scrollbar {
|
|
|
+ width: 6px;
|
|
|
+ height: 6px;
|
|
|
+ }
|
|
|
|
|
|
- .table-scroll::-webkit-scrollbar-thumb {
|
|
|
- background: rgba(255,255,255,.25);
|
|
|
- border-radius: 3px;
|
|
|
- }
|
|
|
+ .table-scroll::-webkit-scrollbar-track {
|
|
|
+ background: transparent;
|
|
|
+ }
|
|
|
|
|
|
- .table-scroll::-webkit-scrollbar-thumb:hover {
|
|
|
- background: rgba(255,255,255,.45);
|
|
|
- }
|
|
|
+ .table-scroll::-webkit-scrollbar-thumb {
|
|
|
+ background: rgba(255,255,255,.25);
|
|
|
+ border-radius: 3px;
|
|
|
+ }
|
|
|
|
|
|
- .table-scroll::-webkit-scrollbar-corner {
|
|
|
- background: transparent;
|
|
|
- }
|
|
|
- </style>
|
|
|
- <div class="col-12 pb-2 text-white m-0 bg-dark table-scroll" style="height: 89%;overflow: auto;">
|
|
|
- <style>
|
|
|
- .level1-table tbody tr td {
|
|
|
- padding: 6px 10px; /* 默认一般是 8~16px,可根据需要继续调小 */
|
|
|
- line-height: 1.2;
|
|
|
- border-bottom: 1px solid rgba(255,255,255,0.2);
|
|
|
+ .table-scroll::-webkit-scrollbar-thumb:hover {
|
|
|
+ background: rgba(255,255,255,.45);
|
|
|
}
|
|
|
- .level1-table tbody tr:last-child td {
|
|
|
- border-bottom: none;
|
|
|
+
|
|
|
+ .table-scroll::-webkit-scrollbar-corner {
|
|
|
+ background: transparent;
|
|
|
}
|
|
|
</style>
|
|
|
- <table class="level1-table" style="width: 100%; height: 100%;">
|
|
|
- <thead style="height: 27px;border-bottom: 1px solid rgba(255,255,255,0.2);background-color: #2C3034;">
|
|
|
- <tr class="text-center">
|
|
|
- <th>分类</th>
|
|
|
- <th>控制目标</th>
|
|
|
- <th>实际投资</th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody id="level1-data">
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
+ <div class="col-12 pb-2 text-white m-0 bg-dark table-scroll" style="height: 89%;overflow: auto;">
|
|
|
+ <style>
|
|
|
+ #big-data .level1-table th, #big-data .level1-table td {
|
|
|
+ padding: 5px 10px;
|
|
|
+ line-height: 1.2;
|
|
|
+ border-bottom: 1px solid rgba(255,255,255,0.2);
|
|
|
+ text-align: right;
|
|
|
+ white-space: nowrap;
|
|
|
+ font-variant-numeric: tabular-nums;
|
|
|
+ }
|
|
|
+ #big-data .level1-table th:first-child, #big-data .level1-table td:first-child {
|
|
|
+ text-align: left;
|
|
|
+ }
|
|
|
+ #big-data .level1-table tbody tr:last-child td {
|
|
|
+ border-bottom: none;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+ <table class="level1-table" style="width: 100%; color: #fff;">
|
|
|
+ <thead style="position: sticky; top: 0; z-index: 1; background: #2c3034;">
|
|
|
+ <tr>
|
|
|
+ <th>分类</th>
|
|
|
+ <th>设计概算</th>
|
|
|
+ <th>控制目标</th>
|
|
|
+ <th>实际投资</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody id="level1-data"></tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="col-7 m-0 px-0 height-100">
|
|
|
- <div class="row ml-2 mr-0 mb-2 height-100 bg-dark">
|
|
|
+ </div>
|
|
|
+ <div class="row m-0" style="height: 33.333333%;">
|
|
|
+ <div class="col-4 px-0 pr-1 pb-2 height-100">
|
|
|
+ <div class="row m-0 height-100 bg-dark">
|
|
|
<div class="col-12 text-white pt-2 pl-3">
|
|
|
- <div class="card-big-htext">| 控制目标与实际投资对比<span class="float-right mr-2">万元 </span></div>
|
|
|
+ <div class="card-big-htext d-flex align-items-center"><span class="flex-grow-1">| 可研过会与实际投资对比</span><span class="text-nowrap mr-2">元</span></div>
|
|
|
</div>
|
|
|
- <div class="col-12 m-0" style="height: 88%">
|
|
|
- <div class="mbsjchart" id="mbsjchart" style="height: 100%; width: 100%;"></div>
|
|
|
+ <div class="col-12 m-0 px-0" style="height: 88%">
|
|
|
+ <div class="gusjchart" id="gusjchart" style="height: 100%; width: 100%;"></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="col-3 m-0 px-0 height-100" id="tender-chart">
|
|
|
- <style>
|
|
|
- #tender-chart .card-big-htext {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- }
|
|
|
- .card-big-htext #tender1_name, .card-big-htext #tender2_name, .card-big-htext #tender3_name, .card-big-htext #tender4_name {
|
|
|
- flex: 1;
|
|
|
- min-width: 0; /* 非常重要,flex 布局下省略号必须有 */
|
|
|
- overflow: hidden;
|
|
|
- white-space: nowrap;
|
|
|
- text-overflow: ellipsis;
|
|
|
- }
|
|
|
-
|
|
|
- #tender-chart .card-big-htext .float-right {
|
|
|
- flex-shrink: 0;
|
|
|
- }
|
|
|
- </style>
|
|
|
- <div class="row m-0 px-0 pb-2" style="height: 23.85vh">
|
|
|
- <div class="row mx-0 w-100 height-100 bg-dark">
|
|
|
- <div class="col-12 text-white pt-2 pl-3">
|
|
|
- <div class="card-big-htext"><span id="tender1_name" data-toggle="tooltip" data-original-title="">标段1</span><span class="float-right mr-2">万元 </span></div>
|
|
|
- </div>
|
|
|
- <div class="col-12 m-0" style="height: 80%">
|
|
|
- <div class="tender1chart" id="tender1chart" style="height: 100%; width: 100%;"></div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="row m-0 px-0 pb-2" style="height: 23.85vh">
|
|
|
- <div class="row mx-0 w-100 height-100 bg-dark">
|
|
|
- <div class="col-12 text-white pt-2 pl-3">
|
|
|
- <div class="card-big-htext"><span id="tender2_name" data-toggle="tooltip" data-original-title="">标段2</span><span class="float-right mr-2">万元 </span></div>
|
|
|
- </div>
|
|
|
- <div class="col-12 m-0" style="height: 80%">
|
|
|
- <div class="tender2chart" id="tender2chart" style="height: 100%; width: 100%;"></div>
|
|
|
+ <div class="col-4 px-0 px-1 pb-2 height-100">
|
|
|
+ <div class="row m-0 height-100 bg-dark">
|
|
|
+ <div class="col-12 text-white pt-2 pl-3">
|
|
|
+ <div class="card-big-htext d-flex align-items-center"><span class="flex-grow-1">| 施工图预算与实际投资对比</span><span class="text-nowrap mr-2">元</span></div>
|
|
|
+ </div>
|
|
|
+ <div class="col-12 m-0 px-0" style="height: 88%">
|
|
|
+ <div class="yusjchart" id="yusjchart" style="height: 100%; width: 100%;"></div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="row m-0 px-0 pb-2" style="height: 23.85vh">
|
|
|
- <div class="row mx-0 w-100 height-100 bg-dark">
|
|
|
- <div class="col-12 text-white pt-2 pl-3">
|
|
|
- <div class="card-big-htext"><span id="tender3_name" data-toggle="tooltip" data-original-title="">标段3</span><span class="float-right mr-2">万元 </span></div>
|
|
|
- </div>
|
|
|
- <div class="col-12 m-0" style="height: 80%">
|
|
|
- <div class="tender3chart" id="tender3chart" style="height: 100%; width: 100%;"></div>
|
|
|
+ <div class="col-4 px-0 pl-1 pb-2 height-100">
|
|
|
+ <div class="row m-0 height-100 bg-dark">
|
|
|
+ <div class="col-12 text-white pt-2 pl-3">
|
|
|
+ <div class="card-big-htext d-flex align-items-center"><span class="flex-grow-1">| 控制目标与实际投资对比</span><span class="text-nowrap mr-2">元</span></div>
|
|
|
+ </div>
|
|
|
+ <div class="col-12 m-0 px-0" style="height: 88%">
|
|
|
+ <div class="mbsjchart" id="mbsjchart" style="height: 100%; width: 100%;"></div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="row m-0 pb-2 px-0" style="height: 23.85vh">
|
|
|
- <div class="row mx-0 w-100 height-100 bg-dark">
|
|
|
- <div class="col-12 text-white pt-2 pl-3">
|
|
|
- <div class="card-big-htext"><span id="tender4_name" data-toggle="tooltip" data-original-title="">标段4</span><span class="float-right mr-2">万元 </span></div>
|
|
|
- </div>
|
|
|
- <div class="col-12 m-0" style="height: 80%">
|
|
|
- <div class="tender4chart" id="tender4chart" style="height: 100%; width: 100%;"></div>
|
|
|
+ <div class="row m-0" id="tender-chart" style="height: 33.333333%;">
|
|
|
+ <% for (let i = 1; i <= 4; i++) { %>
|
|
|
+ <div class="col-3 px-0 <%- i === 1 ? 'pr-1' : (i === 4 ? 'pl-1' : 'px-1') %> height-100">
|
|
|
+ <div class="row m-0 height-100 bg-dark">
|
|
|
+ <div class="col-12 text-white pt-2 pl-3">
|
|
|
+ <div class="card-big-htext d-flex align-items-center"><span class="flex-fill text-truncate" id="tender<%- i %>_name" data-toggle="tooltip" data-original-title="" style="min-width: 0;">标段<%- i %></span><span class="text-nowrap mr-2">元</span></div>
|
|
|
+ </div>
|
|
|
+ <div class="col-12 m-0 px-0" style="height: 88%">
|
|
|
+ <div class="tender<%- i %>chart" id="tender<%- i %>chart" style="height: 100%; width: 100%;"></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ <% } %>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -187,72 +160,8 @@
|
|
|
</div>
|
|
|
<script src="/public/js/path_tree.js"></script>
|
|
|
<script src="/public/js/shares/tenders2tree.js"></script>
|
|
|
-<script src="/public/js/datacollect_scroll.js"></script>
|
|
|
<script type="text/javascript"> autoFlashHeight();</script>
|
|
|
<script type="text/javascript">
|
|
|
- // 利润排名占比饼图表
|
|
|
- const guchart = document.getElementsByClassName('guchart');
|
|
|
- const gaichart = document.getElementsByClassName('gaichart');
|
|
|
- const yuchart = document.getElementsByClassName('yuchart');
|
|
|
- const ctrlchart = document.getElementsByClassName('ctrlchart');
|
|
|
- const guOption = {
|
|
|
- tooltip : {
|
|
|
- trigger: 'item',
|
|
|
- formatter: "{a} <br/>{b} : {c} ({d}%)",
|
|
|
- // 当前鼠标位置
|
|
|
- position: 'right',
|
|
|
- },
|
|
|
- title: {
|
|
|
- text: '投资估算',
|
|
|
- left: 'center',
|
|
|
- bottom: '5%',
|
|
|
- textStyle: {
|
|
|
- fontSize: 14,
|
|
|
- fontWeight: 'normal',
|
|
|
- color: '#fff',
|
|
|
- }
|
|
|
- },
|
|
|
- color: ['rgba(38, 217, 217,0.7)','rgba(78, 139, 229,0.7)',
|
|
|
- 'rgba(78, 229, 139,0.7)','rgba(108, 78, 229,0.7)',
|
|
|
- 'rgba(58,207,221,0.7)','rgba(164, 229, 78,0.7)',
|
|
|
- 'rgba(199, 78, 229,0.7)', 'rgba(229, 92, 174, 0.7)',
|
|
|
- 'rgba(229, 214, 78, 0.7)', 'rgba(241, 87, 96, 0.7)',
|
|
|
- 'rgba(242, 179, 82, 0.7)'],
|
|
|
- backgroundColor: '#343a40 ',
|
|
|
- series: [
|
|
|
- {
|
|
|
- name: '金额',
|
|
|
- type: 'pie',
|
|
|
- radius: '52%',
|
|
|
- center: ['50%', '42%'],
|
|
|
- // formatter: function(name){
|
|
|
- // return name.length>10?name.substr(0,10)+"...":name;
|
|
|
- // },
|
|
|
- data: [],
|
|
|
- emphasis: {
|
|
|
- itemStyle: {
|
|
|
- shadowBlur: 10,
|
|
|
- shadowOffsetX: 0,
|
|
|
- shadowColor: 'rgba(0, 0, 0, 0.5)'
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- ]
|
|
|
- };
|
|
|
- const guChart1 = echarts.init(guchart[0]);
|
|
|
- const gaiChart1 = echarts.init(gaichart[0]);
|
|
|
- const yuChart1 = echarts.init(yuchart[0]);
|
|
|
- const ctrlChart1 = echarts.init(ctrlchart[0]);
|
|
|
- guChart1.setOption(guOption);
|
|
|
- const gaiOption = _.cloneDeep(guOption);
|
|
|
- gaiOption.title.text = '设计概算';
|
|
|
- gaiChart1.setOption(gaiOption);
|
|
|
- const yuOption = _.cloneDeep(guOption);
|
|
|
- yuOption.title.text = '施工图预算';
|
|
|
- yuChart1.setOption(yuOption);
|
|
|
- const ctrlOption = _.cloneDeep(guOption);
|
|
|
- ctrlOption.title.text = '控制目标';
|
|
|
- ctrlChart1.setOption(ctrlOption);
|
|
|
// 利润统计状图表
|
|
|
const quanoption = {
|
|
|
title: {},
|
|
|
@@ -273,6 +182,7 @@
|
|
|
backgroundColor: '#343a40 ',
|
|
|
tooltip: {
|
|
|
trigger: 'axis',
|
|
|
+ formatter: formatInvestmentTooltip,
|
|
|
axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
|
|
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
|
|
},
|
|
|
@@ -280,13 +190,14 @@
|
|
|
grid: {
|
|
|
left: '3%',
|
|
|
right: '5%',
|
|
|
+ top: 55,
|
|
|
bottom: '3%',
|
|
|
containLabel: true
|
|
|
},
|
|
|
xAxis: [
|
|
|
{
|
|
|
type: 'category',
|
|
|
- data: ['投资估算',
|
|
|
+ data: ['可研过会',
|
|
|
'设计概算',
|
|
|
'施工图预算',
|
|
|
'控制目标', '实际投资'],
|
|
|
@@ -314,23 +225,7 @@
|
|
|
position: 'left',
|
|
|
axisLabel : {
|
|
|
color: '#fff',
|
|
|
- formatter: function (value, index) {
|
|
|
- if (value < 0) {
|
|
|
- let newValue = Math.abs(value);
|
|
|
- if (newValue >= 10000 && newValue < 10000000) {
|
|
|
- newValue = newValue / 10000 + "万";
|
|
|
- } else if (newValue >= 10000000) {
|
|
|
- newValue = newValue / 10000000 + "千万";
|
|
|
- }
|
|
|
- value = '-' + newValue;
|
|
|
- }
|
|
|
- if (value >= 10000 && value < 10000000) {
|
|
|
- value = value / 10000 + "万";
|
|
|
- } else if (value >= 10000000) {
|
|
|
- value = value / 10000000 + "千万";
|
|
|
- }
|
|
|
- return value;
|
|
|
- }
|
|
|
+ formatter: formatInvestmentAmount
|
|
|
},
|
|
|
splitLine: {
|
|
|
show: true,
|
|
|
@@ -367,6 +262,7 @@
|
|
|
backgroundColor: '#343a40 ',
|
|
|
tooltip: {
|
|
|
trigger: 'axis',
|
|
|
+ formatter: formatInvestmentTooltip,
|
|
|
axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
|
|
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
|
|
},
|
|
|
@@ -374,6 +270,7 @@
|
|
|
grid: {
|
|
|
left: '3%',
|
|
|
right: '5%',
|
|
|
+ top: 50,
|
|
|
bottom: '3%',
|
|
|
containLabel: true
|
|
|
},
|
|
|
@@ -386,14 +283,13 @@
|
|
|
interval: 0,
|
|
|
textStyle: {
|
|
|
color: "#fff",
|
|
|
- fontSize: 14
|
|
|
+ fontSize: 12
|
|
|
},
|
|
|
formatter: function(value) {
|
|
|
- var res = value;
|
|
|
- if(res.length > 6) {
|
|
|
- res = res.substring(0, 5) + "..";
|
|
|
+ if (value.length > 6) {
|
|
|
+ return value.substring(0, 6) + '\n' + value.substring(6, 12) + (value.length > 12 ? '…' : '');
|
|
|
}
|
|
|
- return res;
|
|
|
+ return value;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -405,23 +301,7 @@
|
|
|
position: 'left',
|
|
|
axisLabel : {
|
|
|
color: '#fff',
|
|
|
- formatter: function (value, index) {
|
|
|
- if (value < 0) {
|
|
|
- let newValue = Math.abs(value);
|
|
|
- if (newValue >= 10000 && newValue < 10000000) {
|
|
|
- newValue = newValue / 10000 + "万";
|
|
|
- } else if (newValue >= 10000000) {
|
|
|
- newValue = newValue / 10000000 + "千万";
|
|
|
- }
|
|
|
- value = '-' + newValue;
|
|
|
- }
|
|
|
- if (value >= 10000 && value < 10000000) {
|
|
|
- value = value / 10000 + "万";
|
|
|
- } else if (value >= 10000000) {
|
|
|
- value = value / 10000000 + "千万";
|
|
|
- }
|
|
|
- return value;
|
|
|
- }
|
|
|
+ formatter: formatInvestmentAmount
|
|
|
},
|
|
|
splitLine: {
|
|
|
show: true,
|
|
|
@@ -438,8 +318,15 @@
|
|
|
name: '控制目标',
|
|
|
type: 'bar',
|
|
|
data: [],
|
|
|
- // barWidth: 18,
|
|
|
+ barMaxWidth: 24,
|
|
|
barGap: '0%',
|
|
|
+ label: {
|
|
|
+ show: true,
|
|
|
+ position: 'top',
|
|
|
+ color: '#fff',
|
|
|
+ fontSize: 12,
|
|
|
+ formatter: formatInvestmentBarLabel
|
|
|
+ },
|
|
|
// itemStyle: {
|
|
|
// borderRadius: [4, 4, 0, 0]
|
|
|
// }
|
|
|
@@ -448,8 +335,16 @@
|
|
|
name: '实际投资',
|
|
|
type: 'bar',
|
|
|
data: [],
|
|
|
- // barWidth: 18,
|
|
|
+ barMaxWidth: 24,
|
|
|
barGap: '0%',
|
|
|
+ label: {
|
|
|
+ show: true,
|
|
|
+ position: 'top',
|
|
|
+ color: '#fff',
|
|
|
+ fontSize: 12,
|
|
|
+ offset: [0, -10],
|
|
|
+ formatter: formatInvestmentBarLabel
|
|
|
+ },
|
|
|
// itemStyle: {
|
|
|
// borderRadius: [4, 4, 0, 0]
|
|
|
// }
|
|
|
@@ -460,6 +355,15 @@
|
|
|
const mbsjChart1 = echarts.init(mbsjchart[0]);
|
|
|
mbsjChart1.setOption(mbsjoption);
|
|
|
|
|
|
+ const gusjOption = _.cloneDeep(mbsjoption);
|
|
|
+ gusjOption.series[0].name = '可研过会';
|
|
|
+ const gusjChart1 = echarts.init(document.getElementById('gusjchart'));
|
|
|
+ gusjChart1.setOption(gusjOption);
|
|
|
+ const yusjOption = _.cloneDeep(mbsjoption);
|
|
|
+ yusjOption.series[0].name = '施工图预算';
|
|
|
+ const yusjChart1 = echarts.init(document.getElementById('yusjchart'));
|
|
|
+ yusjChart1.setOption(yusjOption);
|
|
|
+
|
|
|
|
|
|
const tenderoption = {
|
|
|
title: {},
|
|
|
@@ -480,6 +384,7 @@
|
|
|
backgroundColor: '#343a40 ',
|
|
|
tooltip: {
|
|
|
trigger: 'axis',
|
|
|
+ formatter: formatInvestmentTooltip,
|
|
|
axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
|
|
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
|
|
},
|
|
|
@@ -487,6 +392,7 @@
|
|
|
grid: {
|
|
|
left: '3%',
|
|
|
right: '5%',
|
|
|
+ top: 50,
|
|
|
bottom: '3%',
|
|
|
containLabel: true
|
|
|
},
|
|
|
@@ -518,23 +424,7 @@
|
|
|
position: 'left',
|
|
|
axisLabel : {
|
|
|
color: '#fff',
|
|
|
- formatter: function (value, index) {
|
|
|
- if (value < 0) {
|
|
|
- let newValue = Math.abs(value);
|
|
|
- if (newValue >= 10000 && newValue < 10000000) {
|
|
|
- newValue = newValue / 10000 + "万";
|
|
|
- } else if (newValue >= 10000000) {
|
|
|
- newValue = newValue / 10000000 + "千万";
|
|
|
- }
|
|
|
- value = '-' + newValue;
|
|
|
- }
|
|
|
- if (value >= 10000 && value < 10000000) {
|
|
|
- value = value / 10000 + "万";
|
|
|
- } else if (value >= 10000000) {
|
|
|
- value = value / 10000000 + "千万";
|
|
|
- }
|
|
|
- return value;
|
|
|
- }
|
|
|
+ formatter: formatInvestmentAmount
|
|
|
},
|
|
|
splitLine: {
|
|
|
show: true,
|
|
|
@@ -551,8 +441,15 @@
|
|
|
name: '合同额',
|
|
|
type: 'bar',
|
|
|
data: [],
|
|
|
- // barWidth: 30,
|
|
|
- barGap: '0%',
|
|
|
+ barWidth: 26,
|
|
|
+ barGap: '100%',
|
|
|
+ label: {
|
|
|
+ show: true,
|
|
|
+ position: 'top',
|
|
|
+ color: '#fff',
|
|
|
+ fontSize: 12,
|
|
|
+ formatter: formatInvestmentBarLabel
|
|
|
+ },
|
|
|
// itemStyle: {
|
|
|
// borderRadius: [4, 4, 0, 0]
|
|
|
// }
|
|
|
@@ -561,8 +458,15 @@
|
|
|
name: '计价',
|
|
|
type: 'bar',
|
|
|
data: [],
|
|
|
- // barWidth: 30,
|
|
|
- barGap: '0%',
|
|
|
+ barWidth: 26,
|
|
|
+ barGap: '100%',
|
|
|
+ label: {
|
|
|
+ show: true,
|
|
|
+ position: 'top',
|
|
|
+ color: '#fff',
|
|
|
+ fontSize: 12,
|
|
|
+ formatter: formatInvestmentBarLabel
|
|
|
+ },
|
|
|
// itemStyle: {
|
|
|
// borderRadius: [4, 4, 0, 0]
|
|
|
// }
|
|
|
@@ -571,8 +475,15 @@
|
|
|
name: '利润',
|
|
|
type: 'bar',
|
|
|
data: [],
|
|
|
- // barWidth: 30,
|
|
|
- barGap: '0%',
|
|
|
+ barWidth: 26,
|
|
|
+ barGap: '100%',
|
|
|
+ label: {
|
|
|
+ show: true,
|
|
|
+ position: 'top',
|
|
|
+ color: '#fff',
|
|
|
+ fontSize: 12,
|
|
|
+ formatter: formatInvestmentBarLabel
|
|
|
+ },
|
|
|
// itemStyle: {
|
|
|
// borderRadius: [4, 4, 0, 0]
|
|
|
// }
|
|
|
@@ -591,15 +502,14 @@
|
|
|
}
|
|
|
|
|
|
function echartsReset() {
|
|
|
- guChart1.resize();
|
|
|
- gaiChart1.resize();
|
|
|
- yuChart1.resize();
|
|
|
- ctrlChart1.resize();
|
|
|
quanChart1.resize();
|
|
|
+ gusjChart1.resize();
|
|
|
+ yusjChart1.resize();
|
|
|
mbsjChart1.resize();
|
|
|
for (let i = 1; i <= 4; i++) {
|
|
|
tenderChart['chart' + i].resize();
|
|
|
}
|
|
|
+ [gusjChart1, yusjChart1, mbsjChart1].forEach(fitInvestmentComparisonLabels);
|
|
|
}
|
|
|
$(function () {
|
|
|
$('#showFull').click(function () {
|
|
|
@@ -615,9 +525,6 @@
|
|
|
if (resizeTimer) clearTimeout(resizeTimer);
|
|
|
resizeTimer = setTimeout(function () {
|
|
|
echartsReset();
|
|
|
- $(".tableid_").find('th').each(function(i) {
|
|
|
- $(this).css('width', $('#tableId').find('th:eq(' + i + ')').innerWidth());
|
|
|
- });
|
|
|
}, 500);
|
|
|
})
|
|
|
|
|
|
@@ -653,6 +560,7 @@
|
|
|
$('#exitfull-div').hide();
|
|
|
$('#showFull').show();
|
|
|
}
|
|
|
+ echartsReset();
|
|
|
});
|
|
|
const originDataCollect = parseInt('<%- ctx.subProject.data_collect %>');
|
|
|
$(function () {
|
|
|
@@ -886,129 +794,114 @@
|
|
|
}
|
|
|
}
|
|
|
setRightTenderEchart(result.tenderList);
|
|
|
+ echartsReset();
|
|
|
});
|
|
|
|
|
|
function setPageData(tree, info) {
|
|
|
- console.log(tree);
|
|
|
- const chart_gu_data = [], chart_gai_data = [], chart_yu_data = [], chart_ctrl_data = [];
|
|
|
+ info = info || {};
|
|
|
const chart_quan_data = [];
|
|
|
const chart_mbsj_data = {
|
|
|
xData: [],
|
|
|
+ guData: [],
|
|
|
+ yuData: [],
|
|
|
ctrlData: [],
|
|
|
realData: [],
|
|
|
};
|
|
|
const table_data = [];
|
|
|
const totalLevel1_table_data = {
|
|
|
+ gai_tp: 0,
|
|
|
ctrl_tp: 0,
|
|
|
real_tp: 0,
|
|
|
};
|
|
|
+ let stageTotals = [0, 0, 0, 0, 0];
|
|
|
if (tree.children.length > 0) {
|
|
|
- // 分析第一层结构,获取各个部分金额非全0的及除了回收金额层
|
|
|
+ // 沿用原有第一层分类口径,保留只有实际投资金额的分类。
|
|
|
const level1List = _.filter(tree.children, function (item) {
|
|
|
return item.name.indexOf('回收金额') === -1 &&
|
|
|
- (item.gu_tp || item.gai_tp || (item.final_tp !== undefined && item.final_tp) || item.yu_tp || (item.ctrl_tp !== undefined && item.ctrl_tp))
|
|
|
+ (item.gu_tp || item.gai_tp || item.final_tp || item.yu_tp || item.ctrl_tp || item.real_tp);
|
|
|
});
|
|
|
- console.log(level1List);
|
|
|
for (const level1 of level1List) {
|
|
|
- level1.name = level1.name.replace(
|
|
|
- /^第[一二三四五六七八九十百千万\d]+部分[\s ]+/,
|
|
|
- ''
|
|
|
- );
|
|
|
- chart_gu_data.push({
|
|
|
- name: level1.name,
|
|
|
- value: level1.gu_tp ? ZhCalc.round(ZhCalc.div(level1.gu_tp, 10000), 0) : 0,
|
|
|
- });
|
|
|
- chart_gai_data.push({
|
|
|
- name: level1.name,
|
|
|
- value: level1.gai_tp ? ZhCalc.round(ZhCalc.div(level1.gai_tp, 10000), 0) : 0,
|
|
|
- });
|
|
|
- chart_yu_data.push({
|
|
|
- name: level1.name,
|
|
|
- value: level1.yu_tp ? ZhCalc.round(ZhCalc.div(level1.yu_tp, 10000), 0) : 0,
|
|
|
- });
|
|
|
- chart_ctrl_data.push({
|
|
|
- name: level1.name,
|
|
|
- value: level1.ctrl_tp ? ZhCalc.round(ZhCalc.div(level1.ctrl_tp, 10000), 0) : 0,
|
|
|
- });
|
|
|
+ const name = level1.name.replace(/^第[一二三四五六七八九十百千万\d]+部分[\s ]+/, '');
|
|
|
+ const amounts = [level1.gu_tp, level1.gai_tp, level1.yu_tp, level1.ctrl_tp, level1.real_tp].map(value => Number(value) || 0);
|
|
|
chart_quan_data.push({
|
|
|
- name: level1.name,
|
|
|
+ name,
|
|
|
type: 'bar',
|
|
|
- stack: 'total', // 相同 stack 就会堆叠
|
|
|
+ stack: 'total',
|
|
|
+ barWidth: 26,
|
|
|
emphasis: {
|
|
|
focus: 'series'
|
|
|
},
|
|
|
- data: [
|
|
|
- level1.gu_tp ? ZhCalc.round(ZhCalc.div(level1.gu_tp, 10000), 0) : 0,
|
|
|
- level1.gai_tp ? ZhCalc.round(ZhCalc.div(level1.gai_tp, 10000), 0) : 0,
|
|
|
- level1.yu_tp ? ZhCalc.round(ZhCalc.div(level1.yu_tp, 10000), 0) : 0,
|
|
|
- level1.ctrl_tp ? ZhCalc.round(ZhCalc.div(level1.ctrl_tp, 10000), 0) : 0,
|
|
|
- level1.real_tp ? ZhCalc.round(ZhCalc.div(level1.real_tp, 10000), 0) : 0,
|
|
|
- ]
|
|
|
+ data: amounts,
|
|
|
});
|
|
|
-
|
|
|
- totalLevel1_table_data.ctrl_tp = ZhCalc.add(totalLevel1_table_data.ctrl_tp, level1.ctrl_tp ? ZhCalc.round(ZhCalc.div(level1.ctrl_tp, 10000), 0) : 0);
|
|
|
- totalLevel1_table_data.real_tp = ZhCalc.add(totalLevel1_table_data.real_tp, level1.real_tp ? ZhCalc.round(ZhCalc.div(level1.real_tp, 10000), 0) : 0);
|
|
|
-
|
|
|
- table_data.push(`
|
|
|
- <tr>
|
|
|
- <td>${level1.name}</td>
|
|
|
- <td class="text-center">${level1.ctrl_tp ? ZhCalc.round(ZhCalc.div(level1.ctrl_tp, 10000), 0) : 0}</td>
|
|
|
- <td class="text-center">${level1.real_tp ? ZhCalc.round(ZhCalc.div(level1.real_tp, 10000), 0) : 0}</td>
|
|
|
- </tr>`);
|
|
|
- chart_mbsj_data.xData.push(level1.name);
|
|
|
- chart_mbsj_data.ctrlData.push(level1.ctrl_tp ? ZhCalc.round(ZhCalc.div(level1.ctrl_tp, 10000), 0) : 0);
|
|
|
- chart_mbsj_data.realData.push(level1.real_tp ? ZhCalc.round(ZhCalc.div(level1.real_tp, 10000), 0) : 0);
|
|
|
+ stageTotals = stageTotals.map((value, index) => ZhCalc.add(value, amounts[index]));
|
|
|
+ const gaiAmount = ZhCalc.round(ZhCalc.div(amounts[1], 10000), 0) || 0;
|
|
|
+ const ctrlAmount = ZhCalc.round(ZhCalc.div(amounts[3], 10000), 0) || 0;
|
|
|
+ const realAmount = ZhCalc.round(ZhCalc.div(amounts[4], 10000), 0) || 0;
|
|
|
+ totalLevel1_table_data.gai_tp = ZhCalc.add(totalLevel1_table_data.gai_tp, gaiAmount);
|
|
|
+ totalLevel1_table_data.ctrl_tp = ZhCalc.add(totalLevel1_table_data.ctrl_tp, ctrlAmount);
|
|
|
+ totalLevel1_table_data.real_tp = ZhCalc.add(totalLevel1_table_data.real_tp, realAmount);
|
|
|
+ table_data.push(
|
|
|
+ '<tr><td>' + _.escape(name) + '</td><td>' + gaiAmount + '</td><td>' + ctrlAmount + '</td><td>' + realAmount + '</td></tr>'
|
|
|
+ );
|
|
|
+ chart_mbsj_data.xData.push(name);
|
|
|
+ chart_mbsj_data.guData.push(amounts[0]);
|
|
|
+ chart_mbsj_data.yuData.push(amounts[2]);
|
|
|
+ chart_mbsj_data.ctrlData.push(amounts[3]);
|
|
|
+ chart_mbsj_data.realData.push(amounts[4]);
|
|
|
}
|
|
|
}
|
|
|
- table_data.push(`
|
|
|
- <tr>
|
|
|
- <td>公路总造价</td>
|
|
|
- <td class="text-center">${totalLevel1_table_data.ctrl_tp}</td>
|
|
|
- <td class="text-center">${totalLevel1_table_data.real_tp}</td>
|
|
|
- </tr>`);
|
|
|
- table_data.push(`
|
|
|
- <tr>
|
|
|
- <td>设计优化率(%)</td>
|
|
|
- <td class="text-center">${info.ctrl_optimize_rate}</td>
|
|
|
- <td class="text-center">${info.real_optimize_rate}</td>
|
|
|
- </tr>`);
|
|
|
- table_data.push(`
|
|
|
- <tr>
|
|
|
- <td>收益金额</td>
|
|
|
- <td class="text-center">${info.ctrl_profit ? ZhCalc.round(ZhCalc.div(info.ctrl_profit, 10000), 0) : 0}</td>
|
|
|
- <td class="text-center">${info.real_profit ? ZhCalc.round(ZhCalc.div(info.real_profit, 10000), 0) : 0}</td>
|
|
|
- </tr>`);
|
|
|
- const guOption1 = guChart1.getOption();
|
|
|
- guOption1.series[0].data = chart_gu_data;
|
|
|
- guChart1.setOption(guOption1);
|
|
|
- const gaiOption1 = gaiChart1.getOption();
|
|
|
- gaiOption1.series[0].data = chart_gai_data;
|
|
|
- gaiChart1.setOption(gaiOption1);
|
|
|
- const yuOption1 = yuChart1.getOption();
|
|
|
- yuOption1.series[0].data = chart_yu_data;
|
|
|
- yuChart1.setOption(yuOption1);
|
|
|
- const ctrlOption1 = ctrlChart1.getOption();
|
|
|
- ctrlOption1.series[0].data = chart_ctrl_data;
|
|
|
- ctrlChart1.setOption(ctrlOption1);
|
|
|
+ table_data.push(
|
|
|
+ '<tr><td>公路总造价</td><td>' + totalLevel1_table_data.gai_tp + '</td><td>' + totalLevel1_table_data.ctrl_tp + '</td><td>' + totalLevel1_table_data.real_tp + '</td></tr>'
|
|
|
+ );
|
|
|
+ table_data.push(
|
|
|
+ '<tr><td>设计优化率(%)</td><td>—</td><td>' + _.escape(String(info.ctrl_optimize_rate == null ? '—' : info.ctrl_optimize_rate)) + '</td><td>' + _.escape(String(info.real_optimize_rate == null ? '—' : info.real_optimize_rate)) + '</td></tr>'
|
|
|
+ );
|
|
|
+ table_data.push(
|
|
|
+ '<tr><td>收益金额</td><td>—</td><td>' + (ZhCalc.round(ZhCalc.div(info.ctrl_profit || 0, 10000), 0) || 0) + '</td><td>' + (ZhCalc.round(ZhCalc.div(info.real_profit || 0, 10000), 0) || 0) + '</td></tr>'
|
|
|
+ );
|
|
|
const quanOption1 = quanChart1.getOption();
|
|
|
+ quanOption1.legend[0].data = chart_quan_data.map(item => item.name);
|
|
|
+ chart_quan_data.push({
|
|
|
+ name: '阶段总投资',
|
|
|
+ type: 'scatter',
|
|
|
+ symbolSize: 0,
|
|
|
+ silent: true,
|
|
|
+ tooltip: { show: false },
|
|
|
+ label: {
|
|
|
+ show: true,
|
|
|
+ position: 'top',
|
|
|
+ color: '#fff',
|
|
|
+ formatter: function (params) {
|
|
|
+ return formatInvestmentAmount(params.value[1]);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data: stageTotals.map((value, index) => [index, value]),
|
|
|
+ z: 10,
|
|
|
+ });
|
|
|
quanOption1.series = chart_quan_data;
|
|
|
- quanChart1.setOption(quanOption1);
|
|
|
-
|
|
|
+ quanChart1.setOption(quanOption1, true);
|
|
|
$('#level1-data').html(table_data.join(''));
|
|
|
|
|
|
+ const gusjOption1 = gusjChart1.getOption();
|
|
|
+ gusjOption1.xAxis[0].data = chart_mbsj_data.xData;
|
|
|
+ gusjOption1.series[0].data = chart_mbsj_data.guData;
|
|
|
+ gusjOption1.series[1].data = chart_mbsj_data.realData;
|
|
|
+ gusjChart1.setOption(gusjOption1);
|
|
|
+ const yusjOption1 = yusjChart1.getOption();
|
|
|
+ yusjOption1.xAxis[0].data = chart_mbsj_data.xData;
|
|
|
+ yusjOption1.series[0].data = chart_mbsj_data.yuData;
|
|
|
+ yusjOption1.series[1].data = chart_mbsj_data.realData;
|
|
|
+ yusjChart1.setOption(yusjOption1);
|
|
|
const mbsjOption1 = mbsjChart1.getOption();
|
|
|
- chart_mbsj_data.xData.push('收益金额');
|
|
|
- chart_mbsj_data.ctrlData.push(info.ctrl_profit ? ZhCalc.round(ZhCalc.div(info.ctrl_profit, 10000), 0) : 0);
|
|
|
- chart_mbsj_data.realData.push(info.real_profit ? ZhCalc.round(ZhCalc.div(info.real_profit, 10000), 0) : 0);
|
|
|
- mbsjOption1.xAxis[0].data = chart_mbsj_data.xData;
|
|
|
- mbsjOption1.series[0].data = chart_mbsj_data.ctrlData;
|
|
|
- mbsjOption1.series[1].data = chart_mbsj_data.realData;
|
|
|
+ mbsjOption1.xAxis[0].data = chart_mbsj_data.xData.concat('收益金额');
|
|
|
+ mbsjOption1.series[0].data = chart_mbsj_data.ctrlData.concat(Number(info.ctrl_profit) || 0);
|
|
|
+ mbsjOption1.series[1].data = chart_mbsj_data.realData.concat(Number(info.real_profit) || 0);
|
|
|
mbsjChart1.setOption(mbsjOption1);
|
|
|
}
|
|
|
|
|
|
function setRightTenderEchart(tenders) {
|
|
|
- for (const t in tenders) {
|
|
|
- const tendera = tenders[t] ? tenders[t].a : null;
|
|
|
+ for (let t = 1; t <= 4; t++) {
|
|
|
+ const tendera = tenders && tenders[t] ? tenders[t].a : null;
|
|
|
const chart_data = {
|
|
|
contract_price: [],
|
|
|
end_gather_tp: [],
|
|
|
@@ -1018,20 +911,18 @@
|
|
|
$('#tender'+ t + '_name').text(tendera.name);
|
|
|
$('#tender'+ t + '_name').attr('data-original-title', tendera.name);
|
|
|
calculateTender(tendera);
|
|
|
- chart_data.contract_price.push(ZhCalc.round(ZhCalc.div(tendera.contract_price, 10000), 0) || 0);
|
|
|
- chart_data.end_gather_tp.push(ZhCalc.round(ZhCalc.div(tendera.end_gather_tp, 10000), 0) || 0);
|
|
|
- // chart_data.end_profit_tp.push(tendera.end_gather_tp || 0);
|
|
|
+ chart_data.contract_price.push(Number(tendera.contract_price) || 0);
|
|
|
+ chart_data.end_gather_tp.push(Number(tendera.end_gather_tp) || 0);
|
|
|
const tenderb = tenders[t] ? tenders[t].b : null;
|
|
|
if (tenderb) {
|
|
|
calculateTender(tenderb);
|
|
|
- const profit = ZhCalc.div(ZhCalc.sub(tendera.end_gather_tp, tenderb.end_gather_tp), 10000);
|
|
|
- chart_data.end_profit_tp.push(ZhCalc.round(profit, 0) || 0);
|
|
|
+ chart_data.end_profit_tp.push(ZhCalc.sub(tendera.end_gather_tp, tenderb.end_gather_tp));
|
|
|
} else {
|
|
|
- const profit = ZhCalc.div(ZhCalc.sub(0, tenderb.end_gather_tp), 10000);
|
|
|
- chart_data.end_profit_tp.push(ZhCalc.round(profit, 0) || 0);
|
|
|
+ chart_data.end_profit_tp.push(Number(tendera.end_gather_tp) || 0);
|
|
|
}
|
|
|
} else {
|
|
|
$('#tender'+ t + '_name').text('');
|
|
|
+ $('#tender'+ t + '_name').attr('data-original-title', '');
|
|
|
}
|
|
|
const chartOption = tenderChart[`chart${t}`].getOption();
|
|
|
chartOption.series[0].data = chart_data.contract_price;
|
|
|
@@ -1098,4 +989,61 @@
|
|
|
return 100;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ function formatInvestmentAmount(value) {
|
|
|
+ const amount = Number(value) || 0;
|
|
|
+ if (Math.abs(amount) >= 100000000) {
|
|
|
+ return ZhCalc.round(ZhCalc.div(amount, 100000000), 2) + '亿';
|
|
|
+ }
|
|
|
+ if (Math.abs(amount) >= 10000) {
|
|
|
+ return ZhCalc.round(ZhCalc.div(amount, 10000), 2) + '万';
|
|
|
+ }
|
|
|
+ return ZhCalc.round(amount, 2) || 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function formatInvestmentTooltip(params) {
|
|
|
+ const items = Array.isArray(params) ? params : [params];
|
|
|
+ const visibleItems = items.filter(item => item.seriesName !== '阶段总投资');
|
|
|
+ if (!visibleItems.length) return '';
|
|
|
+ const lines = [_.escape(String(visibleItems[0].axisValueLabel || visibleItems[0].name || ''))];
|
|
|
+ for (const item of visibleItems) {
|
|
|
+ const value = Array.isArray(item.value) ? item.value[1] : item.value;
|
|
|
+ const amount = (Number(value) || 0).toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
|
|
+ lines.push((item.marker || '') + _.escape(item.seriesName) + ':' + amount + '元');
|
|
|
+ }
|
|
|
+ return lines.join('<br>');
|
|
|
+ }
|
|
|
+
|
|
|
+ function fitInvestmentComparisonLabels(chart) {
|
|
|
+ const option = chart.getOption();
|
|
|
+ const count = option.xAxis[0].data.length || 1;
|
|
|
+ let columnWidth = (chart.getWidth() - 80) / count;
|
|
|
+ if (count > 1) {
|
|
|
+ const first = chart.convertToPixel({ xAxisIndex: 0 }, 0);
|
|
|
+ const second = chart.convertToPixel({ xAxisIndex: 0 }, 1);
|
|
|
+ if (Number.isFinite(first) && Number.isFinite(second) && second > first) {
|
|
|
+ columnWidth = second - first;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const labelWidth = Math.max(24, Math.floor(columnWidth - 12));
|
|
|
+ const length = Math.min(6, Math.max(2, Math.floor(labelWidth / 12)));
|
|
|
+ chart.setOption({
|
|
|
+ xAxis: [{
|
|
|
+ axisLabel: {
|
|
|
+ fontSize: 12,
|
|
|
+ lineHeight: 16,
|
|
|
+ formatter: function (value) {
|
|
|
+ if (value.length <= length) return value;
|
|
|
+ const remaining = value.substring(length);
|
|
|
+ return value.substring(0, length) + '\n' + (remaining.length > length ? remaining.substring(0, length - 1) + '…' : remaining);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }]
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function formatInvestmentBarLabel(params) {
|
|
|
+ const amount = Number(params.value) || 0;
|
|
|
+ return amount === 0 ? '' : formatInvestmentAmount(amount);
|
|
|
+ }
|
|
|
</script>
|