Commit af4b269158fc67a5c0eaff80e78493ad9c8d307f
1 parent
c26d1528
添加线条
Showing
2 changed files
with
5 additions
and
20 deletions
src/components/FleetContentBox/index.vue
| @@ -3,11 +3,12 @@ | @@ -3,11 +3,12 @@ | ||
| 3 | <!-- <vue3-seamless-scroll :list="item.fleetInfos" :step="1" :hoverStop="true" :hover="true"> --> | 3 | <!-- <vue3-seamless-scroll :list="item.fleetInfos" :step="1" :hoverStop="true" :hover="true"> --> |
| 4 | <!-- 线路信息 --> | 4 | <!-- 线路信息 --> |
| 5 | <div v-for="(childItem, childIndex) in item.fleetInfos" :key="childItem.lineName" class="fleet-line-info-container"> | 5 | <div v-for="(childItem, childIndex) in item.fleetInfos" :key="childItem.lineName" class="fleet-line-info-container"> |
| 6 | - | 6 | + <!-- <div class="line-box" style="height: 1px; margin: 5px; background-color: #0761ba;"></div> --> |
| 7 | + <el-divider /> | ||
| 7 | <div class="fleet-line-title"> | 8 | <div class="fleet-line-title"> |
| 8 | {{ childItem.lineName }} | 9 | {{ childItem.lineName }} |
| 9 | </div> | 10 | </div> |
| 10 | - <div class="line-box" style="height: 1px; margin: 5px; background-color: #0761ba;"></div> | 11 | + |
| 11 | <div ref="fleetNbbmInfoContainer" class="fleet-nbbm-info-container"> | 12 | <div ref="fleetNbbmInfoContainer" class="fleet-nbbm-info-container"> |
| 12 | <div v-for="(sunItem, sunIndex) in childItem.lineInfos" :key="sunItem.nbbm" class="fleet-nbbm-info-item"> | 13 | <div v-for="(sunItem, sunIndex) in childItem.lineInfos" :key="sunItem.nbbm" class="fleet-nbbm-info-item"> |
| 13 | <div v-if="sunItem.saleInfoVo != null" class="fleet-nbbm-info-have-sale"> | 14 | <div v-if="sunItem.saleInfoVo != null" class="fleet-nbbm-info-have-sale"> |
src/views/home/index.vue
| @@ -98,8 +98,7 @@ const timeTaskObject = reactive( | @@ -98,8 +98,7 @@ const timeTaskObject = reactive( | ||
| 98 | ); | 98 | ); |
| 99 | /** 定时任务 */ | 99 | /** 定时任务 */ |
| 100 | const timeTask = reactive( | 100 | const timeTask = reactive( |
| 101 | - { /** 当前日期 */ | ||
| 102 | - titleNowDateTimer: null, | 101 | + { |
| 103 | /** 数据更新计时 5分钟 */ | 102 | /** 数据更新计时 5分钟 */ |
| 104 | updateDateSchedulerTimer: null | 103 | updateDateSchedulerTimer: null |
| 105 | } | 104 | } |
| @@ -180,7 +179,6 @@ const fleetInfoList = ref() | @@ -180,7 +179,6 @@ const fleetInfoList = ref() | ||
| 180 | const scrollNumber = ref(null); | 179 | const scrollNumber = ref(null); |
| 181 | // 初始化数据 | 180 | // 初始化数据 |
| 182 | onMounted(() => { | 181 | onMounted(() => { |
| 183 | - timeTask.titleNowDateTimer = startUpdateNowDateTimerTaskScheduler(); | ||
| 184 | timeTask.updateDateSchedulerTimer = startUpdateDataTaskScheduler(); | 182 | timeTask.updateDateSchedulerTimer = startUpdateDataTaskScheduler(); |
| 185 | const currentTime = moment().format('HH:mm'); | 183 | const currentTime = moment().format('HH:mm'); |
| 186 | let dateKey; | 184 | let dateKey; |
| @@ -196,25 +194,13 @@ onMounted(() => { | @@ -196,25 +194,13 @@ onMounted(() => { | ||
| 196 | 194 | ||
| 197 | /** 销毁之前触发 */ | 195 | /** 销毁之前触发 */ |
| 198 | onDeactivated(() => { | 196 | onDeactivated(() => { |
| 199 | - clearInterval(timeTask.titleNowDateTimer) | ||
| 200 | clearInterval(timeTask.updateDateSchedulerTimer) | 197 | clearInterval(timeTask.updateDateSchedulerTimer) |
| 201 | }) | 198 | }) |
| 202 | /** 组件不挂载之前触发 */ | 199 | /** 组件不挂载之前触发 */ |
| 203 | onBeforeUnmount(() => { | 200 | onBeforeUnmount(() => { |
| 204 | - clearInterval(timeTask.titleNowDateTimer) | ||
| 205 | clearInterval(timeTask.updateDateSchedulerTimer) | 201 | clearInterval(timeTask.updateDateSchedulerTimer) |
| 206 | }) | 202 | }) |
| 207 | /** | 203 | /** |
| 208 | - * 开启当前日期更新 | ||
| 209 | - * @param {*} val | ||
| 210 | - */ | ||
| 211 | -const startUpdateNowDateTimerTaskScheduler = () => { | ||
| 212 | - return setInterval(() => { | ||
| 213 | - const currentDay = moment(new Date()); | ||
| 214 | - timeTaskObject.titleNowDateObject = currentDay.format("yyyy-MM-DD ") + getWeek(currentDay) + currentDay.format(" HH:mm:ss"); | ||
| 215 | - }, 1000); | ||
| 216 | -} | ||
| 217 | -/** | ||
| 218 | * 数据更新日期 | 204 | * 数据更新日期 |
| 219 | * @param {*} val | 205 | * @param {*} val |
| 220 | */ | 206 | */ |
| @@ -240,6 +226,7 @@ const startUpdateDataTaskScheduler = () => { | @@ -240,6 +226,7 @@ const startUpdateDataTaskScheduler = () => { | ||
| 240 | seconds = seconds < 10 ? "0" + seconds : seconds; | 226 | seconds = seconds < 10 ? "0" + seconds : seconds; |
| 241 | // 格式化倒计时字符串 | 227 | // 格式化倒计时字符串 |
| 242 | timeTaskObject.updateDateSchedulerObject = `${minutes}:${seconds}`; | 228 | timeTaskObject.updateDateSchedulerObject = `${minutes}:${seconds}`; |
| 229 | + timeTaskObject.titleNowDateObject = currentDate.format("yyyy-MM-DD ") + getWeek(currentDate) + currentDate.format(" HH:mm:ss"); | ||
| 243 | }, 1000); | 230 | }, 1000); |
| 244 | } | 231 | } |
| 245 | 232 | ||
| @@ -534,9 +521,6 @@ const handleGlobalInfo = (data, num) => { | @@ -534,9 +521,6 @@ const handleGlobalInfo = (data, num) => { | ||
| 534 | font-size: clamp(0.8rem, -0.907rem + 5.71vw, 1.3rem); | 521 | font-size: clamp(0.8rem, -0.907rem + 5.71vw, 1.3rem); |
| 535 | } | 522 | } |
| 536 | } | 523 | } |
| 537 | - | ||
| 538 | - | ||
| 539 | - | ||
| 540 | } | 524 | } |
| 541 | 525 | ||
| 542 | .fleet-common-style:last-child { | 526 | .fleet-common-style:last-child { |