2.6 盈利能力模块表格完善
This commit is contained in:
217
unpackage/dist/dev/mp-weixin/WordCloud.js
vendored
217
unpackage/dist/dev/mp-weixin/WordCloud.js
vendored
@@ -3,10 +3,9 @@ const common_vendor = require("./common/vendor.js");
|
||||
const _sfc_main = {
|
||||
name: "WordCloud",
|
||||
props: {
|
||||
// 词云数据 [{text: '关键词', value: 100}, ...]
|
||||
// 词云数据:[{ text: '关键词', value: 100 }]
|
||||
wordData: {
|
||||
type: Array,
|
||||
required: true,
|
||||
default: () => []
|
||||
},
|
||||
// 画布宽度
|
||||
@@ -19,149 +18,142 @@ const _sfc_main = {
|
||||
type: Number,
|
||||
default: 300
|
||||
},
|
||||
// 文字颜色列表(分层配色)
|
||||
// 颜色:外 / 中 / 内
|
||||
colorList: {
|
||||
type: Array,
|
||||
default: () => ["#60A5FA", "#FEC200", "#EF4444"]
|
||||
// 外圈、中间、中心
|
||||
},
|
||||
// 新增:字号配置,让组件更灵活
|
||||
fontSizeConfig: {
|
||||
type: Object,
|
||||
default: () => ({
|
||||
minSize: 12,
|
||||
// 最小字号
|
||||
maxSize: 40,
|
||||
// 最大字号
|
||||
scaleFactor: 0.1
|
||||
// 缩放因子,越大字号差异越明显
|
||||
})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
canvasWidth: this.width,
|
||||
canvasHeight: this.height,
|
||||
ctx: null,
|
||||
// canvas 2d 上下文
|
||||
placedWords: []
|
||||
// 已放置的文字信息(用于碰撞检测)
|
||||
placedWords: [],
|
||||
// 已放置文字的包围盒(用于碰撞检测)
|
||||
centerWords: [],
|
||||
// value 最大的 3 个
|
||||
otherWords: []
|
||||
// 其余词
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
// 词云数据变化时重绘
|
||||
wordData: {
|
||||
deep: true,
|
||||
handler() {
|
||||
this.drawWordCloud();
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initCanvas();
|
||||
},
|
||||
methods: {
|
||||
// 初始化canvas
|
||||
// 初始化 canvas
|
||||
async initCanvas() {
|
||||
await new Promise((resolve) => setTimeout(resolve, 50));
|
||||
await new Promise((r) => setTimeout(r, 50));
|
||||
const query = common_vendor.index.createSelectorQuery().in(this);
|
||||
query.select(".word-cloud-canvas").fields({ node: true, size: true }).exec(async (res) => {
|
||||
if (!res || !res[0] || !res[0].node) {
|
||||
common_vendor.index.__f__("error", "at components/WordCloud/WordCloud.vue:82", "获取canvas节点失败,请检查canvas是否正确渲染");
|
||||
query.select(".word-cloud-canvas").fields({ node: true }).exec((res) => {
|
||||
if (!res || !res[0] || !res[0].node)
|
||||
return;
|
||||
}
|
||||
const canvas = res[0].node;
|
||||
let ctx = null;
|
||||
try {
|
||||
ctx = canvas.getContext("2d");
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("warn", "at components/WordCloud/WordCloud.vue:93", "获取2d上下文失败,尝试兼容处理", e);
|
||||
ctx = common_vendor.index.createCanvasContext("wordCloudCanvas", this);
|
||||
}
|
||||
if (!ctx) {
|
||||
common_vendor.index.__f__("error", "at components/WordCloud/WordCloud.vue:99", "无法获取canvas 2d上下文");
|
||||
return;
|
||||
}
|
||||
const ctx = canvas.getContext("2d");
|
||||
const dpr = common_vendor.index.getSystemInfoSync().pixelRatio || 1;
|
||||
canvas.width = this.canvasWidth * dpr;
|
||||
canvas.height = this.canvasHeight * dpr;
|
||||
canvas.width = this.width * dpr;
|
||||
canvas.height = this.height * dpr;
|
||||
ctx.scale(dpr, dpr);
|
||||
this.ctx = ctx;
|
||||
this.drawWordCloud();
|
||||
});
|
||||
},
|
||||
// 绘制词云核心方法
|
||||
// 绘制词云
|
||||
drawWordCloud() {
|
||||
if (!this.ctx || !this.wordData.length)
|
||||
return;
|
||||
this.ctx.clearRect(0, 0, this.canvasWidth, this.canvasHeight);
|
||||
this.ctx.clearRect(0, 0, this.width, this.height);
|
||||
this.placedWords = [];
|
||||
const sortedWords = [...this.wordData].sort((a, b) => b.value - a.value);
|
||||
const values = sortedWords.map((item) => item.value);
|
||||
this.valueMax = Math.max(...values);
|
||||
this.valueMin = Math.min(...values);
|
||||
sortedWords.forEach((word, index) => {
|
||||
this.placeWord(word, index);
|
||||
const sorted = [...this.wordData].sort((a, b) => b.value - a.value);
|
||||
this.centerWords = sorted.slice(0, 3);
|
||||
this.otherWords = sorted.slice(3);
|
||||
this.centerWords.forEach((word, index) => {
|
||||
this.placeWord(word, "center", index);
|
||||
});
|
||||
this.otherWords.forEach((word) => {
|
||||
this.placeWord(word, "other");
|
||||
});
|
||||
this.$emit("rendered");
|
||||
},
|
||||
// 放置单个文字(核心:碰撞检测,确保不重叠)
|
||||
placeWord(word, index) {
|
||||
// 放置单个词
|
||||
placeWord(word, type, index = 0) {
|
||||
const ctx = this.ctx;
|
||||
const maxAttempts = 150;
|
||||
const { minSize, maxSize, scaleFactor } = this.fontSizeConfig;
|
||||
let normalizedValue = 1;
|
||||
if (this.valueMax !== this.valueMin) {
|
||||
normalizedValue = (word.value - this.valueMin) / (this.valueMax - this.valueMin);
|
||||
const text = word.text || word.name;
|
||||
const maxAttempts = 200;
|
||||
let fontSize = 24;
|
||||
let layer = "middle";
|
||||
if (type === "center") {
|
||||
fontSize = 32;
|
||||
layer = "center";
|
||||
} else {
|
||||
layer = Math.random() > 0.5 ? "middle" : "outer";
|
||||
fontSize = layer === "outer" ? 18 : 24;
|
||||
}
|
||||
const fontSize = Math.min(
|
||||
minSize + (maxSize - minSize) * normalizedValue * scaleFactor,
|
||||
maxSize
|
||||
);
|
||||
const rotateAngle = (Math.random() - 0.5) * 120 * Math.PI / 180;
|
||||
ctx.font = `${fontSize}px sans-serif`;
|
||||
const textWidth = ctx.measureText(word.text || word.name).width;
|
||||
const angleLimit = Math.random() > 0.5 ? 60 * Math.PI / 180 : 30 * Math.PI / 180;
|
||||
const angle = (Math.random() - 0.5) * 2 * angleLimit;
|
||||
ctx.font = `bold ${fontSize}px sans-serif`;
|
||||
const textWidth = ctx.measureText(text).width;
|
||||
const textHeight = fontSize * 1.05;
|
||||
for (let i = 0; i < maxAttempts; i++) {
|
||||
const x = this.canvasWidth * 0.05 + Math.random() * this.canvasWidth * 0.9;
|
||||
const y = this.canvasHeight * 0.05 + Math.random() * this.canvasHeight * 0.9;
|
||||
const isOverlap = this.checkOverlap(x, y, textWidth, textHeight, rotateAngle, 2);
|
||||
if (!isOverlap) {
|
||||
const centerX = this.canvasWidth / 2;
|
||||
const centerY = this.canvasHeight / 2;
|
||||
const distance = Math.sqrt(Math.pow(x - centerX, 2) + Math.pow(y - centerY, 2));
|
||||
const maxDistance = Math.sqrt(Math.pow(centerX, 2) + Math.pow(centerY, 2));
|
||||
let color;
|
||||
if (distance > maxDistance * 0.66) {
|
||||
color = this.colorList[0];
|
||||
} else if (distance > maxDistance * 0.33) {
|
||||
color = this.colorList[1];
|
||||
} else {
|
||||
color = this.colorList[2];
|
||||
}
|
||||
ctx.fillStyle = color;
|
||||
this.drawTextAtPosition(word.text || word.name, x, y, rotateAngle, fontSize);
|
||||
this.placedWords.push({
|
||||
x,
|
||||
y,
|
||||
width: textWidth,
|
||||
height: textHeight,
|
||||
angle: rotateAngle
|
||||
});
|
||||
break;
|
||||
let x, y;
|
||||
if (layer === "center") {
|
||||
const centerX = this.width / 2;
|
||||
const centerY = this.height / 2;
|
||||
const offsets = [
|
||||
{ x: 0, y: 0 },
|
||||
// 最大的,正中
|
||||
{ x: -80, y: 0 },
|
||||
// 左
|
||||
{ x: 80, y: 0 }
|
||||
// 右
|
||||
];
|
||||
const pos = offsets[index] || offsets[0];
|
||||
x = centerX + pos.x;
|
||||
y = centerY + pos.y;
|
||||
} else {
|
||||
x = this.width * 0.05 + Math.random() * this.width * 0.9;
|
||||
y = this.height * 0.05 + Math.random() * this.height * 0.9;
|
||||
}
|
||||
const rect = this.getBoundingRect(
|
||||
x,
|
||||
y,
|
||||
textWidth,
|
||||
textHeight,
|
||||
angle,
|
||||
2
|
||||
);
|
||||
if (layer === "outer") {
|
||||
if (rect.left < 0 || rect.right > this.width || rect.top < 0 || rect.bottom > this.height) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (this.checkOverlapRect(rect))
|
||||
continue;
|
||||
ctx.fillStyle = layer === "center" ? this.colorList[2] : layer === "middle" ? this.colorList[1] : this.colorList[0];
|
||||
this.drawText(text, x, y, angle);
|
||||
this.placedWords.push({ rect });
|
||||
break;
|
||||
}
|
||||
},
|
||||
// 碰撞检测:检查当前文字是否与已放置的文字重叠(新增间距容差参数)
|
||||
checkOverlap(x, y, width, height, angle, gap = 2) {
|
||||
const currentRect = this.getBoundingRect(x, y, width, height, angle, gap);
|
||||
for (const placed of this.placedWords) {
|
||||
const placedRect = this.getBoundingRect(placed.x, placed.y, placed.width, placed.height, placed.angle, gap);
|
||||
if (currentRect.left < placedRect.right && currentRect.right > placedRect.left && currentRect.top < placedRect.bottom && currentRect.bottom > placedRect.top) {
|
||||
// 碰撞检测(AABB)
|
||||
checkOverlapRect(current) {
|
||||
for (const item of this.placedWords) {
|
||||
const r = item.rect;
|
||||
if (current.left < r.right && current.right > r.left && current.top < r.bottom && current.bottom > r.top) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
// 获取旋转后文字的包围盒(新增间距容差参数,缩小包围盒)
|
||||
// 计算旋转后的包围盒
|
||||
getBoundingRect(x, y, width, height, angle, gap = 2) {
|
||||
const cos = Math.cos(angle);
|
||||
const sin = Math.sin(angle);
|
||||
@@ -169,22 +161,25 @@ const _sfc_main = {
|
||||
const halfH = (height - gap) / 2;
|
||||
const points = [
|
||||
{ x: -halfW, y: -halfH },
|
||||
{ x: -halfW, y: halfH },
|
||||
{ x: halfW, y: -halfH },
|
||||
{ x: halfW, y: halfH },
|
||||
{ x: halfW, y: -halfH }
|
||||
{ x: -halfW, y: halfH }
|
||||
];
|
||||
const rotatedPoints = points.map((point) => ({
|
||||
x: x + point.x * cos - point.y * sin,
|
||||
y: y + point.x * sin + point.y * cos
|
||||
}));
|
||||
const left = Math.min(...rotatedPoints.map((p) => p.x));
|
||||
const right = Math.max(...rotatedPoints.map((p) => p.x));
|
||||
const top = Math.min(...rotatedPoints.map((p) => p.y));
|
||||
const bottom = Math.max(...rotatedPoints.map((p) => p.y));
|
||||
return { left, right, top, bottom };
|
||||
const xs = [];
|
||||
const ys = [];
|
||||
points.forEach((p) => {
|
||||
xs.push(x + p.x * cos - p.y * sin);
|
||||
ys.push(y + p.x * sin + p.y * cos);
|
||||
});
|
||||
return {
|
||||
left: Math.min(...xs),
|
||||
right: Math.max(...xs),
|
||||
top: Math.min(...ys),
|
||||
bottom: Math.max(...ys)
|
||||
};
|
||||
},
|
||||
// 在指定位置绘制旋转后的文字
|
||||
drawTextAtPosition(text, x, y, angle, fontSize) {
|
||||
// 绘制文字
|
||||
drawText(text, x, y, angle) {
|
||||
const ctx = this.ctx;
|
||||
ctx.save();
|
||||
ctx.translate(x, y);
|
||||
@@ -198,8 +193,8 @@ const _sfc_main = {
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: $data.canvasWidth + "px",
|
||||
b: $data.canvasHeight + "px"
|
||||
a: $props.width + "px",
|
||||
b: $props.height + "px"
|
||||
};
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-cab45d13"]]);
|
||||
|
||||
2
unpackage/dist/dev/mp-weixin/app.js
vendored
2
unpackage/dist/dev/mp-weixin/app.js
vendored
@@ -31,7 +31,7 @@ if (!Math) {
|
||||
"./pagesMine/vip/vip.js";
|
||||
"./pagesMine/vipMeal/vipMeal.js";
|
||||
"./pagesStock/stockCenterDetails/stockCenterDetails.js";
|
||||
"./pagesStock/stockCenterDetails/cwDetails.js";
|
||||
"./pagesStock/stockCenterDetails/cwDetails/cwDetails.js";
|
||||
"./pagesStock/stockCenterDetails/ztfx.js";
|
||||
"./pagesStock/stockCenterDetails/bkydmx.js";
|
||||
"./pagesStock/stockCenterDetails/webView/webView.js";
|
||||
|
||||
2
unpackage/dist/dev/mp-weixin/app.json
vendored
2
unpackage/dist/dev/mp-weixin/app.json
vendored
@@ -38,7 +38,7 @@
|
||||
"root": "pagesStock",
|
||||
"pages": [
|
||||
"stockCenterDetails/stockCenterDetails",
|
||||
"stockCenterDetails/cwDetails",
|
||||
"stockCenterDetails/cwDetails/cwDetails",
|
||||
"stockCenterDetails/ztfx",
|
||||
"stockCenterDetails/bkydmx",
|
||||
"stockCenterDetails/webView/webView",
|
||||
|
||||
176
unpackage/dist/dev/mp-weixin/common/assets.js
vendored
176
unpackage/dist/dev/mp-weixin/common/assets.js
vendored
@@ -1,27 +1,27 @@
|
||||
"use strict";
|
||||
const _imports_0$a = "/static/image/index/conceptTopBg.png";
|
||||
const _imports_1$h = "/static/icon/home/conceptCenter/search.png";
|
||||
const _imports_3$d = "/static/icon/home/conceptCenter/conceptScreenArrow.png";
|
||||
const _imports_3$c = "/static/icon/home/conceptCenter/conceptScreenArrow.png";
|
||||
const _imports_1$g = "/static/icon/home/downArrow.png";
|
||||
const _imports_2$f = "/static/icon/home/upArrow.png";
|
||||
const _imports_3$c = "/static/icon/home/browser.png";
|
||||
const _imports_2$e = "/static/icon/home/upArrow.png";
|
||||
const _imports_3$b = "/static/icon/home/browser.png";
|
||||
const _imports_11$3 = "/static/icon/home/like.png";
|
||||
const _imports_7$2 = "/static/icon/home/collect.png";
|
||||
const _imports_2$e = "/static/icon/backBlack.png";
|
||||
const _imports_2$d = "/static/icon/backBlack.png";
|
||||
const _imports_9$3 = "/static/icon/home/dateRange.png";
|
||||
const _imports_10$2 = "/static/icon/home/industrySearch.png";
|
||||
const _imports_11$2 = "/static/icon/home/industry_s.png";
|
||||
const _imports_12$3 = "/static/icon/home/level_s.png";
|
||||
const _imports_2$d = "/static/icon/invest/upArrow.png";
|
||||
const _imports_4$e = "/static/icon/invest/downArrow.png";
|
||||
const _imports_4$d = "/static/image/index/noData.png";
|
||||
const _imports_2$c = "/static/icon/invest/upArrow.png";
|
||||
const _imports_4$c = "/static/icon/invest/downArrow.png";
|
||||
const _imports_4$b = "/static/image/index/noData.png";
|
||||
const _imports_5$8 = "/static/icon/home/monthLeftArrow.png";
|
||||
const _imports_6$2 = "/static/icon/home/monthRightArrow.png";
|
||||
const _imports_2$c = "/static/icon/home/conceptCenter/sortType.png";
|
||||
const _imports_4$c = "/static/icon/home/conceptCenter/transactionDate.png";
|
||||
const _imports_6$3 = "/static/icon/home/monthRightArrow.png";
|
||||
const _imports_2$b = "/static/icon/home/conceptCenter/sortType.png";
|
||||
const _imports_4$a = "/static/icon/home/conceptCenter/transactionDate.png";
|
||||
const _imports_1$f = "/static/icon/home/conceptCenter/lock.png";
|
||||
const _imports_1$e = "/static/icon/home/conceptCenter/timeAxis.png";
|
||||
const _imports_6$1 = "/static/icon/home/close.png";
|
||||
const _imports_6$2 = "/static/icon/home/close.png";
|
||||
const _imports_8$4 = "/static/icon/home/conceptCenter/statistics.png";
|
||||
const _imports_9$2 = "/static/icon/home/conceptCenter/rank1.png";
|
||||
const _imports_10$1 = "/static/icon/home/conceptCenter/rank2.png";
|
||||
@@ -31,47 +31,47 @@ const _imports_13$2 = "/static/icon/home/conceptCenter/calendar.png";
|
||||
const _imports_14$2 = "/static/icon/home/conceptCenter/browse.png";
|
||||
const _imports_12$1 = "/static/icon/home/sortArrow.png";
|
||||
const _imports_0$9 = "/static/icon/home/conceptCenter/pre.png";
|
||||
const _imports_2$b = "/static/icon/home/conceptCenter/next.png";
|
||||
const _imports_2$a = "/static/icon/home/conceptCenter/next.png";
|
||||
const _imports_13$1 = "/static/icon/home/conceptCenter/vipPopIcon.png";
|
||||
const _imports_14$1 = "/static/icon/home/conceptCenter/vipPopIcon.png";
|
||||
const _imports_15$1 = "/static/icon/home/conceptCenter/free_s.png";
|
||||
const _imports_16$1 = "/static/icon/home/conceptCenter/pro_s.png";
|
||||
const _imports_1$d = "/static/icon/mine/infoArrow.png";
|
||||
const _imports_2$a = "/static/image/mine/vipBg.png";
|
||||
const _imports_3$b = "/static/icon/mine/menuArrow.png";
|
||||
const _imports_4$b = "/static/image/mine/service.png";
|
||||
const _imports_2$9 = "/static/image/mine/vipBg.png";
|
||||
const _imports_3$a = "/static/icon/mine/menuArrow.png";
|
||||
const _imports_4$9 = "/static/image/mine/service.png";
|
||||
const _imports_1$c = "/static/icon/mine/basicInfo/edit.png";
|
||||
const _imports_2$9 = "/static/icon/mine/basicInfo/downArrow.png";
|
||||
const _imports_3$a = "/static/icon/home/expectScore.png";
|
||||
const _imports_4$a = "/static/icon/home/expectScoreTips.png";
|
||||
const _imports_2$8 = "/static/icon/mine/basicInfo/downArrow.png";
|
||||
const _imports_3$9 = "/static/icon/home/expectScore.png";
|
||||
const _imports_4$8 = "/static/icon/home/expectScoreTips.png";
|
||||
const _imports_5$7 = "/static/icon/home/expectScoreDot.png";
|
||||
const _imports_8$3 = "/static/icon/home/eventDetails/like.png";
|
||||
const _imports_9$1 = "/static/icon/home/eventDetails/collect.png";
|
||||
const _imports_4$9 = "/static/icon/home/collect_s.png";
|
||||
const _imports_4$7 = "/static/icon/home/collect_s.png";
|
||||
const _imports_1$b = "/static/icon/home/like_s.png";
|
||||
const _imports_0$8 = "/static/image/login/logo.png";
|
||||
const _imports_3$9 = "/static/icon/login/select_s.png";
|
||||
const _imports_4$8 = "/static/icon/login/select.png";
|
||||
const _imports_3$8 = "/static/icon/login/select_s.png";
|
||||
const _imports_4$6 = "/static/icon/login/select.png";
|
||||
const _imports_1$a = "/static/icon/login/mobile.png";
|
||||
const _imports_2$8 = "/static/icon/login/code.png";
|
||||
const _imports_3$8 = "/static/icon/home/conceptCenter/chgDown.png";
|
||||
const _imports_4$7 = "/static/icon/home/conceptCenter/chgUp.png";
|
||||
const _imports_2$7 = "/static/icon/login/code.png";
|
||||
const _imports_3$7 = "/static/icon/home/conceptCenter/chgDown.png";
|
||||
const _imports_4$5 = "/static/icon/home/conceptCenter/chgUp.png";
|
||||
const _imports_5$6 = "/static/icon/home/conceptCenter/newsReport.png";
|
||||
const _imports_1$9 = "/static/icon/home/conceptCenter/timeScreenArrow.png";
|
||||
const _imports_2$7 = "/static/icon/home/conceptCenter/reasonExpand.png";
|
||||
const _imports_3$7 = "/static/icon/home/conceptCenter/reasonRetract.png";
|
||||
const _imports_3$6 = "/assets/ydjk-icon.9712ef19.png";
|
||||
const _imports_2$6 = "/static/icon/home/conceptCenter/reasonExpand.png";
|
||||
const _imports_3$6 = "/static/icon/home/conceptCenter/reasonRetract.png";
|
||||
const _imports_3$5 = "/assets/ydjk-icon.9712ef19.png";
|
||||
const _imports_5$5 = "/assets/ydjk-zs.f6ba6c32.png";
|
||||
const _imports_1$8 = "/pagesStock/static/icon/ai-icon.png";
|
||||
const _imports_2$6 = "/pagesStock/static/icon/ai-icon-1.png";
|
||||
const _imports_3$5 = "/pagesStock/static/icon/all-icon-3.png";
|
||||
const _imports_2$5 = "/pagesStock/static/icon/ai-icon-1.png";
|
||||
const _imports_3$4 = "/pagesStock/static/icon/all-icon-3.png";
|
||||
const _imports_5$4 = "/pagesStock/static/icon/all-icon-5.png";
|
||||
const _imports_1$7 = "/pagesMine/static/image/vip/vipTopBg.png";
|
||||
const _imports_2$5 = "/pagesMine/static/image/vip/noVipTopBg.png";
|
||||
const _imports_3$4 = "/pagesMine/static/icon/vip/titleLeft_v.png";
|
||||
const _imports_4$6 = "/pagesMine/static/icon/vip/titleLeft.png";
|
||||
const _imports_2$4 = "/pagesMine/static/image/vip/noVipTopBg.png";
|
||||
const _imports_3$3 = "/pagesMine/static/icon/vip/titleLeft_v.png";
|
||||
const _imports_4$4 = "/pagesMine/static/icon/vip/titleLeft.png";
|
||||
const _imports_5$3 = "/pagesMine/static/icon/vip/titleRight_v.png";
|
||||
const _imports_6 = "/pagesMine/static/icon/vip/titleRight.png";
|
||||
const _imports_6$1 = "/pagesMine/static/icon/vip/titleRight.png";
|
||||
const _imports_7$1 = "/pagesMine/static/icon/vip/step1_v.png";
|
||||
const _imports_8$2 = "/pagesMine/static/icon/vip/step1.png";
|
||||
const _imports_9 = "/pagesMine/static/icon/vip/step2_v.png";
|
||||
@@ -85,22 +85,19 @@ const _imports_16 = "/pagesMine/static/icon/vip/industrialResearch.png";
|
||||
const _imports_17 = "/pagesMine/static/icon/vip/operatingDecision.png";
|
||||
const _imports_7 = "/pagesMine/static/icon/vip/notContain.png";
|
||||
const _imports_8$1 = "/pagesMine/static/icon/vip/contain.png";
|
||||
const _imports_2$4 = "/pagesStock/static/icon/establishedTime.png";
|
||||
const _imports_3$3 = "/pagesStock/static/icon/registeredCapital.png";
|
||||
const _imports_4$5 = "/pagesStock/static/icon/location.png";
|
||||
const _imports_2$3 = "/pagesStock/static/icon/establishedTime.png";
|
||||
const _imports_3$2 = "/pagesStock/static/icon/registeredCapital.png";
|
||||
const _imports_4$3 = "/pagesStock/static/icon/location.png";
|
||||
const _imports_5$2 = "/pagesStock/static/icon/noData.png";
|
||||
const _imports_1$6 = "/pagesStock/static/icon/existStatus.png";
|
||||
const _imports_8 = "/pagesStock/static/icon/yRightArrow.png";
|
||||
const _imports_4$4 = "/pagesStock/static/icon/all-down-ed.png";
|
||||
const _imports_2$3 = "/pagesStock/static/icon/contrast.png";
|
||||
const _imports_3$2 = "/pagesStock/static/icon/optional.png";
|
||||
const _imports_4$3 = "/pagesStock/static/icon/share.png";
|
||||
const _imports_4$2 = "/pagesStock/static/icon/all-icon-4.png";
|
||||
const _imports_4$2 = "/pagesStock/static/icon/all-down-ed.png";
|
||||
const _imports_4$1 = "/pagesStock/static/icon/all-icon-4.png";
|
||||
const _imports_0$7 = "/pagesStock/static/icon/cwfx-1.png";
|
||||
const _imports_2$2 = "/pagesStock/static/icon/all-icon-ed.png";
|
||||
const _imports_3$1 = "/pagesStock/static/icon/all-icon.png";
|
||||
const _imports_5$1 = "/pagesStock/static/icon/all-down.png";
|
||||
const _imports_4$1 = "/pagesStock/static/icon/cwfx-2.png";
|
||||
const _imports_2$2 = "/pagesStock/static/icon/all-icon-ed.png";
|
||||
const _imports_6 = "/pagesStock/static/icon/cwfx-2.png";
|
||||
const _imports_0$6 = "/pagesStock/static/icon/rightArrow.png";
|
||||
const _imports_0$5 = "/pagesStock/static/icon/logOffStatus.png";
|
||||
const _imports_0$4 = "/pagesStock/static/icon/shangJiantou.png";
|
||||
@@ -170,51 +167,47 @@ exports._imports_15$1 = _imports_15;
|
||||
exports._imports_16 = _imports_16$1;
|
||||
exports._imports_16$1 = _imports_16;
|
||||
exports._imports_17 = _imports_17;
|
||||
exports._imports_2 = _imports_2$e;
|
||||
exports._imports_2$1 = _imports_2$f;
|
||||
exports._imports_2$10 = _imports_2$5;
|
||||
exports._imports_2$11 = _imports_2$4;
|
||||
exports._imports_2$12 = _imports_2$3;
|
||||
exports._imports_2$13 = _imports_2$2;
|
||||
exports._imports_2$14 = _imports_2$1;
|
||||
exports._imports_2$15 = _imports_2;
|
||||
exports._imports_2$2 = _imports_2$d;
|
||||
exports._imports_2$3 = _imports_2$b;
|
||||
exports._imports_2$4 = _imports_2$c;
|
||||
exports._imports_2$5 = _imports_2$a;
|
||||
exports._imports_2$6 = _imports_2$9;
|
||||
exports._imports_2$7 = _imports_2$8;
|
||||
exports._imports_2$8 = _imports_2$7;
|
||||
exports._imports_2$9 = _imports_2$6;
|
||||
exports._imports_3 = _imports_3$d;
|
||||
exports._imports_3$1 = _imports_3$c;
|
||||
exports._imports_3$10 = _imports_3$3;
|
||||
exports._imports_3$11 = _imports_3$2;
|
||||
exports._imports_3$12 = _imports_3$1;
|
||||
exports._imports_3$13 = _imports_3;
|
||||
exports._imports_3$2 = _imports_3$b;
|
||||
exports._imports_3$3 = _imports_3$a;
|
||||
exports._imports_3$4 = _imports_3$9;
|
||||
exports._imports_3$5 = _imports_3$8;
|
||||
exports._imports_3$6 = _imports_3$7;
|
||||
exports._imports_3$7 = _imports_3$6;
|
||||
exports._imports_3$8 = _imports_3$5;
|
||||
exports._imports_3$9 = _imports_3$4;
|
||||
exports._imports_4 = _imports_4$d;
|
||||
exports._imports_4$1 = _imports_4$e;
|
||||
exports._imports_4$10 = _imports_4$4;
|
||||
exports._imports_4$11 = _imports_4$3;
|
||||
exports._imports_4$12 = _imports_4$2;
|
||||
exports._imports_4$13 = _imports_4$1;
|
||||
exports._imports_4$14 = _imports_4;
|
||||
exports._imports_4$2 = _imports_4$c;
|
||||
exports._imports_4$3 = _imports_4$b;
|
||||
exports._imports_4$4 = _imports_4$a;
|
||||
exports._imports_4$5 = _imports_4$9;
|
||||
exports._imports_4$6 = _imports_4$8;
|
||||
exports._imports_4$7 = _imports_4$7;
|
||||
exports._imports_4$8 = _imports_4$6;
|
||||
exports._imports_4$9 = _imports_4$5;
|
||||
exports._imports_2 = _imports_2$d;
|
||||
exports._imports_2$1 = _imports_2$e;
|
||||
exports._imports_2$10 = _imports_2$4;
|
||||
exports._imports_2$11 = _imports_2$3;
|
||||
exports._imports_2$12 = _imports_2$2;
|
||||
exports._imports_2$13 = _imports_2$1;
|
||||
exports._imports_2$14 = _imports_2;
|
||||
exports._imports_2$2 = _imports_2$c;
|
||||
exports._imports_2$3 = _imports_2$a;
|
||||
exports._imports_2$4 = _imports_2$b;
|
||||
exports._imports_2$5 = _imports_2$9;
|
||||
exports._imports_2$6 = _imports_2$8;
|
||||
exports._imports_2$7 = _imports_2$7;
|
||||
exports._imports_2$8 = _imports_2$6;
|
||||
exports._imports_2$9 = _imports_2$5;
|
||||
exports._imports_3 = _imports_3$c;
|
||||
exports._imports_3$1 = _imports_3$b;
|
||||
exports._imports_3$10 = _imports_3$2;
|
||||
exports._imports_3$11 = _imports_3$1;
|
||||
exports._imports_3$12 = _imports_3;
|
||||
exports._imports_3$2 = _imports_3$a;
|
||||
exports._imports_3$3 = _imports_3$9;
|
||||
exports._imports_3$4 = _imports_3$8;
|
||||
exports._imports_3$5 = _imports_3$7;
|
||||
exports._imports_3$6 = _imports_3$6;
|
||||
exports._imports_3$7 = _imports_3$5;
|
||||
exports._imports_3$8 = _imports_3$4;
|
||||
exports._imports_3$9 = _imports_3$3;
|
||||
exports._imports_4 = _imports_4$b;
|
||||
exports._imports_4$1 = _imports_4$c;
|
||||
exports._imports_4$10 = _imports_4$2;
|
||||
exports._imports_4$11 = _imports_4$1;
|
||||
exports._imports_4$12 = _imports_4;
|
||||
exports._imports_4$2 = _imports_4$a;
|
||||
exports._imports_4$3 = _imports_4$9;
|
||||
exports._imports_4$4 = _imports_4$8;
|
||||
exports._imports_4$5 = _imports_4$7;
|
||||
exports._imports_4$6 = _imports_4$6;
|
||||
exports._imports_4$7 = _imports_4$5;
|
||||
exports._imports_4$8 = _imports_4$4;
|
||||
exports._imports_4$9 = _imports_4$3;
|
||||
exports._imports_5 = _imports_5$8;
|
||||
exports._imports_5$1 = _imports_5$7;
|
||||
exports._imports_5$2 = _imports_5$6;
|
||||
@@ -224,9 +217,10 @@ exports._imports_5$5 = _imports_5$3;
|
||||
exports._imports_5$6 = _imports_5$2;
|
||||
exports._imports_5$7 = _imports_5$1;
|
||||
exports._imports_5$8 = _imports_5;
|
||||
exports._imports_6 = _imports_6$2;
|
||||
exports._imports_6$1 = _imports_6$1;
|
||||
exports._imports_6$2 = _imports_6;
|
||||
exports._imports_6 = _imports_6$3;
|
||||
exports._imports_6$1 = _imports_6$2;
|
||||
exports._imports_6$2 = _imports_6$1;
|
||||
exports._imports_6$3 = _imports_6;
|
||||
exports._imports_7 = _imports_7$2;
|
||||
exports._imports_7$1 = _imports_7$1;
|
||||
exports._imports_7$2 = _imports_7;
|
||||
|
||||
@@ -7051,9 +7051,9 @@ function isConsoleWritable() {
|
||||
return isWritable;
|
||||
}
|
||||
function initRuntimeSocketService() {
|
||||
const hosts = "127.0.0.1,192.168.2.28";
|
||||
const hosts = "127.0.0.1,192.168.2.91";
|
||||
const port = "8090";
|
||||
const id = "mp-weixin_am9vFk";
|
||||
const id = "mp-weixin_bAcvHX";
|
||||
const lazy = typeof swan !== "undefined";
|
||||
let restoreError = lazy ? () => {
|
||||
} : initOnError();
|
||||
|
||||
@@ -1 +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>
|
||||
<view class="word-cloud-container data-v-cab45d13"><canvas type="2d" class="word-cloud-canvas data-v-cab45d13" style="{{'width:' + a + ';' + ('height:' + b)}}"></canvas></view>
|
||||
@@ -2,6 +2,7 @@
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
const common_assets = require("../../common/assets.js");
|
||||
const echarts = require("../../uni_modules/lime-echart/static/echarts.min.js");
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {
|
||||
@@ -149,7 +150,14 @@ const _sfc_main = {
|
||||
//搜索结果
|
||||
selectSearchStockInfo: null,
|
||||
//选中的搜索股票信息
|
||||
isShowTime: false
|
||||
isShowTime: false,
|
||||
ec: { lazyLoad: true },
|
||||
// 延迟加载 ECharts
|
||||
chart: null,
|
||||
y2MaxText: "",
|
||||
// 右侧顶部最大值文本(例:2.36% / -0.89%)
|
||||
y2MinText: ""
|
||||
// 右侧底部最小值文本(例:-3.12% / 0.56%)
|
||||
};
|
||||
},
|
||||
onLoad(e) {
|
||||
@@ -354,6 +362,7 @@ const _sfc_main = {
|
||||
};
|
||||
request_api.marketHotspotOverview(param).then((res) => {
|
||||
var _a;
|
||||
const data = res == null ? void 0 : res.data;
|
||||
const alerts = ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.alerts) || [];
|
||||
const changePct = res.data.index.change_pct;
|
||||
let numPct = 0;
|
||||
@@ -404,9 +413,247 @@ const _sfc_main = {
|
||||
};
|
||||
const sortedAlerts = processedAlerts.sort(sortByTimeDesc);
|
||||
this.marketAlertsList = sortedAlerts;
|
||||
this.initChart(data.index.timeline, processedAlerts);
|
||||
}).catch((error) => {
|
||||
});
|
||||
},
|
||||
async initChart(timeline, alerts) {
|
||||
if (!timeline || timeline.length === 0)
|
||||
return;
|
||||
const chart = await this.$refs.chartRef.init(echarts);
|
||||
this.chartInstance = chart;
|
||||
const xAxisTime = timeline.map((item) => {
|
||||
var _a;
|
||||
return ((_a = item.time) == null ? void 0 : _a.trim()) || "";
|
||||
});
|
||||
const yAxisPrice = timeline.map((item) => Number(item.price) || 0);
|
||||
const changePctList = timeline.map((item) => Number(item.change_pct)).filter((val) => !isNaN(val) && val !== null && val !== void 0);
|
||||
const validPrices = yAxisPrice.filter((val) => val !== 0 && !isNaN(val));
|
||||
const priceMin = validPrices.length > 0 ? Math.min(...validPrices) : 0;
|
||||
const priceMax = validPrices.length > 0 ? Math.max(...validPrices) : 0;
|
||||
const priceRange = priceMax - priceMin;
|
||||
const yAxisMin = priceRange > 0 ? priceMin - priceRange * 0.1 : priceMin;
|
||||
const yAxisMax = priceRange > 0 ? priceMax + priceRange * 0.25 : priceMax;
|
||||
let y2Min = 0, y2Max = 0;
|
||||
if (changePctList.length > 0) {
|
||||
y2Min = Math.min(...changePctList);
|
||||
y2Max = Math.max(...changePctList);
|
||||
this.y2MaxText = Number(y2Max).toFixed(2) + "%";
|
||||
this.y2MinText = Number(y2Min).toFixed(2) + "%";
|
||||
} else {
|
||||
this.y2MaxText = "0.00%";
|
||||
this.y2MinText = "0.00%";
|
||||
}
|
||||
const alertObj = {};
|
||||
let totalAlert = 0;
|
||||
let sameTimeCount = 0;
|
||||
let sameScoreCount = 0;
|
||||
alerts.forEach((alert) => {
|
||||
var _a;
|
||||
if (!alert)
|
||||
return;
|
||||
const alertTime = ((_a = alert.time) == null ? void 0 : _a.trim()) || "";
|
||||
const alertScore = Number(alert.importance_score);
|
||||
if (alertTime === "" || isNaN(alertScore))
|
||||
return;
|
||||
const idx = xAxisTime.findIndex((t) => (t == null ? void 0 : t.trim()) === alertTime);
|
||||
if (idx === -1)
|
||||
return;
|
||||
totalAlert++;
|
||||
if (!alertObj[alertTime]) {
|
||||
alertObj[alertTime] = { ...alert, idx, importance_score: alertScore };
|
||||
} else {
|
||||
sameTimeCount++;
|
||||
const existAlert = alertObj[alertTime];
|
||||
if (alertScore > existAlert.importance_score) {
|
||||
alertObj[alertTime] = { ...alert, idx, importance_score: alertScore };
|
||||
} else if (alertScore === existAlert.importance_score) {
|
||||
sameScoreCount++;
|
||||
}
|
||||
}
|
||||
});
|
||||
const timeToMinutes = (timeStr) => {
|
||||
const [hour, minute] = timeStr.split(":").map(Number);
|
||||
return hour * 60 + minute;
|
||||
};
|
||||
const get10MinGroup = (minutes) => {
|
||||
const startMin = Math.floor(minutes / 10) * 10;
|
||||
const endMin = startMin + 9;
|
||||
const formatTime = (m) => {
|
||||
const h = Math.floor(m / 60).toString().padStart(2, "0");
|
||||
const mi = (m % 60).toString().padStart(2, "0");
|
||||
return `${h}:${mi}`;
|
||||
};
|
||||
return `${formatTime(startMin)}-${formatTime(endMin)}`;
|
||||
};
|
||||
const filterBy10MinGroup = (alertObj2) => {
|
||||
const alertGroupList = Object.keys(alertObj2).filter((time) => time && time.includes(":")).map((time) => {
|
||||
const minutes = timeToMinutes(time);
|
||||
return {
|
||||
group: get10MinGroup(minutes),
|
||||
// 所属10分钟分组
|
||||
score: alertObj2[time].importance_score,
|
||||
// 告警评分
|
||||
data: alertObj2[time]
|
||||
// 原始告警数据
|
||||
};
|
||||
});
|
||||
if (alertGroupList.length === 0)
|
||||
return {};
|
||||
const groupMap = {};
|
||||
alertGroupList.forEach((item) => {
|
||||
if (!groupMap[item.group]) {
|
||||
groupMap[item.group] = [];
|
||||
}
|
||||
groupMap[item.group].push(item);
|
||||
});
|
||||
const finalAlertObj = {};
|
||||
Object.keys(groupMap).forEach((groupName) => {
|
||||
const groupItems = groupMap[groupName];
|
||||
const sortedItems = groupItems.sort((a, b) => b.score - a.score);
|
||||
const topItem = sortedItems[0];
|
||||
finalAlertObj[topItem.data.time] = topItem.data;
|
||||
});
|
||||
return finalAlertObj;
|
||||
};
|
||||
const filteredAlertObj = filterBy10MinGroup(alertObj);
|
||||
const originalKeyLen = Object.keys(alertObj).length;
|
||||
const filteredKeyLen = Object.keys(filteredAlertObj).length;
|
||||
const groupDetail = Object.keys(filteredAlertObj).map((time) => {
|
||||
const minutes = timeToMinutes(time);
|
||||
return { time, group: get10MinGroup(minutes), score: filteredAlertObj[time].importance_score };
|
||||
});
|
||||
common_vendor.index.__f__("log", "at pages/geGuCenter/geGuCenter.vue:957", "===== 告警点处理全统计(10分钟分组版)=====");
|
||||
common_vendor.index.__f__("log", "at pages/geGuCenter/geGuCenter.vue:958", "1. 过滤后有效告警总数量:", totalAlert);
|
||||
common_vendor.index.__f__("log", "at pages/geGuCenter/geGuCenter.vue:959", "2. 相同时间的告警去重数量:", sameTimeCount);
|
||||
common_vendor.index.__f__("log", "at pages/geGuCenter/geGuCenter.vue:960", "3. 相同时间且相同评分数量:", sameScoreCount);
|
||||
common_vendor.index.__f__("log", "at pages/geGuCenter/geGuCenter.vue:961", "4. 基础去重后(同时间最高评分)数量:", originalKeyLen);
|
||||
common_vendor.index.__f__("log", "at pages/geGuCenter/geGuCenter.vue:962", "5. 10分钟分组后(每组取最高评分)数量:", filteredKeyLen);
|
||||
common_vendor.index.__f__("log", "at pages/geGuCenter/geGuCenter.vue:963", "6. 分组详情(时间→所属分组→评分):", groupDetail);
|
||||
common_vendor.index.__f__("log", "at pages/geGuCenter/geGuCenter.vue:964", "7. 分组后最终告警详情:", filteredAlertObj);
|
||||
const alertPoints = Object.values(filteredAlertObj).map((alert) => {
|
||||
const validIdx = !isNaN(alert.idx) && alert.idx >= 0 && alert.idx < xAxisTime.length ? alert.idx : 0;
|
||||
const xVal = xAxisTime[validIdx] || "";
|
||||
const yVal = !isNaN(yAxisPrice[validIdx]) ? yAxisPrice[validIdx] : 0;
|
||||
return {
|
||||
name: alert.concept_name || "未知概念",
|
||||
// 概念名兜底
|
||||
coord: [xVal, yVal],
|
||||
// 确保x轴值严格匹配xAxis.data,y轴值有效
|
||||
value: yVal,
|
||||
itemStyle: { color: "#FF4444" },
|
||||
// 告警点红色
|
||||
label: {
|
||||
formatter() {
|
||||
return alert.concept_name;
|
||||
},
|
||||
show: true,
|
||||
position: "top",
|
||||
fontSize: 10,
|
||||
color: "#FF4444",
|
||||
fontWeight: "500",
|
||||
distance: 5
|
||||
}
|
||||
};
|
||||
}).filter(Boolean);
|
||||
common_vendor.index.__f__("log", "at pages/geGuCenter/geGuCenter.vue:991", "8. 最终ECharts告警点数据(10分钟分组):", alertPoints);
|
||||
const option = {
|
||||
grid: { left: "4%", right: "8%", bottom: "8%", top: "10%", containLabel: true },
|
||||
xAxis: {
|
||||
type: "category",
|
||||
boundaryGap: false,
|
||||
data: xAxisTime,
|
||||
axisLabel: {
|
||||
fontSize: 12,
|
||||
rotate: 30,
|
||||
interval: Math.floor(xAxisTime.length / 6)
|
||||
},
|
||||
axisTick: {
|
||||
alignWithLabel: true,
|
||||
interval: Math.floor(xAxisTime.length / 6)
|
||||
}
|
||||
},
|
||||
yAxis: [
|
||||
{
|
||||
type: "value",
|
||||
min: yAxisMin,
|
||||
max: yAxisMax,
|
||||
nameTextStyle: { fontSize: 12 },
|
||||
axisLabel: {
|
||||
formatter: (val) => val.toFixed(0),
|
||||
fontSize: 12
|
||||
},
|
||||
splitLine: { lineStyle: { type: "dashed", color: "#EEEEEE" } },
|
||||
boundaryGap: [0.05, 0.05]
|
||||
// 上下留5%缓冲,避免顶点告警点被裁剪
|
||||
}
|
||||
],
|
||||
dataZoom: [],
|
||||
series: [
|
||||
{
|
||||
name: "上证指数",
|
||||
type: "line",
|
||||
smooth: true,
|
||||
symbol: "circle",
|
||||
symbolSize: 5,
|
||||
itemStyle: { color: "#0092FF" },
|
||||
lineStyle: {
|
||||
width: 2,
|
||||
color: "#0092FF",
|
||||
shadowColor: "rgba(0,146,255,0.5)",
|
||||
shadowBlur: 8,
|
||||
shadowOffsetY: 3,
|
||||
shadowOffsetX: 0
|
||||
},
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: "rgba(0,146,255,0.25)" },
|
||||
{ offset: 1, color: "rgba(0,146,255,0)" }
|
||||
])
|
||||
},
|
||||
data: yAxisPrice,
|
||||
// 保留所有markPoint显示修复配置(强制显示/层级/样式)
|
||||
markPoint: {
|
||||
show: true,
|
||||
// 强制开启显示(关键!)
|
||||
symbol: "circle",
|
||||
symbolSize: 5,
|
||||
// 比折线大,避免被遮挡
|
||||
z: 10,
|
||||
// 层级置顶,不被任何元素遮挡
|
||||
data: alertPoints,
|
||||
itemStyle: {
|
||||
color: "#FF4444",
|
||||
borderColor: "#fff",
|
||||
// 白色描边,更醒目
|
||||
borderWidth: 1
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: "top",
|
||||
fontSize: 10,
|
||||
color: "#FF4444",
|
||||
fontWeight: "500",
|
||||
distance: 6,
|
||||
backgroundColor: "rgba(255,255,255,0.8)",
|
||||
// 标签白色背景,防融合
|
||||
padding: [2, 4],
|
||||
borderRadius: 2,
|
||||
borderColor: "#FF4444",
|
||||
// 白色描边,更醒目
|
||||
borderWidth: 1
|
||||
}
|
||||
},
|
||||
yAxisIndex: 0
|
||||
}
|
||||
]
|
||||
};
|
||||
common_vendor.index.__f__("log", "at pages/geGuCenter/geGuCenter.vue:1082", "7. 分组后最终告警详情:", JSON.stringify(option.series));
|
||||
chart.setOption(option, true);
|
||||
common_vendor.index.onWindowResize(() => {
|
||||
this.chartInstance && this.chartInstance.resize();
|
||||
});
|
||||
},
|
||||
itemDetails(item) {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pagesStock/stockCenterDetails/stockCenterDetails?code=" + item.stock_code
|
||||
@@ -441,7 +688,7 @@ const _sfc_main = {
|
||||
},
|
||||
handleDateChange(date) {
|
||||
this.selectedDate = date;
|
||||
common_vendor.index.__f__("log", "at pages/geGuCenter/geGuCenter.vue:828", "选中的日期:", date);
|
||||
common_vendor.index.__f__("log", "at pages/geGuCenter/geGuCenter.vue:1124", "选中的日期:", date);
|
||||
},
|
||||
confirmAction(index) {
|
||||
if (index == 1) {
|
||||
@@ -449,7 +696,7 @@ const _sfc_main = {
|
||||
} else if (index == 2) {
|
||||
if (this.selectedDate) {
|
||||
this.currentDate = this.selectedDate;
|
||||
common_vendor.index.__f__("log", "at pages/geGuCenter/geGuCenter.vue:837", "最终确认的日期:", this.currentDate);
|
||||
common_vendor.index.__f__("log", "at pages/geGuCenter/geGuCenter.vue:1133", "最终确认的日期:", this.currentDate);
|
||||
} else {
|
||||
const now = /* @__PURE__ */ new Date();
|
||||
const year = now.getFullYear();
|
||||
@@ -469,7 +716,7 @@ const _sfc_main = {
|
||||
this.formattedAvg = item.formattedAvg, this.upCount = item.upCount, this.downCount = item.downCount, this.limit_up_ratio = item.limit_up_ratio, this.conceptStocksDetails(item.concept_id);
|
||||
},
|
||||
conceptStocksDetails(concept_id) {
|
||||
common_vendor.index.__f__("log", "at pages/geGuCenter/geGuCenter.vue:864", "concept_id", concept_id);
|
||||
common_vendor.index.__f__("log", "at pages/geGuCenter/geGuCenter.vue:1160", "concept_id", concept_id);
|
||||
request_api.conceptStocks(concept_id, {}).then((res) => {
|
||||
if (res.data && res.data.stocks) {
|
||||
let rawData = res.data.stocks;
|
||||
@@ -479,7 +726,7 @@ const _sfc_main = {
|
||||
return bValue - aValue;
|
||||
});
|
||||
} else {
|
||||
common_vendor.index.__f__("warn", "at pages/geGuCenter/geGuCenter.vue:883", "接口返回数据格式异常", res);
|
||||
common_vendor.index.__f__("warn", "at pages/geGuCenter/geGuCenter.vue:1179", "接口返回数据格式异常", res);
|
||||
}
|
||||
}).catch((error) => {
|
||||
});
|
||||
@@ -505,15 +752,17 @@ const _sfc_main = {
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_navBar2 = common_vendor.resolveComponent("navBar");
|
||||
const _easycom_l_echart2 = common_vendor.resolveComponent("l-echart");
|
||||
const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
|
||||
const _easycom_LCCalendar22 = common_vendor.resolveComponent("LCCalendar2");
|
||||
(_easycom_navBar2 + _easycom_uni_popup2 + _easycom_LCCalendar22)();
|
||||
(_easycom_navBar2 + _easycom_l_echart2 + _easycom_uni_popup2 + _easycom_LCCalendar22)();
|
||||
}
|
||||
const _easycom_navBar = () => "../../components/navBar/navBar.js";
|
||||
const _easycom_l_echart = () => "../../uni_modules/lime-echart/components/l-echart/l-echart.js";
|
||||
const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
|
||||
const _easycom_LCCalendar2 = () => "../../components/LCCalendar2/LCCalendar2.js";
|
||||
if (!Math) {
|
||||
(_easycom_navBar + _easycom_uni_popup + _easycom_LCCalendar2)();
|
||||
(_easycom_navBar + _easycom_l_echart + _easycom_uni_popup + _easycom_LCCalendar2)();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
@@ -587,11 +836,16 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
o: common_assets._imports_2$3,
|
||||
p: common_vendor.o((...args) => $options.moreAction && $options.moreAction(...args)),
|
||||
q: common_assets._imports_3$7,
|
||||
r: common_vendor.t($data.currentDate),
|
||||
s: common_assets._imports_4$1,
|
||||
t: common_vendor.o(($event) => $options.allAction(2)),
|
||||
v: common_assets._imports_3$7,
|
||||
w: common_vendor.f($data.marketAlertsList, (item, index, i0) => {
|
||||
r: common_assets._imports_4$1,
|
||||
s: common_vendor.o(($event) => $options.allAction(1)),
|
||||
t: common_vendor.t($data.currentDate),
|
||||
v: common_assets._imports_4$1,
|
||||
w: common_vendor.o(($event) => $options.allAction(2)),
|
||||
x: common_vendor.sr("chartRef", "c7f5c964-1"),
|
||||
y: common_vendor.t($data.y2MaxText),
|
||||
z: common_vendor.t($data.y2MinText),
|
||||
A: common_assets._imports_3$7,
|
||||
B: common_vendor.f($data.marketAlertsList, (item, index, i0) => {
|
||||
var _a, _b, _c, _d;
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(item.time),
|
||||
@@ -615,40 +869,40 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
q: common_vendor.o(($event) => $options.bkydAction(item), index)
|
||||
});
|
||||
}),
|
||||
x: common_assets._imports_5$3,
|
||||
y: common_vendor.s("top:" + $data.contentTop + "px;"),
|
||||
z: common_vendor.o(($event) => $options.closeAction(1)),
|
||||
A: common_vendor.o(($event) => $options.confirmAction(1)),
|
||||
B: common_vendor.f($data.typeList, (item, index, i0) => {
|
||||
C: common_assets._imports_5$3,
|
||||
D: common_vendor.s("top:" + $data.contentTop + "px;"),
|
||||
E: common_vendor.o(($event) => $options.closeAction(1)),
|
||||
F: common_vendor.o(($event) => $options.confirmAction(1)),
|
||||
G: common_vendor.f($data.typeList, (item, index, i0) => {
|
||||
return {
|
||||
a: item.backIcon,
|
||||
b: common_vendor.t(item.title),
|
||||
c: index
|
||||
};
|
||||
}),
|
||||
C: common_vendor.sr("typePopup", "c7f5c964-1"),
|
||||
D: common_vendor.p({
|
||||
type: "bottom",
|
||||
safeArea: false
|
||||
}),
|
||||
E: common_vendor.o(($event) => $options.closeAction(2)),
|
||||
F: common_vendor.o(($event) => $options.confirmAction(2)),
|
||||
G: common_vendor.o($options.handleDateChange),
|
||||
H: common_vendor.sr("datePopup", "c7f5c964-2"),
|
||||
H: common_vendor.sr("typePopup", "c7f5c964-2"),
|
||||
I: common_vendor.p({
|
||||
type: "bottom",
|
||||
safeArea: false
|
||||
}),
|
||||
J: common_assets._imports_6$1,
|
||||
K: common_vendor.o(($event) => $options.closeAction(3)),
|
||||
L: common_vendor.t($data.formattedAvg),
|
||||
M: Number($data.formattedAvg) > 0 ? "#EC3440" : "#01AB5D",
|
||||
N: common_vendor.t($data.upCount),
|
||||
O: $data.upCount > 0 ? "#EC3440" : "#888888",
|
||||
P: common_vendor.t($data.downCount),
|
||||
Q: $data.downCount > 0 ? "#01AB5D" : "#888888",
|
||||
R: common_vendor.t($options.formatLimitUpRatio($data.limit_up_ratio, 0)),
|
||||
S: common_vendor.f($data.conceptStocksList, (item, index, i0) => {
|
||||
J: common_vendor.o(($event) => $options.closeAction(2)),
|
||||
K: common_vendor.o(($event) => $options.confirmAction(2)),
|
||||
L: common_vendor.o($options.handleDateChange),
|
||||
M: common_vendor.sr("datePopup", "c7f5c964-3"),
|
||||
N: common_vendor.p({
|
||||
type: "bottom",
|
||||
safeArea: false
|
||||
}),
|
||||
O: common_assets._imports_6$1,
|
||||
P: common_vendor.o(($event) => $options.closeAction(3)),
|
||||
Q: common_vendor.t($data.formattedAvg),
|
||||
R: Number($data.formattedAvg) > 0 ? "#EC3440" : "#01AB5D",
|
||||
S: common_vendor.t($data.upCount),
|
||||
T: $data.upCount > 0 ? "#EC3440" : "#888888",
|
||||
U: common_vendor.t($data.downCount),
|
||||
V: $data.downCount > 0 ? "#01AB5D" : "#888888",
|
||||
W: common_vendor.t($options.formatLimitUpRatio($data.limit_up_ratio, 0)),
|
||||
X: common_vendor.f($data.conceptStocksList, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.name),
|
||||
b: common_vendor.t(item.code),
|
||||
@@ -658,8 +912,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
f: index % 2 == 0 ? "#fff" : "#FAFAFC"
|
||||
};
|
||||
}),
|
||||
T: common_vendor.sr("detailPopup", "c7f5c964-4"),
|
||||
U: common_vendor.p({
|
||||
Y: common_vendor.sr("detailPopup", "c7f5c964-5"),
|
||||
Z: common_vendor.p({
|
||||
type: "bottom",
|
||||
safeArea: false
|
||||
})
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"navigationBarTitleText": "",
|
||||
"usingComponents": {
|
||||
"nav-bar": "../../components/navBar/navBar",
|
||||
"l-echart": "../../uni_modules/lime-echart/components/l-echart/l-echart",
|
||||
"uni-popup": "../../uni_modules/uni-popup/components/uni-popup/uni-popup",
|
||||
"l-c-calendar2": "../../components/LCCalendar2/LCCalendar2"
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -202,6 +202,12 @@ const _sfc_main = {
|
||||
* @param {Object} code
|
||||
*/
|
||||
clickStockName(code) {
|
||||
if (code.indexOf(".") > -1) {
|
||||
code = code.split(".")[0];
|
||||
}
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pagesStock/stockCenterDetails/stockCenterDetails?code=" + code
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 点击查看股票详情
|
||||
|
||||
57
unpackage/dist/dev/mp-weixin/pages/ztfx/ztfx.js
vendored
57
unpackage/dist/dev/mp-weixin/pages/ztfx/ztfx.js
vendored
@@ -322,6 +322,10 @@ const _sfc_main = {
|
||||
onReady() {
|
||||
},
|
||||
methods: {
|
||||
// 词云绘制完成
|
||||
onWordCloudRendered() {
|
||||
common_vendor.index.hideLoading();
|
||||
},
|
||||
getStockHeatType(stock) {
|
||||
const days = stock.continuous_days_num || 0;
|
||||
if (days >= this.RISK_THRESHOLDS.CRITICAL) {
|
||||
@@ -462,9 +466,19 @@ const _sfc_main = {
|
||||
this.$refs.chartRef && this.initPieChart();
|
||||
break;
|
||||
case 1:
|
||||
common_vendor.index.showLoading({
|
||||
title: "词云生成中...",
|
||||
mask: true
|
||||
// 防止用户误触
|
||||
});
|
||||
this.initWordCloud();
|
||||
break;
|
||||
case 2:
|
||||
common_vendor.index.showLoading({
|
||||
title: "词云生成中...",
|
||||
mask: true
|
||||
// 防止用户误触
|
||||
});
|
||||
this.initWordCloud();
|
||||
break;
|
||||
}
|
||||
@@ -476,7 +490,7 @@ const _sfc_main = {
|
||||
const currentDay = String(now.getDate()).padStart(2, "0");
|
||||
const dateStr = `${currentYear}-${currentMonth}-${currentDay}`;
|
||||
if (!/^\d{4}-\d{2}-\d{2}$/.test(dateStr)) {
|
||||
common_vendor.index.__f__("error", "at pages/ztfx/ztfx.vue:749", "日期格式错误,请传入 YYYY-MM-DD 格式的日期");
|
||||
common_vendor.index.__f__("error", "at pages/ztfx/ztfx.vue:763", "日期格式错误,请传入 YYYY-MM-DD 格式的日期");
|
||||
return "";
|
||||
}
|
||||
const [year, month, day] = dateStr.split("-").map(Number);
|
||||
@@ -496,7 +510,7 @@ const _sfc_main = {
|
||||
const formattedDate = this.selectedFullDate;
|
||||
const baseURL = request_http.getBaseURL1();
|
||||
const requestUrl = `${baseURL}/data/zt/daily/${formattedDate}.json?t=${timestamp}`;
|
||||
common_vendor.index.__f__("log", "at pages/ztfx/ztfx.vue:782", "请求URL:", requestUrl);
|
||||
common_vendor.index.__f__("log", "at pages/ztfx/ztfx.vue:796", "请求URL:", requestUrl);
|
||||
const res = await common_vendor.index.request({
|
||||
url: requestUrl,
|
||||
method: "GET"
|
||||
@@ -535,7 +549,7 @@ const _sfc_main = {
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/ztfx/ztfx.vue:832", "请求异常:", error);
|
||||
common_vendor.index.__f__("error", "at pages/ztfx/ztfx.vue:846", "请求异常:", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "网络异常",
|
||||
icon: "none"
|
||||
@@ -585,18 +599,18 @@ const _sfc_main = {
|
||||
];
|
||||
if (this.$refs.chartRef) {
|
||||
const Piechart = await this.$refs.chartRef.init(echarts);
|
||||
common_vendor.index.__f__("log", "at pages/ztfx/ztfx.vue:893", "Piechart实例创建成功", Piechart);
|
||||
common_vendor.index.__f__("log", "at pages/ztfx/ztfx.vue:907", "Piechart实例创建成功", Piechart);
|
||||
Piechart.setOption(this.pieOption);
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/ztfx/ztfx.vue:897", "饼图初始化失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/ztfx/ztfx.vue:911", "饼图初始化失败:", error);
|
||||
}
|
||||
},
|
||||
// 初始化词云
|
||||
initWordCloud() {
|
||||
if (this.originData.word_freq_data && Array.isArray(this.originData.word_freq_data)) {
|
||||
this.wordData = this.originData.word_freq_data;
|
||||
common_vendor.index.__f__("log", "at pages/ztfx/ztfx.vue:906", "词云数据赋值完成", this.wordData);
|
||||
common_vendor.index.__f__("log", "at pages/ztfx/ztfx.vue:920", "词云数据赋值完成", this.wordData);
|
||||
} else {
|
||||
this.wordData = [{
|
||||
name: "脑机",
|
||||
@@ -606,10 +620,13 @@ const _sfc_main = {
|
||||
value: 3428
|
||||
}];
|
||||
}
|
||||
setTimeout(() => {
|
||||
common_vendor.index.hideLoading();
|
||||
}, 2e3);
|
||||
},
|
||||
handleDateChange(data) {
|
||||
var _a, _b, _c, _d;
|
||||
common_vendor.index.__f__("log", "at pages/ztfx/ztfx.vue:924", "从日历组件接收的参数:", {
|
||||
common_vendor.index.__f__("log", "at pages/ztfx/ztfx.vue:940", "从日历组件接收的参数:", {
|
||||
currentZtCount: (_a = data.item) == null ? void 0 : _a.zt_count,
|
||||
prevZtCount: (_b = data.prevItem) == null ? void 0 : _b.zt_count
|
||||
});
|
||||
@@ -647,7 +664,7 @@ const _sfc_main = {
|
||||
const prevDay = String(selectedDate.getDate()).padStart(2, "0");
|
||||
const prevDateFormatted = `${prevYear}${prevMonth}${prevDay}`;
|
||||
this.selectedFullDate = prevDateFormatted;
|
||||
common_vendor.index.__f__("log", "at pages/ztfx/ztfx.vue:982", `选中日期为当天(${todayFormatted}),已自动调整为前一天:`, prevDateFormatted);
|
||||
common_vendor.index.__f__("log", "at pages/ztfx/ztfx.vue:998", `选中日期为当天(${todayFormatted}),已自动调整为前一天:`, prevDateFormatted);
|
||||
}
|
||||
}
|
||||
this.fetchData();
|
||||
@@ -716,7 +733,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
a: common_vendor.t(item.title),
|
||||
b: common_vendor.t(item.count),
|
||||
c: index,
|
||||
d: item.bgColor
|
||||
d: item.bgColor,
|
||||
e: common_vendor.o(($event) => $options.bkydAction(index), index)
|
||||
};
|
||||
}),
|
||||
k: common_vendor.f($data.bkTypes, (item, index, i0) => {
|
||||
@@ -731,18 +749,19 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
l: common_vendor.sr("chartRef", "06b829a4-2"),
|
||||
m: $data.activeType === 0,
|
||||
n: $data.activeType === 1,
|
||||
o: common_vendor.p({
|
||||
o: common_vendor.o($options.onWordCloudRendered),
|
||||
p: common_vendor.p({
|
||||
wordData: $data.wordData,
|
||||
width: 330,
|
||||
height: 330
|
||||
}),
|
||||
p: common_assets._imports_3$8,
|
||||
q: common_vendor.t($data.highPositionStats.total_count),
|
||||
r: common_vendor.t($data.highPositionStats.avg_continuous_days),
|
||||
s: common_vendor.t($data.highPositionStats.max_continuous_days),
|
||||
t: common_vendor.t($data.riskAssessment.level),
|
||||
v: $data.riskAssessment.color,
|
||||
w: common_vendor.f($data.highPositionStockList, (stock, index, i0) => {
|
||||
q: common_assets._imports_3$8,
|
||||
r: common_vendor.t($data.highPositionStats.total_count),
|
||||
s: common_vendor.t($data.highPositionStats.avg_continuous_days),
|
||||
t: common_vendor.t($data.highPositionStats.max_continuous_days),
|
||||
v: common_vendor.t($data.riskAssessment.level),
|
||||
w: $data.riskAssessment.color,
|
||||
x: common_vendor.f($data.highPositionStockList, (stock, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(stock.sname),
|
||||
b: common_vendor.t(stock.risk_info.status),
|
||||
@@ -759,8 +778,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
k: index
|
||||
});
|
||||
}),
|
||||
x: common_assets._imports_5$4,
|
||||
y: common_vendor.s("top:" + $data.contentTop + "px;")
|
||||
y: common_assets._imports_5$4,
|
||||
z: common_vendor.s("top:" + $data.contentTop + "px;")
|
||||
};
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,6 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../common/vendor.js");
|
||||
const utils_util = require("../../../utils/util.js");
|
||||
const common_assets = require("../../../common/assets.js");
|
||||
const echarts = require("../../../uni_modules/lime-echart/static/echarts.min.js");
|
||||
const _sfc_main = {
|
||||
@@ -33,6 +34,7 @@ const _sfc_main = {
|
||||
}
|
||||
],
|
||||
profitabilityIndicatorIndex: 0,
|
||||
profitabilitySingleQuarterAllIndex: 0,
|
||||
perShareIndicatorList: [
|
||||
{
|
||||
title: "每股收益(EPS)"
|
||||
@@ -60,6 +62,7 @@ const _sfc_main = {
|
||||
}
|
||||
],
|
||||
perShareIndicatorIndex: 0,
|
||||
perShareSingleQuarterAllIndex: 0,
|
||||
option1: {
|
||||
legend: {
|
||||
show: true,
|
||||
@@ -71,14 +74,28 @@ const _sfc_main = {
|
||||
top: "5%",
|
||||
bottom: "30%"
|
||||
},
|
||||
xAxis: {
|
||||
type: "category",
|
||||
data: [],
|
||||
axisLabel: {
|
||||
fontSize: 10,
|
||||
rotate: 45
|
||||
xAxis: [
|
||||
{
|
||||
type: "category",
|
||||
data: [],
|
||||
axisLabel: {
|
||||
fontSize: 10
|
||||
}
|
||||
},
|
||||
{
|
||||
type: "category",
|
||||
data: [],
|
||||
axisLine: {
|
||||
show: false
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
axisLabel: {
|
||||
show: false
|
||||
}
|
||||
}
|
||||
},
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: "value",
|
||||
@@ -99,9 +116,9 @@ const _sfc_main = {
|
||||
}
|
||||
}
|
||||
],
|
||||
dataZoom: [{
|
||||
type: "slider"
|
||||
}],
|
||||
// dataZoom:[{
|
||||
// type:'slider'
|
||||
// }],
|
||||
series: [
|
||||
{
|
||||
type: "bar",
|
||||
@@ -156,9 +173,9 @@ const _sfc_main = {
|
||||
}
|
||||
}
|
||||
],
|
||||
dataZoom: [{
|
||||
type: "slider"
|
||||
}],
|
||||
// dataZoom:[{
|
||||
// type:'slider'
|
||||
// }],
|
||||
series: [
|
||||
{
|
||||
type: "bar",
|
||||
@@ -173,7 +190,10 @@ const _sfc_main = {
|
||||
yAxisIndex: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
accDiv: utils_util.accDiv,
|
||||
accSub: utils_util.accSub,
|
||||
accMul: utils_util.accMul
|
||||
};
|
||||
},
|
||||
props: {
|
||||
@@ -181,31 +201,12 @@ const _sfc_main = {
|
||||
},
|
||||
watch: {
|
||||
dataList(newValue) {
|
||||
let category = [];
|
||||
let data1 = [];
|
||||
let data2 = [];
|
||||
for (let item of newValue) {
|
||||
var type = item.report_type;
|
||||
type = type.replace("年三季报", "Q3");
|
||||
type = type.replace("年一季报", "Q1");
|
||||
type = type.replace("年中报", "中报");
|
||||
type = type.replace("年年报", "年报");
|
||||
category.push(type);
|
||||
if (item.profitability.roe) {
|
||||
data1.push(item.profitability.roe.toFixed(2));
|
||||
} else
|
||||
data1.push(0);
|
||||
if (item.per_share_metrics.eps) {
|
||||
data2.push(item.per_share_metrics.eps.toFixed(2));
|
||||
} else
|
||||
data2.push(0);
|
||||
if (this.profitabilitySingleQuarterAllIndex == 0) {
|
||||
this.getROESingleQuarterData();
|
||||
} else {
|
||||
this.getROEAllData();
|
||||
}
|
||||
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();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -226,11 +227,10 @@ const _sfc_main = {
|
||||
this.profitabilityIndicatorIndex = index;
|
||||
let data = [];
|
||||
if (index == 0) {
|
||||
for (let item of this.dataList) {
|
||||
if (item.profitability.roe) {
|
||||
data.push(item.profitability.roe.toFixed(2));
|
||||
} else
|
||||
data.push(0);
|
||||
if (this.profitabilitySingleQuarterAllIndex == 0) {
|
||||
this.getROESingleQuarterData();
|
||||
} else {
|
||||
this.getROEAllData();
|
||||
}
|
||||
} else if (index == 1) {
|
||||
for (let item of this.dataList) {
|
||||
@@ -241,8 +241,8 @@ const _sfc_main = {
|
||||
}
|
||||
} else if (index == 2) {
|
||||
for (let item of this.dataList) {
|
||||
if (item.profitability.roe_deducted) {
|
||||
data.push(item.profitability.roe_deducted.toFixed(2));
|
||||
if (item.profitability.roe_weighted) {
|
||||
data.push(item.profitability.roe_weighted.toFixed(2));
|
||||
} else
|
||||
data.push(0);
|
||||
}
|
||||
@@ -286,6 +286,303 @@ const _sfc_main = {
|
||||
this.profitabilityInit();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 盈利能力切换单季度还是全部
|
||||
*/
|
||||
clickProfitabilitySingleQuarterOrAll(index) {
|
||||
if (this.profitabilitySingleQuarterAllIndex != index) {
|
||||
this.profitabilitySingleQuarterAllIndex = index;
|
||||
if (index == 0) {
|
||||
if (this.profitabilityIndicatorIndex == 0) {
|
||||
this.getROESingleQuarterData();
|
||||
} else if (this.profitabilityIndicatorIndex == 1) {
|
||||
this.getOwnerEquitySingleQuarterData();
|
||||
} else if (this.profitabilityIndicatorIndex == 2) {
|
||||
this.getOwnerEquitySingleQuarterData();
|
||||
}
|
||||
} else {
|
||||
if (this.profitabilityIndicatorIndex == 0) {
|
||||
this.getROEAllData();
|
||||
} else if (this.profitabilityIndicatorIndex == 1) {
|
||||
this.getOwnerEquityAllData();
|
||||
}
|
||||
}
|
||||
this.profitabilityInit();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 获取净资产收益率单季度数据
|
||||
*/
|
||||
getROESingleQuarterData() {
|
||||
let category = [];
|
||||
let currentYear = this.dataList[0].period.split("-")[0];
|
||||
var currentYearCount = 0;
|
||||
for (let item of this.dataList) {
|
||||
let year = item.period.split("-")[0];
|
||||
if (year == currentYear) {
|
||||
currentYearCount++;
|
||||
}
|
||||
}
|
||||
let years = (16 - currentYearCount) / 4;
|
||||
let showDataCount = years * 4 + currentYearCount;
|
||||
let showDataList = this.dataList.slice(0, showDataCount);
|
||||
for (var i = 0; i <= years; i++) {
|
||||
category.unshift(currentYear - i);
|
||||
}
|
||||
let data1 = [];
|
||||
let data2 = [];
|
||||
let data3 = [];
|
||||
let data4 = [];
|
||||
for (let item of showDataList) {
|
||||
for (let item1 of category) {
|
||||
let index = showDataList.indexOf(item);
|
||||
let lastItem = showDataList[index + 1];
|
||||
if (item1 + "年一季报" == item.report_type) {
|
||||
if (item.profitability.roe) {
|
||||
data1.unshift(item.profitability.roe.toFixed(2));
|
||||
} else
|
||||
data1.unshift(0);
|
||||
}
|
||||
if (item1 + "年中报" == item.report_type) {
|
||||
if (item.profitability.roe) {
|
||||
data2.unshift(utils_util.accSub(item.profitability.roe, lastItem.profitability.roe));
|
||||
} else
|
||||
data2.unshift(0);
|
||||
}
|
||||
if (item1 + "年三季报" == item.report_type) {
|
||||
if (item.profitability.roe) {
|
||||
data3.unshift(utils_util.accSub(item.profitability.roe, lastItem.profitability.roe));
|
||||
} else
|
||||
data3.unshift(0);
|
||||
}
|
||||
if (item1 + "年年报" == item.report_type) {
|
||||
if (item.profitability.roe) {
|
||||
data4.unshift(utils_util.accSub(item.profitability.roe, lastItem.profitability.roe));
|
||||
} else
|
||||
data4.unshift(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
common_vendor.index.__f__("log", "at pagesStock/components/cwfx-view/cwfx-view.vue:476", data1, data2, data3, data4);
|
||||
let sumData = [];
|
||||
for (var i = 0; i < data1.length; i++) {
|
||||
let sum = data1[i];
|
||||
sum = utils_util.accAdd(sum, data2[i] ? data2[i] : 0);
|
||||
sum = utils_util.accAdd(sum, data3[i] ? data3[i] : 0);
|
||||
sum = utils_util.accAdd(sum, data4[i] ? data4[i] : 0).toFixed(2);
|
||||
if (sum > 1e4) {
|
||||
sumData.push((sum / 1e4).toFixed(2) + "万");
|
||||
} else
|
||||
sumData.push(sum);
|
||||
}
|
||||
this.option1.legend.data = ["第一季度", "第二季度", "第三季度", "第四季度"];
|
||||
this.option1.xAxis[0].data = category;
|
||||
this.option1.xAxis[1].data = category;
|
||||
this.option1.series = [
|
||||
{
|
||||
type: "bar",
|
||||
name: "第一季度",
|
||||
barWidth: "15%",
|
||||
data: data1,
|
||||
yAxisIndex: 0
|
||||
},
|
||||
{
|
||||
type: "bar",
|
||||
name: "第二季度",
|
||||
barWidth: "15%",
|
||||
data: data2,
|
||||
yAxisIndex: 0
|
||||
},
|
||||
{
|
||||
type: "bar",
|
||||
name: "第三季度",
|
||||
barWidth: "15%",
|
||||
data: data3,
|
||||
yAxisIndex: 0
|
||||
},
|
||||
{
|
||||
type: "bar",
|
||||
name: "第四季度",
|
||||
barWidth: "15%",
|
||||
data: data4,
|
||||
yAxisIndex: 0
|
||||
},
|
||||
{
|
||||
type: "bar",
|
||||
name: "总值",
|
||||
data: sumData,
|
||||
barWidth: "70%",
|
||||
xAxisIndex: 1,
|
||||
yAxisIndex: 0,
|
||||
itemStyle: {
|
||||
color: "rgba(0,0,0,0.2)"
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: "top"
|
||||
}
|
||||
}
|
||||
];
|
||||
},
|
||||
/**
|
||||
* 获取净资产收益率全部数据
|
||||
*/
|
||||
getROEAllData() {
|
||||
let showDataList = this.dataList.slice(0, 8);
|
||||
let category = [];
|
||||
let data1 = [];
|
||||
let data2 = [];
|
||||
let data3 = [];
|
||||
let data4 = [];
|
||||
for (let item of showDataList) {
|
||||
let index = showDataList.indexOf(item);
|
||||
if (index < showDataList.length - 3) {
|
||||
let type = item.report_type;
|
||||
type = type.replaceAll("三季报", "\n三季报");
|
||||
type = type.replaceAll("年报", "\n年报");
|
||||
type = type.replaceAll("中报", "\n中报");
|
||||
type = type.replaceAll("一季报", "\n一季报");
|
||||
category.unshift(type);
|
||||
let lastItem1 = showDataList[index + 1];
|
||||
let lastItem2 = showDataList[index + 2];
|
||||
let lastItem3 = showDataList[index + 3];
|
||||
if (item.report_type.indexOf("三季报") > -1) {
|
||||
if (item.profitability.roe) {
|
||||
data4.unshift(0);
|
||||
data3.unshift(utils_util.accSub(item.profitability.roe, lastItem1.profitability.roe).toFixed(2));
|
||||
data2.unshift(utils_util.accDiv(utils_util.accSub(lastItem1.profitability.roe, lastItem2.profitability.roe), 1e8).toFixed(2));
|
||||
data1.unshift(utils_util.accDiv(lastItem2.profitability.roe, 1e8).toFixed(2));
|
||||
} else {
|
||||
data4.unshift(0);
|
||||
data3.unshift(0);
|
||||
data2.unshift(0);
|
||||
data1.unshift(0);
|
||||
}
|
||||
} else if (item.report_type.indexOf("中报") > -1) {
|
||||
if (item.profitability.roe) {
|
||||
data4.unshift(0);
|
||||
data3.unshift(0);
|
||||
data2.unshift(utils_util.accDiv(utils_util.accSub(item.profitability.roe, lastItem1.profitability.roe), 1e8).toFixed(2));
|
||||
data1.unshift(utils_util.accDiv(lastItem1.profitability.roe, 1e8).toFixed(2));
|
||||
} else {
|
||||
data4.unshift(0);
|
||||
data3.unshift(0);
|
||||
data2.unshift(0);
|
||||
data1.unshift(0);
|
||||
}
|
||||
} else if (item.report_type.indexOf("一季报") > -1) {
|
||||
if (item.profitability.roe) {
|
||||
data4.unshift(0);
|
||||
data3.unshift(0);
|
||||
data2.unshift(0);
|
||||
data1.unshift(utils_util.accDiv(item.profitability.roe, 1e8).toFixed(2));
|
||||
} else {
|
||||
data4.unshift(0);
|
||||
data3.unshift(0);
|
||||
data2.unshift(0);
|
||||
data1.unshift(0);
|
||||
}
|
||||
} else if (item.report_type.indexOf("年报") > -1) {
|
||||
if (item.profitability.roe) {
|
||||
data4.unshift(utils_util.accDiv(utils_util.accSub(item.profitability.roe, lastItem1.profitability.roe), 1e8).toFixed(2));
|
||||
data3.unshift(utils_util.accDiv(utils_util.accSub(lastItem1.profitability.roe, lastItem2.profitability.roe), 1e8).toFixed(2));
|
||||
data2.unshift(utils_util.accDiv(utils_util.accSub(lastItem2.profitability.roe, lastItem3.profitability.roe), 1e8).toFixed(2));
|
||||
data1.unshift(utils_util.accDiv(lastItem3.profitability.roe, 1e8).toFixed(2));
|
||||
} else {
|
||||
data4.unshift(0);
|
||||
data3.unshift(0);
|
||||
data2.unshift(0);
|
||||
data1.unshift(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
let sumData = [];
|
||||
for (var i = 0; i < data1.length; i++) {
|
||||
let sum = data1[i];
|
||||
sum = utils_util.accAdd(sum, data2[i]);
|
||||
sum = utils_util.accAdd(sum, data3[i]);
|
||||
sum = utils_util.accAdd(sum, data4[i]).toFixed(2);
|
||||
if (sum > 1e4) {
|
||||
sumData.push((sum / 1e4).toFixed(2) + "万");
|
||||
} else
|
||||
sumData.push(sum);
|
||||
}
|
||||
this.option1.xAxis[0].data = category;
|
||||
let ratioList = [];
|
||||
for (let item of showDataList) {
|
||||
let index = showDataList.indexOf(item);
|
||||
if (index < showDataList.length - 3) {
|
||||
let lastItem = this.dataList[index + 4];
|
||||
ratioList.unshift(utils_util.accMul(utils_util.accDiv(utils_util.accSub(item.profitability.roe, lastItem.profitability.roe), Math.abs(lastItem.profitability.roe)), 100).toFixed(2));
|
||||
}
|
||||
}
|
||||
this.option1.tooltip = {
|
||||
show: true,
|
||||
confine: true,
|
||||
formatter(params) {
|
||||
let index = params.dataIndex;
|
||||
let str = params.name + ":" + sumData[index];
|
||||
if (data1[index] != 0) {
|
||||
str += "\n第一季度:" + data1[index];
|
||||
}
|
||||
if (data2[index] != 0) {
|
||||
str += "\n第二季度:" + data2[index];
|
||||
}
|
||||
if (data3[index] != 0) {
|
||||
str += "\n第三季度:" + data3[index];
|
||||
}
|
||||
if (data4[index] != 0) {
|
||||
str += "\n第四季度:" + data4[index];
|
||||
}
|
||||
str += "\n同比(右)" + ratioList[index];
|
||||
return str;
|
||||
}
|
||||
};
|
||||
this.option1.series = [
|
||||
{
|
||||
type: "bar",
|
||||
name: "第一季度",
|
||||
data: data1,
|
||||
stack: "quarter",
|
||||
yAxisIndex: 0,
|
||||
label: {
|
||||
show: true,
|
||||
position: "top",
|
||||
formatter(params) {
|
||||
return sumData[params.dataIndex];
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type: "bar",
|
||||
name: "第二季度",
|
||||
data: data2,
|
||||
stack: "quarter",
|
||||
yAxisIndex: 0
|
||||
},
|
||||
{
|
||||
type: "bar",
|
||||
name: "第三季度",
|
||||
data: data3,
|
||||
yAxisIndex: 0,
|
||||
stack: "quarter"
|
||||
},
|
||||
{
|
||||
type: "bar",
|
||||
name: "第四季度",
|
||||
data: data4,
|
||||
yAxisIndex: 0,
|
||||
stack: "quarter"
|
||||
},
|
||||
{
|
||||
type: "line",
|
||||
name: "同比(右)",
|
||||
data: ratioList,
|
||||
yAxisIndex: 1
|
||||
}
|
||||
];
|
||||
},
|
||||
/**
|
||||
* 切换每股指标
|
||||
* @param {Object} item
|
||||
@@ -354,6 +651,289 @@ const _sfc_main = {
|
||||
this.option2.series[0].data = data;
|
||||
this.perShareInit();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 获取期间费用单季度数据
|
||||
*/
|
||||
getPeriodExpensesSingleQuarterData() {
|
||||
let category = [];
|
||||
let currentYear = this.incomeStatementList[0].period.split("-")[0];
|
||||
var currentYearCount = 0;
|
||||
for (let item of this.incomeStatementList) {
|
||||
let year = item.period.split("-")[0];
|
||||
if (year == currentYear) {
|
||||
currentYearCount++;
|
||||
}
|
||||
}
|
||||
let years = (16 - currentYearCount) / 4;
|
||||
let showDataCount = years * 4 + currentYearCount;
|
||||
let showDataList = this.incomeStatementList.slice(0, showDataCount);
|
||||
for (var i = 0; i <= years; i++) {
|
||||
category.unshift(currentYear - i);
|
||||
}
|
||||
let data1 = [];
|
||||
let data2 = [];
|
||||
let data3 = [];
|
||||
let data4 = [];
|
||||
for (let item of showDataList) {
|
||||
for (let item1 of category) {
|
||||
let index = showDataList.indexOf(item);
|
||||
let lastItem = showDataList[index + 1];
|
||||
let total1 = utils_util.accAdd(utils_util.accAdd(utils_util.accAdd(item.costs.selling_expenses, item.costs.admin_expenses), item.costs.rd_expenses), item.costs.financial_expenses);
|
||||
let total2 = 0;
|
||||
if (lastItem) {
|
||||
total2 = utils_util.accAdd(utils_util.accAdd(utils_util.accAdd(lastItem.costs.selling_expenses, lastItem.costs.admin_expenses), lastItem.costs.rd_expenses), lastItem.costs.financial_expenses);
|
||||
}
|
||||
if (item1 + "年一季报" == item.report_type) {
|
||||
if (total1) {
|
||||
data1.unshift(utils_util.accDiv(total1, 1e8).toFixed(2));
|
||||
} else
|
||||
data1.unshift(0);
|
||||
}
|
||||
if (item1 + "年中报" == item.report_type) {
|
||||
if (total1 && total2) {
|
||||
data2.unshift(utils_util.accDiv(utils_util.accSub(total1, total2), 1e8).toFixed(2));
|
||||
} else
|
||||
data2.unshift(0);
|
||||
}
|
||||
if (item1 + "年三季报" == item.report_type) {
|
||||
if (total1 && total2) {
|
||||
data3.unshift(utils_util.accDiv(utils_util.accSub(total1, total2), 1e8).toFixed(2));
|
||||
} else
|
||||
data3.unshift(0);
|
||||
}
|
||||
if (item1 + "年年报" == item.report_type) {
|
||||
if (total1 && total2) {
|
||||
data4.unshift(utils_util.accDiv(utils_util.accSub(total1, total2), 1e8).toFixed(2));
|
||||
} else
|
||||
data4.unshift(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
let sumData = [];
|
||||
for (var i = 0; i < data1.length; i++) {
|
||||
let sum = data1[i];
|
||||
sum = utils_util.accAdd(sum, data2[i] ? data2[i] : 0);
|
||||
sum = utils_util.accAdd(sum, data3[i] ? data3[i] : 0);
|
||||
sum = utils_util.accAdd(sum, data4[i] ? data4[i] : 0).toFixed(2);
|
||||
if (sum > 1e4) {
|
||||
sumData.push((sum / 1e4).toFixed(2) + "万");
|
||||
} else
|
||||
sumData.push(sum);
|
||||
}
|
||||
this.option2.legend.data = ["第一季度", "第二季度", "第三季度", "第四季度"];
|
||||
this.option3.xAxis[0].data = category;
|
||||
this.option3.xAxis[1].data = category;
|
||||
this.option3.series = [
|
||||
{
|
||||
type: "bar",
|
||||
name: "第一季度",
|
||||
barWidth: "15%",
|
||||
data: data1,
|
||||
yAxisIndex: 0
|
||||
},
|
||||
{
|
||||
type: "bar",
|
||||
name: "第二季度",
|
||||
barWidth: "15%",
|
||||
data: data2,
|
||||
yAxisIndex: 0
|
||||
},
|
||||
{
|
||||
type: "bar",
|
||||
name: "第三季度",
|
||||
barWidth: "15%",
|
||||
data: data3,
|
||||
yAxisIndex: 0
|
||||
},
|
||||
{
|
||||
type: "bar",
|
||||
name: "第四季度",
|
||||
barWidth: "15%",
|
||||
data: data4,
|
||||
yAxisIndex: 0
|
||||
},
|
||||
{
|
||||
type: "bar",
|
||||
name: "总值",
|
||||
data: sumData,
|
||||
barWidth: "70%",
|
||||
xAxisIndex: 1,
|
||||
yAxisIndex: 0,
|
||||
itemStyle: {
|
||||
color: "rgba(0,0,0,0.2)"
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: "top"
|
||||
}
|
||||
}
|
||||
];
|
||||
},
|
||||
/**
|
||||
* 获取期间费用全部数据
|
||||
*/
|
||||
getPeriodExpensesAllData() {
|
||||
let showDataList = this.incomeStatementList.slice(0, 8);
|
||||
let category = [];
|
||||
let data1 = [];
|
||||
let data2 = [];
|
||||
let data3 = [];
|
||||
let data4 = [];
|
||||
for (let item of showDataList) {
|
||||
let index = showDataList.indexOf(item);
|
||||
if (index < showDataList.length - 3) {
|
||||
let type = item.report_type;
|
||||
type = type.replaceAll("三季报", "\n三季报");
|
||||
type = type.replaceAll("年报", "\n年报");
|
||||
type = type.replaceAll("中报", "\n中报");
|
||||
type = type.replaceAll("一季报", "\n一季报");
|
||||
category.unshift(type);
|
||||
let lastItem1 = showDataList[index + 1];
|
||||
let lastItem2 = showDataList[index + 2];
|
||||
let lastItem3 = showDataList[index + 3];
|
||||
let total1 = utils_util.accAdd(utils_util.accAdd(utils_util.accAdd(item.costs.selling_expenses, item.costs.admin_expenses), item.costs.rd_expenses), item.costs.financial_expenses);
|
||||
let total2 = utils_util.accAdd(utils_util.accAdd(utils_util.accAdd(lastItem1.costs.selling_expenses, lastItem1.costs.admin_expenses), lastItem1.costs.rd_expenses), lastItem1.costs.financial_expenses);
|
||||
let total3 = utils_util.accAdd(utils_util.accAdd(utils_util.accAdd(lastItem2.costs.selling_expenses, lastItem2.costs.admin_expenses), lastItem2.costs.rd_expenses), lastItem2.costs.financial_expenses);
|
||||
let total4 = utils_util.accAdd(utils_util.accAdd(utils_util.accAdd(lastItem3.costs.selling_expenses, lastItem3.costs.admin_expenses), lastItem3.costs.rd_expenses), lastItem3.costs.financial_expenses);
|
||||
if (item.report_type.indexOf("三季报") > -1) {
|
||||
if (total1 && total2 && total3) {
|
||||
data4.unshift(0);
|
||||
data3.unshift(utils_util.accDiv(utils_util.accSub(total1, total2), 1e8).toFixed(2));
|
||||
data2.unshift(utils_util.accDiv(utils_util.accSub(total2, total3), 1e8).toFixed(2));
|
||||
data1.unshift(utils_util.accDiv(total3, 1e8).toFixed(2));
|
||||
} else {
|
||||
data4.unshift(0);
|
||||
data3.unshift(0);
|
||||
data2.unshift(0);
|
||||
data1.unshift(0);
|
||||
}
|
||||
} else if (item.report_type.indexOf("中报") > -1) {
|
||||
if (total1 && total2) {
|
||||
data4.unshift(0);
|
||||
data3.unshift(0);
|
||||
data2.unshift(utils_util.accDiv(utils_util.accSub(total1, total2), 1e8).toFixed(2));
|
||||
data1.unshift(utils_util.accDiv(total2, 1e8).toFixed(2));
|
||||
} else {
|
||||
data4.unshift(0);
|
||||
data3.unshift(0);
|
||||
data2.unshift(0);
|
||||
data1.unshift(0);
|
||||
}
|
||||
} else if (item.report_type.indexOf("一季报") > -1) {
|
||||
if (total1) {
|
||||
data4.unshift(0);
|
||||
data3.unshift(0);
|
||||
data2.unshift(0);
|
||||
data1.unshift(utils_util.accDiv(total1, 1e8).toFixed(2));
|
||||
} else {
|
||||
data4.unshift(0);
|
||||
data3.unshift(0);
|
||||
data2.unshift(0);
|
||||
data1.unshift(0);
|
||||
}
|
||||
} else if (item.report_type.indexOf("年报") > -1) {
|
||||
if (total1 && total2 && total3 && total4) {
|
||||
data4.unshift(utils_util.accDiv(utils_util.accSub(total1, total2), 1e8).toFixed(2));
|
||||
data3.unshift(utils_util.accDiv(utils_util.accSub(total2, total3), 1e8).toFixed(2));
|
||||
data2.unshift(utils_util.accDiv(utils_util.accSub(total3, total4), 1e8).toFixed(2));
|
||||
data1.unshift(utils_util.accDiv(total4, 1e8).toFixed(2));
|
||||
} else {
|
||||
data4.unshift(0);
|
||||
data3.unshift(0);
|
||||
data2.unshift(0);
|
||||
data1.unshift(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
let sumData = [];
|
||||
for (var i = 0; i < data1.length; i++) {
|
||||
let sum = data1[i];
|
||||
sum = utils_util.accAdd(sum, data2[i]);
|
||||
sum = utils_util.accAdd(sum, data3[i]);
|
||||
sum = utils_util.accAdd(sum, data4[i]).toFixed(2);
|
||||
if (sum > 1e4) {
|
||||
sumData.push((sum / 1e4).toFixed(2) + "万");
|
||||
} else
|
||||
sumData.push(sum);
|
||||
}
|
||||
this.option3.xAxis[0].data = category;
|
||||
let ratioList = [];
|
||||
for (let item of showDataList) {
|
||||
let index = showDataList.indexOf(item);
|
||||
if (index < showDataList.length - 3) {
|
||||
let lastItem = this.incomeStatementList[index + 4];
|
||||
let total1 = utils_util.accAdd(utils_util.accAdd(utils_util.accAdd(item.costs.selling_expenses, item.costs.admin_expenses), item.costs.rd_expenses), item.costs.financial_expenses);
|
||||
let total2 = utils_util.accAdd(utils_util.accAdd(utils_util.accAdd(lastItem.costs.selling_expenses, lastItem.costs.admin_expenses), lastItem.costs.rd_expenses), lastItem.costs.financial_expenses);
|
||||
ratioList.unshift(utils_util.accMul(utils_util.accDiv(utils_util.accSub(total1, total2), Math.abs(total2)), 100).toFixed(2));
|
||||
}
|
||||
}
|
||||
this.option3.tooltip = {
|
||||
show: true,
|
||||
confine: true,
|
||||
formatter(params) {
|
||||
let index = params.dataIndex;
|
||||
let str = params.name + ":" + sumData[index];
|
||||
if (data1[index] != 0) {
|
||||
str += "\n第一季度:" + data1[index];
|
||||
}
|
||||
if (data2[index] != 0) {
|
||||
str += "\n第二季度:" + data2[index];
|
||||
}
|
||||
if (data3[index] != 0) {
|
||||
str += "\n第三季度:" + data3[index];
|
||||
}
|
||||
if (data4[index] != 0) {
|
||||
str += "\n第四季度:" + data4[index];
|
||||
}
|
||||
str += "\n同比(右)" + ratioList[index];
|
||||
return str;
|
||||
}
|
||||
};
|
||||
this.option3.series = [
|
||||
{
|
||||
type: "bar",
|
||||
name: "第一季度",
|
||||
data: data1,
|
||||
stack: "quarter",
|
||||
yAxisIndex: 0,
|
||||
label: {
|
||||
show: true,
|
||||
position: "top",
|
||||
formatter(params) {
|
||||
return sumData[params.dataIndex];
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type: "bar",
|
||||
name: "第二季度",
|
||||
data: data2,
|
||||
stack: "quarter",
|
||||
yAxisIndex: 0
|
||||
},
|
||||
{
|
||||
type: "bar",
|
||||
name: "第三季度",
|
||||
data: data3,
|
||||
yAxisIndex: 0,
|
||||
stack: "quarter"
|
||||
},
|
||||
{
|
||||
type: "bar",
|
||||
name: "第四季度",
|
||||
data: data4,
|
||||
yAxisIndex: 0,
|
||||
stack: "quarter"
|
||||
},
|
||||
{
|
||||
type: "line",
|
||||
name: "同比(右)",
|
||||
data: ratioList,
|
||||
yAxisIndex: 1
|
||||
}
|
||||
];
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -366,7 +946,7 @@ if (!Math) {
|
||||
_easycom_l_echart();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
return common_vendor.e({
|
||||
a: common_assets._imports_0$3,
|
||||
b: common_assets._imports_2$3,
|
||||
c: common_vendor.f($data.profitabilityIndicatorList, (item, index, i0) => {
|
||||
@@ -377,12 +957,26 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
d: common_vendor.o(($event) => $options.clickProfitabilityIndicatorItem(index), index)
|
||||
};
|
||||
}),
|
||||
d: common_assets._imports_3$12,
|
||||
e: common_assets._imports_5$7,
|
||||
f: common_vendor.sr("chartRef1", "351c0d57-0"),
|
||||
g: common_assets._imports_4$13,
|
||||
h: common_assets._imports_2$3,
|
||||
i: common_vendor.f($data.perShareIndicatorList, (item, index, i0) => {
|
||||
d: common_vendor.n("option " + ($data.profitabilitySingleQuarterAllIndex == 0 ? "select" : "")),
|
||||
e: common_vendor.o(($event) => $options.clickProfitabilitySingleQuarterOrAll(0)),
|
||||
f: $data.profitabilitySingleQuarterAllIndex == 1
|
||||
}, $data.profitabilitySingleQuarterAllIndex == 1 ? {
|
||||
g: common_assets._imports_2$12
|
||||
} : {
|
||||
h: common_assets._imports_3$11
|
||||
}, {
|
||||
i: $data.profitabilitySingleQuarterAllIndex == 1
|
||||
}, $data.profitabilitySingleQuarterAllIndex == 1 ? {
|
||||
j: common_assets._imports_4$10
|
||||
} : {
|
||||
k: common_assets._imports_5$7
|
||||
}, {
|
||||
l: common_vendor.n("flex option " + ($data.profitabilitySingleQuarterAllIndex == 1 ? "select" : "")),
|
||||
m: common_vendor.o(($event) => $options.clickProfitabilitySingleQuarterOrAll(1)),
|
||||
n: common_vendor.sr("chartRef1", "351c0d57-0"),
|
||||
o: common_assets._imports_6$3,
|
||||
p: common_assets._imports_2$3,
|
||||
q: common_vendor.f($data.perShareIndicatorList, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.title),
|
||||
b: common_vendor.n("item flexCenter " + ($data.perShareIndicatorIndex == index ? "select" : "")),
|
||||
@@ -390,10 +984,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
d: common_vendor.o(($event) => $options.clickPerShareIndicatorItem(index), index)
|
||||
};
|
||||
}),
|
||||
j: common_assets._imports_3$12,
|
||||
k: common_assets._imports_5$7,
|
||||
l: common_vendor.sr("chartRef2", "351c0d57-1")
|
||||
};
|
||||
r: common_assets._imports_3$11,
|
||||
s: common_assets._imports_5$7,
|
||||
t: common_vendor.sr("chartRef2", "351c0d57-1")
|
||||
});
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
|
||||
@@ -1 +1 @@
|
||||
<view><view style="color:#2B2B2B;font-weight:500;font-size:24rpx"><view class="flex" style="padding:20rpx"><image src="{{a}}" mode="widthFix" style="width:40rpx;height:40rpx"></image><view class="flex1" style="margin:0 10rpx;font-size:28rpx">盈利能力</view><image src="{{b}}" mode="widthFix" style="width:13rpx;height:22rpx"></image></view><view class="indicatorC" style="display:grid;gap:20rpx;grid-template-columns:repeat(4, 1fr);margin:0 20rpx"><view wx:for="{{c}}" wx:for-item="item" wx:key="c" class="{{item.b}}" style="justify-content:center;text-align:center;padding:3rpx 5rpx" bindtap="{{item.d}}">{{item.a}}</view></view><view class="flex" style="padding:20rpx"><view class="flex1" style="font-size:28rpx">查看详细数据</view><view style="color:#F2C369;font-size:22rpx;padding:2rpx 10rpx;border-radius:5rpx;border:1rpx solid #F2C369;text-align:center;margin:0 10rpx"> 单季度</view><view class="flex" style="padding:3rpx 10rpx;border:1rpx solid #D2D2D2"><image style="width:23rpx;height:23rpx" src="{{d}}" mode="widthFix"></image><view style="margin:0 10rpx;color:#999999;font-size:22rpx">全部</view><image style="width:11rpx;height:6rpx" src="{{e}}" mode="widthFix"></image></view></view><view style="height:500rpx"><l-echart class="r" u-r="chartRef1" u-i="351c0d57-0" bind:__l="__l"></l-echart></view></view><view style="color:#2B2B2B;font-weight:500;font-size:24rpx"><view style="display:flex;align-items:center;padding:20rpx;box-sizing:border-box"><image src="{{g}}" mode="widthFix" style="width:40rpx;height:40rpx"></image><view class="flex1" style="margin:0 10rpx;font-size:28rpx">每股指标</view><image src="{{h}}" mode="widthFix" style="width:13rpx;height:22rpx"></image></view><view class="indicatorC" style="display:grid;gap:20rpx;grid-template-columns:repeat(4, 1fr);margin:0 20rpx"><view wx:for="{{i}}" wx:for-item="item" wx:key="c" class="{{item.b}}" bindtap="{{item.d}}">{{item.a}}</view></view><view style="display:flex;align-items:center;padding:20rpx;box-sizing:border-box"><view class="flex1" style="font-size:28rpx">查看详细数据</view><view style="color:#F2C369;font-size:22rpx;padding:2rpx 10rpx;border-radius:5rpx;border:1rpx solid #F2C369;text-align:center;margin:0 10rpx"> 单季度</view><view style="display:flex;align-items:center;padding:3rpx 10rpx;box-sizing:border-box;border:1rpx solid #D2D2D2"><image style="width:23rpx;height:23rpx" src="{{j}}" mode="widthFix"></image><view style="margin:0 10rpx;color:#999999;font-size:22rpx">全部</view><image style="width:11rpx;height:6rpx" src="{{k}}" mode="widthFix"></image></view></view><view style="height:500rpx"><l-echart class="r" u-r="chartRef2" u-i="351c0d57-1" bind:__l="__l"></l-echart></view></view></view>
|
||||
<view><view style="color:#2B2B2B;font-weight:500;font-size:24rpx"><view class="flex" style="padding:20rpx"><image src="{{a}}" mode="widthFix" style="width:40rpx;height:40rpx"></image><view class="flex1" style="margin:0 10rpx;font-size:28rpx">盈利能力</view><image src="{{b}}" mode="widthFix" style="width:13rpx;height:22rpx"></image></view><view class="indicatorC" style="display:grid;gap:20rpx;grid-template-columns:repeat(4, 1fr);margin:0 20rpx"><view wx:for="{{c}}" wx:for-item="item" wx:key="c" class="{{item.b}}" style="justify-content:center;text-align:center;padding:3rpx 5rpx" bindtap="{{item.d}}">{{item.a}}</view></view><view class="detailOptionC flex" style="padding:20rpx"><view class="flex1" style="font-size:28rpx">查看详细数据</view><view class="{{d}}" bindtap="{{e}}">单季度</view><view class="{{l}}" bindtap="{{m}}"><image wx:if="{{f}}" class="icon" src="{{g}}" mode="widthFix"></image><image wx:else class="icon" src="{{h}}" mode="widthFix"></image><view style="margin:0 10rpx;color:#999999;font-size:22rpx">全部</view><image wx:if="{{i}}" class="arrow" src="{{j}}" mode="widthFix"></image><image wx:else class="arrow" src="{{k}}" mode="widthFix"></image></view></view><view style="height:500rpx"><l-echart class="r" u-r="chartRef1" u-i="351c0d57-0" bind:__l="__l"></l-echart></view></view><view style="color:#2B2B2B;font-weight:500;font-size:24rpx"><view style="display:flex;align-items:center;padding:20rpx;box-sizing:border-box"><image src="{{o}}" mode="widthFix" style="width:40rpx;height:40rpx"></image><view class="flex1" style="margin:0 10rpx;font-size:28rpx">每股指标</view><image src="{{p}}" mode="widthFix" style="width:13rpx;height:22rpx"></image></view><view class="indicatorC" style="display:grid;gap:20rpx;grid-template-columns:repeat(4, 1fr);margin:0 20rpx"><view wx:for="{{q}}" wx:for-item="item" wx:key="c" class="{{item.b}}" bindtap="{{item.d}}">{{item.a}}</view></view><view style="display:flex;align-items:center;padding:20rpx;box-sizing:border-box"><view class="flex1" style="font-size:28rpx">查看详细数据</view><view style="color:#F2C369;font-size:22rpx;padding:2rpx 10rpx;border-radius:5rpx;border:1rpx solid #F2C369;text-align:center;margin:0 10rpx"> 单季度</view><view style="display:flex;align-items:center;padding:3rpx 10rpx;box-sizing:border-box;border:1rpx solid #D2D2D2"><image style="width:23rpx;height:23rpx" src="{{r}}" mode="widthFix"></image><view style="margin:0 10rpx;color:#999999;font-size:22rpx">全部</view><image style="width:11rpx;height:6rpx" src="{{s}}" mode="widthFix"></image></view></view><view style="height:500rpx"><l-echart class="r" u-r="chartRef2" u-i="351c0d57-1" bind:__l="__l"></l-echart></view></view></view>
|
||||
@@ -11,3 +11,25 @@
|
||||
border: 1rpx solid #F2C369;
|
||||
color: #BB8520;
|
||||
}
|
||||
.detailOptionC .option {
|
||||
margin: 0 10rpx;
|
||||
line-height: 36rpx;
|
||||
padding: 0 10rpx;
|
||||
border-radius: 5rpx;
|
||||
border: 1rpx solid #D2D2D2;
|
||||
font-size: 22rpx;
|
||||
color: #999999;
|
||||
text-align: center;
|
||||
}
|
||||
.detailOptionC .option .icon {
|
||||
width: 23rpx;
|
||||
height: auto;
|
||||
}
|
||||
.detailOptionC .option .arrow {
|
||||
width: 11rpx;
|
||||
height: auto;
|
||||
}
|
||||
.detailOptionC .option.select {
|
||||
border: solid 1rpx #F2C369;
|
||||
color: #F2C369;
|
||||
}
|
||||
|
||||
@@ -2413,7 +2413,7 @@ const _sfc_main = {
|
||||
} else
|
||||
sumData.push(sum);
|
||||
}
|
||||
this.option2.legend.data = ["第一季度", "第二季度", "第三季度", "第四季度"];
|
||||
this.option3.legend.data = ["第一季度", "第二季度", "第三季度", "第四季度"];
|
||||
this.option3.xAxis[0].data = category;
|
||||
this.option3.xAxis[1].data = category;
|
||||
this.option3.series = [
|
||||
@@ -2677,9 +2677,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
e: common_vendor.o(($event) => $options.clickBalanceSingleQuarterOrAll(0)),
|
||||
f: $data.balanceSingleQuarterAllIndex == 1
|
||||
}, $data.balanceSingleQuarterAllIndex == 1 ? {
|
||||
g: common_assets._imports_2$13
|
||||
g: common_assets._imports_2$12
|
||||
} : {
|
||||
h: common_assets._imports_3$12
|
||||
h: common_assets._imports_3$11
|
||||
}, {
|
||||
i: $data.balanceSingleQuarterAllIndex == 1
|
||||
}, $data.balanceSingleQuarterAllIndex == 1 ? {
|
||||
@@ -2714,9 +2714,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
B: common_vendor.o(($event) => $options.clickCashFlowSingleQuarterOrAll(0)),
|
||||
C: $data.cashFlowSingleQuarterAllIndex == 1
|
||||
}, $data.cashFlowSingleQuarterAllIndex == 1 ? {
|
||||
D: common_assets._imports_2$13
|
||||
D: common_assets._imports_2$12
|
||||
} : {
|
||||
E: common_assets._imports_3$12
|
||||
E: common_assets._imports_3$11
|
||||
}, {
|
||||
F: $data.cashFlowSingleQuarterAllIndex == 1
|
||||
}, $data.cashFlowSingleQuarterAllIndex == 1 ? {
|
||||
@@ -2750,9 +2750,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
W: common_vendor.o(($event) => $options.clickProfitSingleQuarterOrAll(0)),
|
||||
X: $data.profitSingleQuarterAllIndex == 1
|
||||
}, $data.profitSingleQuarterAllIndex == 1 ? {
|
||||
Y: common_assets._imports_2$13
|
||||
Y: common_assets._imports_2$12
|
||||
} : {
|
||||
Z: common_assets._imports_3$12
|
||||
Z: common_assets._imports_3$11
|
||||
}, {
|
||||
aa: $data.profitSingleQuarterAllIndex == 1
|
||||
}, $data.profitSingleQuarterAllIndex == 1 ? {
|
||||
|
||||
@@ -20,6 +20,14 @@
|
||||
color: #999999;
|
||||
text-align: center;
|
||||
}
|
||||
.detailOptionC .option .icon {
|
||||
width: 23rpx;
|
||||
height: auto;
|
||||
}
|
||||
.detailOptionC .option .arrow {
|
||||
width: 11rpx;
|
||||
height: auto;
|
||||
}
|
||||
.detailOptionC .option.select {
|
||||
border: solid 1rpx #F2C369;
|
||||
color: #F2C369;
|
||||
|
||||
@@ -80,7 +80,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: item.impact_metrics.is_positive == 1
|
||||
}, item.impact_metrics.is_positive == 1 ? {
|
||||
b: common_assets._imports_4$14
|
||||
b: common_assets._imports_4$12
|
||||
} : {
|
||||
c: common_assets._imports_5$8
|
||||
}, {
|
||||
|
||||
@@ -76,7 +76,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
i: item.list.length > 4
|
||||
}, item.list.length > 4 ? {
|
||||
j: common_vendor.t(item.isExpand ? "收起" : "展开查看"),
|
||||
k: common_assets._imports_2$14,
|
||||
k: common_assets._imports_2$13,
|
||||
l: common_vendor.o(($event) => $options.clickExpandOrRetractManagement(index), index)
|
||||
} : {}, {
|
||||
m: index
|
||||
|
||||
@@ -91,8 +91,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
});
|
||||
}),
|
||||
g: common_assets._imports_1$15,
|
||||
h: common_assets._imports_2$15,
|
||||
i: common_assets._imports_3$13
|
||||
h: common_assets._imports_2$14,
|
||||
i: common_assets._imports_3$12
|
||||
} : {}, {
|
||||
j: $data.showType == 1
|
||||
}, $data.showType == 1 ? {
|
||||
|
||||
@@ -96,21 +96,16 @@ const _sfc_main = {
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
// 筛选后的股票列表
|
||||
// 筛选后的股票列表:按板块codes匹配 + 连板排序/筛选
|
||||
filteredStocks() {
|
||||
var _a;
|
||||
if (!this.allStocks.length)
|
||||
if (!((_a = this.originData) == null ? void 0 : _a.stocks) || !this.bkList.length)
|
||||
return [];
|
||||
let stocks = [...this.allStocks];
|
||||
if (this.activeIndex >= 0 && this.bkList.length) {
|
||||
const currentSector = (_a = this.bkList[this.activeIndex]) == null ? void 0 : _a.title;
|
||||
if (currentSector) {
|
||||
stocks = stocks.filter((stock) => {
|
||||
const sectorMatch = stock.core_sectors.some((s) => s.includes(currentSector)) || (Array.isArray(stock.sector_category) ? stock.sector_category.includes(currentSector) : stock.sector_category === currentSector);
|
||||
return sectorMatch;
|
||||
});
|
||||
}
|
||||
}
|
||||
const currentBk = this.bkList[this.activeIndex];
|
||||
if (!(currentBk == null ? void 0 : currentBk.codes) || currentBk.codes.length === 0)
|
||||
return [];
|
||||
const targetCodes = new Set(currentBk.codes);
|
||||
let stocks = this.originData.stocks.filter((stock) => targetCodes.has(stock.scode));
|
||||
switch (this.filterIndex) {
|
||||
case 0:
|
||||
stocks.sort((a, b) => {
|
||||
@@ -134,7 +129,7 @@ const _sfc_main = {
|
||||
onLoad(e) {
|
||||
this.activeIndex = e.index;
|
||||
this.selectedFullDate = e.data;
|
||||
common_vendor.index.__f__("log", "at pagesStock/stockCenterDetails/bkydmx.vue:237", "selectedFullDate", this.selectedFullDate);
|
||||
common_vendor.index.__f__("log", "at pagesStock/stockCenterDetails/bkydmx.vue:229", "selectedFullDate", this.selectedFullDate);
|
||||
this.contentTop = this.navH + 20 / 750 * common_vendor.inject("windowWidth");
|
||||
this.fetchData();
|
||||
},
|
||||
@@ -230,7 +225,6 @@ const _sfc_main = {
|
||||
setStockRoles() {
|
||||
if (!this.originData || !this.originData.stocks || !this.bkList.length)
|
||||
return;
|
||||
common_vendor.index.__f__("log", "at pagesStock/stockCenterDetails/bkydmx.vue:357", "setStockRoles", JSON.stringify(this.originData.stocks));
|
||||
this.allStocks = this.originData.stocks.map((stock) => {
|
||||
let sectorIndex = -1;
|
||||
const stockSectors = Array.isArray(stock.sector_category) ? stock.sector_category : [stock.sector_category];
|
||||
@@ -263,28 +257,20 @@ const _sfc_main = {
|
||||
const formattedDate = this.selectedFullDate;
|
||||
const baseURL = request_http.getBaseURL1();
|
||||
const requestUrl = `${baseURL}/data/zt/daily/${formattedDate}.json?t=${timestamp}`;
|
||||
common_vendor.index.__f__("log", "at pagesStock/stockCenterDetails/bkydmx.vue:401", "请求URL:", requestUrl);
|
||||
common_vendor.index.__f__("log", "at pagesStock/stockCenterDetails/bkydmx.vue:390", "请求URL:", requestUrl);
|
||||
const res = await common_vendor.index.request({
|
||||
url: requestUrl,
|
||||
method: "GET"
|
||||
});
|
||||
if (res.statusCode === 200 && res.data) {
|
||||
this.originData = res.data;
|
||||
const chartData = this.originData.chart_data || {};
|
||||
const labels = chartData.labels || [];
|
||||
const counts = chartData.counts || [];
|
||||
const maxCount = counts.length > 0 ? Math.max(...counts) : 0;
|
||||
const maxLen = Math.min(labels.length, counts.length);
|
||||
let bkList = [];
|
||||
for (let i = 0; i < maxLen; i++) {
|
||||
const title = labels[i];
|
||||
const count = counts[i] || 0;
|
||||
bkList.push({
|
||||
title,
|
||||
count
|
||||
});
|
||||
}
|
||||
this.bkList = bkList;
|
||||
const { sector_data } = this.originData;
|
||||
this.bkList = Object.entries(sector_data).filter(([sectorName]) => sectorName !== "其他").map(([sectorName, sectorInfo]) => ({
|
||||
title: sectorName,
|
||||
codes: sectorInfo.stock_codes || []
|
||||
// 取板块对应的股票代码
|
||||
}));
|
||||
common_vendor.index.__f__("log", "at pagesStock/stockCenterDetails/bkydmx.vue:408", "生成板块列表:", this.bkList);
|
||||
this.setStockRoles();
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
@@ -293,7 +279,7 @@ const _sfc_main = {
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pagesStock/stockCenterDetails/bkydmx.vue:440", "请求异常:", error);
|
||||
common_vendor.index.__f__("error", "at pagesStock/stockCenterDetails/bkydmx.vue:418", "请求异常:", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "网络异常",
|
||||
icon: "none"
|
||||
|
||||
313
unpackage/dist/dev/mp-weixin/pagesStock/stockCenterDetails/cwDetails/cwDetails.js
vendored
Normal file
313
unpackage/dist/dev/mp-weixin/pagesStock/stockCenterDetails/cwDetails/cwDetails.js
vendored
Normal file
@@ -0,0 +1,313 @@
|
||||
"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"),
|
||||
windowWidth: common_vendor.inject("windowWidth"),
|
||||
contentTop: "",
|
||||
otherTop: "",
|
||||
stockCode: "000001",
|
||||
//股票代码
|
||||
tabList: ["盈利能力", "每股指标", "成长能力", "资产负债表", "现金流量指标", "现金流量表"],
|
||||
activeIndex: 0,
|
||||
topScrollWidth: 0,
|
||||
topScrollLeft: 0,
|
||||
filterList: ["全部", "年报", "中报", "一季度", "三季度"],
|
||||
filterIndex: 0,
|
||||
secondScrollWidth: 0,
|
||||
secondScrollLeft: 0,
|
||||
periodList: [
|
||||
{
|
||||
title: "最近4期",
|
||||
period: 4
|
||||
},
|
||||
{
|
||||
title: "最近8期",
|
||||
period: 8
|
||||
},
|
||||
{
|
||||
title: "最近12期",
|
||||
period: 12
|
||||
},
|
||||
{
|
||||
title: "最近16期",
|
||||
period: 16
|
||||
}
|
||||
],
|
||||
periodIndex: 1,
|
||||
periodTop: "",
|
||||
periodShow: false,
|
||||
//是否显示弹窗
|
||||
leftList: [
|
||||
["净资产收益率(ROE)%", "净资产收益率(扣非)%", "净资产收益率(加权)%", "总资产报酬率(ROA)%", "毛利率%", "净利率%", "营业利润率%", "成本费用利润率%", "EBIT"],
|
||||
["每股收益(EPS)%", "基本每股收益", "稀释每股收益", "扣非每股收益", "每股净资产", "每股经营现金流", "每股资本公积", "每股未分配利润"],
|
||||
["营收增长率%", "净利润增长率%", "扣非净利润增长率%", "归母净利润增长率%", "经营现金流增长率%", "总资产增长率%", "净资产增长率%", "固定资产增长率%"],
|
||||
["营收增长率%", "净利润增长率%", "扣非净利润增长率%", "归母净利润增长率%", "经营现金流增长率%", "总资产增长率%", "净资产增长率%", "固定资产增长率%"],
|
||||
["货币资金", "交易性金融资产", "应收票据", "营收账款", "预付款项", "其他应收款", "存货", "存货", "其他流动资产"],
|
||||
["经营现金流净额", "销售收现", "购买支付现金", "投资现金流净额", "筹资现金流净额", "现金净增加额", "期末现金余额", "自由现金流"]
|
||||
],
|
||||
financialMetricsList: [],
|
||||
showDataList: []
|
||||
};
|
||||
},
|
||||
onLoad(e) {
|
||||
if (e.index) {
|
||||
this.activeIndex = e.index;
|
||||
}
|
||||
if (e.code) {
|
||||
this.stockCode = e.code;
|
||||
}
|
||||
this.contentTop = this.navH + 20 / 750 * common_vendor.inject("windowWidth");
|
||||
this.otherTop = this.navH + 204 / 750 * common_vendor.inject("windowWidth");
|
||||
this.getFinancialMetricsData();
|
||||
},
|
||||
onReady() {
|
||||
common_vendor.index.createSelectorQuery().select("#topCategory").boundingClientRect((rect) => {
|
||||
this.topScrollWidth = Math.round(rect.width);
|
||||
}).exec();
|
||||
common_vendor.index.createSelectorQuery().select("#filterList").boundingClientRect((rect) => {
|
||||
if (rect) {
|
||||
this.secondScrollWidth = Math.round(rect.width);
|
||||
}
|
||||
}).exec();
|
||||
},
|
||||
methods: {
|
||||
clickTabItem(e, index) {
|
||||
if (this.activeIndex != index) {
|
||||
this.activeIndex = index;
|
||||
let offsetLeft = e.currentTarget.offsetLeft;
|
||||
this.topScrollLeft = offsetLeft - this.topScrollWidth / 2;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 点击选择筛选项
|
||||
* @param {Object} index
|
||||
*/
|
||||
clickFilterItem(e, index) {
|
||||
if (this.filterIndex != index) {
|
||||
this.filterIndex = index;
|
||||
let offsetLeft = e.currentTarget.offsetLeft;
|
||||
this.secondScrollLeft = offsetLeft - this.secondScrollWidth / 2;
|
||||
if (this.activeIndex == 0 || this.activeIndex == 1 || this.activeIndex == 2 || this.activeIndex == 4) {
|
||||
this.getFinancialMetricsData();
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 点击选择期数
|
||||
* @param {Object} e
|
||||
*/
|
||||
clickSelectPeriod(e) {
|
||||
this.periodTop = e.currentTarget.offsetTop + this.navH + (70 + 10) / 750 * this.windowWidth;
|
||||
this.periodShow = true;
|
||||
},
|
||||
/**
|
||||
* 点击选择期数
|
||||
* @param {Object} index
|
||||
*/
|
||||
clickPeriodItem(index) {
|
||||
if (this.periodIndex != index) {
|
||||
this.periodIndex = index;
|
||||
this.periodShow = false;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 获取财务指标数据
|
||||
*/
|
||||
getFinancialMetricsData() {
|
||||
let code = this.stockCode;
|
||||
let period = this.periodList[this.periodIndex].period;
|
||||
let param = { limit: period };
|
||||
request_api.financialMetrics(code, param).then((res) => {
|
||||
this.financialMetricsList = res.data;
|
||||
this.getFinancialMetricsShowData();
|
||||
}).catch((error) => {
|
||||
});
|
||||
},
|
||||
getFinancialMetricsShowData() {
|
||||
let data = [];
|
||||
if (this.filterIndex == 0) {
|
||||
data = this.financialMetricsList;
|
||||
} else if (this.filterIndex == 1) {
|
||||
for (let item of this.financialMetricsList) {
|
||||
if (item.report_type.indexOf("年报") > -1) {
|
||||
data.push(item);
|
||||
}
|
||||
}
|
||||
} else if (this.filterIndex == 2) {
|
||||
for (let item of this.financialMetricsList) {
|
||||
if (item.report_type.indexOf("中报") > -1) {
|
||||
data.push(item);
|
||||
}
|
||||
}
|
||||
} else if (this.filterIndex == 3) {
|
||||
for (let item of this.financialMetricsList) {
|
||||
if (item.report_type.indexOf("一季报") > -1) {
|
||||
data.push(item);
|
||||
}
|
||||
}
|
||||
} else if (this.filterIndex == 4) {
|
||||
for (let item of this.financialMetricsList) {
|
||||
if (item.report_type.indexOf("三季报") > -1) {
|
||||
data.push(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.showDataList = data;
|
||||
common_vendor.index.__f__("log", "at pagesStock/stockCenterDetails/cwDetails/cwDetails.vue:272", this.showDataList);
|
||||
},
|
||||
/**
|
||||
* 获取资产负债表数据
|
||||
*/
|
||||
getFinancialBalanceSheetData() {
|
||||
let code = this.stockCode;
|
||||
let period = this.periodList[this.periodIndex].period;
|
||||
let param = { limit: period };
|
||||
request_api.financialBalanceSheet(code, param).then((res) => {
|
||||
this.financialBalanceList = res.data;
|
||||
}).catch((error) => {
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取现金流量表数据
|
||||
*/
|
||||
getCashFlowSheetData() {
|
||||
let code = this.stockCode;
|
||||
let period = this.periodList[this.periodIndex].period;
|
||||
let param = { limit: period };
|
||||
request_api.cashflowSheet(code, param).then((res) => {
|
||||
this.cashFlowList = res.data;
|
||||
}).catch((error) => {
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取利润表数据
|
||||
*/
|
||||
getIncomeStatementSheetData() {
|
||||
let code = this.stockCode;
|
||||
let period = this.periodList[this.periodIndex].period;
|
||||
let param = { limit: period };
|
||||
request_api.incomeStatementSheet(code, param).then((res) => {
|
||||
this.incomeStatementList = res.data;
|
||||
}).catch((error) => {
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_navBar2 = common_vendor.resolveComponent("navBar");
|
||||
_easycom_navBar2();
|
||||
}
|
||||
const _easycom_navBar = () => "../../../components/navBar/navBar.js";
|
||||
if (!Math) {
|
||||
_easycom_navBar();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.p({
|
||||
leftText: "平安银行(000001)",
|
||||
hideNavBg: true
|
||||
}),
|
||||
b: common_assets._imports_0,
|
||||
c: common_vendor.f($data.tabList, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item),
|
||||
b: index,
|
||||
c: "tab-" + index,
|
||||
d: index == $data.tabList.length - 1 ? "0" : "40rpx",
|
||||
e: $data.activeIndex == index ? "#2B2B2B" : "#999999",
|
||||
f: $data.activeIndex == index ? "28rpx" : "26rpx",
|
||||
g: $data.activeIndex == index ? "1rpx solid #F2C369" : "none",
|
||||
h: $data.activeIndex == index ? "bold" : "500",
|
||||
i: common_vendor.o(($event) => $options.clickTabItem($event, index), index)
|
||||
};
|
||||
}),
|
||||
d: $data.topScrollLeft,
|
||||
e: common_vendor.f($data.filterList, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item),
|
||||
b: common_vendor.n("item flexCenter " + ($data.filterIndex == index ? "select" : "")),
|
||||
c: index,
|
||||
d: common_vendor.o(($event) => $options.clickFilterItem($event, index), index)
|
||||
};
|
||||
}),
|
||||
f: $data.secondScrollLeft,
|
||||
g: common_vendor.t($data.periodList[$data.periodIndex].title),
|
||||
h: common_assets._imports_4$10,
|
||||
i: common_vendor.o(($event) => $options.clickSelectPeriod($event)),
|
||||
j: common_vendor.s("top:" + $data.contentTop + "px;"),
|
||||
k: common_vendor.f($data.leftList[$data.activeIndex], (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item),
|
||||
b: index,
|
||||
c: index % 2 == 0 ? "#fff" : "#FAFAFC"
|
||||
};
|
||||
}),
|
||||
l: common_vendor.f($data.showDataList, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.report_type),
|
||||
b: common_vendor.f($data.leftList[$data.activeIndex], (litem, lindex, i1) => {
|
||||
return common_vendor.e($data.activeIndex == 0 ? common_vendor.e({
|
||||
a: lindex == 0
|
||||
}, lindex == 0 ? {
|
||||
b: common_vendor.t($data.showDataList[index].profitability.roe ? $data.showDataList[index].profitability.roe.toFixed(2) : "-")
|
||||
} : {}, {
|
||||
c: lindex == 1
|
||||
}, lindex == 1 ? {
|
||||
d: common_vendor.t($data.showDataList[index].profitability.roe_deducted ? $data.showDataList[index].profitability.roe_deducted.toFixed(2) : "-")
|
||||
} : {}, {
|
||||
e: lindex == 2
|
||||
}, lindex == 2 ? {
|
||||
f: common_vendor.t($data.showDataList[index].profitability.roe_weighted ? $data.showDataList[index].profitability.roe_weighted.toFixed(2) : "-")
|
||||
} : {}, {
|
||||
g: lindex == 3
|
||||
}, lindex == 3 ? {
|
||||
h: common_vendor.t($data.showDataList[index].profitability.roa ? $data.showDataList[index].profitability.roa.toFixed(2) : "-")
|
||||
} : {}, {
|
||||
i: lindex == 4
|
||||
}, lindex == 4 ? {
|
||||
j: common_vendor.t($data.showDataList[index].profitability.gross_margin ? $data.showDataList[index].profitability.gross_margin.toFixed(2) : "-")
|
||||
} : {}, {
|
||||
k: lindex == 5
|
||||
}, lindex == 5 ? {
|
||||
l: common_vendor.t($data.showDataList[index].profitability.net_profit_margin ? $data.showDataList[index].profitability.net_profit_margin.toFixed(2) : "-")
|
||||
} : {}, {
|
||||
m: lindex == 6
|
||||
}, lindex == 6 ? {
|
||||
n: common_vendor.t($data.showDataList[index].profitability.operating_profit_margin ? $data.showDataList[index].profitability.operating_profit_margin.toFixed(2) : "-")
|
||||
} : {}, {
|
||||
o: lindex == 7
|
||||
}, lindex == 7 ? {
|
||||
p: common_vendor.t($data.showDataList[index].profitability.cost_profit_ratio ? $data.showDataList[index].profitability.cost_profit_ratio.toFixed(2) : "-")
|
||||
} : {}, {
|
||||
q: lindex == 8
|
||||
}, lindex == 8 ? {
|
||||
r: common_vendor.t($data.showDataList[index].profitability.ebit ? $data.showDataList[index].profitability.ebit.toFixed(2) : "-")
|
||||
} : {}) : {}, {
|
||||
s: lindex,
|
||||
t: lindex % 2 == 0 ? "#fff" : "#FAFAFC"
|
||||
});
|
||||
}),
|
||||
c: index
|
||||
};
|
||||
}),
|
||||
m: $data.activeIndex == 0,
|
||||
n: common_vendor.s("top:" + $data.otherTop + "px;"),
|
||||
o: $data.periodShow
|
||||
}, $data.periodShow ? {
|
||||
p: common_vendor.f($data.periodList, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.title),
|
||||
b: index,
|
||||
c: common_vendor.o(($event) => $options.clickPeriodItem(index), index)
|
||||
};
|
||||
}),
|
||||
q: common_vendor.s("top:" + $data.periodTop + "px")
|
||||
} : {});
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/pagesStock/stockCenterDetails/cwDetails/cwDetails.js.map
|
||||
6
unpackage/dist/dev/mp-weixin/pagesStock/stockCenterDetails/cwDetails/cwDetails.json
vendored
Normal file
6
unpackage/dist/dev/mp-weixin/pagesStock/stockCenterDetails/cwDetails/cwDetails.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"usingComponents": {
|
||||
"nav-bar": "../../../components/navBar/navBar"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pagesStock/stockCenterDetails/cwDetails/cwDetails.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pagesStock/stockCenterDetails/cwDetails/cwDetails.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view><nav-bar wx:if="{{a}}" u-i="9030b988-0" bind:__l="__l" u-p="{{a}}"></nav-bar><image class="topBg absolute" src="{{b}}" mode="widthFix"></image><view class="stockDetailsC fixed" style="{{j}}"><view style="margin:0 20rpx;height:99rpx"><scroll-view id="topCategory" scroll-x style="white-space:nowrap" scroll-with-animation scroll-left="{{d}}" show-scrollbar="false"><view style="display:inline-block"><view wx:for="{{c}}" wx:for-item="item" wx:key="b" id="{{item.c}}" style="{{'display:inline-block;text-align:center;line-height:98rpx' + ';' + ('margin-right:' + item.d + ';' + ('color:' + item.e) + ';' + ('font-size:' + item.f) + ';' + ('border-bottom:' + item.g) + ';' + ('font-weight:' + item.h))}}" bindtap="{{item.i}}">{{item.a}}</view></view></scroll-view></view><view style="height:1rpx;background-color:#E7E7E7;margin:0 20rpx"></view><view class="flex" style="margin:20rpx 20rpx 0"><scroll-view id="filterList" class="filterList" scroll-x scroll-left="{{f}}"><view wx:for="{{e}}" wx:for-item="item" wx:key="c" class="{{item.b}}" bindtap="{{item.d}}">{{item.a}}</view></scroll-view><view class="flexCenter" style="color:#F2C369;font-size:22rpx;font-weight:500;border:1rpx solid #F2C369;border-radius:5rpx;padding:0 10rpx;height:43rpx" bindtap="{{i}}"><text>{{g}}</text><image style="width:11rpx;height:6rpx;margin-left:10rpx" src="{{h}}" mode="widthFix"></image></view></view></view><scroll-view scroll-y class="stockDetailsC fixed" style="{{n}}"><view style="display:flex;color:#666666;font-size:20rpx;font-weight:500;margin:0 20rpx"><view><view style="height:60rpx;background-color:#FAFAFC"></view><view wx:for="{{k}}" wx:for-item="item" wx:key="b" style="{{'line-height:60rpx;padding-right:20rpx' + ';' + ('background-color:' + item.c)}}">{{item.a}}</view></view><view style="flex:1;white-space:nowrap;overflow:scroll;display:flex"><view wx:for="{{l}}" wx:for-item="item" wx:key="c" style="font-size:18rpx;text-align:center"><view style="padding:0 10rpx;line-height:60rpx;background-color:#FAFAFC">{{item.a}}</view><view wx:for="{{item.b}}" wx:for-item="litem" wx:key="s" style="{{'line-height:60rpx' + ';' + ('background-color:' + litem.t)}}"><block wx:if="{{m}}"><block wx:if="{{litem.a}}">{{litem.b}}</block><block wx:if="{{litem.c}}">{{litem.d}}</block><block wx:if="{{litem.e}}">{{litem.f}}</block><block wx:if="{{litem.g}}">{{litem.h}}</block><block wx:if="{{litem.i}}">{{litem.j}}</block><block wx:if="{{litem.k}}">{{litem.l}}</block><block wx:if="{{litem.m}}">{{litem.n}}</block><block wx:if="{{litem.o}}">{{litem.p}}</block><block wx:if="{{litem.q}}">{{litem.r}}</block></block></view></view></view></view></scroll-view><view wx:if="{{o}}" class="periodList fixed" style="{{q}}"><view wx:for="{{p}}" wx:for-item="item" wx:key="b" class="item" bindtap="{{item.c}}">{{item.a}}</view></view></view>
|
||||
85
unpackage/dist/dev/mp-weixin/pagesStock/stockCenterDetails/cwDetails/cwDetails.wxss
vendored
Normal file
85
unpackage/dist/dev/mp-weixin/pagesStock/stockCenterDetails/cwDetails/cwDetails.wxss
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
page {
|
||||
background-color: #070707;
|
||||
}
|
||||
.topBg {
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
.stockDetailsC {
|
||||
left: 25rpx;
|
||||
width: calc(100vw - 50rpx);
|
||||
background-color: white;
|
||||
border-radius: 10rpx 10rpx 0 0;
|
||||
overflow: hidden;
|
||||
bottom: calc(20rpx + 70rpx + 20rpx + env(safe-area-inset-bottom));
|
||||
}
|
||||
.bottomC {
|
||||
background-color: black;
|
||||
padding: 20rpx 25rpx calc(20rpx + env(safe-area-inset-bottom));
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
.bottomC .inputC {
|
||||
background-color: #424143;
|
||||
margin-right: 20rpx;
|
||||
padding: 0 33rpx;
|
||||
height: 70rpx;
|
||||
border-radius: 35rpx;
|
||||
}
|
||||
.bottomC .inputC input {
|
||||
height: 100%;
|
||||
font-size: 26rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
.bottomC .contrastShareC .item {
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #FEFAF6;
|
||||
text-align: center;
|
||||
}
|
||||
.bottomC .contrastShareC .item .icon {
|
||||
margin: 0 30rpx;
|
||||
width: auto;
|
||||
height: 26rpx;
|
||||
}
|
||||
.filterList {
|
||||
margin-right: 20rpx;
|
||||
white-space: nowrap;
|
||||
width: calc(100% - 150rpx);
|
||||
}
|
||||
.filterList .item {
|
||||
display: inline-block;
|
||||
margin-right: 28rpx;
|
||||
background-color: #F6F6F6;
|
||||
padding: 0 10rpx;
|
||||
min-width: 110rpx;
|
||||
line-height: 45rpx;
|
||||
border-radius: 5rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #939393;
|
||||
text-align: center;
|
||||
}
|
||||
.filterList .item.select {
|
||||
background-color: #F2C369;
|
||||
font-weight: bold;
|
||||
color: #070707;
|
||||
}
|
||||
.periodList {
|
||||
right: 25rpx;
|
||||
margin: 0 25rpx;
|
||||
width: 130rpx;
|
||||
}
|
||||
.periodList .item {
|
||||
line-height: 40rpx;
|
||||
font-size: 22rpx;
|
||||
font-weight: 500;
|
||||
color: #999;
|
||||
text-align: center;
|
||||
}
|
||||
.periodList .item.select {
|
||||
color: #F2C369;
|
||||
}
|
||||
@@ -775,7 +775,7 @@ const _sfc_main = {
|
||||
if (this.selectSearchStockInfo) {
|
||||
code = this.selectSearchStockInfo.stock_code;
|
||||
}
|
||||
let param = { limit: 8 };
|
||||
let param = { limit: 16 };
|
||||
request_api.financialMetrics(code, param).then((res) => {
|
||||
this.financialMetricsList = res.data;
|
||||
}).catch((error) => {
|
||||
|
||||
@@ -161,7 +161,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
a: index
|
||||
};
|
||||
}),
|
||||
k: common_assets._imports_4$12,
|
||||
k: common_assets._imports_4$11,
|
||||
l: common_assets._imports_5$4,
|
||||
m: common_assets._imports_5$4,
|
||||
n: common_vendor.s("top:" + $data.contentTop + "px;")
|
||||
|
||||
@@ -4,10 +4,17 @@
|
||||
"list": [
|
||||
{
|
||||
"name": "pagesStock/stockCenterDetails/stockCenterDetails",
|
||||
"pathName": "pagesStock/stockCenterDetails/stockCenterDetails",
|
||||
"pathName": "pagesStock/stockCenterDetails/cwDetails/cwDetails",
|
||||
"query": "",
|
||||
"scene": null,
|
||||
"launchMode": "default"
|
||||
},
|
||||
{
|
||||
"name": "pagesStock/stockCenterDetails/cwDetails",
|
||||
"pathName": "pagesStock/stockCenterDetails/cwDetails",
|
||||
"query": "",
|
||||
"launchMode": "default",
|
||||
"scene": null
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
5
unpackage/dist/dev/mp-weixin/utils/util.js
vendored
5
unpackage/dist/dev/mp-weixin/utils/util.js
vendored
@@ -62,7 +62,7 @@ function accAdd(arg1, arg2) {
|
||||
return (arg1 * m + arg2 * m) / m;
|
||||
}
|
||||
function accSub(arg1, arg2) {
|
||||
var r1, r2, m, n;
|
||||
var r1, r2, m;
|
||||
try {
|
||||
r1 = arg1.toString().split(".")[1].length;
|
||||
} catch (e) {
|
||||
@@ -74,8 +74,7 @@ function accSub(arg1, arg2) {
|
||||
r2 = 0;
|
||||
}
|
||||
m = Math.pow(10, Math.max(r1, r2));
|
||||
n = r1 >= r2 ? r1 : r2;
|
||||
return ((arg1 * m - arg2 * m) / m).toFixed(n);
|
||||
return (arg1 * m - arg2 * m) / m;
|
||||
}
|
||||
function getRateStr(r) {
|
||||
if (!r)
|
||||
|
||||
Reference in New Issue
Block a user