From ac235850a9287dae6977c964213176fa7c86b140 Mon Sep 17 00:00:00 2001
From: Tomas <tomasysh@gmail.com>
Date: 星期四, 09 十二月 2021 14:42:20 +0800
Subject: [PATCH] Merge branch 'refactor/separate-vue' of ssh://192.168.0.10:29418/pcalife/PAM into refactor/separate-vue

---
 PAMapp/pages/consultantLogin/index.vue |  195 +-----------------------------------------------
 1 files changed, 4 insertions(+), 191 deletions(-)

diff --git a/PAMapp/pages/consultantLogin/index.vue b/PAMapp/pages/consultantLogin/index.vue
index 0c14a5f..e59a9ca 100644
--- a/PAMapp/pages/consultantLogin/index.vue
+++ b/PAMapp/pages/consultantLogin/index.vue
@@ -31,8 +31,8 @@
       </div>
       <div class="pam-paragraph">
         <div class="pam-consultant-login__title">
-          <div>撽�Ⅳ</div>
-          <div class="text--dark-blue fs-16 cursor--pointer fix-chrome-click--issue"
+          <div>撽�Ⅳ <span class="text--dark-blue fs-16">(����之撠神)</span></div>
+          <div class="text--primary fs-16 cursor--pointer fix-chrome-click--issue"
             @click="regenerateImgOfVerification">������</div>
         </div>
         <div class="pam-consultant-login__verifyBlock mt-10">
@@ -55,195 +55,8 @@
   </div>
 </template>
 
-<script lang="ts">
-  import { Vue, Component , namespace } from 'nuxt-property-decorator';
-  import { getImgOfVerification, logInToConsultant, getVerificationStatus } from '~/assets/ts/api/consultant';
-  import { Role } from '~/assets/ts/models/enum/Role';
-  import { MessageBox } from 'element-ui';
-
-  const roleStorage = namespace('localStorage');
-  @Component({
-    layout: 'home'
-  })
-  export default class ConsultantLogin extends Vue {
-    @roleStorage.Mutation storageIdToken!: (token: string) => void;
-    @roleStorage.Mutation storageRole!: (role: string) => void;
-
-    isRememberUserName = false;
-    isShowPassword = false;
-    imgSrc = '';
-    verificationCode='';
-    consultantDto = {
-      username: '',
-      password: '',
-    }
-
-    get isAlreadyDone():boolean{
-      return !!(this.verificationCode && this.consultantDto.username && this.consultantDto.password);
-    }
-
-    mounted() {
-      this.getInitUserName();
-      this.regenerateImgOfVerification();
-    };
-
-    private getInitUserName(): void {
-      const username = localStorage.getItem('consultantUserName')
-      if (username) {
-        this.consultantDto.username = username;
-        this.isRememberUserName = true;
-      }
-    }
-
-    public regenerateImgOfVerification(): void {
-      getImgOfVerification().then( imgOfBase64 =>
-        this.imgSrc = imgOfBase64
-      );
-    };
-
-    public isRememberChange():void{
-      this.isRememberUserName = !this.isRememberUserName;
-      this.storeUserName();
-    }
-
-    public sendInfo():void{
-      this.isAlreadyDone ? this.verify() : this.showErrorMessageBox('隢Ⅱ隤董����Ⅳ隞亙���Ⅳ��憛怠神摰');
-    }
-
-    private verify():void{
-      getVerificationStatus(this.verificationCode).then( verifySuccess => {
-        verifySuccess.data ? this.loginWithConsultant() : this.showErrorMessageBox('撽�Ⅳ頛詨�隤�');
-      });
-    }
-
-    private loginWithConsultant(): void {
-      logInToConsultant(this.consultantDto).then(res => {
-        this.storageIdToken(res.data.id_token);
-        this.storageRole(Role.ADMIN);
-        this.storeUserName();
-        this.$router.push('/myAppointmentList/appointmentList');
-      }, (error) => {
-          this.clearValue();
-      });
-    }
-
-    private showErrorMessageBox(errorMsg:string):void{
-      this.clearValue();
-      MessageBox({
-        message: errorMsg,
-        showClose:false,
-        showConfirmButton:true,
-        confirmButtonText:'蝣箄��',
-        customClass:'pam-message-box',
-        closeOnClickModal:false,
-      });
-    }
-
-    private storeUserName(): void {
-      localStorage.setItem('consultantUserName', this.isRememberUserName ? this.consultantDto.username : '');
-    };
-
-    private clearValue():void{
-      this.consultantDto.password = '';
-      this.verificationCode = '';
-    }
-  };
-
-</script>
+<script src="./consultant-login.component.ts"></script>
 
 <style lang="scss" scoped>
-  .mt-20 {
-    margin-top: 20px;
-  }
-
-  .mt-25 {
-    margin-top: 25px;
-  }
-
-  .w-55 {
-    width: 55% !important;
-  }
-
-  .position-r {
-    position: relative;
-  }
-
-  .pam-consultant-login {
-    margin: auto;
-    width: 336px;
-    font-size: 20px;
-    color: $PRIMARY_BLACK;
-
-    &__header {
-      text-align: center;
-      font-size: 24px;
-      font-weight: bold;
-      letter-spacing: 1.2;
-      color: $PRIMARY_BLACK;
-    }
-
-    &__title {
-      display: flex;
-      justify-content: space-between;
-      align-items: center;
-    }
-
-    &__input {
-      width: 100%;
-      outline: 0;
-      border: 1px solid #CCCCCC;
-      border-radius: 10px;
-      font-size: 20px;
-      height: 50px;
-      padding: 10px 90px 10px 15px;
-      overflow: auto;
-      box-sizing: border-box;
-      -webkit-box-sizing: border-box;
-      -moz-box-sizing: border-box;
-
-      &Icon {
-        position: absolute;
-        display: flex;
-        align-items: center;
-        top: 15px;
-        right: 15px;
-      }
-    }
-
-    &__forgot-password {
-      color: $PRIMARY_RED;
-      text-decoration: none;
-      font-size: 16px;
-    }
-
-    &__verifyBlock {
-      display: flex;
-      justify-content: space-between;
-    }
-
-    &__verifyImg {
-      width: 126px;
-      height: 50px;
-      border:1px #cccccc solid;
-      img {
-        width: 100%;
-        height: 100%;
-      }
-    }
-
-    &__confirmBlock {
-      display: flex;
-      justify-content: center;
-    }
-
-    &__confirm {
-      color: $PRIMARY_WHITE;
-      width: 80px;
-      height: 50px;
-      border-radius: 30px;
-      border: 1px solid $LIGHT_GREY;
-      background-color: $PRIMARY_RED;
-    }
-  }
-
+  @import "./consultant-login.component.scss";
 </style>

--
Gitblit v1.8.0