Explorar o código

二维码登录输入法输入问题修改

yejian016332 %!s(int64=3) %!d(string=hai) anos
pai
achega
f9be24aa48
Modificáronse 1 ficheiros con 15 adicións e 4 borrados
  1. 15 4
      imcs-ui/src/views/login/index.vue

+ 15 - 4
imcs-ui/src/views/login/index.vue

@@ -19,7 +19,7 @@
 		    <el-tab-pane label="扫码登录" name="first">
 		    	<div class="saomaDom">
 		    		<img :src="require(`@/assets/logo/saoma.png`)"/>
-		    		<div>请扫码登录<el-input id="qcodeUser" name="qcodeUser" v-model="loginForm.qcodeUser" type="hidden" onfocus=""  @input="showQcodeUser()"/></div>
+		    		<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">
@@ -333,8 +333,8 @@
       this.getCodeImage();
       this.$nextTick(
         window.onload = function () { // 光标默认位置
-            var oInput = document.getElementById('qcodeUser');
-            oInput.focus();
+          var oInput = document.getElementById('qcodeUserInput');
+          oInput.focus();
         }
       )
     },
@@ -344,6 +344,16 @@
     methods: {
     	// Tabs切换-事件
     	handleClick(tab, event) {
+    	    // tab切换初始化focus及内容
+    	    if(tab.name === 'first'){
+              this.$nextTick(
+                  window.onload = function () { // 光标默认位置
+                      document.getElementById('qcodeUserInput').value = "";
+                      var oInput = document.getElementById('qcodeUserInput');
+                      oInput.focus();
+                  }
+              )
+          }
         console.log(tab, event);
       },
 
@@ -572,11 +582,12 @@
         console.log(user);
       },
 
-      qcodelogin() {
+      qcodelogin(qcodeUserValue) {
         this.loading = true;
         const that = this;
         this.loginForm.tenant = `${Base64.encode(this.loginForm.tenantView)}`;
         this.$store.commit("account/setTenant", this.loginForm.tenant);
+        this.loginForm.qcodeUserValue = qcodeUserValue
         this.loginForm.grantType="password";
         loginApi.qcodelogin(this.loginForm).then(response => {
           const res = response.data;