提交 b15a7787 authored 作者: liujiaxing's avatar liujiaxing

更新时间轴问题

上级 45a0bdf7
......@@ -161,7 +161,7 @@ const setdia = ref(false)//弹框是否展开
//设置问题
const setclick = () => {
console.log("哦口口");
timeValue.value = '1'
setdia.value = !setdia.value
historyS.value = false
}
......@@ -193,14 +193,14 @@ const dateClick = (e) => {
const year = now.getFullYear(); // 年份,如 2026
const month = now.getMonth() + 1; // 月份,需要 +1,结果范围 1~12
const day = now.getDate();
startTime = `${year}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`
endTime = ''
if (timeValue.value == 1) {//当天
endTime = `${year}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`
startTime = ''
if (timeValue.value == 1) {//当天
startTime = `${year}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`
} else if (timeValue.value == 2) {//近七天
endTime = getLast7DaysIncludingToday()
startTime = getLast7DaysIncludingToday()
} else if (timeValue.value == 3) {//近一个月
endTime = getPreviousMonthDate()
startTime = getPreviousMonthDate()
}
}
emit("changeTime", [startTime, endTime]);
......
......@@ -142,6 +142,7 @@ const dateValue = ref([])//时间段
const setdia = ref(false)//弹框是否展开
//设置问题
const setclick = () => {
timeValue.value = '1'
setdia.value = !setdia.value
historyS.value = false
}
......@@ -173,14 +174,14 @@ const dateClick = (e) => {
const year = now.getFullYear(); // 年份,如 2026
const month = now.getMonth() + 1; // 月份,需要 +1,结果范围 1~12
const day = now.getDate();
startTime = `${year}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`
endTime = ''
if (timeValue.value == 1) {//当天
endTime = `${year}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`
startTime = ''
if (timeValue.value == 1) {//当天
startTime = `${year}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`
} else if (timeValue.value == 2) {//近七天
endTime = getLast7DaysIncludingToday()
startTime = getLast7DaysIncludingToday()
} else if (timeValue.value == 3) {//近一个月
endTime = getPreviousMonthDate()
startTime = getPreviousMonthDate()
}
}
emit("changeTime", [startTime, endTime]);
......
......@@ -161,6 +161,7 @@ const dateValue = ref([])//时间段
const setdia = ref(false)//弹框是否展开
//设置问题
const setclick = () => {
timeValue.value = '1'
setdia.value = !setdia.value
historyS.value = false
}
......@@ -192,14 +193,14 @@ const dateClick = (e) => {
const year = now.getFullYear(); // 年份,如 2026
const month = now.getMonth() + 1; // 月份,需要 +1,结果范围 1~12
const day = now.getDate();
startTime = `${year}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`
endTime = ''
if (timeValue.value == 1) {//当天
endTime = `${year}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`
startTime = ''
if (timeValue.value == 1) {//当天
startTime = `${year}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`
} else if (timeValue.value == 2) {//近七天
endTime = getLast7DaysIncludingToday()
startTime = getLast7DaysIncludingToday()
} else if (timeValue.value == 3) {//近一个月
endTime = getPreviousMonthDate()
startTime = getPreviousMonthDate()
}
}
emit("changeTime", [startTime, endTime]);
......
<template>
<div class="constellation-panel">
<template v-if="timeclick">
<!-- 顶部区域:标题与核心指标 -->
<div class="header-container">
<!-- <allHotMap></allHotMap> -->
<!-- <div>{{ component1 }}</div> -->
<component :is="component1" :data="[capacityData, trafficData]" zoomHeight="2" :title="titles[0]" slogan="容量/流量"
:legendName="['链路层容量', '用户实际流量']" :lineArray="true" @changeTime="changeTimeFn(1, $event)"></component>
</div>
<!-- 卫星列表 -->
<div class="satellite-section">
<!-- <cdf></cdf> -->
<component :is="component2" :data="[availabilityData, actualAvailabilityData]" zoomHeight="14" :title="titles[1]"
slogan="可用性" :legendName="['规划可用性', '实际可用性']" :lineArray="true" @changeTime="changeTimeFn(2, $event)">
<component :is="component2" :data="[availabilityData, actualAvailabilityData]" zoomHeight="14"
:title="titles[1]" slogan="可用性" :legendName="['规划可用性', '实际可用性']" :lineArray="true"
@changeTime="changeTimeFn(2, $event)">
</component>
</div>
<!-- 地面系统 -->
<div class="ground-system-section">
<!-- <instant></instant> -->
<component :is="component3" :data="[delayData, lossRateData]" zoomHeight="14" :title="titles[2]" slogan="网络时延/丢包"
:legendName="['搜星时延', '丢包率']" :lineArray="false" @changeTime="changeTimeFn(3, $event)"></component>
<component :is="component3" :data="[delayData, lossRateData]" zoomHeight="14" :title="titles[2]"
slogan="网络时延/丢包" :legendName="['搜星时延', '丢包率']" :lineArray="false" @changeTime="changeTimeFn(3, $event)">
</component>
</div>
</template>
</div>
</template>
......@@ -35,6 +37,7 @@ import { getPanelCurve, templateConfigQuery } from '@/api/Zodiac'
import Loading from '@/pages/all/components/loadingComponent/index.js'
const startTime = ref('')
const endTime = ref('')
const timeclick = ref(true)//选择时间时更新组件
//组件返回时信息根据type区分判断
const changeTimeFn = (type, times) => {
console.log(times, '对比', type);
......@@ -45,6 +48,7 @@ const changeTimeFn = (type, times) => {
} else if (type == 3) {
}
timeclick.value = false
startTime.value = times[0]
endTime.value = times[1]
getPanelCurveData()
......@@ -69,6 +73,8 @@ let granularity = null
let granularityValue = null
watch(() => appStore.chartConfig, (newVal) => {
console.log("是否触发");
// console.log('appStore.chartConfig', appStore.chartConfig)
// console.log('newVal', newVal)
if (appStore.chartConfig) {
......@@ -105,6 +111,7 @@ const getPanelCurveData = async (datas) => {
delete data.endTime
}
const res = await getPanelCurve(data)
timeclick.value = true
if (res.code == 200 && res.data !== null) {
// console.log('所有曲线数据', res.data)
capacityData.value = res.data.capacity
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论