feat: refs #6919 sync alias
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jorge Penadés 2024-11-18 16:38:58 +01:00
parent a44ea9384a
commit 617af7b7cb
5 changed files with 21 additions and 34 deletions

View File

@ -4,19 +4,11 @@ import { ref, computed } from 'vue';
import VnTable from 'components/VnTable/VnTable.vue';
import VnSearchbar from 'components/ui/VnSearchbar.vue';
import { useStateStore } from 'stores/useStateStore';
import exprBuilder from './Alias/AliasExprBuilder.js';
const tableRef = ref();
const { t } = useI18n();
const stateStore = useStateStore();
const exprBuilder = (param, value) => {
switch (param) {
case 'search':
return /^\d+$/.test(value)
? { id: value }
: { alias: { like: `%${value}%` } };
}
};
const columns = computed(() => [
{
align: 'left',

View File

@ -0,0 +1,8 @@
export default (param, value) => {
switch (param) {
case 'search':
return /^\d+$/.test(value)
? { id: value }
: { alias: { like: `%${value}%` } };
}
};

View File

@ -1,8 +1,7 @@
<script setup>
import { useI18n } from 'vue-i18n';
import VnCard from 'components/common/VnCard.vue';
import AliasDescriptor from './AliasDescriptor.vue';
const { t } = useI18n();
import exprBuilder from '../AliasExprBuilder.js';
</script>
<template>
@ -13,9 +12,10 @@ const { t } = useI18n();
search-data-key="AccountAliasList"
:searchbar-props="{
url: 'MailAliases',
info: t('mailAlias.searchInfo'),
label: t('mailAlias.search'),
info: $t('mailAlias.searchInfo'),
label: $t('mailAlias.search'),
searchUrl: 'table',
exprBuilder,
}"
/>
</template>

View File

@ -7,7 +7,6 @@ import { useQuasar } from 'quasar';
import CardDescriptor from 'components/ui/CardDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import useCardDescription from 'src/composables/useCardDescription';
import axios from 'axios';
import useNotify from 'src/composables/useNotify.js';
@ -29,9 +28,6 @@ const entityId = computed(() => {
return $props.id || route.params.id;
});
const data = ref(useCardDescription());
const setData = (entity) => (data.value = useCardDescription(entity.alias, entity.id));
const removeAlias = () => {
quasar
.dialog({
@ -60,10 +56,8 @@ const removeAlias = () => {
ref="descriptor"
:url="`MailAliases/${entityId}`"
module="Alias"
@on-fetch="setData"
data-key="aliasData"
:title="data.title"
:subtitle="data.subtitle"
data-key="Alias"
title="alias"
>
<template #menu>
<QItem v-ripple clickable @click="removeAlias()">

View File

@ -1,13 +1,11 @@
<script setup>
import { ref, computed } from 'vue';
import { computed } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import CardSummary from 'components/ui/CardSummary.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import { useArrayData } from 'src/composables/useArrayData';
const route = useRoute();
const { t } = useI18n();
@ -18,20 +16,15 @@ const $props = defineProps({
},
});
const { store } = useArrayData('Alias');
const alias = ref(store.data);
const entityId = computed(() => $props.id || route.params.id);
</script>
<template>
<CardSummary
ref="summary"
:url="`MailAliases/${entityId}`"
@on-fetch="(data) => (alias = data)"
data-key="MailAliasesSummary"
>
<template #header> {{ alias.id }} - {{ alias.alias }} </template>
<template #body>
<CardSummary ref="summary" :url="`MailAliases/${entityId}`" data-key="Alias">
<template #header="{ entity: alias }">
{{ alias.id }} - {{ alias.alias }}
</template>
<template #body="{ entity: alias }">
<QCard class="vn-one">
<QCardSection class="q-pa-none">
<router-link