import {
  customerStateOptions,
  customerTypesOptions,
  customerSexOptions,
  customerIsFirstRechargeOptions,
} from '@/config';

export default {
  data() {
    return {
      customerStateOptions,
      customerTypesOptions,
      customerSexOptions,
      customerIsFirstRechargeOptions,
    };
  },
  methods: {
    getTypeLabel(val) {
      let item = customerTypesOptions.find(item => item.value === val);
      return item ? item.label : '';
    },
    getStateLabel(val) {
      let item = customerStateOptions.find(item => item.value === val);
      return item ? item.label : '';
    },
    getSexLabel(val) {
      let item = customerSexOptions.find(item => item.value === val);
      return item ? item.label : '';
    },
    getIsFirstRechargeLabel(val) {
      let item = customerIsFirstRechargeOptions.find(
        item => item.value === val
      );
      return item ? item.label : '';
    },
  },
};
