This commit is contained in:
Viet An
2026-05-20 15:48:05 +07:00
parent 087b05a0b8
commit a52c33706a
20 changed files with 86 additions and 106 deletions

View File

@@ -39,25 +39,13 @@ export default defineNuxtPlugin((nuxtApp) => {
$store.commit("showmodal", data);
};
const snackbar = function (content, title, type, width, height) {
content = typeof content == "string" ? content : JSON.stringify(content);
const vtitle =
type === "Success"
? `<span class="has-text-primary">${title}</span>`
: type === "Error"
? `<span class="has-text-danger">${title}</span>`
: title;
const data = {
id: $id(),
component: type || "Info",
vbind: { content },
title: vtitle,
width: width || "600px",
height: height || "100px",
};
$store.commit("snackbar", data);
const snackbar = function (content, component = "Info") {
$store.commit("snackbar", {
component,
vbind: {
content: typeof content == "string" ? content : JSON.stringify(content),
},
});
};
const getLink = function (val) {

View File

@@ -1227,8 +1227,8 @@ export default defineNuxtPlugin((nuxtApp) => {
}
if (notify !== false) {
$store.lang === "en"
? $snackbar("Data has been successfully saved to the system.", "Success", "Success")
: $snackbar("Dữ liệu đã được lưu vào hệ thống", "Thành công", "Success");
? $snackbar("Data has been successfully saved to the system.", "Success")
: $snackbar("Dữ liệu đã được lưu vào hệ thống", "Success");
}
return rs;
} catch (err) {
@@ -1264,8 +1264,8 @@ export default defineNuxtPlugin((nuxtApp) => {
}
if (notify !== false) {
$store.lang === "en"
? $snackbar("Data has been successfully saved to the system.", "Success", "Success")
: $snackbar("Dữ liệu đã được lưu vào hệ thống", "Thành công", "Success");
? $snackbar("Data has been successfully saved to the system.", "Success")
: $snackbar("Dữ liệu đã được lưu vào hệ thống", "Success");
}
return rs;
} catch (err) {
@@ -1289,8 +1289,8 @@ export default defineNuxtPlugin((nuxtApp) => {
if (notify !== false) {
$store.lang === "en"
? $snackbar("Data has been successfully saved to the system.", "Success", "Success")
: $snackbar("Dữ liệu đã được lưu vào hệ thống", "Thành công", "Success");
? $snackbar("Data has been successfully saved to the system.", "Success")
: $snackbar("Dữ liệu đã được lưu vào hệ thống", "Success");
}
return rs;
} catch (err) {