/* * @Author: 李佐宁 * @Description: * @Date: 2022-10-31 10:54:23 * @LastEditTime: 2023-03-21 15:16:02 * @LastEditors: 李佐宁 */ import { ElNotification } from "element-plus"; export const yaNotification = ( title, type, hasClose, dangerouslyUseHTMLString = false, message ) => { return ElNotification({ title, type, duration: hasClose ? 4500 : 0, offset: 20, appendTo: document.body, dangerouslyUseHTMLString: dangerouslyUseHTMLString, message, customClass: "ya-notify", }); }; export const changePasswordNotification = (fn) => { const _html = `
您的密码30天内未修改。为了您的安全,建议您
修改密码
`; const message = _html; const notify = yaNotification( "密码修改提示", "warning", false, true, message ); const notifyDom = document.querySelector(".ya-notify"); setTimeout(() => { notifyDom ?.querySelector(".change-pwd-text")! .addEventListener("click", (event) => { event.stopPropagation(); fn(notify); }); notifyDom?.querySelector(".confirm-btn")!.addEventListener("click", () => { notify.close(); }); console.log(notify, "notify"); }, 0); console.log(notify, "notify"); };