From 46da7429ca192bf6a947d79437e8076b94676a05 Mon Sep 17 00:00:00 2001 From: Tomas <tomasysh@gmail.com> Date: 星期四, 13 一月 2022 16:29:45 +0800 Subject: [PATCH] update: 刪除重複的 interface: clientInfo => appointment --- /dev/null | 29 ----- PAMapp/pages/myAppointmentList/onProgressList.vue | 13 +- PAMapp/store/index.ts | 9 - PAMapp/pages/myAppointmentList/appointmentList.vue | 13 +- PAMapp/shared/services/appointment.service.ts | 11 +- PAMapp/components/Client/ClientList.vue | 4 PAMapp/components/Client/ClientCard.vue | 6 PAMapp/pages/myAppointmentList/contactedList.vue | 13 +- PAMapp/shared/models/appointment.model.ts | 138 +++++++++++++++------------ PAMapp/pages/myAppointmentList.vue | 10 +- PAMapp/shared/services/my-consultant.service.ts | 7 11 files changed, 122 insertions(+), 131 deletions(-) diff --git a/PAMapp/components/Client/ClientCard.vue b/PAMapp/components/Client/ClientCard.vue index 6d7e821..79dc475 100644 --- a/PAMapp/components/Client/ClientCard.vue +++ b/PAMapp/components/Client/ClientCard.vue @@ -137,9 +137,9 @@ import appointmentService from '~/shared/services/appointment.service'; import UtilsService from '~/shared/services/utils.service'; import { hideReviews } from '~/shared/const/hide-reviews'; -import { AppointmentMemoInfo, ClientInfo } from '~/shared/models/client.model'; import myConsultantService from '~/shared/services/my-consultant.service'; import { ElRow } from 'element-ui/types/row'; +import { Appointment, AppointmentMemoInfo } from '~/shared/models/appointment.model'; const localStorage = namespace('localStorage'); @Component({ @@ -163,10 +163,10 @@ }) export default class ClientList extends Vue { @Action - updateMyAppointment!: (data: ClientInfo) => void; + updateMyAppointment!: (data: Appointment) => void; @Prop() - client!: ClientInfo; + client!: Appointment; @localStorage.Mutation storageClearAppointmentIdFromMsg!: () => void; diff --git a/PAMapp/components/Client/ClientList.vue b/PAMapp/components/Client/ClientList.vue index 31c4095..2f8285c 100644 --- a/PAMapp/components/Client/ClientList.vue +++ b/PAMapp/components/Client/ClientList.vue @@ -18,11 +18,11 @@ <script lang='ts'> import { Vue, Component, Prop } from 'nuxt-property-decorator'; -import { ClientInfo } from '~/shared/models/client.model'; +import { Appointment } from '~/shared/models/appointment.model'; @Component export default class ClientList extends Vue { - @Prop() clients!: ClientInfo[]; + @Prop() clients!: Appointment[]; @Prop() title!: string; ////////////////////////////////////////////////////////////////////// diff --git a/PAMapp/pages/myAppointmentList.vue b/PAMapp/pages/myAppointmentList.vue index 7c83119..286ea92 100644 --- a/PAMapp/pages/myAppointmentList.vue +++ b/PAMapp/pages/myAppointmentList.vue @@ -52,7 +52,7 @@ import * as _ from 'lodash'; -import { ClientInfo } from '~/shared/models/client.model'; +import { Appointment } from '~/shared/models/appointment.model'; const localStorage = namespace('localStorage'); @@ -63,7 +63,7 @@ export default class ClientReservedList extends Vue { @State('myAppointmentList') - myAppointmentList!: ClientInfo[]; + myAppointmentList!: Appointment[]; @State('myNewAppointmentSum') newAppointmentSum!: number; @@ -78,9 +78,9 @@ currentAppointmentIdFromMsg!: string; activeTabName : string = 'appointmentList'; - appointmentList : ClientInfo[] = []; - clients : ClientInfo[] = []; - contactedList : ClientInfo[] = []; + appointmentList : Appointment[] = []; + clients : Appointment[] = []; + contactedList : Appointment[] = []; showNewAppointmentHint: boolean = false; ////////////////////////////////////////////////////////////////////// diff --git a/PAMapp/pages/myAppointmentList/appointmentList.vue b/PAMapp/pages/myAppointmentList/appointmentList.vue index 7c39615..57e3080 100644 --- a/PAMapp/pages/myAppointmentList/appointmentList.vue +++ b/PAMapp/pages/myAppointmentList/appointmentList.vue @@ -26,22 +26,23 @@ <script lang="ts"> import { Vue, Component, State, Watch, namespace } from 'nuxt-property-decorator'; -import { ClientInfo } from '~/shared/models/client.model'; +import { Appointment } from '~/shared/models/appointment.model'; + const localStorage = namespace('localStorage'); @Component export default class ClientReservedList extends Vue { @State('myAppointmentList') - myAppointmentList!: ClientInfo[]; + myAppointmentList!: Appointment[]; @localStorage.Getter currentAppointmentIdFromMsg!: string; - appointmentList: ClientInfo[] = []; - filterList : ClientInfo[] = []; + appointmentList: Appointment[] = []; + filterList : Appointment[] = []; keyWord : string = ''; - pageList : ClientInfo[] = []; + pageList : Appointment[] = []; currentPage : number = 1; ////////////////////////////////////////////////////////////////////// @@ -92,7 +93,7 @@ }) } - changePage(pageList: ClientInfo[]): void { + changePage(pageList: Appointment[]): void { this.pageList = pageList; } diff --git a/PAMapp/pages/myAppointmentList/contactedList.vue b/PAMapp/pages/myAppointmentList/contactedList.vue index aedf894..e4de5e7 100644 --- a/PAMapp/pages/myAppointmentList/contactedList.vue +++ b/PAMapp/pages/myAppointmentList/contactedList.vue @@ -30,22 +30,23 @@ <script lang="ts"> import { Vue, Component, Watch, State, namespace } from 'nuxt-property-decorator'; -import { ClientInfo } from '~/shared/models/client.model'; +import { Appointment } from '~/shared/models/appointment.model'; + const localStorage = namespace('localStorage'); @Component export default class ClientContactedList extends Vue { @State('myAppointmentList') - myAppointmentList!: ClientInfo[]; + myAppointmentList!: Appointment[]; @localStorage.Getter currentAppointmentIdFromMsg!: string; - contactedList: ClientInfo[] = []; - filterList : ClientInfo[] = []; + contactedList: Appointment[] = []; + filterList : Appointment[] = []; keyWord : string = ''; - pageList : ClientInfo[] = []; + pageList : Appointment[] = []; currentPage : number = 1; ////////////////////////////////////////////////////////////////////// @@ -83,7 +84,7 @@ }) } - changePage(pageList: ClientInfo[]): void { + changePage(pageList: Appointment[]): void { this.pageList = pageList; } diff --git a/PAMapp/pages/myAppointmentList/onProgressList.vue b/PAMapp/pages/myAppointmentList/onProgressList.vue index aedf894..e4de5e7 100644 --- a/PAMapp/pages/myAppointmentList/onProgressList.vue +++ b/PAMapp/pages/myAppointmentList/onProgressList.vue @@ -30,22 +30,23 @@ <script lang="ts"> import { Vue, Component, Watch, State, namespace } from 'nuxt-property-decorator'; -import { ClientInfo } from '~/shared/models/client.model'; +import { Appointment } from '~/shared/models/appointment.model'; + const localStorage = namespace('localStorage'); @Component export default class ClientContactedList extends Vue { @State('myAppointmentList') - myAppointmentList!: ClientInfo[]; + myAppointmentList!: Appointment[]; @localStorage.Getter currentAppointmentIdFromMsg!: string; - contactedList: ClientInfo[] = []; - filterList : ClientInfo[] = []; + contactedList: Appointment[] = []; + filterList : Appointment[] = []; keyWord : string = ''; - pageList : ClientInfo[] = []; + pageList : Appointment[] = []; currentPage : number = 1; ////////////////////////////////////////////////////////////////////// @@ -83,7 +84,7 @@ }) } - changePage(pageList: ClientInfo[]): void { + changePage(pageList: Appointment[]): void { this.pageList = pageList; } diff --git a/PAMapp/shared/models/appointment.model.ts b/PAMapp/shared/models/appointment.model.ts index 2fe9173..8919dc9 100644 --- a/PAMapp/shared/models/appointment.model.ts +++ b/PAMapp/shared/models/appointment.model.ts @@ -1,41 +1,60 @@ export interface AppointmentLog { - id : number, - createdDate : Date, - lastModifiedDate: Date, - customerId : number, - agentNo : string, - status : 'UNFILLED' | 'FILLED', - score : number, - agentName : string, - customerName : string, + id : number; + createdDate : string; + lastModifiedDate: string; + customerId : number; + agentNo : string; + status : 'UNFILLED' | 'FILLED'; + score : number; + agentName : string; + customerName : string; } export interface Appointment { - id : number; - phone? : string; - email? : string; - contactType : string; - gender : string; age : string; - job : string; - requirement : string; - communicateStatus : string; - hopeContactTime : string; - otherRequirement? : string; - appointmentDate : string; - lastModifiedDate : string; agentNo : string; + appointmentDate : string; + appointmentMemoList: AppointmentMemoInfo[] + communicateStatus : string; + consultantReadTime : string; + consultantViewTime : string; + contactTime : string; + contactType : string; customerId : number; + email : string; + gender : string; + hopeContactTime : string; + id : number; + interviewRecordDTOs: InterviewRecord[]; + job : string; + lastModifiedDate : string; name : string; - consultantViewTime?: string; - consultantReadTime?: string; - satisfactionScore? : number; + otherRequirement : string; + phone : string; + requirement : string; + satisfactionScore : number; }; + +export interface AppointmentMemoInfo { + appointmentId: number; + content : string; + id : number; +} +export interface InterviewRecord { + appointmentId : number; + content : string; + createdBy : string; + createdDate : string; + id : number; + interviewDate : string; + lastModifiedBy : string; + lastModifiedDate: string; +} export interface AppointmentWithConsultantInfo extends Appointment { - consultantName : string; consultantAvatar : string; - consultantExpertList: string[] - updateTime : Date | string; + consultantExpertList: string[]; + consultantName : string; contactStatus : string; + updateTime : string; } export interface AppointmentDetail { @@ -63,52 +82,51 @@ satisfactionScore? : number; } export interface AppointmentParams { - phone : string; - email : string; - contactType : string; - gender : string; age : string; - job : string; - requirement : string; - hopeContactTime: string; agentNo : string; + contactType : string; + email : string; + gender : string; + hopeContactTime: string; + job : string; + phone : string; + requirement : string; } export interface EditAppointmentParams { - id : number, - phone : string, - email : string, - contactType : string, - gender : string, - age : string, - job : string, - requirement : string, - hopeContactTime : string, - otherRequirement: null + age : string; + contactType : string; + email : string; + gender : string; + hopeContactTime : string; + id : number; + job : string; + otherRequirement: null; + phone : string; + requirement : string; } export interface AppointmentRequests { - phone : string, - email : string, - contactType : string, - gender : string, - age : string, - job : string, - requirement : string[], - hopeContactTime: ContactTime[], - agentNo : string, + age : string; + agentNo : string; + contactType : string; + email : string; + gender : string; + hopeContactTime: ContactTime[]; + job : string; + phone : string; + requirement : string[]; } export interface ContactTime { -selectWeekOptions : string[], -selectTimesOptions: string[] + selectTimesOptions: string[]; + selectWeekOptions : string[]; } export interface createdMemoInfo { - content: string, - appointmentId: number + appointmentId: number; + content : string; } export interface updatedMemoInfo { - content: string, - /** memo id */ - id: number + content: string; + id : number; } diff --git a/PAMapp/shared/models/client.model.ts b/PAMapp/shared/models/client.model.ts deleted file mode 100644 index e4ac0c8..0000000 --- a/PAMapp/shared/models/client.model.ts +++ /dev/null @@ -1,29 +0,0 @@ -export interface ClientInfo { - age : string, - agentNo : string, - appointmentDate : string, - communicateStatus : string, - consultantReadTime : string, - consultantViewTime : string, - contactTime : string, - contactType : string, - customerId : number, - email : string, - gender : string, - hopeContactTime : string, - id : number, - job : string, - lastModifiedDate : string, - name : string, - otherRequirement : string, - phone : string, - requirement : string, - satisfactionScore : number, - appointmentMemoList: AppointmentMemoInfo[] -} - -export interface AppointmentMemoInfo { - appointmentId: number, - content: string, - id: number -} diff --git a/PAMapp/shared/services/appointment.service.ts b/PAMapp/shared/services/appointment.service.ts index a21979c..a97c333 100644 --- a/PAMapp/shared/services/appointment.service.ts +++ b/PAMapp/shared/services/appointment.service.ts @@ -1,14 +1,13 @@ import { http } from "./httpClient"; -import { AppointmentMemoInfo, ClientInfo } from "~/shared/models/client.model"; -import { AppointmentDetail, createdMemoInfo, EditAppointmentParams, updatedMemoInfo } from "~/shared/models/appointment.model"; +import { Appointment, AppointmentDetail, AppointmentMemoInfo, createdMemoInfo, EditAppointmentParams, updatedMemoInfo } from "~/shared/models/appointment.model"; class AppointmentService { - // ��������� - async getMyAppointmentList(): Promise<ClientInfo[]> { + // 憿批������撌梁���API + async getMyAppointmentList(): Promise<Appointment[]> { return http.get('/consultant/getMyAppointment').then((res) => { - const hasNewAppointment = res.data.find((appointment: ClientInfo) => !appointment.consultantViewTime); + const hasNewAppointment = res.data.find((appointment: Appointment) => !appointment.consultantViewTime); if (hasNewAppointment) { this.viewAllAppointment(); } @@ -16,7 +15,7 @@ }); } - // 憿批��憿舐內����蝑敺孛� + // 憿批��汗�撌望������蝝���孛�API private viewAllAppointment(): void { http.post('/consultant/record/allAppointmentsView').then(); } diff --git a/PAMapp/shared/services/my-consultant.service.ts b/PAMapp/shared/services/my-consultant.service.ts index 906f44d..3d4dd78 100644 --- a/PAMapp/shared/services/my-consultant.service.ts +++ b/PAMapp/shared/services/my-consultant.service.ts @@ -1,8 +1,9 @@ +import _ from "lodash"; + import { http } from "./httpClient"; import { AgentInfo } from '~/shared/models/agent-info.model'; import { Consultant } from "../models/consultant.model"; -import _ from "lodash"; -import { ClientInfo } from "../models/client.model"; +import { Appointment } from "../models/appointment.model"; class MyConsultantService { async getFavoriteConsultantList(): Promise<Consultant[]> { @@ -30,7 +31,7 @@ } // 璅�撌脰蝯� - markAsContact(appointmentId: number): Promise<ClientInfo> { + markAsContact(appointmentId: number): Promise<Appointment> { return http.post(`/appointment/markAsContacted/${appointmentId}`).then(res => res.data); } diff --git a/PAMapp/store/index.ts b/PAMapp/store/index.ts index 25d55a2..1aabd10 100644 --- a/PAMapp/store/index.ts +++ b/PAMapp/store/index.ts @@ -9,8 +9,7 @@ import reviewsService from '~/shared/services/reviews.service'; import { Consultant } from '~/shared/models/consultant.model'; -import { AppointmentLog } from '~/shared/models/appointment.model'; -import { ClientInfo } from '~/shared/models/client.model'; +import { Appointment, AppointmentLog } from '~/shared/models/appointment.model'; import { AgentOfStrictQuery } from '~/shared/models/strict-query.model'; @Module export default class Store extends VuexModule { @@ -18,7 +17,7 @@ strictQueryList: AgentOfStrictQuery[] = []; myConsultantList: Consultant[] = []; - myAppointmentList: ClientInfo[] = []; + myAppointmentList: Appointment[] = []; myNewAppointmentSum: number = 0; myAppointmentReviewLogList: AppointmentLog[] = []; @@ -43,7 +42,7 @@ } @Mutation - updateMyAppointmentList(data: ClientInfo[]) { + updateMyAppointmentList(data: Appointment[]) { this.myAppointmentList = data; } @@ -149,7 +148,7 @@ } @Action - updateMyAppointment(myAppointment: ClientInfo) { + updateMyAppointment(myAppointment: Appointment) { const data = this.myAppointmentList.filter(item => item.id !== myAppointment.id); data.unshift(myAppointment); this.context.commit('updateMyAppointmentList', data) -- Gitblit v1.8.0