保誠-保戶業務員媒合平台
HelenHuang
2022-02-10 2411af4fd62e5d4b1ae634fa18a25066437c33f0
add: serve-area-filter - 當服務所有地區時,顯示為"全台"
修改2個檔案
新增1個檔案
19 ■■■■■ 已變更過的檔案
PAMapp/nuxt.config.js 1 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/pages/agentInfo/_agentNo.vue 2 ●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/plugins/filters/serve-area.filter.ts 16 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/nuxt.config.js
@@ -40,6 +40,7 @@
    '~/plugins/filters/date.filter.ts',
    '~/plugins/filters/age.filter.ts',
    '~/plugins/filters/appointment-fail-reason.filter.ts',
    '~/plugins/filters/serve-area.filter.ts',
  ],
  // Auto import components: https://go.nuxtjs.dev/config-components
PAMapp/pages/agentInfo/_agentNo.vue
@@ -47,7 +47,7 @@
        type="flex"
        class="pam-paragraph">
        <UiField icon="company" label="服務地區">
          {{ agentInfo.serveArea }}
          {{ agentInfo.serveArea | toServeArea }}
        </UiField>
      </el-row>
PAMapp/plugins/filters/serve-area.filter.ts
¤ñ¹ï·sÀÉ®×
@@ -0,0 +1,16 @@
import { taiwanCities } from '~/shared/const/taiwan-cities';
import Vue from 'vue'
Vue.filter('toServeArea', (value: string): string => {
  if (!value || typeof value !== 'string') {
    return '--';
  }
  const serveAreaLength = value.split('、').length;
  return serveAreaLength === taiwanCities.length
        ? '全台'
        : value;
})