|
|
|
@ -1,5 +1,7 @@
|
|
|
|
|
<template> |
|
|
|
|
<v-row class="currency-wrapper"> |
|
|
|
|
<v-tooltip top :disabled="!(isMoney && isPG)"> |
|
|
|
|
<template #activator="{ on, attrs }"> |
|
|
|
|
<v-row class="currency-wrapper" v-bind="attrs" v-on="on"> |
|
|
|
|
<v-col cols="6"> |
|
|
|
|
<!--label="Format Locale"--> |
|
|
|
|
<v-autocomplete |
|
|
|
@ -11,6 +13,7 @@
|
|
|
|
|
:items="currencyLocaleList" |
|
|
|
|
outlined |
|
|
|
|
hide-details |
|
|
|
|
:disabled="isMoney && isPG" |
|
|
|
|
/> |
|
|
|
|
</v-col> |
|
|
|
|
<v-col cols="6"> |
|
|
|
@ -24,10 +27,14 @@
|
|
|
|
|
:items="currencyList" |
|
|
|
|
outlined |
|
|
|
|
hide-details |
|
|
|
|
:disabled="isMoney && isPG" |
|
|
|
|
/> |
|
|
|
|
</v-col> |
|
|
|
|
</v-row> |
|
|
|
|
</template> |
|
|
|
|
<span>{{ message }}</span> |
|
|
|
|
</v-tooltip> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { currencyCodes, currencyLocales, validateCurrencyCode, validateCurrencyLocale } from '~/helpers/currencyHelper' |
|
|
|
@ -49,6 +56,20 @@ export default {
|
|
|
|
|
return validateCurrencyCode(value) || 'Invalid Currency Code' |
|
|
|
|
} |
|
|
|
|
}), |
|
|
|
|
computed: { |
|
|
|
|
isMoney() { |
|
|
|
|
return this.column.dt === 'money' |
|
|
|
|
}, |
|
|
|
|
isPG() { |
|
|
|
|
return ['pg'].includes(this.$store.getters['project/GtrClientType']) |
|
|
|
|
}, |
|
|
|
|
message() { |
|
|
|
|
if (this.isMoney && this.isPG) { |
|
|
|
|
return "PostgreSQL 'money' type has own currency settings" |
|
|
|
|
} |
|
|
|
|
return '' |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
|
value() { |
|
|
|
|
this.colMeta = this.value || {} |
|
|
|
|