Files
DzzOffice/static/js/main.min.js
小胡 53be1fecb4 更新内容:
系统设置新增功能
1. 是否启用登录密码加密:
在许多现代系统中,登录密码加密是默认启用的,以确保用户密码的安全性。所以新增了一个系统配置项,允许管理员决定是否启用登录密码的加密传输。这一功能增强了用户密码的安全性,防止密码泄露风险。
2. UID登录(允许通过UID的方式登录验证):
引入UID(用户唯一标识符)登录方式,除了传统的用户名/邮箱/手机号登录外,用户还可以通过其UID进行登录验证,为系统访问提供另一种灵活的身份验证方式。
3. 用户在线时间更新时长:
管理员可以自定义更新用户在线时间的时间频率,这有助于更准确地反映用户的活跃状态,并对系统资源的使用进行优化。
4. 图片处理库类型:
系统新增了图片处理库类型的选择功能,允许管理员根据实际需求选择合适的图像处理库来处理缩略图和水印,以满足不同的性能和效果需求。
新增性能优化栏
1. 禁止浏览器缓冲:
通过此设置,管理员可以控制是否禁止浏览器对页面内容进行缓存。在某些场景下,禁用缓存可以提高页面的实时性和准确性。
2. 在线保持时间:
设置用户会话(session)的在线保持时间,即用户在不进行任何操作后,多久后会被视为离线。这有助于管理系统的会话资源,避免资源浪费。
3. 关闭session机制:   提供选项关闭系统的session管理机制。在某些特殊应用场景下,可能不需要使用session来跟踪用户状态,关闭session可以减少服务器负担,提高性能。
系统工具新增文件权限检查栏:    系统工具中新增了文件权限检查功能,帮助管理员快速识别和修复文件权限问题,确保系统的正常运行和数据安全。
优化提示消息框UI:
对系统的提示消息框进行了UI优化,使其更加美观、易用,提升了用户的使用体验。
压缩css、js代码优化前端性能
对前端的CSS和JS代码进行了压缩处理,减少了文件体积,加快了加载速度,从而提升了前端性能。
2024-07-21 18:38:53 +08:00

1 line
5.4 KiB
JavaScript

$(document).ready(function(){$("button:submit,input:submit, .nav-link, .btn,a").click(function(){$(this).attr("disable","true");var e=$(this).lyearloading({opacity:.2,spinnerSize:"nm"});e.addClass("disabled"),setTimeout(function(){$(this).prop("disable","false"),e.destroy(),e.removeClass("disabled")},1e3)}),$("body").on("click","[data-stopPropagation]",function(e){e.stopPropagation()}),$(document).on("click",".lyear-mask-modal",function(){$(this).remove(),$(".lyear-layout-sidebar").toggleClass("lyear-aside-open"),$("body").toggleClass("lyear-layout-sidebar-close")}),$('[data-bs-toggle="tooltip"]')[0]&&$('[data-bs-toggle="tooltip"]').tooltip({container:"body"}),$('[data-bs-toggle="popover"]')[0]&&$('[data-bs-toggle="popover"]').popover({container:"body"}),$(document).on("click",".card-btn-fullscreen",function(){$(this).closest(".card").toggleClass("card-fullscreen")}),$(document).on("click",".card-btn-slide",function(){$(this).toggleClass("rotate-180").closest(".card").find(".card-body").slideToggle()}),$(document).on("click",".card-btn-reload",function(e){e.preventDefault();var t=$(this).attr("href"),o=$(this).closest(".card");if(!("#"==t|"#!"==t)){var a=o.lyearloading({opacity:.1,spinnerSize:"nm"});o.find(".card-body").load(t,function(){a.destroy()})}}),$(document).on("click",".card-btn-close",function(){$(this).closest(".card").fadeOut(600,function(){1==$(this).parent().children().length?$(this).parent().remove():$(this).remove()})}),$(".lyear-scroll")[0]&&$(".lyear-scroll").each(function(){new PerfectScrollbar(this,{swipeEasing:!1,suppressScrollX:!0})}),jQuery(".js-colorpicker").each(function(){var e=jQuery(this);e.colorpicker({format:e.data("colorpicker-mode")?e.data("colorpicker-mode"):"auto",horizontal:!!e.data("colorpicker-horizontal")&&e.data("colorpicker-horizontal")})}),jQuery("[data-provide = 'datepicker']").each(function(){var e={language:"zh-CN",multidateSeparator:", "};e=$.extend(e,getDataOptions($(this))),"INPUT"!=$(this).prop("tagName")&&(e.inputs=[$(this).find("input:first"),$(this).find("input:last")]),$(this).datepicker(e)}),jQuery("[data-provide = 'datetimepicker']").each(function(){var e={locale:moment.locale()};e=$.extend(e,getDataOptions($(this))),"INPUT"!=$(this).prop("tagName")&&(e.inputs=[$(this).find("input:first"),$(this).find("input:last")]),console.log(e),$(this).datetimepicker(e)}),$(".js-tags-input").each(function(){var e=$(this);e.tagsInput({height:e.data("height")?e.data("height"):"100%",width:"100%",defaultText:e.attr("placeholder"),removeWithBackspace:!0,delimiter:[","]})}),$(document).on("change","#check-all",function(){($boxname=$(this).data("name"))?$(this).closest("table").find("input[name='"+$boxname+"']").prop("checked",$(this).prop("checked")):$(this).closest("table").find(".form-check input[type='checkbox']").prop("checked",$(this).prop("checked"))}),showNotify=function(e,t,o,a,i,n,r){t=t||"info",o=o||1e3,i=i||"top",n=n||"right",$enter="danger"==t?"animate__animated animate__shakeX":"animate__animated animate__fadeInUp",r=r||"",jQuery.notify({icon:a,message:e},{element:"body",type:t,allow_dismiss:!0,newest_on_top:!0,showProgressbar:!1,placement:{from:i,align:n},offset:20,spacing:10,z_index:10800,delay:o,animate:{enter:$enter,exit:"animate__animated animate__fadeOutDown"}}),""!=r&&setTimeout(function(){window.location.href=r},o)}}),getDataOptions=function(e,t){var o={};return $.each($(e).data(),function(e,t){"provide"!=(e=dataToOption(e))&&(o[e]=t)}),o},dataToOption=function(e){return e.replace(/-([a-z])/g,function(e){return e[1].toUpperCase()})},function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(jQuery)}(function(e){function t(e){return n.raw?e:encodeURIComponent(e)}function o(e){return n.raw?e:decodeURIComponent(e)}function a(t,o){var a=n.raw?t:function(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e=decodeURIComponent(e.replace(i," ")),n.json?JSON.parse(e):e}catch(e){}}(t);return e.isFunction(o)?o(a):a}var i=/\+/g,n=e.cookie=function(i,r,c){if(void 0!==r&&!e.isFunction(r)){if("number"==typeof(c=e.extend({},n.defaults,c)).expires){var s=c.expires,d=c.expires=new Date;d.setTime(+d+864e5*s)}return document.cookie=[t(i),"=",function(e){return t(n.json?JSON.stringify(e):String(e))}(r),c.expires?"; expires="+c.expires.toUTCString():"",c.path?"; path="+c.path:"",c.domain?"; domain="+c.domain:"",c.secure?"; secure":""].join("")}for(var l=i?void 0:{},p=document.cookie?document.cookie.split("; "):[],u=0,h=p.length;h>u;u++){var f=p[u].split("="),m=o(f.shift()),$=f.join("=");if(i&&i===m){l=a($,r);break}i||void 0===($=a($))||(l[m]=$)}return l};n.defaults={},e.removeCookie=function(t,o){return void 0!==e.cookie(t)&&(e.cookie(t,"",e.extend({},o,{expires:-1})),!e.cookie(t))}}),$(document).ready(function(){var e=$.cookie("the_header_bg"),t=$.cookie("the_sidebar_bg"),o=$.cookie("the_site_theme");e&&$("body").attr("data-headerbg",e),t&&$("body").attr("data-sidebarbg",t),o&&$("body").attr("data-theme",o),$(".dropdown-skin :radio").each(function(){var a=$(this);switch(a.attr("name")){case"site_theme":a.val()==o&&a.prop("checked",!0);break;case"header_bg":a.val()==e&&a.prop("checked",!0);break;case"sidebar_bg":a.val()==t&&a.prop("checked",!0)}}),setTheme=function(e,t){$("input[name='"+e+"']").click(function(){var o=$(this).val();$("body").attr(t,o),$.cookie("the_"+e,o)})},setTheme("site_theme","data-theme"),setTheme("sidebar_bg","data-sidebarbg"),setTheme("header_bg","data-headerbg")});