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

更新时间轴问题

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