Prechádzať zdrojové kódy

二维码登录修改

yejian016332 3 rokov pred
rodič
commit
a676fe408d

+ 11 - 1
imcs-ui/src/api/resourceProductMgr/productionResourcesMgr.js

@@ -17,6 +17,10 @@ const apiList = {
     method: 'POST',
     url: `/authority/productionresource/getList`
   },
+  getStations: {
+    method: 'POST',
+    url: `/authority/productionresource/getStations`
+  },
   save: {
     method: 'POST',
     url: `/authority/productionresource`
@@ -62,6 +66,12 @@ export default {
       data
     })
   },
+  getStations (data) {
+    return axiosApi({
+      ...apiList.getStations,
+      data
+    })
+  },
   save (data) {
     return axiosApi({
       ...apiList.save,
@@ -104,4 +114,4 @@ export default {
     	url: `/authority/productionresource/${id}`
     })
   }
-}
+}

+ 44 - 3
imcs-ui/src/views/login/index.vue

@@ -19,7 +19,21 @@
 		    <el-tab-pane label="扫码登录" name="first">
 		    	<div class="saomaDom">
 		    		<img :src="require(`@/assets/logo/saoma.png`)"/>
-		    		<div>请扫码登录<el-input id="qcodeUserInput" name="qcodeUserInput"  type="password" style="z-index: -100" v-model="loginForm.qcodeUser" onfocus="this.style.imeMode = 'disabled'"  @input="showQcodeUser()"/></div>
+            <el-select
+              v-model="opValue"
+              :span="2"
+              @change="selectChange"
+              :placeholder="$t('common.pleaseSelect')"
+            >
+              <el-option
+                v-for="item in options"
+                :key="item.value"
+                :label="item.name"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+		    		<div>请选择上下料站并扫码登录<el-input id="qcodeUserInput" name="qcodeUserInput"  type="password" style="z-index: -100" v-model="loginForm.qcodeUser" onfocus="this.style.imeMode = 'disabled'"  @input="showQcodeUser()"/></div>
 		    	</div>
 		    </el-tab-pane>
 		    <el-tab-pane label="密码登录" name="second">
@@ -213,12 +227,15 @@
   import loginApi from "@/api/Login.js";
   import oauthApi from '@/api/Oauth'
   import {Base64} from 'js-base64';
+  import productionResourcesMgrApi from "@/api/resourceProductMgr/productionResourcesMgr";
 
   export default {
     name: "Login",
     components: {LangSelect},
     data() {
       return {
+        options: [],
+        opValue:'',
       	activeName: 'first',
         //是否启用多租户
         isMultiTenant:
@@ -249,7 +266,8 @@
           bindPassword: "",
           signAccount: "",
           signPassword: "",
-          qcodeUser: ""
+          qcodeUser: "",
+          stationResourceId: "",
         },
         rules: {
           account: {
@@ -327,6 +345,7 @@
       };
     },
     created() {
+      this.getStations()
     },
     mounted() {
       db.clear();
@@ -606,7 +625,29 @@
         if(this.loginForm.qcodeUser.substr(this.loginForm.qcodeUser.length-1,1) == "#"){
             this.qcodelogin()
         }
-      }
+      },
+
+      getStations() {
+        productionResourcesMgrApi.getStations({}).then((res) => {
+          res = res.data;
+          if (res.isSuccess) {
+            if (res.data.length > 0) {
+              this.options = res.data;
+            }
+          }
+        });
+      },
+      selectChange(value) {
+        console.log(value);
+        this.loginForm.stationResourceId = value;
+        this.$nextTick(
+          window.onload = function () { // 光标默认位置
+            document.getElementById('qcodeUserInput').value = "";
+            var oInput = document.getElementById('qcodeUserInput');
+            oInput.focus();
+          }
+        )
+      },
     }
   };
 </script>

+ 8 - 8
imcs-ui/src/views/zuihou/machiningClient/touchScreen/Index.vue

@@ -112,7 +112,7 @@
                       max-height: 200%;
                     "
                     :src="resolveLogo('status' + (index + 1) + '.png')"
-                    fit="fill"                    
+                    fit="fill"
                   >
                   </el-image>
                   <span>{{ item.taskName }}</span>
@@ -165,7 +165,7 @@
           </span>
           <div class="tableTransparent">
             <el-table
-              :data="finishData"              
+              :data="finishData"
               border
 			        style="height:100%;min-height:80px;"
               :header-cell-style="{ background: '#1890ff', color: '#fff' }"
@@ -407,7 +407,7 @@ export default {
     viewClose() {
       this.view1Visible = false
       this.view2Visible = false
-      this.view3Visible = false      
+      this.view3Visible = false
     },
     setPercentage(time, left) {
       return this.formatGap(time, left)[0] > 100
@@ -429,9 +429,9 @@ export default {
       this.taskCount = this.taskCount - 1;
       let planTime = Math.ceil(Math.random() * 30);
       let activeTime = Math.ceil(Math.random() * 30);
-      let currentTime = new Date();	 
-      //let currentTime2 = new Date(currentTime.valueOf() + activeTime * 60);    
-	  currentTime.setMinutes(currentTime.getMinutes() + activeTime);  
+      let currentTime = new Date();
+      //let currentTime2 = new Date(currentTime.valueOf() + activeTime * 60);
+	  currentTime.setMinutes(currentTime.getMinutes() + activeTime);
       let finishParams = {
         planTime: planTime,
         activeTime: activeTime,
@@ -444,7 +444,7 @@ export default {
       console.log(this.finishData);
       this.taskData.shift();
     },
-    getFullTime(date) {      
+    getFullTime(date) {
       var yy = date.getFullYear(); //年
       var mm = date.getMonth() + 1; //月
       var dd = date.getDate(); //日
@@ -554,4 +554,4 @@ export default {
 .el-table__expanded-cell {
   background-color: transparent;
 }
-</style>
+</style>