1.31 财务分析,财务数据模块完善,产业链桑基图展示

This commit is contained in:
尚政杰
2026-01-31 17:19:16 +08:00
parent 1c13386dfc
commit 0a2dab4936
527 changed files with 3390 additions and 604 deletions

View File

@@ -1,11 +1,16 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const request_api = require("../../request/api.js");
const common_assets = require("../../common/assets.js");
const _sfc_main = {
data() {
return {
navH: common_vendor.inject("navHeight"),
contentTop: "",
allStockData: [],
filteredData: [],
currentDate: "",
// 最终要赋值的日期
topLists: [
{
title: "超大盘股",
@@ -24,10 +29,80 @@ const _sfc_main = {
};
},
onLoad(e) {
this.activeIndex = e.index;
this.currentDate = e.currentDate;
this.contentTop = this.navH + (20 + 70 + 25) / 750 * common_vendor.inject("windowWidth");
this.marketHeatmap();
},
methods: {}
methods: {
handleTypeClick(index) {
this.list2Index = index;
this.marketHeatmap();
},
getTableItem(obj) {
const marketCap = obj.market_cap ? obj.market_cap.toFixed(2) : "0.00";
const amount = obj.amount ? obj.amount.toFixed(2) : "0.00";
const changePercent = obj.change_percent ? Number(obj.change_percent) : 0;
let changePercentStr = "";
let changeType = "";
if (changePercent > 0) {
changePercentStr = `+${changePercent}%`;
changeType = "positive";
} else if (changePercent < 0) {
changePercentStr = `${changePercent}%`;
changeType = "negative";
} else {
changePercentStr = "0%";
changeType = "zero";
}
return [
[obj.stock_name, obj.stock_code],
[changePercentStr, "", changeType],
// 第三个元素存类型标记
[`${marketCap}亿元`],
[`${amount}亿元`],
[obj.industry || "暂无"]
// 处理行业为空的情况
];
},
marketHeatmap() {
let param = {
limit: 500,
date: this.currentDate
};
request_api.marketHeatmap(param).then((res) => {
this.allStockData = res.data || [];
this.filterStockByMarketCap();
}).catch((error) => {
});
},
// 根据市值区间筛选数据
filterStockByMarketCap() {
const {
list2Index,
allStockData
} = this;
let filtered = [];
switch (list2Index) {
case 0:
filtered = allStockData.filter((item) => item.market_cap > 1e3);
break;
case 1:
filtered = allStockData.filter((item) => item.market_cap >= 500 && item.market_cap <= 1e3);
break;
case 2:
filtered = allStockData.filter((item) => item.market_cap >= 100 && item.market_cap <= 500);
break;
default:
filtered = allStockData;
}
this.filteredData = filtered;
},
itemDetails(item) {
common_vendor.index.navigateTo({
url: "/pagesStock/stockCenterDetails/stockCenterDetails?code=" + item.stock_code
});
}
}
};
if (!Array) {
const _easycom_navBar2 = common_vendor.resolveComponent("navBar");
@@ -55,7 +130,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
b: $data.list2Index == index ? "#BB8520" : "#070707",
c: common_vendor.t(item.value),
d: $data.list2Index == index ? "#BB8520" : "#070707",
e: common_vendor.o(($event) => $data.list2Index = index, index),
e: common_vendor.o(($event) => $options.handleTypeClick(index), index),
f: index,
g: $data.list2Index == index ? "1rpx solid #F2C369" : "none"
};
@@ -66,18 +141,21 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
b: index
};
}),
j: common_vendor.f(10, (obj, j, i0) => {
j: common_vendor.f($data.filteredData, (obj, j, i0) => {
return {
a: common_vendor.f(["云南白药", "+0.04%", "996.85 亿元", "4.44 亿元", "医药生物"], (item, index, i1) => {
a: common_vendor.f($options.getTableItem(obj), (item, index, i1) => {
return common_vendor.e({
a: common_vendor.t(item),
a: common_vendor.t(item[0]),
b: index == 0
}, index == 0 ? {} : {}, {
c: index,
d: index == 0 ? "#222222" : index == 1 ? "#EC3440" : "#666666"
}, index == 0 ? {
c: common_vendor.t(item[1])
} : {}, {
d: index,
e: index == 0 ? "#222222" : index == 1 ? item[2] === "positive" ? "#EC3440" : "#01AB5D" : "#666666"
});
}),
b: j % 2 == 0 ? "#fff" : "#FAFAFC"
b: common_vendor.o(($event) => $options.itemDetails(obj)),
c: j % 2 == 0 ? "#fff" : "#FAFAFC"
};
}),
k: common_vendor.s("top:" + $data.contentTop + "px;")