From 5aa99c119f387d6f32a58dfc7190351f6f92ecf6 Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期一, 18 九月 2023 21:07:46 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes

---
 CanadaMes-ui/src/views/home/index.vue |  213 ++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 152 insertions(+), 61 deletions(-)

diff --git a/CanadaMes-ui/src/views/home/index.vue b/CanadaMes-ui/src/views/home/index.vue
index c2448cd..d1c95f8 100644
--- a/CanadaMes-ui/src/views/home/index.vue
+++ b/CanadaMes-ui/src/views/home/index.vue
@@ -60,67 +60,81 @@
 
 .gezi {
     height: 35px;
-    width: 4.22px;
+
+    position: absolute;
+    width: 3.08px;
+    /* width: 4.22px; */
 }
 
-.gezi:nth-child(22),
+/* .gezi:nth-child(22),
 .gezi:nth-child(43),
 .gezi:nth-child(64),
 .gezi:nth-child(85) {
+    margin-left: 7px;
     margin-left: 10px;
-}
+} */
 
 
 
 .blocks {
-    min-height: 55vh;
-    max-width: 100vw;
+
+
     background-image: url('../../img/xmjc.png');
     margin: 0 auto;
     background-repeat: no-repeat;
-    /* background-size: 100% 100%; */
-    background-size: 1660px 560px;
     background-attachment: local;
     width: 1660px;
+    min-height: 55vh;
+    max-width: 94vw;
+    background-size: 1200px 510px;
+    /* max-width: 100vw;
+    background-size: 1660px 560px; */
+
+
 }
 
 .blocks-img {
     height: 100px;
     max-width: 100vw;
     background-repeat: no-repeat;
-    background-size: 46px 94px;
     background-attachment: local;
     width: 32px;
     position: absolute;
-    /* left: 116px; */
-    /* left:1060px;18.88px */
     background-image: url('../../img/bigcar01.png');
+    background-size: 40px 87px;
+    /* background-size: 46px 94px; */
 }
 
 .blocks-img2 {
     height: 100px;
     max-width: 100vw;
     background-repeat: no-repeat;
-    background-size: 85px 100px;
     background-attachment: local;
     width: 100px;
     position: absolute;
-    /* left: 116px; */
-    /* left:1060px;18.88px */
     background-image: url('../../img/dipan.png');
+    background-size: 70px 85px;
+    left: 654px;
+    top: 333px;
+    /* background-size: 85px 100px;
+    left: 912px;
+    top: 366px; */
 }
 
 .blocks-img3 {
     height: 90px;
     max-width: 100vw;
     background-repeat: no-repeat;
-    background-size: 160px 40px;
     background-attachment: local;
     width: 160px;
     position: absolute;
-    /* left: 116px; */
-    /* left:1060px;18.88px */
     background-image: url('../../img/taimian.png');
+    background-size: 120px 30px;
+    left: 630px;
+    top: 420px;
+    /* background-size: 160px 40px;
+    left: 875px;
+    top: 455px;  */
 }
 
 .el-table td,
@@ -162,6 +176,10 @@
         transform: translateX(-150%);
     }
 }
+
+.el-dialog {
+    width: 80%;
+}
 </style>
 <template>
     <el-container>
@@ -169,7 +187,8 @@
         <el-main>
             <div class="box" @click="dialogFormVisible2 = true">
                 <div class="text">
-                    Alarm:
+                    <!-- Alarm: -->
+                    {{ this.text }}
                     <label v-for="item in this.alarm" :key="item['id']">
                         {{ item['content'] }}
                     </label>
@@ -226,26 +245,58 @@
         </el-main>
         <el-footer>
             <div class="blocks" style="position: relative;">
-                <div style="display:flex;position: absolute;float:left;z-index: 999;top:112px;left:328px;">
-                    <div :class="getStatusClass(item.state)" v-for="item in cagelist1" :key="item['date']"
+                <div style="display:flex;position: absolute;float:left;z-index: 999;top:102px;left:237px;">
+                    <div :class="getStatusClass(item.state)" v-for="(item, index) in cagelist1" :key="item['date']"
+                        :style="{ height: 35 * item['glassWidth'] + 'px', left: 3.07 * index + Math.abs(item['cage'] - 10) * 6.8 + 'px' }"
+                        @click="showcageinfo(item['cage'])"></div>
+                </div>
+                <div style="display:flex;position: absolute;float:left;z-index: 999;top:102px;left:640px;">
+                    <div :class="getStatusClass(item.state)" v-for="(item, index) in cagelist2" :key="item['date']"
+                        :style="{ height: 35 * item['glassWidth'] + 'px', left: 3.07 * index + Math.abs(item['cage'] - 5) * 6.8 + 'px' }"
+                        @click="showcageinfo(item['cage'])"></div>
+                </div>
+                <div style="display:flex;position: absolute;float:left;z-index: 999;top:139px;left:237px;">
+                    <div :class="getStatusClass(item.state)" v-for="(item, index) in cagelist3" :key="item['date']"
+                        :style="{ height: 35 * item['glassWidth'] + 'px', top: item['width'] * 35 - 35 + 'px', left: 3.07 * index + Math.abs(item['cage'] - 10) * 6.8 + 'px' }"
+                        @click="showcageinfo(item['cage'])">
+                    </div>
+                </div>
+                <div style="display:flex;position: absolute;float:left;z-index: 999;top:139px;left:640px;">
+                    <div :class="getStatusClass(item.state)" v-for="(item, index) in cagelist4" :key="item['date']"
+                        :style="{ height: 35 * item['glassWidth'] + 'px', top: item['width'] * 35 - 35 + 'px', left: 3.07 * index + Math.abs(item['cage'] - 5) * 6.8 + 'px' }"
+                        @click="showcageinfo(item['cage'])"></div>
+                </div>
+                <div class="blue gezi"
+                    :style="{ display: flex, position: absolute, float: left, top: 105 + 'px', left: 1050 + 'px', height: loadglassheight + 'px', width: 5 + 'px' }">
+                </div>
+                <div class="blocks-img" :style="{ left: car1 + 'px', top: '16px' }"></div>
+                <div class="blocks-img" :style="{ left: car2 + 'px', top: '175px' }"></div>
+                <div class="blocks-img2"></div>
+                <div class="blocks-img3"></div>
+                <!-- <div style="display:flex;position: absolute;float:left;z-index: 999;top:112px;left:328px;">
+                    <div :class="getStatusClass(item.state)" v-for="(item,index) in cagelist1" :key="item['date']"
+                        :style="{ height: 35 * item['glassWidth'] + 'px',left:4.22*index+'px' }"
                         @click="showcageinfo(item['cage'])"></div>
                 </div>
                 <div style="display:flex;position: absolute;float:left;z-index: 999;top:112px;left:885px;">
-                    <div :class="getStatusClass(item.state)" v-for="item in cagelist2" :key="item['date']"
+                    <div :class="getStatusClass(item.state)" v-for="(item,index) in cagelist2" :key="item['date']"
+                        :style="{ height: 35 * item['glassWidth'] + 'px',left:4.22*index+'px' }"
                         @click="showcageinfo(item['cage'])"></div>
                 </div>
                 <div style="display:flex;position: absolute;float:left;z-index: 999;top:154px;left:328px;">
-                    <div :class="getStatusClass(item.state)" v-for="item in cagelist3" :key="item['date']"
+                    <div :class="getStatusClass(item.state)" v-for="(item,index) in cagelist3" :key="item['date']"
+                        :style="{ height: 35 * item['glassWidth'] + 'px', top: item['width'] * 35 - 35 + 'px',left:4.22*index+'px' }"
                         @click="showcageinfo(item['cage'])"></div>
                 </div>
                 <div style="display:flex;position: absolute;float:left;z-index: 999;top:154px;left:885px;">
-                    <div :class="getStatusClass(item.state)" v-for="item in cagelist4" :key="item['date']"
+                    <div :class="getStatusClass(item.state)" v-for="(item,index) in cagelist4" :key="item['date']"
+                        :style="{ height: 35 * item['glassWidth'] + 'px', top: item['width'] * 35 - 35 + 'px',left:4.22*index+'px' }"
                         @click="showcageinfo(item['cage'])"></div>
                 </div>
                 <div class="blocks-img" :style="{ left: car1 + 'px', top: '16px' }"></div>
                 <div class="blocks-img" :style="{ left: car2 + 'px', top: '194px' }"></div>
                 <div class="blocks-img2" :style="{ left: '912px', top: '366px' }"></div>
-                <div class="blocks-img3" :style="{ left: '875px', top: '455px' }"></div>
+                <div class="blocks-img3" :style="{ left: '875px', top: '455px' }"></div> -->
             </div>
         </el-footer>
         <el-dialog :visible.sync="dialogFormVisible" :title="$t('Please confirm the glass information')">
@@ -296,14 +347,14 @@
         </el-dialog>
         <el-dialog :visible.sync="dialogFormVisible3" :title="$t('Cage Details')">
             <el-table :data="this.cageinfo" :height="700" border style="width: 100%;overflow: auto;">
-                <el-table-column :width="150" prop="cage" :label="$t('The Cage number')"></el-table-column>
+                <el-table-column prop="cage" :label="$t('The Cage number')"></el-table-column>
                 <el-table-column prop="cell" :label="$t('cell')"></el-table-column>
                 <el-table-column prop="tier" :label="$t('tier')"></el-table-column>
                 <el-table-column prop="glassId" :label="$t('glassid')"></el-table-column>
-                <el-table-column :width="130" prop="orderId" :label="$t('order number')"></el-table-column>
-                <el-table-column :width="150" prop="lengthWidth" :label="$t('Length and width')"></el-table-column>
+                <el-table-column prop="orderId" :label="$t('order number')"></el-table-column>
+                <el-table-column prop="lengthWidth" :label="$t('Length and width')"></el-table-column>
                 <el-table-column prop="coating" :label="$t('coating')"></el-table-column>
-                <el-table-column :width="140" :label="$t('Operate')">
+                <el-table-column :label="$t('Operate')">
                     <template slot-scope='scope'>
                         <el-button type="primary" style="padding: 4px 10px;font-size: 12px;"
                             @click="deleteglass(scope.row.glassId, scope.row.state)">{{ $t('delete') }}</el-button>
@@ -319,7 +370,7 @@
 </template>
 <script>
 
-import { home, home2, loadtask, InsertOrder, Addglassid, UpdateTask, SelectAlarmmgInfo, SelectCageInfo, DeleteByGlassID, OutByGlassID } from "../../api/home";
+import { home, home2, loadtask, InsertOrder, Addglassid, UpdateTask, SelectAlarmmgInfo, SelectCageInfo, DeleteByGlassID, OutByGlassID, Loadcarlist, SelectPassword } from "../../api/home";
 
 
 import LanguageMixin from '../../lang/LanguageMixin'
@@ -328,6 +379,7 @@
     name: "Home",
     data() {
         return {
+            name: 'Confirm',
             mixins: [LanguageMixin],
             dialogFormVisible: false,
             dialogFormVisible1: false,
@@ -356,10 +408,16 @@
             order: "",
             glassid: "",
             url: "../../img/bigcar01.png",
-            car1: 150,
-            car2: 242,
+            car1: 145,
+            car2: 210,
+            // car1: 210,
+            // car2: 300,
             cageinfo: [],
-            cage: 0
+            cage: 0,
+            carlist: [],
+            loadglassheight: 0,
+            password: 1,
+            text: ""
         };
     },
     created() {
@@ -391,8 +449,11 @@
                     //console.log("鏀跺埌鏁版嵁====" + msg.data);
                     let obj = JSON.parse(msg.data);
                     if (obj.params != null) {
-                        this.car1 = 150 + 24.6 * obj.params[0][0];
-                        this.car2 = 242 + 24.6 * obj.params[0][1];
+                        this.car1 = 145 + 8.1 * Math.abs(obj.params[0][0] - this.carlist[0]['start']) / Math.abs(this.carlist[0]['end'] - this.carlist[0]['start']) * 100;
+                        this.car2 = 210 + 8.25 * Math.abs(obj.params[0][1] - this.carlist[1]['start']) / Math.abs(this.carlist[1]['end'] - this.carlist[1]['start']) * 100;
+                        // this.car1 = 210 + 11.25 * (obj.params[0][1]-this.carlist[1]['start'])/(this.carlist[1]['end']-this.carlist[1]['start'])*100;
+                        // this.car2 = 300 + 11.25 * (obj.params[0][1]-this.carlist[1]['start'])/(this.carlist[1]['end']-this.carlist[1]['start'])*100;
+                        console.log(obj.params[0][1], this.carlist[1]['start']);
                     }
                     this.tableData = obj.tableData[0];
                     this.cagelist1 = obj.cagelist1[0];
@@ -402,7 +463,11 @@
                     this.tasklist1 = obj.tasklist1[0];
                     this.tasklist2 = obj.tasklist2[0];
                     this.alarm = obj.alarmmg[0];
+                    this.loadglassheight = obj.loadglassheight;
 
+                    if (obj.dbconnected == "false") {
+                        this.text = this.$t('DataBase Connection failed');
+                    }
                     SelectCageInfo(this.cage).then(res => {
                         this.cageinfo = res.data.cageinfo;
                     });
@@ -441,14 +506,19 @@
                 if (res.data.list.length > 0) {
                     this.outcell = this.tasklist2[0]['cell'];
                 }
-
             });
             loadtask(this.task2).then(res => {
                 this.tasklist2 = res.data.list;
-
             });
             SelectAlarmmgInfo().then(res => {
                 this.alarm = res.data.alarmmg;
+            });
+            Loadcarlist().then(res => {
+                this.carlist = res.data.carlist;
+                console.log(this.carlist);
+            });
+            SelectPassword().then(res => {
+                this.password = res.data.password;
             });
         },
         //鏍规嵁鏍煎瓙鐘舵�佷慨鏀归鑹�
@@ -533,23 +603,28 @@
             this.form1 = {};
         },
         endtask(type, glassid, cell) {
-            this.$confirm(this.$t('Are you sure to perform this operation ?'), this.$t('prompt'), {
+            this.$prompt(this.$t('Are you sure to perform this operation ?'), this.$t('prompt'), {
+                inputType: 'password',
+                inputPlaceholder: this.$t('Please enter the password'),
                 confirmButtonText: this.$t('Yes'),
                 cancelButtonText: this.$t('No'),
                 type: 'warning'
-            }).then(() => {
-                UpdateTask(type, glassid, cell).then(res => {
-                    if (res.data.message3 == 200) {
-                        this.$message.success(this.$t('Operation successful'));
-                    }
-                });
+            }).then(({ value }) => {
+                if (this.password == value) {
+                    UpdateTask(type, glassid, cell).then(res => {
+                        if (res.data.message3 == 200) {
+                            this.$message.success(this.$t('Operation successful'));
+                        }
+                    });
+                } else {
+                    this.$message.success(this.$t('Password error'));//瀵嗙爜閿欒
+                }
             }).catch(() => {
                 this.$message({
                     type: 'info',
                     message: this.$t('Operation canceled')
                 });
             });
-
         },
         showcageinfo(cage) {
             this.cage = cage;
@@ -559,20 +634,27 @@
             });
         },
         deleteglass(glassid, state) {
-            this.$confirm(this.$t('Are you sure to perform this operation ?'), this.$t('prompt'), {
+            this.$prompt(this.$t('Are you sure to perform this operation ?'), this.$t('prompt'), {
+                inputType: 'password',
+                inputPlaceholder: this.$t('Please enter the password'),
                 confirmButtonText: this.$t('Yes'),
                 cancelButtonText: this.$t('No'),
                 type: 'warning'
-            }).then(() => {
-                if (state == 1) {
-                    DeleteByGlassID(glassid).then(res => {
-                        if (res.data.message3 == 200) {
-                            this.$message.success(this.$t('Operation successful'));
-                        }
-                    });
+            }).then(({ value }) => {
+                if (this.password == value) {
+                    if (state == 1) {
+                        DeleteByGlassID(glassid).then(res => {
+                            if (res.data.message3 == 200) {
+                                this.$message.success(this.$t('Operation successful'));
+                            }
+                        });
+                    } else {
+                        this.$message.success(this.$t('No delete allowed'));
+                    }
                 } else {
-                    this.$message.success(this.$t('No delete allowed'));
+                    this.$message.success(this.$t('Password error'));//瀵嗙爜閿欒
                 }
+
             }).catch(() => {
                 this.$message({
                     type: 'info',
@@ -581,19 +663,28 @@
             });
         },
         outglass(glassid, state) {
-            this.$confirm(this.$t('Are you sure to perform this operation ?'), this.$t('prompt'), {
+            this.$prompt(this.$t('Are you sure to perform this operation ?'), this.$t('prompt'), {
+                inputType: 'password',
+                inputPlaceholder: this.$t('Please enter the password'),
                 confirmButtonText: this.$t('Yes'),
                 cancelButtonText: this.$t('No'),
                 type: 'warning'
-            }).then(() => {
-                if (state == 1) {
-                    OutByGlassID(glassid).then(res => {
-                        if (res.data.message3 == 200) {
-                            this.$message.success(this.$t('Operation successful'));
-                        }
-                    });
+            }).then(({ value }) => {
+                if (this.password == value) {
+                    if (state == 1) {
+                        OutByGlassID(glassid).then(res => {
+                            if (res.data.message3 == 200) {
+                                this.$message.success(this.$t('Operation successful'));
+                            }
+                            else if (res.data.message2 == 300) {
+                                this.$message.success(this.$t('There is no such grid'));
+                            }
+                        });
+                    } else {
+                        this.$message.success(this.$t('No out allowed'));
+                    }
                 } else {
-                    this.$message.success(this.$t('No out allowed'));
+                    this.$message.success(this.$t('Password error'));//瀵嗙爜閿欒
                 }
             }).catch(() => {
                 this.$message({

--
Gitblit v1.8.0