Merge pull request 'Warmifx[CardDescriptor]: Fixed department descriptor icon' (!1612) from Warmfix-DepartmentIcon into test
gitea/salix-front/pipeline/head This commit looks good
Details
gitea/salix-front/pipeline/head This commit looks good
Details
Reviewed-on: #1612 Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
commit
0d63c4ec2c
|
@ -38,6 +38,10 @@ const $props = defineProps({
|
||||||
type: String,
|
type: String,
|
||||||
default: 'md-width',
|
default: 'md-width',
|
||||||
},
|
},
|
||||||
|
toModule: {
|
||||||
|
type: String,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const state = useState();
|
const state = useState();
|
||||||
|
@ -129,6 +133,11 @@ const emit = defineEmits(['onFetch']);
|
||||||
|
|
||||||
const iconModule = computed(() => {
|
const iconModule = computed(() => {
|
||||||
moduleName.value = getName();
|
moduleName.value = getName();
|
||||||
|
if ($props.toModule) {
|
||||||
|
return router
|
||||||
|
.getRoutes()
|
||||||
|
.find((r) => r.name && r.name.includes($props.toModule.name)).meta.icon;
|
||||||
|
}
|
||||||
if (isSameModuleName) {
|
if (isSameModuleName) {
|
||||||
return router.options.routes[1].children.find((r) => r.name === moduleName.value)
|
return router.options.routes[1].children.find((r) => r.name === moduleName.value)
|
||||||
?.meta?.icon;
|
?.meta?.icon;
|
||||||
|
@ -139,9 +148,10 @@ const iconModule = computed(() => {
|
||||||
|
|
||||||
const toModule = computed(() => {
|
const toModule = computed(() => {
|
||||||
moduleName.value = getName();
|
moduleName.value = getName();
|
||||||
|
if ($props.toModule) return $props.toModule;
|
||||||
if (isSameModuleName) {
|
if (isSameModuleName) {
|
||||||
return router.options.routes[1].children.find((r) => r.name === moduleName.value)
|
return router.options.routes[1].children.find((r) => r.name === moduleName.value)
|
||||||
?.children[0]?.redirect;
|
?.redirect;
|
||||||
} else {
|
} else {
|
||||||
return route.matched[1].path.split('/').length > 2
|
return route.matched[1].path.split('/').length > 2
|
||||||
? route.matched[1].redirect
|
? route.matched[1].redirect
|
||||||
|
|
|
@ -37,6 +37,7 @@ const removeRole = async () => {
|
||||||
:filter="{ where: { id: entityId } }"
|
:filter="{ where: { id: entityId } }"
|
||||||
data-key="Role"
|
data-key="Role"
|
||||||
:summary="$props.summary"
|
:summary="$props.summary"
|
||||||
|
:to-module="{ name: 'AccountRoles' }"
|
||||||
>
|
>
|
||||||
<template #menu>
|
<template #menu>
|
||||||
<QItem v-ripple clickable @click="removeRole()">
|
<QItem v-ripple clickable @click="removeRole()">
|
||||||
|
|
Loading…
Reference in New Issue