From 3f3975c56ccaa18b3c3a79afa33ec0e1bffa3b20 Mon Sep 17 00:00:00 2001 From: Stranger Date: Tue, 4 Apr 2023 02:54:53 +0000 Subject: [PATCH 1/5] update templates/system/user/user.html. Signed-off-by: Stranger --- templates/system/user/user.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/system/user/user.html b/templates/system/user/user.html index eebdb89..3b8822a 100644 --- a/templates/system/user/user.html +++ b/templates/system/user/user.html @@ -154,7 +154,8 @@ type: 2, title: '新增', shade: 0.1, - area: ['60%', '80%'], + area: size < 2 ? ['90%', '55%'] : ['70%', '80%'], + offset: 'auto', content: MODULE_PATH + 'add', }); }; @@ -164,7 +165,8 @@ type: 2, title: '修改', shade: 0.1, - area: ['60%', '80%'], + area: size < 2 ? ['90%', '55%'] : ['70%', '80%'], + offset: 'auto', content: MODULE_PATH + 'edit' + `?uid=${obj.data.id}`, }); }; -- Gitee From d5bceabf0dfed0d25c9d3fec1e805c69696f204c Mon Sep 17 00:00:00 2001 From: Stranger Date: Tue, 4 Apr 2023 02:56:10 +0000 Subject: [PATCH 2/5] =?UTF-8?q?=E7=AA=97=E5=8F=A3=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stranger --- templates/system/role/role.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/templates/system/role/role.html b/templates/system/role/role.html index 8b8a752..11abffa 100644 --- a/templates/system/role/role.html +++ b/templates/system/role/role.html @@ -130,7 +130,8 @@ type: 2, title: '新增', shade: 0.1, - area: ['500px', '400px'], + area: size < 2 ? ['90%', '55%'] : ['70%', '80%'], + offset: 'auto', content: MODULE_PATH + 'add', }); }; @@ -140,7 +141,8 @@ type: 2, title: '授权', shade: 0.1, - area: ['800px', '500px'], + area: size < 2 ? ['90%', '55%'] : ['70%', '80%'], + offset: 'auto', content: MODULE_PATH + `permission/${obj.data['id']}`, }); }; @@ -150,7 +152,8 @@ type: 2, title: '修改', shade: 0.1, - area: ['500px', '400px'], + area: size < 2 ? ['90%', '55%'] : ['70%', '80%'], + offset: 'auto', content: MODULE_PATH + `edit/${obj.data.id}`, }); }; -- Gitee From ae627ca539636ebc6292f4bd8c7b295d3c27afce Mon Sep 17 00:00:00 2001 From: Stranger Date: Tue, 4 Apr 2023 02:56:44 +0000 Subject: [PATCH 3/5] =?UTF-8?q?=E7=AA=97=E5=8F=A3=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stranger --- templates/system/permission/permission.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/system/permission/permission.html b/templates/system/permission/permission.html index 0ebde0d..f7b3a9f 100644 --- a/templates/system/permission/permission.html +++ b/templates/system/permission/permission.html @@ -190,7 +190,8 @@ type: 2, title: '新增', shade: 0.1, - area: ['50%', '80%'], + area: size < 2 ? ['90%', '60%'] : ['70%', '80%'], + offset: 'auto', content: '/permission/add', }); }; @@ -200,7 +201,8 @@ type: 2, title: '修改', shade: 0.1, - area: ['50%', '80%'], + area: size < 2 ? ['90%', '60%'] : ['70%', '80%'], + offset: 'auto', content: `/permission/edit/${obj.data.id}`, }); }; -- Gitee From 7de5e4dc80bcf1c0e65c3e5fa853f60191f5e855 Mon Sep 17 00:00:00 2001 From: Stranger Date: Tue, 4 Apr 2023 02:57:07 +0000 Subject: [PATCH 4/5] =?UTF-8?q?=E5=BC=B9=E7=AA=97=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stranger --- templates/system/department/department.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/system/department/department.html b/templates/system/department/department.html index c44e011..ac412e7 100644 --- a/templates/system/department/department.html +++ b/templates/system/department/department.html @@ -136,7 +136,8 @@ type: 2, title: '新增', shade: 0.1, - area: ['50%', '80%'], + area: size < 2 ? ['90%', '55%'] : ['70%', '80%'], + offset: 'auto', content: '/department/add', }); }; @@ -201,7 +202,8 @@ type: 2, title: '修改', shade: 0.1, - area: ['450px', '500px'], + area: size < 2 ? ['90%', '55%'] : ['70%', '80%'], + offset: 'auto', content: `/department/edit?did=` + obj.data.id, /*编辑修改窗口从那里来*/ }); }; -- Gitee From db202b2461747a9b28232933b0272df282ccb66e Mon Sep 17 00:00:00 2001 From: Stranger Date: Tue, 4 Apr 2023 02:58:21 +0000 Subject: [PATCH 5/5] =?UTF-8?q?=E5=BC=B9=E7=AA=97=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stranger --- static/js/pear_admin_flask.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/static/js/pear_admin_flask.js b/static/js/pear_admin_flask.js index 6f525bb..eb102a9 100644 --- a/static/js/pear_admin_flask.js +++ b/static/js/pear_admin_flask.js @@ -12,6 +12,23 @@ function generateUUID() { return uuid; } +//layui弹出框适应 +var size=9; +function screen() { + //获取当前窗口的宽度 + var width = window.innerWidth; + if (width > 1200) { + return size=3; //大屏幕 + } else if (width > 992) { + return size=2; //中屏幕 + } else if (width > 768) { + return size=1; //小屏幕 + } else { + return size=0; //超小屏幕 + } +} +screen(); + function formatDate(value) {//调用时间戳为日期显示 let date = new Date(value); let y = date.getFullYear(); //获取年份 -- Gitee