clean code
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
395eb6bed7
commit
aee3c67ee0
|
@ -196,13 +196,13 @@ async function save() {
|
||||||
|
|
||||||
if ($props.urlCreate) notify('globals.dataCreated', 'positive');
|
if ($props.urlCreate) notify('globals.dataCreated', 'positive');
|
||||||
|
|
||||||
hasChanges.value = false;
|
|
||||||
isLoading.value = false;
|
|
||||||
|
|
||||||
updateAndEmit(response?.data, 'onDataSaved');
|
updateAndEmit(response?.data, 'onDataSaved');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
notify('errors.writeRequest', 'negative');
|
notify('errors.writeRequest', 'negative');
|
||||||
|
} finally {
|
||||||
|
hasChanges.value = false;
|
||||||
|
isLoading.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -239,6 +239,7 @@ function updateAndEmit(val, evt) {
|
||||||
originalData.value = val && JSON.parse(JSON.stringify(val));
|
originalData.value = val && JSON.parse(JSON.stringify(val));
|
||||||
if (!$props.url) arrayData.store.data = val;
|
if (!$props.url) arrayData.store.data = val;
|
||||||
|
|
||||||
|
console.log('$props.model: ', $props.model);
|
||||||
emit(evt, state.get($props.model));
|
emit(evt, state.get($props.model));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,7 @@ const navigate = (event, id) => {
|
||||||
</QDrawer>
|
</QDrawer>
|
||||||
<QPage class="column items-center q-pa-md">
|
<QPage class="column items-center q-pa-md">
|
||||||
<div class="vn-card-list">
|
<div class="vn-card-list">
|
||||||
<VnPaginate data-key="RolesList" url="VnRoles" auto-load>
|
<VnPaginate data-key="RolesList" url="VnRoles">
|
||||||
<template #body="{ rows }">
|
<template #body="{ rows }">
|
||||||
<CardList
|
<CardList
|
||||||
:id="row.id"
|
:id="row.id"
|
||||||
|
|
|
@ -60,6 +60,7 @@ const redirectToRoleSummary = (id) =>
|
||||||
data-key="InheritedRoles"
|
data-key="InheritedRoles"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
:url="urlPath"
|
:url="urlPath"
|
||||||
|
:limit="0"
|
||||||
auto-load
|
auto-load
|
||||||
>
|
>
|
||||||
<template #body>
|
<template #body>
|
||||||
|
|
|
@ -8,14 +8,6 @@ import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
const defaultInitialData = {
|
|
||||||
name: null,
|
|
||||||
description: null,
|
|
||||||
};
|
|
||||||
|
|
||||||
const redirectToRoleBasicData = (_, { id }) =>
|
|
||||||
router.push({ name: 'RoleBasicData', params: { id } });
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FormModelPopup
|
<FormModelPopup
|
||||||
|
@ -23,8 +15,10 @@ const redirectToRoleBasicData = (_, { id }) =>
|
||||||
ref="formModelPopupRef"
|
ref="formModelPopupRef"
|
||||||
url-create="VnRoles"
|
url-create="VnRoles"
|
||||||
model="VnRole"
|
model="VnRole"
|
||||||
:form-initial-data="defaultInitialData"
|
:form-initial-data="{}"
|
||||||
@on-data-saved="redirectToRoleBasicData"
|
@on-data-saved="
|
||||||
|
(_, { id }) => router.push({ name: 'RoleBasicData', params: { id } })
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<template #form-inputs="{ data }">
|
<template #form-inputs="{ data }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
|
|
Loading…
Reference in New Issue