【升级】layui升级到2.8.0版本,layuiadmin升级到1.9.0版本。
@@ -552,29 +552,6 @@
|
||||
<None Include="wwwroot\lib\custom\js\sortable.min.js" />
|
||||
<None Include="wwwroot\lib\custom\js\vue.min.js" />
|
||||
<None Include="wwwroot\lib\custom\js\vuedraggable.min.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\config.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\controller\breadcrumb.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\controller\common.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\controller\contextMenu.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\controller\contlist.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\controller\coredropdown.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\controller\Cropper.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\controller\iconPicker.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\controller\tableX.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\controller\treeTable.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\controller\xmSelect.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\controller\zTree.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\index.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\lib\admin.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\lib\extend\coreHelper.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\lib\extend\dltable.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\lib\extend\dtree.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\lib\extend\echarts.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\lib\extend\echartsTheme.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\lib\extend\treeGrid.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\lib\view.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\style\dtree\dtree.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\style\dtree\font\dtreefont.svg" />
|
||||
<None Include="wwwroot\lib\jquery\doT.min.js" />
|
||||
<None Include="wwwroot\lib\jquery\jquery-2.1.4.js" />
|
||||
<None Include="wwwroot\lib\jquery\jquery-2.1.4.min.js" />
|
||||
@@ -591,10 +568,50 @@
|
||||
<None Include="wwwroot\lib\jquery\jquery.validate.unobtrusive.js" />
|
||||
<None Include="wwwroot\lib\jquery\jquery.validate.unobtrusive.min.js" />
|
||||
<None Include="wwwroot\lib\jquery\lazyloadv3.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\style\res\logo.psd" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\style\res\noImage.psd" />
|
||||
<None Include="wwwroot\lib\layui\font\iconfont.svg" />
|
||||
<None Include="wwwroot\lib\layui\font\iconfont.woff2" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\adminui\dist\modules\admin.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\adminui\dist\modules\index.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\adminui\dist\modules\view.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\adminui\src\modules\admin.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\adminui\src\modules\index.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\adminui\src\modules\view.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\config.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\index.es5.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\index.es5.min.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\index.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\layui\font\iconfont.svg" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\layui\font\iconfont.woff2" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\layui\layui.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\modules\breadcrumb.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\modules\common.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\modules\console.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\modules\contextMenu.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\modules\contlist.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\modules\coredropdown.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\modules\coreHelper.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\modules\Cropper.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\modules\CropperImg.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\modules\dltable.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\modules\dtree.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\modules\echarts.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\modules\echartsTheme.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\modules\forum.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\modules\iconPicker.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\modules\layim\layim.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\modules\sample.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\modules\senior.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\modules\set.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\modules\tableX.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\modules\treeGrid.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\modules\treeTable.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\modules\user.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\modules\useradmin.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\modules\workorder.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\modules\xmSelect.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\modules\zTree.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\style\dtree\dtree.js" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\style\dtree\font\dtreefont.svg" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\style\imgs\logo.psd" />
|
||||
<None Include="wwwroot\lib\layuiAdmin\style\imgs\noImage.psd" />
|
||||
<None Include="wwwroot\static\css\documentEditor.less" />
|
||||
<None Include="wwwroot\static\css\overWrite.less" />
|
||||
<None Include="wwwroot\static\js\common.js" />
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="shortcut icon" href="static/images/common/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" href="/lib/layui/css/layui.css" media="all">
|
||||
<link href="/lib/layuiAdmin/layui/css/layui.css" rel="stylesheet" />
|
||||
<link href="/lib/layuiAdmin/style/dtree/dtree.css" rel="stylesheet" />
|
||||
<link href="/lib/layuiAdmin/style/dtree/font/dtreefont.css" rel="stylesheet" />
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<div id="LAY_app"></div>
|
||||
<script src="/lib/layui/layui.js"></script>
|
||||
<script src="/lib/layuiAdmin/layui/layui.js"></script>
|
||||
<script>
|
||||
var editor;
|
||||
layui.config({
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #eee;border-left-width:6px;background-color:#FAFAFA;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:40px;line-height:40px;border-bottom:1px solid #eee}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 10px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view .layui-code-ol li:first-child{padding-top:10px}.layui-code-view .layui-code-ol li:last-child{padding-bottom:10px}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none}.layui-code-demo .layui-code{visibility:visible!important;margin:-15px;border-top:none;border-right:none;border-bottom:none}.layui-code-demo .layui-tab-content{padding:15px;border-top:none}
|
||||
1
CoreCms.Net.Web.Admin/wwwroot/lib/layuiAdmin/adminui/dist/css/admin.css
vendored
Normal file
1
CoreCms.Net.Web.Admin/wwwroot/lib/layuiAdmin/adminui/dist/css/login.css
vendored
Normal file
@@ -0,0 +1 @@
|
||||
#LAY_app,body,html{height:100%}.layui-layout-body{overflow:auto}#LAY-user-login,.layadmin-user-display-show{display:block!important}.layadmin-user-login{position:relative;left:0;top:0;padding:110px 0;min-height:100%;box-sizing:border-box}.layadmin-user-login-main{width:375px;margin:0 auto;box-sizing:border-box}.layadmin-user-login-box{padding:20px}.layadmin-user-login-header{text-align:center}.layadmin-user-login-header h2{margin-bottom:10px;font-weight:300;font-size:30px;color:#000}.layadmin-user-login-header p{font-weight:300;color:#999}.layadmin-user-login-body .layui-form-item{position:relative}.layadmin-user-login-icon{position:absolute;left:1px;top:1px;width:38px;line-height:36px;text-align:center;color:#d2d2d2}.layadmin-user-login-body .layui-form-item .layui-input{padding-left:38px}.layadmin-user-login-codeimg{max-height:38px;width:100%;cursor:pointer;box-sizing:border-box}.layadmin-user-login-other{position:relative;font-size:0;line-height:38px;padding-top:20px}.layadmin-user-login-other>*{display:inline-block;vertical-align:middle;margin-right:10px;font-size:14px}.layadmin-user-login-other .layui-icon{position:relative;top:2px;font-size:26px}.layadmin-user-login-other a:hover{opacity:.8}.layadmin-user-jump-change{float:right}.layadmin-user-login-footer{position:absolute;left:0;bottom:0;width:100%;line-height:30px;padding:20px;text-align:center;box-sizing:border-box;color:rgba(0,0,0,.5)}.layadmin-user-login-footer span{padding:0 5px}.layadmin-user-login-footer a{padding:0 5px;color:rgba(0,0,0,.5)}.layadmin-user-login-footer a:hover{color:#000}.layadmin-user-login-main[bgimg]{background-color:#fff;box-shadow:0 0 5px rgba(0,0,0,.05)}.ladmin-user-login-theme{position:fixed;bottom:0;left:0;width:100%;text-align:center}.ladmin-user-login-theme ul{display:inline-block;padding:5px;background-color:#fff}.ladmin-user-login-theme ul li{display:inline-block;vertical-align:top;width:64px;height:43px;cursor:pointer;transition:all .3s;-webkit-transition:all .3s;background-color:#f2f2f2}.ladmin-user-login-theme ul li:hover{opacity:.9}@media screen and (max-width:768px){.layadmin-user-login{padding-top:60px}.layadmin-user-login-main{width:300px}.layadmin-user-login-box{padding:10px}}
|
||||
1
CoreCms.Net.Web.Admin/wwwroot/lib/layuiAdmin/adminui/dist/modules/admin.js
vendored
Normal file
1
CoreCms.Net.Web.Admin/wwwroot/lib/layuiAdmin/adminui/dist/modules/index.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/** The Web UI Theme-v1.9.0 */;layui.define(['admin', "breadcrumb"],function(e){function a(e){var n,a=layui.router(),i=u(l.container),t=r.correctRouter(a.path.join("/"));if(layui.each(l.indPage,function(e,a){if(t===a)return n=!0}),layui.config({base:l.paths.base+"modules/"}),n||"/user/login"===t)i.render(a.path.join("/")).done(function(){r.pageType="alone"});else{if(l.interceptor)if(!layui.data(l.tableName)[l.request.tokenName])return location.hash="/user/login/redirect="+encodeURIComponent(t);"console"===r.pageType?c():i.render("layout").done(function(){c(),layui.element.render(),r.screen()<2&&r.sideFlexible(),r.pageType="console"})}}var l=layui.setter,o=layui.element,r=layui.admin,s=r.tabsPage,u=layui.view,c=function(){function e(e){c.haveInit&&h(".layui-layer").each(function(){var e=h(this),a=e.attr("times");e.hasClass("layui-layim")||e.hasClass("layui-layim-chat")||layer.close(a)}),c.haveInit=!0,h(d).scrollTop(0),delete s.type}var i=layui.router(),a=i.path,t=r.correctRouter(i.path.join("/"));""===(a=a.length?a:[""])[a.length-1]&&(a[a.length-1]=l.entry);if("tab"===s.type&&("/"!==t||"/"===t&&r.tabsBody().html()))return r.tabsBodyChange(s.index),e(s.type);u().render(a.join("/")).then(function(e){var a,n=h("#LAY_app_tabsheader>li");n.each(function(e){h(this).attr("lay-id")===t&&(a=!0,s.index=e)}),l.pageTabs&&"/"!==t&&!a&&(h(d).append('<div class="layadmin-tabsbody-item layui-show"></div>'),s.index=n.length,o.tabAdd(y,{title:"<span>"+(e.title||"\u65b0\u6807\u7b7e\u9875")+"</span>",id:t,attr:i.href})),this.container=r.tabsBody(s.index),l.pageTabs||this.container.scrollTop(0),o.tabChange(y,t),r.tabsBodyChange(s.index)}).done(function(){layui.use("common",layui.cache.callback.common),n.on("resize",layui.data.resize),o.render("breadcrumb","breadcrumb"),r.tabsBody(s.index).on("scroll",function(){var e=h(this),a=h(".layui-laydate"),n=h(".layui-layer")[0];a[0]&&(a.each(function(){var e=h(this);e.hasClass("layui-laydate-static")||e.remove()}),e.find("input").blur()),n&&layer.closeAll("tips")})}),e()},d="#LAY_app_body",y="layadmin-layout-tabs",h=layui.$,n=h(window),i=(layui.link(l.paths.core+"css/admin.css?v="+r.v,function(){a()},"layuiAdmin"),window.onhashchange=function(){a(),layui.event.call(this,l.MOD_NAME,"hash({*})",layui.router())},{render:c});h.extend(r,i),e("adminIndex",i)});
|
||||
1
CoreCms.Net.Web.Admin/wwwroot/lib/layuiAdmin/adminui/dist/modules/view.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/** The Web UI Theme-v1.9.0 */;layui.define(["laytpl","layer"],function(e){function u(e){return new t(e)}function t(e){this.id=e,this.container=c("#"+(e||a))}var c=layui.jquery,p=layui.laytpl,r=layui.layer,s=layui.setter,y=(layui.device(),layui.hint()),a="LAY_app_body";u.loading=function(e){e.append(this.elemLoad=c('<i class="layui-anim layui-anim-rotate layui-anim-loop layui-icon layui-icon-loading layadmin-loading"></i>'))},u.removeLoad=function(){this.elemLoad&&this.elemLoad.remove()},u.exit=function(){layui.data(s.tableName,{key:s.request.tokenName,remove:!0}),location.hash="/user/login"},u.req=function(a){function n(){return s.debug?"<br><cite>URL\uff1a</cite>"+a.url:""}var e,r=a.success,o=a.error,t=s.request,i=s.response;return a.data=a.data||{},a.headers=a.headers||{},t.tokenName&&(e="string"==typeof a.data?JSON.parse(a.data):a.data,a.data[t.tokenName]=t.tokenName in e?a.data[t.tokenName]:layui.data(s.tableName)[t.tokenName]||"",a.headers[t.tokenName]=t.tokenName in a.headers?a.headers[t.tokenName]:layui.data(s.tableName)[t.tokenName]||""),delete a.success,delete a.error,c.ajax(c.extend({type:"get",dataType:"json",success:function(e){var t=i.statusCode;e[i.statusName]==t.ok?"function"==typeof a.done&&a.done(e):e[i.statusName]==t.logout?u.exit():(t=["<cite>Error\uff1a</cite> "+(e[i.msgName]||"\u8fd4\u56de\u72b6\u6001\u7801\u5f02\u5e38"),n()].join(""),u.error(t)),"function"==typeof r&&r(e)},error:function(e,t){var a=["\u8bf7\u6c42\u5f02\u5e38\uff0c\u8bf7\u91cd\u8bd5<br><cite>\u9519\u8bef\u4fe1\u606f\uff1a</cite>"+t,n()].join("");u.error(a),"function"==typeof o&&o.apply(this,arguments)}},a))},u.popup=function(e){var n=e.success,t=e.skin;return delete e.success,delete e.skin,r.open(c.extend({type:1,title:"\u63d0\u793a",content:"",id:"LAY-system-view-popup",skin:"layui-layer-admin"+(t?" "+t:""),shadeClose:!0,closeBtn:!1,success:function(e,t){var a=c('<i class="layui-icon" close>ဆ</i>');e.append(a),a.on("click",function(){r.close(t)}),"function"==typeof n&&n.apply(this,arguments)}},e))},u.error=function(e,t){return u.popup(c.extend({content:e,maxWidth:300,offset:"t",anim:6,id:"LAY_adminError"},t))},t.prototype.render=function(e,n){var r=this;layui.router();return e=(s.paths&&s.paths.views?s.paths:s).views+e+s.engine,c("#"+a).children(".layadmin-loading").remove(),u.loading(r.container),c.ajax({url:e,type:"get",dataType:"html",data:{v:layui.cache.version},success:function(e){var t=c(e="<div>"+e+"</div>").find("title"),a={title:t.text()||(e.match(/\<title\>([\s\S]*)\<\/title>/)||[])[1],body:e};t.remove(),r.params=n||{},r.then&&(r.then(a),delete r.then),r.parse(e),u.removeLoad(),r.done&&(r.done(a),delete r.done)},error:function(e){if(u.removeLoad(),r.render.isError)return u.error("\u8bf7\u6c42\u89c6\u56fe\u6587\u4ef6\u5f02\u5e38\uff0c\u72b6\u6001\uff1a"+e.status);404===e.status?r.render("template/tips/404"):r.render("template/tips/error"),r.render.isError=!0}}),r},t.prototype.parse=function(e,t,n){function o(t){var e=p(t.dataElem.html()),a=c.extend({params:d.params},t.res);t.dataElem.after(e.render(a)),"function"==typeof n&&n();try{t.done&&new Function("d",t.done)(a)}catch(e){console.error(t.dataElem[0],"\n\u5b58\u5728\u9519\u8bef\u56de\u8c03\u811a\u672c\n\n",e)}}var a=this,r="object"==typeof e,i=r?e:c(e),s=r?e:i.find("*[template]"),d=layui.router();i.find("title").remove(),a.container[t?"after":"html"](i.children()),d.params=a.params||{};for(var l=s.length;0<l;l--)!function(){var t=s.eq(l-1),a=t.attr("lay-done")||t.attr("lay-then"),e=p(t.attr("lay-url")||"").render(d),n=p(t.attr("lay-data")||"").render(d),r=p(t.attr("lay-headers")||"").render(d);try{n=new Function("return "+n+";")()}catch(e){y.error("lay-data: "+e.message),n={}}try{r=new Function("return "+r+";")()}catch(e){y.error("lay-headers: "+e.message),r=r||{}}e?u.req({type:t.attr("lay-type")||"get",url:e,data:n,dataType:"json",headers:r,success:function(e){o({dataElem:t,res:e,done:a})}}):o({dataElem:t,done:a})}();return a},t.prototype.send=function(e,t){e=p(e||this.container.html()).render(t||{});return this.container.html(e),this},t.prototype.refresh=function(e){var t=this,a=t.container.next().attr("lay-templateid");return t.id!=a||t.parse(t.container,"refresh",function(){t.container.siblings('[lay-templateid="'+t.id+'"]:last').remove(),"function"==typeof e&&e()}),t},t.prototype.then=function(e){return this.then=e,this},t.prototype.done=function(e){return this.done=e,this},e("view",u)});
|
||||
@@ -0,0 +1,521 @@
|
||||
/**
|
||||
* admin.css
|
||||
*/
|
||||
|
||||
html #layuicss-layuiAdmin{display: none; position: absolute; width: 1989px;}
|
||||
|
||||
|
||||
/* 系统 */
|
||||
::-webkit-input-placeholder{color: #ccc}
|
||||
|
||||
/** 滚动条 **/
|
||||
/*
|
||||
::-webkit-scrollbar{width: 10px; height: 10px;}
|
||||
::-webkit-scrollbar-button:vertical{display: none;}
|
||||
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner{background-color: #e2e2e2;}
|
||||
::-webkit-scrollbar-thumb{border-radius: 0; background-color: rgba(0,0,0,.3);}
|
||||
::-webkit-scrollbar-thumb:vertical:hover{background-color: rgba(0,0,0,.35);}
|
||||
::-webkit-scrollbar-thumb:vertical:active{background-color: rgba(0,0,0,.38);}
|
||||
*/
|
||||
|
||||
|
||||
/* 全局 */
|
||||
html{background-color: #f2f2f2; color: #5F5F5F;}
|
||||
*[template],
|
||||
.layadmin-tabsbody-item{display: none;}
|
||||
*[lay-href],
|
||||
*[lay-tips],
|
||||
*[layadmin-event]{cursor: pointer;}
|
||||
|
||||
/* 重置布局结构 */
|
||||
.layui-layout-admin .layui-header{position: fixed; top: 0; left: 0; width: 100%; height: 50px;}
|
||||
|
||||
/*
|
||||
.layui-layout-admin .layui-header .layui-layout-right .layui-nav-item a{color: #fff;}
|
||||
.layui-layout-admin .layui-header .layui-layout-right .layui-nav-item a cite{color: rgba(255,255,255,.7);}
|
||||
*/
|
||||
|
||||
.layui-layout-admin .layui-header .layui-nav .layui-nav-child a{color: #333;}
|
||||
.layui-layout-admin .layui-side{width: 220px; top: 0; z-index: 1001;}
|
||||
.layui-layout-admin .layui-logo,
|
||||
.layui-layout-admin .layui-header .layui-nav .layui-nav-item{height: 50px; line-height: 50px;}
|
||||
.layui-layout-admin .layui-logo{position: fixed; left: 0; top: 0; z-index: 1002; width: 220px; height: 49px; padding: 0 15px; box-sizing: border-box; overflow: hidden; font-weight: 300; background-repeat: no-repeat; background-position: center center;}
|
||||
.layui-layout-admin .layui-layout-left,
|
||||
.layadmin-pagetabs,
|
||||
.layui-layout-admin .layui-body,
|
||||
.layui-layout-admin .layui-footer{left: 220px;}
|
||||
.layadmin-pagetabs{position: fixed; top: 50px; right: 0; z-index: 999;}
|
||||
.layadmin-pagetabs .layui-breadcrumb{padding: 0 15px;}
|
||||
.layui-layout-admin .layui-body{position: fixed; top: 90px; bottom: 0;}
|
||||
.layui-layout-admin .layui-body .layadmin-tabsbody-item{position: absolute; top: 0; bottom: 0; left: 0; right: 0; overflow: hidden; overflow-y: auto;}
|
||||
.layui-layout-admin .layui-header .layui-nav-img{width: 26px; height: 26px;}
|
||||
.layui-layout-admin .layui-header .layui-nav-child{top: 55px;}
|
||||
.layui-layout-admin .layui-header .layui-layout-right .layui-nav-child{left: auto; right: 0;}
|
||||
.layui-layout-admin .layui-header .layui-nav .layui-nav-child dd.layui-this a,
|
||||
.layui-layout-admin .layui-header .layui-nav .layui-nav-child dd.layui-this{background: none}
|
||||
|
||||
/* 统一动画 */
|
||||
.layui-layout-admin .layui-header .layui-nav .layui-nav-item,
|
||||
.layui-layout-admin .layui-layout-left,
|
||||
.layadmin-pagetabs,
|
||||
.layui-layout-admin .layui-body,
|
||||
.layui-layout-admin .layui-footer,
|
||||
.layui-layout-admin .layui-side,
|
||||
.layui-layout-admin .layui-logo,
|
||||
.layui-layout-admin .layui-header .layui-layout-right{transition: all .3s; -webkit-transition: all .3s;}
|
||||
|
||||
/* 图标 */
|
||||
.layui-icon-login-qq{color: #3492ED;}
|
||||
.layui-icon-login-wechat{color: #4DAF29;}
|
||||
.layui-icon-login-weibo{color: #CF1900;}
|
||||
|
||||
/* 重置表格风格 */
|
||||
/*
|
||||
.layui-table th,
|
||||
.layui-table td,
|
||||
.layui-table[lay-skin="line"],
|
||||
.layui-table[lay-skin="row"],
|
||||
.layui-table-view,
|
||||
.layui-table-header,
|
||||
.layui-table-tool,
|
||||
.layui-table-page,
|
||||
.layui-table-fixed-r,
|
||||
.layui-table-tips-main{border-color: #f5f5f5;}
|
||||
|
||||
.layui-table thead tr,
|
||||
.layui-table-header,
|
||||
.layui-table-tool,
|
||||
.layui-table-patch,
|
||||
.layui-table-mend{background-color: #fff;}
|
||||
|
||||
.layui-table[lay-even] tr:nth-child(even),
|
||||
.layui-table tbody tr:hover,
|
||||
.layui-table-hover,
|
||||
.layui-table-click{background-color: #f8f8f8;}
|
||||
*/
|
||||
|
||||
/* 表单 */
|
||||
.layui-form[wid100] .layui-form-label{width: 100px;}
|
||||
.layui-form[wid100] .layui-input-block{margin-left: 130px;}
|
||||
@media screen and (max-width: 450px){
|
||||
.layui-form[wid100] .layui-form-item .layui-input-inline{margin-left: 132px;}
|
||||
.layui-form[wid100] .layui-form-item .layui-input-inline+.layui-form-mid{margin-left: 130px;}
|
||||
}
|
||||
.layui-form-item .layui-input-company{width: auto; padding-right: 10px; line-height: 38px;}
|
||||
|
||||
/* 辅助 */
|
||||
.layadmin-flexible{}
|
||||
.layui-bg-white{background-color: #fff;}
|
||||
.layadmin-loading{position: absolute; left: 50%; top: 50%; margin: -16px -15px; font-size: 30px; color: #c2c2c2;}
|
||||
.layadmin-fixed{position: fixed; left: 0; top: 0; z-index: 999;}
|
||||
.layadmin-link{color: #029789!important;}
|
||||
.layadmin-link:hover{opacity: 0.8;}
|
||||
|
||||
/* 弹出面板 */
|
||||
.layui-layer-admin .layui-layer-title{height: 50px; line-height: 50px; border: none 0; background-color: #20222A; color: #fff;}
|
||||
.layui-layer-admin i[close]{position: absolute; padding: 5px; right: 10px; top: 12px; color: #fff; cursor: pointer;}
|
||||
.layui-layer-admin .layui-layer-content{padding: 20px; line-height: 22px;}
|
||||
.layui-layer-admin .layui-layer-content cite{font-style: normal; color: #FF5722;}
|
||||
|
||||
/* 右侧面板 */
|
||||
.layui-layer-adminRight{top: 50px !important; bottom: 0; box-shadow: 1px 1px 10px rgba(0,0,0,.1); border-radius: 0; overflow: auto;}
|
||||
|
||||
/* 弹出便签 */
|
||||
.layadmin-note .layui-layer-content{padding: 0;}
|
||||
.layadmin-note textarea{display: block; width: 300px; height: 132px; min-width: 300px; min-height: 132px; line-height: 20px; padding: 10px 20px; border: none; box-sizing: border-box; color: #5F5F5F; word-wrap: break-word;}
|
||||
|
||||
/* 头部导航 */
|
||||
.layui-layout-admin .layui-layout-left{padding: 0 10px;}
|
||||
.layui-layout-admin .layui-layout-left .layui-nav-item{margin: 0 20px;}
|
||||
.layui-layout-admin .layui-input-search{display: inline-block; vertical-align: middle; height: 32px; border: none; cursor: text;}
|
||||
.layui-layout-admin .layui-layout-left a{padding: 0;}
|
||||
.layui-layout-admin .layui-layout-right{padding: 0;}
|
||||
.layui-header .layui-nav-item:hover{}
|
||||
.layui-header .layui-layout-right .layui-badge-dot{margin-left: 0px;}
|
||||
.layui-header .layui-nav .layui-this:after,
|
||||
.layui-layout-admin .layui-header .layui-nav-bar{top: 0 !important; bottom: auto; height: 3px; background-color: #fff; background-color: rgba(255,255,255,.3);}
|
||||
|
||||
/* 遮罩 */
|
||||
.layadmin-body-shade{position: fixed; display: none; left: 0; right: 0; top: 0; bottom: 0; background-color: rgba(0,0,0,.3); z-index: 1000;}
|
||||
|
||||
/* 侧边菜单 */
|
||||
.layui-side-menu .layui-side-scroll{width: 240px;}
|
||||
.layui-side-menu .layui-nav{width: 220px; margin-top: 50px; background: none;}
|
||||
.layui-side-menu .layui-nav .layui-nav-item a{padding-left: 45px; padding-right: 30px;}
|
||||
.layui-side-menu .layui-nav .layui-nav-item a:hover{background: none;}
|
||||
.layui-side-menu .layui-nav .layui-nav-itemed > .layui-nav-child{padding: 5px 0;}
|
||||
.layui-side-menu .layui-nav>.layui-nav-item .layui-icon:first-child{position: absolute; top: 50%; left: 20px; margin-top: -19px;}
|
||||
.layui-side-menu .layui-nav .layui-nav-child .layui-nav-child{background: none!important;}
|
||||
.layui-side-menu .layui-nav .layui-nav-child .layui-nav-child a{padding-left: 60px}
|
||||
|
||||
/* 侧边菜单 - 平板移动设备 */
|
||||
@media screen and (max-width: 992px) {
|
||||
.layui-layout-admin .layui-side{transform: translate3d(-220px, 0, 0); -webkit-transform: translate3d(-220px, 0, 0); width: 220px;}
|
||||
.layui-layout-admin .layui-layout-left,
|
||||
.layadmin-pagetabs,
|
||||
.layui-layout-admin .layui-body,
|
||||
.layui-layout-admin .layui-footer{left: 0;}
|
||||
}
|
||||
|
||||
/* 侧边收缩模式 */
|
||||
.layadmin-side-shrink .layui-layout-admin .layui-logo{width: 60px; background-image: url(res/logo.png); /*background-size: 20px;)*/}
|
||||
.layadmin-side-shrink .layui-layout-admin .layui-logo span{display: none;}
|
||||
.layadmin-side-shrink .layui-side{left: 0; width: 60px;}
|
||||
.layadmin-side-shrink .layui-layout-admin .layui-layout-left,
|
||||
.layadmin-side-shrink .layadmin-pagetabs,
|
||||
.layadmin-side-shrink .layui-layout-admin .layui-body,
|
||||
.layadmin-side-shrink .layui-layout-admin .layui-footer{left: 60px;}
|
||||
.layadmin-side-shrink .layui-side-menu .layui-nav{position: static; width: 60px;}
|
||||
.layadmin-side-shrink .layui-side-menu .layui-nav-item{position: static;}
|
||||
.layadmin-side-shrink .layui-side-menu .layui-nav-item>a{padding-right: 0;}
|
||||
.layadmin-side-shrink .layui-side-menu .layui-nav-item cite,
|
||||
.layadmin-side-shrink .layui-side-menu .layui-nav > .layui-nav-item > a .layui-nav-more,
|
||||
.layadmin-side-shrink .layui-side-menu .layui-nav > .layui-nav-item > .layui-nav-child{display: none; padding: 8px 0; width: 200px;}
|
||||
.layadmin-side-shrink .layui-side-menu .layui-nav > .layui-nav-itemed>a{background: rgba(0,0,0,.3);}
|
||||
|
||||
/* 移动端展开模式 */
|
||||
.layadmin-side-spread-sm .layui-layout-admin .layui-layout-left,
|
||||
.layadmin-side-spread-sm .layadmin-pagetabs,
|
||||
.layadmin-side-spread-sm .layui-layout-admin .layui-body,
|
||||
.layadmin-side-spread-sm .layui-layout-admin .layui-footer{left: 0; transform: translate3d(220px, 0, 0); -webkit-transform: translate3d(220px, 0, 0);}
|
||||
.layadmin-side-spread-sm .layui-layout-admin .layui-layout-right{transform: translate3d(220px, 0, 0); -webkit-transform: translate3d(220px, 0, 0);}
|
||||
.layadmin-side-spread-sm .layui-side{transform: translate3d(0, 0, 0); -webkit-transform: translate3d(0, 0, 0);}
|
||||
.layadmin-side-spread-sm .layadmin-body-shade{display: block; }
|
||||
|
||||
|
||||
/* 页面标签 */
|
||||
.layadmin-pagetabs{height: 40px; line-height: 40px; padding: 0 80px 0 40px; /*border-bottom: 2px solid #292B34;*/ background-color: #fff; box-sizing: border-box; box-shadow: 0 1px 2px 0 rgba(0,0,0,.1);}
|
||||
.layadmin-pagetabs .layadmin-tabs-control{position: absolute; top: 0; width: 40px; height: 100%; text-align: center; cursor: pointer; transition: all .3s; -webkit-transition: all .3s; box-sizing: border-box; border-left: 1px solid #f5f5f5;}
|
||||
.layadmin-pagetabs .layadmin-tabs-control:hover{background-color: #f5f5f5;}
|
||||
.layadmin-pagetabs .layui-icon-prev{left: 0; border-left: none; border-right: 1px solid #f5f5f5;}
|
||||
.layadmin-pagetabs .layui-icon-next{right: 40px; right: 40px;}
|
||||
.layadmin-pagetabs .layui-icon-down{right: 0;}
|
||||
.layadmin-tabs-select.layui-nav{position: absolute; left: 0; top: 0; width: 100%; height: 100%; padding: 0; background: none;}
|
||||
.layadmin-tabs-select.layui-nav .layui-nav-item{line-height: 40px;}
|
||||
.layadmin-tabs-select.layui-nav .layui-nav-item>a{height: 40px;}
|
||||
.layadmin-tabs-select.layui-nav .layui-nav-item a{color: #5F5F5F;}
|
||||
.layadmin-tabs-select.layui-nav .layui-nav-child{top: 40px; left: auto; right: 0;}
|
||||
.layadmin-tabs-select.layui-nav .layui-nav-child dd.layui-this,
|
||||
.layadmin-tabs-select.layui-nav .layui-nav-child dd.layui-this a{background-color: #f2f2f2!important; color: #333;}
|
||||
.layadmin-tabs-select.layui-nav .layui-nav-more,
|
||||
.layadmin-tabs-select.layui-nav .layui-nav-bar{display: none;}
|
||||
|
||||
.layadmin-pagetabs .layui-tab{margin: 0; overflow: hidden;}
|
||||
.layadmin-pagetabs .layui-tab-title{height: 40px; border: none;}
|
||||
.layadmin-pagetabs .layui-tab-title li{min-width: 0; line-height: 40px; max-width: 160px; text-overflow: ellipsis; padding-right: 40px; overflow: hidden; border-right: 1px solid #f5f5f5; vertical-align: top;}
|
||||
.layadmin-pagetabs .layui-tab-title li:first-child{ padding-right: 15px;}
|
||||
.layadmin-pagetabs .layui-tab-title li:first-child .layui-tab-close{display: none;}
|
||||
.layadmin-pagetabs .layui-tab-title li .layui-tab-close{position: absolute; right: 8px; top: 50%; margin: -7px 0 0 0; width: 16px; height: 16px; line-height: 16px; border-radius: 50%; font-size: 12px;}
|
||||
.layadmin-pagetabs .layui-tab-title li:after{content:''; position: absolute; top: 0; left: 0; width: 0; height: 2px; border-radius: 0; background-color: #292B34; transition: all .3s; -webkit-transition: all .3s;}
|
||||
.layadmin-pagetabs .layui-tab-title li:hover:after{width: 100%;}
|
||||
.layadmin-pagetabs .layui-tab-title li:hover,
|
||||
.layadmin-pagetabs .layui-tab-title li.layui-this{color: #5FB878;}
|
||||
.layadmin-pagetabs .layui-tab-title li.layui-this:after{width: 100%; border: none; height: 2px; background-color: #292B34;}
|
||||
|
||||
/* 不开启页面标签时 */
|
||||
.layadmin-tabspage-none .layui-layout-admin .layui-header{border-bottom: none; box-shadow: 0 1px 2px 0 rgba(0,0,0,.05);}
|
||||
.layadmin-tabspage-none .layui-layout-admin .layui-body{top: 50px;}
|
||||
.layadmin-tabspage-none .layadmin-header{display: block;}
|
||||
.layadmin-tabspage-none .layadmin-header .layui-breadcrumb{border-top: 1px solid #f5f5f5;}
|
||||
|
||||
/* 底部固定区域 */
|
||||
.layui-layout-admin .layui-footer{padding: 10px 0; text-align: center;}
|
||||
|
||||
/* 默认主题修饰 */
|
||||
.layui-layout-admin .layui-header{border-bottom: 1px solid #f5f5f5; box-sizing: border-box; background-color: #fff;}
|
||||
.layui-layout-admin .layui-header a,
|
||||
.layui-layout-admin .layui-header a cite{color: #333;}
|
||||
.layui-layout-admin .layui-header a:hover{color: #000;}
|
||||
.layui-layout-admin .layui-header .layui-nav .layui-nav-more{border-top-color: #5F5F5F}
|
||||
.layui-layout-admin .layui-header .layui-nav .layui-nav-mored{border-color: transparent; border-bottom-color: #5F5F5F;}
|
||||
.layui-layout-admin .layui-header .layui-nav .layui-this:after,
|
||||
.layui-layout-admin .layui-header .layui-nav-bar{height: 2px; background-color: #20222A}
|
||||
.layui-layout-admin .layui-logo{background-color: #20222A; box-shadow: 0 1px 2px 0 rgba(0,0,0,.15);}
|
||||
.layui-layout-admin .layui-logo,
|
||||
.layui-layout-admin .layui-logo a{color: #fff; color: rgba(255,255,255,.8)}
|
||||
.layui-side-menu{box-shadow: 1px 0 2px 0 rgba(0,0,0,.05);}
|
||||
.layui-layout-admin .layui-footer{box-shadow: 0 -1px 2px 0 rgba(0,0,0,.05);}
|
||||
|
||||
.layui-side-menu,
|
||||
.layadmin-setTheme-side{background-color: #20222A; color: #fff;}
|
||||
.layadmin-setTheme-header{background-color: #fff;}
|
||||
|
||||
.layui-layout-admin .layui-footer{background-color: #fff;}
|
||||
.layui-tab-admin .layui-tab-title{background-color: #393D49; color: #fff;}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
格局
|
||||
|
||||
*/
|
||||
|
||||
.layui-fluid{padding: 15px;}
|
||||
.layadmin-header{display: none; height: 50px; line-height: 50px; margin-bottom: 0; border-radius: 0;}
|
||||
.layadmin-header .layui-breadcrumb{padding: 0 15px;}
|
||||
.layui-card-header{position: relative;}
|
||||
.layui-card-header .layui-icon{line-height: initial; position: absolute; right: 15px; top: 50%; margin-top: -7px;}
|
||||
.layadmin-iframe{position: absolute; width: 100%; height: 100%; left: 0; top: 0; right: 0; bottom: 0;}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
控制台
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/* 重置轮播样式 */
|
||||
.layadmin-carousel{height: 185px !important; background-color: #fff;}
|
||||
.layadmin-carousel .layui-carousel-ind li{background-color: #e2e2e2;}
|
||||
.layadmin-carousel .layui-carousel-ind li:hover{background-color: #c2c2c2;}
|
||||
.layadmin-carousel .layui-carousel-ind li.layui-this{background-color: #999;}
|
||||
.layadmin-carousel .layui-carousel,
|
||||
.layadmin-carousel > *[carousel-item] > *{background-color: #fff;}
|
||||
.layadmin-carousel .layui-col-space10{margin: 0;}
|
||||
.layadmin-carousel .layui-carousel-ind{position: absolute; top: -41px; text-align: right;}
|
||||
.layadmin-carousel .layui-carousel-ind ul{background: none;}
|
||||
|
||||
/* 重置tab样式 */
|
||||
.layui-card .layui-tab-brief .layui-tab-title{height: 42px; border-bottom-color: #f5f5f5;}
|
||||
.layui-card .layui-tab-brief .layui-tab-title li{margin: 0 15px; padding: 0; line-height: 42px;}
|
||||
.layui-card .layui-tab-brief .layui-tab-title li.layui-this{color: #333;}
|
||||
.layui-card .layui-tab-brief .layui-tab-title .layui-this:after{height: 43px;}
|
||||
.layui-card .layui-tab-brief .layui-tab-content{padding: 15px;}
|
||||
.layui-card .layui-table-view{margin: 0;}
|
||||
|
||||
/* 快捷方式 */
|
||||
.layadmin-shortcut li{text-align: center;}
|
||||
.layadmin-shortcut li .layui-icon{display: inline-block; width: 100%; height: 60px; line-height: 60px; text-align: center; border-radius: 2px; font-size: 30px; background-color: #F8F8F8; color: #333; transition: all .3s; -webkit-transition: all .3s;}
|
||||
.layadmin-shortcut li cite{position: relative; top: 2px; display: block; color: #5F5F5F; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; font-size: 14px;}
|
||||
.layadmin-shortcut li:hover .layui-icon{background-color: #f2f2f2;}
|
||||
|
||||
/* 待办事项 */
|
||||
.layadmin-backlog .layadmin-backlog-body{display: block; padding: 10px 15px; background-color: #f8f8f8; color: #999; border-radius: 2px; transition: all .3s; -webkit-transition: all .3s;}
|
||||
.layadmin-backlog-body h3{padding-bottom: 10px; font-size: 12px;}
|
||||
.layadmin-backlog-body p cite{font-style: normal; font-size: 30px; font-weight: 300; color: #009688;}
|
||||
.layadmin-backlog-body:hover{background-color: #f2f2f2; color: #888;}
|
||||
|
||||
/* 版本信息 */
|
||||
.layadmin-version .layui-table{padding: 6px 0;}
|
||||
.layadmin-version .layui-table td,
|
||||
.layadmin-version .layui-table th{line-height: 25px;}
|
||||
|
||||
/* 数据概览 */
|
||||
.layadmin-dataview{height: 332px !important;}
|
||||
.layadmin-dataview>*[carousel-item]:before{display: none;}
|
||||
.layadmin-dataview>*[carousel-item]>div{height: 332px;}
|
||||
|
||||
/* 控制台效果报告 */
|
||||
.layadmin-takerates{padding-top: 5px;}
|
||||
.layadmin-takerates .layui-progress{margin: 50px 0 60px;}
|
||||
.layadmin-takerates .layui-progress:last-child{margin-bottom: 10px;}
|
||||
.layadmin-takerates .layui-progress h3{position: absolute; right: 0; top: -35px; color: #999; font-size: 14px;}
|
||||
.layadmin-takerates .layui-progress-bar{text-align: left;}
|
||||
.layadmin-takerates .layui-progress-text{top: -35px; line-height: 26px; font-size: 26px;}
|
||||
|
||||
/* 产品动态 */
|
||||
.layadmin-news{height: 60px !important; padding: 5px 0;}
|
||||
.layadmin-news a{display: block; line-height: 60px; text-align: center;}
|
||||
.layadmin-news .layui-carousel-ind{height: 45px;}
|
||||
|
||||
/* 文字列表 */
|
||||
.layadmin-list li{margin-bottom: 6px; padding-bottom: 6px; border-bottom-color: #f5f5f5; list-style-position: inside; list-style-type: disc;}
|
||||
.layadmin-list li{text-overflow: ellipsis; overflow: hidden; white-space: nowrap;}
|
||||
.layadmin-list li a{color: #5F5F5F;}
|
||||
.layadmin-list li a:hover{color: #009688;}
|
||||
.layadmin-list li:last-child{border: none; padding: 0; margin: 0;}
|
||||
|
||||
/* 文本区域 */
|
||||
.layadmin-text p{margin-bottom: 10px; text-indent: 2em;}
|
||||
.layadmin-text p:last-child{margin: 0;}
|
||||
.layadmin-font-em{font-size: 13px; color: #758697;}
|
||||
|
||||
|
||||
|
||||
|
||||
/********************************
|
||||
|
||||
其它主页开始
|
||||
|
||||
*******************************/
|
||||
|
||||
/* 主页示例一 */
|
||||
/* 进行中的项目 */
|
||||
.layui-card-header .layui-a-tips{position: absolute; right: 15px; color: #01AAED;}
|
||||
.layuiadmin-card-text{background-color: #f8f8f8; color: #777; padding: 24px;}
|
||||
.layuiadmin-card-text .layui-text-top{padding-bottom: 10px;}
|
||||
.layuiadmin-card-text .layui-text-top i{margin-right: 10px; font-size: 24px; color: #009688;}
|
||||
.layuiadmin-card-text .layui-text-top a{line-height: 24px; font-size: 16px; vertical-align: top;}
|
||||
.layuiadmin-card-text .layui-text-center{height: 44px; line-height: 22px; margin-bottom: 10px; overflow: hidden;}
|
||||
.layuiadmin-card-text .layui-text-bottom{position: relative;}
|
||||
.layuiadmin-card-text .layui-text-bottom a{color: #777; font-size: 12px; text-overflow: ellipsis; word-break: break-all;}
|
||||
.layuiadmin-card-text .layui-text-bottom span{color: #CCC; font-size: 12px; position: absolute; right: 0;}
|
||||
.layuiadmin-card-text a:hover,
|
||||
.layuiadmin-card-link a:hover,
|
||||
.layuiadmin-card-team li a:hover{color: #01AAED; transition: all 300ms;}
|
||||
|
||||
/* 动态 */
|
||||
.layuiadmin-card-status{padding: 0 10px 10px 10px;}
|
||||
.layuiadmin-card-status dd{padding: 15px 0; border-bottom: 1px solid #EEE; display: -webkit-flex; display: flex;}
|
||||
.layuiadmin-card-status dd:last-child{border: none;}
|
||||
.layuiadmin-card-status dd div.layui-status-img,
|
||||
.layuiadmin-card-team .layui-team-img{width: 32px; height: 32px; border-radius: 50%; background-color: #009688; margin-right: 15px;}
|
||||
.layuiadmin-card-status dd div.layui-status-img a{width: 100%; height: 100%; display: inline-block; text-align: center; line-height: 32px;}
|
||||
.layuiadmin-card-status dd div.layui-status-img img,
|
||||
.layuiadmin-card-team .layui-team-img img{width: 50%; height: 50%;}
|
||||
.layuiadmin-card-status dd div a{color: #01AAED;}
|
||||
.layuiadmin-card-status dd div span{color: #BBB;}
|
||||
|
||||
/* 便捷导航 */
|
||||
.layuiadmin-card-link{padding-left: 10px; font-size: 0}
|
||||
.layuiadmin-card-link a{display: inline-block; width: 25%; color: #5F5F5F; font-size: 14px; margin-bottom: 12px;}
|
||||
.layuiadmin-card-link button{vertical-align: top;}
|
||||
.layuiadmin-card-link button:hover{color: #009688;}
|
||||
|
||||
/* 团队 */
|
||||
.layuiadmin-card-team li{padding: 10px 0 10px 10px;}
|
||||
.layuiadmin-card-team .layui-team-img{display: inline-block; margin-right: 8px; width: 24px; height: 24px; text-align: center; line-height: 24px;}
|
||||
.layuiadmin-card-team span{color: #777;}
|
||||
|
||||
|
||||
/* 主页示例二 */
|
||||
.layuiadmin-badge{position: absolute; top: 50%; margin-top: -9px; right: 15px; color: #01AAED; }
|
||||
.layuiadmin-card-list{padding: 15px;}
|
||||
.layuiadmin-card-list p.layuiadmin-big-font{font-size: 36px; color: #5F5F5F; line-height: 36px; padding: 5px 0 10px; overflow: hidden; text-overflow: ellipsis; word-break: break-all; white-space: nowrap;}
|
||||
.layuiadmin-card-list p.layuiadmin-normal-font{padding-bottom: 10px; font-size: 20px; color: #5F5F5F; line-height: 24px;}
|
||||
.layuiadmin-span-color{font-size: 14px; position: absolute; right: 15px;}
|
||||
.layuiadmin-span-color i{padding-left: 5px;}
|
||||
.layuiadmin-btn-group{position: absolute; right: 15px;}
|
||||
|
||||
.layuiadmin-card-status li{position: relative; padding: 10px 0; border-bottom: 1px solid #EEE;}
|
||||
.layuiadmin-card-status li h3{padding-bottom: 5px; font-weight: 700;}
|
||||
.layuiadmin-card-status li p{padding-bottom: 10px;}
|
||||
.layuiadmin-card-status li>span{color: #999;}
|
||||
.layuiadmin-home2-usernote .layuiadmin-reply{display: none; position: absolute; right: 0; bottom: 12px;}
|
||||
.layuiadmin-home2-usernote li:hover .layuiadmin-reply{display: block;}
|
||||
|
||||
.layuiadmin-page-table td span{color: #2F4056;}
|
||||
.layuiadmin-page-table td span.first{color: #FF5722;}
|
||||
.layuiadmin-page-table td span.second{color: #FFB800;}
|
||||
.layuiadmin-page-table td span.third{color: #5FB878;}
|
||||
|
||||
|
||||
/****** 其它主页结束 ******/
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
应用
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/* 消息中心 */
|
||||
.layuiAdmin-msg-detail h1{font-size: 16px;}
|
||||
.layuiAdmin-msg-detail .layui-card-header{height: auto; line-height: 30px; padding: 15px;}
|
||||
.layuiAdmin-msg-detail .layui-card-header span{padding: 0 5px; color: #999;}
|
||||
.layuiAdmin-msg-detail .layui-card-header span:first-child{padding-left: 0;}
|
||||
.layuiAdmin-msg-detail .layui-card-body{padding: 15px;}
|
||||
|
||||
/* 文章列表 */
|
||||
.layuiadmin-content-bread{padding-bottom: 20px;}
|
||||
|
||||
/* 进度条样式 */
|
||||
.layuiadmin-order-progress{position: relative; top: 12px;}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
系统
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/* 头部图标重置 */
|
||||
.layui-card-header.layuiadmin-card-header-auto{padding-top: 15px; padding-bottom: 15px; height: auto;}
|
||||
.layuiadmin-card-header-auto i.layuiadmin-button-btn{position: relative; right: 0; top: 0; vertical-align: middle;}
|
||||
.layuiadmin-card-header-auto .layui-form-item:last-child{margin-bottom: 0;}
|
||||
|
||||
|
||||
/* 主题设置 */
|
||||
.layadmin-setTheme{padding: 15px; overflow-x: hidden;}
|
||||
.layadmin-setTheme>h5{padding: 20px 0 10px; color: #000;}
|
||||
.layadmin-setTheme>h5:first-child{padding-top: 0;}
|
||||
.layadmin-setTheme-color{width: 330px; font-size: 0;}
|
||||
.layadmin-setTheme-color li{position: relative; display: inline-block; vertical-align: top; width: 80px; height: 50px; margin: 0 15px 15px 0; background-color: #f2f2f2; cursor: pointer; font-size: 12px; color: #5F5F5F;}
|
||||
.layadmin-setTheme-color li:after{content: ''; position: absolute; z-index: 20; top: 50%; left: 50%; width: 1px; height: 0; border: 1px solid #f2f2f2; transition: all .3s; -webkit-transition: all .3s; opacity: 0;}
|
||||
.layadmin-setTheme-color li.layui-this:after,
|
||||
.layadmin-setTheme-color li:hover:after{width: 100%; height: 100%; padding: 4px; top: -5px; left: -5px; border-color: #5FB878; opacity: 1;}
|
||||
|
||||
.layadmin-setTheme-header{position: relative; z-index: 10; height: 10px; border-top: 1px solid #f2f2f2; border-right: 1px solid #f2f2f2;}
|
||||
.layadmin-setTheme-side{position: absolute; left: 0; top: 0; width: 20px; height: 100%; z-index: 11; box-shadow: 1px 0 2px 0 rgba(0,0,0,.05);}
|
||||
.layadmin-setTheme-logo{position: absolute; left: 0; top: 0; width: 100%; height: 10px; box-shadow: 0 1px 2px 0 rgba(0,0,0,.15);}
|
||||
.layadmin-form-right{text-align: right;}
|
||||
|
||||
|
||||
/* 关于 */
|
||||
.layadmin-about p{margin-bottom: 10px;}
|
||||
|
||||
/* 菜单列表 */
|
||||
.layadmin-menu-list .layui-card-header{height: 50px; line-height: 50px; font-size: 16px;}
|
||||
.layadmin-menu-list .layui-card-header:active{background-color: #f2f2f2;}
|
||||
.layadmin-menu-list .layui-card-header .layui-icon{position: relative; top: 1px; left: 0; display: inline-block; margin: 0 10px 0; font-size: 18px;}
|
||||
|
||||
|
||||
/* 动画 */
|
||||
@-webkit-keyframes layui-rl{ /* 从右往左滑入 */
|
||||
from {-webkit-transform: translate3d(100%, 0, 0);}
|
||||
to {-webkit-transform: translate3d(0, 0, 0);}
|
||||
}
|
||||
@keyframes layui-rl{
|
||||
from {transform: translate3d(100%, 0, 0);}
|
||||
to {transform: translate3d(0, 0, 0);}
|
||||
}
|
||||
.layui-anim-rl{-webkit-animation-name: layui-rl; animation-name: layui-rl;}
|
||||
|
||||
@-webkit-keyframes layui-lr{ /* 从右往左滑入 */
|
||||
from {-webkit-transform: translate3d(0 0, 0); opacity: 1;}
|
||||
to {-webkit-transform: translate3d(100%, 0, 0); opacity: 1;}
|
||||
}
|
||||
@keyframes layui-lr{
|
||||
from {transform: translate3d(0, 0, 0);}
|
||||
to {transform: translate3d(100%, 0, 0);}
|
||||
}
|
||||
.layui-anim-lr{-webkit-animation-name: layui-lr; animation-name: layui-lr;}
|
||||
|
||||
.layui-anim-rl.layer-anim-close{-webkit-animation-name: layui-lr; animation-name: layui-lr;}
|
||||
|
||||
|
||||
/* 提示页 */
|
||||
.layadmin-tips{margin-top: 30px; text-align: center;}
|
||||
.layadmin-tips .layui-icon[face]{display: inline-block; font-size: 300px; color: #393D49;}
|
||||
.layadmin-tips .layui-text{width: 500px; margin: 30px auto; padding-top: 20px; border-top: 5px solid #009688; font-size: 16px;}
|
||||
.layadmin-tips h1{font-size: 100px; line-height: 100px; color: #009688;}
|
||||
.layadmin-tips .layui-text .layui-anim{display: inline-block;}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
响应式补充
|
||||
|
||||
*/
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
|
||||
/* 产品清单模板 */
|
||||
.layadmin-panel-selection{margin: 0; width: auto;}
|
||||
|
||||
/* 导航 */
|
||||
.layui-body .layui-nav .layui-nav-item{display: block;}
|
||||
|
||||
/* 主体容器 */
|
||||
.layui-layout-admin .layui-body .layadmin-tabsbody-item{-webkit-overflow-scrolling: touch; overflow: auto;}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* admin.login.css
|
||||
*/
|
||||
|
||||
html,body,#LAY_app{height:100%;}
|
||||
.layui-layout-body{overflow: auto;}
|
||||
|
||||
#LAY-user-login,
|
||||
.layadmin-user-display-show{display: block !important;}
|
||||
.layadmin-user-login{position: relative; left: 0; top: 0; padding: 110px 0; min-height: 100%; box-sizing: border-box;}
|
||||
.layadmin-user-login-main{width: 375px; margin: 0 auto; box-sizing: border-box;}
|
||||
.layadmin-user-login-box{padding: 20px;}
|
||||
.layadmin-user-login-header{text-align: center;}
|
||||
.layadmin-user-login-header h2{margin-bottom: 10px; font-weight: 300; font-size: 30px; color: #000;}
|
||||
.layadmin-user-login-header p{font-weight: 300; color: #999;}
|
||||
|
||||
.layadmin-user-login-body .layui-form-item{position: relative;}
|
||||
.layadmin-user-login-icon{position: absolute; left: 1px; top: 1px; width: 38px; line-height: 36px; text-align: center; color: #d2d2d2;}
|
||||
.layadmin-user-login-body .layui-form-item .layui-input{padding-left: 38px;}
|
||||
.layadmin-user-login-codeimg{max-height: 38px; width: 100%; cursor: pointer; box-sizing: border-box;}
|
||||
|
||||
.layadmin-user-login-other{position: relative; font-size: 0; line-height: 38px; padding-top: 20px;}
|
||||
.layadmin-user-login-other>*{display: inline-block; vertical-align: middle; margin-right: 10px; font-size: 14px;}
|
||||
.layadmin-user-login-other .layui-icon{position: relative; top: 2px; font-size: 26px;}
|
||||
.layadmin-user-login-other a:hover{opacity: 0.8;}
|
||||
|
||||
.layadmin-user-jump-change{float: right;}
|
||||
|
||||
.layadmin-user-login-footer{position: absolute; left: 0; bottom: 0; width: 100%; line-height: 30px; padding: 20px; text-align: center; box-sizing: border-box; color: rgba(0,0,0,.5)}
|
||||
.layadmin-user-login-footer span{padding: 0 5px;}
|
||||
.layadmin-user-login-footer a{padding: 0 5px; color: rgba(0,0,0,.5);}
|
||||
.layadmin-user-login-footer a:hover{color: rgba(0,0,0,1);}
|
||||
|
||||
/* 有背景图时 */
|
||||
.layadmin-user-login-main[bgimg]{background-color: #fff; box-shadow: 0 0 5px rgba(0,0,0,0.05);}
|
||||
|
||||
/* 主题背景 */
|
||||
.ladmin-user-login-theme{position: fixed; bottom: 0; left: 0; width: 100%; text-align: center;}
|
||||
.ladmin-user-login-theme ul{display: inline-block; padding: 5px; background-color: #fff;}
|
||||
.ladmin-user-login-theme ul li{display: inline-block; vertical-align: top; width: 64px; height: 43px; cursor: pointer; transition: all .3s; -webkit-transition: all .3s; background-color: #f2f2f2;}
|
||||
.ladmin-user-login-theme ul li:hover{opacity: 0.9}
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
.layadmin-user-login{padding-top: 60px;}
|
||||
.layadmin-user-login-main{width: 300px;}
|
||||
.layadmin-user-login-box{padding: 10px;}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,867 @@
|
||||
/**
|
||||
* 界面核心模块
|
||||
*/
|
||||
|
||||
layui.define('view', function(exports){
|
||||
var $ = layui.jquery
|
||||
,laytpl = layui.laytpl
|
||||
,element = layui.element
|
||||
,table = layui.table
|
||||
,upload = layui.upload
|
||||
,setter = layui.setter
|
||||
,view = layui.view
|
||||
,device = layui.device()
|
||||
|
||||
,$win = $(window), $body = $('body')
|
||||
,container = $('#'+ setter.container)
|
||||
|
||||
,SHOW = 'layui-show', HIDE = 'layui-hide', THIS = 'layui-this', DISABLED = 'layui-disabled', TEMP = 'template'
|
||||
,APP_BODY = '#LAY_app_body', APP_FLEXIBLE = 'LAY_app_flexible'
|
||||
,FILTER_TAB_TBAS = 'layadmin-layout-tabs'
|
||||
,APP_SPREAD_SM = 'layadmin-side-spread-sm', TABS_BODY = 'layadmin-tabsbody-item'
|
||||
,ICON_SHRINK = 'layui-icon-shrink-right', ICON_SPREAD = 'layui-icon-spread-left'
|
||||
,SIDE_SHRINK = 'layadmin-side-shrink', SIDE_MENU = 'LAY-system-side-menu'
|
||||
|
||||
//通用方法
|
||||
,admin = {
|
||||
v: '1.9.0'
|
||||
,mode: 'spa'
|
||||
|
||||
//数据的异步请求
|
||||
,req: view.req
|
||||
|
||||
//清除本地 token,并跳转到登入页
|
||||
,exit: view.exit
|
||||
|
||||
//xss 转义
|
||||
,escape: function(html){
|
||||
return String(html || '').replace(/&(?!#?[a-zA-Z0-9]+;)/g, '&')
|
||||
.replace(/</g, '<').replace(/>/g, '>')
|
||||
.replace(/'/g, ''').replace(/"/g, '"');
|
||||
}
|
||||
|
||||
//事件
|
||||
,on: function(events, callback){
|
||||
return layui.onevent.call(this, setter.MOD_NAME, events, callback);
|
||||
}
|
||||
|
||||
//弹出面板
|
||||
,popup: view.popup
|
||||
|
||||
//右侧面板
|
||||
,popupRight: function(options){
|
||||
//layer.close(admin.popup.index);
|
||||
return admin.popup.index = layer.open($.extend({
|
||||
type: 1
|
||||
,id: 'LAY_adminPopupR'
|
||||
,anim: -1
|
||||
,title: false
|
||||
,closeBtn: false
|
||||
,offset: 'r'
|
||||
,shade: 0.1
|
||||
,shadeClose: true
|
||||
,skin: 'layui-anim layui-anim-rl layui-layer-adminRight'
|
||||
,area: '300px'
|
||||
}, options));
|
||||
}
|
||||
|
||||
//发送验证码
|
||||
,sendAuthCode: function(options){
|
||||
options = $.extend({
|
||||
seconds: 60
|
||||
,elemPhone: '#LAY_phone'
|
||||
,elemVercode: '#LAY_vercode'
|
||||
}, options);
|
||||
|
||||
var seconds = options.seconds
|
||||
,token = null
|
||||
,timer, countDown = function(loop){
|
||||
var btn = $(options.elem)
|
||||
seconds--;
|
||||
if(seconds < 0){
|
||||
btn.removeClass(DISABLED).html('获取验证码');
|
||||
seconds = options.seconds;
|
||||
clearInterval(timer);
|
||||
} else {
|
||||
btn.addClass(DISABLED).html(seconds + '秒后重获');
|
||||
}
|
||||
|
||||
if(!loop){
|
||||
timer = setInterval(function(){
|
||||
countDown(true);
|
||||
}, 1000);
|
||||
}
|
||||
};
|
||||
|
||||
$body.off('click', options.elem).on('click', options.elem, function(){
|
||||
options.elemPhone = $(options.elemPhone);
|
||||
options.elemVercode = $(options.elemVercode);
|
||||
|
||||
var elemPhone = options.elemPhone
|
||||
,value = elemPhone.val();
|
||||
|
||||
if(seconds !== options.seconds || $(this).hasClass(DISABLED)) return;
|
||||
|
||||
if(!/^1\d{10}$/.test(value)){
|
||||
elemPhone.focus();
|
||||
return layer.msg('请输入正确的手机号')
|
||||
};
|
||||
|
||||
if(typeof options.ajax === 'object'){
|
||||
var success = options.ajax.success;
|
||||
delete options.ajax.success;
|
||||
}
|
||||
|
||||
admin.req($.extend(true, {
|
||||
url: '/auth/code'
|
||||
,type: 'get'
|
||||
,data: {
|
||||
phone: value
|
||||
}
|
||||
,success: function(res){
|
||||
layer.msg('验证码已发送至你的手机,请注意查收', {
|
||||
icon: 1
|
||||
,shade: 0
|
||||
});
|
||||
options.elemVercode.focus();
|
||||
countDown();
|
||||
success && success(res);
|
||||
}
|
||||
}, options.ajax));
|
||||
});
|
||||
}
|
||||
|
||||
//屏幕类型
|
||||
,screen: function(){
|
||||
var width = $win.width();
|
||||
if(width > 1200){
|
||||
return 3; //大屏幕
|
||||
} else if(width > 992){
|
||||
return 2; //中屏幕
|
||||
} else if(width > 768){
|
||||
return 1; //小屏幕
|
||||
} else {
|
||||
return 0; //超小屏幕
|
||||
}
|
||||
}
|
||||
|
||||
//侧边伸缩
|
||||
,sideFlexible: function(status){
|
||||
var app = container
|
||||
,iconElem = $('#'+ APP_FLEXIBLE)
|
||||
,screen = admin.screen();
|
||||
|
||||
//设置状态,PC:默认展开、移动:默认收缩
|
||||
if(status === 'spread'){
|
||||
//切换到展开状态的 icon,箭头:←
|
||||
iconElem.removeClass(ICON_SPREAD).addClass(ICON_SHRINK);
|
||||
|
||||
//移动:从左到右位移;PC:清除多余选择器恢复默认
|
||||
if(screen < 2){
|
||||
app.addClass(APP_SPREAD_SM);
|
||||
} else {
|
||||
app.removeClass(APP_SPREAD_SM);
|
||||
}
|
||||
|
||||
app.removeClass(SIDE_SHRINK)
|
||||
} else {
|
||||
//切换到搜索状态的 icon,箭头:→
|
||||
iconElem.removeClass(ICON_SHRINK).addClass(ICON_SPREAD);
|
||||
|
||||
//移动:清除多余选择器恢复默认;PC:从右往左收缩
|
||||
if(screen < 2){
|
||||
app.removeClass(SIDE_SHRINK);
|
||||
} else {
|
||||
app.addClass(SIDE_SHRINK);
|
||||
}
|
||||
|
||||
app.removeClass(APP_SPREAD_SM)
|
||||
}
|
||||
|
||||
layui.event.call(this, setter.MOD_NAME, 'side({*})', {
|
||||
status: status
|
||||
});
|
||||
}
|
||||
|
||||
//重置主体区域表格尺寸
|
||||
,resizeTable: function(delay){
|
||||
var that = this, runResizeTable = function(){
|
||||
that.tabsBody(admin.tabsPage.index).find('.layui-table-view').each(function(){
|
||||
var tableID = $(this).attr('lay-id');
|
||||
layui.table.resize(tableID);
|
||||
});
|
||||
};
|
||||
if(!layui.table) return;
|
||||
delay ? setTimeout(runResizeTable, delay) : runResizeTable();
|
||||
}
|
||||
|
||||
//主题设置
|
||||
,theme: function(options){
|
||||
var theme = setter.theme
|
||||
,local = layui.data(setter.tableName)
|
||||
,id = 'LAY_layadmin_theme'
|
||||
,style = document.createElement('style')
|
||||
,styleText = laytpl([
|
||||
//主题色
|
||||
'.layui-side-menu,'
|
||||
,'.layui-layer-admin .layui-layer-title,'
|
||||
,'.layadmin-side-shrink .layui-side-menu .layui-nav>.layui-nav-item>.layui-nav-child'
|
||||
,'{background-color:{{d.color.main}} !important;}'
|
||||
|
||||
//背景选中色
|
||||
,'.layadmin-pagetabs .layui-tab-title li:after,'
|
||||
,'.layadmin-pagetabs .layui-tab-title li.layui-this:after,'
|
||||
,'.layui-nav-tree .layui-this,'
|
||||
,'.layui-nav-tree .layui-this>a,'
|
||||
,'.layui-nav-tree .layui-nav-child dd.layui-this,'
|
||||
,'.layui-nav-tree .layui-nav-child dd.layui-this a,'
|
||||
,'.layui-nav-tree .layui-nav-bar'
|
||||
,'{background-color:{{d.color.selected}} !important;}'
|
||||
|
||||
//logo
|
||||
,'.layui-layout-admin .layui-logo{background-color:{{d.color.logo || d.color.main}} !important;}'
|
||||
|
||||
//文字选中色
|
||||
,'.layadmin-pagetabs .layui-tab-title li:hover,'
|
||||
,'.layadmin-pagetabs .layui-tab-title li.layui-this'
|
||||
,'{color: {{d.color.selected}} !important;}'
|
||||
|
||||
//头部色
|
||||
,'{{# if(d.color.header){ }}'
|
||||
,'.layui-layout-admin .layui-header{background-color:{{ d.color.header }};}'
|
||||
,'.layui-layout-admin .layui-header a,'
|
||||
,'.layui-layout-admin .layui-header a cite{color: #f8f8f8;}'
|
||||
,'.layui-layout-admin .layui-header a:hover{color: #fff;}'
|
||||
,'.layui-layout-admin .layui-header .layui-nav .layui-nav-more{border-top-color: #fbfbfb;}'
|
||||
,'.layui-layout-admin .layui-header .layui-nav .layui-nav-mored{border-color: transparent; border-bottom-color: #fbfbfb;}'
|
||||
,'.layui-layout-admin .layui-header .layui-nav .layui-this:after, .layui-layout-admin .layui-header .layui-nav-bar{background-color: #fff; background-color: rgba(255,255,255,.5);}'
|
||||
,'.layadmin-pagetabs .layui-tab-title li:after{display: none;}'
|
||||
,'{{# } }}'
|
||||
].join('')).render(options = $.extend({}, local.theme, options))
|
||||
,styleElem = document.getElementById(id);
|
||||
|
||||
//添加主题样式
|
||||
if('styleSheet' in style){
|
||||
style.setAttribute('type', 'text/css');
|
||||
style.styleSheet.cssText = styleText;
|
||||
} else {
|
||||
style.innerHTML = styleText;
|
||||
}
|
||||
style.id = id;
|
||||
|
||||
styleElem && $body[0].removeChild(styleElem);
|
||||
$body[0].appendChild(style);
|
||||
$body.attr('layadmin-themealias', options.color.alias);
|
||||
|
||||
//本地存储记录
|
||||
local.theme = local.theme || {};
|
||||
layui.each(options, function(key, value){
|
||||
local.theme[key] = value;
|
||||
});
|
||||
layui.data(setter.tableName, {
|
||||
key: 'theme'
|
||||
,value: local.theme
|
||||
});
|
||||
}
|
||||
|
||||
//初始化主题
|
||||
,initTheme: function(index){
|
||||
var theme = setter.theme;
|
||||
index = index || 0;
|
||||
if(theme.color[index]){
|
||||
theme.color[index].index = index;
|
||||
admin.theme({
|
||||
color: theme.color[index]
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//记录最近一次点击的页面标签数据
|
||||
,tabsPage: {}
|
||||
|
||||
//获取标签页的头元素
|
||||
,tabsHeader: function(index){
|
||||
return $('#LAY_app_tabsheader').children('li').eq(index || 0);
|
||||
}
|
||||
|
||||
//获取页面标签主体元素
|
||||
,tabsBody: function(index){
|
||||
return $(APP_BODY).find('.'+ TABS_BODY).eq(index || 0);
|
||||
}
|
||||
|
||||
//切换页面标签主体
|
||||
,tabsBodyChange: function(index){
|
||||
admin.tabsHeader(index).attr('lay-attr', layui.router().href);
|
||||
admin.tabsBody(index).addClass(SHOW).siblings().removeClass(SHOW);
|
||||
events.rollPage('auto', index);
|
||||
}
|
||||
|
||||
//resize事件管理
|
||||
,resize: function(fn){
|
||||
var router = layui.router()
|
||||
,key = router.path.join('-');
|
||||
|
||||
if(admin.resizeFn[key]){
|
||||
$win.off('resize', admin.resizeFn[key]);
|
||||
delete admin.resizeFn[key];
|
||||
}
|
||||
|
||||
if(fn === 'off') return; //如果是清除 resize 事件,则终止往下执行
|
||||
|
||||
fn(), admin.resizeFn[key] = fn;
|
||||
$win.on('resize', admin.resizeFn[key]);
|
||||
}
|
||||
,resizeFn: {}
|
||||
,runResize: function(){
|
||||
var router = layui.router()
|
||||
,key = router.path.join('-');
|
||||
admin.resizeFn[key] && admin.resizeFn[key]();
|
||||
}
|
||||
,delResize: function(){
|
||||
this.resize('off');
|
||||
}
|
||||
|
||||
//关闭当前 pageTabs
|
||||
,closeThisTabs: function(){
|
||||
if(!admin.tabsPage.index) return;
|
||||
$(TABS_HEADER).eq(admin.tabsPage.index).find('.layui-tab-close').trigger('click');
|
||||
}
|
||||
|
||||
//全屏
|
||||
,fullScreen: function(){
|
||||
var ele = document.documentElement
|
||||
,reqFullScreen = ele.requestFullScreen || ele.webkitRequestFullScreen
|
||||
|| ele.mozRequestFullScreen || ele.msRequestFullscreen;
|
||||
if(typeof reqFullScreen !== 'undefined' && reqFullScreen) {
|
||||
reqFullScreen.call(ele);
|
||||
};
|
||||
}
|
||||
|
||||
//退出全屏
|
||||
,exitScreen: function(){
|
||||
var ele = document.documentElement
|
||||
if (document.exitFullscreen) {
|
||||
document.exitFullscreen();
|
||||
} else if (document.mozCancelFullScreen) {
|
||||
document.mozCancelFullScreen();
|
||||
} else if (document.webkitCancelFullScreen) {
|
||||
document.webkitCancelFullScreen();
|
||||
} else if (document.msExitFullscreen) {
|
||||
document.msExitFullscreen();
|
||||
}
|
||||
}
|
||||
|
||||
//纠正单页路由格式
|
||||
,correctRouter: function(href){
|
||||
if(!/^\//.test(href)) href = '/' + href;
|
||||
|
||||
//纠正首尾
|
||||
return href.replace(/^(\/+)/, '/')
|
||||
.replace(new RegExp('\/' + setter.entry + '$'), '/'); //过滤路由最后的默认视图文件名(如:index)
|
||||
}
|
||||
|
||||
//……
|
||||
};
|
||||
|
||||
//事件
|
||||
var events = admin.events = {
|
||||
//伸缩
|
||||
flexible: function(othis){
|
||||
var iconElem = othis.find('#'+ APP_FLEXIBLE)
|
||||
,isSpread = iconElem.hasClass(ICON_SPREAD);
|
||||
admin.sideFlexible(isSpread ? 'spread' : null); //控制伸缩
|
||||
admin.resizeTable(350);
|
||||
}
|
||||
|
||||
//刷新
|
||||
,refresh: function(){
|
||||
admin.render();
|
||||
}
|
||||
|
||||
//输入框搜索
|
||||
,serach: function(othis){
|
||||
othis.off('keypress').on('keypress',function(e){
|
||||
if(!this.value.replace(/\s/g, '')) return;
|
||||
//回车跳转
|
||||
if(e.keyCode === 13){
|
||||
var href = othis.attr('lay-action')
|
||||
,text = othis.attr('lay-text') || '搜索';
|
||||
|
||||
href = href + this.value;
|
||||
text = text + ' <span style="color: #FF5722;">'+ admin.escape(this.value) +'</span>';
|
||||
|
||||
//打开标签页
|
||||
location.hash = admin.correctRouter(href)
|
||||
|
||||
//如果搜索关键词已经打开,则刷新页面即可
|
||||
events.serach.keys || (events.serach.keys = {});
|
||||
events.serach.keys[admin.tabsPage.index] = this.value;
|
||||
if(this.value === events.serach.keys[admin.tabsPage.index]){
|
||||
events.refresh(othis);
|
||||
}
|
||||
|
||||
//清空输入框
|
||||
this.value = '';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//点击消息
|
||||
,message: function(othis){
|
||||
othis.find('.layui-badge-dot').remove();
|
||||
}
|
||||
|
||||
//弹出主题面板
|
||||
,theme: function(){
|
||||
admin.popupRight({
|
||||
id: 'LAY_adminPopupTheme'
|
||||
,success: function(){
|
||||
view(this.id).render('system/theme')
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//便签
|
||||
,note: function(othis){
|
||||
var mobile = admin.screen() < 2
|
||||
,note = layui.data(setter.tableName).note;
|
||||
|
||||
events.note.index = admin.popup({
|
||||
title: '便签'
|
||||
,shade: 0
|
||||
,offset: [
|
||||
'41px'
|
||||
,(mobile ? null : (othis.offset().left - 250) + 'px')
|
||||
]
|
||||
,anim: -1
|
||||
,id: 'LAY_adminNote'
|
||||
,skin: 'layadmin-note layui-anim layui-anim-upbit'
|
||||
,content: '<textarea placeholder="内容"></textarea>'
|
||||
,resize: false
|
||||
,success: function(layero, index){
|
||||
var textarea = layero.find('textarea')
|
||||
,value = note === undefined ? '便签中的内容会存储在本地,这样即便你关掉了浏览器,在下次打开时,依然会读取到上一次的记录。是个非常小巧实用的本地备忘录' : note;
|
||||
|
||||
textarea.val(value).focus().on('keyup', function(){
|
||||
layui.data(setter.tableName, {
|
||||
key: 'note'
|
||||
,value: this.value
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//全屏
|
||||
,fullscreen: function(othis){
|
||||
var SCREEN_FULL = 'layui-icon-screen-full'
|
||||
,SCREEN_REST = 'layui-icon-screen-restore'
|
||||
,iconElem = othis.children("i");
|
||||
|
||||
if(iconElem.hasClass(SCREEN_FULL)){
|
||||
admin.fullScreen();
|
||||
iconElem.addClass(SCREEN_REST).removeClass(SCREEN_FULL);
|
||||
} else {
|
||||
admin.exitScreen();
|
||||
iconElem.addClass(SCREEN_FULL).removeClass(SCREEN_REST);
|
||||
}
|
||||
}
|
||||
|
||||
//弹出关于面板
|
||||
,about: function(){
|
||||
admin.popupRight({
|
||||
id: 'LAY_adminPopupAbout'
|
||||
,success: function(){
|
||||
view(this.id).render('system/about')
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//弹出更多面板
|
||||
,more: function(){
|
||||
admin.popupRight({
|
||||
id: 'LAY_adminPopupMore'
|
||||
,success: function(){
|
||||
view(this.id).render('system/more')
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//返回上一页
|
||||
,back: function(){
|
||||
history.back();
|
||||
}
|
||||
|
||||
//主题设置
|
||||
,setTheme: function(othis){
|
||||
var index = othis.data('index')
|
||||
,nextIndex = othis.siblings('.layui-this').data('index');
|
||||
|
||||
if(othis.hasClass(THIS)) return;
|
||||
|
||||
othis.addClass(THIS).siblings('.layui-this').removeClass(THIS);
|
||||
admin.initTheme(index);
|
||||
}
|
||||
|
||||
//左右滚动页面标签
|
||||
,rollPage: function(type, index){
|
||||
var tabsHeader = $('#LAY_app_tabsheader')
|
||||
,liItem = tabsHeader.children('li')
|
||||
,scrollWidth = tabsHeader.prop('scrollWidth')
|
||||
,outerWidth = tabsHeader.outerWidth()
|
||||
,tabsLeft = parseFloat(tabsHeader.css('left'));
|
||||
|
||||
//右左往右
|
||||
if(type === 'left'){
|
||||
if(!tabsLeft && tabsLeft <=0) return;
|
||||
|
||||
//当前的left减去可视宽度,用于与上一轮的页标比较
|
||||
var prefLeft = -tabsLeft - outerWidth;
|
||||
|
||||
liItem.each(function(index, item){
|
||||
var li = $(item)
|
||||
,left = li.position().left;
|
||||
|
||||
if(left >= prefLeft){
|
||||
tabsHeader.css('left', -left);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
} else if(type === 'auto'){ //自动滚动
|
||||
(function(){
|
||||
var thisLi = liItem.eq(index), thisLeft;
|
||||
|
||||
if(!thisLi[0]) return;
|
||||
thisLeft = thisLi.position().left;
|
||||
|
||||
//当目标标签在可视区域左侧时
|
||||
if(thisLeft < -tabsLeft){
|
||||
return tabsHeader.css('left', -thisLeft);
|
||||
}
|
||||
|
||||
//当目标标签在可视区域右侧时
|
||||
if(thisLeft + thisLi.outerWidth() >= outerWidth - tabsLeft){
|
||||
var subLeft = thisLeft + thisLi.outerWidth() - (outerWidth - tabsLeft);
|
||||
liItem.each(function(i, item){
|
||||
var li = $(item)
|
||||
,left = li.position().left;
|
||||
|
||||
//从当前可视区域的最左第二个节点遍历,如果减去最左节点的差 > 目标在右侧不可见的宽度,则将该节点放置可视区域最左
|
||||
if(left + tabsLeft > 0){
|
||||
if(left - tabsLeft > subLeft){
|
||||
tabsHeader.css('left', -left);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}());
|
||||
} else {
|
||||
//默认向左滚动
|
||||
liItem.each(function(i, item){
|
||||
var li = $(item)
|
||||
,left = li.position().left;
|
||||
|
||||
if(left + li.outerWidth() >= outerWidth - tabsLeft){
|
||||
tabsHeader.css('left', -left);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//向右滚动页面标签
|
||||
,leftPage: function(){
|
||||
events.rollPage('left');
|
||||
}
|
||||
|
||||
//向左滚动页面标签
|
||||
,rightPage: function(){
|
||||
events.rollPage();
|
||||
}
|
||||
|
||||
//关闭当前标签页
|
||||
,closeThisTabs: function(){
|
||||
admin.closeThisTabs();
|
||||
}
|
||||
|
||||
//关闭其它标签页
|
||||
,closeOtherTabs: function(type){
|
||||
var TABS_REMOVE = 'LAY-system-pagetabs-remove';
|
||||
if(type === 'all'){
|
||||
$(TABS_HEADER+ ':gt(0)').remove();
|
||||
$(APP_BODY).find('.'+ TABS_BODY+ ':gt(0)').remove();
|
||||
} else {
|
||||
$(TABS_HEADER).each(function(index, item){
|
||||
if(index && index != admin.tabsPage.index){
|
||||
$(item).addClass(TABS_REMOVE);
|
||||
admin.tabsBody(index).addClass(TABS_REMOVE);
|
||||
}
|
||||
});
|
||||
$('.'+ TABS_REMOVE).remove();
|
||||
}
|
||||
}
|
||||
|
||||
//关闭全部标签页
|
||||
,closeAllTabs: function(){
|
||||
events.closeOtherTabs('all');
|
||||
location.hash = '';
|
||||
}
|
||||
|
||||
//遮罩
|
||||
,shade: function(){
|
||||
admin.sideFlexible();
|
||||
}
|
||||
};
|
||||
|
||||
//初始
|
||||
!function(){
|
||||
//主题初始化,本地主题记录优先,其次为 initColorIndex
|
||||
var local = layui.data(setter.tableName);
|
||||
if(local.theme){
|
||||
admin.theme(local.theme);
|
||||
} else if(setter.theme){
|
||||
admin.initTheme(setter.theme.initColorIndex);
|
||||
}
|
||||
|
||||
//禁止水平滚动
|
||||
$body.addClass('layui-layout-body');
|
||||
|
||||
//移动端强制不开启页面标签功能
|
||||
if(admin.screen() < 1){
|
||||
delete setter.pageTabs;
|
||||
}
|
||||
|
||||
//不开启页面标签时
|
||||
if(!setter.pageTabs){
|
||||
container.addClass('layadmin-tabspage-none');
|
||||
}
|
||||
|
||||
//低版本IE提示
|
||||
if(device.ie && device.ie < 10){
|
||||
view.error('IE'+ device.ie + '下访问可能不佳,推荐使用:Chrome / Firefox / Edge 等高级浏览器', {
|
||||
offset: 'auto'
|
||||
,id: 'LAY_errorIE'
|
||||
});
|
||||
}
|
||||
|
||||
}();
|
||||
|
||||
//admin.prevRouter = {}; //上一个路由
|
||||
|
||||
// hash 改变侧边状态
|
||||
admin.on('hash(side)', function(router){
|
||||
var path = router.path, getData = function(item){
|
||||
return {
|
||||
list: item.children('.layui-nav-child')
|
||||
,name: item.data('name')
|
||||
,jump: item.data('jump')
|
||||
}
|
||||
}
|
||||
,sideMenu = $('#'+ SIDE_MENU)
|
||||
,SIDE_NAV_ITEMD = 'layui-nav-itemed'
|
||||
|
||||
//捕获对应菜单
|
||||
,matchMenu = function(list){
|
||||
var pathURL = admin.correctRouter(path.join('/'));
|
||||
list.each(function(index1, item1){
|
||||
var othis1 = $(item1)
|
||||
,data1 = getData(othis1)
|
||||
,listChildren1 = data1.list.children('dd')
|
||||
,matched1 = path[0] == data1.name || (index1 === 0 && !path[0])
|
||||
|| (data1.jump && pathURL == admin.correctRouter(data1.jump));
|
||||
|
||||
listChildren1.each(function(index2, item2){
|
||||
var othis2 = $(item2)
|
||||
,data2 = getData(othis2)
|
||||
,listChildren2 = data2.list.children('dd')
|
||||
,matched2 = (path[0] == data1.name && path[1] == data2.name)
|
||||
|| (data2.jump && pathURL == admin.correctRouter(data2.jump));
|
||||
|
||||
listChildren2.each(function(index3, item3){
|
||||
var othis3 = $(item3)
|
||||
,data3 = getData(othis3)
|
||||
,matched3 = (path[0] == data1.name && path[1] == data2.name && path[2] == data3.name)
|
||||
|| (data3.jump && pathURL == admin.correctRouter(data3.jump))
|
||||
|
||||
if(matched3){
|
||||
var selected = data3.list[0] ? SIDE_NAV_ITEMD : THIS;
|
||||
othis3.addClass(selected).siblings().removeClass(selected); //标记选择器
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
if(matched2){
|
||||
var selected = data2.list[0] ? SIDE_NAV_ITEMD : THIS;
|
||||
othis2.addClass(selected).siblings().removeClass(selected); //标记选择器
|
||||
return false
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
if(matched1){
|
||||
var selected = data1.list[0] ? SIDE_NAV_ITEMD : THIS;
|
||||
othis1.addClass(selected).siblings().removeClass(selected); //标记选择器
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//重置状态
|
||||
sideMenu.find('.'+ THIS).removeClass(THIS);
|
||||
|
||||
//移动端点击菜单时自动收缩
|
||||
if(admin.screen() < 2) admin.sideFlexible();
|
||||
|
||||
//开始捕获
|
||||
matchMenu(sideMenu.children('li'));
|
||||
});
|
||||
|
||||
//侧边导航点击事件
|
||||
element.on('nav(layadmin-system-side-menu)', function(elem){
|
||||
if(elem.siblings('.layui-nav-child')[0] && container.hasClass(SIDE_SHRINK)){
|
||||
admin.sideFlexible('spread');
|
||||
layer.close(elem.data('index'));
|
||||
};
|
||||
admin.tabsPage.type = 'nav';
|
||||
});
|
||||
|
||||
//选项卡的更多操作
|
||||
element.on('nav(layadmin-pagetabs-nav)', function(elem){
|
||||
var dd = elem.parent();
|
||||
dd.removeClass(THIS);
|
||||
dd.parent().removeClass(SHOW);
|
||||
});
|
||||
|
||||
//同步路由
|
||||
var setThisRouter = function(othis){
|
||||
var layid = othis.attr('lay-id')
|
||||
,attr = othis.attr('lay-attr')
|
||||
,index = othis.index();
|
||||
|
||||
location.hash = layid === setter.entry ? '/' : (attr || '/');
|
||||
admin.tabsBodyChange(index);
|
||||
}
|
||||
,TABS_HEADER = '#LAY_app_tabsheader>li';
|
||||
|
||||
//页面标签点击
|
||||
$body.on('click', TABS_HEADER, function(){
|
||||
var othis = $(this)
|
||||
,index = othis.index();
|
||||
|
||||
admin.tabsPage.type = 'tab';
|
||||
admin.tabsPage.index = index;
|
||||
|
||||
//如果是iframe类型的标签页
|
||||
if(othis.attr('lay-attr') === 'iframe'){
|
||||
return admin.tabsBodyChange(index);
|
||||
};
|
||||
|
||||
|
||||
setThisRouter(othis); //同步路由
|
||||
admin.runResize(); //执行resize事件,如果存在的话
|
||||
admin.resizeTable(); //重置当前主体区域的表格尺寸
|
||||
});
|
||||
|
||||
// tabspage 删除
|
||||
element.on('tabDelete(layadmin-layout-tabs)', function(obj){
|
||||
var othis = $(TABS_HEADER+ '.layui-this');
|
||||
|
||||
obj.index && admin.tabsBody(obj.index).remove();
|
||||
setThisRouter(othis);
|
||||
|
||||
//移除resize事件
|
||||
admin.delResize();
|
||||
});
|
||||
|
||||
//页面跳转
|
||||
$body.on('click', '*[lay-href]', function(){
|
||||
var othis = $(this)
|
||||
,href = othis.attr('lay-href')
|
||||
,router = layui.router();
|
||||
|
||||
admin.tabsPage.elem = othis;
|
||||
//admin.prevRouter[router.path[0]] = router.href; //记录上一次各菜单的路由信息
|
||||
|
||||
//执行跳转
|
||||
location.hash = admin.correctRouter(href);
|
||||
|
||||
//如果为当前页,则执行刷新
|
||||
if(admin.correctRouter(href) === router.href){
|
||||
admin.events.refresh();
|
||||
}
|
||||
});
|
||||
|
||||
//点击事件
|
||||
$body.on('click', '*[layadmin-event]', function(){
|
||||
var othis = $(this)
|
||||
,attrEvent = othis.attr('layadmin-event');
|
||||
events[attrEvent] && events[attrEvent].call(this, othis);
|
||||
});
|
||||
|
||||
//tips
|
||||
$body.on('mouseenter', '*[lay-tips]', function(){
|
||||
var othis = $(this);
|
||||
|
||||
if(othis.parent().hasClass('layui-nav-item') && !container.hasClass(SIDE_SHRINK)) return;
|
||||
|
||||
var tips = othis.attr('lay-tips')
|
||||
,offset = othis.attr('lay-offset')
|
||||
,direction = othis.attr('lay-direction')
|
||||
,index = layer.tips(tips, this, {
|
||||
tips: direction || 1
|
||||
,time: -1
|
||||
,success: function(layero, index){
|
||||
if(offset){
|
||||
layero.css('margin-left', offset + 'px');
|
||||
}
|
||||
}
|
||||
});
|
||||
othis.data('index', index);
|
||||
}).on('mouseleave', '*[lay-tips]', function(){
|
||||
layer.close($(this).data('index'));
|
||||
});
|
||||
|
||||
//窗口resize事件
|
||||
var resizeSystem = layui.data.resizeSystem = function(){
|
||||
//layer.close(events.note.index);
|
||||
layer.closeAll('tips');
|
||||
|
||||
if(!resizeSystem.lock){
|
||||
setTimeout(function(){
|
||||
admin.sideFlexible(admin.screen() < 2 ? '' : 'spread');
|
||||
delete resizeSystem.lock;
|
||||
}, 100);
|
||||
}
|
||||
|
||||
resizeSystem.lock = true;
|
||||
}
|
||||
$win.on('resize', layui.data.resizeSystem);
|
||||
|
||||
|
||||
//设置组件全局 token
|
||||
;!function(){
|
||||
var request = setter.request;
|
||||
if(request.tokenName){
|
||||
var obj = {};
|
||||
obj[request.tokenName] = layui.data(setter.tableName)[request.tokenName] || ''
|
||||
|
||||
//table
|
||||
table.set({
|
||||
headers: obj, //通过 request 头传递
|
||||
where: obj //通过参数传递
|
||||
});
|
||||
//upload
|
||||
upload.set({
|
||||
headers: obj, //通过 request 头传递
|
||||
data: obj //通过参数传递
|
||||
});
|
||||
}
|
||||
}();
|
||||
|
||||
|
||||
//接口输出
|
||||
exports('admin', admin);
|
||||
});
|
||||
@@ -0,0 +1,198 @@
|
||||
/**
|
||||
* 界面入口模块
|
||||
*/
|
||||
|
||||
layui.define('admin', function(exports){
|
||||
var setter = layui.setter;
|
||||
var element = layui.element;
|
||||
var admin = layui.admin;
|
||||
var tabsPage = admin.tabsPage;
|
||||
var view = layui.view;
|
||||
|
||||
//根据路由渲染页面
|
||||
var renderPage = function(){
|
||||
var router = layui.router()
|
||||
,path = router.path
|
||||
,pathURL = admin.correctRouter(router.path.join('/'))
|
||||
|
||||
//默认读取主页
|
||||
if(!path.length) path = [''];
|
||||
|
||||
//如果最后一项为空字符,则读取默认文件
|
||||
if(path[path.length - 1] === ''){
|
||||
path[path.length - 1] = setter.entry;
|
||||
}
|
||||
|
||||
//重置状态
|
||||
var reset = function(type){
|
||||
//renderPage.haveInit && layer.closeAll();
|
||||
if(renderPage.haveInit){
|
||||
$('.layui-layer').each(function(){
|
||||
var othis = $(this),
|
||||
index = othis.attr('times');
|
||||
if(!(othis.hasClass('layui-layim') || othis.hasClass('layui-layim-chat'))){
|
||||
layer.close(index);
|
||||
}
|
||||
});
|
||||
}
|
||||
renderPage.haveInit = true;
|
||||
|
||||
$(APP_BODY).scrollTop(0);
|
||||
delete tabsPage.type; //重置页面标签的来源类型
|
||||
};
|
||||
|
||||
//如果路由来自于 tab 切换,则不重新请求视图
|
||||
if(tabsPage.type === 'tab'){
|
||||
//切换到非主页、或者切换到主页且主页必须有内容。方可阻止请求
|
||||
if(pathURL !== '/' || (pathURL === '/' && admin.tabsBody().html())){
|
||||
admin.tabsBodyChange(tabsPage.index);
|
||||
return reset(tabsPage.type);
|
||||
}
|
||||
}
|
||||
|
||||
//请求视图渲染
|
||||
view().render(path.join('/')).then(function(res){
|
||||
|
||||
//遍历页签选项卡
|
||||
var matchTo
|
||||
,tabs = $('#LAY_app_tabsheader>li');
|
||||
|
||||
tabs.each(function(index){
|
||||
var li = $(this)
|
||||
,layid = li.attr('lay-id');
|
||||
|
||||
if(layid === pathURL){
|
||||
matchTo = true;
|
||||
tabsPage.index = index;
|
||||
}
|
||||
});
|
||||
|
||||
//如果未在选项卡中匹配到,则追加选项卡
|
||||
if(setter.pageTabs && pathURL !== '/'){
|
||||
if(!matchTo){
|
||||
$(APP_BODY).append('<div class="layadmin-tabsbody-item layui-show"></div>');
|
||||
tabsPage.index = tabs.length;
|
||||
element.tabAdd(FILTER_TAB_TBAS, {
|
||||
title: '<span>'+ (res.title || '新标签页') +'</span>'
|
||||
,id: pathURL
|
||||
,attr: router.href
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
this.container = admin.tabsBody(tabsPage.index);
|
||||
setter.pageTabs || this.container.scrollTop(0); //如果不开启标签页,则跳转时重置滚动条
|
||||
|
||||
//定位当前tabs
|
||||
element.tabChange(FILTER_TAB_TBAS, pathURL);
|
||||
admin.tabsBodyChange(tabsPage.index);
|
||||
|
||||
}).done(function(){
|
||||
layui.use('common', layui.cache.callback.common);
|
||||
$win.on('resize', layui.data.resize);
|
||||
|
||||
element.render('breadcrumb', 'breadcrumb');
|
||||
|
||||
//容器 scroll 事件,剔除吸附层
|
||||
admin.tabsBody(tabsPage.index).on('scroll', function(){
|
||||
var othis = $(this)
|
||||
,elemDate = $('.layui-laydate')
|
||||
,layerOpen = $('.layui-layer')[0];
|
||||
|
||||
//关闭 layDate
|
||||
if(elemDate[0]){
|
||||
elemDate.each(function(){
|
||||
var thisElemDate = $(this);
|
||||
thisElemDate.hasClass('layui-laydate-static') || thisElemDate.remove();
|
||||
});
|
||||
othis.find('input').blur();
|
||||
}
|
||||
|
||||
//关闭 Tips 层
|
||||
layerOpen && layer.closeAll('tips');
|
||||
});
|
||||
});
|
||||
|
||||
reset();
|
||||
};
|
||||
|
||||
//入口页面
|
||||
var entryPage = function(fn){
|
||||
var router = layui.router()
|
||||
,container = view(setter.container)
|
||||
,pathURL = admin.correctRouter(router.path.join('/'))
|
||||
,isIndPage;
|
||||
|
||||
//检查是否属于独立页面
|
||||
layui.each(setter.indPage, function(index, item){
|
||||
if(pathURL === item){
|
||||
return isIndPage = true;
|
||||
}
|
||||
});
|
||||
|
||||
//将模块根路径设置为 modules 目录
|
||||
layui.config({
|
||||
base: setter.paths.base + 'modules/'
|
||||
});
|
||||
|
||||
//独立页面
|
||||
if(isIndPage || pathURL === '/user/login'){ //此处单独判断登入页,是为了兼容旧版(即未在 config.js 配置 indPage 的情况)
|
||||
container.render(router.path.join('/')).done(function(){
|
||||
admin.pageType = 'alone';
|
||||
});
|
||||
} else { //后台框架页面
|
||||
|
||||
//强制拦截未登入
|
||||
if(setter.interceptor){
|
||||
var local = layui.data(setter.tableName);
|
||||
if(!local[setter.request.tokenName]){
|
||||
return location.hash = '/user/login/redirect='+ encodeURIComponent(pathURL); //跳转到登入页
|
||||
}
|
||||
}
|
||||
|
||||
//渲染后台结构
|
||||
if(admin.pageType === 'console') { //后台主体页
|
||||
renderPage();
|
||||
} else { //初始控制台结构
|
||||
container.render('layout').done(function(){
|
||||
renderPage();
|
||||
layui.element.render();
|
||||
|
||||
if(admin.screen() < 2){
|
||||
admin.sideFlexible();
|
||||
}
|
||||
admin.pageType = 'console';
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
var APP_BODY = '#LAY_app_body';
|
||||
var FILTER_TAB_TBAS = 'layadmin-layout-tabs';
|
||||
var $ = layui.$, $win = $(window);
|
||||
|
||||
//初始主体结构
|
||||
layui.link(
|
||||
setter.paths.core + 'css/admin.css?v='+ admin.v
|
||||
,function(){
|
||||
entryPage()
|
||||
}
|
||||
,'layuiAdmin'
|
||||
);
|
||||
|
||||
//Hash改变
|
||||
window.onhashchange = function(){
|
||||
entryPage();
|
||||
//执行 {setter.MOD_NAME}.hash 下的事件
|
||||
layui.event.call(this, setter.MOD_NAME, 'hash({*})', layui.router());
|
||||
};
|
||||
|
||||
// 对外输出
|
||||
var adminuiIndex = {
|
||||
render: renderPage
|
||||
};
|
||||
|
||||
$.extend(admin, adminuiIndex);
|
||||
exports('adminIndex', adminuiIndex);
|
||||
});
|
||||
@@ -0,0 +1,347 @@
|
||||
/**
|
||||
* 界面视图模块
|
||||
*/
|
||||
|
||||
layui.define(['laytpl', 'layer'], function(exports){
|
||||
var $ = layui.jquery
|
||||
,laytpl = layui.laytpl
|
||||
,layer = layui.layer
|
||||
,setter = layui.setter
|
||||
,device = layui.device()
|
||||
,hint = layui.hint()
|
||||
|
||||
//对外接口
|
||||
,view = function(id){
|
||||
return new Class(id);
|
||||
}
|
||||
|
||||
,SHOW = 'layui-show', LAY_BODY = 'LAY_app_body'
|
||||
|
||||
//构造器
|
||||
,Class = function(id){
|
||||
this.id = id;
|
||||
this.container = $('#'+(id || LAY_BODY));
|
||||
};
|
||||
|
||||
//加载中
|
||||
view.loading = function(elem){
|
||||
elem.append(
|
||||
this.elemLoad = $('<i class="layui-anim layui-anim-rotate layui-anim-loop layui-icon layui-icon-loading layadmin-loading"></i>')
|
||||
);
|
||||
};
|
||||
|
||||
//移除加载
|
||||
view.removeLoad = function(){
|
||||
this.elemLoad && this.elemLoad.remove();
|
||||
};
|
||||
|
||||
//清除 token,并跳转到登入页
|
||||
view.exit = function(){
|
||||
//清空本地记录的 token
|
||||
layui.data(setter.tableName, {
|
||||
key: setter.request.tokenName
|
||||
,remove: true
|
||||
});
|
||||
|
||||
//跳转到登入页
|
||||
location.hash = '/user/login';
|
||||
};
|
||||
|
||||
//Ajax请求
|
||||
view.req = function(options){
|
||||
var that = this
|
||||
,success = options.success
|
||||
,error = options.error
|
||||
,request = setter.request
|
||||
,response = setter.response
|
||||
,debug = function(){
|
||||
return setter.debug
|
||||
? '<br><cite>URL:</cite>' + options.url
|
||||
: '';
|
||||
};
|
||||
|
||||
options.data = options.data || {};
|
||||
options.headers = options.headers || {};
|
||||
|
||||
if(request.tokenName){
|
||||
var sendData = typeof options.data === 'string'
|
||||
? JSON.parse(options.data)
|
||||
: options.data;
|
||||
|
||||
//自动给参数传入默认 token
|
||||
options.data[request.tokenName] = request.tokenName in sendData
|
||||
? options.data[request.tokenName]
|
||||
: (layui.data(setter.tableName)[request.tokenName] || '');
|
||||
|
||||
//自动给 Request Headers 传入 token
|
||||
options.headers[request.tokenName] = request.tokenName in options.headers
|
||||
? options.headers[request.tokenName]
|
||||
: (layui.data(setter.tableName)[request.tokenName] || '');
|
||||
}
|
||||
|
||||
delete options.success;
|
||||
delete options.error;
|
||||
|
||||
return $.ajax($.extend({
|
||||
type: 'get'
|
||||
,dataType: 'json'
|
||||
,success: function(res){
|
||||
var statusCode = response.statusCode;
|
||||
|
||||
//只有 response 的 code 一切正常才执行 done
|
||||
if(res[response.statusName] == statusCode.ok) {
|
||||
typeof options.done === 'function' && options.done(res);
|
||||
}
|
||||
|
||||
//登录状态失效,清除本地 access_token,并强制跳转到登入页
|
||||
else if(res[response.statusName] == statusCode.logout){
|
||||
view.exit();
|
||||
}
|
||||
|
||||
//其它异常
|
||||
else {
|
||||
var errorText = [
|
||||
'<cite>Error:</cite> ' + (res[response.msgName] || '返回状态码异常')
|
||||
,debug()
|
||||
].join('');
|
||||
view.error(errorText);
|
||||
}
|
||||
|
||||
//只要 http 状态码正常,无论 response 的 code 是否正常都执行 success
|
||||
typeof success === 'function' && success(res);
|
||||
}
|
||||
,error: function(e, code){
|
||||
var errorText = [
|
||||
'请求异常,请重试<br><cite>错误信息:</cite>'+ code
|
||||
,debug()
|
||||
].join('');
|
||||
view.error(errorText);
|
||||
|
||||
typeof error === 'function' && error.apply(this, arguments);
|
||||
}
|
||||
}, options));
|
||||
};
|
||||
|
||||
//弹窗
|
||||
view.popup = function(options){
|
||||
var success = options.success
|
||||
,skin = options.skin;
|
||||
|
||||
delete options.success;
|
||||
delete options.skin;
|
||||
|
||||
return layer.open($.extend({
|
||||
type: 1
|
||||
,title: '提示'
|
||||
,content: ''
|
||||
,id: 'LAY-system-view-popup'
|
||||
,skin: 'layui-layer-admin' + (skin ? ' ' + skin : '')
|
||||
,shadeClose: true
|
||||
,closeBtn: false
|
||||
,success: function(layero, index){
|
||||
var elemClose = $('<i class="layui-icon" close>ဆ</i>');
|
||||
layero.append(elemClose);
|
||||
elemClose.on('click', function(){
|
||||
layer.close(index);
|
||||
});
|
||||
typeof success === 'function' && success.apply(this, arguments);
|
||||
}
|
||||
}, options))
|
||||
};
|
||||
|
||||
//异常提示
|
||||
view.error = function(content, options){
|
||||
return view.popup($.extend({
|
||||
content: content
|
||||
,maxWidth: 300
|
||||
//,shade: 0.01
|
||||
,offset: 't'
|
||||
,anim: 6
|
||||
,id: 'LAY_adminError'
|
||||
}, options))
|
||||
};
|
||||
|
||||
|
||||
//请求模板文件渲染
|
||||
Class.prototype.render = function(views, params){
|
||||
var that = this, router = layui.router();
|
||||
views = (
|
||||
setter.paths && setter.paths.views
|
||||
? setter.paths.views
|
||||
: setter.views
|
||||
) + views + setter.engine;
|
||||
|
||||
$('#'+ LAY_BODY).children('.layadmin-loading').remove();
|
||||
view.loading(that.container); //loading
|
||||
|
||||
//请求模板
|
||||
$.ajax({
|
||||
url: views
|
||||
,type: 'get'
|
||||
,dataType: 'html'
|
||||
,data: {
|
||||
v: layui.cache.version
|
||||
}
|
||||
,success: function(html){
|
||||
html = '<div>' + html + '</div>';
|
||||
|
||||
var elemTitle = $(html).find('title')
|
||||
,title = elemTitle.text() || (html.match(/\<title\>([\s\S]*)\<\/title>/)||[])[1];
|
||||
|
||||
var res = {
|
||||
title: title
|
||||
,body: html
|
||||
};
|
||||
|
||||
elemTitle.remove();
|
||||
that.params = params || {}; //获取参数
|
||||
|
||||
if(that.then){
|
||||
that.then(res);
|
||||
delete that.then;
|
||||
}
|
||||
|
||||
that.parse(html);
|
||||
view.removeLoad();
|
||||
|
||||
if(that.done){
|
||||
that.done(res);
|
||||
delete that.done;
|
||||
}
|
||||
|
||||
}
|
||||
,error: function(e){
|
||||
view.removeLoad();
|
||||
|
||||
if(that.render.isError){
|
||||
return view.error('请求视图文件异常,状态:'+ e.status);
|
||||
};
|
||||
|
||||
if(e.status === 404){
|
||||
that.render('template/tips/404');
|
||||
} else {
|
||||
that.render('template/tips/error');
|
||||
}
|
||||
|
||||
that.render.isError = true;
|
||||
}
|
||||
});
|
||||
return that;
|
||||
};
|
||||
|
||||
//解析模板
|
||||
Class.prototype.parse = function(html, refresh, callback){
|
||||
var that = this
|
||||
,isScriptTpl = typeof html === 'object' //是否模板元素
|
||||
,elem = isScriptTpl ? html : $(html)
|
||||
,elemTemp = isScriptTpl ? html : elem.find('*[template]')
|
||||
,fn = function(options){
|
||||
var tpl = laytpl(options.dataElem.html())
|
||||
,res = $.extend({
|
||||
params: router.params
|
||||
}, options.res);
|
||||
|
||||
options.dataElem.after(tpl.render(res));
|
||||
typeof callback === 'function' && callback();
|
||||
|
||||
try {
|
||||
options.done && new Function('d', options.done)(res);
|
||||
} catch(e){
|
||||
console.error(options.dataElem[0], '\n存在错误回调脚本\n\n', e)
|
||||
}
|
||||
}
|
||||
,router = layui.router();
|
||||
|
||||
elem.find('title').remove();
|
||||
that.container[refresh ? 'after' : 'html'](elem.children());
|
||||
|
||||
router.params = that.params || {};
|
||||
|
||||
//遍历模板区块
|
||||
for(var i = elemTemp.length; i > 0; i--){
|
||||
(function(){
|
||||
var dataElem = elemTemp.eq(i - 1)
|
||||
,layDone = dataElem.attr('lay-done') || dataElem.attr('lay-then') //获取回调
|
||||
,url = laytpl(dataElem.attr('lay-url')|| '').render(router) //接口 url
|
||||
,data = laytpl(dataElem.attr('lay-data')|| '').render(router) //接口参数
|
||||
,headers = laytpl(dataElem.attr('lay-headers')|| '').render(router); //接口请求的头信息
|
||||
|
||||
try {
|
||||
data = new Function('return '+ data + ';')();
|
||||
} catch(e) {
|
||||
hint.error('lay-data: ' + e.message);
|
||||
data = {};
|
||||
};
|
||||
|
||||
try {
|
||||
headers = new Function('return '+ headers + ';')();
|
||||
} catch(e) {
|
||||
hint.error('lay-headers: ' + e.message);
|
||||
headers = headers || {}
|
||||
};
|
||||
|
||||
if(url){
|
||||
view.req({
|
||||
type: dataElem.attr('lay-type') || 'get'
|
||||
,url: url
|
||||
,data: data
|
||||
,dataType: 'json'
|
||||
,headers: headers
|
||||
,success: function(res){
|
||||
fn({
|
||||
dataElem: dataElem
|
||||
,res: res
|
||||
,done: layDone
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
fn({
|
||||
dataElem: dataElem
|
||||
,done: layDone
|
||||
});
|
||||
}
|
||||
}());
|
||||
}
|
||||
|
||||
return that;
|
||||
};
|
||||
|
||||
//直接渲染字符
|
||||
Class.prototype.send = function(views, data){
|
||||
var tpl = laytpl(views || this.container.html()).render(data || {});
|
||||
this.container.html(tpl);
|
||||
return this;
|
||||
};
|
||||
|
||||
//局部刷新模板
|
||||
Class.prototype.refresh = function(callback){
|
||||
var that = this
|
||||
,next = that.container.next()
|
||||
,templateid = next.attr('lay-templateid');
|
||||
|
||||
if(that.id != templateid) return that;
|
||||
|
||||
that.parse(that.container, 'refresh', function(){
|
||||
that.container.siblings('[lay-templateid="'+ that.id +'"]:last').remove();
|
||||
typeof callback === 'function' && callback();
|
||||
});
|
||||
|
||||
return that;
|
||||
};
|
||||
|
||||
//视图请求成功后的回调
|
||||
Class.prototype.then = function(callback){
|
||||
this.then = callback;
|
||||
return this;
|
||||
};
|
||||
|
||||
//视图渲染完毕后的回调
|
||||
Class.prototype.done = function(callback){
|
||||
this.done = callback;
|
||||
return this;
|
||||
};
|
||||
|
||||
//对外接口
|
||||
exports('view', view);
|
||||
});
|
||||
@@ -1,159 +1,174 @@
|
||||
/*!
|
||||
* 全局配置
|
||||
/**
|
||||
* setter
|
||||
*/
|
||||
layui.define(['laytpl', 'layer', 'element', 'util'], function (exports) {
|
||||
|
||||
// 初始化配置
|
||||
layui.define(['all'], function (exports) {
|
||||
exports('setter', {
|
||||
container: 'LAY_app' //容器ID
|
||||
, base: layui.cache.base //记录layuiAdmin文件夹所在路径
|
||||
//, views: layui.cache.base + 'views/' //视图所在目录
|
||||
, views: '/views/' //视图所在目录
|
||||
, entry: 'index' //默认视图文件名
|
||||
, engine: '.html' //视图文件后缀名
|
||||
, pageTabs: false //是否开启页面选项卡功能。单页版不推荐开启
|
||||
paths: { // v1.9.0 及以上版本的写法
|
||||
core: layui.cache.base + 'adminui/dist/', // 核心库所在目录
|
||||
//views: layui.cache.base + 'views/', // 业务视图所在目录
|
||||
views: '/views/', //视图所在目录
|
||||
modules: layui.cache.base + 'modules/', // 业务模块所在目录
|
||||
base: layui.cache.base // 记录静态资源所在基础目录
|
||||
},
|
||||
/* v1.9.0 之前的写法
|
||||
views: layui.cache.base + 'views/', // 业务视图所在目录
|
||||
base: layui.cache.base, // 记录静态资源所在基础目录
|
||||
*/
|
||||
|
||||
, name: '核心商城系统'
|
||||
, version: '0.6.6'
|
||||
, tableName: 'CoreCms' //本地存储表名
|
||||
, MOD_NAME: 'admin' //模块事件名
|
||||
container: 'LAY_app', // 容器ID
|
||||
entry: 'index', // 默认视图文件名
|
||||
engine: '.html', // 视图文件后缀名
|
||||
pageTabs: false, // 是否开启页面选项卡功能。单页版不推荐开启
|
||||
|
||||
, debug: true //是否开启调试模式。如开启,接口异常时会抛出异常 URL 等信息
|
||||
name: '核心商城系统',
|
||||
version: 'CoreShop v1.0',
|
||||
name: 'layuiAdmin',
|
||||
tableName: 'CoreShop', // 本地存储表名
|
||||
MOD_NAME: 'admin', // 模块事件名
|
||||
|
||||
, interceptor: false //是否开启未登入拦截
|
||||
|
||||
//自定义请求字段
|
||||
, request: {
|
||||
tokenName: 'Authorization' //自动携带 token 的字段名。可设置 false 不携带。
|
||||
}
|
||||
debug: true, // 是否开启调试模式。如开启,接口异常时会抛出异常 URL 等信息
|
||||
interceptor: false, // 是否开启未登入拦截
|
||||
|
||||
//额外增加
|
||||
, apiUrl: '/' //api请求地址
|
||||
, fileUrl: '/' //资源请求地址
|
||||
, noImagePicUrl: 'https://files.cdn.coreshop.cn/static/images/empty/noImage.jpg' //api请求地址
|
||||
apiUrl: '/', //api请求地址
|
||||
fileUrl: '/', //资源请求地址
|
||||
noImagePicUrl: layui.cache.base + 'style/imgs/noImage.jpg', //api请求地址
|
||||
|
||||
//自定义响应字段
|
||||
, response: {
|
||||
statusName: 'code' //数据状态的字段名称
|
||||
, statusCode: {
|
||||
ok: 0 //数据状态一切正常的状态码
|
||||
, logout: 401 //登录状态失效的状态码
|
||||
, error: 1 //系统返回异常数据提醒
|
||||
}
|
||||
, msgName: 'msg' //状态信息的字段名称
|
||||
, dataName: 'data' //数据详情的字段名称
|
||||
}
|
||||
// 自定义请求字段
|
||||
request: {
|
||||
tokenName: 'Authorization' // 自动携带 token 的字段名。可设置 false 不携带。
|
||||
},
|
||||
|
||||
//独立页面路由,可随意添加(无需写参数)
|
||||
, indPage: [
|
||||
'/user/login' //登入页
|
||||
]
|
||||
// 自定义响应字段
|
||||
response: {
|
||||
statusName: 'code', // 数据状态的字段名称
|
||||
statusCode: {
|
||||
ok: 0, // 数据状态一切正常的状态码
|
||||
logout: 401, // 登录状态失效的状态码
|
||||
error: 1 //系统返回异常数据提醒
|
||||
},
|
||||
msgName: 'msg', // 状态信息的字段名称
|
||||
dataName: 'data' // 数据详情的字段名称
|
||||
},
|
||||
|
||||
//扩展的模块(相对于 lib/extend 目录)
|
||||
, extend: {
|
||||
// 独立页面路由,可随意添加(无需写参数)
|
||||
indPage: [
|
||||
'/user/login', // 登入页
|
||||
'/user/reg', // 注册页
|
||||
'/user/forget', // 找回密码
|
||||
'/template/tips/test' // 独立页的一个测试 demo
|
||||
],
|
||||
|
||||
// 配置业务模块目录中的特殊模块
|
||||
extend: {
|
||||
layim: 'layim/layim', // layim
|
||||
echarts: 'echarts', //第三方 echarts 核心包
|
||||
echartsTheme: 'echartsTheme', //第三方 echarts 主题
|
||||
treeGrid: 'treeGrid', //treeGrid
|
||||
coreHelper: 'coreHelper', //常用操作封装
|
||||
dtree: 'dtree', //常用操作封装
|
||||
}
|
||||
},
|
||||
|
||||
//主题配置
|
||||
, theme: {
|
||||
//内置主题配色方案
|
||||
// 主题配置
|
||||
theme: {
|
||||
// 内置主题配色方案
|
||||
color: [{
|
||||
main: '#20222A' //主题色
|
||||
, selected: '#009688' //选中色
|
||||
, alias: 'default' //默认别名
|
||||
main: '#20222A', // 主题色
|
||||
selected: '#009688', // 选中色
|
||||
alias: 'default' // 默认别名
|
||||
}, {
|
||||
main: '#03152A'
|
||||
, selected: '#3B91FF'
|
||||
, alias: 'dark-blue' //藏蓝
|
||||
main: '#03152A',
|
||||
selected: '#3B91FF',
|
||||
alias: 'dark-blue' // 藏蓝
|
||||
}, {
|
||||
main: '#2E241B'
|
||||
, selected: '#A48566'
|
||||
, alias: 'coffee' //咖啡
|
||||
main: '#2E241B',
|
||||
selected: '#A48566',
|
||||
alias: 'coffee' // 咖啡
|
||||
}, {
|
||||
main: '#50314F'
|
||||
, selected: '#7A4D7B'
|
||||
, alias: 'purple-red' //紫红
|
||||
main: '#50314F',
|
||||
selected: '#7A4D7B',
|
||||
alias: 'purple-red' // 紫红
|
||||
}, {
|
||||
main: '#344058'
|
||||
, logo: '#1E9FFF'
|
||||
, selected: '#1E9FFF'
|
||||
, alias: 'ocean' //海洋
|
||||
main: '#344058',
|
||||
logo: '#1E9FFF',
|
||||
selected: '#1E9FFF',
|
||||
alias: 'ocean' // 海洋
|
||||
}, {
|
||||
main: '#3A3D49'
|
||||
, logo: '#2F9688'
|
||||
, selected: '#5FB878'
|
||||
, alias: 'green' //墨绿
|
||||
main: '#3A3D49',
|
||||
logo: '#2F9688',
|
||||
selected: '#5FB878',
|
||||
alias: 'green' // 墨绿
|
||||
}, {
|
||||
main: '#20222A'
|
||||
, logo: '#F78400'
|
||||
, selected: '#F78400'
|
||||
, alias: 'red' //橙色
|
||||
main: '#20222A',
|
||||
logo: '#F78400',
|
||||
selected: '#F78400',
|
||||
alias: 'red' // 橙色
|
||||
}, {
|
||||
main: '#28333E'
|
||||
, logo: '#AA3130'
|
||||
, selected: '#AA3130'
|
||||
, alias: 'fashion-red' //时尚红
|
||||
main: '#28333E',
|
||||
logo: '#AA3130',
|
||||
selected: '#AA3130',
|
||||
alias: 'fashion-red' // 时尚红
|
||||
}, {
|
||||
main: '#24262F'
|
||||
, logo: '#3A3D49'
|
||||
, selected: '#009688'
|
||||
, alias: 'classic-black' //经典黑
|
||||
main: '#24262F',
|
||||
logo: '#3A3D49',
|
||||
selected: '#009688',
|
||||
alias: 'classic-black' // 经典黑
|
||||
}, {
|
||||
logo: '#226A62'
|
||||
, header: '#2F9688'
|
||||
, alias: 'green-header' //墨绿头
|
||||
logo: '#226A62',
|
||||
header: '#2F9688',
|
||||
alias: 'green-header' // 墨绿头
|
||||
}, {
|
||||
main: '#344058'
|
||||
, logo: '#0085E8'
|
||||
, selected: '#1E9FFF'
|
||||
, header: '#1E9FFF'
|
||||
, alias: 'ocean-header' //海洋头
|
||||
main: '#344058',
|
||||
logo: '#0085E8',
|
||||
selected: '#1E9FFF',
|
||||
header: '#1E9FFF',
|
||||
alias: 'ocean-header' // 海洋头
|
||||
}, {
|
||||
header: '#393D49'
|
||||
, alias: 'classic-black-header' //经典黑
|
||||
header: '#393D49',
|
||||
alias: 'classic-black-header' // 经典黑
|
||||
}, {
|
||||
main: '#50314F'
|
||||
, logo: '#50314F'
|
||||
, selected: '#7A4D7B'
|
||||
, header: '#50314F'
|
||||
, alias: 'purple-red-header' //紫红头
|
||||
main: '#50314F',
|
||||
logo: '#50314F',
|
||||
selected: '#7A4D7B',
|
||||
header: '#50314F',
|
||||
alias: 'purple-red-header' // 紫红头
|
||||
}, {
|
||||
main: '#28333E'
|
||||
, logo: '#28333E'
|
||||
, selected: '#AA3130'
|
||||
, header: '#AA3130'
|
||||
, alias: 'fashion-red-header' //时尚红头
|
||||
main: '#28333E',
|
||||
logo: '#28333E',
|
||||
selected: '#AA3130',
|
||||
header: '#AA3130',
|
||||
alias: 'fashion-red-header' // 时尚红头
|
||||
}, {
|
||||
main: '#28333E'
|
||||
, logo: '#009688'
|
||||
, selected: '#009688'
|
||||
, header: '#009688'
|
||||
, alias: 'green-header' //墨绿头
|
||||
main: '#28333E',
|
||||
logo: '#009688',
|
||||
selected: '#009688',
|
||||
header: '#009688',
|
||||
alias: 'green-header' // 墨绿头
|
||||
}, {
|
||||
main: '#393D49'
|
||||
, logo: '#393D49'
|
||||
, selected: '#009688'
|
||||
, header: '#23262E'
|
||||
, alias: 'Classic-style1' //经典风格1
|
||||
main: '#393D49',
|
||||
logo: '#393D49',
|
||||
selected: '#009688',
|
||||
header: '#23262E',
|
||||
alias: 'Classic-style1' // 经典风格1
|
||||
}, {
|
||||
main: '#001529'
|
||||
, logo: '#001529'
|
||||
, selected: '#1890FF'
|
||||
, header: '#1890FF'
|
||||
, alias: 'Classic-style2' //经典风格2
|
||||
main: '#001529',
|
||||
logo: '#001529',
|
||||
selected: '#1890FF',
|
||||
header: '#1890FF',
|
||||
alias: 'Classic-style2' // 经典风格2
|
||||
}, {
|
||||
main: '#25282A'
|
||||
, logo: '#25282A'
|
||||
, selected: '#35BDB2'
|
||||
, header: '#35BDB2'
|
||||
, alias: 'Classic-style3' //经典风格3
|
||||
}]
|
||||
main: '#25282A',
|
||||
logo: '#25282A',
|
||||
selected: '#35BDB2',
|
||||
header: '#35BDB2',
|
||||
alias: 'Classic-style3' // 经典风格3
|
||||
}],
|
||||
|
||||
//初始的颜色索引,对应上面的配色方案数组索引
|
||||
//如果本地已经有主题色记录,则以本地记录为优先,除非请求本地数据(localStorage)
|
||||
, initColorIndex: 14
|
||||
// 初始的颜色索引,对应上面的配色方案数组索引
|
||||
// 如果本地已经有主题色记录,则以本地记录为优先,除非请求本地数据(localStorage)
|
||||
initColorIndex: 14
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
/** layuiAdmin.pro-v1.7.0 LPPL License */
|
||||
; layui.define(function (e) {
|
||||
var i = (layui.$, layui.layer, layui.laytpl, layui.setter, layui.view, layui.admin); i.events.logout = function () {
|
||||
i.exit();
|
||||
//i.req({
|
||||
// url: "./json/user/logout.js", type: "get", data: {}, done: function (e) {
|
||||
// i.exit()
|
||||
// }
|
||||
//})
|
||||
}, e("common", {})
|
||||
});
|
||||
@@ -1,2 +0,0 @@
|
||||
/** layuiAdmin.pro-v1.7.0 LPPL License */
|
||||
;layui.define(["table","form"],function(t){var e=(layui.$,layui.admin),i=layui.view,n=layui.table,l=layui.form;n.render({elem:"#LAY-app-content-list",url:"./json/content/list.js",cols:[[{type:"checkbox",fixed:"left"},{field:"id",width:100,title:"文章ID",sort:!0},{field:"label",title:"文章标签",minWidth:100},{field:"title",title:"文章标题"},{field:"author",title:"作者"},{field:"uploadtime",title:"上传时间",sort:!0},{field:"status",title:"发布状态",templet:"#buttonTpl",minWidth:80,align:"center"},{title:"操作",minWidth:150,align:"center",fixed:"right",toolbar:"#table-content-list"}]],page:!0,limit:10,limits:[10,15,20,25,30],text:"对不起,加载出现异常!"}),n.on("tool(LAY-app-content-list)",function(t){var n=t.data;"del"===t.event?layer.confirm("确定删除此文章?",function(e){t.del(),layer.close(e)}):"edit"===t.event&&e.popup({title:"编辑文章",area:["550px","550px"],id:"LAY-popup-content-edit",success:function(t,e){i(this.id).render("app/content/listform",n).done(function(){l.render(null,"layuiadmin-app-form-list"),l.on("submit(layuiadmin-app-form-submit)",function(t){t.field;layui.table.reload("LAY-app-content-list"),layer.close(e)})})}})}),n.render({elem:"#LAY-app-content-tags",url:"./json/content/tags.js",cols:[[{type:"numbers",fixed:"left"},{field:"id",width:100,title:"ID",sort:!0},{field:"tags",title:"分类名",minWidth:100},{title:"操作",width:150,align:"center",fixed:"right",toolbar:"#layuiadmin-app-cont-tagsbar"}]],text:"对不起,加载出现异常!"}),n.on("tool(LAY-app-content-tags)",function(t){var n=t.data;"del"===t.event?layer.confirm("确定删除此分类?",function(e){t.del(),layer.close(e)}):"edit"===t.event&&e.popup({title:"编辑分类",area:["450px","200px"],id:"LAY-popup-content-tags",success:function(t,e){i(this.id).render("app/content/tagsform",n).done(function(){l.render(null,"layuiadmin-form-tags"),l.on("submit(layuiadmin-app-tags-submit)",function(t){t.field;layui.table.reload("LAY-app-content-tags"),layer.close(e)})})}})}),n.render({elem:"#LAY-app-content-comm",url:"./json/content/comment.js",cols:[[{type:"checkbox",fixed:"left"},{field:"id",width:100,title:"ID",sort:!0},{field:"reviewers",title:"评论者",minWidth:100},{field:"content",title:"评论内容",minWidth:100},{field:"commtime",title:"评论时间",minWidth:100,sort:!0},{title:"操作",width:150,align:"center",fixed:"right",toolbar:"#table-content-com"}]],page:!0,limit:10,limits:[10,15,20,25,30],text:"对不起,加载出现异常!"}),n.on("tool(LAY-app-content-comm)",function(t){var n=t.data;"del"===t.event?layer.confirm("确定删除此条评论?",function(e){t.del(),layer.close(e)}):"edit"===t.event&&e.popup({title:"编辑评论",area:["450px","300px"],id:"LAY-popup-content-comm",success:function(t,e){i(this.id).render("app/content/contform",n).done(function(){l.render(null,"layuiadmin-form-comment"),l.on("submit(layuiadmin-app-com-submit)",function(t){t.field;layui.table.reload("LAY-app-content-comm"),layer.close(e)})})}})}),t("contlist",{})});
|
||||
43
CoreCms.Net.Web.Admin/wwwroot/lib/layuiAdmin/index.es5.js
Normal file
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* 初始化主题入口模块
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
layui.extend({
|
||||
setter: 'config' // 将 config.js 扩展到 layui 模块
|
||||
}).define(['setter'], function (exports) {
|
||||
var setter = layui.setter;
|
||||
|
||||
// 将核心库扩展到 layui 模块
|
||||
layui.each({
|
||||
admin: 'admin',
|
||||
view: 'view',
|
||||
adminIndex: 'index'
|
||||
}, function (modName, fileName) {
|
||||
var libs = {};
|
||||
libs[modName] = '{/}' + setter.paths.core + '/modules/' + fileName;
|
||||
layui.extend(libs);
|
||||
});
|
||||
|
||||
// 指定业务模块基础目录
|
||||
layui.config({
|
||||
base: setter.paths.modules
|
||||
});
|
||||
|
||||
// 将业务模块中的特殊模块扩展到 layui 模块
|
||||
layui.each(setter.extend, function (key, value) {
|
||||
var mods = {};
|
||||
mods[key] = '{/}' + layui.cache.base + value;
|
||||
layui.extend(mods);
|
||||
});
|
||||
|
||||
// 加载主题核心库入口模块
|
||||
layui.use('adminIndex', function () {
|
||||
layui.use('common'); // 加载公共业务模块,如不需要可剔除
|
||||
|
||||
// 输出模块 / 模块加载完毕标志
|
||||
exports('index', layui.admin);
|
||||
});
|
||||
});
|
||||
|
||||
1
CoreCms.Net.Web.Admin/wwwroot/lib/layuiAdmin/index.es5.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";layui.extend({setter:"config"}).define(["setter"],function(n){var t=layui.setter;layui.each({admin:"admin",view:"view",adminIndex:"index"},function(n,i){var r={};r[n]="{/}"+t.paths.core+"/modules/"+i;layui.extend(r)});layui.config({base:t.paths.modules});layui.each(t.extend,function(n,t){var i={};i[n]="{/}"+layui.cache.base+t;layui.extend(i)});layui.use("adminIndex",function(){layui.use("common");n("index",layui.admin)})});
|
||||
@@ -1,2 +1,40 @@
|
||||
/** layuiAdmin.pro-v1.7.0 LPPL License */
|
||||
; layui.extend({ setter: "config", admin: "lib/admin", view: "lib/view", breadcrumb: 'controller/breadcrumb' }).define(["setter", "admin", "breadcrumb"],function(e){console.log(`\n %c \u6838\u5fc3\u5546\u57ce\u7cfb\u7edf\u0020\u0043\u006f\u0072\u0065\u0053\u0068\u006f\u0070 V${layui.setter.version} %c \u0068\u0074\u0074\u0070\u0073\u003a\u002f\u002f\u0077\u0077\u0077\u002e\u0063\u006f\u0072\u0065\u0073\u0068\u006f\u0070\u002e\u0063\u006e\u002f \n\n`, 'color: #ffffff; background: #3c9cff; padding:5px 0;', 'color: #3c9cff;background: #f1f1f1; padding:5px 0;');var a=layui.setter,n=layui.element,i=layui.admin,t=i.tabsPage,l=layui.view,r=function(){var e=layui.router(),o=e.path,y=i.correctRouter(e.path.join("/"));o.length||(o=[""]),""===o[o.length-1]&&(o[o.length-1]=a.entry);var h=function(e){r.haveInit&&d(".layui-layer").each(function(){var e=d(this),a=e.attr("times");e.hasClass("layui-layim")||layer.close(a)}),r.haveInit=!0,d(s).scrollTop(0),delete t.type};return"tab"===t.type&&("/"!==y||"/"===y&&i.tabsBody().html())?(i.tabsBodyChange(t.index),h(t.type)):(l().render(o.join("/")).then(function(l){var r,o=d("#LAY_app_tabsheader>li");o.each(function(e){var a=d(this),n=a.attr("lay-id");n===y&&(r=!0,t.index=e)}),a.pageTabs&&"/"!==y&&(r||(d(s).append('<div class="layadmin-tabsbody-item layui-show"></div>'),t.index=o.length,n.tabAdd(u,{title:"<span>"+(l.title||"新标签页")+"</span>",id:y,attr:e.href}))),this.container=i.tabsBody(t.index),a.pageTabs||this.container.scrollTop(0),n.tabChange(u,y),i.tabsBodyChange(t.index)}).done(function(){layui.use("common",layui.cache.callback.common),c.on("resize",layui.data.resize),n.render("breadcrumb","breadcrumb"),i.tabsBody(t.index).on("scroll",function(){var e=d(this),a=d(".layui-laydate"),n=d(".layui-layer")[0];a[0]&&(a.each(function(){var e=d(this);e.hasClass("layui-laydate-static")||e.remove()}),e.find("input").blur()),n&&layer.closeAll("tips")})}),void h())},o=function(e){var n,t=layui.router(),o=l(a.container),s=i.correctRouter(t.path.join("/"));if(layui.each(a.indPage,function(e,a){if(s===a)return n=!0}),layui.config({base:a.base+"controller/"}),n||"/user/login"===s)o.render(t.path.join("/")).done(function(){i.pageType="alone"});else{if(a.interceptor){var u=layui.data(a.tableName);if(!u[a.request.tokenName])return location.hash="/user/login/redirect="+encodeURIComponent(s)}"console"===i.pageType?r():o.render("layout").done(function(){r(),layui.element.render(),i.screen()<2&&i.sideFlexible(),i.pageType="console"})}},s="#LAY_app_body",u="layadmin-layout-tabs",d=layui.$,c=d(window);layui.link(a.base+"style/admin.css?v="+(i.v+"-1"),function(){o()},"layuiAdmin"),window.onhashchange=function(){o(),layui.event.call(this,a.MOD_NAME,"hash({*})",layui.router())},layui.each(a.extend,function(e,n){var i={},t=a.extend.constructor===Array;i[t?n:e]="{/}"+a.base+"lib/extend/"+n,layui.extend(i)}),e("index",{render:r})});
|
||||
/**
|
||||
* 初始化主题入口模块
|
||||
*/
|
||||
|
||||
layui.extend({
|
||||
setter: 'config' // 将 config.js 扩展到 layui 模块
|
||||
}).define(['setter'], function(exports){
|
||||
var setter = layui.setter;
|
||||
|
||||
// 将核心库扩展到 layui 模块
|
||||
layui.each({
|
||||
admin: 'admin',
|
||||
view: 'view',
|
||||
adminIndex: 'index'
|
||||
}, function(modName, fileName){
|
||||
var libs = {};
|
||||
libs[modName] = '{/}'+ setter.paths.core +'/modules/'+ fileName;
|
||||
layui.extend(libs);
|
||||
});
|
||||
|
||||
// 指定业务模块基础目录
|
||||
layui.config({
|
||||
base: setter.paths.modules
|
||||
});
|
||||
|
||||
// 将业务模块中的特殊模块扩展到 layui 模块
|
||||
layui.each(setter.extend, function(key, value){
|
||||
var mods = {};
|
||||
mods[key] = '{/}' + layui.cache.base + value;
|
||||
layui.extend(mods);
|
||||
});
|
||||
|
||||
// 加载主题核心库入口模块
|
||||
layui.use('adminIndex', function(){
|
||||
layui.use('common'); // 加载公共业务模块,如不需要可剔除
|
||||
|
||||
// 输出模块 / 模块加载完毕标志
|
||||
exports('index', layui.admin);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-view{display:block;position:relative;margin:10px 0;padding:0;border:1px solid #eee;border-left-width:6px;background-color:#fafafa;color:#333;font-family:Courier New;font-size:13px}.layui-code-title{position:relative;padding:0 10px;height:40px;line-height:40px;border-bottom:1px solid #eee;font-size:12px}.layui-code-title>.layui-code-about{position:absolute;right:10px;top:0;color:#b7b7b7}.layui-code-about>a{padding-left:10px}.layui-code-view>.layui-code-ol,.layui-code-view>.layui-code-ul{position:relative;overflow:auto}.layui-code-view>.layui-code-ol>li{position:relative;margin-left:45px;line-height:20px;padding:0 10px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view>.layui-code-ol>li:first-child,.layui-code-view>.layui-code-ul>li:first-child{padding-top:10px}.layui-code-view>.layui-code-ol>li:last-child,.layui-code-view>.layui-code-ul>li:last-child{padding-bottom:10px}.layui-code-view>.layui-code-ul>li{position:relative;line-height:20px;padding:0 10px;list-style-type:none;*list-style-type:none;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-dark{border:1px solid #0c0c0c;border-left-color:#3f3f3f;background-color:#0c0c0c;color:#c2be9e}.layui-code-dark>.layui-code-title{border-bottom:none}.layui-code-dark>.layui-code-ol>li,.layui-code-dark>.layui-code-ul>li{background-color:#3f3f3f;border-left:none}.layui-code-dark>.layui-code-ul>li{margin-left:6px}.layui-code-demo .layui-code{visibility:visible!important;margin:-15px;border-top:none;border-right:none;border-bottom:none}.layui-code-demo .layui-tab-content{padding:15px;border-top:none}
|
||||
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 701 B After Width: | Height: | Size: 701 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
@@ -28,8 +28,6 @@
|
||||
|
||||
<glyph glyph-name="clear" unicode="" d="M508.412288-59.874413000000004c-246.585071 0-447.224718 200.684672-447.224718 447.441659 0 246.738567 200.639646 447.448822 447.224718 447.448822 246.622934 0 447.2503-200.710254 447.2503-447.448822C955.661565 140.81025899999997 755.035222-59.874413000000004 508.412288-59.874413000000004zM685.286672 527.07151l-45.177945 45.215808L504.588193 436.690036 369.06766 572.287317l-45.184085-45.215808 135.520533-135.591141L323.883575 255.88411099999996l45.184085-45.184085 135.520533 135.583978 135.520533-135.583978 45.177945 45.184085L549.766139 391.480368 685.286672 527.07151z" horiz-adv-x="1024" />
|
||||
|
||||
<glyph glyph-name="keyboard" unicode="" d="M928.67 689.56H95.33A83.42 83.42 0 0 1 12 606.22v-444.44a83.42 83.42 0 0 1 83.33-83.33h833.34a83.42 83.42 0 0 1 83.33 83.33V606.22a83.42 83.42 0 0 1-83.33 83.34z m27.78-527.78A27.8 27.8 0 0 0 928.67 134H95.33a27.8 27.8 0 0 0-27.78 27.78V606.22A27.8 27.8 0 0 0 95.33 634h833.34a27.8 27.8 0 0 0 27.78-27.78zM845.33 272.89H178.67a27.78 27.78 0 0 1 0-55.56h666.66a27.78 27.78 0 0 1 0 55.56zM178.67 356.22H262a27.78 27.78 0 1 1 0 55.56h-83.33a27.78 27.78 0 0 1 0-55.56zM373.11 356.22h83.33a27.78 27.78 0 0 1 0 55.56h-83.33a27.78 27.78 0 0 1 0-55.56zM567.56 356.22h83.33a27.78 27.78 0 0 1 0 55.56h-83.33a27.78 27.78 0 0 1 0-55.56zM845.33 411.78H762a27.78 27.78 0 1 1 0-55.56h83.33a27.78 27.78 0 0 1 0 55.56zM178.67 495.11H262a27.78 27.78 0 1 1 0 55.56h-83.33a27.78 27.78 0 0 1 0-55.56zM373.11 495.11h83.33a27.78 27.78 0 0 1 0 55.56h-83.33a27.78 27.78 0 0 1 0-55.56zM567.56 495.11h83.33a27.78 27.78 0 0 1 0 55.56h-83.33a27.78 27.78 0 0 1 0-55.56zM845.33 550.6700000000001H762a27.78 27.78 0 1 1 0-55.56h83.33a27.78 27.78 0 0 1 0 55.56z" horiz-adv-x="1024" />
|
||||
|
||||
<glyph glyph-name="heart-fill" unicode="" d="M729.068827 776.44202c-94.686523 0-176.905082-48.314379-217.069851-118.640074-40.163745 70.325695-122.382305 118.640074-217.044268 118.640074-143.767358 0-229.665727-123.660414-229.665727-243.219417 0-283.128359 415.870616-527.841803 433.576883-538.126031 4.062526-2.363837 8.584516-3.538593 13.132088-3.538593 4.547573 0 9.070586 1.174756 13.132088 3.538593 17.706267 10.283204 433.576883 254.997672 433.576883 538.126031C958.708971 652.781606 872.811626 776.44202 729.068827 776.44202z" horiz-adv-x="1024" />
|
||||
|
||||
<glyph glyph-name="light" unicode="" d="M512 72c-172.313 0-312 139.687-312 312s139.687 312 312 312 312-139.687 312-312-139.687-312-312-312z m0 64c136.967 0 248 111.033 248 248 0 136.967-111.033 248-248 248-136.967 0-248-111.033-248-248 0-136.967 111.033-248 248-248z m0 696c17.673 0 32-14.327 32-32v-51c0-17.673-14.327-32-32-32-17.673 0-32 14.327-32 32V800c0 17.673 14.327 32 32 32z m0-785c17.673 0 32-14.327 32-32v-51c0-17.673-14.327-32-32-32-17.673 0-32 14.327-32 32v51c0 17.673 14.327 32 32 32z m325.945 11.055c-12.497-12.496-32.758-12.496-45.255 0l-36.063 36.063c-12.496 12.497-12.496 32.758 0 45.255 12.497 12.496 32.758 12.496 45.255 0l36.063-36.063c12.496-12.497 12.496-32.758 0-45.255z m-568 565c-12.497-12.496-32.758-12.496-45.255 0l-36.063 36.063c-12.496 12.497-12.496 32.758 0 45.255 12.497 12.496 32.758 12.496 45.255 0l36.063-36.063c12.496-12.497 12.496-32.758 0-45.255z m561 81.318c12.496-12.497 12.496-32.758 0-45.255l-36.063-36.063c-12.497-12.496-32.758-12.496-45.255 0-12.496 12.497-12.496 32.758 0 45.255l36.063 36.063c12.497 12.496 32.758 12.496 45.255 0z m-563.572-565c12.496-12.497 12.496-32.758 0-45.255l-36.063-36.063c-12.497-12.496-32.758-12.496-45.255 0-12.496 12.497-12.496 32.758 0 45.255l36.063 36.063c12.497 12.496 32.758 12.496 45.255 0zM960 384c0-17.673-14.327-32-32-32h-51c-17.673 0-32 14.327-32 32 0 17.673 14.327 32 32 32h51c17.673 0 32-14.327 32-32z m-781 0c0-17.673-14.327-32-32-32H96c-17.673 0-32 14.327-32 32 0 17.673 14.327 32 32 32h51c17.673 0 32-14.327 32-32z" horiz-adv-x="1024" />
|
||||
@@ -270,7 +268,7 @@
|
||||
|
||||
<glyph glyph-name="edit" unicode="" d="M769.089 516.251l-125.896 125.89 62.974 62.947c20.866 20.838 54.652 20.838 75.517 0l50.353-50.351c20.865-20.865 20.865-54.703 0-75.567L769.089 516.251zM403.349 150.52700000000004L277.453 276.418 619.706 615.982 745.601 490.09ZM176.314 47.283000000000015L252.912 251.87699999999995 377.753 127.01199999999994Z" horiz-adv-x="1024" />
|
||||
|
||||
<glyph glyph-name="delete" unicode="" d="M738.923 24.288h-451.956c-27.2 0-49.327 21.603-49.327 48.157v418.017c0 26.548 22.129 48.147 49.327 48.147h451.956c27.2 0 49.327-21.598 49.327-48.147v-418.017c0-26.555-22.129-48.157-49.327-48.157zM286.966 494.547c-4.447 0-7.168-2.644-7.168-4.084v-418.017c0-1.443 2.722-4.093 7.168-4.093h451.956c4.448 0 7.168 2.651 7.168 4.093v418.017c0 1.44-2.722 4.084-7.168 4.084h-451.956zM832.199 496.302h-640.401c-27.201 0-49.327 20.131-49.327 44.876v61.045c0 24.74 22.128 44.867 49.327 44.867h640.401c27.2 0 49.327-20.127 49.327-44.867v-61.045c0-24.744-22.129-44.876-49.327-44.876zM184.631 541.327c0.387-0.733 2.722-2.866 7.168-2.866h640.401c4.445 0 6.782 2.132 7.168 2.867v60.741c-0.393 0.736-2.733 2.863-7.168 2.863h-640.401c-4.437 0-6.776-2.128-7.168-2.863v-60.742zM600.748 605.354h-174.546c-27.201 0-49.327 20.13-49.327 44.876v10.736c0 24.74 22.128 44.867 49.327 44.867h174.546c27.2 0 49.327-20.126 49.327-44.867v-10.736c0-24.745-22.128-44.876-49.327-44.876zM419.034 650.378c0.387-0.733 2.722-2.865 7.168-2.865h174.546c4.446 0 6.782 2.131 7.168 2.865v10.432c-0.393 0.736-2.734 2.862-7.168 2.862h-174.546c-4.437 0-6.776-2.126-7.168-2.862v-10.432zM404.099 430.833h-30.097c-7.297 0-13.213-5.916-13.213-13.213v-272.34c0-7.297 5.916-13.212 13.213-13.212h30.098c7.297 0 13.212 5.916 13.212 13.212v272.341c0 7.297-5.916 13.213-13.212 13.213zM659.583 430.833h-30.097c-7.298 0-13.213-5.916-13.213-13.213v-272.34c0-7.297 5.917-13.212 13.213-13.212h30.097c7.297 0 13.212 5.916 13.212 13.212v272.341c0 7.297-5.916 13.213-13.212 13.213zM531.841 430.833h-30.098c-7.297 0-13.213-5.916-13.213-13.213v-272.34c0-7.297 5.917-13.212 13.213-13.212h30.098c7.297 0 13.212 5.916 13.212 13.212v272.341c0 7.297-5.916 13.213-13.212 13.213z" horiz-adv-x="1024" />
|
||||
<glyph glyph-name="delete" unicode="" d="M724.7403125 66.76999999999998h-423.70875c-25.5 0-46.2440625 20.2528125-46.2440625 45.1471875v391.8909375c0 24.88875 20.7459375 45.1378125 46.2440625 45.1378125h423.70875c25.5 0 46.2440625-20.248125 46.2440625-45.1378125v-391.8909375c0-24.8953125-20.7459375-45.1471875-46.2440625-45.1471875zM301.030625 507.6378125c-4.1690625 0-6.72-2.47875-6.72-3.82875v-391.8909375c0-1.3528125 2.551875-3.8371875 6.72-3.8371875h423.70875c4.17 0 6.72 2.4853125 6.72 3.8371875v391.8909375c0 1.35-2.551875 3.82875-6.72 3.82875h-423.70875zM812.1865625 509.283125h-600.3759375c-25.5009375 0-46.2440625 18.8728125-46.2440625 42.07125v57.2296875c0 23.19375 20.745 42.0628125 46.2440625 42.0628125h600.3759375c25.5 0 46.2440625-18.8690625 46.2440625-42.0628125v-57.2296875c0-23.1975-20.7459375-42.07125-46.2440625-42.07125zM205.0915625 551.4940624999999c0.3628125-0.6871875 2.551875-2.686875 6.72-2.686875h600.3759375c4.1671875 0 6.358125 1.99875 6.72 2.6878125v56.9446875c-0.3684375 0.69-2.5621875 2.6840625-6.72 2.6840625h-600.3759375c-4.1596875 0-6.3525-1.995-6.72-2.6840625v-56.945625zM595.20125 611.5193750000001h-163.636875c-25.5009375 0-46.2440625 18.871875-46.2440625 42.07125v10.065c0 23.19375 20.745 42.0628125 46.2440625 42.0628125h163.636875c25.5 0 46.2440625-18.868125 46.2440625-42.0628125v-10.065c0-23.1984375-20.745-42.07125-46.2440625-42.07125zM424.844375 653.729375c0.3628125-0.6871875 2.551875-2.6859375 6.72-2.6859375h163.636875c4.168125 0 6.358125 1.9978125 6.72 2.6859375v9.78c-0.3684375 0.69-2.563125 2.683125-6.72 2.683125h-163.636875c-4.1596875 0-6.3525-1.993125-6.72-2.683125v-9.78zM410.8428125 447.9059375h-28.2159375c-6.8409375 0-12.3871875-5.54625-12.3871875-12.3871875v-255.31875c0-6.8409375 5.54625-12.38625 12.3871875-12.38625h28.216875c6.8409375 0 12.38625 5.54625 12.38625 12.38625v255.3196875c0 6.8409375-5.54625 12.3871875-12.38625 12.3871875zM650.3590625 447.9059375h-28.2159375c-6.841875 0-12.3871875-5.54625-12.3871875-12.3871875v-255.31875c0-6.8409375 5.5471875-12.38625 12.3871875-12.38625h28.2159375c6.8409375 0 12.38625 5.54625 12.38625 12.38625v255.3196875c0 6.8409375-5.54625 12.3871875-12.38625 12.3871875zM530.6009375 447.9059375h-28.216875c-6.8409375 0-12.3871875-5.54625-12.3871875-12.3871875v-255.31875c0-6.8409375 5.5471875-12.38625 12.3871875-12.38625h28.216875c6.8409375 0 12.38625 5.54625 12.38625 12.38625v255.3196875c0 6.8409375-5.54625 12.3871875-12.38625 12.3871875z" horiz-adv-x="1024" />
|
||||
|
||||
<glyph glyph-name="engine" unicode="" d="M422.214332 360.70413299999996L186.183684 360.70413299999996l0 46.568461 236.030648 0c10.379577 40.075407 46.47537 69.794509 89.785668 69.794509 51.432433 0 93.067103-41.657943 93.067103-93.067103C605.067103 332.56756700000005 563.40916 290.909624 512 290.909624 468.689703 290.909624 432.593909 320.65199900000005 422.214332 360.70413299999996L422.214332 360.70413299999996zM512 779.634098c-218.529658 0-395.634098-177.10444-395.634098-395.634098 0-218.529658 177.10444-395.634098 395.634098-395.634098 154.76275 0 288.417257 89.064217 353.440885 218.55293l101.398692-59.112389-23.063141-39.959044-62.161099 35.909613c-33.745261-51.595341-77.42792-96.115813-129.093079-129.744711l35.653614-61.765464-40.308133-23.295867-35.653614 61.765464c-53.620057-27.345298-113.360805-44.404109-176.894987-47.73209L535.319139-127.99706800000001l-46.568461 0 0 70.981412c-63.534182 3.327981-123.27493 20.386792-176.894987 47.73209l-35.653614-61.765464-40.308133 23.295867 35.653614 61.765464c-51.665159 33.628898-95.347818 78.149371-129.093079 129.744711l-62.161099-35.909613-23.295867 40.308133 62.114553 35.863067c-27.415116 53.550239-44.799743 113.104807-48.127724 176.685534L0.002932 360.70413299999996l0 46.568461 70.958139 0c3.327981 63.580727 20.712609 123.135295 48.127724 176.685534l-62.114553 35.863067 23.295867 40.308133 62.161099-35.909613c33.745261 51.595341 77.42792 96.115813 129.093079 129.744711l-35.653614 61.765464 40.308133 23.295867 35.653614-61.765464c53.620057 27.345298 113.360805 44.404109 176.894987 47.73209L488.727406 895.997068l46.568461 0 0-70.981412c63.534182-3.327981 123.27493-20.386792 176.894987-47.73209l35.653614 61.765464 40.308133-23.295867-35.653614-61.765464c51.665159-33.628898 95.347818-78.149371 129.093079-129.744711l62.161099 35.909613 23.063141-39.959044-101.398692-59.112389C800.417257 690.569881 666.76275 779.634098 512 779.634098L512 779.634098z" horiz-adv-x="1024" />
|
||||
|
||||
|
Before Width: | Height: | Size: 309 KiB After Width: | Height: | Size: 309 KiB |
@@ -1,2 +0,0 @@
|
||||
/** layuiAdmin.pro-v1.7.0 LPPL License */
|
||||
;layui.define(["laytpl","layer"],function(e){var t=layui.jquery,a=layui.laytpl,n=layui.layer,r=layui.setter,o=(layui.device(),layui.hint()),i=function(e){return new d(e)},s="LAY_app_body",d=function(e){this.id=e,this.container=t("#"+(e||s))};i.loading=function(e){e.append(this.elemLoad=t('<i class="layui-anim layui-anim-rotate layui-anim-loop layui-icon layui-icon-loading layadmin-loading"></i>'))},i.removeLoad=function(){this.elemLoad&&this.elemLoad.remove()},i.exit=function(){layui.data(r.tableName,{key:r.request.tokenName,remove:!0}),location.hash="/user/login"},i.req=function(e){var a=e.success,n=e.error,o=r.request,s=r.response,d=function(){return r.debug?"<br><cite>URL:</cite>"+e.url:""};if(e.data=e.data||{},e.headers=e.headers||{},o.tokenName){var l="string"==typeof e.data?JSON.parse(e.data):e.data;e.data[o.tokenName]=o.tokenName in l?e.data[o.tokenName]:layui.data(r.tableName)[o.tokenName]||"",e.headers[o.tokenName]=o.tokenName in e.headers?e.headers[o.tokenName]:layui.data(r.tableName)[o.tokenName]||""}return delete e.success,delete e.error,t.ajax(t.extend({type:"get",dataType:"json",success:function(t){var n=s.statusCode;if(t[s.statusName]==n.ok)"function"==typeof e.done&&e.done(t);else if(t[s.statusName]==n.logout)i.exit();else{var r=["<cite>Error:</cite> "+(t[s.msgName]||"返回状态码异常"),d()].join("");i.error(r)}"function"==typeof a&&a(t)},error:function(e,t){var a=["请求异常,请重试<br><cite>错误信息:</cite>"+t,d()].join("");i.error(a),"function"==typeof n&&n.apply(this,arguments)}},e))},i.popup=function(e){var a=e.success,r=e.skin;return delete e.success,delete e.skin,n.open(t.extend({type:1,title:"提示",content:"",id:"LAY-system-view-popup",skin:"layui-layer-admin"+(r?" "+r:""),shadeClose:!0,closeBtn:!1,success:function(e,r){var o=t('<i class="layui-icon" close>ဆ</i>');e.append(o),o.on("click",function(){n.close(r)}),"function"==typeof a&&a.apply(this,arguments)}},e))},i.error=function(e,a){return i.popup(t.extend({content:e,maxWidth:500,offset:"auto",anim:6,id:"LAY_adminError"},a))},d.prototype.render=function(e,a){var n=this;layui.router();return e=r.views+e+r.engine,t("#"+s).children(".layadmin-loading").remove(),i.loading(n.container),t.ajax({url:e,type:"get",dataType:"html",data:{v:layui.cache.version},success:function(e){e="<div>"+e+"</div>";var r=t(e).find("title"),o=r.text()||(e.match(/\<title\>([\s\S]*)\<\/title>/)||[])[1],s={title:o,body:e};r.remove(),n.params=a||{},n.then&&(n.then(s),delete n.then),n.parse(e),i.removeLoad(),n.done&&(n.done(s),delete n.done)},error:function(e){return i.removeLoad(),n.render.isError?i.error("请求视图文件异常,状态:"+e.status):(404===e.status?n.render("template/tips/404"):n.render("template/tips/error"),void(n.render.isError=!0))}}),n},d.prototype.parse=function(e,n,r){var s=this,d="object"==typeof e,l=d?e:t(e),u=d?e:l.find("*[template]"),c=function(e){var n=a(e.dataElem.html()),o=t.extend({params:y.params},e.res);e.dataElem.after(n.render(o)),"function"==typeof r&&r();try{e.done&&new Function("d",e.done)(o)}catch(i){console.error(e.dataElem[0],"\n存在错误回调脚本\n\n",i)}},y=layui.router();l.find("title").remove(),s.container[n?"after":"html"](l.children()),y.params=s.params||{};for(var p=u.length;p>0;p--)!function(){var e=u.eq(p-1),t=e.attr("lay-done")||e.attr("lay-then"),n=a(e.attr("lay-url")||"").render(y),r=a(e.attr("lay-data")||"").render(y),s=a(e.attr("lay-headers")||"").render(y);try{r=new Function("return "+r+";")()}catch(d){o.error("lay-data: "+d.message),r={}}try{s=new Function("return "+s+";")()}catch(d){o.error("lay-headers: "+d.message),s=s||{}}n?i.req({type:e.attr("lay-type")||"get",url:n,data:r,dataType:"json",headers:s,success:function(a){c({dataElem:e,res:a,done:t})}}):c({dataElem:e,done:t})}();return s},d.prototype.send=function(e,t){var n=a(e||this.container.html()).render(t||{});return this.container.html(n),this},d.prototype.refresh=function(e){var t=this,a=t.container.next(),n=a.attr("lay-templateid");return t.id!=n?t:(t.parse(t.container,"refresh",function(){t.container.siblings('[lay-templateid="'+t.id+'"]:last').remove(),"function"==typeof e&&e()}),t)},d.prototype.then=function(e){return this.then=e,this},d.prototype.done=function(e){return this.done=e,this},e("view",i)});
|
||||
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* common
|
||||
*/
|
||||
|
||||
layui.define(function (exports) {
|
||||
var $ = layui.$
|
||||
, layer = layui.layer
|
||||
, laytpl = layui.laytpl
|
||||
, setter = layui.setter
|
||||
, view = layui.view
|
||||
, admin = layui.admin
|
||||
|
||||
//公共业务的逻辑处理可以写在此处,切换任何页面都会执行
|
||||
//……
|
||||
|
||||
|
||||
|
||||
//退出
|
||||
admin.events.logout = function () {
|
||||
//执行退出接口
|
||||
//admin.req({
|
||||
// url: './res/json/user/logout.js'
|
||||
// ,type: 'get'
|
||||
// ,data: {}
|
||||
// ,done: function(res){ //这里要说明一下:done 是只有 response 的 code 正常才会执行。而 succese 则是只要 http 为 200 就会执行
|
||||
|
||||
// //清空本地记录的 token,并跳转到登入页
|
||||
// admin.exit();
|
||||
// }
|
||||
//});
|
||||
admin.exit();
|
||||
};
|
||||
|
||||
|
||||
//对外暴露的接口
|
||||
exports('common', {});
|
||||
});
|
||||
324
CoreCms.Net.Web.Admin/wwwroot/lib/layuiAdmin/modules/console.js
Normal file
@@ -0,0 +1,324 @@
|
||||
/**
|
||||
* console
|
||||
*/
|
||||
|
||||
layui.define(function(exports){
|
||||
|
||||
/*
|
||||
下面通过 layui.use 分段加载不同的模块,实现不同区域的同时渲染,从而保证视图的快速呈现
|
||||
*/
|
||||
|
||||
|
||||
//区块轮播切换
|
||||
layui.use(['admin', 'carousel'], function(){
|
||||
var $ = layui.$
|
||||
,admin = layui.admin
|
||||
,carousel = layui.carousel
|
||||
,element = layui.element
|
||||
,device = layui.device();
|
||||
|
||||
//轮播切换
|
||||
$('.layadmin-carousel').each(function(){
|
||||
var othis = $(this);
|
||||
carousel.render({
|
||||
elem: this
|
||||
,width: '100%'
|
||||
,arrow: 'none'
|
||||
,interval: othis.data('interval')
|
||||
,autoplay: othis.data('autoplay') === true
|
||||
,trigger: (device.ios || device.android) ? 'click' : 'hover'
|
||||
,anim: othis.data('anim')
|
||||
});
|
||||
});
|
||||
|
||||
element.render('progress');
|
||||
|
||||
});
|
||||
|
||||
//数据概览
|
||||
layui.use(['admin', 'carousel', 'echarts'], function(){
|
||||
var $ = layui.$
|
||||
,admin = layui.admin
|
||||
,carousel = layui.carousel
|
||||
,echarts = layui.echarts;
|
||||
|
||||
var echartsApp = [], options = [
|
||||
//今日流量趋势
|
||||
{
|
||||
title: {
|
||||
text: '今日流量趋势',
|
||||
x: 'center',
|
||||
textStyle: {
|
||||
fontSize: 14
|
||||
}
|
||||
},
|
||||
tooltip : {
|
||||
trigger: 'axis'
|
||||
},
|
||||
legend: {
|
||||
data:['','']
|
||||
},
|
||||
xAxis : [{
|
||||
type : 'category',
|
||||
boundaryGap : false,
|
||||
data: ['06:00','06:30','07:00','07:30','08:00','08:30','09:00','09:30','10:00','11:30','12:00','12:30','13:00','13:30','14:00','14:30','15:00','15:30','16:00','16:30','17:00','17:30','18:00','18:30','19:00','19:30','20:00','20:30','21:00','21:30','22:00','22:30','23:00','23:30']
|
||||
}],
|
||||
yAxis : [{
|
||||
type : 'value'
|
||||
}],
|
||||
series : [{
|
||||
name:'PV',
|
||||
type:'line',
|
||||
smooth:true,
|
||||
itemStyle: {normal: {areaStyle: {type: 'default'}}},
|
||||
data: [111,222,333,444,555,777,3333,33333,55555,88888,33333,3333,7777,11888,28888,38888,58888,42222,39999,28888,17777,9777,6555,5555,3333,2222,3111,6999,5888,2777,1777,999,888,777]
|
||||
},{
|
||||
name:'UV',
|
||||
type:'line',
|
||||
smooth:true,
|
||||
itemStyle: {normal: {areaStyle: {type: 'default'}}},
|
||||
data: [11,22,33,44,55,66,333,3333,5555,12312,3333,333,777,1188,2777,3888,7777,4222,3999,2888,1777,966,655,555,333,222,311,699,588,277,166,99,88,77]
|
||||
}]
|
||||
},
|
||||
|
||||
/*
|
||||
//访客浏览器分布
|
||||
{
|
||||
title : {
|
||||
text: '访客浏览器分布',
|
||||
x: 'center',
|
||||
textStyle: {
|
||||
fontSize: 14
|
||||
}
|
||||
},
|
||||
tooltip : {
|
||||
trigger: 'item',
|
||||
formatter: "{a} <br/>{b} : {c} ({d}%)"
|
||||
},
|
||||
legend: {
|
||||
orient : 'vertical',
|
||||
x : 'left',
|
||||
data:['Chrome','Firefox','IE 8.0','Safari','其它浏览器']
|
||||
},
|
||||
series : [{
|
||||
name:'访问来源',
|
||||
type:'pie',
|
||||
radius : '55%',
|
||||
center: ['50%', '50%'],
|
||||
data:[
|
||||
{value:9052, name:'Chrome'},
|
||||
{value:1610, name:'Firefox'},
|
||||
{value:3200, name:'IE 8.0'},
|
||||
{value:535, name:'Safari'},
|
||||
{value:1700, name:'其它浏览器'}
|
||||
]
|
||||
}]
|
||||
},
|
||||
*/
|
||||
|
||||
//新增的用户量
|
||||
{
|
||||
title: {
|
||||
text: '最近一周新增的用户量',
|
||||
x: 'center',
|
||||
textStyle: {
|
||||
fontSize: 14
|
||||
}
|
||||
},
|
||||
tooltip : { //提示框
|
||||
trigger: 'axis',
|
||||
formatter: "{b}<br>新增用户:{c}"
|
||||
},
|
||||
xAxis : [{ //X轴
|
||||
type : 'category',
|
||||
data : ['11-07', '11-08', '11-09', '11-10', '11-11', '11-12', '11-13']
|
||||
}],
|
||||
yAxis : [{ //Y轴
|
||||
type : 'value'
|
||||
}],
|
||||
series : [{ //内容
|
||||
type: 'line',
|
||||
data:[200, 300, 400, 610, 150, 270, 380],
|
||||
}]
|
||||
}
|
||||
]
|
||||
,elemDataView = $('#LAY-index-dataview').children('div')
|
||||
,renderDataView = function(index){
|
||||
echartsApp[index] = echarts.init(elemDataView[index], layui.echartsTheme);
|
||||
echartsApp[index].setOption(options[index]);
|
||||
//window.onresize = echartsApp[index].resize;
|
||||
admin.resize(function(){
|
||||
echartsApp[index].resize();
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
//没找到DOM,终止执行
|
||||
if(!elemDataView[0]) return;
|
||||
|
||||
|
||||
|
||||
renderDataView(0);
|
||||
|
||||
//触发数据概览轮播
|
||||
var carouselIndex = 0;
|
||||
carousel.on('change(LAY-index-dataview)', function(obj){
|
||||
renderDataView(carouselIndex = obj.index);
|
||||
});
|
||||
|
||||
//触发侧边伸缩
|
||||
layui.admin.on('side', function(){
|
||||
setTimeout(function(){
|
||||
renderDataView(carouselIndex);
|
||||
}, 300);
|
||||
});
|
||||
|
||||
//触发路由
|
||||
layui.admin.on('hash(tab)', function(){
|
||||
layui.router().path.join('') || renderDataView(carouselIndex);
|
||||
});
|
||||
});
|
||||
|
||||
//地图
|
||||
layui.use(['carousel', 'echarts'], function(){
|
||||
var $ = layui.$
|
||||
,carousel = layui.carousel
|
||||
,echarts = layui.echarts;
|
||||
|
||||
var echartsApp = [], options = [
|
||||
{
|
||||
title : {
|
||||
text: '访客地区分布',
|
||||
subtext: '不完全统计'
|
||||
},
|
||||
tooltip : {
|
||||
trigger: 'item'
|
||||
},
|
||||
dataRange: {
|
||||
orient: 'horizontal',
|
||||
min: 0,
|
||||
max: 60000,
|
||||
text:['高','低'],
|
||||
splitNumber:0
|
||||
},
|
||||
series : [
|
||||
{
|
||||
name: '访客地区分布',
|
||||
type: 'map',
|
||||
mapType: 'china',
|
||||
selectedMode : 'multiple',
|
||||
itemStyle:{
|
||||
normal:{label:{show:true}},
|
||||
emphasis:{label:{show:true}}
|
||||
},
|
||||
data:[
|
||||
{name:'西藏', value:60},
|
||||
{name:'青海', value:167},
|
||||
{name:'宁夏', value:210},
|
||||
{name:'海南', value:252},
|
||||
{name:'甘肃', value:502},
|
||||
{name:'贵州', value:570},
|
||||
{name:'新疆', value:661},
|
||||
{name:'云南', value:8890},
|
||||
{name:'重庆', value:10010},
|
||||
{name:'吉林', value:5056},
|
||||
{name:'山西', value:2123},
|
||||
{name:'天津', value:9130},
|
||||
{name:'江西', value:10170},
|
||||
{name:'广西', value:6172},
|
||||
{name:'陕西', value:9251},
|
||||
{name:'黑龙江', value:5125},
|
||||
{name:'内蒙古', value:1435},
|
||||
{name:'安徽', value:9530},
|
||||
{name:'北京', value:51919},
|
||||
{name:'福建', value:3756},
|
||||
{name:'上海', value:59190},
|
||||
{name:'湖北', value:37109},
|
||||
{name:'湖南', value:8966},
|
||||
{name:'四川', value:31020},
|
||||
{name:'辽宁', value:7222},
|
||||
{name:'河北', value:3451},
|
||||
{name:'河南', value:9693},
|
||||
{name:'浙江', value:62310},
|
||||
{name:'山东', value:39231},
|
||||
{name:'江苏', value:35911},
|
||||
{name:'广东', value:55891}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
,elemDataView = $('#LAY-index-pagethree-home').children('div')
|
||||
,renderDataView = function(index){
|
||||
echartsApp[index] = echarts.init(elemDataView[index], layui.echartsTheme);
|
||||
echartsApp[index].setOption(options[index]);
|
||||
window.onresize = echartsApp[index].resize;
|
||||
};
|
||||
//没找到DOM,终止执行
|
||||
if(!elemDataView[0]) return;
|
||||
|
||||
renderDataView(0);
|
||||
});
|
||||
|
||||
|
||||
//table
|
||||
layui.use('table', function(){
|
||||
var $ = layui.$
|
||||
,table = layui.table;
|
||||
|
||||
//今日热搜
|
||||
table.render({
|
||||
elem: '#LAY-index-topSearch'
|
||||
,url: './res/json/console/top-search.js' //模拟接口
|
||||
,page: true
|
||||
,cols: [[
|
||||
{type: 'numbers', fixed: 'left'}
|
||||
,{field: 'keywords', title: '关键词', minWidth: 300, templet: '<div><a href="https://www.baidu.com/s?wd={{ d.keywords }}" target="_blank" class="layui-table-link">{{ d.keywords }}</div>'}
|
||||
,{field: 'frequency', title: '搜索次数', minWidth: 120, sort: true}
|
||||
,{field: 'userNums', title: '用户数', sort: true}
|
||||
]]
|
||||
,skin: 'line'
|
||||
});
|
||||
|
||||
//今日热贴
|
||||
table.render({
|
||||
elem: '#LAY-index-topCard'
|
||||
,url: './res/json/console/top-card.js' //模拟接口
|
||||
,page: true
|
||||
,cellMinWidth: 120
|
||||
,cols: [[
|
||||
{type: 'numbers', fixed: 'left'}
|
||||
,{field: 'title', title: '标题', minWidth: 300, templet: '<div><a href="{{ d.href }}" target="_blank" class="layui-table-link">{{ d.title }}</div>'}
|
||||
,{field: 'username', title: '发帖者'}
|
||||
,{field: 'channel', title: '类别'}
|
||||
,{field: 'crt', title: '点击率', sort: true}
|
||||
]]
|
||||
,skin: 'line'
|
||||
});
|
||||
|
||||
//项目进展
|
||||
table.render({
|
||||
elem: '#LAY-home-homepage-console'
|
||||
,url: './res/json/console/prograss.js' //模拟接口
|
||||
,cols: [[
|
||||
{type: 'checkbox', fixed: 'left'}
|
||||
,{field: 'prograss', title: '任务'}
|
||||
,{field: 'time', title: '所需时间'}
|
||||
,{field: 'complete', title: '完成情况'
|
||||
,templet: function(d){
|
||||
if(d.complete == '已完成'){
|
||||
return '<del style="color: #5FB878;">'+ d.complete +'</del>'
|
||||
}else if(d.complete == '进行中'){
|
||||
return '<span style="color: #FFB800;">'+ d.complete +'</span>'
|
||||
}else{
|
||||
return '<span style="color: #FF5722;">'+ d.complete +'</span>'
|
||||
}
|
||||
}
|
||||
}
|
||||
]]
|
||||
,skin: 'line'
|
||||
});
|
||||
});
|
||||
|
||||
exports('console', {})
|
||||
});
|
||||
160
CoreCms.Net.Web.Admin/wwwroot/lib/layuiAdmin/modules/contlist.js
Normal file
@@ -0,0 +1,160 @@
|
||||
/**
|
||||
* 内容系统 demo
|
||||
*/
|
||||
|
||||
layui.define(['table', 'form'], function(exports){
|
||||
var $ = layui.$
|
||||
,admin = layui.admin
|
||||
,view = layui.view
|
||||
,table = layui.table
|
||||
,form = layui.form;
|
||||
|
||||
//文章管理
|
||||
table.render({
|
||||
elem: '#LAY-app-content-list'
|
||||
,url: './res/json/content/list.js' //模拟接口
|
||||
,cols: [[
|
||||
{type: 'checkbox', fixed: 'left'}
|
||||
,{field: 'id', width: 100, title: '文章ID', sort: true}
|
||||
,{field: 'label', title: '文章标签', minWidth: 100}
|
||||
,{field: 'title', title: '文章标题'}
|
||||
,{field: 'author', title: '作者'}
|
||||
,{field: 'uploadtime', title: '上传时间', sort: true}
|
||||
,{field: 'status', title: '发布状态', templet: '#buttonTpl', minWidth: 80, align: 'center'}
|
||||
,{title: '操作', minWidth: 150, align: 'center', fixed: 'right', toolbar: '#table-content-list'}
|
||||
]]
|
||||
,page: true
|
||||
,limit: 10
|
||||
,limits: [10, 15, 20, 25, 30]
|
||||
,text: '对不起,加载出现异常!'
|
||||
});
|
||||
|
||||
//工具条
|
||||
table.on('tool(LAY-app-content-list)', function(obj){
|
||||
var data = obj.data;
|
||||
if(obj.event === 'del'){
|
||||
layer.confirm('确定删除此文章?', function(index){
|
||||
obj.del();
|
||||
layer.close(index);
|
||||
});
|
||||
} else if(obj.event === 'edit'){
|
||||
admin.popup({
|
||||
title: '编辑文章'
|
||||
,area: ['550px', '550px']
|
||||
,id: 'LAY-popup-content-edit'
|
||||
,success: function(layero, index){
|
||||
view(this.id).render('app/content/listform', data).done(function(){
|
||||
form.render(null, 'layuiadmin-app-form-list');
|
||||
|
||||
//提交
|
||||
form.on('submit(layuiadmin-app-form-submit)', function(data){
|
||||
var field = data.field; //获取提交的字段
|
||||
|
||||
//提交 Ajax 成功后,关闭当前弹层并重载表格
|
||||
//$.ajax({});
|
||||
layui.table.reload('LAY-app-content-list'); //重载表格
|
||||
layer.close(index); //执行关闭
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//分类管理
|
||||
table.render({
|
||||
elem: '#LAY-app-content-tags'
|
||||
,url: './res/json/content/tags.js' //模拟接口
|
||||
,cols: [[
|
||||
{type: 'numbers', fixed: 'left'}
|
||||
,{field: 'id', width: 100, title: 'ID', sort: true}
|
||||
,{field: 'tags', title: '分类名', minWidth: 100}
|
||||
,{title: '操作', width: 150, align: 'center', fixed: 'right', toolbar: '#layuiadmin-app-cont-tagsbar'}
|
||||
]]
|
||||
,text: '对不起,加载出现异常!'
|
||||
});
|
||||
|
||||
//工具条
|
||||
table.on('tool(LAY-app-content-tags)', function(obj){
|
||||
var data = obj.data;
|
||||
if(obj.event === 'del'){
|
||||
layer.confirm('确定删除此分类?', function(index){
|
||||
obj.del();
|
||||
layer.close(index);
|
||||
});
|
||||
} else if(obj.event === 'edit'){
|
||||
admin.popup({
|
||||
title: '编辑分类'
|
||||
,area: ['450px', '200px']
|
||||
,id: 'LAY-popup-content-tags'
|
||||
,success: function(layero, index){
|
||||
view(this.id).render('app/content/tagsform', data).done(function(){
|
||||
form.render(null, 'layuiadmin-form-tags');
|
||||
|
||||
//提交
|
||||
form.on('submit(layuiadmin-app-tags-submit)', function(data){
|
||||
var field = data.field; //获取提交的字段
|
||||
|
||||
//提交 Ajax 成功后,关闭当前弹层并重载表格
|
||||
//$.ajax({});
|
||||
layui.table.reload('LAY-app-content-tags'); //重载表格
|
||||
layer.close(index); //执行关闭
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//评论管理
|
||||
table.render({
|
||||
elem: '#LAY-app-content-comm'
|
||||
,url: './res/json/content/comment.js' //模拟接口
|
||||
,cols: [[
|
||||
{type: 'checkbox', fixed: 'left'}
|
||||
,{field: 'id', width: 100, title: 'ID', sort: true}
|
||||
,{field: 'reviewers', title: '评论者', minWidth: 100}
|
||||
,{field: 'content', title: '评论内容', minWidth: 100}
|
||||
,{field: 'commtime', title: '评论时间', minWidth: 100, sort: true}
|
||||
,{title: '操作', width: 150, align: 'center', fixed: 'right', toolbar: '#table-content-com'}
|
||||
]]
|
||||
,page: true
|
||||
,limit: 10
|
||||
,limits: [10, 15, 20, 25, 30]
|
||||
,text: '对不起,加载出现异常!'
|
||||
});
|
||||
|
||||
//工具条
|
||||
table.on('tool(LAY-app-content-comm)', function(obj){
|
||||
var data = obj.data;
|
||||
if(obj.event === 'del'){
|
||||
layer.confirm('确定删除此条评论?', function(index){
|
||||
obj.del();
|
||||
layer.close(index);
|
||||
});
|
||||
} else if(obj.event === 'edit'){
|
||||
admin.popup({
|
||||
title: '编辑评论'
|
||||
,area: ['450px', '300px']
|
||||
,id: 'LAY-popup-content-comm'
|
||||
,success: function(layero, index){
|
||||
view(this.id).render('app/content/contform', data).done(function(){
|
||||
form.render(null, 'layuiadmin-form-comment');
|
||||
|
||||
//提交
|
||||
form.on('submit(layuiadmin-app-com-submit)', function(data){
|
||||
var field = data.field; //获取提交的字段
|
||||
|
||||
//提交 Ajax 成功后,关闭当前弹层并重载表格
|
||||
//$.ajax({});
|
||||
layui.table.reload('LAY-app-content-comm'); //重载表格
|
||||
layer.close(index); //执行关闭
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
exports('contlist', {})
|
||||
});
|
||||
@@ -1,10 +1,5 @@
|
||||
/**
|
||||
|
||||
@Name:echarts 主题
|
||||
|
||||
|
||||
@License:GPL-2
|
||||
|
||||
* Set echarts theme
|
||||
*/
|
||||
|
||||
|
||||
@@ -22,7 +17,7 @@ layui.define(function(exports) {
|
||||
title: {
|
||||
textStyle: {
|
||||
fontWeight: 'normal',
|
||||
color: '#666' // 主标题文字颜色
|
||||
color: '#5F5F5F' // 主标题文字颜色
|
||||
}
|
||||
},
|
||||
|
||||
120
CoreCms.Net.Web.Admin/wwwroot/lib/layuiAdmin/modules/forum.js
Normal file
@@ -0,0 +1,120 @@
|
||||
/**
|
||||
* forum demo
|
||||
*/
|
||||
|
||||
|
||||
layui.define(['table', 'form'], function(exports){
|
||||
var $ = layui.$
|
||||
,admin = layui.admin
|
||||
,view = layui.view
|
||||
,table = layui.table
|
||||
,form = layui.form;
|
||||
|
||||
//帖子管理
|
||||
table.render({
|
||||
elem: '#LAY-app-forum-list'
|
||||
,url: './res/json/forum/list.js' //模拟接口
|
||||
,cols: [[
|
||||
{type: 'checkbox', fixed: 'left'}
|
||||
,{field: 'id', width: 100, title: 'ID', sort: true}
|
||||
,{field: 'poster', title: '发帖人'}
|
||||
,{field: 'avatar', title: '头像', width: 100, templet: '#imgTpl'}
|
||||
,{field: 'content', title: '发帖内容'}
|
||||
,{field: 'posttime', title: '发帖时间', sort: true}
|
||||
,{field: 'top', title: '置顶', templet: '#buttonTpl', minWidth: 80, align: 'center'}
|
||||
,{title: '操作', width: 150, align: 'center', fixed: 'right', toolbar: '#table-forum-list'}
|
||||
]]
|
||||
,page: true
|
||||
,limit: 10
|
||||
,limits: [10, 15, 20, 25, 30]
|
||||
,text: '对不起,加载出现异常!'
|
||||
});
|
||||
|
||||
//工具条
|
||||
table.on('tool(LAY-app-forum-list)', function(obj){
|
||||
var data = obj.data;
|
||||
if(obj.event === 'del'){
|
||||
layer.confirm('确定删除此条帖子?', function(index){
|
||||
obj.del();
|
||||
layer.close(index);
|
||||
});
|
||||
} else if(obj.event === 'edit'){
|
||||
admin.popup({
|
||||
title: '编辑帖子'
|
||||
,area: ['550px', '450px']
|
||||
,id: 'LAY-popup-forum-edit'
|
||||
,resize: false
|
||||
,success: function(layero, index){
|
||||
view(this.id).render('app/forum/listform', data).done(function(){
|
||||
form.render(null, 'layuiadmin-form-list');
|
||||
|
||||
//提交
|
||||
form.on('submit(layuiadmin-app-forum-submit)', function(data){
|
||||
var field = data.field; //获取提交的字段
|
||||
|
||||
//提交 Ajax 成功后,关闭当前弹层并重载表格
|
||||
//$.ajax({});
|
||||
layui.table.reload('LAY-app-forum-list'); //重载表格
|
||||
layer.close(index); //执行关闭
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//回帖管理
|
||||
table.render({
|
||||
elem: '#LAY-app-forumreply-list'
|
||||
,url: './res/json/forum/replys.js' //模拟接口
|
||||
,cols: [[
|
||||
{type: 'checkbox', fixed: 'left'}
|
||||
,{field: 'id', width: 100, title: 'ID', sort: true}
|
||||
,{field: 'replyer', title: '回帖人'}
|
||||
,{field: 'cardid', title: '回帖ID', sort: true}
|
||||
,{field: 'avatar', title: '头像', width: 100, templet: '#imgTpl'}
|
||||
,{field: 'content', title: '回帖内容', width: 200}
|
||||
,{field: 'replytime', title: '回帖时间', sort: true}
|
||||
,{title: '操作', width: 150, align: 'center', fixed: 'right', toolbar: '#table-forum-replys'}
|
||||
]]
|
||||
,page: true
|
||||
,limit: 10
|
||||
,limits: [10, 15, 20, 25, 30]
|
||||
,text: '对不起,加载出现异常!'
|
||||
});
|
||||
|
||||
//工具条
|
||||
table.on('tool(LAY-app-forumreply-list)', function(obj){
|
||||
var data = obj.data;
|
||||
if(obj.event === 'del'){
|
||||
layer.confirm('确定删除此条评论?', function(index){
|
||||
obj.del();
|
||||
layer.close(index);
|
||||
});
|
||||
} else if(obj.event === 'edit'){
|
||||
admin.popup({
|
||||
title: '编辑回帖'
|
||||
,area: ['550px', '400px']
|
||||
,id: 'LAY-popup-forum-edit'
|
||||
,resize: false
|
||||
,success: function(layero, index){
|
||||
view(this.id).render('app/forum/replysform', data).done(function(){
|
||||
form.render(null, 'layuiadmin-app-forum-reply');
|
||||
|
||||
//提交
|
||||
form.on('submit(layuiadmin-app-forumreply-submit)', function(data){
|
||||
var field = data.field; //获取提交的字段
|
||||
|
||||
//提交 Ajax 成功后,关闭当前弹层并重载表格
|
||||
//$.ajax({});
|
||||
layui.table.reload('LAY-app-forumreply-list'); //重载表格
|
||||
layer.close(index); //执行关闭
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
exports('forum', {})
|
||||
});
|
||||
@@ -159,7 +159,7 @@ layui.define(['laypage', 'form'], function (exports) {
|
||||
|
||||
}
|
||||
|
||||
$('#' + ICON_BODY).find('.layui-anim').find('.' + LIST_BOX).html('').append(listHtml).append(pageHtml);
|
||||
$('#' + ICON_BODY).find('.layui-anim').find('.' + LIST_BOX).html('').html(listHtml).append(pageHtml);
|
||||
a.check();
|
||||
return a;
|
||||
},
|
||||
@@ -0,0 +1,96 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title>演示聊天记录模板</title>
|
||||
|
||||
<link rel="stylesheet" href="//unpkg.com/layui@2.6.8/dist/css/layui.css">
|
||||
<style>
|
||||
html{background-color: #f5f5f5;}
|
||||
body .layim-chat-main{height: auto;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="layim-chat-main">
|
||||
<ul id="LAY_view"></ul>
|
||||
</div>
|
||||
|
||||
<div id="LAY_page" style="margin: 0 10px;"></div>
|
||||
|
||||
|
||||
<textarea title="消息模版" id="LAY_tpl" style="display:none;">
|
||||
{{# layui.each(d.data, function(index, item){
|
||||
if(item.id == layui.layim.cache().mine.id){ }}
|
||||
<li class="layim-chat-mine"><div class="layim-chat-user"><img src="{{ item.avatar }}"><cite><i>{{ layui.data.date(item.timestamp) }}</i>{{ item.username }}</cite></div><div class="layim-chat-text">{{ layui.layim.content(item.content) }}</div></li>
|
||||
{{# } else { }}
|
||||
<li><div class="layim-chat-user"><img src="{{ item.avatar }}"><cite>{{ item.username }}<i>{{ layui.data.date(item.timestamp) }}</i></cite></div><div class="layim-chat-text">{{ layui.layim.content(item.content) }}</div></li>
|
||||
{{# }
|
||||
}); }}
|
||||
</textarea>
|
||||
|
||||
<!--
|
||||
上述模版采用了 laytpl 语法
|
||||
-->
|
||||
|
||||
|
||||
<script src="//unpkg.com/layui@2.6.8/dist/layui.js"></script>
|
||||
<script>
|
||||
layui.link('../layim.css', 'skinlayimcss') //加载 css
|
||||
layui.config({
|
||||
layimPath: '../../' //配置 layim.js 所在目录
|
||||
,layimResPath: '../' //layim 资源文件所在目录
|
||||
}).use(['jquery'], function(){
|
||||
var layim = parent.layui.layim
|
||||
,laytpl = parent.layui.laytpl
|
||||
,$ = layui.jquery
|
||||
,laypage = parent.layui.laypage;
|
||||
|
||||
//聊天记录的分页此处不做演示,你可以采用 laypage
|
||||
|
||||
//开始请求聊天记录
|
||||
var param = location.search //获得URL参数。该窗口url会携带会话id和type,他们是你请求聊天记录的重要凭据
|
||||
|
||||
//实际使用时,下述的res一般是通过Ajax获得,而此处仅仅只是演示数据格式
|
||||
,res = {
|
||||
code: 0
|
||||
,msg: ''
|
||||
,data: [{
|
||||
username: '我'
|
||||
,id: 100000
|
||||
,avatar: '' || layui.cache.layimResPath + 'images/default.png'
|
||||
,timestamp: 1480897882000
|
||||
,content: '我方模拟记录 111'
|
||||
}, {
|
||||
username: 'test123'
|
||||
,id: 108101
|
||||
,avatar: '' || layui.cache.layimResPath + 'images/default.png'
|
||||
,timestamp: 1480897892000
|
||||
,content: '对方模拟记录 111'
|
||||
},{
|
||||
username: 'test123'
|
||||
,id: 108101
|
||||
,avatar: '' || layui.cache.layimResPath + 'images/default.png'
|
||||
,timestamp: 1480897898000
|
||||
,content: '对方模拟记录 222'
|
||||
},{
|
||||
username: 'test123'
|
||||
,id: 108101
|
||||
,avatar: '' || layui.cache.layimResPath + 'images/default.png'
|
||||
,timestamp: 1480897908000
|
||||
,content: '注意:该页面为 chatLog 参数指向的自定义页面。此页仅为聊天记录的模拟数据,实际使用时请进行相应修改。'
|
||||
}]
|
||||
}
|
||||
|
||||
//console.log(param)
|
||||
|
||||
var html = laytpl(LAY_tpl.value).render({
|
||||
data: res.data
|
||||
});
|
||||
$('#LAY_view').html(html);
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,44 @@
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title>发现</title>
|
||||
|
||||
<link rel="stylesheet" href="//unpkg.com/layui@2.6.8/dist/css/layui.css">
|
||||
<style>
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div style="margin: 15px;">
|
||||
<blockquote class="layui-elem-quote">
|
||||
通过 find 参数指向的自定义页面
|
||||
</blockquote>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script src="//unpkg.com/layui@2.6.8/dist/layui.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
layimPath: '../../' //配置 layim.js 所在目录
|
||||
,layimResPath: '../' //layim 资源文件所在目录
|
||||
}).extend({
|
||||
layim: layui.cache.layimPath + 'layim' //配置 layim 组件所在的路径
|
||||
}).use(['layim', 'laypage'], function(){
|
||||
var layim = layui.layim
|
||||
,layer = layui.layer
|
||||
,laytpl = layui.laytpl
|
||||
,$ = layui.jquery
|
||||
,laypage = layui.laypage;
|
||||
|
||||
//一些添加好友请求之类的交互参见文档
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"code": 0,
|
||||
"pages": 1,
|
||||
"data": [
|
||||
{
|
||||
"id": 76,
|
||||
"content": "申请添加你为好友",
|
||||
"uid": 168,
|
||||
"from": 166488,
|
||||
"from_group": 0,
|
||||
"type": 1,
|
||||
"remark": "test1",
|
||||
"href": null,
|
||||
"read": 1,
|
||||
"time": "刚刚",
|
||||
"user": {
|
||||
"id": 166488,
|
||||
"avatar": "http://q.qlogo.cn/qqapp/101235792/B704597964F9BD0DB648292D1B09F7E8/100",
|
||||
"username": "测试A",
|
||||
"sign": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 75,
|
||||
"content": "申请添加你为好友",
|
||||
"uid": 168,
|
||||
"from": 347592,
|
||||
"from_group": 0,
|
||||
"type": 1,
|
||||
"remark": "test2",
|
||||
"href": null,
|
||||
"read": 1,
|
||||
"time": "刚刚",
|
||||
"user": {
|
||||
"id": 347592,
|
||||
"avatar": "http://q.qlogo.cn/qqapp/101235792/B78751375E0531675B1272AD994BA875/100",
|
||||
"username": "测试B",
|
||||
"sign": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 62,
|
||||
"content": "测试C 拒绝了你的好友申请",
|
||||
"uid": 168,
|
||||
"from": null,
|
||||
"from_group": null,
|
||||
"type": 1,
|
||||
"remark": null,
|
||||
"href": null,
|
||||
"read": 1,
|
||||
"time": "10天前",
|
||||
"user": {
|
||||
"id": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 60,
|
||||
"content": "测试D 已经同意你的好友申请",
|
||||
"uid": 168,
|
||||
"from": null,
|
||||
"from_group": null,
|
||||
"type": 1,
|
||||
"remark": null,
|
||||
"href": null,
|
||||
"read": 1,
|
||||
"time": "10天前",
|
||||
"user": {
|
||||
"id": null
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,220 @@
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title>消息盒子</title>
|
||||
|
||||
<link rel="stylesheet" href="//unpkg.com/layui@2.6.8/dist/css/layui.css">
|
||||
<style>
|
||||
.layim-msgbox{margin: 15px;}
|
||||
.layim-msgbox li{position: relative; margin-bottom: 10px; padding: 0 130px 10px 60px; padding-bottom: 10px; line-height: 22px; border-bottom: 1px dotted #e2e2e2;}
|
||||
.layim-msgbox .layim-msgbox-tips{margin: 0; padding: 10px 0; border: none; text-align: center; color: #999;}
|
||||
.layim-msgbox .layim-msgbox-system{padding: 0 10px 10px 10px;}
|
||||
.layim-msgbox li p span{padding-left: 5px; color: #999;}
|
||||
.layim-msgbox li p em{font-style: normal; color: #FF5722;}
|
||||
|
||||
.layim-msgbox-avatar{position: absolute; left: 0; top: 0; width: 50px; height: 50px;}
|
||||
.layim-msgbox-user{padding-top: 5px;}
|
||||
.layim-msgbox-content{margin-top: 3px;}
|
||||
.layim-msgbox .layui-btn-small{padding: 0 15px; margin-left: 5px;}
|
||||
.layim-msgbox-btn{position: absolute; right: 0; top: 12px; color: #999;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<ul class="layim-msgbox" id="LAY_view"></ul>
|
||||
|
||||
<div style="margin: 0 15px;">
|
||||
<blockquote class="layui-elem-quote">
|
||||
注意:该页面为 msgbox 参数指向的自定义页面。
|
||||
<br> 此页为消息盒子的模拟数据,实际使用时请进行相应修改。
|
||||
</blockquote>
|
||||
</div>
|
||||
|
||||
<textarea title="消息模版" id="LAY_tpl" style="display:none;">
|
||||
{{# layui.each(d.data, function(index, item){
|
||||
if(item.from){ }}
|
||||
<li data-uid="{{ item.from }}" data-fromGroup="{{ item.from_group }}">
|
||||
<a href="/u/{{ item.from }}/" target="_blank">
|
||||
<img src="{{ item.user.avatar }}" class="layui-circle layim-msgbox-avatar">
|
||||
</a>
|
||||
<p class="layim-msgbox-user">
|
||||
<a href="/u/{{ item.from }}/" target="_blank">{{ item.user.username||'' }}</a>
|
||||
<span>{{ item.time }}</span>
|
||||
</p>
|
||||
<p class="layim-msgbox-content">
|
||||
{{ item.content }}
|
||||
<span>{{ item.remark ? '附言: '+item.remark : '' }}</span>
|
||||
</p>
|
||||
<p class="layim-msgbox-btn">
|
||||
<button class="layui-btn layui-btn-small" data-type="agree">同意</button>
|
||||
<button class="layui-btn layui-btn-small layui-btn-primary" data-type="refuse">拒绝</button>
|
||||
</p>
|
||||
</li>
|
||||
{{# } else { }}
|
||||
<li class="layim-msgbox-system">
|
||||
<p><em>系统:</em>{{ item.content }}<span>{{ item.time }}</span></p>
|
||||
</li>
|
||||
{{# }
|
||||
}); }}
|
||||
</textarea>
|
||||
|
||||
<!--
|
||||
上述模版采用了 laytpl 语法
|
||||
-->
|
||||
|
||||
|
||||
<script src="//unpkg.com/layui@2.6.8/dist/layui.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
layimPath: '../../' //配置 layim.js 所在目录
|
||||
,layimResPath: '../' //layim 资源文件所在目录
|
||||
}).extend({
|
||||
layim: layui.cache.layimPath + 'layim' //配置 layim 组件所在的路径
|
||||
}).use(['layim', 'flow'], function(){
|
||||
var layim = layui.layim
|
||||
,layer = layui.layer
|
||||
,laytpl = layui.laytpl
|
||||
,$ = layui.jquery
|
||||
,flow = layui.flow;
|
||||
|
||||
var cache = {}; //用于临时记录请求到的数据
|
||||
|
||||
//请求消息
|
||||
var renderMsg = function(page, callback){
|
||||
|
||||
//实际部署时,请将下述 getmsg.json 改为你的接口地址
|
||||
|
||||
$.get('getmsg.json', {
|
||||
page: page || 1
|
||||
}, function(res){
|
||||
if(res.code != 0){
|
||||
return layer.msg(res.msg);
|
||||
}
|
||||
|
||||
//记录来源用户信息
|
||||
layui.each(res.data, function(index, item){
|
||||
cache[item.from] = item.user;
|
||||
});
|
||||
|
||||
callback && callback(res.data, res.pages);
|
||||
});
|
||||
};
|
||||
|
||||
//消息信息流
|
||||
flow.load({
|
||||
elem: '#LAY_view' //流加载容器
|
||||
,isAuto: false
|
||||
,end: '<li class="layim-msgbox-tips">暂无更多新消息</li>'
|
||||
,done: function(page, next){ //加载下一页
|
||||
renderMsg(page, function(data, pages){
|
||||
var html = laytpl(LAY_tpl.value).render({
|
||||
data: data
|
||||
,page: page
|
||||
});
|
||||
next(html, page < pages);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//打开页面即把消息标记为已读
|
||||
/*
|
||||
$.post('/message/read', {
|
||||
type: 1
|
||||
});
|
||||
*/
|
||||
|
||||
//操作
|
||||
var active = {
|
||||
//同意
|
||||
agree: function(othis){
|
||||
var li = othis.parents('li')
|
||||
,uid = li.data('uid')
|
||||
,from_group = li.data('fromGroup')
|
||||
,user = cache[uid];
|
||||
|
||||
//选择分组
|
||||
parent.layui.layim.setFriendGroup({
|
||||
type: 'friend'
|
||||
,username: user.username
|
||||
,avatar: user.avatar
|
||||
,group: parent.layui.layim.cache().friend //获取好友分组数据
|
||||
,submit: function(group, index){
|
||||
|
||||
//将好友追加到主面板
|
||||
parent.layui.layim.addList({
|
||||
type: 'friend'
|
||||
,avatar: user.avatar //好友头像
|
||||
,username: user.username //好友昵称
|
||||
,groupid: group //所在的分组id
|
||||
,id: uid //好友ID
|
||||
,sign: user.sign //好友签名
|
||||
});
|
||||
parent.layer.close(index);
|
||||
othis.parent().html('已同意');
|
||||
|
||||
|
||||
//实际部署时,请开启下述注释,并改成你的接口地址
|
||||
/*
|
||||
$.post('/im/agreeFriend', {
|
||||
uid: uid //对方用户ID
|
||||
,from_group: from_group //对方设定的好友分组
|
||||
,group: group //我设定的好友分组
|
||||
}, function(res){
|
||||
if(res.code != 0){
|
||||
return layer.msg(res.msg);
|
||||
}
|
||||
|
||||
//将好友追加到主面板
|
||||
parent.layui.layim.addList({
|
||||
type: 'friend'
|
||||
,avatar: user.avatar //好友头像
|
||||
,username: user.username //好友昵称
|
||||
,groupid: group //所在的分组id
|
||||
,id: uid //好友ID
|
||||
,sign: user.sign //好友签名
|
||||
});
|
||||
parent.layer.close(index);
|
||||
othis.parent().html('已同意');
|
||||
});
|
||||
*/
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//拒绝
|
||||
,refuse: function(othis){
|
||||
var li = othis.parents('li')
|
||||
,uid = li.data('uid');
|
||||
|
||||
layer.confirm('确定拒绝吗?', function(index){
|
||||
layer.close(index);
|
||||
othis.parent().html('<em>已拒绝</em>');
|
||||
|
||||
/*
|
||||
$.post('/im/refuseFriend', {
|
||||
uid: uid //对方用户ID
|
||||
}, function(res){
|
||||
if(res.code != 0){
|
||||
return layer.msg(res.msg);
|
||||
}
|
||||
layer.close(index);
|
||||
othis.parent().html('<em>已拒绝</em>');
|
||||
});
|
||||
*/
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$('body').on('click', '.layui-btn', function(){
|
||||
var othis = $(this), type = othis.data('type');
|
||||
active[type] ? active[type].call(this, othis) : '';
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 45 KiB |
293
CoreCms.Net.Web.Admin/wwwroot/lib/layuiAdmin/modules/sample.js
Normal file
@@ -0,0 +1,293 @@
|
||||
/**
|
||||
* console homepage
|
||||
*/
|
||||
|
||||
layui.define(function(exports){
|
||||
var admin = layui.admin;
|
||||
|
||||
//区块轮播切换
|
||||
layui.use(['admin', 'carousel'], function(){
|
||||
var $ = layui.$
|
||||
,admin = layui.admin
|
||||
,carousel = layui.carousel
|
||||
,element = layui.element
|
||||
,device = layui.device();
|
||||
|
||||
//轮播切换
|
||||
$('.layadmin-carousel').each(function(){
|
||||
var othis = $(this);
|
||||
carousel.render({
|
||||
elem: this
|
||||
,width: '100%'
|
||||
,arrow: 'none'
|
||||
,interval: othis.data('interval')
|
||||
,autoplay: othis.data('autoplay') === true
|
||||
,trigger: (device.ios || device.android) ? 'click' : 'hover'
|
||||
,anim: othis.data('anim')
|
||||
});
|
||||
});
|
||||
|
||||
element.render('progress');
|
||||
|
||||
});
|
||||
|
||||
//八卦新闻
|
||||
layui.use(['carousel', 'echarts'], function(){
|
||||
var $ = layui.$
|
||||
,carousel = layui.carousel
|
||||
,echarts = layui.echarts;
|
||||
|
||||
var echartsApp = [], options = [
|
||||
{
|
||||
title : {
|
||||
subtext: '完全实况球员数据',
|
||||
textStyle: {
|
||||
fontSize: 14
|
||||
}
|
||||
},
|
||||
tooltip : {
|
||||
trigger: 'axis'
|
||||
},
|
||||
legend: {
|
||||
x : 'left',
|
||||
data:['罗纳尔多','舍普琴科']
|
||||
},
|
||||
polar : [
|
||||
{
|
||||
indicator : [
|
||||
{text : '进攻', max : 100},
|
||||
{text : '防守', max : 100},
|
||||
{text : '体能', max : 100},
|
||||
{text : '速度', max : 100},
|
||||
{text : '力量', max : 100},
|
||||
{text : '技巧', max : 100}
|
||||
],
|
||||
radius : 130
|
||||
}
|
||||
],
|
||||
series : [
|
||||
{
|
||||
type: 'radar',
|
||||
center : ['50%', '50%'],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
areaStyle: {
|
||||
type: 'default'
|
||||
}
|
||||
}
|
||||
},
|
||||
data:[
|
||||
{value : [97, 42, 88, 94, 90, 86], name : '舍普琴科'},
|
||||
{value : [97, 32, 74, 95, 88, 92], name : '罗纳尔多'}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
,elemDataView = $('#LAY-index-pageone').children('div')
|
||||
,renderDataView = function(index){
|
||||
echartsApp[index] = echarts.init(elemDataView[index], layui.echartsTheme);
|
||||
echartsApp[index].setOption(options[index]);
|
||||
window.onresize = echartsApp[index].resize;
|
||||
};
|
||||
//没找到DOM,终止执行
|
||||
if(!elemDataView[0]) return;
|
||||
|
||||
renderDataView(0);
|
||||
});
|
||||
|
||||
//访问量
|
||||
layui.use(['carousel', 'echarts'], function(){
|
||||
var $ = layui.$
|
||||
,carousel = layui.carousel
|
||||
,echarts = layui.echarts;
|
||||
|
||||
var echartsApp = [], options = [
|
||||
{
|
||||
tooltip : {
|
||||
trigger: 'axis'
|
||||
},
|
||||
calculable : true,
|
||||
legend: {
|
||||
data:['访问量','下载量','平均访问量']
|
||||
},
|
||||
|
||||
xAxis : [
|
||||
{
|
||||
type : 'category',
|
||||
data : ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月']
|
||||
}
|
||||
],
|
||||
yAxis : [
|
||||
{
|
||||
type : 'value',
|
||||
name : '访问量',
|
||||
axisLabel : {
|
||||
formatter: '{value} 万'
|
||||
}
|
||||
},
|
||||
{
|
||||
type : 'value',
|
||||
name : '下载量',
|
||||
axisLabel : {
|
||||
formatter: '{value} 万'
|
||||
}
|
||||
}
|
||||
],
|
||||
series : [
|
||||
{
|
||||
name:'访问量',
|
||||
type:'line',
|
||||
data:[900, 850, 950, 1000, 1100, 1050, 1000, 1150, 1250, 1370, 1250, 1100]
|
||||
},
|
||||
{
|
||||
name:'下载量',
|
||||
type:'line',
|
||||
yAxisIndex: 1,
|
||||
data:[850, 850, 800, 950, 1000, 950, 950, 1150, 1100, 1240, 1000, 950]
|
||||
},
|
||||
{
|
||||
name:'平均访问量',
|
||||
type:'line',
|
||||
data:[870, 850, 850, 950, 1050, 1000, 980, 1150, 1000, 1300, 1150, 1000]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
,elemDataView = $('#LAY-index-pagetwo').children('div')
|
||||
,renderDataView = function(index){
|
||||
echartsApp[index] = echarts.init(elemDataView[index], layui.echartsTheme);
|
||||
echartsApp[index].setOption(options[index]);
|
||||
window.onresize = echartsApp[index].resize;
|
||||
};
|
||||
//没找到DOM,终止执行
|
||||
if(!elemDataView[0]) return;
|
||||
renderDataView(0);
|
||||
|
||||
});
|
||||
|
||||
//地图
|
||||
layui.use(['carousel', 'echarts'], function(){
|
||||
var $ = layui.$
|
||||
,carousel = layui.carousel
|
||||
,echarts = layui.echarts;
|
||||
|
||||
var echartsApp = [], options = [
|
||||
{
|
||||
title : {
|
||||
text: '访客地区分布',
|
||||
subtext: '不完全统计'
|
||||
},
|
||||
tooltip : {
|
||||
trigger: 'item'
|
||||
},
|
||||
dataRange: {
|
||||
orient: 'horizontal',
|
||||
min: 0,
|
||||
max: 60000,
|
||||
text:['高','低'],
|
||||
splitNumber:0
|
||||
},
|
||||
series : [
|
||||
{
|
||||
name: '访客地区分布',
|
||||
type: 'map',
|
||||
mapType: 'china',
|
||||
selectedMode : 'multiple',
|
||||
itemStyle:{
|
||||
normal:{label:{show:true}},
|
||||
emphasis:{label:{show:true}}
|
||||
},
|
||||
data:[
|
||||
{name:'西藏', value:60},
|
||||
{name:'青海', value:167},
|
||||
{name:'宁夏', value:210},
|
||||
{name:'海南', value:252},
|
||||
{name:'甘肃', value:502},
|
||||
{name:'贵州', value:570},
|
||||
{name:'新疆', value:661},
|
||||
{name:'云南', value:8890},
|
||||
{name:'重庆', value:10010},
|
||||
{name:'吉林', value:5056},
|
||||
{name:'山西', value:2123},
|
||||
{name:'天津', value:9130},
|
||||
{name:'江西', value:10170},
|
||||
{name:'广西', value:6172},
|
||||
{name:'陕西', value:9251},
|
||||
{name:'黑龙江', value:5125},
|
||||
{name:'内蒙古', value:1435},
|
||||
{name:'安徽', value:9530},
|
||||
{name:'北京', value:51919},
|
||||
{name:'福建', value:3756},
|
||||
{name:'上海', value:59190},
|
||||
{name:'湖北', value:37109},
|
||||
{name:'湖南', value:8966},
|
||||
{name:'四川', value:31020},
|
||||
{name:'辽宁', value:7222},
|
||||
{name:'河北', value:3451},
|
||||
{name:'河南', value:9693},
|
||||
{name:'浙江', value:62310},
|
||||
{name:'山东', value:39231},
|
||||
{name:'江苏', value:35911},
|
||||
{name:'广东', value:55891}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
,elemDataView = $('#LAY-index-pagethree').children('div')
|
||||
,renderDataView = function(index){
|
||||
echartsApp[index] = echarts.init(elemDataView[index], layui.echartsTheme);
|
||||
echartsApp[index].setOption(options[index]);
|
||||
window.onresize = echartsApp[index].resize;
|
||||
};
|
||||
//没找到DOM,终止执行
|
||||
if(!elemDataView[0]) return;
|
||||
|
||||
renderDataView(0);
|
||||
});
|
||||
|
||||
//项目进展
|
||||
layui.use('table', function(){
|
||||
var $ = layui.$
|
||||
,table = layui.table;
|
||||
|
||||
table.render({
|
||||
elem: '#LAY-home-homepage2'
|
||||
,url: './res/json/console/prograss.js' //模拟接口
|
||||
,cols: [[
|
||||
{type: 'checkbox', fixed: 'left'}
|
||||
,{field: 'prograss', title: '任务'}
|
||||
,{field: 'time', title: '所需时间'}
|
||||
,{field: 'complete', title: '完成情况'
|
||||
,templet: function(d){
|
||||
if(d.complete == '已完成'){
|
||||
return '<del style="color: #5FB878;">'+ d.complete +'</del>'
|
||||
}else if(d.complete == '进行中'){
|
||||
return '<span style="color: #FFB800;">'+ d.complete +'</span>'
|
||||
}else{
|
||||
return '<span style="color: #FF5722;">'+ d.complete +'</span>'
|
||||
}
|
||||
}
|
||||
}
|
||||
]]
|
||||
,skin: 'line'
|
||||
});
|
||||
});
|
||||
|
||||
//回复留言
|
||||
admin.events.replyNote = function(othis){
|
||||
var nid = othis.data('id');
|
||||
layer.prompt({
|
||||
title: '回复留言 ID:'+ nid
|
||||
,formType: 2
|
||||
}, function(value, index){
|
||||
//这里可以请求 Ajax
|
||||
//…
|
||||
layer.msg('得到:'+ value);
|
||||
layer.close(index);
|
||||
});
|
||||
};
|
||||
|
||||
exports('sample', {})
|
||||
});
|
||||
1147
CoreCms.Net.Web.Admin/wwwroot/lib/layuiAdmin/modules/senior.js
Normal file
152
CoreCms.Net.Web.Admin/wwwroot/lib/layuiAdmin/modules/set.js
Normal file
@@ -0,0 +1,152 @@
|
||||
/**
|
||||
* set
|
||||
*/
|
||||
|
||||
layui.define(['form', 'upload'], function(exports){
|
||||
var $ = layui.$
|
||||
,layer = layui.layer
|
||||
,laytpl = layui.laytpl
|
||||
,setter = layui.setter
|
||||
,view = layui.view
|
||||
,admin = layui.admin
|
||||
,form = layui.form
|
||||
,upload = layui.upload;
|
||||
|
||||
var $body = $('body');
|
||||
|
||||
form.render();
|
||||
|
||||
//自定义验证
|
||||
form.verify({
|
||||
nickname: function(value, item){ //value:表单的值、item:表单的DOM对象
|
||||
if(!new RegExp("^[a-zA-Z0-9_\u4e00-\u9fa5\\s·]+$").test(value)){
|
||||
return '用户名不能有特殊字符';
|
||||
}
|
||||
if(/(^\_)|(\__)|(\_+$)/.test(value)){
|
||||
return '用户名首尾不能出现下划线\'_\'';
|
||||
}
|
||||
if(/^\d+\d+\d$/.test(value)){
|
||||
return '用户名不能全为数字';
|
||||
}
|
||||
}
|
||||
|
||||
//我们既支持上述函数式的方式,也支持下述数组的形式
|
||||
//数组的两个值分别代表:[正则匹配、匹配不符时的提示文字]
|
||||
,pass: [
|
||||
/^[\S]{6,12}$/
|
||||
,'密码必须6到12位,且不能出现空格'
|
||||
]
|
||||
|
||||
//确认密码
|
||||
,repass: function(value){
|
||||
if(value !== $('#LAY_password').val()){
|
||||
return '两次密码输入不一致';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//网站设置
|
||||
form.on('submit(set_website)', function(obj){
|
||||
layer.alert(layui.util.escape(JSON.stringify(obj.field)));
|
||||
|
||||
//提交修改
|
||||
/*
|
||||
admin.req({
|
||||
url: ''
|
||||
,data: obj.field
|
||||
,success: function(){
|
||||
|
||||
}
|
||||
});
|
||||
*/
|
||||
return false;
|
||||
});
|
||||
|
||||
//邮件服务
|
||||
form.on('submit(set_system_email)', function(obj){
|
||||
layer.alert(layui.util.escape(JSON.stringify(obj.field)));
|
||||
|
||||
//提交修改
|
||||
/*
|
||||
admin.req({
|
||||
url: ''
|
||||
,data: obj.field
|
||||
,success: function(){
|
||||
|
||||
}
|
||||
});
|
||||
*/
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
//设置我的资料
|
||||
form.on('submit(setmyinfo)', function(obj){
|
||||
layer.alert(layui.util.escape(JSON.stringify(obj.field)));
|
||||
|
||||
//提交修改
|
||||
/*
|
||||
admin.req({
|
||||
url: ''
|
||||
,data: obj.field
|
||||
,success: function(){
|
||||
|
||||
}
|
||||
});
|
||||
*/
|
||||
return false;
|
||||
});
|
||||
|
||||
//上传头像
|
||||
var avatarSrc = $('#LAY_avatarSrc');
|
||||
upload.render({
|
||||
url: '/api/upload/'
|
||||
,elem: '#LAY_avatarUpload'
|
||||
,done: function(res){
|
||||
if(res.status == 0){
|
||||
avatarSrc.val(res.url);
|
||||
} else {
|
||||
layer.msg(res.msg, {icon: 5});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//查看头像
|
||||
admin.events.avartatPreview = function(othis){
|
||||
var src = avatarSrc.val();
|
||||
layer.photos({
|
||||
photos: {
|
||||
"title": "查看头像" //相册标题
|
||||
,"data": [{
|
||||
"src": src //原图地址
|
||||
}]
|
||||
}
|
||||
,shade: 0.01
|
||||
,closeBtn: 1
|
||||
,anim: 5
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
// 设置密码
|
||||
form.on('submit(setmypass)', function(obj){
|
||||
var field = obj.field; // 获得表单字段
|
||||
|
||||
layer.msg('ok');
|
||||
|
||||
// 提交修改
|
||||
/*
|
||||
admin.req({
|
||||
url: ''
|
||||
,data: obj.field
|
||||
,success: function(){
|
||||
|
||||
}
|
||||
});
|
||||
*/
|
||||
return false;
|
||||
});
|
||||
|
||||
// 输出接口
|
||||
exports('set', {});
|
||||
});
|
||||
47
CoreCms.Net.Web.Admin/wwwroot/lib/layuiAdmin/modules/user.js
Normal file
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* user demo
|
||||
*/
|
||||
|
||||
layui.define('form', function(exports){
|
||||
var $ = layui.$
|
||||
,layer = layui.layer
|
||||
,laytpl = layui.laytpl
|
||||
,setter = layui.setter
|
||||
,view = layui.view
|
||||
,admin = layui.admin
|
||||
,form = layui.form;
|
||||
|
||||
var $body = $('body');
|
||||
|
||||
//自定义验证
|
||||
form.verify({
|
||||
nickname: function(value, item){ //value:表单的值、item:表单的DOM对象
|
||||
if(!new RegExp("^[a-zA-Z0-9_\u4e00-\u9fa5\\s·]+$").test(value)){
|
||||
return '用户名不能有特殊字符';
|
||||
}
|
||||
if(/(^\_)|(\__)|(\_+$)/.test(value)){
|
||||
return '用户名首尾不能出现下划线\'_\'';
|
||||
}
|
||||
if(/^\d+\d+\d$/.test(value)){
|
||||
return '用户名不能全为数字';
|
||||
}
|
||||
}
|
||||
|
||||
//我们既支持上述函数式的方式,也支持下述数组的形式
|
||||
//数组的两个值分别代表:[正则匹配、匹配不符时的提示文字]
|
||||
,pass: [
|
||||
/^[\S]{6,12}$/
|
||||
,'密码必须6到12位,且不能出现空格'
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
//更换图形验证码
|
||||
$body.on('click', '#LAY-user-get-vercode', function(){
|
||||
var othis = $(this);
|
||||
this.src = 'https://www.oschina.net/action/user/captcha?t='+ new Date().getTime()
|
||||
});
|
||||
|
||||
//对外暴露的接口
|
||||
exports('user', {});
|
||||
});
|
||||
@@ -0,0 +1,179 @@
|
||||
/**
|
||||
* useradmin demo
|
||||
*/
|
||||
|
||||
|
||||
layui.define(['table', 'form'], function(exports){
|
||||
var $ = layui.$
|
||||
,admin = layui.admin
|
||||
,view = layui.view
|
||||
,table = layui.table
|
||||
,form = layui.form;
|
||||
|
||||
//用户管理
|
||||
table.render({
|
||||
elem: '#LAY-user-manage'
|
||||
,url: './res/json/useradmin/webuser.js' //模拟接口
|
||||
,cols: [[
|
||||
{type: 'checkbox', fixed: 'left'}
|
||||
,{field: 'id', width: 100, title: 'ID', sort: true}
|
||||
,{field: 'username', title: '用户名', minWidth: 100}
|
||||
,{field: 'avatar', title: '头像', width: 100, templet: '#imgTpl'}
|
||||
,{field: 'phone', title: '手机'}
|
||||
,{field: 'email', title: '邮箱'}
|
||||
,{field: 'sex', width: 80, title: '性别'}
|
||||
,{field: 'ip', title: 'IP'}
|
||||
,{field: 'jointime', title: '加入时间', sort: true}
|
||||
,{title: '操作', width: 150, align:'center', fixed: 'right', toolbar: '#table-useradmin-webuser'}
|
||||
]]
|
||||
,page: true
|
||||
,limit: 30
|
||||
,height: 'full-320'
|
||||
,text: '对不起,加载出现异常!'
|
||||
});
|
||||
|
||||
//工具条
|
||||
table.on('tool(LAY-user-manage)', function(obj){
|
||||
var data = obj.data;
|
||||
if(obj.event === 'del'){
|
||||
layer.prompt({
|
||||
formType: 1
|
||||
,title: '敏感操作,请验证口令'
|
||||
}, function(value, index){
|
||||
layer.close(index);
|
||||
|
||||
layer.confirm('真的删除行么', function(index){
|
||||
obj.del();
|
||||
layer.close(index);
|
||||
});
|
||||
});
|
||||
} else if(obj.event === 'edit'){
|
||||
admin.popup({
|
||||
title: '编辑用户'
|
||||
,area: ['500px', '450px']
|
||||
,id: 'LAY-popup-user-add'
|
||||
,success: function(layero, index){
|
||||
view(this.id).render('user/user/userform', data).done(function(){
|
||||
form.render(null, 'layuiadmin-form-useradmin');
|
||||
|
||||
//提交
|
||||
form.on('submit(LAY-user-front-submit)', function(data){
|
||||
var field = data.field; //获取提交的字段
|
||||
|
||||
//提交 Ajax 成功后,关闭当前弹层并重载表格
|
||||
//$.ajax({});
|
||||
layui.table.reload('LAY-user-manage'); //重载表格
|
||||
layer.close(index); //执行关闭
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//管理员管理
|
||||
table.render({
|
||||
elem: '#LAY-user-back-manage'
|
||||
,url: './res/json/useradmin/mangadmin.js' //模拟接口
|
||||
,cols: [[
|
||||
{type: 'checkbox', fixed: 'left'}
|
||||
,{field: 'id', width: 80, title: 'ID', sort: true}
|
||||
,{field: 'loginname', title: '登录名'}
|
||||
,{field: 'telphone', title: '手机'}
|
||||
,{field: 'email', title: '邮箱'}
|
||||
,{field: 'role', title: '角色'}
|
||||
,{field: 'jointime', title: '加入时间', sort: true}
|
||||
,{field: 'check', title:'审核状态', templet: '#buttonTpl', minWidth: 80, align: 'center'}
|
||||
,{title: '操作', width: 150, align: 'center', fixed: 'right', toolbar: '#table-useradmin-admin'}
|
||||
]]
|
||||
,text: '对不起,加载出现异常!'
|
||||
});
|
||||
|
||||
//工具条
|
||||
table.on('tool(LAY-user-back-manage)', function(obj){
|
||||
var data = obj.data;
|
||||
if(obj.event === 'del'){
|
||||
layer.prompt({
|
||||
formType: 1
|
||||
,title: '敏感操作,请验证口令'
|
||||
}, function(value, index){
|
||||
layer.close(index);
|
||||
layer.confirm('确定删除此管理员?', function(index){
|
||||
console.log(obj)
|
||||
obj.del();
|
||||
layer.close(index);
|
||||
});
|
||||
});
|
||||
}else if(obj.event === 'edit'){
|
||||
admin.popup({
|
||||
title: '编辑管理员'
|
||||
,area: ['420px', '450px']
|
||||
,id: 'LAY-popup-user-add'
|
||||
,success: function(layero, index){
|
||||
view(this.id).render('user/administrators/adminform', data).done(function(){
|
||||
form.render(null, 'layuiadmin-form-admin');
|
||||
|
||||
//提交
|
||||
form.on('submit(LAY-user-back-submit)', function(data){
|
||||
var field = data.field; //获取提交的字段
|
||||
|
||||
//提交 Ajax 成功后,关闭当前弹层并重载表格
|
||||
//$.ajax({});
|
||||
layui.table.reload('LAY-user-back-manage'); //重载表格
|
||||
layer.close(index); //执行关闭
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//角色管理
|
||||
table.render({
|
||||
elem: '#LAY-user-back-role'
|
||||
,url: './res/json/useradmin/role.js' //模拟接口
|
||||
,cols: [[
|
||||
{type: 'checkbox', fixed: 'left'}
|
||||
,{field: 'id', width: 80, title: 'ID', sort: true}
|
||||
,{field: 'rolename', title: '角色名'}
|
||||
,{field: 'limits', title: '拥有权限'}
|
||||
,{field: 'descr', title: '具体描述'}
|
||||
,{title: '操作', width: 150, align: 'center', fixed: 'right', toolbar: '#table-useradmin-admin'}
|
||||
]]
|
||||
,text: '对不起,加载出现异常!'
|
||||
});
|
||||
|
||||
//工具条
|
||||
table.on('tool(LAY-user-back-role)', function(obj){
|
||||
var data = obj.data;
|
||||
if(obj.event === 'del'){
|
||||
layer.confirm('确定删除此角色?', function(index){
|
||||
obj.del();
|
||||
layer.close(index);
|
||||
});
|
||||
}else if(obj.event === 'edit'){
|
||||
admin.popup({
|
||||
title: '添加新角色'
|
||||
,area: ['500px', '480px']
|
||||
,id: 'LAY-popup-user-add'
|
||||
,success: function(layero, index){
|
||||
view(this.id).render('user/administrators/roleform', data).done(function(){
|
||||
form.render(null, 'layuiadmin-form-role');
|
||||
|
||||
//提交
|
||||
form.on('submit(LAY-user-role-submit)', function(data){
|
||||
var field = data.field; //获取提交的字段
|
||||
|
||||
//提交 Ajax 成功后,关闭当前弹层并重载表格
|
||||
//$.ajax({});
|
||||
layui.table.reload('LAY-user-back-role'); //重载表格
|
||||
layer.close(index); //执行关闭
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
exports('useradmin', {})
|
||||
});
|
||||
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* workorder demo
|
||||
*/
|
||||
|
||||
|
||||
layui.define(['table', 'form', 'element'], function(exports){
|
||||
var $ = layui.$
|
||||
,admin = layui.admin
|
||||
,view = layui.view
|
||||
,table = layui.table
|
||||
,form = layui.form
|
||||
,element = layui.element;
|
||||
|
||||
table.render({
|
||||
elem: '#LAY-app-workorder'
|
||||
,url: './res/json/workorder/demo.js' //模拟接口
|
||||
,cols: [[
|
||||
{type: 'numbers', fixed: 'left'}
|
||||
,{field: 'orderid', width: 100, title: '工单号', sort: true}
|
||||
,{field: 'attr', width: 100, title: '业务性质'}
|
||||
,{field: 'title', width: 100, title: '工单标题', width: 300}
|
||||
,{field: 'progress', title: '进度', width: 200, align: 'center', templet: '#progressTpl'}
|
||||
,{field: 'submit', width: 100, title: '提交者'}
|
||||
,{field: 'accept', width: 100, title: '受理人员'}
|
||||
,{field: 'state', title: '工单状态', templet: '#buttonTpl', minWidth: 80, align: 'center'}
|
||||
,{title: '操作', align: 'center', fixed: 'right', toolbar: '#table-system-order'}
|
||||
]]
|
||||
,page: true
|
||||
,limit: 10
|
||||
,limits: [10, 15, 20, 25, 30]
|
||||
,text: '对不起,加载出现异常!'
|
||||
,done: function(){
|
||||
element.render('progress');
|
||||
}
|
||||
});
|
||||
|
||||
//工具条
|
||||
table.on('tool(LAY-app-workorder)', function(obj){
|
||||
var data = obj.data;
|
||||
if(obj.event === 'edit'){
|
||||
admin.popup({
|
||||
title: '编辑工单'
|
||||
,area: ['450px', '450px']
|
||||
,id: 'LAY-popup-workorder-add'
|
||||
,success: function(layero, index){
|
||||
view(this.id).render('app/workorder/listform').done(function(){
|
||||
form.render(null, 'layuiadmin-form-workorder');
|
||||
|
||||
//提交
|
||||
form.on('submit(LAY-app-workorder-submit)', function(data){
|
||||
var field = data.field; //获取提交的字段
|
||||
|
||||
//提交 Ajax 成功后,关闭当前弹层并重载表格
|
||||
//$.ajax({});
|
||||
layui.table.reload('LAY-app-workorder'); //重载表格
|
||||
layer.close(index); //执行关闭
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
exports('workorder', {})
|
||||
});
|
||||
|
Before Width: | Height: | Size: 933 B After Width: | Height: | Size: 933 B |
|
Before Width: | Height: | Size: 381 B After Width: | Height: | Size: 381 B |
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 601 B After Width: | Height: | Size: 601 B |
|
Before Width: | Height: | Size: 580 B After Width: | Height: | Size: 580 B |
|
Before Width: | Height: | Size: 570 B After Width: | Height: | Size: 570 B |
|
Before Width: | Height: | Size: 762 B After Width: | Height: | Size: 762 B |
|
Before Width: | Height: | Size: 399 B After Width: | Height: | Size: 399 B |
|
Before Width: | Height: | Size: 710 B After Width: | Height: | Size: 710 B |
|
Before Width: | Height: | Size: 432 B After Width: | Height: | Size: 432 B |
|
Before Width: | Height: | Size: 534 B After Width: | Height: | Size: 534 B |
|
Before Width: | Height: | Size: 529 B After Width: | Height: | Size: 529 B |