From 994ba6406557eeb4199a40d080f4187232ad41ab Mon Sep 17 00:00:00 2001
From: Tomas <tomasysh@gmail.com>
Date: 星期三, 08 十二月 2021 10:19:16 +0800
Subject: [PATCH] Revert "refactor: pages component - separate vue files"

---
 PAMapp/pages/agentInfo/_agentNo.vue |  124 ++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 120 insertions(+), 4 deletions(-)

diff --git a/PAMapp/pages/agentInfo/_agentNo.vue b/PAMapp/pages/agentInfo/_agentNo.vue
index a3b562f..03478ed 100644
--- a/PAMapp/pages/agentInfo/_agentNo.vue
+++ b/PAMapp/pages/agentInfo/_agentNo.vue
@@ -130,8 +130,8 @@
         type="flex"
         class="pam-paragraph">
         <UiField icon="school" label="�犖��">
-          <span v-for="(experience, index) in agentInfo.expertiseList" :key="index">
-            {{ experience }}<span v-if="index !== agentInfo.expertiseList.length - 1">, </span>
+          <span v-for="(experience, index) in agentInfo.experiences" :key="index">
+            {{ experience }}<span v-if="index !== agentInfo.experiences.length - 1">, </span>
           </span>
         </UiField>
       </el-row>
@@ -182,8 +182,124 @@
     </div>
 </template>
 
-<script src="./agent-info.component.ts"></script>
+<script lang="ts">
+import { Context } from '@nuxt/types';
+import { namespace } from 'nuxt-property-decorator';
+import { Vue, Component } from 'vue-property-decorator';
+import { getConsultantDetail } from '~/assets/ts/api/consultant';
+import { Role } from '~/assets/ts//models/enum/Role';
+const roleStorage = namespace('localStorage');
+@Component
+export default class AgentInfoComponent extends Vue {
+  @roleStorage.Getter currentRole!:string|null;
+  role = Role;
+  agentInfo!: AgentInfo;
+  isAlertAddSuccess = false;
+  isAlertFieldInfo = false;
+  fieldInfoTitle = '';
+  fieldInfoDesc = '';
+
+  async asyncData(context: Context) {
+    const agentNo = context.route.params.agentNo;
+    let agentInfo = {};
+    await getConsultantDetail(agentNo).then((res) => agentInfo = res.data )
+    return {
+      agentInfo
+    }
+  }
+
+  get agentName(): string {
+    return `${this.agentInfo.name}(${this.agentInfo.role})`;
+  }
+
+  alertAddSuccess() {
+      this.isAlertAddSuccess = true;
+  }
+
+  alertFieldInfo(field: string): void {
+    this.isAlertFieldInfo = true;
+    switch(field) {
+      case 'suitability':
+        this.fieldInfoTitle = '���漲';
+        this.fieldInfoDesc = '���漲��������翰�祟�敺����雿�憿批����脰�������蝯行�����潘��隞乩������“������潦��';
+        break;
+      case 'evaluation':
+        this.fieldInfoTitle = '隢株岷摨西”�';
+        this.fieldInfoDesc = '隢株岷摨西”��撠��雿�憿批�������垣閰X���脰�������蝯行�����潦��';
+        break;
+    }
+  }
+}
+
+interface AgentInfo {
+  name            : string;
+  agentNo         : string;
+  role            : string;
+  image           : string;
+  avgScore        : number;
+  title           : string;
+  phoneNumber     : string;
+  serveArea       : string;
+  companyAddress  : string;
+  lastestLoginTime: Date | null;
+  seniority       : string;
+  suitability     : number;
+  evaluation      : number;
+  expertises      : string[];
+  concept         : string;
+  experiences     : string[];
+  awards          : string;
+}
+</script>
 
 <style lang="scss">
-  @import "./agent-info.component.scss";
+.pam-icon {
+  font-size: 15px;
+  padding-right: 8px;
+  color: $PRUDENTIAL_GREY;
+  &.icon--primary {
+    color: $PRIMARY_RED;
+  }
+}
+.pam-field {
+  display: flex;
+  flex-direction: column;
+  .pam-field__label {
+    display: flex;
+    align-items: center;
+    .pam-icon {
+      font-size: 12px;
+    }
+    .pam-field__title {
+      font-size: 16px;
+      font-weight: bold;
+      display: flex;
+      align-items: center;
+    }
+  }
+}
+
+.pam-field-suitability {
+  .el-progress-bar__inner {
+    background-color: $LIGHT_BLUE !important;
+  }
+}
+
+.pam-field-evaluation {
+  .el-progress-bar__inner {
+    background-color: $TEAL_GREEN!important;
+  }
+}
+
+.pam-field-experts {
+  display: flex;
+  flex-wrap: wrap;
+}
+
+.pam-progress__label {
+  justify-content: space-between;
+  flex-wrap: wrap;
+  line-height: 24px;
+}
+
 </style>

--
Gitblit v1.8.0