zhaowei
2025-05-12 cd3313781f48c15a8fa0f0b46e2fdcde02969e87
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
<template>
  <div class="full-screen-container">
 
    <div class="background-line-container">
      <div class="page-header">
        <div>
          <img src="@/assets/signage/logo.png" style="height: 1.67vw"/>
          法士特沃克齿轮有限公司
        </div>
        <div>{{signageList[currentSignageIndex].signageTitle}}</div>
        <div>
          {{currentDateAndTime}}
          <span>{{currentDayOfWeek}}</span>
          <div class="back-img-container" v-if="currentSignageIndex!==0" @click="backToPreSignage">
            <img src="@/assets/signage/back.png"/>
          </div>
        </div>
      </div>
 
      <div class="content-container">
        <dv-decoration-10 class="dv-decoration" :color="['#4D9BEF','#222E4A']"/>
        <Component :is="currentSignage" @nextSignage="switchToNextSignage" ref="componentRef"
                   :currentProductionId="signageList[currentSignageIndex].productionId"
                   :preSignageProductionId="currentSignageIndex!==0?signageList[currentSignageIndex-1].productionId:''"
                   @switchEquipmentSignageProductionId="switchEquipmentSignageProductionId"
                   @startPageLoading="pageLoading=true" @loadFinished="pageLoading=false">
          <template v-slot:loading>
            <dv-loading class="dv-loading" v-if="pageLoading">加载中...</dv-loading>
          </template>
        </Component>
      </div>
    </div>
  </div>
</template>
 
<script>
  import moment from 'moment'
  import CompanySignage from './modules/GradeSignage/CompanySignage.vue'
  import WorkshopSignage from './modules/GradeSignage/WorkshopSignage.vue'
  import SectionSignage from './modules/GradeSignage/SectionSignage.vue'
  import EquipmentSignage from './modules/GradeSignage/EquipmentSignage.vue'
 
  export default {
    productionName: 'GradeWorkshopSignage',
    components: {
      CompanySignage,
      WorkshopSignage,
      SectionSignage,
      EquipmentSignage
    },
    data() {
      return {
        pageLoading: false,
        currentDateAndTime: null,
        currentDayOfWeek: null,
        getDateAndTimeInterval: null,
        getDayOfWeekInterval: null,
        signageList: [
          {
            signageLevel: 'CompanySignage',
            signageTitle: '法士特沃克齿轮有限公司',
            productionId: ''
          },
          {
            signageLevel: 'WorkshopSignage',
            signageTitle: '',
            productionId: ''
          },
          {
            signageLevel: 'SectionSignage',
            signageTitle: '',
            productionId: ''
          },
          {
            signageLevel: 'EquipmentSignage',
            signageTitle: '设备看板',
            productionId: ''
          }
        ],
        currentSignage: 'CompanySignage',
        currentSignageIndex: 0
      }
    },
    created() {
      this.pageLoading = true
      this.getCurrentDateAndTime()
      this.getCurrentDayOfWeek()
    },
    beforeDestroy() {
      if (this.getDateAndTimeInterval) {
        clearInterval(this.getDateAndTimeInterval)
        this.getDateAndTimeInterval = null
      }
 
      if (this.getDayOfWeekInterval) {
        clearInterval(this.getDayOfWeekInterval)
        this.getDayOfWeekInterval = null
      }
    },
    methods: {
      /**
       * 切换到下一级看板
       * @param record 跳转按钮信息
       */
      switchToNextSignage(record) {
        this.pageLoading = true
        this.currentSignageIndex++
        if (this.currentSignageIndex !== this.signageList.length - 1) {
          this.signageList[this.currentSignageIndex].signageTitle = record.productionName + '看板'
        }
        this.signageList[this.currentSignageIndex].productionId = record.id
        this.currentSignage = this.signageList[this.currentSignageIndex].signageLevel
      },
 
      // 返回前一级看板
      backToPreSignage() {
        this.pageLoading = true
        this.currentSignageIndex--
        if (this.currentSignageIndex + 1 !== this.signageList.length - 1) this.signageList[this.currentSignageIndex + 1].signageTitle = ''
        this.signageList[this.currentSignageIndex + 1].productionId = ''
        this.currentSignage = this.signageList[this.currentSignageIndex].signageLevel
      },
 
      /**
       * 切换设备看板中的设备编号时触发
       * @param productionId 看板对应编号
       */
      switchEquipmentSignageProductionId(productionId) {
        this.signageList[this.currentSignageIndex].productionId = productionId
      },
 
      // 获取当前日期和时间(1秒更新1次)
      getCurrentDateAndTime() {
        this.getDateAndTimeInterval = setInterval(() => this.currentDateAndTime = moment().format('YYYY-MM-DD HH:mm:ss'), 1000)
      },
 
      // 获取当天是星期几(1天更新1次)
      getCurrentDayOfWeek() {
        let timer = setTimeout(() => {
          this.currentDayOfWeek = moment().format('dddd')
          clearTimeout(timer)
          timer = null
        })
        this.getDayOfWeekInterval = setInterval(() => {
          this.currentDayOfWeek = moment().format('dddd')
        }, 1000 * 60 * 60 * 24)
      }
    }
  }
</script>
 
<style lang="less">
  @font-face {
    font-family: 'LanTing';
    src: url('../../../assets/signage/font/方正兰亭特黑简体.ttf') format('truetype');
  }
 
  @font-face {
    font-family: 'ZongYi';
    src: url('../../../assets/signage/font/百度综艺简体.ttf') format('truetype');
  }
 
  .full-screen-container {
    width: 100vw;
    height: 56.25vw;
    background-image: url("../../../assets/signage/background.png");
    background-size: 100% 100%;
    padding: 0.5%;
    color: #eee;
 
    .background-line-container {
      background-image: url("../../../assets/signage/background-line.png");
      background-size: 100% 100%;
      height: 100%;
      display: flex;
      flex-direction: column;
 
      .page-header {
        display: flex;
        letter-spacing: 0.05vw;
 
        > div:first-child {
          color: #0071B6;
          font-size: 1.05vw;
        }
 
        > div:nth-child(2) {
          font-size: 1.7vw;
          text-align: center;
          text-shadow: 0 0.4vw 0 rgba(255, 255, 255, .2);
          font-family: 'ZongYi';
          letter-spacing: 0.25vw;
        }
 
        > div:last-child {
          text-align: right;
          font-family: 'ZongYi';
          font-size: 1.25vw;
          position: relative;
 
          span {
            font-weight: normal;
            font-size: 1.05vw;
          }
 
          .back-img-container {
            position: absolute;
            bottom: -2vw;
            right: 1vw;
            cursor: pointer;
 
            img {
              width: 1.77vw;
              height: 1.77vw;
            }
          }
        }
 
        > div:not(div:nth-child(2)) {
          font-weight: bold;
        }
 
        > div {
          width: 33%;
        }
      }
 
      .content-container {
        flex: 1;
        margin: 4.5vw 3.3vw 3vw 3vw;
 
        .right-container {
          display: flex;
          flex-direction: column;
          justify-content: space-between;
 
          > div:first-child {;
            position: relative;
 
            img {
              height: 100%;
              position: absolute;
            }
 
            .right-chart-container {
              width: 73.59vw;
              height: 25.31vw;
            }
          }
 
          > div:last-child {
            display: flex;
            justify-content: space-between;
 
            > div {
              position: relative;
 
              img {
                height: 100%;
                position: absolute;
              }
 
              .right-chart-container {
                width: 23.125vw;
                height: 19.42vw;
              }
            }
          }
        }
      }
    }
 
    .dv-decoration {
      width: 90%;
      height: 0.25vw;
      max-width: 90%;
      position: absolute;
      top: -1.5vw;
      left: 5%
    }
 
    .dv-loading {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: rgba(0, 0, 0, .5);
      z-index: 9999
    }
 
  }
</style>