From 1076fdc06d40646d1d6f125a3ce4d43cf4eac673 Mon Sep 17 00:00:00 2001
From: HelenHuang <LinHuang@pollex.com.tw>
Date: 星期一, 06 十二月 2021 15:52:01 +0800
Subject: [PATCH] rename: change Consultants model to Consultant

---
 PAMapp/pages/quickFilter/index.vue                          |    4 +-
 PAMapp/store/index.ts                                       |   12 +++---
 PAMapp/assets/ts/storageConsultant.ts                       |    6 +-
 PAMapp/pages/myConsultantList.vue                           |   10 ++--
 PAMapp/components/AddAndReservedBtns.vue                    |   10 ++--
 PAMapp/pages/myConsultantList/contactedList.vue             |    8 ++--
 PAMapp/components/Consultant/ConsultantCard.vue             |    4 +-
 PAMapp/components/QuickFilter/QuickFilterConsultantList.vue |    4 +-
 PAMapp/components/Consultant/ConsultantSwiper.vue           |    4 +-
 PAMapp/pages/index.vue                                      |   10 ++--
 PAMapp/pages/myConsultantList/consultantList.vue            |    8 ++--
 PAMapp/assets/ts/models/appointment.model.ts                |    5 +-
 PAMapp/assets/ts/api/consultant.ts                          |    6 +-
 PAMapp/components/Ui/UiPagination.vue                       |   10 ++--
 PAMapp/components/Ui/UiDateFormat.vue                       |    2 
 PAMapp/components/Consultant/ConsultantList.vue             |    4 +-
 PAMapp/assets/ts/models/consultant.model.ts                 |    2 
 17 files changed, 54 insertions(+), 55 deletions(-)

diff --git a/PAMapp/assets/ts/api/consultant.ts b/PAMapp/assets/ts/api/consultant.ts
index c45db96..08935d3 100644
--- a/PAMapp/assets/ts/api/consultant.ts
+++ b/PAMapp/assets/ts/api/consultant.ts
@@ -4,7 +4,7 @@
 import { ConsultantLoginInfo } from '../models/ConsultantLoginInfo';
 import _ from 'lodash';
 import { UserSetting } from '../models/account.model';
-import { Consultants } from '~/assets/ts/models/consultant.model';
+import { Consultant } from '~/assets/ts/models/consultant.model';
 
 // 憿批恥��(TODO: OTP隤����� ���蝙�)
 export function login(user: any) {
@@ -28,7 +28,7 @@
 
 // ��靽憿批��
 export function recommend() {
-    return service.get<Consultants[]>('/consultant/recommend')
+    return service.get<Consultant[]>('/consultant/recommend')
             .then(res => res.data);
 }
 
@@ -37,7 +37,7 @@
     const headers = {
         Authorization: 'Bearer ' + localStorage.getItem('id_token')
     }
-    return service.get<Consultants[]>('/consultant/favorite', {headers})
+    return service.get<Consultant[]>('/consultant/favorite', {headers})
             .then(res => res.data);
 }
 
diff --git a/PAMapp/assets/ts/models/appointment.model.ts b/PAMapp/assets/ts/models/appointment.model.ts
index 3851f85..2d5733d 100644
--- a/PAMapp/assets/ts/models/appointment.model.ts
+++ b/PAMapp/assets/ts/models/appointment.model.ts
@@ -6,7 +6,6 @@
     agentNo         : string,
     status          : 'UNFILLED' | 'FILLED',
     score           : number,
-    // ��閬� agentName
-    agentName: string,
-    clientName: string,
+    agentName       : string,
+    customerName    : string,
 }
\ No newline at end of file
diff --git a/PAMapp/assets/ts/models/consultant.model.ts b/PAMapp/assets/ts/models/consultant.model.ts
index c9326b7..1a4c75f 100644
--- a/PAMapp/assets/ts/models/consultant.model.ts
+++ b/PAMapp/assets/ts/models/consultant.model.ts
@@ -1,4 +1,4 @@
-export interface Consultants {
+export interface Consultant {
     agentNo            : string;
     name               : string;
     img                : string;
diff --git a/PAMapp/assets/ts/storageConsultant.ts b/PAMapp/assets/ts/storageConsultant.ts
index 9776a17..ecff738 100644
--- a/PAMapp/assets/ts/storageConsultant.ts
+++ b/PAMapp/assets/ts/storageConsultant.ts
@@ -1,11 +1,11 @@
-import { Consultants } from "./models/consultant.model";
+import { Consultant } from "./models/consultant.model";
 
 
-export function getFavoriteFromStorage(): Consultants[] {
+export function getFavoriteFromStorage(): Consultant[] {
     const consultantList = localStorage.getItem('favoriteConsultant');
     return consultantList ? JSON.parse(consultantList) : [];
 }
 
-export function setFavoriteToStorage(consultants: Consultants[]) {
+export function setFavoriteToStorage(consultants: Consultant[]) {
     localStorage.setItem('favoriteConsultant', JSON.stringify(consultants));
 }
\ No newline at end of file
diff --git a/PAMapp/components/AddAndReservedBtns.vue b/PAMapp/components/AddAndReservedBtns.vue
index 8a7b4e1..d88a444 100644
--- a/PAMapp/components/AddAndReservedBtns.vue
+++ b/PAMapp/components/AddAndReservedBtns.vue
@@ -12,17 +12,17 @@
 
 <script lang="ts">
 import { Vue, Component, Prop, Emit, Action, State, namespace } from 'nuxt-property-decorator';
-import { Consultants } from '~/assets/ts/models/consultant.model';
+import { Consultant } from '~/assets/ts/models/consultant.model';
 
 const localStorage = namespace('localStorage');
 @Component
 export default class AddAndReservedBtns extends Vue {
-    @Action addToMyConsultantList!: (consultantToAdd: Consultants) => Promise<boolean>
-    @State('myConsultantList') myConsultantList!: Consultants[];
-    @Prop() agentInfo!: Consultants;
+    @Action addToMyConsultantList!: (consultantToAdd: Consultant) => Promise<boolean>
+    @State('myConsultantList') myConsultantList!: Consultant[];
+    @Prop() agentInfo!: Consultant;
     @Prop() cusClass!: string;
     isVisiblePopUp = false;
-    addConsultant(item: Consultants) {
+    addConsultant(item: Consultant) {
         this.addToMyConsultantList(item).then(addOk => {
             addOk && this.openPopUp();
         });
diff --git a/PAMapp/components/Consultant/ConsultantCard.vue b/PAMapp/components/Consultant/ConsultantCard.vue
index bd059f7..c3dad48 100644
--- a/PAMapp/components/Consultant/ConsultantCard.vue
+++ b/PAMapp/components/Consultant/ConsultantCard.vue
@@ -105,7 +105,7 @@
 <script lang="ts">
 import { Vue, Component, Prop, Emit, Action, State } from 'nuxt-property-decorator';
 import { getAppointmentDetail, UserReviewsConsultantsParams, userReviewsConsultants  } from '~/assets/ts/api/consultant';
-import { Consultants, Appointment } from '~/assets/ts/models/consultant.model';
+import { Consultant, Appointment } from '~/assets/ts/models/consultant.model';
 import { isLogin } from '~/assets/ts/auth';
 import { isMobileDevice } from '~/assets/ts/device';
 
@@ -132,7 +132,7 @@
 export default class ConsultantCard extends Vue {
     @Action removeFromMyConsultantList!: (agentNo: string) => Promise<boolean>;
     @Action storeConsultantList!: any;
-    @Prop() agentInfo!: Consultants;
+    @Prop() agentInfo!: Consultant;
     isVisibleDialog = false;
     reviewsBtn = false;
     status = false;
diff --git a/PAMapp/components/Consultant/ConsultantList.vue b/PAMapp/components/Consultant/ConsultantList.vue
index a453231..90bd709 100644
--- a/PAMapp/components/Consultant/ConsultantList.vue
+++ b/PAMapp/components/Consultant/ConsultantList.vue
@@ -24,12 +24,12 @@
 
 <script lang="ts">
 import { Vue, Component, Prop } from 'nuxt-property-decorator';
-import { Consultants } from '~/assets/ts/models/consultant.model';
+import { Consultant } from '~/assets/ts/models/consultant.model';
 import { isLogin } from '~/assets/ts/auth';
 
 @Component
 export default class ConsultantList extends Vue {
-    @Prop() agents!: Consultants[];
+    @Prop() agents!: Consultant[];
 
     get isLogin() {
         return isLogin();
diff --git a/PAMapp/components/Consultant/ConsultantSwiper.vue b/PAMapp/components/Consultant/ConsultantSwiper.vue
index 7f01888..bacf1ca 100644
--- a/PAMapp/components/Consultant/ConsultantSwiper.vue
+++ b/PAMapp/components/Consultant/ConsultantSwiper.vue
@@ -28,12 +28,12 @@
 <script lang="ts">
 import { Vue, Component, Prop } from 'vue-property-decorator';
 import { SwiperOptions } from 'swiper';
-import { Consultants } from '~/assets/ts/models/consultant.model';
+import { Consultant } from '~/assets/ts/models/consultant.model';
 
 
 @Component
 export default class UiSwiper extends Vue {
-    @Prop() agents!: Consultants[];
+    @Prop() agents!: Consultant[];
 
     swiperOptions: SwiperOptions = {
       loop: false,
diff --git a/PAMapp/components/QuickFilter/QuickFilterConsultantList.vue b/PAMapp/components/QuickFilter/QuickFilterConsultantList.vue
index 02671ad..d8a1707 100644
--- a/PAMapp/components/QuickFilter/QuickFilterConsultantList.vue
+++ b/PAMapp/components/QuickFilter/QuickFilterConsultantList.vue
@@ -79,12 +79,12 @@
 <script lang="ts">
 import { ElCarousel } from 'element-ui/types/carousel';
 import { Vue, Component, Prop } from 'vue-property-decorator';
-import { Consultants } from '~/assets/ts/models/consultant.model';
+import { Consultant } from '~/assets/ts/models/consultant.model';
 
 
 @Component
 export default class QuickFilterConsultantList extends Vue {
-    @Prop() consultantList!: Consultants[];
+    @Prop() consultantList!: Consultant[];
     isVisiblePopUp = false;
     popUpTxt = '����憿批��';
 
diff --git a/PAMapp/components/Ui/UiDateFormat.vue b/PAMapp/components/Ui/UiDateFormat.vue
index b929e7b..7decbf2 100644
--- a/PAMapp/components/Ui/UiDateFormat.vue
+++ b/PAMapp/components/Ui/UiDateFormat.vue
@@ -20,7 +20,7 @@
         if (!this.date) return;
 
         const toDatePromise = new Promise((resolve, reject) => {
-            const date: Date = typeof(this.date) === 'string' ? new Date(this.date) : this.date;
+            const date: Date = typeof(this.date) === 'string' ? new Date(this.date) : this.date as Date;
             resolve(date);
         });
 
diff --git a/PAMapp/components/Ui/UiPagination.vue b/PAMapp/components/Ui/UiPagination.vue
index 5ab226b..822d0de 100644
--- a/PAMapp/components/Ui/UiPagination.vue
+++ b/PAMapp/components/Ui/UiPagination.vue
@@ -12,20 +12,20 @@
 
 <script lang="ts">
 import { Vue, Component, Prop, Emit, Watch } from 'nuxt-property-decorator';
-import { Consultants } from '~/assets/ts/models/consultant.model';
+import { Consultant } from '~/assets/ts/models/consultant.model';
 
 @Component
 export default class UiPagination extends Vue {
-    @Prop() totalList!: Consultants[];
+    @Prop() totalList!: Consultant[];
     @Prop({default: 5}) pageSize!: number;
     currentPage = 1;
-    pageList: Consultants[] = [];
+    pageList: Consultant[] = [];
 
     mounted() {
         this.handleCurrentChange(this.currentPage);
     }
 
-    @Emit('changePage') chagnePage(): Consultants[] {
+    @Emit('changePage') chagnePage(): Consultant[] {
         return this.pageList
     }
 
@@ -41,7 +41,7 @@
         }
     }
 
-    @Watch('totalList') watchtotalList(newValue: Consultants[]) {
+    @Watch('totalList') watchtotalList(newValue: Consultant[]) {
         if (newValue) {
             this.handleCurrentChange(this.currentPage);
         }
diff --git a/PAMapp/pages/index.vue b/PAMapp/pages/index.vue
index 3d9550d..bfe3453 100644
--- a/PAMapp/pages/index.vue
+++ b/PAMapp/pages/index.vue
@@ -44,18 +44,18 @@
 
 <script lang="ts">
   import { Vue, Component, State, Action, Watch } from 'nuxt-property-decorator';
-  import { Consultants } from '~/assets/ts/models/consultant.model';
+  import { Consultant } from '~/assets/ts/models/consultant.model';
 
   @Component({
     layout: 'home'
   })
   export default class MainComponent extends Vue {
-    consultantList: Consultants[] = [];
-    agents: Consultants[] = [];
-    @State('recommendList') recommendList!: Consultants[];
+    consultantList: Consultant[] = [];
+    agents: Consultant[] = [];
+    @State('recommendList') recommendList!: Consultant[];
     @Action storeRecommendList!: any;
 
-    @State('myConsultantList') myConsultantList!: Consultants[];
+    @State('myConsultantList') myConsultantList!: Consultant[];
     @Action storeConsultantList!: any;
 
     @Watch('myConsultantList')
diff --git a/PAMapp/pages/myConsultantList.vue b/PAMapp/pages/myConsultantList.vue
index 420a6dd..490d23c 100644
--- a/PAMapp/pages/myConsultantList.vue
+++ b/PAMapp/pages/myConsultantList.vue
@@ -26,16 +26,16 @@
 
 <script lang='ts'>
 import { Vue, Component, Watch, State, Action } from 'nuxt-property-decorator';
-import { Consultants } from '~/assets/ts/models/consultant.model';
+import { Consultant } from '~/assets/ts/models/consultant.model';
 
 @Component
 export default class myConsultantList extends Vue {
     activeTabName = 'consultantList';
-    agents: Consultants[] = [];
-    contactedList: Consultants[] = [];
-    consultantList: Consultants[] = [];
+    agents: Consultant[] = [];
+    contactedList: Consultant[] = [];
+    consultantList: Consultant[] = [];
 
-    @State('myConsultantList') myConsultantList!: Consultants[];
+    @State('myConsultantList') myConsultantList!: Consultant[];
     @Action storeConsultantList!: any;
 
     @Watch('myConsultantList')
diff --git a/PAMapp/pages/myConsultantList/consultantList.vue b/PAMapp/pages/myConsultantList/consultantList.vue
index 4b1e09e..b1b0a5c 100644
--- a/PAMapp/pages/myConsultantList/consultantList.vue
+++ b/PAMapp/pages/myConsultantList/consultantList.vue
@@ -13,16 +13,16 @@
 
 <script lang="ts">
 import { Vue, Component, Prop, Getter } from 'nuxt-property-decorator';
-import { Consultants } from '~/assets/ts/models/consultant.model';
+import { Consultant } from '~/assets/ts/models/consultant.model';
 
 
 @Component
 export default class ConsultantPage extends Vue {
-    @Prop() consultantList!: Consultants[];
+    @Prop() consultantList!: Consultant[];
     @Getter isLogin!: boolean;
-    pageList: Consultants[] = [];
+    pageList: Consultant[] = [];
 
-    changePage(pageList: Consultants[]) {
+    changePage(pageList: Consultant[]) {
         this.pageList = pageList;
     }
 
diff --git a/PAMapp/pages/myConsultantList/contactedList.vue b/PAMapp/pages/myConsultantList/contactedList.vue
index fb64a88..a9d3d72 100644
--- a/PAMapp/pages/myConsultantList/contactedList.vue
+++ b/PAMapp/pages/myConsultantList/contactedList.vue
@@ -13,15 +13,15 @@
 
 <script lang="ts">
 import { Vue, Component, Prop } from 'nuxt-property-decorator' ;
-import { Consultants } from '~/assets/ts/models/consultant.model';
+import { Consultant } from '~/assets/ts/models/consultant.model';
 
 
 @Component
 export default class ContactedList extends Vue {
-    @Prop() contactedList!: Consultants[];
-    pageList: Consultants[] = [];
+    @Prop() contactedList!: Consultant[];
+    pageList: Consultant[] = [];
 
-    changePage(pageList: Consultants[]) {
+    changePage(pageList: Consultant[]) {
         this.pageList = pageList;
     }
 }
diff --git a/PAMapp/pages/quickFilter/index.vue b/PAMapp/pages/quickFilter/index.vue
index 8961922..c6ef025 100644
--- a/PAMapp/pages/quickFilter/index.vue
+++ b/PAMapp/pages/quickFilter/index.vue
@@ -67,7 +67,7 @@
 <script lang="ts">
 import { Vue, Component, namespace } from 'nuxt-property-decorator';
 import { FastQueryParams } from '~/assets/ts/api/consultant';
-import { Consultants } from '~/assets/ts/models/consultant.model';
+import { Consultant } from '~/assets/ts/models/consultant.model';
 import { Selected } from '~/components/QuickFilter/QuickFilterSelector.vue';
 import { fastQuery } from '~/assets/ts/api/consultant';
 
@@ -78,7 +78,7 @@
     @localStorage.Getter quickFilterSelectedData!: Selected[];
 
     isOpenQuestionPopUp = false;
-    consultantList: Consultants[] = [];
+    consultantList: Consultant[] = [];
     questionOption = {};
     confirmItem: Selected[] = [];
     questionList: QuestionOption[] = [
diff --git a/PAMapp/store/index.ts b/PAMapp/store/index.ts
index db7b6ef..6e91e76 100644
--- a/PAMapp/store/index.ts
+++ b/PAMapp/store/index.ts
@@ -2,26 +2,26 @@
 import { ClientInfo, getMyAppointmentList, getMyReviewLog, allAppointmentsView } from '~/assets/ts/api/appointment';
 // import * as consultant from '~/assets/ts/api/consultant';
 import { recommend, AgentOfStrictQuery, getFavoriteConsultant, addFavoriteConsultant, deleteConsultant, strictQuery } from '~/assets/ts/api/consultant';
-import { Consultants } from '~/assets/ts/models/consultant.model';
+import { Consultant } from '~/assets/ts/models/consultant.model';
 import { isLogin } from '~/assets/ts/auth';
 import { AppointmentLog } from '~/assets/ts/models/appointment.model';
 import { getFavoriteFromStorage, setFavoriteToStorage } from '~/assets/ts/storageConsultant';
 
 @Module
 export default class Store extends VuexModule {
-    recommendList: Consultants[] = [];
+    recommendList: Consultant[] = [];
     strictQueryList: AgentOfStrictQuery[] = [];
-    myConsultantList: Consultants[] = [];
+    myConsultantList: Consultant[] = [];
 
     myAppointmentList: ClientInfo[] = [];
 
     myAppointmentReviewLogList: AppointmentLog[] = [];
 
-    @Mutation updateRecommend(data: Consultants[]) {
+    @Mutation updateRecommend(data: Consultant[]) {
         this.recommendList = data;
     }
 
-    @Mutation updateConsultantList(data: Consultants[]) {
+    @Mutation updateConsultantList(data: Consultant[]) {
         this.myConsultantList = data;
     }
 
@@ -83,7 +83,7 @@
     }
 
     @Action
-    async addToMyConsultantList(consultantToAdd: Consultants) {
+    async addToMyConsultantList(consultantToAdd: Consultant) {
         if (consultantToAdd) {
             const found = this.myConsultantList.find(item => item.agentNo === consultantToAdd.agentNo);
             if (!found) {

--
Gitblit v1.8.0