fix: 修复API参数错误和图表初始化逻辑
修复newsInfo.ts中getTopSourcePeriod方法的参数名错误,将data.start_date改为data.start_time 优化LineHolYellow.vue图表组件,添加props.data的watch监听并移除mounted中的直接初始化 修正indexRelease.vue中行业和概念数据获取方法的调用错误
This commit is contained in:
parent
ef3c530df5
commit
9c62ac9ca3
|
|
@ -51,5 +51,5 @@ export const getTopIndustryPeriod = (data: any) => {
|
|||
|
||||
// 热门标签某时间段内topN列表(右边)
|
||||
export const getTopSourcePeriod = (data: any) => {
|
||||
return request.get("/top_source_period?start_date=" + data.start_date + "&end_date=" + data.end_time + "&limit_num=" + data.limit_num, data);
|
||||
return request.get("/top_source_period?start_date=" + data.start_time + "&end_date=" + data.end_time + "&limit_num=" + data.limit_num, data);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ const values = ref([]);
|
|||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
default: () => { },
|
||||
},
|
||||
});
|
||||
|
||||
|
|
@ -114,6 +114,14 @@ const initChart = () => {
|
|||
myChart.setOption(option);
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.data,
|
||||
(newVal) => {
|
||||
if (newVal) {
|
||||
initChart();
|
||||
}
|
||||
}
|
||||
);
|
||||
onMounted(async () => {
|
||||
// await getData();
|
||||
// initChart();
|
||||
|
|
@ -122,7 +130,6 @@ onMounted(async () => {
|
|||
// initChart();
|
||||
// }, 5000);
|
||||
|
||||
initChart();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -73,7 +73,8 @@
|
|||
<indexMenuTitle title="资讯评分分布区间"></indexMenuTitle>
|
||||
<Line style="margin-top: 30rpx" :data="lineData"></Line>
|
||||
|
||||
<view style="display: flex; flex-direction: column; text-align: center; justify-content: center; align-items: center; padding-bottom: 30rpx">
|
||||
<view
|
||||
style="display: flex; flex-direction: column; text-align: center; justify-content: center; align-items: center; padding-bottom: 30rpx">
|
||||
<InfoSummary style="width: 85%" :count="newsNum"></InfoSummary>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -100,11 +101,8 @@
|
|||
|
||||
<view class="logout" @click="loginOut" v-if="Session.get('token')">退出登录</view>
|
||||
|
||||
<LoginPopup
|
||||
:show="LoginShow"
|
||||
@handlePopupClose="handlePopupClose"
|
||||
@handlePopupSuccessCallback="handlePopupSuccessCallback"
|
||||
@handlePopupErrorCallback="handlePopupErrorCallback" />
|
||||
<LoginPopup :show="LoginShow" @handlePopupClose="handlePopupClose"
|
||||
@handlePopupSuccessCallback="handlePopupSuccessCallback" @handlePopupErrorCallback="handlePopupErrorCallback" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -263,7 +261,7 @@ const lineTopData = ref({});
|
|||
async function getLineDataFn() {
|
||||
if (lineTabIndex.value == 0) {
|
||||
// 行业
|
||||
getTopConceptPeriod({
|
||||
getTopIndustryPeriod({
|
||||
start_time: "2025-09-06",
|
||||
end_time: "2025-09-13",
|
||||
limit_num: 10,
|
||||
|
|
@ -272,7 +270,7 @@ async function getLineDataFn() {
|
|||
});
|
||||
} else if (lineTabIndex.value == 1) {
|
||||
// 概念
|
||||
getTopIndustryPeriod({
|
||||
getTopConceptPeriod({
|
||||
start_time: "2025-09-06",
|
||||
end_time: "2025-09-13",
|
||||
limit_num: 10,
|
||||
|
|
|
|||
Loading…
Reference in New Issue