Files
JiaZhiQianYan/unpackage/dist/dev/mp-weixin/components/zysj-view/zysj-view.js
2026-01-28 14:43:26 +08:00

152 lines
4.1 KiB
JavaScript

"use strict";
const common_vendor = require("../../common/vendor.js");
const echarts = require("../../uni_modules/lime-echart/static/echarts.min.js");
const _sfc_main = {
name: "zysj-view",
data() {
return {
option1: {
xAxis: {
type: "category",
data: []
},
yAxis: [
{
type: "value",
name: "营收(亿)",
position: "left",
alignTicks: true,
axisLine: {
onZero: false
}
},
{
type: "value",
name: "利润(亿)",
position: "right",
alignTicks: true,
axisLine: {
onZero: false
}
}
],
series: [
{
type: "bar",
data: [],
yAxisIndex: 0
},
{
type: "line",
data: [],
yAxisIndex: 1
}
]
},
option2: {
xAxis: {
type: "category",
data: []
},
yAxis: {
type: "value"
},
series: [
{
data: [120, 200, 150, 80, 70, 110, 130],
type: "pie",
showBackground: true,
backgroundStyle: {
color: "rgba(180, 180, 180, 0.2)"
}
}
]
}
};
},
props: {
// 0 主营数据 1 财务分析 2 财务数据
type: Number,
barCategoryList: Array,
barList: Array,
lineList: Array
},
watch: {
barList(newValue) {
this.option1.series[0].data = newValue;
this.barLineInit();
},
lineList(newValue) {
this.option1.series[1].data = newValue;
this.barLineInit();
}
},
methods: {
/**
* 柱状图,折线图初始化
*/
async barLineInit() {
const chart = await this.$refs.chartRef1.init(echarts);
let that = this;
setTimeout(function() {
chart.setOption(that.option1);
}, 2e3);
},
/**
* 饼状图初始化
*/
async pieInit() {
const chart = await this.$refs.chartRef2.init(echarts);
let that = this;
setTimeout(function() {
chart.setOption(that.option2);
}, 2e3);
},
itemClick(index) {
common_vendor.index.navigateTo({
url: `/pagesStock/stockCenterDetails/cwDetails?index=${index}`
});
}
}
};
if (!Array) {
const _easycom_l_echart2 = common_vendor.resolveComponent("l-echart");
_easycom_l_echart2();
}
const _easycom_l_echart = () => "../../uni_modules/lime-echart/components/l-echart/l-echart.js";
if (!Math) {
_easycom_l_echart();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.sr("chartRef1", "cf18d1d4-0"),
b: common_vendor.sr("chartRef2", "cf18d1d4-1"),
c: common_vendor.f(["业务", "毛利率", "利润", "营收", "营收"], (item, index, i0) => {
return common_vendor.e({
a: common_vendor.t(item),
b: ["", "(2025年中报)", "(2025年中报)", "(2025年中报)", "(2024年年报)"][index].length > 0
}, ["", "(2025年中报)", "(2025年中报)", "(2025年中报)", "(2024年年报)"][index].length > 0 ? {
c: common_vendor.t(["", "(2025年中报)", "(2025年中报)", "(2025年中报)", "(2024年年报)"][index]),
d: index == 0 ? "left" : "center"
} : {}, {
e: index == 0 ? "left" : "center",
f: index == 0 ? "flex-start" : "center"
});
}),
d: common_vendor.f(["零售金融业务", "批发金融业务", "其他业务"], (item, index, i0) => {
return {
a: common_vendor.f([item, "64.53%", "200.57亿", "310.81亿", "712.55亿"], (item2, index2, i1) => {
return {
a: common_vendor.t(item2),
b: index2 == 0 ? "left" : "center"
};
}),
b: index % 2 == 0 ? "#FFFFFF" : "#FAFAFC"
};
})
};
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/zysj-view/zysj-view.js.map