This commit is contained in:
renzhijun
2026-01-31 11:40:17 +08:00
parent e2610ccd9c
commit 44d8ecf318
3 changed files with 12 additions and 56 deletions

View File

@@ -178,7 +178,7 @@
</template>
<script>
import {getBaseURL} from '@/request/http.js'
import {getBaseURL1 } from '@/request/http.js'
import {
inject
} from 'vue'
@@ -418,55 +418,7 @@
length2:5,
},
data: [{
value: 10,
name: '科技板块'
},
{
value: 8,
name: '人脑工程'
},
{
value: 9,
name: '商业航天'
},
{
value: 10,
name: '人工智能'
},
{
value: 9,
name: '芯片'
},
{
value: 7,
name: '算力网'
},
{
value: 6,
name: '智能机器'
},
{
value: 6,
name: '资产注入'
},
{
value: 5,
name: '智能医疗'
},
{
value: 5,
name: '国防军工'
},
{
value: 5,
name: '康复医疗'
},
{
value: 20,
name: '创新药'
},
]
data: []
}]
},
// 关系图配置项
@@ -519,7 +471,7 @@
//if (this.activeType === 0) {
this.initGraphChart(); // 初始化关系图
//} else if (this.activeType === 1) {
this.initPieChart(); // 初始化饼图
// 初始化饼图
//}
},
methods: {
@@ -552,7 +504,7 @@
const date = new Date(year, month - 1, day);
// 将日期减一天
date.setDate(date.getDate() - 1);
date.setDate(date.getDate() - 2);
// 格式化前一天的日期为 YYYYMMDD 格式(补零处理)
const prevYear = date.getFullYear();
@@ -572,7 +524,9 @@
// 调用上面的函数获取前一天的格式化日期YYYYMMDD
const formattedDate = this.getPreviousDayDate(this.selectedFullDate);
const requestUrl = getBaseURL1+`/data/zt/daily/${formattedDate}.json?t=${timestamp}`;
const baseURL = getBaseURL1();
const requestUrl = `${baseURL}/data/zt/daily/${formattedDate}.json?t=${timestamp}`;
console.log('请求URL', requestUrl); // 打印URL便于调试
const res = await uni.request({
@@ -583,6 +537,7 @@
if (res.statusCode === 200 && res.data) {
this.originData = res.data;
console.log('接口数据请求成功', this.originData.chart_data );
this.initPieChart();
} else {
uni.showToast({
title: '数据请求失败',
@@ -1029,7 +984,8 @@
// this.analyseHighStocks()
},
analyseHighStocks() {
const formatDate = this.selectedFullDate.replace(/-/g, '');
const formatDate = this.getPreviousDayDate(this.selectedFullDate);
let param = {
date: formatDate
}