1.31 财务分析,财务数据模块完善,产业链桑基图展示
This commit is contained in:
@@ -35,12 +35,40 @@ const _sfc_main = {
|
||||
this.endDateStr = this.selectDateStr = `${currentYear}-${currentMonth > 9 ? currentMonth : "0" + currentMonth}-${currentDay > 9 ? currentDay : "0" + currentDay}`;
|
||||
this.getYesterdayDateData();
|
||||
this.generateMonthDateListData();
|
||||
this.emitDateChange(currentYear, currentMonth, currentDay, this.getTodayItem(currentYear, currentMonth, currentDay));
|
||||
this.emitDateChange(
|
||||
currentYear,
|
||||
currentMonth,
|
||||
currentDay,
|
||||
this.getTodayItem(currentYear, currentMonth, currentDay),
|
||||
this.getPrevDayItem(currentYear, currentMonth, currentDay)
|
||||
// 新增上一天数据
|
||||
);
|
||||
},
|
||||
mounted() {
|
||||
this.getCalendarCombinedData();
|
||||
},
|
||||
methods: {
|
||||
// 3. 在日历组件methods中新增getPrevDayItem方法
|
||||
/**
|
||||
* 获取指定日期的上一天数据
|
||||
*/
|
||||
getPrevDayItem(year, month, day) {
|
||||
const currentDate = /* @__PURE__ */ new Date(`${year}-${month}-${day}`);
|
||||
const prevDate = new Date(currentDate.getTime() - 24 * 60 * 60 * 1e3);
|
||||
const prevYear = prevDate.getFullYear();
|
||||
const prevMonth = prevDate.getMonth() + 1;
|
||||
const prevDay = prevDate.getDate();
|
||||
const targetDate = `${prevYear}-${prevMonth > 9 ? prevMonth : "0" + prevMonth}-${prevDay > 9 ? prevDay : "0" + prevDay}`;
|
||||
const currentMonthList = this.monthDateList[this.selectMonthIndex] || [];
|
||||
const localItem = currentMonthList.find((item) => item.date === targetDate) || null;
|
||||
const apiData = this.getCalendarItemByDate(targetDate) || {};
|
||||
return {
|
||||
...localItem,
|
||||
zt_count: apiData.zt_count || 0,
|
||||
top_sector: apiData.top_sector || "-",
|
||||
zaban_rate: apiData.zaban_rate || "0%"
|
||||
};
|
||||
},
|
||||
/**
|
||||
* 获取当天的item数据(合并接口数据)
|
||||
*/
|
||||
@@ -63,14 +91,34 @@ const _sfc_main = {
|
||||
/**
|
||||
* 触发日期变更事件(传递包含接口数据的item)
|
||||
*/
|
||||
emitDateChange(year, month, day, item) {
|
||||
// emitDateChange(year, month, day, item) {
|
||||
// const yearMonth = `${year}-${month > 9 ? month : '0' + month}`;
|
||||
// const fullDate = `${year}-${month > 9 ? month : '0' + month}-${day > 9 ? day : '0' + day}`;
|
||||
// this.$emit('date-change', {
|
||||
// yearMonth,
|
||||
// fullDate,
|
||||
// item: item || { // 兜底:无item时赋值空对象+默认值
|
||||
// date: fullDate,
|
||||
// year,
|
||||
// month,
|
||||
// day,
|
||||
// zt_count: 0,
|
||||
// top_sector: '-',
|
||||
// zaban_rate: '0%'
|
||||
// },
|
||||
// year,
|
||||
// month,
|
||||
// day
|
||||
// });
|
||||
// },
|
||||
emitDateChange(year, month, day, item, prevItem = { zt_count: 0 }) {
|
||||
const yearMonth = `${year}-${month > 9 ? month : "0" + month}`;
|
||||
const fullDate = `${year}-${month > 9 ? month : "0" + month}-${day > 9 ? day : "0" + day}`;
|
||||
this.$emit("date-change", {
|
||||
yearMonth,
|
||||
fullDate,
|
||||
item: item || {
|
||||
// 兜底:无item时赋值空对象+默认值
|
||||
// 兜底:无当前item时赋值空对象+默认值
|
||||
date: fullDate,
|
||||
year,
|
||||
month,
|
||||
@@ -79,6 +127,12 @@ const _sfc_main = {
|
||||
top_sector: "-",
|
||||
zaban_rate: "0%"
|
||||
},
|
||||
prevItem: prevItem || {
|
||||
// 新增:传递上一天数据,兜底默认值
|
||||
zt_count: 0,
|
||||
top_sector: "-",
|
||||
zaban_rate: "0%"
|
||||
},
|
||||
year,
|
||||
month,
|
||||
day
|
||||
@@ -159,18 +213,24 @@ const _sfc_main = {
|
||||
const res = await request_api.calendarCombinedData(param);
|
||||
if (res.success && Array.isArray(res.data)) {
|
||||
this.calendarApiData = res.data;
|
||||
common_vendor.index.__f__("log", "at components/LCCalendar/LCCalendar.vue:258", "日历数据加载成功", this.calendarApiData);
|
||||
if (this.selectDateStr) {
|
||||
const [year, month, day] = this.selectDateStr.split("-").map(Number);
|
||||
this.emitDateChange(year, month, day, this.getTodayItem(year, month, day));
|
||||
this.emitDateChange(
|
||||
year,
|
||||
month,
|
||||
day,
|
||||
this.getTodayItem(year, month, day),
|
||||
this.getPrevDayItem(year, month, day)
|
||||
// 新增上一天数据
|
||||
);
|
||||
}
|
||||
} else {
|
||||
this.calendarApiData = [];
|
||||
common_vendor.index.__f__("warn", "at components/LCCalendar/LCCalendar.vue:266", "日历接口返回数据格式异常", res);
|
||||
common_vendor.index.__f__("warn", "at components/LCCalendar/LCCalendar.vue:330", "日历接口返回数据格式异常", res);
|
||||
}
|
||||
} catch (error) {
|
||||
this.calendarApiData = [];
|
||||
common_vendor.index.__f__("error", "at components/LCCalendar/LCCalendar.vue:270", "获取日历数据失败", error);
|
||||
common_vendor.index.__f__("error", "at components/LCCalendar/LCCalendar.vue:334", "获取日历数据失败", error);
|
||||
}
|
||||
},
|
||||
/**
|
||||
@@ -292,7 +352,7 @@ const _sfc_main = {
|
||||
this.selectYear = year;
|
||||
this.Month = month;
|
||||
this.getCalendarCombinedData();
|
||||
common_vendor.index.__f__("log", "at components/LCCalendar/LCCalendar.vue:405", "点击上个月");
|
||||
common_vendor.index.__f__("log", "at components/LCCalendar/LCCalendar.vue:469", "点击上个月");
|
||||
}
|
||||
},
|
||||
/**
|
||||
@@ -321,7 +381,7 @@ const _sfc_main = {
|
||||
this.selectMonth = year + "年" + month + "月";
|
||||
this.startDateStr = year + "-" + (month > 9 ? month : "0" + month) + "-01";
|
||||
this.endDateStr = year + "-" + (month > 9 ? month : "0" + month) + "-" + lastDay;
|
||||
common_vendor.index.__f__("log", "at components/LCCalendar/LCCalendar.vue:434", "点击下个月");
|
||||
common_vendor.index.__f__("log", "at components/LCCalendar/LCCalendar.vue:498", "点击下个月");
|
||||
this.selectYear = year;
|
||||
this.Month = month;
|
||||
this.getCalendarCombinedData();
|
||||
@@ -338,7 +398,7 @@ const _sfc_main = {
|
||||
this.startDateStr = selectYear + "-" + (selectMonth > 9 ? selectMonth : "0" + selectMonth) + "-01";
|
||||
let lastDayOfMonth = new Date(selectYear, selectMonth, 0);
|
||||
this.endDateStr = selectYear + "-" + (selectMonth > 9 ? selectMonth : "0" + selectMonth) + "-" + lastDayOfMonth.getDate();
|
||||
common_vendor.index.__f__("log", "at components/LCCalendar/LCCalendar.vue:454", "月份变更");
|
||||
common_vendor.index.__f__("log", "at components/LCCalendar/LCCalendar.vue:518", "月份变更");
|
||||
this.selectYear = selectYear;
|
||||
this.Month = selectMonth;
|
||||
this.getCalendarCombinedData();
|
||||
@@ -365,12 +425,53 @@ const _sfc_main = {
|
||||
isWeekend: index % 7 === 0 || index % 7 === 6
|
||||
// 是否周末
|
||||
};
|
||||
const currentDate = new Date(item.date);
|
||||
const prevDate = new Date(currentDate.getTime() - 24 * 60 * 60 * 1e3);
|
||||
const prevYear = prevDate.getFullYear();
|
||||
const prevMonth = prevDate.getMonth() + 1;
|
||||
const prevDay = prevDate.getDate();
|
||||
const prevDateStr = `${prevYear}-${prevMonth > 9 ? prevMonth : "0" + prevMonth}-${prevDay > 9 ? prevDay : "0" + prevDay}`;
|
||||
const prevApiData = this.getCalendarItemByDate(prevDateStr) || {};
|
||||
let prevLocalItem = null;
|
||||
const currentMonthList = this.monthDateList[this.selectMonthIndex] || [];
|
||||
prevLocalItem = currentMonthList.find((i) => i.date === prevDateStr);
|
||||
if (!prevLocalItem) {
|
||||
const prevMonthIndex = this.selectMonthIndex - (prevMonth < item.month ? 1 : 0);
|
||||
const prevMonthList = this.monthDateList[prevMonthIndex] || [];
|
||||
prevLocalItem = prevMonthList.find((i) => i.date === prevDateStr);
|
||||
}
|
||||
const prevMergedItem = {
|
||||
...prevLocalItem || {},
|
||||
zt_count: prevApiData.zt_count || 0,
|
||||
top_sector: prevApiData.top_sector || "-",
|
||||
zaban_rate: prevApiData.zaban_rate || "0%",
|
||||
isWeekend: false
|
||||
// 兜底默认值
|
||||
};
|
||||
this.chgStockData = mergedItem;
|
||||
const [year, month, day] = item.date.split("-").map(Number);
|
||||
this.emitDateChange(year, month, day, mergedItem);
|
||||
common_vendor.index.__f__("log", "at components/LCCalendar/LCCalendar.vue:482", "点击某天(含接口数据)", mergedItem);
|
||||
this.emitDateChange(year, month, day, mergedItem, prevMergedItem);
|
||||
common_vendor.index.__f__("log", "at components/LCCalendar/LCCalendar.vue:580", "点击某天(含接口数据)", { current: mergedItem, prev: prevMergedItem });
|
||||
}
|
||||
}
|
||||
// clickSelectDate(item, index) {
|
||||
// if (!item.isCurrentMonth) return
|
||||
// if (this.selectDateStr != item.date) {
|
||||
// this.selectDateStr = item.date
|
||||
// const apiData = this.getCalendarItemByDate(item.date) || {};
|
||||
// const mergedItem = {
|
||||
// ...item,
|
||||
// zt_count: apiData.zt_count || 0,
|
||||
// top_sector: apiData.top_sector || '-',
|
||||
// zaban_rate: apiData.zaban_rate || '0%',
|
||||
// isWeekend: index % 7 === 0 || index % 7 === 6
|
||||
// };
|
||||
// this.chgStockData = mergedItem;
|
||||
// const [year, month, day] = item.date.split('-').map(Number);
|
||||
// this.emitDateChange(year, month, day, mergedItem);
|
||||
// uni.__f__('log','at components/LCCalendar/LCCalendar.vue:602','点击某天(含接口数据)', mergedItem);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
|
||||
@@ -29,6 +29,7 @@ const _sfc_main = {
|
||||
this.startDateStr = currentYear + "-" + (currentMonth > 9 ? currentMonth : "0" + currentMonth) + "-01";
|
||||
this.endDateStr = this.selectDateStr = currentYear + "-" + (currentMonth > 9 ? currentMonth : "0" + currentMonth) + "-" + (currentDay > 9 ? currentDay : "0" + currentDay);
|
||||
this.generateMonthDateListData();
|
||||
this.$emit("date-change", this.selectDateStr);
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
@@ -42,6 +43,7 @@ const _sfc_main = {
|
||||
let selectMonth = selectDate.getMonth() + 1;
|
||||
let selectDay = selectDate.getDate();
|
||||
this.selectDateStr = selectYear + "-" + (selectMonth > 9 ? selectMonth : "0" + selectMonth) + "-" + (selectDay > 9 ? selectDay : "0" + selectDay);
|
||||
this.$emit("date-change", this.selectDateStr);
|
||||
},
|
||||
/**
|
||||
* 生成日期数组
|
||||
@@ -159,7 +161,7 @@ const _sfc_main = {
|
||||
this.selectMonth = year + "年" + month + "月";
|
||||
this.startDateStr = year + "-" + (month > 9 ? month : "0" + month) + "-01";
|
||||
this.endDateStr = year + "-" + (month > 9 ? month : "0" + month) + "-" + lastDay;
|
||||
common_vendor.index.__f__("log", "at components/LCCalendar2/LCCalendar2.vue:224", "点击上个月");
|
||||
common_vendor.index.__f__("log", "at components/LCCalendar2/LCCalendar2.vue:228", "点击上个月");
|
||||
}
|
||||
},
|
||||
/**
|
||||
@@ -188,7 +190,7 @@ const _sfc_main = {
|
||||
this.selectMonth = year + "年" + month + "月";
|
||||
this.startDateStr = year + "-" + (month > 9 ? month : "0" + month) + "-01";
|
||||
this.endDateStr = year + "-" + (month > 9 ? month : "0" + month) + "-" + lastDay;
|
||||
common_vendor.index.__f__("log", "at components/LCCalendar2/LCCalendar2.vue:253", "点击下个月");
|
||||
common_vendor.index.__f__("log", "at components/LCCalendar2/LCCalendar2.vue:257", "点击下个月");
|
||||
}
|
||||
},
|
||||
monthChange(e) {
|
||||
@@ -202,7 +204,7 @@ const _sfc_main = {
|
||||
this.startDateStr = selectYear + "-" + (selectMonth > 9 ? selectMonth : "0" + selectMonth) + "-01";
|
||||
let lastDayOfMonth = new Date(selectYear, selectMonth, 0);
|
||||
this.endDateStr = selectYear + "-" + (selectMonth > 9 ? selectMonth : "0" + selectMonth) + "-" + lastDayOfMonth.getDate();
|
||||
common_vendor.index.__f__("log", "at components/LCCalendar2/LCCalendar2.vue:270", "月份变更");
|
||||
common_vendor.index.__f__("log", "at components/LCCalendar2/LCCalendar2.vue:274", "月份变更");
|
||||
},
|
||||
/**
|
||||
* 点击选择开始日期和结束日期
|
||||
@@ -214,7 +216,8 @@ const _sfc_main = {
|
||||
if (this.selectDateStr != item.date) {
|
||||
this.selectDateStr = item.date;
|
||||
this.chgStockData = item;
|
||||
common_vendor.index.__f__("log", "at components/LCCalendar2/LCCalendar2.vue:281", "点击某天");
|
||||
common_vendor.index.__f__("log", "at components/LCCalendar2/LCCalendar2.vue:285", "点击某天");
|
||||
this.$emit("date-change", this.selectDateStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
4
unpackage/dist/dev/mp-weixin/components/WordCloud/WordCloud.js
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/components/WordCloud/WordCloud.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
"use strict";
|
||||
const WordCloud = require("../../WordCloud.js");
|
||||
wx.createPage(WordCloud.MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/WordCloud/WordCloud.js.map
|
||||
4
unpackage/dist/dev/mp-weixin/components/WordCloud/WordCloud.json
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/components/WordCloud/WordCloud.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/components/WordCloud/WordCloud.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/components/WordCloud/WordCloud.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="word-cloud-container data-v-cab45d13"><canvas type="2d" ref="wordCloudCanvas" id="wordCloudCanvas" class="word-cloud-canvas data-v-cab45d13" style="{{'width:' + a + ';' + ('height:' + b)}}"></canvas></view>
|
||||
9
unpackage/dist/dev/mp-weixin/components/WordCloud/WordCloud.wxss
vendored
Normal file
9
unpackage/dist/dev/mp-weixin/components/WordCloud/WordCloud.wxss
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
.word-cloud-container.data-v-cab45d13 {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.word-cloud-canvas.data-v-cab45d13 {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
4
unpackage/dist/dev/mp-weixin/components/WordCloud/WordCloud2.js
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/components/WordCloud/WordCloud2.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
"use strict";
|
||||
const WordCloud = require("../../WordCloud.js");
|
||||
wx.createPage(WordCloud.MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/WordCloud/WordCloud2.js.map
|
||||
@@ -203,6 +203,7 @@ const _sfc_main = {
|
||||
this.option1.xAxis.data = category;
|
||||
this.option1.series[0].data = data1;
|
||||
this.profitabilityInit();
|
||||
this.option2.xAxis.data = category;
|
||||
this.option2.series[0].data = data2;
|
||||
this.perShareInit();
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
const utils_util = require("../../utils/util.js");
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const common_assets = require("../../common/assets.js");
|
||||
const echarts = require("../../uni_modules/lime-echart/static/echarts.min.js");
|
||||
const _sfc_main = {
|
||||
name: "cwsj-view",
|
||||
data() {
|
||||
@@ -12,7 +13,7 @@ const _sfc_main = {
|
||||
option1: {
|
||||
legend: {
|
||||
show: true,
|
||||
data: ["期间费用", "同比(右)"]
|
||||
data: ["货币资金", "同比(右)"]
|
||||
},
|
||||
grid: {
|
||||
left: "2%",
|
||||
@@ -88,7 +89,7 @@ const _sfc_main = {
|
||||
yAxis: [
|
||||
{
|
||||
type: "value",
|
||||
name: "(%)",
|
||||
name: "(亿)",
|
||||
position: "left",
|
||||
alignTicks: true,
|
||||
axisLine: {
|
||||
@@ -111,7 +112,7 @@ const _sfc_main = {
|
||||
series: [
|
||||
{
|
||||
type: "bar",
|
||||
name: "ROE",
|
||||
name: "经营现金流",
|
||||
data: [],
|
||||
yAxisIndex: 0
|
||||
},
|
||||
@@ -126,7 +127,7 @@ const _sfc_main = {
|
||||
option3: {
|
||||
legend: {
|
||||
show: true,
|
||||
data: ["期间费用", "同比(右)"]
|
||||
data: ["净利润", "同比(右)"]
|
||||
},
|
||||
grid: {
|
||||
left: "2%",
|
||||
@@ -145,7 +146,7 @@ const _sfc_main = {
|
||||
yAxis: [
|
||||
{
|
||||
type: "value",
|
||||
name: "(%)",
|
||||
name: "(亿)",
|
||||
position: "left",
|
||||
alignTicks: true,
|
||||
axisLine: {
|
||||
@@ -168,7 +169,7 @@ const _sfc_main = {
|
||||
series: [
|
||||
{
|
||||
type: "bar",
|
||||
name: "ROE",
|
||||
name: "净利润",
|
||||
data: [],
|
||||
yAxisIndex: 0
|
||||
},
|
||||
@@ -180,7 +181,10 @@ const _sfc_main = {
|
||||
}
|
||||
]
|
||||
},
|
||||
getNumStr: utils_util.getNumStr
|
||||
getNumStr: utils_util.getNumStr,
|
||||
accDiv: utils_util.accDiv,
|
||||
accSub: utils_util.accSub,
|
||||
accMul: utils_util.accMul
|
||||
};
|
||||
},
|
||||
props: {
|
||||
@@ -191,8 +195,85 @@ const _sfc_main = {
|
||||
incomeStatementList: Array
|
||||
//利润表
|
||||
},
|
||||
watch: {},
|
||||
watch: {
|
||||
financialBalanceList(newValue) {
|
||||
let category = [];
|
||||
let data = [];
|
||||
for (let item of newValue) {
|
||||
category.push(item.report_type);
|
||||
if (item.assets.current_assets.cash) {
|
||||
data.push(utils_util.accDiv(item.assets.current_assets.cash, 1e8).toFixed(2));
|
||||
} else
|
||||
data.push(0);
|
||||
}
|
||||
this.option1.xAxis.data = category;
|
||||
this.option1.series[0].data = data;
|
||||
this.profitabilityInit();
|
||||
},
|
||||
cashFlowList(newValue) {
|
||||
let category = [];
|
||||
let data = [];
|
||||
for (let item of newValue) {
|
||||
category.push(item.report_type);
|
||||
if (item.operating_activities.net_flow) {
|
||||
data.push(utils_util.accDiv(item.operating_activities.net_flow, 1e8).toFixed(2));
|
||||
} else
|
||||
data.push(0);
|
||||
}
|
||||
this.option2.xAxis.data = category;
|
||||
this.option2.series[0].data = data;
|
||||
this.cashFlowInit();
|
||||
},
|
||||
incomeStatementList(newValue) {
|
||||
let category = [];
|
||||
let data = [];
|
||||
for (let item of newValue) {
|
||||
category.push(item.report_type);
|
||||
if (item.profit.net_profit) {
|
||||
data.push(utils_util.accDiv(item.profit.net_profit, 1e9).toFixed(2));
|
||||
} else
|
||||
data1.push(0);
|
||||
}
|
||||
this.option3.xAxis.data = category;
|
||||
this.option3.series[0].data = data;
|
||||
this.incomeStatementInit();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async profitabilityInit() {
|
||||
const chart = await this.$refs.chartRef1.init(echarts);
|
||||
chart.setOption(this.option1);
|
||||
},
|
||||
async cashFlowInit() {
|
||||
const chart = await this.$refs.chartRef2.init(echarts);
|
||||
chart.setOption(this.option2);
|
||||
},
|
||||
async incomeStatementInit() {
|
||||
const chart = await this.$refs.chartRef3.init(echarts);
|
||||
chart.setOption(this.option3);
|
||||
},
|
||||
/**
|
||||
* 计算经营性现金流增长率
|
||||
*/
|
||||
caculateOperatingFlowRatio() {
|
||||
let flow1 = this.cashFlowList[0].operating_activities.net_flow;
|
||||
let flow2 = this.cashFlowList[4].operating_activities.net_flow;
|
||||
return utils_util.accMul(utils_util.accDiv(utils_util.accSub(flow1, flow2), flow2), 100).toFixed(2);
|
||||
},
|
||||
/**
|
||||
* 计算合计现金流增长率
|
||||
*/
|
||||
caculateNetIncreaseRatio() {
|
||||
let flow1 = this.cashFlowList[0].cash_changes.net_increase;
|
||||
let flow2 = this.cashFlowList[4].cash_changes.net_increase;
|
||||
return utils_util.accMul(utils_util.accDiv(utils_util.accSub(flow1, flow2), flow2), 100).toFixed(2);
|
||||
},
|
||||
/**
|
||||
* 获取去年
|
||||
*/
|
||||
getLastYearPeriod(list) {
|
||||
list[0].period.split("-")[0];
|
||||
},
|
||||
/**
|
||||
* 点击切换现金流量表指标
|
||||
* @param {Object} index
|
||||
@@ -200,6 +281,31 @@ const _sfc_main = {
|
||||
clickCashFlowIndicatorItem(index) {
|
||||
if (this.cashFlowIndicatorIndex != index) {
|
||||
this.cashFlowIndicatorIndex = index;
|
||||
let data = [];
|
||||
if (index == 0) {
|
||||
for (let item of this.cashFlowList) {
|
||||
if (item.operating_activities.net_flow) {
|
||||
data.push(utils_util.accDiv(item.operating_activities.net_flow, 1e8).toFixed(2));
|
||||
} else
|
||||
data.push(0);
|
||||
}
|
||||
} else if (index == 1) {
|
||||
for (let item of this.cashFlowList) {
|
||||
if (item.financing_activities.net_flow) {
|
||||
data.push(utils_util.accDiv(item.financing_activities.net_flow, 1e8).toFixed(2));
|
||||
} else
|
||||
data.push(0);
|
||||
}
|
||||
} else if (index == 2) {
|
||||
for (let item of this.cashFlowList) {
|
||||
if (item.investment_activities.net_flow) {
|
||||
data.push(utils_util.accDiv(item.investment_activities.net_flow, 1e8).toFixed(2));
|
||||
} else
|
||||
data.push(0);
|
||||
}
|
||||
}
|
||||
this.option2.series[0].data = data;
|
||||
this.cashFlowInit();
|
||||
}
|
||||
},
|
||||
/**
|
||||
@@ -245,10 +351,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
m: common_vendor.t($data.getNumStr($props.financialBalanceList[0].equity.surplus_reserve)),
|
||||
n: common_vendor.t($data.getNumStr($props.financialBalanceList[0].equity.undistributed_profit))
|
||||
} : {}, {
|
||||
o: common_vendor.o(($event) => _ctx.itemClick(0)),
|
||||
p: common_assets._imports_0$8,
|
||||
q: common_assets._imports_1$2,
|
||||
r: common_vendor.f(["经营现金流", "筹资现金流", "投资现金流"], (item, index, i0) => {
|
||||
o: common_assets._imports_0$8,
|
||||
p: common_assets._imports_1$2,
|
||||
q: common_vendor.f(["经营现金流", "筹资现金流", "投资现金流"], (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item),
|
||||
b: common_vendor.n("item flexCenter " + ($data.cashFlowIndicatorIndex == index ? "select" : "")),
|
||||
@@ -256,12 +361,21 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
d: common_vendor.o(($event) => $options.clickCashFlowIndicatorItem(index), index)
|
||||
};
|
||||
}),
|
||||
s: common_assets._imports_2$14,
|
||||
t: common_assets._imports_3$13,
|
||||
v: common_vendor.sr("chartRef2", "63ca7cac-1"),
|
||||
w: common_assets._imports_0$8,
|
||||
x: common_assets._imports_1$2,
|
||||
y: common_vendor.f(["净利润", "营业收入", "期间费用"], (item, index, i0) => {
|
||||
r: common_assets._imports_2$14,
|
||||
s: common_assets._imports_3$13,
|
||||
t: common_vendor.sr("chartRef2", "63ca7cac-1"),
|
||||
v: $props.cashFlowList.length > 0
|
||||
}, $props.cashFlowList.length > 0 ? {
|
||||
w: common_vendor.t($data.getNumStr($props.cashFlowList[0].operating_activities.net_flow)),
|
||||
x: common_vendor.t($options.caculateOperatingFlowRatio()),
|
||||
y: common_vendor.t($data.getNumStr($props.cashFlowList[0].investment_activities.net_flow)),
|
||||
z: common_vendor.t($data.getNumStr($props.cashFlowList[0].financing_activities.net_flow)),
|
||||
A: common_vendor.t($data.getNumStr($props.cashFlowList[0].cash_changes.net_increase)),
|
||||
B: common_vendor.t($options.caculateNetIncreaseRatio())
|
||||
} : {}, {
|
||||
C: common_assets._imports_0$8,
|
||||
D: common_assets._imports_1$2,
|
||||
E: common_vendor.f(["净利润", "营业收入", "期间费用"], (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item),
|
||||
b: common_vendor.n("item flexCenter " + ($data.profitIndicatorIndex == index ? "select" : "")),
|
||||
@@ -269,12 +383,17 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
d: common_vendor.o(($event) => $options.clickProfitIndicatorItem(index), index)
|
||||
};
|
||||
}),
|
||||
z: common_assets._imports_2$14,
|
||||
A: common_assets._imports_3$13,
|
||||
B: common_assets._imports_2$14,
|
||||
C: common_assets._imports_3$13,
|
||||
D: common_vendor.sr("chartRef3", "63ca7cac-2")
|
||||
});
|
||||
F: common_assets._imports_2$14,
|
||||
G: common_assets._imports_3$13,
|
||||
H: common_assets._imports_2$14,
|
||||
I: common_assets._imports_3$13,
|
||||
J: common_vendor.sr("chartRef3", "63ca7cac-2"),
|
||||
K: $props.incomeStatementList.length > 0
|
||||
}, $props.incomeStatementList.length > 0 ? {
|
||||
L: common_vendor.t($data.getNumStr($props.incomeStatementList[0].comprehensive_income.total_comprehensive_income)),
|
||||
M: common_vendor.t($data.getNumStr($props.incomeStatementList[0].revenue.total_operating_revenue)),
|
||||
N: common_vendor.t($data.getNumStr($props.incomeStatementList[0].profit.operating_profit))
|
||||
} : {});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createComponent(Component);
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,6 +1,7 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const common_assets = require("../../common/assets.js");
|
||||
const echarts = require("../../uni_modules/lime-echart/static/echarts.min.js");
|
||||
const _sfc_main = {
|
||||
name: "cyl-view",
|
||||
data() {
|
||||
@@ -27,7 +28,26 @@ const _sfc_main = {
|
||||
type: "downstream"
|
||||
}
|
||||
],
|
||||
typeIndex: 0
|
||||
typeIndex: 0,
|
||||
option: {
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
grid: {
|
||||
left: "2%",
|
||||
right: "2%",
|
||||
top: "5%",
|
||||
bottom: "30%"
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: "sankey",
|
||||
name: "经营现金流",
|
||||
data: [],
|
||||
links: []
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
props: {
|
||||
@@ -38,25 +58,63 @@ const _sfc_main = {
|
||||
//核心企业
|
||||
downstreamList: Array,
|
||||
//下游客户
|
||||
totalNodes: Number
|
||||
totalNodes: Number,
|
||||
//总节点数
|
||||
valueChainFlowsList: Array
|
||||
//产业链流向数据
|
||||
},
|
||||
watch: {
|
||||
valueChainAnalysisInfo(newValue) {
|
||||
this.types[0].count = newValue.upstream_nodes;
|
||||
this.types[1].count = newValue.company_nodes;
|
||||
this.types[2].count = newValue.downstream_nodes;
|
||||
},
|
||||
valueChainFlowsList(newValue) {
|
||||
let data = [];
|
||||
let links = [];
|
||||
let name = [];
|
||||
for (let item of newValue) {
|
||||
if (name.indexOf(item.source.node_name) == -1) {
|
||||
name.push(item.source.node_name);
|
||||
data.push({ name: item.source.node_name });
|
||||
}
|
||||
links.push({ source: item.source.node_name, target: item.target.node_name, value: item.flow_metrics.flow_ratio });
|
||||
}
|
||||
this.option.series[0].data = data;
|
||||
this.option.series[0].links = links;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async init() {
|
||||
const chart = await this.$refs.chartRef.init(echarts);
|
||||
common_vendor.index.__f__("log", "at components/cyl-view/cyl-view.vue:183", chart);
|
||||
common_vendor.index.__f__("log", "at components/cyl-view/cyl-view.vue:184", this.option);
|
||||
chart.setOption(this.option);
|
||||
},
|
||||
changeCenterIndex(index) {
|
||||
this.center_index = index;
|
||||
if (this.center_index != index) {
|
||||
this.center_index = index;
|
||||
if (index == 1) {
|
||||
let that = this;
|
||||
setTimeout(function() {
|
||||
that.init();
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
},
|
||||
clickAction(item) {
|
||||
this.$emit("detail", item);
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_l_echart2 = common_vendor.resolveComponent("l-echart");
|
||||
_easycom_l_echart2();
|
||||
}
|
||||
const _easycom_l_echart = () => "../../uni_modules/lime-echart/components/l-echart/l-echart.js";
|
||||
if (!Math) {
|
||||
_easycom_l_echart();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t($props.totalNodes),
|
||||
@@ -64,7 +122,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
c: common_vendor.o(($event) => $options.changeCenterIndex(0)),
|
||||
d: $data.center_index == 1 ? 1 : "",
|
||||
e: common_vendor.o(($event) => $options.changeCenterIndex(1)),
|
||||
f: common_vendor.f($data.types, (item, index, i0) => {
|
||||
f: $data.center_index == 0
|
||||
}, $data.center_index == 0 ? common_vendor.e({
|
||||
g: common_vendor.f($data.types, (item, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(item.title),
|
||||
b: common_vendor.t(item.count),
|
||||
@@ -79,9 +139,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
i: index
|
||||
});
|
||||
}),
|
||||
g: $data.typeIndex == 0
|
||||
h: $data.typeIndex == 0
|
||||
}, $data.typeIndex == 0 ? {
|
||||
h: common_vendor.f($props.upstreamList, (item, index, i0) => {
|
||||
i: common_vendor.f($props.upstreamList, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.node_name),
|
||||
b: common_vendor.t(item.node_description),
|
||||
@@ -94,9 +154,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
};
|
||||
})
|
||||
} : {}, {
|
||||
i: $data.typeIndex == 1
|
||||
j: $data.typeIndex == 1
|
||||
}, $data.typeIndex == 1 ? {
|
||||
j: common_vendor.f($props.coreEnterpriseList, (item, index, i0) => {
|
||||
k: common_vendor.f($props.coreEnterpriseList, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.node_name),
|
||||
b: common_vendor.t(item.node_description),
|
||||
@@ -109,9 +169,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
};
|
||||
})
|
||||
} : {}, {
|
||||
k: $data.typeIndex == 2
|
||||
l: $data.typeIndex == 2
|
||||
}, $data.typeIndex == 2 ? {
|
||||
l: common_vendor.f($props.downstreamList, (item, index, i0) => {
|
||||
m: common_vendor.f($props.downstreamList, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.node_name),
|
||||
b: common_vendor.t(item.node_description),
|
||||
@@ -123,6 +183,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
h: common_vendor.o(($event) => $options.clickAction(item), index)
|
||||
};
|
||||
})
|
||||
} : {}) : {}, {
|
||||
n: $data.center_index == 1
|
||||
}, $data.center_index == 1 ? {
|
||||
o: common_vendor.sr("chartRef", "2cc4c3dc-0")
|
||||
} : {});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
"usingComponents": {
|
||||
"l-echart": "../../uni_modules/lime-echart/components/l-echart/l-echart"
|
||||
}
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
<view class="cyl_view"><view class="top flex"><view class="child_1">产业链分析</view><view class="child_2">目标公司供应链图谱</view><view class="child_3">节点 {{a}}</view></view><view class="center"><view class="{{['child', b && 'action']}}" bindtap="{{c}}"> 层级视图 </view><view class="{{['child', d && 'action']}}" bindtap="{{e}}"> 流向关系 </view></view><view class="bottom"><view class="type flex"><view wx:for="{{f}}" wx:for-item="item" wx:key="i" class="item flex flex1"><view class="{{item.e}}" bindtap="{{item.f}}"><view class="titleNumC">{{item.a}} <text class="{{item.c}}">{{item.b}}</text></view><view class="des">{{item.d}}</view></view><image wx:if="{{item.g}}" class="arrow" src="{{item.h}}" mode="widthFix"></image></view></view><view class="list"><block wx:if="{{g}}"><view wx:for="{{h}}" wx:for-item="item" wx:key="g" class="item" bindtap="{{item.h}}"><view class="title">{{item.a}}</view><view class="des">{{item.b}}</view><view class="labelC flex"><view class="label upstream type">{{item.c}}</view><view class="label upstream market">份额:{{item.d}}%</view></view><view class="importanceC flex"><view class="title">影响度</view><view class="progressBgC flex1"><view class="progress upstream" style="{{'width:' + item.e}}"></view></view><view class="value">{{item.f}}</view></view></view></block><block wx:if="{{i}}"><view wx:for="{{j}}" wx:for-item="item" wx:key="g" class="item" bindtap="{{item.h}}"><view class="title">{{item.a}}</view><view class="des">{{item.b}}</view><view class="labelC flex"><view class="label core type">{{item.c}}</view><view class="label core market">份额:{{item.d}}%</view></view><view class="importanceC flex"><view class="title">影响度</view><view class="progressBgC flex1"><view class="progress core" style="{{'width:' + item.e}}"></view></view><view class="value">{{item.f}}</view></view></view></block><block wx:if="{{k}}"><view wx:for="{{l}}" wx:for-item="item" wx:key="g" class="item" bindtap="{{item.h}}"><view class="title">{{item.a}}</view><view class="des">{{item.b}}</view><view class="labelC flex"><view class="label downstream type">{{item.c}}</view><view class="label downstream market">份额:{{item.d}}%</view></view><view class="importanceC flex"><view class="title">影响度</view><view class="progressBgC flex1"><view class="progress downstream" style="{{'width:' + item.e}}"></view></view><view class="value">{{item.f}}</view></view></view></block></view></view></view>
|
||||
<view class="cyl_view"><view class="top flex"><view class="child_1">产业链分析</view><view class="child_2">目标公司供应链图谱</view><view class="child_3">节点 {{a}}</view></view><view class="center"><view class="{{['child', b && 'action']}}" bindtap="{{c}}"> 层级视图 </view><view class="{{['child', d && 'action']}}" bindtap="{{e}}"> 流向关系 </view></view><view wx:if="{{f}}" class="bottom"><view class="type flex"><view wx:for="{{g}}" wx:for-item="item" wx:key="i" class="item flex flex1"><view class="{{item.e}}" bindtap="{{item.f}}"><view class="titleNumC">{{item.a}} <text class="{{item.c}}">{{item.b}}</text></view><view class="des">{{item.d}}</view></view><image wx:if="{{item.g}}" class="arrow" src="{{item.h}}" mode="widthFix"></image></view></view><view class="list"><block wx:if="{{h}}"><view wx:for="{{i}}" wx:for-item="item" wx:key="g" class="item" bindtap="{{item.h}}"><view class="title">{{item.a}}</view><view class="des">{{item.b}}</view><view class="labelC flex"><view class="label upstream type">{{item.c}}</view><view class="label upstream market">份额:{{item.d}}%</view></view><view class="importanceC flex"><view class="title">影响度</view><view class="progressBgC flex1"><view class="progress upstream" style="{{'width:' + item.e}}"></view></view><view class="value">{{item.f}}</view></view></view></block><block wx:if="{{j}}"><view wx:for="{{k}}" wx:for-item="item" wx:key="g" class="item" bindtap="{{item.h}}"><view class="title">{{item.a}}</view><view class="des">{{item.b}}</view><view class="labelC flex"><view class="label core type">{{item.c}}</view><view class="label core market">份额:{{item.d}}%</view></view><view class="importanceC flex"><view class="title">影响度</view><view class="progressBgC flex1"><view class="progress core" style="{{'width:' + item.e}}"></view></view><view class="value">{{item.f}}</view></view></view></block><block wx:if="{{l}}"><view wx:for="{{m}}" wx:for-item="item" wx:key="g" class="item" bindtap="{{item.h}}"><view class="title">{{item.a}}</view><view class="des">{{item.b}}</view><view class="labelC flex"><view class="label downstream type">{{item.c}}</view><view class="label downstream market">份额:{{item.d}}%</view></view><view class="importanceC flex"><view class="title">影响度</view><view class="progressBgC flex1"><view class="progress downstream" style="{{'width:' + item.e}}"></view></view><view class="value">{{item.f}}</view></view></view></block></view></view><view wx:if="{{n}}" style="height:500rpx"><l-echart class="r" u-r="chartRef" u-i="2cc4c3dc-0" bind:__l="__l"></l-echart></view></view>
|
||||
@@ -82,7 +82,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
}, item.impact_metrics.is_positive == 1 ? {
|
||||
b: common_assets._imports_4$11
|
||||
} : {
|
||||
c: common_assets._imports_5$7
|
||||
c: common_assets._imports_5$6
|
||||
}, {
|
||||
d: common_vendor.n("line flex1 " + (item.impact_metrics.is_positive == 1 ? "up" : "down")),
|
||||
e: common_vendor.t(item.event_title),
|
||||
|
||||
Reference in New Issue
Block a user