#6825 - VnTable V1 #396
|
@ -134,26 +134,28 @@ const col = computed(() => {
|
|||
const components = computed(() => $props.components ?? defaultComponents);
|
||||
</script>
|
||||
<template>
|
||||
<VnComponent
|
||||
v-if="col.before"
|
||||
:prop="col.before"
|
||||
:components="components"
|
||||
:value="model"
|
||||
v-model="model"
|
||||
/>
|
||||
<VnComponent
|
||||
v-if="col.component"
|
||||
:prop="col"
|
||||
:components="components"
|
||||
:value="model"
|
||||
v-model="model"
|
||||
/>
|
||||
<span :title="value" v-else>{{ value }}</span>
|
||||
<VnComponent
|
||||
v-if="col.after"
|
||||
:prop="col.after"
|
||||
:components="components"
|
||||
:value="model"
|
||||
v-model="model"
|
||||
/>
|
||||
<div class="row no-wrap fit">
|
||||
<VnComponent
|
||||
v-if="col.before"
|
||||
:prop="col.before"
|
||||
:components="components"
|
||||
:value="model"
|
||||
v-model="model"
|
||||
/>
|
||||
<VnComponent
|
||||
v-if="col.component"
|
||||
:prop="col"
|
||||
:components="components"
|
||||
:value="model"
|
||||
v-model="model"
|
||||
/>
|
||||
<span :title="value" v-else>{{ value }}</span>
|
||||
<VnComponent
|
||||
v-if="col.after"
|
||||
:prop="col.after"
|
||||
:components="components"
|
||||
:value="model"
|
||||
v-model="model"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -147,7 +147,7 @@ const tagsList = computed(() => {
|
|||
const tagList = [];
|
||||
for (const key of Object.keys(params.value)) {
|
||||
const value = params.value[key];
|
||||
if (!value || ($props.hiddenTags || []).includes(key)) continue;
|
||||
if (value == null || ($props.hiddenTags || []).includes(key)) continue;
|
||||
tagList.push({ label: key, value });
|
||||
}
|
||||
return tagList;
|
||||
|
@ -161,21 +161,14 @@ const customTags = computed(() =>
|
|||
);
|
||||
|
||||
async function remove(key) {
|
||||
delete params.value[key];
|
||||
delete params.value.filter?.where?.[key];
|
||||
params.value[key] = undefined;
|
||||
await arrayData.applyFilter({ params: params.value });
|
||||
search();
|
||||
emit('remove', key);
|
||||
}
|
||||
|
||||
function formatValue(value) {
|
||||
if (typeof value === 'boolean') {
|
||||
return value ? t('Yes') : t('No');
|
||||
}
|
||||
|
||||
if (isNaN(value) && !isNaN(Date.parse(value))) {
|
||||
return toDate(value);
|
||||
}
|
||||
if (typeof value === 'boolean') return value ? t('Yes') : t('No');
|
||||
|
||||
if (isNaN(value) && !isNaN(Date.parse(value))) return toDate(value);
|
||||
|
||||
return `"${value}"`;
|
||||
}
|
||||
|
@ -236,7 +229,7 @@ function formatValue(value) {
|
|||
<slot name="tags" :tag="chip" :format-fn="formatValue">
|
||||
<div class="q-gutter-x-xs">
|
||||
<strong>{{ chip.label }}:</strong>
|
||||
<span>"{{ chip.value }}"</span>
|
||||
<span>"{{ formatValue(chip.value) }}"</span>
|
||||
</div>
|
||||
</slot>
|
||||
</VnFilterPanelChip>
|
||||
|
|
|
@ -94,15 +94,19 @@ const columns = computed(() => [
|
|||
label: t('customer.extendedList.tableVisibleColumns.phone'),
|
||||
name: 'phone',
|
||||
cardVisible: true,
|
||||
after: {
|
||||
component: markRaw(VnLinkPhone),
|
||||
props: (prop) => ({
|
||||
'phone-number': prop.phone,
|
||||
}),
|
||||
columnFilter: {
|
||||
component: 'number',
|
||||
},
|
||||
component: 'number',
|
||||
columnField: {
|
||||
component: null,
|
||||
after: {
|
||||
component: markRaw(VnLinkPhone),
|
||||
attrs: (prop) => {
|
||||
return {
|
||||
'phone-number': prop,
|
||||
};
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Si la operacion ternaria es para el valor de la traducción, porque no ponerla dentro de la funcion t?
Otra cosa es, hacen falta las traducciones? Porque en globals tenemos yes y no