春风项目四线(合箱线、总装线)
wujian
2024-01-18 0ae9acad17724f5da4bfd68250ae2b5f3aefd188
提交 | 用户 | 时间
fd2207 1 <template>
2   <div class="app-container">
3     <el-row :gutter="3">
4       <el-col :span="6">
5         <el-card shadow="always">
b6884f 6           <img style="width: 200px;height: 50px; margin-left: 40px; margin-top: 0px" src="@/assets/logo/jcdm2.png" alt="dark">
W 7           <span style="margin-left: 66px; font-weight: bold">{{currentTime}}</span>
fd2207 8         </el-card>
9       </el-col>
10       <el-col :span="3">
11         <el-card shadow="always">
b6884f 12           <span class="centerText" style="margin-top: 26px">{{productCode}}</span>
fd2207 13         </el-card>
14       </el-col>
15       <el-col :span="15">
16         <el-card shadow="always">
f5af64 17           <span class="centerText">{{locationName}}</span>
fd2207 18         </el-card>
19       </el-col>
20     </el-row>
21     <el-row :gutter="3" style="margin-top: 5px">
22       <el-col :span="6">
23         <div style="height: 600px;overflow: auto;">
24           <div  class="container" style="height: 50px;background-color: #00afff;margin-bottom: 10px">
b6884f 25             <span class="centered">作业流程</span>
fd2207 26           </div>
27           <div v-for="(item,index) in tableData" :key="item.sort" class="outerDiv" :id="'outerDiv'+index">
28             <div class="innerDiv1">
29               <div class="innerDiv2">
30                 <span class="content_left">{{ index+1 }}</span>
31               </div>
32               <div class="content_right">{{ item.address }}</div>
33             </div>
34           </div>
35         </div>
36       </el-col>
37       <el-col :span="18">
38         <el-col :span="20">
39           <el-card style="height: 600px" shadow="always">
40             <el-row style="height: 100px">
b6884f 41               <span style="color: #31b431;font-size: 30px;font-weight: bold">{{address}}</span>
fd2207 42             </el-row>
43             <el-row style="height: 400px">
44               <el-image style="height: 390px;width: 960px" :src="src"></el-image>
45 <!--              {{src}}-->
46             </el-row>
47             <el-row style="height: 100px">
b6884f 48               <el-button type="primary" @click="backClick()" style="height: 50px; width: 130px; font-size: 20px; float: left" icon="el-icon-d-arrow-left">上一步</el-button>
W 49               <el-button type="primary" @click="nextStep()" style="height: 50px; width: 130px; font-size: 20px; float: right">下一步<i class="el-icon-d-arrow-right"></i></el-button>
fd2207 50             </el-row>
51           </el-card>
52         </el-col>
53         <el-col :span="4">
54           <el-card style="height: 600px" shadow="always">
55             <el-row style="height: 100px;margin-top: 100px">
b6884f 56               <el-button type="primary" @click="processDocuments()" style="height: 50px; width: 130px; font-size: 20px; float: left" icon="el-icon-folder-opened">工艺文件</el-button>
fd2207 57             </el-row>
b6884f 58             <el-row style="height: 80px;margin-top: 5px">
W 59               <el-button type="success" @click="changeProducts('2V91')" style="height: 50px; width: 130px; font-size: 20px; float: left" icon="el-icon-s-unfold">2V91</el-button>
fd2207 60             </el-row>
b6884f 61             <el-row style="height: 80px;">
W 62               <el-button type="info" @click="changeProducts('191')" style="height: 50px; width: 130px; font-size: 20px; float: left" icon="el-icon-s-unfold">191</el-button>
fd2207 63             </el-row>
b6884f 64             <el-row style="height: 80px;">
W 65               <el-button type="info" @click="changeProducts('0JWF')" style="height: 50px; width: 130px; font-size: 20px; float: left" icon="el-icon-s-unfold">0JWF</el-button>
fd2207 66             </el-row>
67           </el-card>
68         </el-col>
69
70       </el-col>
71     </el-row>
72   </div>
73 </template>
74
75 <script>
76 import {listFormulaChild} from "@/api/main/bs/formulaChild/formulaChild";
f5af64 77 import {listStationConf,getIp} from "@/api/main/sc/stationConf";
fd2207 78
79 export default {
80   name: "index",
81   data() {
82     return {
f5af64 83       locationName: "未配置工位",
fd2207 84       queryParams: {
85         pageNum: 1,
86         pageSize: 10,
87         productCode: null,
88       },
b6884f 89       currentTime:'',
fd2207 90       productCode: '2V91',
91       tableData: [{
92         img: 'https://fuss10.elemecdn.com/e/5d/4a731a90594',
93         sort: '2',
94         address: '上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄'
95       }, {
96         img: 'https://fuss10.elemecdn.com/e/5d/4a731a90594',
97         sort: '2',
98         address: '上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄'
99       }, {
100         img: 'https://fuss10.elemecdn.com/e/5d/4a731a90594',
101         sort: '2',
102         address: '上海市普陀区金沙江路 1519 弄'
103       }, {
104         img: 'htts://fuss10.elemecdn.com/e/5d/4a731a90594',
105         sort: '2',
106         address: '上海市普陀区金沙江路 1516 弄'
107       }, {
108         img: 'https://fuss10.elemecdn.com/e/5d/4a731a90594',
109         sort: '2',
110         address: '上海市普陀区金沙江路 1516 弄'
111       }, {
112         img: 'https://fuss10.elemecdn.com/e/5d/4a731a90594',
113         sort: '2',
114         address: '上海市普陀区金沙江路 1516 弄'
115       }, {
116         img: 'https://fuss10.elemecdn.com/e/5d/4a731a90594',
117         sort: '2',
118         address: '上海市普陀区金沙江路 1516 弄'
119       }, {
120         img: '222222222222',
121         sort: '2',
122         address: '上海市普陀区金沙江路 1516 弄'
123       }, {
124         img: 'https://fuss10.elemecdn.com/e/5d/4a731a90594',
125         sort: '2',
126         address: '上海市普陀区金沙江路 1516 弄'
127       }, {
128         img: 'https://fuss10.elemecdn.com/e/5d/4a731a90594',
129         sort: '2',
130         address: '上海市普陀区金沙江路 1516 弄'
131       }, {
132         img: 'https://fuss10.elemecdn.com/e/5d/4a731a90594',
133         sort: '2',
134         address: '上海市普陀区金沙江路 1516 弄'
135       }],
136       address: '',
1558d8 137       // src: 'https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg',
fd2207 138       // src: 'file:///D:/img/qt.jpg'
139
140       intervalId: null,
141
142     };
143   },
144   created() {
145     this.tableData = []
146   },
147   mounted() {
f5af64 148     this.getStationConf()
fd2207 149     this.changeProducts(this.productCode)
b6884f 150     this.getNowTime()
fd2207 151     // this.autoShow()
152   },
b6884f 153   // computed: {
W 154   //   currentTime:
155   // },
fd2207 156   methods: {
f5af64 157     /** 查询工位终端配置列表 */
158     getStationConf() {
159       getIp().then(response => {
160         let queryParams = {
161           ipAddress: response.msg,
162         }
163         listStationConf(queryParams).then(response => {
164           this.locationName = response.rows[0].processesName
165         });
166       });
167     },
b6884f 168     //获取当前时间
W 169     getNowTime () {
170       let speed = 1000
171       let that = this
172       let theNowTime = function () {
173         that.currentTime = that.timeNumber()
174       }
175       setInterval(theNowTime, speed)
176     },
177     timeNumber () {
178       let today = new Date()
179       let date = today.getFullYear() + '-' + this.twoDigits(today.getMonth() + 1) + '-' + this.twoDigits(today.getDate())
180       let time = this.twoDigits(today.getHours()) + ':' + this.twoDigits(today.getMinutes()) + ':' + this.twoDigits(today.getSeconds())
181       return date + '  ' + time
182     },
183     twoDigits (val) {
184       if (val < 10) return '0' + val
185       return val
186     },
fd2207 187     // 定时触发
188     autoShow() {
189       const _this = this
190       this.intervalId = setInterval(() => {
191         _this.setBg()
b6884f 192       }, 10000)
fd2207 193     },
194     setImg(index) {
195       this.address = this.tableData[index].address
196       this.src = this.tableData[index].img
197     },
198     setBg() {
199       if (document.getElementById('outerDiv' + (this.tableData.length - 1)).style.background === 'yellow') {
200         this.setImg(0)
201         document.getElementById('outerDiv0').style.background = 'yellow'
202         for (let j = 1; j < this.tableData.length; j++) {
203           document.getElementById('outerDiv' + j).style.background = 'white'
204         }
205         return;
206       }
207       for (let i = 0; i < this.tableData.length - 1; i++) {
208         if (document.getElementById('outerDiv' + i).style.background === 'yellow') {
209           this.setImg(i+1)
b6884f 210           document.getElementById('outerDiv' + i).style.background = 'lightgreen'
fd2207 211           document.getElementById('outerDiv' + (i+1)).style.background = 'yellow'
212           return;
213         }
214       }
215     },
216     getUpOrDown(index) {
217       for (let i = 0; i < this.tableData.length; i++) {
218         if (document.getElementById('outerDiv' + i).style.background === 'yellow') {
219           this.setImg(i + index)
b6884f 220           document.getElementById('outerDiv' + i).style.background = index < 0 ? 'white' : 'lightgreen'
fd2207 221           document.getElementById('outerDiv' + (i + index)).style.background = 'yellow'
222           return;
223         }
224       }
225     },
226     backClick(){
227       this.getUpOrDown(-1)
228     },
229     nextStep(){
230       this.getUpOrDown(1)
231     },
232     processDocuments(){
233
234     },
235     changeProducts(val){
236
b6884f 237       console.log("------更换图片",val)
fd2207 238       this.productCode = val
239       const _this = this
240
241       /** 查询配方配置子信息列表 */
242       this.queryParams.productCode = val;
243       listFormulaChild(this.queryParams).then(response => {
0ae9ac 244         this.tableData = [];
fd2207 245         this.tableData = response.rows;
1558d8 246         console.log(response.rows)
fd2207 247         this.$nextTick(() => {
248           clearInterval(this.intervalId);
249           document.getElementById('outerDiv0').style.background = 'yellow'
b6884f 250           for (let i = 1; i < this.tableData.length; i++){
W 251             document.getElementById('outerDiv' + i).style.background =  'white'
252           }
fd2207 253           this.setImg(0)
254           this.autoShow()
255         })
256
257
258       });
259     },
260   },
261 }
262 </script>
263
264 <style scoped>
265 .outerDiv {
266   width: fit-content;
b6884f 267   min-width: 102%;
fd2207 268   /*width: 300px;*/
269   height: 50px;
270   margin-bottom: 10px;
271 }
272
273 .innerDiv1 {
274   /*width: 79%;*/
275   height: 100%;
276   display: flex;
277   align-items: center;
278   border: 1px solid black;
279 }
280
281 .innerDiv2 {
282   /*width: 20%;*/
283   width: 50px;
284   height: 100%;
285   display: flex;
286   justify-content: center;
287   align-items: center;
288   border: 1px solid black;
289 }
290
291 .content_left {
292   font-weight: bold;
293 }
294 .content_right {
295   white-space: nowrap;
296   padding-left: 5px;
297   padding-right: 5px;
298 }
299 .container {
300   display: flex;
301   justify-content: center;
302   align-items: center;
303   height: 100px; /* 设置div的高度,可根据实际情况调整 */
304 }
305
306 .centered {
307   text-align: center;
b6884f 308   color: white;
W 309   font-weight: bold;
310   font-size: 20px;
fd2207 311 }
b6884f 312 .centerText{
W 313   color: black;
314   font-weight: bold;
315   font-size: 40px;
316   display: flex;
317   justify-content: center;
318   margin-top: 20px
319 }
320 ::v-deep .el-card__body{
321   height: 100px;
322 }
323
fd2207 324
325 </style>