perbaikan dan sweetalert

This commit is contained in:
2025-06-08 15:12:02 +07:00
parent cabb052b21
commit 714eba34b7
6 changed files with 40 additions and 9 deletions

No files matched your search

+18 -4
View File
@@ -1,5 +1,6 @@
<script setup lang="ts">
import {useSettingStore} from "@/stores/api/setting/setting";
import { sweetalert } from "~/utils/helper";
const {getTypeUser, getMenu, postRoleUserMenu} = useSettingStore();
const {listMenu, listTypeUser, typeUser, roleMenuById,messages} = storeToRefs(useSettingStore());
@@ -8,6 +9,8 @@ const menuItem = ref<any>([]);
const type_user = ref<any>([]);
const dataDetail = ref(null)
const emit = defineEmits(['stateValue']);
const dataMenu = async () => {
await Promise.all([
getMenu(),
@@ -88,15 +91,19 @@ const onSubmit = async () => {
// console.log('Payload yang dikirim:', payload);
await postRoleUserMenu(payload);
// console.log(messages.value);
// if(messages.value.type==='success'){
// sweetalert(messages.value.title,'',messages.value.type);
// }
window.location.reload();
if(messages.value.type==='success'){
emit('stateValue', false)
sweetalert(messages.value.title,'',messages.value.type);
}else{
sweetalert(messages.value.title,'',messages.value.type);
}
// window.location.reload();
};
onMounted(async () => {
data.value = await dataMenu();
checkMenu()
// console.log("ini rrolemenu :",roleMenuById);
});
// Helper function to create checkbox config
@@ -199,3 +206,10 @@ const createMenuRow = (menu: any) => {
</Vueform>
</div>
</template>
<style>
.my-swal{
z-index:2147483647 !important;
}
</style>