保誠-保戶業務員媒合平台
Tomas
2021-12-27 c9b1f11a9655813773e009286467af5044106d6e
refactor components: multiSelectBtn, singleSelectBtn
修改2個檔案
12 ■■■■ 已變更過的檔案
PAMapp/components/multiSelectBtn.vue 9 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/components/singleSelectBtn.vue 3 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/components/multiSelectBtn.vue
@@ -30,6 +30,7 @@
  @Component
  export default class MultiSelectBtn extends Vue {
    @PropSync('mutiSelect',{type:Array,default:()=>[]})
    syncMutiSelect!:string[];
@@ -49,18 +50,22 @@
    isSelectAll=false;
    //////////////////////////////////////////////////////////////////////
    updated() {
      this.isSelectAll = this.syncMutiSelect.length === this.options.length;
    }
    //////////////////////////////////////////////////////////////////////
    selectAll():void{
      this.isSelectAll= !this.isSelectAll;
      this.syncMutiSelect = this.isSelectAll ? this.optionsFormat(this.options):[];
    }
    optionsFormat(optios:OptionBtnDto[]):string[]{
      return optios.map(o=>o.title);
    optionsFormat(options:OptionBtnDto[]): string[] {
      return options.map((option)=> option.title );
    }
    selectOther():void{
      this.isSelectOtherOption = !this.isSelectOtherOption;
      if(!this.isSelectOtherOption){
PAMapp/components/singleSelectBtn.vue
@@ -20,9 +20,12 @@
<script lang="ts">
  import { Component, Prop, PropSync, Vue } from "nuxt-property-decorator";
  import * as _ from 'lodash';
  @Component
  export default class SingleSelectBtn extends Vue {
    @PropSync('singleSelected', { default: '' })
    syncSingleSelected!: string | number;