forked from verdnatura/salix-front
refacto: refs #4466 replace composable name
This commit is contained in:
parent
e2facf3330
commit
75b527207f
|
@ -7,7 +7,7 @@ import { date } from 'quasar';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import { toRelativeDate } from 'src/filters';
|
import { toRelativeDate } from 'src/filters';
|
||||||
import { useColor } from 'src/composables/useColor';
|
import { useColor } from 'src/composables/useColor';
|
||||||
import { useFirstUpper } from 'src/composables/useFirstUpper';
|
import { useCapitalize } from 'src/composables/useCapitalize';
|
||||||
import { useValidator } from 'src/composables/useValidator';
|
import { useValidator } from 'src/composables/useValidator';
|
||||||
import VnAvatar from '../ui/VnAvatar.vue';
|
import VnAvatar from '../ui/VnAvatar.vue';
|
||||||
import VnJsonValue from '../common/VnJsonValue.vue';
|
import VnJsonValue from '../common/VnJsonValue.vue';
|
||||||
|
@ -140,7 +140,7 @@ function parseProps(propNames, locale, vals, olds) {
|
||||||
if (prop.endsWith('$')) continue;
|
if (prop.endsWith('$')) continue;
|
||||||
props.push({
|
props.push({
|
||||||
name: prop,
|
name: prop,
|
||||||
nameI18n: useFirstUpper(locale.columns?.[prop]) || prop,
|
nameI18n: useCapitalize(locale.columns?.[prop]) || prop,
|
||||||
val: getVal(vals, prop),
|
val: getVal(vals, prop),
|
||||||
old: olds && getVal(olds, prop),
|
old: olds && getVal(olds, prop),
|
||||||
});
|
});
|
||||||
|
@ -202,7 +202,7 @@ function getLogTree(data) {
|
||||||
userLog.logs.push(
|
userLog.logs.push(
|
||||||
(modelLog = {
|
(modelLog = {
|
||||||
model: log.changedModel,
|
model: log.changedModel,
|
||||||
modelI18n: useFirstUpper(locale.name) || log.changedModel,
|
modelI18n: useCapitalize(locale.name) || log.changedModel,
|
||||||
id: log.changedModelId,
|
id: log.changedModelId,
|
||||||
showValue: log.changedModelValue,
|
showValue: log.changedModelValue,
|
||||||
logs: [],
|
logs: [],
|
||||||
|
@ -395,7 +395,7 @@ setLogTree();
|
||||||
(data) =>
|
(data) =>
|
||||||
(actions = data.map((item) => {
|
(actions = data.map((item) => {
|
||||||
return {
|
return {
|
||||||
locale: useFirstUpper(validations[item.changedModel].locale.name),
|
locale: useCapitalize(validations[item.changedModel].locale.name),
|
||||||
value: item.changedModel,
|
value: item.changedModel,
|
||||||
};
|
};
|
||||||
}))
|
}))
|
||||||
|
@ -409,7 +409,7 @@ setLogTree();
|
||||||
>
|
>
|
||||||
<QItem class="origin-info items-center q-my-md" v-if="logTree.length > 1">
|
<QItem class="origin-info items-center q-my-md" v-if="logTree.length > 1">
|
||||||
<h6 class="origin-id text-grey">
|
<h6 class="origin-id text-grey">
|
||||||
{{ useFirstUpper(validations[props.model].locale.name) }}
|
{{ useCapitalize(validations[props.model].locale.name) }}
|
||||||
#{{ originLog.originFk }}
|
#{{ originLog.originFk }}
|
||||||
</h6>
|
</h6>
|
||||||
<div class="line bg-grey"></div>
|
<div class="line bg-grey"></div>
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
export function useFirstUpper(str) {
|
export function useCapitalize(str) {
|
||||||
return str && str.charAt(0).toUpperCase() + str.substr(1);
|
return str && str.charAt(0).toUpperCase() + str.substr(1);
|
||||||
}
|
}
|
|
@ -3,7 +3,7 @@ import { ref, computed } from 'vue';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
import { useFirstUpper } from 'src/composables/useFirstUpper';
|
import { useCapitalize } from 'src/composables/useCapitalize';
|
||||||
import CrudModel from 'src/components/CrudModel.vue';
|
import CrudModel from 'src/components/CrudModel.vue';
|
||||||
import FetchData from 'src/components/FetchData.vue';
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
|
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
|
||||||
|
@ -32,7 +32,7 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'type',
|
name: 'type',
|
||||||
label: useFirstUpper(t('globals.type')),
|
label: useCapitalize(t('globals.type')),
|
||||||
field: (row) => row.cplusRectificationTypeFk,
|
field: (row) => row.cplusRectificationTypeFk,
|
||||||
options: cplusRectificationTypes.value,
|
options: cplusRectificationTypes.value,
|
||||||
model: 'cplusRectificationTypeFk',
|
model: 'cplusRectificationTypeFk',
|
||||||
|
@ -44,7 +44,7 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'class',
|
name: 'class',
|
||||||
label: useFirstUpper(t('globals.class')),
|
label: useCapitalize(t('globals.class')),
|
||||||
field: (row) => row.siiTypeInvoiceOutFk,
|
field: (row) => row.siiTypeInvoiceOutFk,
|
||||||
options: siiTypeInvoiceOuts.value,
|
options: siiTypeInvoiceOuts.value,
|
||||||
model: 'siiTypeInvoiceOutFk',
|
model: 'siiTypeInvoiceOutFk',
|
||||||
|
@ -56,7 +56,7 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'reason',
|
name: 'reason',
|
||||||
label: useFirstUpper(t('globals.reason')),
|
label: useCapitalize(t('globals.reason')),
|
||||||
field: (row) => row.invoiceCorrectionTypeFk,
|
field: (row) => row.invoiceCorrectionTypeFk,
|
||||||
options: invoiceCorrectionTypes.value,
|
options: invoiceCorrectionTypes.value,
|
||||||
model: 'invoiceCorrectionTypeFk',
|
model: 'invoiceCorrectionTypeFk',
|
||||||
|
|
|
@ -16,7 +16,7 @@ import FetchData from 'src/components/FetchData.vue';
|
||||||
import SendEmailDialog from 'components/common/SendEmailDialog.vue';
|
import SendEmailDialog from 'components/common/SendEmailDialog.vue';
|
||||||
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
||||||
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
|
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
|
||||||
import { useFirstUpper } from 'src/composables/useFirstUpper';
|
import { useCapitalize } from 'src/composables/useCapitalize';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
|
@ -481,7 +481,7 @@ const createInvoiceInCorrection = async () => {
|
||||||
readonly
|
readonly
|
||||||
/>
|
/>
|
||||||
<VnSelectFilter
|
<VnSelectFilter
|
||||||
:label="`${useFirstUpper(t('globals.class'))}*`"
|
:label="`${useCapitalize(t('globals.class'))}*`"
|
||||||
v-model="correctionFormData.invoiceClass"
|
v-model="correctionFormData.invoiceClass"
|
||||||
:options="siiTypeInvoiceOuts"
|
:options="siiTypeInvoiceOuts"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
|
@ -491,7 +491,7 @@ const createInvoiceInCorrection = async () => {
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnSelectFilter
|
<VnSelectFilter
|
||||||
:label="`${useFirstUpper(t('globals.type'))}*`"
|
:label="`${useCapitalize(t('globals.type'))}*`"
|
||||||
v-model="correctionFormData.invoiceType"
|
v-model="correctionFormData.invoiceType"
|
||||||
:options="cplusRectificationTypes"
|
:options="cplusRectificationTypes"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
|
@ -499,7 +499,7 @@ const createInvoiceInCorrection = async () => {
|
||||||
:rules="[requiredFieldRule]"
|
:rules="[requiredFieldRule]"
|
||||||
/>
|
/>
|
||||||
<VnSelectFilter
|
<VnSelectFilter
|
||||||
:label="`${useFirstUpper(t('globals.reason'))}*`"
|
:label="`${useCapitalize(t('globals.reason'))}*`"
|
||||||
v-model="correctionFormData.invoiceReason"
|
v-model="correctionFormData.invoiceReason"
|
||||||
:options="invoiceCorrectionTypes"
|
:options="invoiceCorrectionTypes"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
|
|
|
@ -7,7 +7,7 @@ import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
import { useFirstUpper } from 'src/composables/useFirstUpper';
|
import { useCapitalize } from 'src/composables/useCapitalize';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -53,7 +53,7 @@ const suppliersRef = ref();
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="useFirstUpper(t('params.correctedFk'))"
|
:label="useCapitalize(t('params.correctedFk'))"
|
||||||
v-model="params.correctedFk"
|
v-model="params.correctedFk"
|
||||||
is-outlined
|
is-outlined
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in New Issue