Aurora Admin v1.2.0: 79 components x 5 ends, doc site, contracts batch 1, playground, regression, deploy ready
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Aurora Admin · NotificationPro(普通 H5)</title>
|
||||
<link rel="stylesheet" href="../.design_library/aurora-admin/colors_and_type.css" />
|
||||
<link rel="stylesheet" href="NotificationPro.css" />
|
||||
<style>body{margin:0;padding:24px;background:#F5F7FA;display:flex;gap:8px;flex-wrap:wrap;}</style>
|
||||
</head>
|
||||
<body>
|
||||
<button onclick="AaNotify.success('审批通过', '订单 ORD-2024 已通过主管审批')">success</button>
|
||||
<button onclick="AaNotify.error('提交失败', '网络异常,请稍后重试')">error</button>
|
||||
<button onclick="AaNotify.warning('存储空间不足', '当前已使用 92%')">warning</button>
|
||||
<button onclick="AaNotify.info('新版本', '系统已发布 v2.3.0')">info</button>
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
var ICON = { success: '✓', error: '✕', warning: '!', info: 'i' };
|
||||
var wrap = document.createElement('div');
|
||||
wrap.className = 'aa-notification-wrap';
|
||||
document.body.appendChild(wrap);
|
||||
var id = 0;
|
||||
function open(opts) {
|
||||
var el = document.createElement('div');
|
||||
el.className = 'aa-notification is-' + opts.type;
|
||||
el.innerHTML = '<span class="aa-notification-icon">' + (ICON[opts.type] || 'i') + '</span>' +
|
||||
'<div class="aa-notification-body"><div class="aa-notification-title">' + opts.title + '</div>' +
|
||||
'<div class="aa-notification-desc">' + opts.desc + '</div></div>' +
|
||||
'<span class="aa-notification-close">✕</span>';
|
||||
wrap.appendChild(el);
|
||||
var myId = ++id;
|
||||
function close() { if (el.parentNode) el.parentNode.removeChild(el); }
|
||||
el.querySelector('.aa-notification-close').addEventListener('click', close);
|
||||
var d = opts.duration == null ? 4500 : opts.duration;
|
||||
if (d > 0) setTimeout(close, d);
|
||||
return close;
|
||||
}
|
||||
window.AaNotify = {
|
||||
success: function (t, d, dur) { return open({ type: 'success', title: t, desc: d, duration: dur }); },
|
||||
error: function (t, d, dur) { return open({ type: 'error', title: t, desc: d, duration: dur }); },
|
||||
warning: function (t, d, dur) { return open({ type: 'warning', title: t, desc: d, duration: dur }); },
|
||||
info: function (t, d, dur) { return open({ type: 'info', title: t, desc: d, duration: dur }); },
|
||||
open: open
|
||||
};
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user