소스 검색

修改登录为下拉

mxx 3 년 전
부모
커밋
87f1c79759
3개의 변경된 파일20개의 추가작업 그리고 24개의 파일을 삭제
  1. 2 0
      src/api/common/index.js
  2. 5 1
      src/model/signIn/index.js
  3. 13 23
      src/views/login/index.vue

+ 2 - 0
src/api/common/index.js

@@ -99,3 +99,5 @@ export const API_POST_UPLOADFILES = `/appendix/api/uploadFiles`
 export const API_POST_DELETEFILES = `/appendix/api/deleteFiles`
 // 上传附件
 export const API_POST_OTHERUPLOADFILES = `/appendix/api/uploadFiles`
+//获取公司下拉列表
+export const API_GET_API_COMPLIST = `/commonUser/getComp`

+ 5 - 1
src/model/signIn/index.js

@@ -13,7 +13,8 @@ import {
   API_POST_VERICODE_API_SENDREGISTERCODE,
   API_POST_AUTH_API_GETTENANTINFOBYUSER,
   API_GET_COMPANY_COMPANYINFOBYDOMAINNAME,
-  API_GET_SYSTEM_FINDVESSELSYSVERSION
+  API_GET_SYSTEM_FINDVESSELSYSVERSION,
+  API_GET_API_COMPLIST
 } from '@/api/common'
 import { API_POST_REGISTER } from '@/api/V2/operation'
 // 登录页注册接口
@@ -34,3 +35,6 @@ export const getTenantInfoByUser = appRx.post(API_POST_AUTH_API_GETTENANTINFOBYU
 // 通过域名获取公司信息
 export const getCompanyInfo = appRx.get(API_GET_COMPANY_COMPANYINFOBYDOMAINNAME, errorCatcher, errorHandle, filter)
 export const findVesselSysVersion = appRx.get(API_GET_SYSTEM_FINDVESSELSYSVERSION, errorCatcher, errorHandle, filter)
+
+//获取公司下拉列表
+export const getcompList = appRx.get(API_GET_API_COMPLIST, errorCatcher, errorHandle, filter)

+ 13 - 23
src/views/login/index.vue

@@ -146,11 +146,11 @@
             <el-form v-show="tabsOne" ref="loginForm" :model="loginForm" :rules="getFormRules" auto-complete="on"
               label-position="left">
               <el-form-item prop="companyName">
-                <el-input v-model="loginForm.companyName" :placeholder="$t('login.verification08')" />
-                <!-- <el-select v-model="value" filterable placeholder="请选择">
-                  <el-option v-for="item in compOptionList" :key="item.value" :label="item.label" :value="item.value">
+                <!-- <el-input v-model="loginForm.companyName" :placeholder="$t('login.verification08')" /> -->
+                <el-select v-model="loginForm.companyName" filterable placeholder="请选择" class="comp-select">
+                  <el-option v-for="item in compOptionList" :key="item.compName" :label="item.compName" :value="item.compName">
                   </el-option>
-                </el-select> -->
+                </el-select>
               </el-form-item>
               <el-form-item prop="username">
                 <el-input ref="username" v-model="loginForm.username" :placeholder="$t('login.select01')"
@@ -364,23 +364,8 @@
         }
       }
       return {
-        compOptionList: [{
-          value: '选项1',
-          label: '黄金糕'
-        }, {
-          value: '选项2',
-          label: '双皮奶'
-        }, {
-          value: '选项3',
-          label: '蚵仔煎'
-        }, {
-          value: '选项4',
-          label: '龙须面'
-        }, {
-          value: '选项5',
-          label: '北京烤鸭'
-        }],
-        value: '',
+        compOptionList: [],
+        compValue: '黑龙江中天昊元贸易有限公司',
         dialogService: false, //客服
         dialogAgreement: false, //服务协议
         phone: '',
@@ -577,8 +562,9 @@
       compList() {
         getcompList()
           .toPromise()
-          .then((res) => {debugger
+          .then((res) => {
             console.log('公司下拉列表数据',res)
+            this.compOptionList = res
             
           })
           .catch((err) => {})
@@ -1139,7 +1125,7 @@
             border-top: none;
             border-right: none;
             border-radius: 0;
-            border: 1px solid #e5e8ed;
+            border: 1px solid #e5e8ed!important;
             color: #000;
             padding: 0;
             padding: 5px 10px;
@@ -1443,4 +1429,8 @@
       line-height: 12px !important;
     }
   }
+  .comp-select{
+    width: 100%;
+        
+  }
 </style>