unit.ts 570 B

12345678910111213141516171819202122232425262728
  1. import { useEnumStore } from '@/stores'
  2. const { getEnumTypeList, getEnumTypeName } = useEnumStore()
  3. /**
  4. * 获取商品单位列表
  5. * @returns
  6. */
  7. export function getGoodsUnitList() {
  8. return getEnumTypeList('goodsunit')
  9. }
  10. /**
  11. * 获取商品单位名称
  12. * @returns
  13. */
  14. export function getGoodsUnitName(value?: number) {
  15. const enums = getGoodsUnitList()
  16. return getEnumTypeName(enums, value)
  17. }
  18. /**
  19. * 获取国际手机区号
  20. * @returns
  21. */
  22. export function getCountryCodeList() {
  23. return getEnumTypeList('countrycode')
  24. }