huangxiaoqiang
2025-06-05 f0428c0ce5831765142690676d1b337a84e90b8b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
<!--
 * @Author: daidai
 * @Date: 2022-03-04 09:23:59
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-05-07 11:05:02
 * @FilePath: \web-pc\src\pages\big-screen\view\indexs\index.vue
-->
<template>
  <div class="contents">
    <div class="contetn_left">
      <div class="pagetab">
        
      </div>
      <!-- <ItemWrap class="contetn_left-top contetn_lr-item" title="故障--种类频率">
        <LeftCenter />
      </ItemWrap> -->
 
      <ItemWrap
        class="contetn_left-bottom contetn_lr-item"
        title="当前出入库任务"
      >
      <stationone/>
      </ItemWrap>
 
      <ItemWrap
        class="contetn_left-bottom contetn_lr-item"
        title="今日待出库实盘"
      >
      <stationtwo/>
      </ItemWrap>
 
      <ItemWrap
        class="contetn_left-bottom contetn_lr-item"
        title="货位状态信息"
      >
      <stationthree/>
      </ItemWrap>
 
    </div>
    <div class="contetn_center">
      <div style="height:70vh;margin-bottom: -30px">
        <LeftBottom/>
      </div>
      <ItemWrap
        class="contetn_left-bottom contetn_lr-item"
        title="产量展示信息"
        style="padding: 0 10px 16px 10px"
      >
        <RightCenter />
      </ItemWrap>
    </div>
    <div class="contetn_right">
      <ItemWrap
        class="contetn_left-bottom contetn_lr-item"
        title="各线当前任务数量"
        style="padding: 0 10px 16px 10px"
      >
      <passtwo />
      </ItemWrap>
 
      <ItemWrap
        class="contetn_left-bottom contetn_lr-item"
        title="实盘入库产量统计"
        style="padding: 0 10px 16px 10px"
      >
      <CenterBottom />
      </ItemWrap>
 
      <ItemWrap
        class="contetn_left-bottom contetn_lr-item"
        title="实盘出库产量统计"
      >
        <plan />
      </ItemWrap> 
    </div>
    <div class="popup-container">
    <!-- 弹窗内容 -->
    <div
      v-show="isPopupVisible"
      class="popup"
    >
      <div class="popup-content">
        <table class="table table-striped">
    <thead>
      <tr>
        <th>货位号</th>
        <th>托盘号</th>
        <th>库区</th>
      </tr>
    </thead>
    <tbody>
    
              <!-- 使用 v-for 循环渲染数据行 -->
              <tr v-for="item in tableData" :key="item.id"> <!-- 假设数据有唯一标识id,若无可用索引 -->
                <td style="color: red;">当前超时托盘:</td>
                <td>{{ item.locationCode }}</td> <!-- 货位号字段,需根据接口返回的实际字段名修改 -->
                <td>{{ item.palletCode }}</td> <!-- 托盘号字段 -->
                <td>{{ item.areaCode.includes('FR') ? '分容库区' : item.areaCode.includes('GW') ? '高温库区'  : item.areaCode.includes('CW') ? '常温库区'  : item.areaCode }}</td><!-- 应出库时间,可添加格式化函数 -->
                <td >{{ item.outboundTime }}</td>
              </tr>
              <!-- 空数据提示 -->
              <tr v-if="tableData.length == 0">
                <td colspan="3" class="text-center">暂无数据</td>
              </tr>
            </tbody>
      
</table>
        <button @click="closePopup">立即关闭</button>
      </div>
    </div>
  </div>
  </div>
</template>
 
<script>
import LeftTop from './left-top.vue'
import LeftCenter from "./left-center.vue";
import LeftBottom from "./left-bottom.vue";
import CenterMap from "./center-map.vue";
import CenterBottom from "./center-bottom.vue";
import RightTop from "./right-top.vue";
import RightCenter from "./right-center.vue";
import RightBottom from "./right-bottom.vue";
import LeftCenterRight from "./left-center-right.vue";
import stationone from './station-one.vue'
import stationtwo from './station-two.vue'
import stationthree from './station-three.vue'
import stationfour from './station-four.vue'
import passtwo from './pass-two.vue'
import plan from './plan.vue'
import {GetTimeoutgetPageData} from "@/api/http.js"
export default {
  components: {
    LeftTop,
    LeftCenter,
    LeftCenterRight,
    LeftBottom,
    CenterMap,
    RightTop,
    RightCenter,
    RightBottom,
    CenterBottom,
    stationone,
    stationtwo,
    stationthree,
    stationfour,
    passtwo,
    plan
  },
  data() {
    return {
      isPopupVisible: false,
      tableData: [],
      showDuration: 60*10*1000, // 显示时长(5秒)
      intervalTime: 60*60*1000, // 间隔时长(5秒)
      showTimer: null, // 显示时长定时器
      intervalTimer: null // 间隔时长定时器
    };
  },
  mounted() {
    this.startPopupCycle(); // 启动弹窗循环
  },
  beforeDestroy() {
    this.clearTimers(); // 清除所有定时器
  },
  // beforeDestroy() {
  //   this.clearData()
  // },
  methods: {
    // 启动弹窗循环
    startPopupCycle() {
      this.showPopup(); // 首次显示弹窗
    },
 
    // 显示弹窗
    showPopup() {
      this.isPopupVisible = true;
      this.fetchData(); // 获取数据
 
      // 设置显示时长定时器
      this.showTimer = setTimeout(() => {
        this.hidePopup(); // 显示结束后隐藏弹窗
      }, this.showDuration);
    },
 
    // 隐藏弹窗
    hidePopup() {
      this.isPopupVisible = false;
      
      // 设置间隔时长定时器
      this.intervalTimer = setTimeout(() => {
        this.startPopupCycle(); // 间隔结束后重新显示弹窗
      }, this.intervalTime);
    },
 
    // 获取数据
    async fetchData() {
      try {
        const rep = await GetTimeoutgetPageData();
        this.tableData = rep || []; // 更新响应式数据
      } catch (error) {
        console.error("数据获取失败:", error);
      }
    },
 
    // 手动关闭弹窗(可选)
    closePopup() {
      this.isPopupVisible = false;
      this.clearTimers(); // 清除定时器
      this.startPopupCycle(); // 重新开始循环(可选)
    },
 
    // 清除所有定时器
    clearTimers() {
      clearTimeout(this.showTimer);
      clearTimeout(this.intervalTimer);
      this.showTimer = null;
      this.intervalTimer = null;
    }
  }
};
</script>
<style lang="scss" scoped>
// 内容
.contents {
  .contetn_left,
  .contetn_right {
    width: 540px;
    box-sizing: border-box;
    // padding: 16px 0;
  }
 
  .contetn_center {
    width: 720px;
  }
 
  //左右两侧 三个块
  .contetn_lr-item {
    height: 310px;
  }
 
  .contetn_center_top {
    width: 100%;
  }
 
  // 中间
  .contetn_center {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
  }
 
  .contetn_center-bottom {
    height: 315px;
  }
 
  //左边 右边 结构一样
  .contetn_left,
  .contetn_right {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    position: relative;
 
  
  }
}
.labels {
        flex-shrink: 0;
        font-size: 24px;
        color: rgba(255, 255, 255, 0.6);
        float: left; 
        margin-right: 11.5%;
      }
      .labelsd {
        flex-shrink: 0;
        font-size: 24px;
        color: rgba(255, 255, 255, 0.6);
        float: left; 
        margin-left: 6%;
      }
 
@keyframes rotating {
    0% {
        -webkit-transform: rotate(0) scale(1);
        transform: rotate(0) scale(1);
    }
    50% {
        -webkit-transform: rotate(180deg) scale(1.1);
        transform: rotate(180deg) scale(1.1);
    }
    100% {
        -webkit-transform: rotate(360deg) scale(1);
        transform: rotate(360deg) scale(1);
    }
}
.popup-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  z-index: 9999;
}
 
.popup {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
 
.popup-content {
  text-align: center;
}
 
button {
  margin-top: 15px;
  padding: 8px 20px;
  background: #42b983;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
 
button:hover {
  opacity: 0.9;
}
</style>