| | |
| | | import { dayTimeFrames } from "~/shared/const/day-time-frames"; |
| | | import { OptionBtnDto, OptionDto } from "~/shared/models/optionBtnDto.model"; |
| | | import { weekDays } from "~/shared/const/week-days"; |
| | | import * as _ from "lodash"; |
| | | @Component({ |
| | | filters:{ |
| | | titleFormatByIndex(index:number):string{ |
| | | const chineseNumber = ['ä¸','äº','ä¸','å','äº','å
','ä¸','å
«','ä¹','å']; |
| | | return 'ææ®µ'+chineseNumber[index]; |
| | | }, |
| | | optionsFormat(selectedOptions:string[]|[], compareOptions:OptionDto): string{ |
| | | return _.isEqual(selectedOptions.length,compareOptions.options.length) |
| | | ? compareOptions.selectAll |
| | | : _.join(selectedOptions,','); |
| | | }, |
| | | optionsFormat(selectedOptions = [], compareOptions) { |
| | | return selectedOptions.length === compareOptions.options.length |
| | | ? compareOptions.selectAll |
| | | : selectedOptions.join(','); |
| | | } |
| | | } |
| | | }) |
| | | export default class PhoneContactTimePicker extends Vue { |
| | |
| | | ////////////////////////////////////////////////////////////////////// |
| | | |
| | | get isOpenByDayPopUp(): boolean{ |
| | | return _.isEqual(this.popUpMode , TimePickerMode.SELECT_DAY) |
| | | return this.popUpMode === TimePickerMode.SELECT_DAY; |
| | | } |
| | | |
| | | set isOpenByDayPopUp(value:boolean){ |
| | |
| | | } |
| | | |
| | | get isOpenByTimePopUp(): boolean{ |
| | | return _.isEqual(this.popUpMode , TimePickerMode.SELECT_TIME); |
| | | return this.popUpMode === TimePickerMode.SELECT_TIME; |
| | | } |
| | | |
| | | set isOpenByTimePopUp(value:boolean){ |
| | |
| | | ////////////////////////////////////////////////////////////////////// |
| | | |
| | | openPopUp(schedule:scheduleDto,index:number):void{ |
| | | this.initPickerControl = _.cloneDeep(schedule); |
| | | this.initPickerControl = JSON.parse(JSON.stringify(schedule)); |
| | | this.popUpMode = TimePickerMode.SELECT_DAY; |
| | | this.scheduleIndex = index; |
| | | } |
| | |
| | | } |
| | | |
| | | private initPickerFormatSort(initPickerControl:scheduleDto):scheduleDto{ |
| | | _.keys(initPickerControl).forEach(keyName=>{ |
| | | const options = _.isEqual(keyName,'selectWeekOptions') ? weekDays : dayTimeFrames; |
| | | Object.keys(initPickerControl).forEach(keyName=>{ |
| | | const options = keyName === 'selectWeekOptions' ? weekDays : dayTimeFrames; |
| | | initPickerControl[keyName] = this.getOptionsBySort(initPickerControl[keyName],options); |
| | | }) |
| | | return initPickerControl; |
| | |
| | | |
| | | // è³æéæ°æåºï¼å復ä¸éå§æ¸
å®é åº |
| | | private getOptionsBySort( selectedOptions:string[] , options:OptionBtnDto[]): string[] { |
| | | return options.map( o => _.includes(selectedOptions , o.label) ? o.label as string : '').filter(String); |
| | | return options.map( o => selectedOptions.includes(o.label as string) ? o.label as string : '').filter(String); |
| | | } |
| | | |
| | | addNewSchedule(): void { |
| | |
| | | "core-js": "^3.18.3", |
| | | "crypto-js": "^4.1.1", |
| | | "element-ui": "^2.15.6", |
| | | "lodash": "^4.17.21", |
| | | "node-cipher": "^6.3.3", |
| | | "node-forge": "^1.3.1", |
| | | "nuxt": "^2.15.8", |
| | |
| | | "@nuxt/types": "^2.15.8", |
| | | "@nuxt/typescript-build": "^2.1.0", |
| | | "@nuxtjs/dotenv": "^1.4.1", |
| | | "@types/lodash": "^4.14.176", |
| | | "@types/node-forge": "^1.3.4", |
| | | "@vue/test-utils": "^1.2.2", |
| | | "babel-core": "7.0.0-bridge.0", |
| | |
| | | import { Context } from '@nuxt/types'; |
| | | import { namespace } from 'nuxt-property-decorator'; |
| | | import { Vue, Component, Prop } from 'vue-property-decorator'; |
| | | import * as _ from "lodash"; |
| | | |
| | | import myConsultantService from '~/shared/services/my-consultant.service'; |
| | | import accountSettingService from '~/shared/services/account-setting.service'; |
| | |
| | | |
| | | this.editInfoValue = { |
| | | ...this.defaultAgentInfoSetting, |
| | | expertise: _.cloneDeep(this.defaultAgentInfoSetting.expertise), |
| | | expertise: JSON.parse(JSON.stringify(this.defaultAgentInfoSetting.expertise)), |
| | | communicationStyle: this.defaultAgentInfoSetting.communicationStyle?.split('ã') || [], |
| | | }; |
| | | } |
| | |
| | | } |
| | | |
| | | get phoneValid(): boolean { |
| | | const rule = /^09[0-9]{8}$/; |
| | | return this.editInfoValue.phoneNumber |
| | | ? rule.test(this.editInfoValue.phoneNumber) && _.isEqual(this.editInfoValue.phoneNumber.length,10) |
| | | : true; |
| | | } |
| | | const rule = /^09[0-9]{8}$/; |
| | | return this.editInfoValue.phoneNumber |
| | | ? rule.test(this.editInfoValue.phoneNumber) && this.editInfoValue.phoneNumber.length === 10 |
| | | : true; |
| | | } |
| | | |
| | | get emailValid() { |
| | | const rule = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/; |
| | |
| | | import { MessageBox } from 'element-ui'; |
| | | import { MessageBoxData } from "element-ui/types/message-box"; |
| | | import _ from "lodash"; |
| | | |
| | | class MessageBoxService { |
| | | |
| | |
| | | |
| | | // æ«æç¨éè廿·è¡ |
| | | private breakTextByComma(errorMsg:string):string{ |
| | | return _.split(errorMsg,"ï¼").join('<br>'); |
| | | return errorMsg.split("ï¼").join('<br>'); |
| | | } |
| | | |
| | | } |
| | |
| | | import _ from "lodash"; |
| | | |
| | | import { http } from "./httpClient"; |
| | | import { AgentInfo } from '~/shared/models/agent-info.model'; |
| | | import { Consultant } from "../models/consultant.model"; |
| | | import { Appointment } from "../models/appointment.model"; |
| | | import { Consultant } from "../models/consultant.model"; |
| | | import { http } from "./httpClient"; |
| | | class MyConsultantService { |
| | | |
| | | async getFavoriteConsultantList(): Promise<Consultant[]> { |
| | |
| | | return http.get(`/consultant/avatar/${agentNo}`,{ responseType : 'arraybuffer' }) |
| | | .then( response => { |
| | | const toBase64 = window.btoa( |
| | | _.reduce( new Uint8Array(response.data),(data,byte) => |
| | | data + String.fromCharCode(byte),'') |
| | | Array.from(new Uint8Array(response.data)).reduce((data, byte) => |
| | | data + String.fromCharCode(byte), '') |
| | | ); |
| | | const imgSrc = `data:image/png;base64,${toBase64}`; |
| | | return imgSrc; |
| | |
| | | "@nuxt/types", |
| | | "@types/node", |
| | | "@nuxtjs/axios", |
| | | "@types/lodash", |
| | | ] |
| | | }, |
| | | "exclude": [ |