This commit is contained in:
2024-05-11 10:11:24 +07:00
parent cea5665f51
commit 90e1a88461
3 changed files with 53 additions and 40 deletions

View File

@@ -1,43 +1,43 @@
"use strict";
const AdminFunction = (() => {
function e(e, t, n) {
let o = null;
return function (...a) {
const i = this,
r = function () {
o = null, !n && e.apply(i, a)
function capNhatTrangThaiMenu(e) {
!1 === e ? $("#js-admin-content-container").addClass("show-large-menu") : $("#js-admin-content-container").removeClass("show-large-menu"), $("#js-menu-big").toggleClass("hidden", e), $("#js-menu-small").toggleClass("hidden", !e), $("#js-form-search").toggleClass("menu-hide", e), localStorage.setItem(e ? "menu_big" : "menu_small", "hidden"), localStorage.removeItem(e ? "menu_small" : "menu_big");
}
function e(e) {
let t = null;
return function (...n) {
const o = this, a = function () {
t = null, n.length > 0 && !e && func.apply(o, n);
}, i = e && !t;
clearTimeout(t), t = setTimeout(a, wait), i && func.apply(o, n);
};
const c = n && !o;
clearTimeout(o), o = setTimeout(r, t), c && e.apply(i, a)
}
function t(t) {
$("#status_" + t).html('<span class="loading loading-bars loading-sm"></span><span class="ml-[3px]">Đang xử lý..</span>'), setTimeout(() => {
$("#status_" + t).html("");
}, 1e3);
}
function t(e) {
$("#js-admin-content-container").toggleClass("show-large-menu", !e), $("#js-menu-big").toggleClass("hidden", e), $("#js-menu-small").toggleClass("hidden", !e), $("#js-form-search").toggleClass("menu-hide", e), localStorage.setItem(e ? "menu_big" : "menu_small", "hidden"), localStorage.removeItem(e ? "menu_small" : "menu_big")
function n(e) {
$(e).keyup((() => {
$("#js-show-search").show();
}));
$("body").click((() => {
$("#js-show-search").hide();
}));
}
return {
capNhatTrangThaiMenu: t,
add_product_to_category: function (e) {
$("#status_" + e).html('<span class="loading loading-bars loading-sm"></span><span class="ml-[3px]">Đang xử lý..</span>'), setTimeout(() => {
$("#status_" + e).html("")
}, 1e3)
},
run_search: function (e) {
$(e).keyup(e => {
! function (e) {
$("#js-show-search").show()
}(e.target)
}), $("body").click(() => {
$("#js-show-search").hide()
})
},
update_product_hot: function (e) {
function o(e) {
$("#js-status-hottype-" + e).html('<span class="loading loading-bars loading-sm"></span><span class="ml-[3px]">Đang xử lý..</span>'), setTimeout(() => {
$("#js-status-hottype-" + e).html("")
}, 1e3)
},
searchSelect: function (e) {
$(e).select2()
$("#js-status-hottype-" + e).html("");
}, 1e3);
}
function a(e) {
$(e).select2();
}
function i(e) {
$("#overlay").addClass("active"), $(".status-notificatiom").addClass("active"), !0 === e ? $(".status-notificatiom .content").html('<i class="fa fa-check"></i> <b>Cập nhật thành công</b>\n <p>Đơn hàng #000-368 đã được cập nhật thành công</p>') : $(".status-notificatiom .content").html('<i class="fa-solid fa-triangle-exclamation"></i> <b>Lỗi cập nhật</b><p>Có một số vấn đề với hoạt động của bạn.</p>');
}
function r() {
$("#overlay").removeClass("active"), $(".status-notificatiom").removeClass("active");
}
return { capNhatTrangThaiMenu: capNhatTrangThaiMenu, add_product_to_category: t, run_search: n, update_product_hot: o, searchSelect: a, checkForm: i, closeForm: r };
})();

View File

@@ -305,6 +305,6 @@
</div>
<div class="bg-white p-[15px] border-[#FAFAFB] rounded-[0_0_10px_10px] shadow-[0_1px_1px_0px_#0000001A]">
<input class="w-[82px] h-[32px] bg-[#0041E8] rounded-[4px] text-white cursor-pointer" id="submit-collection-btn"
name="commit" type="submit" value="Cập nhật" />
name="commit" type="button" value="Cập nhật" onclick="AdminFunction.checkForm(true)" />
</div>
</form>

View File

@@ -28,7 +28,7 @@
<body>
<div id="overlay"></div>
<div class="admin-global-container">
@@ -297,13 +297,26 @@
<!-- Content -->
{{ page_content }}
</div>
</div>
<div class="status-notificatiom">
<a href="javascript:void(0)" class="icon-close" onclick="AdminFunction.closeForm()"><i
class="fa fa-times"></i></a>
<div class="content flex flex-col items-center justify-center">
<i class="fa fa-check"></i>
<b>Cập nhật thành công</b>
<p>Đơn hàng #000-368 đã được cập nhật thành công</p>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/flowbite/2.3.0/datepicker.min.js"></script>
<script src="{{ 'global.js' | asset_url }}"></script>
<script src="{{ 'global.js' | asset_url }}?v=1"></script>
<!-- <script src="../dist/index.js"></script> -->
{% include javascript/index %}