Commit af4b269158fc67a5c0eaff80e78493ad9c8d307f

Authored by guzijian
1 parent c26d1528

添加线条

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