大屏页面初始化
This commit is contained in:
@@ -41,7 +41,7 @@ let myChart = null
|
||||
let resizeObserver = null
|
||||
let resizeHandler = null
|
||||
let seriesStatus = {
|
||||
'待完成': true,
|
||||
'待开始': true,
|
||||
'进行中': true,
|
||||
'已完成': true
|
||||
}
|
||||
@@ -79,7 +79,7 @@ function calculateTotal() {
|
||||
|
||||
return xAxisData.map((_, index) => {
|
||||
let total = 0
|
||||
if (seriesStatus['待完成']) total += index01Data[index]
|
||||
if (seriesStatus['待开始']) total += index01Data[index]
|
||||
if (seriesStatus['进行中']) total += index02Data[index]
|
||||
if (seriesStatus['已完成']) total += index03Data[index]
|
||||
return total
|
||||
@@ -116,7 +116,7 @@ function renderChart() {
|
||||
itemWidth: 14,
|
||||
itemHeight: 14,
|
||||
itemGap: 20,
|
||||
data: ['待完成', '进行中', '已完成'],
|
||||
data: ['待开始', '进行中', '已完成'],
|
||||
selected: seriesStatus,
|
||||
selectable: true
|
||||
},
|
||||
@@ -136,13 +136,11 @@ function renderChart() {
|
||||
html += `<table style="width: 100%; border-collapse: collapse; font-size: 12px;">`
|
||||
|
||||
html += `<tr style="background: #f5f7fa;">
|
||||
<th style="padding: 6px; border: 1px solid #e6e6e6; text-align: center;">状态/数值</th>
|
||||
${validParams.map(param => `<th style="padding: 6px; border: 1px solid #e6e6e6; text-align: center;">${param.seriesName}</th>`).join('')}
|
||||
<th style="padding: 6px; border: 1px solid #e6e6e6; text-align: center;">总数</th>
|
||||
</tr>`
|
||||
|
||||
html += `<tr>
|
||||
<td style="padding: 6px; border: 1px solid #e6e6e6; text-align: center; color: #606266;">数量</td>
|
||||
${validParams.map(param => `<td style="padding: 6px; border: 1px solid #e6e6e6; text-align: center; color: #303133;">${param.value}</td>`).join('')}
|
||||
<td style="padding: 6px; border: 1px solid #e6e6e6; text-align: center; color: #303133; font-weight: bold;">${total}</td>
|
||||
</tr>`
|
||||
@@ -196,7 +194,7 @@ function renderChart() {
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '待完成',
|
||||
name: '待开始',
|
||||
type: 'bar',
|
||||
stack: 'total',
|
||||
data: index01Data,
|
||||
|
||||
Reference in New Issue
Block a user