From dc5472e5bda5f4c9b779977c691e8973e2a1a12c Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期四, 07 九月 2023 10:49:45 +0800 Subject: [PATCH] 去掉网络设置的 tab 2-23-9-7 --- src/views/visualization.vue | 155 +++++++++++++++++++++++++++++++++++---------------- 1 files changed, 105 insertions(+), 50 deletions(-) diff --git a/src/views/visualization.vue b/src/views/visualization.vue index 987af08..9a27125 100644 --- a/src/views/visualization.vue +++ b/src/views/visualization.vue @@ -1,6 +1,7 @@ <template> <div class="home"> + <!-- --> <template v-if="Object.keys(taskData).length > 0 && taskData.Procedure.ID"> <div class="left"> <p class="title"> @@ -27,9 +28,9 @@ <span class="title-item" >鍚庨亾宸ュ簭: <span class="color_4efefa"> - <!-- {{ - taskData.NextProcedure.procedure.procedureName || "--" - }} --> + {{ + taskData.Procedure.procedure.nextProcedureName || "--" + }} </span> </span> <span class="title-item" @@ -106,15 +107,17 @@ <el-progress define-back-color="#133EAF" color="#09E5ED" + text-color="#fff" :text-inside="true" :stroke-width="30" - :percentage="finishPercent" + :percentage="taskData.Order?parseInt(finishNumber/taskData.Order.amount*100):0" ></el-progress> </el-descriptions-item> <!-- <el-descriptions-item label="鍚堟牸鐜�" style="width: 100%"> <el-progress define-back-color="#007101" color="#00CC66" + text-color="#fff" :text-inside="true" :stroke-width="30" :percentage="passrate" @@ -196,15 +199,16 @@ </div> <div class="card_top-3"> <span class="card-top-r-t" - >瀹屾垚杩涘害锛歿{ finishPercent || 0 }}</span + >瀹屾垚杩涘害锛歿{ taskData.Order?parseInt(finishNumber/taskData.Order.amount*100):0}}</span > <span class="card-top-r-b"> <el-progress define-back-color="#133EAF" color="#09E5ED" + text-color="#fff" :text-inside="true" :stroke-width="10" - :percentage="finishPercent" + :percentage="taskData.Order?parseInt(finishNumber/taskData.Order.amount*100):0" :show-text="false" ></el-progress> </span> @@ -223,7 +227,7 @@ </div> --> <div class="card_top-4"> <div>宸ヨ壓缂栧彿锛歿{ list.number }}</div> - <div + <!-- <div style=" font-size: 14px; color: #cfcfcf; @@ -231,7 +235,7 @@ " > 宸ヨ壓鐨勫叿浣撲俊鎭鐐瑰嚮鎺у埗鏌ョ湅锛� - </div> + </div> --> </div> </template> </div> @@ -343,10 +347,10 @@ <div class="right-top-l">浣滀笟鐘舵��</div> <div class="time"> <dl> - <dd><span style="font-size: 32px">{{ formatDate3() }}</span></dd> + <dd><span style="font-size: 32px">{{ formatTime3 }}</span></dd> <dd> <span style="font-size: 12px; " - >{{ formatDate2() }}</span + >{{ formatTime2 }}</span > <!--margin-right: 10px <span style="font-size: 14px">鏄熸湡鍥�</span> --> </dd> @@ -361,7 +365,7 @@ </span> </div> <div class="right-top-m-btn"> - <el-button type="primary" @click="controlClick"> 鎺у埗</el-button> + <!-- <el-button type="primary" @click="controlClick"> 鎺у埗</el-button> --> </div> <div class="right_dutyLst"> <div class="right-small-title">褰撳墠鍊肩彮</div> @@ -415,12 +419,13 @@ </div> </div> </template> + <!-- --> <template v-else> <div class="home-img-box"> <div class="bg-title"> <img src="../../public/bg-title.png" /> <span class="bg-title-span">璁惧瀹炴椂鐢熶骇鐪嬫澘</span> - <div class="bg-date"><span>{{ formatDate3() }}</span><br/>{{formatDate2()}}</div> + <div class="bg-date"><span>{{ formatTime3 }}</span><br/>{{formatTime2}}</div> <span class="font el-icon-setting set-title bg-set" @click="setUrl" @@ -430,7 +435,8 @@ <img src="../../public/yuan.png" /> <div class="btn-img"> <div class="font_size_16" style="line-height: 5; margin-top: 18%"> - 鏆傛棤浠诲姟锛屼紤鎭竴涓嬪惂... + <span v-if="showCountDown">璺濈浠诲姟寮�濮嬫椂闂达細{{countDownHour}}鏃� {{countDownMinute}}鍒�</span> + <span v-else>鏆傛棤浠诲姟锛屼紤鎭竴涓嬪惂...</span> </div> <el-button type="primary" @click="reloadPage">鍒锋柊浠诲姟</el-button> </div> @@ -438,11 +444,14 @@ </div> </template> <!-- 鎺у埗鐨勫脊妗� --> - <AddControl ref="control" :id="taskData.Procedure.ID" /> + <AddControl ref="control" :Arr="Arr" /> + <!-- 鎺у埗鐨勫脊妗� --> + <AddIssue ref="control" :Arr="Arr" :taskData="taskData" :Order="taskData.Order" @getSetProductNumber="getTaskInfo" /> </div> </template> <script> + import { getTaskInfo, finishTask, @@ -450,15 +459,18 @@ saveMiniDict, startTask, getProgress, + countdown, } from "@/api/home/index"; // 浜х嚎 import Card from "@/components/Card.vue"; import Knowledge from "../components/Knowledge.vue"; import AddControl from "../components/AddControl.vue"; +import AddIssue from "../components/AddIssue.vue"; export default { components: { Card, Knowledge, AddControl, + AddIssue, }, data() { return { @@ -466,7 +478,8 @@ passrate: 30, //鍚堟牸鐜� production: 25, //鐢熶骇涓� finishNumber: 0, - finishPercent: 0, + formatTime2:'', + formatTime3:'', // 鍙充晶瀹屾垚 finishShow: false, inputMaterials: [], @@ -513,6 +526,14 @@ }, }, }, + totalNumber:0, + showCountDown:false, + countDownHour:0, + countDownMinute:0, + Arr:[], + // 璁板綍瀹氭椂鍣ㄧ姸鎬� + procInfoTimer:null, + cutdownTimer: null }; }, mounted() { @@ -521,23 +542,34 @@ // this.passrate = this.getRandomNumber(1, 100); // this.production = this.getRandomNumber(1, 100); // }, 3000); + this.getDate3() + this.getDate2() + setInterval(()=>{ + this.getDate3() + this.getDate2() + },5000) this.getTaskInfo(); - setInterval(() => { - this.getProgressInfo(); - }, 60000); }, - methods: { + reloadPage() { - window.location.reload(); + // window.location.reload(); + this.getTaskInfo(); + }, + getcountdown(){ + countdown().then((res) => { + if (res.code == 200) { + this.showCountDown=res.data.ShowCountDown?res.data.ShowCountDown:false; + this.countDownHour=res.data.CountDownHour?res.data.CountDownHour:0 + this.countDownMinute=res.data.CountDownMinute?res.data.CountDownMinute:0 + } + }); }, getProgressInfo() { getProgress().then((res) => { if (res.code == 200) { this.finishNumber = res.data.finishNumber ? res.data.finishNumber : 0; - this.finishPercent = res.data.finishPercent - ? res.data.finishPercent - : 0; + } }); }, @@ -579,15 +611,13 @@ return ""; } }, - formatDate3() { - const now = new Date(); - let time = this.getDateObj(now, "hh:mm"); - return time; + getDate3(){ + let now= new Date(); + this.formatTime3 = this.getDateObj(now, "hh:mm"); }, - formatDate2(){ - const now = new Date(); - let time = this.getDateObj(now, "yyyy骞碝M鏈坉d鏃�"); - return time; + getDate2(){ + let now = new Date(); + this.formatTime2 = this.getDateObj(now, "yyyy骞碝M鏈坉d鏃�"); }, setInterCard(value, name) { let height = 200; @@ -631,6 +661,7 @@ }; getTaskInfo().then((res) => { if (res.code == 200) { + this.procedureList=[] this.taskData = res.data ? res.data : { @@ -653,16 +684,25 @@ ...this.taskData.Procedure.procedure, }, ]); + + if (this.taskData.Procedure.ID) { startTask({ id: this.taskData.Procedure.ID }).then((res) => { if (res.code == 200) { // res.data.number this.procedureList[0].push({ - number: res.data.number, + number: res.data.Number, name: "宸ヨ壓", }); + this.Arr=res.data.Params?res.data.Params:[]; } }); + this.getProgressInfo(); + if (!this.procInfoTimer) { + this.procInfoTimer = setInterval(() => { + this.getProgressInfo(); + }, 6000); + } } console.log(this.procedureList, "===1111procedureList"); // setTimeout(() => { @@ -671,14 +711,26 @@ this.setInterCard("outputMaterials", "cardBox3"); // }, 5000); } + if(res.code!=200||!this.taskData.Procedure.ID){ + this.getcountdown(); + // 鎺у埗閲嶆柊璇锋眰getTaskInfo, 鍙紑鍚竴涓畾鏃跺櫒 + if (!this.cutdownTimer) { + this.cutdownTimer = setInterval(() => { + this.getcountdown(); + }, 60000); + } + } }); }, // 璁剧疆 setUrl() { - const { href } = this.$router.resolve({ + // const { href } = this.$router.resolve({ + // path: "/set", + // }); + // window.open(href, "_blank"); + this.$router.push({ path: "/set", }); - window.open(href, "_blank"); }, // 鍙充晶鎺у埗 controlClick() { @@ -686,6 +738,7 @@ this.$refs.control.islook = true; } else { this.$message.error("褰撳墠璁惧娌℃湁宸ュ簭锛�"); + } }, // 鍙充晶瀹屾垚 @@ -731,24 +784,24 @@ } .bg-title-span { position: absolute; - width: 400px; - height: 100px; - line-height: 100px; + width: 30%; + height: 4rem; + line-height:2.4; font-size: 26px; font-weight: 700; text-align: center; - left: 39%; - top: 5%; + left: 36%; + top: 1.5rem; display: inline-block; } .bg-set{ position:absolute; right:10%; - height: 100px; - line-height: 100px; + height: 4rem; + line-height:2.4; font-size: 40px; font-weight: 700; - top: 5%; + top: 1rem; } .bg-date{ position:absolute; @@ -780,7 +833,7 @@ margin: 0 auto; text-align: center; position: absolute; - top: 21%; + top: 9rem; } } } @@ -788,11 +841,7 @@ font-size: 30px; font-weight: 700; } -.el-button--primary { - border: 0; - font-weight: 700 !important; - font-size: 16px !important; -} + .color_4efefa { color: #4efefa; } @@ -1103,7 +1152,7 @@ padding: 0 10px; height: 70px; - line-height: 40px; + line-height: 70px; color: #fff; background: rgb(19, 35, 90); font-size: 20px; @@ -1219,7 +1268,8 @@ } .right_dutyLst { width: calc(100% - 20px); - height: 270px; + // height: 270px; + height: 310px; border-radius: 4px; line-height: 30px; overflow: hidden; @@ -1304,4 +1354,9 @@ } } } +.el-button--primary { + border: 0; + font-weight: 700 !important; + font-size: 16px; +} </style> -- Gitblit v1.8.0