feat: refs #8197 working rightMenu
gitea/salix-front/pipeline/pr-master There was a failure building this commit Details

This commit is contained in:
Alex Moreno 2024-12-12 11:03:28 +01:00
parent 2ae0d90e32
commit 3984327b51
4 changed files with 44 additions and 51 deletions

View File

@ -1,7 +1,6 @@
<script setup> <script setup>
import { ref } from 'vue'; import { ref } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useStateStore } from 'stores/useStateStore';
import VnFilterPanel from 'components/ui/VnFilterPanel.vue'; import VnFilterPanel from 'components/ui/VnFilterPanel.vue';
import VnFilter from 'components/VnTable/VnFilter.vue'; import VnFilter from 'components/VnTable/VnFilter.vue';
@ -22,7 +21,6 @@ defineProps({
}, },
}); });
const { t } = useI18n(); const { t } = useI18n();
const stateStore = useStateStore();
const tableFilterRef = ref([]); const tableFilterRef = ref([]);
@ -34,13 +32,7 @@ function columnName(col) {
} }
</script> </script>
<template> <template>
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above> <VnFilterPanel v-bind="$attrs" :search-button="true" :disable-submit-event="true">
<QScrollArea class="fit">
<VnFilterPanel
v-bind="$attrs"
:search-button="true"
:disable-submit-event="true"
>
<template #body="{ params, orders }"> <template #body="{ params, orders }">
<div <div
class="row no-wrap flex-center" class="row no-wrap flex-center"
@ -55,10 +47,7 @@ function columnName(col) {
:search-url="searchUrl" :search-url="searchUrl"
/> />
<VnTableOrder <VnTableOrder
v-if=" v-if="col?.columnFilter !== false && col?.name !== 'tableActions'"
col?.columnFilter !== false &&
col?.name !== 'tableActions'
"
v-model="orders[col.orderBy ?? col.name]" v-model="orders[col.orderBy ?? col.name]"
:name="col.orderBy ?? col.name" :name="col.orderBy ?? col.name"
:data-key="$attrs['data-key']" :data-key="$attrs['data-key']"
@ -80,6 +69,4 @@ function columnName(col) {
</div> </div>
</template> </template>
</VnFilterPanel> </VnFilterPanel>
</QScrollArea>
</QDrawer>
</template> </template>

View File

@ -1,6 +1,7 @@
<script setup> <script setup>
import LeftMenu from '../LeftMenu.vue'; import LeftMenu from '../LeftMenu.vue';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import RightMenu from './RightMenu.vue';
const stateStore = useStateStore(); const stateStore = useStateStore();
defineProps({ defineProps({
@ -17,5 +18,9 @@ defineProps({
</Teleport> </Teleport>
<slot name="body" v-if="section == $route.name" /> <slot name="body" v-if="section == $route.name" />
<RouterView v-else /> <RouterView v-else />
<slot name="rightPanel" /> <RightMenu>
<template #right-panel v-if="$slots['rightMenu']">
<slot name="rightMenu" />
</template>
</RightMenu>
</template> </template>

View File

@ -136,7 +136,7 @@ function exprBuilder(param, value) {
:right-search="false" :right-search="false"
/> />
</template> </template>
<template #rightPanel> <template #rightMenu>
<VnTableFilter :data-key="dataKey" :columns="columns" /> <VnTableFilter :data-key="dataKey" :columns="columns" />
</template> </template>
</VnCardMain> </VnCardMain>

View File

@ -114,6 +114,7 @@ const exprBuilder = (param, value) => {
:columns="columns" :columns="columns"
default-mode="table" default-mode="table"
redirect="account/role" redirect="account/role"
:right-search="false"
/> />
</template> </template>
</VnCardMain> </VnCardMain>