From 176b380f392efab0a84dd79560dca22e8053d0e4 Mon Sep 17 00:00:00 2001 From: Tomas <tomasysh@gmail.com> Date: 星期一, 27 十二月 2021 12:32:35 +0800 Subject: [PATCH] refactor component: careerSelect --- PAMapp/components/Consultant/ConsultantList.vue | 36 ++++++++++++++++++++++++++---------- 1 files changed, 26 insertions(+), 10 deletions(-) diff --git a/PAMapp/components/Consultant/ConsultantList.vue b/PAMapp/components/Consultant/ConsultantList.vue index a8791f8..45e8a0a 100644 --- a/PAMapp/components/Consultant/ConsultantList.vue +++ b/PAMapp/components/Consultant/ConsultantList.vue @@ -10,7 +10,7 @@ </template> <template v-if="isUserLogin && agentList.length === 0"> <div class="emptyRowStyle"> - <div class="smTxt txt">����撌脰蝯⊿“���</div> + <div class="smTxt txt">{{ noDataPlaceholder }}</div> </div> </template> <template v-if="!isUserLogin"> @@ -23,21 +23,37 @@ </template> <script lang="ts"> -import { Vue, Component, Prop, namespace } from 'nuxt-property-decorator'; -import { Consultant } from '~/assets/ts/models/consultant.model'; -import { Role } from '~/assets/ts/models/enum/Role'; +import { Vue, Component, Prop } from 'nuxt-property-decorator'; -const roleStorage = namespace('localStorage'); +import authService from '~/shared/services/auth.service'; +import { Consultant } from '~/shared/models/consultant.model'; @Component export default class ConsultantList extends Vue { - @Prop() agents!: Consultant[]; - @roleStorage.Getter isUserLogin!:boolean; + @Prop() + agents!: Consultant[]; + + @Prop() + title! : string; + + isUserLogin = false; get agentList(){ - return this.agents.map((agentDto)=> - ({...agentDto,customerScore:0,}) - ) + return this.agents.map((agentDto)=> + ({...agentDto,customerScore:0,}) + ) + } + + get noDataPlaceholder(): string { + return this.title === 'contactedList' + ? '����撌脰蝯⊿“���' + : '����撌脤憿批��'; + } + + ////////////////////////////////////////////////////////////////////// + + mounted() { + this.isUserLogin = authService.isUserLogin(); } } -- Gitblit v1.8.0