|
@@ -2,9 +2,23 @@
|
|
|
<div class="charts">
|
|
<div class="charts">
|
|
|
<div class="card">
|
|
<div class="card">
|
|
|
<div class="t">产销采月度综合趋势(M07~M08)</div>
|
|
<div class="t">产销采月度综合趋势(M07~M08)</div>
|
|
|
|
|
+ <!-- 口径文案:三段分别对应绿柱 / 橙柱 / 红折线,与后端披露的含税 / 不含税 / 数量口径达成率一致 -->
|
|
|
<div class="d">
|
|
<div class="d">
|
|
|
- 绿柱=营业收入、橙柱=采购支出(万元,左轴)|红折线=产销达成率(右轴)
|
|
|
|
|
|
|
+ 绿柱=营业收入(含税,与 M01 同口径)、橙柱=采购支出(不含税)、红线=产销达成率(右轴 %,数量口径)
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <!-- 口径说明:后端 dataReason 存在时展示,折叠态一行省略号 + title 全文,点击展开;
|
|
|
|
|
+ 字段缺失时 v-if 直接降级不渲染,不报错 -->
|
|
|
|
|
+ <div
|
|
|
|
|
+ v-if="dataReason"
|
|
|
|
|
+ class="trend-reason"
|
|
|
|
|
+ :class="{ 'is-open': reasonOpen }"
|
|
|
|
|
+ :title="dataReason"
|
|
|
|
|
+ @click="reasonOpen = !reasonOpen"
|
|
|
|
|
+ >
|
|
|
|
|
+ <span class="trend-reason-label">口径说明:</span>{{ reasonOpen ? dataReason : dataReasonShort }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <!-- 单月档提示:后端按月聚合,只有一个月时柱状为当月累计,不做日均外推 -->
|
|
|
|
|
+ <div v-if="isSingleMonth && hasCombo" class="trend-note">本月档按月聚合,柱为当月累计</div>
|
|
|
<v-chart v-if="hasCombo" class="chart chart-combo" :option="comboOption" autoresize />
|
|
<v-chart v-if="hasCombo" class="chart chart-combo" :option="comboOption" autoresize />
|
|
|
<div v-else class="chart-empty">暂无数据</div>
|
|
<div v-else class="chart-empty">暂无数据</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -28,6 +42,12 @@
|
|
|
|
|
|
|
|
const COLORS = { revenue: '#2e9e6b', purchase: '#e8862c', rate: '#d84848', payable: '#d9b23a' };
|
|
const COLORS = { revenue: '#2e9e6b', purchase: '#e8862c', rate: '#d84848', payable: '#d9b23a' };
|
|
|
|
|
|
|
|
|
|
+ // 控制台日志统一前缀,便于在看板里按 [eos-trend] 过滤
|
|
|
|
|
+ const LOG = '[eos-trend]';
|
|
|
|
|
+ // dataReason 进控制台的最大字符数,避免后端长文本刷屏
|
|
|
|
|
+ const REASON_LOG_MAX = 200;
|
|
|
|
|
+
|
|
|
|
|
+ // 单点取值:空串 / null / undefined / 非数字统一归一成 null(保留空值,不补 0)
|
|
|
function num(v) {
|
|
function num(v) {
|
|
|
if (v === null || v === undefined || v === '') {
|
|
if (v === null || v === undefined || v === '') {
|
|
|
return null;
|
|
return null;
|
|
@@ -36,14 +56,78 @@
|
|
|
return Number.isNaN(n) ? null : n;
|
|
return Number.isNaN(n) ? null : n;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 整列归一:非数组降级为空数组,元素逐个走 num(),null 保持 null 以便折线断开
|
|
|
function toSeries(list) {
|
|
function toSeries(list) {
|
|
|
return Array.isArray(list) ? list.map(num) : [];
|
|
return Array.isArray(list) ? list.map(num) : [];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 判断一列是否存在有效值(null 不算有效值)
|
|
|
function hasValue(list) {
|
|
function hasValue(list) {
|
|
|
return list.some((v) => v !== null);
|
|
return list.some((v) => v !== null);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 统计一列中的空值个数:为 0 说明后端把没有数据的月份补了 0(会画成 0 柱/0 点)
|
|
|
|
|
+ function nullCount(list) {
|
|
|
|
|
+ return list.filter((v) => v === null).length;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 保留一位小数,去掉浮点尾差
|
|
|
|
|
+ function round1(v) {
|
|
|
|
|
+ return Math.round(Number(v) * 10) / 10;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 左轴金额口径:万元(营业收入含税、采购支出不含税,均由后端换算好)
|
|
|
|
|
+ function fmtWan(v) {
|
|
|
|
|
+ if (v === null || v === undefined || v === '' || Number.isNaN(Number(v))) {
|
|
|
|
|
+ return '—';
|
|
|
|
|
+ }
|
|
|
|
|
+ return round1(v) + ' 万元';
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 右轴达成率口径:百分比,固定一位小数
|
|
|
|
|
+ function fmtRate(v) {
|
|
|
|
|
+ if (v === null || v === undefined || v === '' || Number.isNaN(Number(v))) {
|
|
|
|
|
+ return '—';
|
|
|
|
|
+ }
|
|
|
|
|
+ return Number(v).toFixed(1) + '%';
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // series 名 → 单位:柱(营业收入/采购支出)走万元,折线(产销达成率)走 %
|
|
|
|
|
+ const UNIT_BY_SERIES = { 营业收入: '万元', 采购支出: '万元', 产销达成率: '%' };
|
|
|
|
|
+
|
|
|
|
|
+ // 按 series 名选单位格式化,未知 series 默认按万元展示
|
|
|
|
|
+ function fmtByUnit(seriesName, v) {
|
|
|
|
|
+ return UNIT_BY_SERIES[seriesName] === '%' ? fmtRate(v) : fmtWan(v);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 组合图 tooltip:axis 触发 + formatter 回调,逐行按 series 分派单位,
|
|
|
|
|
+ // 空值月份不渲染成 0,统一收敛为「本月无数据」提示
|
|
|
|
|
+ function comboFormatter(params) {
|
|
|
|
|
+ const list = Array.isArray(params) ? params : [params];
|
|
|
|
|
+ if (!list.length) {
|
|
|
|
|
+ return '';
|
|
|
|
|
+ }
|
|
|
|
|
+ const head =
|
|
|
|
|
+ '<div style="margin-bottom:4px;font-weight:600">' +
|
|
|
|
|
+ (list[0].axisValueLabel || list[0].axisValue || '') +
|
|
|
|
|
+ '</div>';
|
|
|
|
|
+ const rows = list
|
|
|
|
|
+ .filter((p) => p.value !== null && p.value !== undefined && p.value !== '-')
|
|
|
|
|
+ .map(
|
|
|
|
|
+ (p) =>
|
|
|
|
|
+ '<div style="line-height:18px">' +
|
|
|
|
|
+ p.marker +
|
|
|
|
|
+ p.seriesName +
|
|
|
|
|
+ ':' +
|
|
|
|
|
+ fmtByUnit(p.seriesName, p.value) +
|
|
|
|
|
+ '</div>'
|
|
|
|
|
+ );
|
|
|
|
|
+ if (!rows.length) {
|
|
|
|
|
+ return head + '<div style="color:#9aa5b5">本月无数据</div>';
|
|
|
|
|
+ }
|
|
|
|
|
+ return head + rows.join('');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
export default {
|
|
export default {
|
|
|
name: 'TrendCharts',
|
|
name: 'TrendCharts',
|
|
|
components: { VChart },
|
|
components: { VChart },
|
|
@@ -51,44 +135,98 @@
|
|
|
trend: { type: Object, default: null },
|
|
trend: { type: Object, default: null },
|
|
|
arAp: { type: Object, default: null }
|
|
arAp: { type: Object, default: null }
|
|
|
},
|
|
},
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ // 口径说明是否展开(折叠态一行省略号,展开显示 dataReason 全文)
|
|
|
|
|
+ reasonOpen: false
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
computed: {
|
|
computed: {
|
|
|
|
|
+ // 组合图 X 轴:月份分类(后端按月聚合,granularity=month,前端不做重聚合)
|
|
|
months() {
|
|
months() {
|
|
|
const list = this.trend && this.trend.months;
|
|
const list = this.trend && this.trend.months;
|
|
|
return Array.isArray(list) ? list : [];
|
|
return Array.isArray(list) ? list : [];
|
|
|
},
|
|
},
|
|
|
|
|
+ // 绿柱:营业收入,单位万元,含税口径(与 M01 本期营业收入同口径)
|
|
|
revenue() {
|
|
revenue() {
|
|
|
return toSeries(this.trend && this.trend.revenue);
|
|
return toSeries(this.trend && this.trend.revenue);
|
|
|
},
|
|
},
|
|
|
|
|
+ // 橙柱:采购支出,单位万元,不含税口径
|
|
|
purchase() {
|
|
purchase() {
|
|
|
return toSeries(this.trend && this.trend.purchase);
|
|
return toSeries(this.trend && this.trend.purchase);
|
|
|
},
|
|
},
|
|
|
|
|
+ // 红折线:产销达成率,单位 %,数量口径,挂在右轴
|
|
|
achieveRate() {
|
|
achieveRate() {
|
|
|
return toSeries(this.trend && this.trend.achieveRate);
|
|
return toSeries(this.trend && this.trend.achieveRate);
|
|
|
},
|
|
},
|
|
|
|
|
+ // 单月档:月份只有一个时视为「本月档」,柱为当月累计
|
|
|
|
|
+ isSingleMonth() {
|
|
|
|
|
+ return this.months.length === 1;
|
|
|
|
|
+ },
|
|
|
|
|
+ // 右轴上限:max(100, 达成率最大值向上取整到 10 的倍数),
|
|
|
|
|
+ // 下限 100 保证 100% 参考线在轴内,上限抬升避免 >100% 的点被静默截断
|
|
|
|
|
+ rateAxisMax() {
|
|
|
|
|
+ const values = this.achieveRate.filter((v) => v !== null);
|
|
|
|
|
+ if (!values.length) {
|
|
|
|
|
+ return 100;
|
|
|
|
|
+ }
|
|
|
|
|
+ const ceilTo10 = Math.ceil(Math.max.apply(null, values) / 10) * 10;
|
|
|
|
|
+ return Math.max(100, ceilTo10);
|
|
|
|
|
+ },
|
|
|
|
|
+ // 组合图是否有可画数据:月份非空 且 三序列至少一个有效值
|
|
|
hasCombo() {
|
|
hasCombo() {
|
|
|
return (
|
|
return (
|
|
|
this.months.length > 0 &&
|
|
this.months.length > 0 &&
|
|
|
(hasValue(this.revenue) || hasValue(this.purchase) || hasValue(this.achieveRate))
|
|
(hasValue(this.revenue) || hasValue(this.purchase) || hasValue(this.achieveRate))
|
|
|
);
|
|
);
|
|
|
},
|
|
},
|
|
|
|
|
+ // 「暂无数据」的确切原因,空串表示有数据可画;用于 console.warn 定位后端字段缺失
|
|
|
|
|
+ comboEmptyReason() {
|
|
|
|
|
+ if (!this.trend) {
|
|
|
|
|
+ return '接口未返回 trend 节点';
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!this.months.length) {
|
|
|
|
|
+ return 'trend.months 为空';
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!hasValue(this.revenue) && !hasValue(this.purchase) && !hasValue(this.achieveRate)) {
|
|
|
|
|
+ return 'revenue/purchase/achieveRate 三序列全为空值';
|
|
|
|
|
+ }
|
|
|
|
|
+ return '';
|
|
|
|
|
+ },
|
|
|
|
|
+ // 后端口径与降级披露原文,缺失或空串时返回空串(模板 v-if 降级,不报错)
|
|
|
|
|
+ dataReason() {
|
|
|
|
|
+ const text = this.trend && this.trend.dataReason;
|
|
|
|
|
+ return typeof text === 'string' ? text.trim() : '';
|
|
|
|
|
+ },
|
|
|
|
|
+ // 折叠态文案:压成单行并截断,完整内容由 title 属性承担
|
|
|
|
|
+ dataReasonShort() {
|
|
|
|
|
+ const oneLine = this.dataReason.replace(/\s+/g, ' ');
|
|
|
|
|
+ return oneLine.length > 60 ? oneLine.slice(0, 60) + '…' : oneLine;
|
|
|
|
|
+ },
|
|
|
|
|
+ // M09~M11 卡片的月份轴(应收应付资金趋势),与上面组合图互不影响
|
|
|
arMonths() {
|
|
arMonths() {
|
|
|
const list = this.arAp && this.arAp.months;
|
|
const list = this.arAp && this.arAp.months;
|
|
|
return Array.isArray(list) ? list : [];
|
|
return Array.isArray(list) ? list : [];
|
|
|
},
|
|
},
|
|
|
|
|
+ // M09 绿线:应收账款余额(万元)
|
|
|
receivable() {
|
|
receivable() {
|
|
|
return toSeries(this.arAp && this.arAp.receivable);
|
|
return toSeries(this.arAp && this.arAp.receivable);
|
|
|
},
|
|
},
|
|
|
|
|
+ // M10 黄线:应付账款余额(万元)
|
|
|
payable() {
|
|
payable() {
|
|
|
return toSeries(this.arAp && this.arAp.payable);
|
|
return toSeries(this.arAp && this.arAp.payable);
|
|
|
},
|
|
},
|
|
|
|
|
+ // M11 红线:资金安全阈值(万元,单一配置值,接口未给时为 null 不画线)
|
|
|
safetyLine() {
|
|
safetyLine() {
|
|
|
return this.arAp ? num(this.arAp.cashSafetyLine) : null;
|
|
return this.arAp ? num(this.arAp.cashSafetyLine) : null;
|
|
|
},
|
|
},
|
|
|
|
|
+ // 应收应付图是否有可画数据
|
|
|
hasArAp() {
|
|
hasArAp() {
|
|
|
return (
|
|
return (
|
|
|
this.arMonths.length > 0 && (hasValue(this.receivable) || hasValue(this.payable))
|
|
this.arMonths.length > 0 && (hasValue(this.receivable) || hasValue(this.payable))
|
|
|
);
|
|
);
|
|
|
},
|
|
},
|
|
|
|
|
+ // 应收应付卡片副标题:线色与口径说明,阈值标签优先用后端下发的 cashLineLabel
|
|
|
lineSubTitle() {
|
|
lineSubTitle() {
|
|
|
const label = this.arAp && this.arAp.cashLineLabel;
|
|
const label = this.arAp && this.arAp.cashLineLabel;
|
|
|
const tail =
|
|
const tail =
|
|
@@ -96,16 +234,43 @@
|
|
|
`红线=资金安全阈值 ${this.safetyLine === null ? '—' : this.safetyLine} 万(参数可配)`;
|
|
`红线=资金安全阈值 ${this.safetyLine === null ? '—' : this.safetyLine} 万(参数可配)`;
|
|
|
return `绿线=应收账款余额、黄线=应付账款余额(万元)|${tail}`;
|
|
return `绿线=应收账款余额、黄线=应付账款余额(万元)|${tail}`;
|
|
|
},
|
|
},
|
|
|
|
|
+ // 双轴组合图 option:左轴万元(两组柱),右轴 %(达成率折线)
|
|
|
comboOption() {
|
|
comboOption() {
|
|
|
|
|
+ // 排查日志①:构造期快照——月份数、三序列长度与空值数、是否单月档
|
|
|
|
|
+ console.info(LOG + ' 构造产销采月度综合趋势', {
|
|
|
|
|
+ 月份数: this.months.length,
|
|
|
|
|
+ 营业收入: { 长度: this.revenue.length, 空值数: nullCount(this.revenue) },
|
|
|
|
|
+ 采购支出: { 长度: this.purchase.length, 空值数: nullCount(this.purchase) },
|
|
|
|
|
+ 产销达成率: { 长度: this.achieveRate.length, 空值数: nullCount(this.achieveRate) },
|
|
|
|
|
+ 单月档: this.isSingleMonth,
|
|
|
|
|
+ // 后端单位与聚合粒度:缺省即说明新契约字段未下发,前端按固定文案降级
|
|
|
|
|
+ 后端单位: {
|
|
|
|
|
+ 收入: (this.trend && this.trend.revenueUnit) || '缺省',
|
|
|
|
|
+ 达成率: (this.trend && this.trend.achieveUnit) || '缺省'
|
|
|
|
|
+ },
|
|
|
|
|
+ 后端粒度: (this.trend && this.trend.granularity) || '缺省'
|
|
|
|
|
+ });
|
|
|
|
|
+ // 排查日志②:达成率 >100% 时右轴必须抬升,否则点位会被静默截断在顶格
|
|
|
|
|
+ this.achieveRate.forEach((v, i) => {
|
|
|
|
|
+ if (v !== null && v > 100) {
|
|
|
|
|
+ console.warn(LOG + ' 产销达成率超过 100%,右轴已抬升', {
|
|
|
|
|
+ 月份: this.months[i] || '下标 ' + i,
|
|
|
|
|
+ 值: v
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
return {
|
|
return {
|
|
|
grid: { left: 6, right: 10, top: 32, bottom: 4, containLabel: true },
|
|
grid: { left: 6, right: 10, top: 32, bottom: 4, containLabel: true },
|
|
|
|
|
+ // tooltip:axis 触发,命中同一月份时柱显示「xxx 万元」、折线显示「xx.x%」
|
|
|
tooltip: {
|
|
tooltip: {
|
|
|
trigger: 'axis',
|
|
trigger: 'axis',
|
|
|
axisPointer: { type: 'shadow' },
|
|
axisPointer: { type: 'shadow' },
|
|
|
|
|
+ formatter: comboFormatter,
|
|
|
backgroundColor: '#fff',
|
|
backgroundColor: '#fff',
|
|
|
borderColor: '#e3e8f0',
|
|
borderColor: '#e3e8f0',
|
|
|
textStyle: { color: '#2b3444', fontSize: 12 }
|
|
textStyle: { color: '#2b3444', fontSize: 12 }
|
|
|
},
|
|
},
|
|
|
|
|
+ // X 轴:月份分类,数据直接取后端 months,不在前端重聚合
|
|
|
xAxis: {
|
|
xAxis: {
|
|
|
type: 'category',
|
|
type: 'category',
|
|
|
data: this.months,
|
|
data: this.months,
|
|
@@ -115,6 +280,7 @@
|
|
|
},
|
|
},
|
|
|
yAxis: [
|
|
yAxis: [
|
|
|
{
|
|
{
|
|
|
|
|
+ // 左轴:金额轴,单位万元,服务营业收入(含税)与采购支出(不含税)两组柱
|
|
|
type: 'value',
|
|
type: 'value',
|
|
|
splitNumber: 4,
|
|
splitNumber: 4,
|
|
|
name: '万元',
|
|
name: '万元',
|
|
@@ -123,24 +289,29 @@
|
|
|
splitLine: { lineStyle: { color: '#eef1f6' } }
|
|
splitLine: { lineStyle: { color: '#eef1f6' } }
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
|
|
+ // 右轴:产销达成率(%),数量口径;min 固定 0,max 动态且下限 100
|
|
|
type: 'value',
|
|
type: 'value',
|
|
|
min: 0,
|
|
min: 0,
|
|
|
- max: 100,
|
|
|
|
|
|
|
+ max: this.rateAxisMax,
|
|
|
splitNumber: 4,
|
|
splitNumber: 4,
|
|
|
- axisLabel: { show: false },
|
|
|
|
|
|
|
+ // 右轴刻度必须可见并带 % 后缀,否则读数无法区分左右轴
|
|
|
|
|
+ axisLabel: { show: true, formatter: '{value}%', color: '#9aa5b5', fontSize: 11 },
|
|
|
splitLine: { show: false }
|
|
splitLine: { show: false }
|
|
|
}
|
|
}
|
|
|
],
|
|
],
|
|
|
series: [
|
|
series: [
|
|
|
{
|
|
{
|
|
|
|
|
+ // 绿柱:营业收入(万元,含税,与 M01 同口径)
|
|
|
name: '营业收入',
|
|
name: '营业收入',
|
|
|
type: 'bar',
|
|
type: 'bar',
|
|
|
barWidth: 14,
|
|
barWidth: 14,
|
|
|
barGap: '25%',
|
|
barGap: '25%',
|
|
|
itemStyle: { color: COLORS.revenue, borderRadius: [2, 2, 0, 0] },
|
|
itemStyle: { color: COLORS.revenue, borderRadius: [2, 2, 0, 0] },
|
|
|
|
|
+ // 空值月份保持 null,不补 0,柱子留空不画
|
|
|
data: this.revenue
|
|
data: this.revenue
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
|
|
+ // 橙柱:采购支出(万元,不含税)
|
|
|
name: '采购支出',
|
|
name: '采购支出',
|
|
|
type: 'bar',
|
|
type: 'bar',
|
|
|
barWidth: 14,
|
|
barWidth: 14,
|
|
@@ -148,6 +319,7 @@
|
|
|
data: this.purchase
|
|
data: this.purchase
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
|
|
+ // 红折线:产销达成率(%,数量口径),挂右轴;null 保持断开不连线
|
|
|
name: '产销达成率',
|
|
name: '产销达成率',
|
|
|
type: 'line',
|
|
type: 'line',
|
|
|
yAxisIndex: 1,
|
|
yAxisIndex: 1,
|
|
@@ -169,9 +341,11 @@
|
|
|
]
|
|
]
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
+ // M09~M11 折线图 option:单左轴万元,series/数据/坐标轴语义与 HEAD 保持一致
|
|
|
lineOption() {
|
|
lineOption() {
|
|
|
const series = [
|
|
const series = [
|
|
|
{
|
|
{
|
|
|
|
|
+ // 绿线:应收账款余额(万元)
|
|
|
name: '应收账款余额',
|
|
name: '应收账款余额',
|
|
|
type: 'line',
|
|
type: 'line',
|
|
|
symbol: 'circle',
|
|
symbol: 'circle',
|
|
@@ -181,6 +355,7 @@
|
|
|
data: this.receivable
|
|
data: this.receivable
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
|
|
+ // 黄线:应付账款余额(万元)
|
|
|
name: '应付账款余额',
|
|
name: '应付账款余额',
|
|
|
type: 'line',
|
|
type: 'line',
|
|
|
symbol: 'circle',
|
|
symbol: 'circle',
|
|
@@ -192,6 +367,7 @@
|
|
|
];
|
|
];
|
|
|
if (this.safetyLine !== null) {
|
|
if (this.safetyLine !== null) {
|
|
|
series.push({
|
|
series.push({
|
|
|
|
|
+ // 红虚线:资金安全阈值(万元),按月份长度铺平成水平线
|
|
|
name: '资金安全阈值',
|
|
name: '资金安全阈值',
|
|
|
type: 'line',
|
|
type: 'line',
|
|
|
symbol: 'none',
|
|
symbol: 'none',
|
|
@@ -208,6 +384,7 @@
|
|
|
borderColor: '#e3e8f0',
|
|
borderColor: '#e3e8f0',
|
|
|
textStyle: { color: '#2b3444', fontSize: 12 }
|
|
textStyle: { color: '#2b3444', fontSize: 12 }
|
|
|
},
|
|
},
|
|
|
|
|
+ // X 轴:月份分类(应收应付口径),与组合图月份数组彼此独立
|
|
|
xAxis: {
|
|
xAxis: {
|
|
|
type: 'category',
|
|
type: 'category',
|
|
|
boundaryGap: false,
|
|
boundaryGap: false,
|
|
@@ -218,6 +395,7 @@
|
|
|
},
|
|
},
|
|
|
yAxis: [
|
|
yAxis: [
|
|
|
{
|
|
{
|
|
|
|
|
+ // 单左轴:金额轴,单位万元(应收余额 / 应付余额 / 安全阈值同单位)
|
|
|
type: 'value',
|
|
type: 'value',
|
|
|
splitNumber: 4,
|
|
splitNumber: 4,
|
|
|
name: '万元',
|
|
name: '万元',
|
|
@@ -229,6 +407,53 @@
|
|
|
series
|
|
series
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
|
|
+ },
|
|
|
|
|
+ watch: {
|
|
|
|
|
+ // trend 变化(含首屏 immediate)时打印一次数据可用性结论:
|
|
|
|
|
+ // 无数据时说明「暂无数据」的原因;有 dataReason 时打印截断后的口径披露
|
|
|
|
|
+ trend: {
|
|
|
|
|
+ immediate: true,
|
|
|
|
|
+ handler() {
|
|
|
|
|
+ if (this.comboEmptyReason) {
|
|
|
|
|
+ console.warn(LOG + ' 暂无可绘制的月度趋势数据:' + this.comboEmptyReason);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.dataReason) {
|
|
|
|
|
+ const oneLine = this.dataReason.replace(/\s+/g, ' ');
|
|
|
|
|
+ console.info(
|
|
|
|
|
+ LOG + ' 后端口径披露(dataReason)',
|
|
|
|
|
+ oneLine.length > REASON_LOG_MAX ? oneLine.slice(0, REASON_LOG_MAX) + '…' : oneLine
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
|
|
|
+
|
|
|
|
|
+<style scoped>
|
|
|
|
|
+ .trend-reason {
|
|
|
|
|
+ margin-top: 2px;
|
|
|
|
|
+ color: #7a8699;
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ line-height: 18px;
|
|
|
|
|
+ white-space: nowrap;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .trend-reason.is-open {
|
|
|
|
|
+ white-space: normal;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .trend-reason-label {
|
|
|
|
|
+ color: #9aa5b5;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .trend-note {
|
|
|
|
|
+ margin-top: 2px;
|
|
|
|
|
+ color: #9aa5b5;
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ line-height: 18px;
|
|
|
|
|
+ }
|
|
|
|
|
+</style>
|