Commit 86e71150 by limin

新增树组件

1 parent 5c5db5c2
@import url(https://www.layuicdn.com/layui/css/layui.css); @import url(https://www.layuicdn.com/layui/css/layui.css);
@import url('./ztree.css');
html, body { html, body {
height: 100%; height: 100%;
} }
......
/*-------------------------------------
zTree Style
version: 3.5.19
author: Hunter.z
email: hunter.z@263.net
website: http://code.google.com/p/jquerytree/
-------------------------------------*/
.ztree * {
padding: 0;
margin: 0;
font-size: 12px;
font-family: Verdana, Arial, Helvetica, AppleGothic, sans-serif
}
.ztree {
margin: 0;
padding: 5px;
color: #333
}
.ztree li {
padding: 0;
margin: 0;
list-style: none;
line-height: 14px;
text-align: left;
white-space: nowrap;
outline: 0
}
.ztree li ul {
margin: 0;
padding: 0 0 0 18px
}
.ztree li ul.line {
background: url(./img/line_conn.gif) 0 0 repeat-y;
}
.ztree li a {
padding: 1px 3px 0 0;
margin: 0;
cursor: pointer;
/** height: 17px; limin**/
height: 17px;
color: #333;
background-color: transparent;
text-decoration: none;
vertical-align: top;
display: inline-block
}
.ztree li a:hover {
text-decoration: underline
}
.ztree li a.curSelectedNode {
padding-top: 0px;
background-color: #FFE6B0;
color: black;
height: 16px;
border: 1px #FFB951 solid;
opacity: 0.8;
}
.ztree li a.curSelectedNode_Edit {
padding-top: 0px;
background-color: #FFE6B0;
color: black;
height: 16px;
border: 1px #FFB951 solid;
opacity: 0.8;
}
.ztree li a.tmpTargetNode_inner {
padding-top: 0px;
background-color: #316AC5;
color: white;
height: 16px;
border: 1px #316AC5 solid;
opacity: 0.8;
filter: alpha(opacity=80)
}
.ztree li a.tmpTargetNode_prev {}
.ztree li a.tmpTargetNode_next {}
.ztree li a input.rename {
height: 14px;
width: 80px;
padding: 0;
margin: 0;
font-size: 12px;
border: 1px #7EC4CC solid;
*border: 0px
}
.ztree li span {
line-height: 16px;
margin-right: 2px
}
.ztree li span.button {
line-height: 0;
margin: 0;
width: 16px;
height: 16px;
display: inline-block;
vertical-align: middle;
border: 0 none;
cursor: pointer;
outline: none;
background-color: transparent;
background-repeat: no-repeat;
background-attachment: scroll;
background-image: url("./img/zTreeStandard.png");
*background-image: url("./img/zTreeStandard.gif")
}
.ztree li span.button.chk {
width: 13px;
height: 13px;
margin: 0 3px 0 0;
cursor: auto
}
.ztree li span.button.chk.checkbox_false_full {
background-position: 0 0
}
.ztree li span.button.chk.checkbox_false_full_focus {
background-position: 0 -14px
}
.ztree li span.button.chk.checkbox_false_part {
background-position: 0 -28px
}
.ztree li span.button.chk.checkbox_false_part_focus {
background-position: 0 -42px
}
.ztree li span.button.chk.checkbox_false_disable {
background-position: 0 -56px
}
.ztree li span.button.chk.checkbox_true_full {
background-position: -14px 0
}
.ztree li span.button.chk.checkbox_true_full_focus {
background-position: -14px -14px
}
.ztree li span.button.chk.checkbox_true_part {
background-position: -14px -28px
}
.ztree li span.button.chk.checkbox_true_part_focus {
background-position: -14px -42px
}
.ztree li span.button.chk.checkbox_true_disable {
background-position: -14px -56px
}
.ztree li span.button.chk.radio_false_full {
background-position: -28px 0
}
.ztree li span.button.chk.radio_false_full_focus {
background-position: -28px -14px
}
.ztree li span.button.chk.radio_false_part {
background-position: -28px -28px
}
.ztree li span.button.chk.radio_false_part_focus {
background-position: -28px -42px
}
.ztree li span.button.chk.radio_false_disable {
background-position: -28px -56px
}
.ztree li span.button.chk.radio_true_full {
background-position: -42px 0
}
.ztree li span.button.chk.radio_true_full_focus {
background-position: -42px -14px
}
.ztree li span.button.chk.radio_true_part {
background-position: -42px -28px
}
.ztree li span.button.chk.radio_true_part_focus {
background-position: -42px -42px
}
.ztree li span.button.chk.radio_true_disable {
background-position: -42px -56px
}
.ztree li span.button.switch {
width: 18px;
height: 18px
}
.ztree li span.button.root_open {
background-position: -92px -54px
}
.ztree li span.button.root_close {
background-position: -74px -54px
}
.ztree li span.button.roots_open {
background-position: -92px 0
}
.ztree li span.button.roots_close {
background-position: -74px 0
}
.ztree li span.button.center_open {
background-position: -92px -18px
}
.ztree li span.button.center_close {
background-position: -74px -18px
}
.ztree li span.button.bottom_open {
background-position: -92px -36px
}
.ztree li span.button.bottom_close {
background-position: -74px -36px
}
.ztree li span.button.noline_open {
background-position: -92px -72px
}
.ztree li span.button.noline_close {
background-position: -74px -72px
}
.ztree li span.button.root_docu {
background: none;
}
.ztree li span.button.roots_docu {
background-position: -56px 0
}
.ztree li span.button.center_docu {
background-position: -56px -18px
}
.ztree li span.button.bottom_docu {
background-position: -56px -36px
}
.ztree li span.button.noline_docu {
background: none;
}
.ztree li span.button.ico_open {
margin-right: 2px;
background-position: -110px -16px;
vertical-align: top;
*vertical-align: middle
}
.ztree li span.button.ico_close {
margin-right: 2px;
background-position: -110px 0;
vertical-align: top;
*vertical-align: middle
}
.ztree li span.button.ico_docu {
margin-right: 2px;
background-position: -110px -32px;
vertical-align: top;
*vertical-align: middle
}
.ztree li span.button.edit {
margin-right: 2px;
background-position: -110px -48px;
vertical-align: top;
*vertical-align: middle
}
.ztree li span.button.remove {
margin-right: 2px;
background-position: -110px -64px;
vertical-align: top;
*vertical-align: middle
}
.ztree li span.button.ico_loading {
margin-right: 2px;
background: url(./img/loading.gif) no-repeat scroll 0 0 transparent;
vertical-align: top;
*vertical-align: middle
}
ul.tmpTargetzTree {
background-color: #FFE6B0;
opacity: 0.8;
filter: alpha(opacity=80)
}
span.tmpzTreeMove_arrow {
width: 16px;
height: 16px;
display: inline-block;
padding: 0;
margin: 2px 0 0 1px;
border: 0 none;
position: absolute;
background-color: transparent;
background-repeat: no-repeat;
background-attachment: scroll;
background-position: -110px -80px;
background-image: url("./img/zTreeStandard.png");
*background-image: url("./img/zTreeStandard.gif")
}
ul.ztree.zTreeDragUL {
margin: 0;
padding: 0;
position: absolute;
width: auto;
height: auto;
overflow: hidden;
background-color: #cfcfcf;
border: 1px #00B83F dotted;
opacity: 0.8;
filter: alpha(opacity=80)
}
.zTreeMask {
z-index: 10000;
background-color: #cfcfcf;
opacity: 0.0;
filter: alpha(opacity=0);
position: absolute
}
/*limin*/
ul.level2 {
display: flex;
}
li.level3 span.switch.level3 {
opacity: 0;
}
/* level style*/
/*.ztree li span.button.level0 {
display:none;
}
.ztree li ul.level0 {
padding:0;
background:none;
}*/
\ No newline at end of file \ No newline at end of file
<div class="header"> <div class="header">
<ul class="layui-nav layui-bg-cyan" lay-filter=""> <ul class="layui-nav layui-bg-cyan">
<li class="layui-nav-item"> <li class="layui-nav-item">
<a href="javascript:;">XXXX有限公司</a> <a href="javascript:;">XXXX有限公司</a>
<dl class="layui-nav-child"> <dl class="layui-nav-child">
<dt></dt>
<dd><a href="">退出登录</a></dd> <dd><a href="">退出登录</a></dd>
<dd><a href="">退出登录</a></dd> <dd><a href="">退出登录</a></dd>
</dl> </dl>
</li> </li>
<li class="layui-nav-item"> <li class="layui-nav-item">
<a href="../merchant/index.html">商户管理</a> <a href="/html/merchant/index.html">商户管理</a>
</li> </li>
<li class="layui-nav-item"> <li class="layui-nav-item">
<a href="../employee/index.html">员工管理</a> <a href="/html/employee/index.html">员工管理</a>
</li> </li>
<li class="layui-nav-item"> <li class="layui-nav-item">
<a href="../role/index.html">角色管理</a> <a href="/html/role/index.html">角色管理</a>
</li> </li>
</ul> </ul>
</div> </div>
<script> <script>
highlight() layui.use('element', function () {
function highlight() { highlight(layui.$)
var element = layui.element
element.init()
})
function highlight($) {
var _path = getPath()[0] var _path = getPath()[0]
var _href = '../' + _path var _href = '/html/' + _path
$('.layui-nav-item').each(function (i, e) { $('.layui-nav-item').each(function (i, e) {
var _hr = $(e).find('a').attr('href') var _hr = $(e).find('a').attr('href')
if (_hr.startsWith(_href)) { if (_hr.startsWith(_href)) {
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
<html lang="zh"> <html lang="zh">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0,user-scalable=0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="广联帐户管理中心-员工管理" /> <meta name="description" content="广联帐户管理中心-员工管理" />
<meta name="author" content="GLSX Web Team" /> <meta name="author" content="GLSX Web Team" />
<meta name="keywords" itemprop="keywords" content="广联,帐户管理,员工管理" /> <meta name="keywords" itemprop="keywords" content="广联,帐户管理,员工管理" />
<link rel="stylesheet" type="text/css" href="../../css/main.css" /> <link rel="stylesheet" type="text/css" href="/css/main.css" />
<title>员工管理</title> <title>员工管理</title>
</head> </head>
<body> <body>
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<main>员工管理-详情</main> <main>员工管理-详情</main>
</div> </div>
<script src="https://www.layuicdn.com/layui/layui.js"></script> <script src="https://www.layuicdn.com/layui/layui.js"></script>
<script src="../../../js/load.js"></script> <script src="/js/load.js"></script>
<script> <script>
console.log(qs('a')) console.log(qs('a'))
</script> </script>
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
<html lang="zh"> <html lang="zh">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0,user-scalable=0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="广联帐户管理中心-员工管理" /> <meta name="description" content="广联帐户管理中心-员工管理" />
<meta name="author" content="GLSX Web Team" /> <meta name="author" content="GLSX Web Team" />
<meta name="keywords" itemprop="keywords" content="广联,帐户管理,员工管理" /> <meta name="keywords" itemprop="keywords" content="广联,帐户管理,员工管理" />
<link rel="stylesheet" type="text/css" href="../../css/main.css" /> <link rel="stylesheet" type="text/css" href="/css/main.css" />
<title>员工管理</title> <title>员工管理</title>
</head> </head>
<body> <body>
...@@ -15,10 +15,10 @@ ...@@ -15,10 +15,10 @@
<main>p*100{$}</main> <main>p*100{$}</main>
</div> </div>
<script src="https://www.layuicdn.com/layui/layui.js"></script> <script src="https://www.layuicdn.com/layui/layui.js"></script>
<script src="../../../js/load.js"></script> <script src="/js/load.js"></script>
<script> <script>
setTimeout(function () { setTimeout(function () {
// go('employee', 'detail', { a: 1, b: 2 }) go('merchant', 'index', { a: 1, b: 2 })
}, 3000) }, 3000)
</script> </script>
</body> </body>
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
<html lang="zh"> <html lang="zh">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0,user-scalable=0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="广联帐户管理中心-员工管理" /> <meta name="description" content="广联帐户管理中心-员工管理" />
<meta name="author" content="GLSX Web Team" /> <meta name="author" content="GLSX Web Team" />
<meta name="keywords" itemprop="keywords" content="广联,帐户管理,员工管理" /> <meta name="keywords" itemprop="keywords" content="广联,帐户管理,员工管理" />
<link rel="stylesheet" type="text/css" href="../../css/main.css" /> <link rel="stylesheet" type="text/css" href="/css/main.css" />
<title>商户管理</title> <title>商户管理</title>
</head> </head>
<body> <body>
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<main>商户管理-详情</main> <main>商户管理-详情</main>
</div> </div>
<script src="https://www.layuicdn.com/layui/layui.js"></script> <script src="https://www.layuicdn.com/layui/layui.js"></script>
<script src="../../../js/load.js"></script> <script src="/js/load.js"></script>
<script></script> <script></script>
</body> </body>
</html> </html>
...@@ -2,20 +2,36 @@ ...@@ -2,20 +2,36 @@
<html lang="zh"> <html lang="zh">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0,user-scalable=0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="广联帐户管理中心-员工管理" /> <meta name="description" content="广联帐户管理中心-员工管理" />
<meta name="author" content="GLSX Web Team" /> <meta name="author" content="GLSX Web Team" />
<meta name="keywords" itemprop="keywords" content="广联,帐户管理,员工管理" /> <meta name="keywords" itemprop="keywords" content="广联,帐户管理,员工管理" />
<link rel="stylesheet" type="text/css" href="../../css/main.css" /> <link rel="stylesheet" type="text/css" href="/css/main.css" />
<title>商户管理</title> <title>商户管理</title>
</head> </head>
<body> <body>
<div id="app"> <div id="app">
<main>p*100{$}</main> <main>
<div id="tree"></div>
</main>
</div> </div>
<script src="https://www.layuicdn.com/layui/layui.js"></script> <script src="https://www.layuicdn.com/layui/layui.js"></script>
<script src="../../../js/load.js"></script> <script src="/js/load.js"></script>
<script></script> <script>
layui.use('gtree', function () {
var tree = layui.gtree
var inst = tree.create('tree', [
{
name: 'test1',
open: true,
children: [
{ name: 'test1_1', children: [{ name: 'test1_1_1', children: [{ name: 'a' }, { name: 'b' }, { name: 'c' }] }, { name: 'test1_1_2' }] },
{ name: 'test1_2', children: [{ name: 'test1_2_1', children: [{ name: 'aa' }, { name: 'bb' }, { name: 'vv' }] }, { name: 'test1_2_2' }] }
]
}
])
})
</script>
</body> </body>
</html> </html>
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
<html lang="zh"> <html lang="zh">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0,user-scalable=0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="广联帐户管理中心-员工管理" /> <meta name="description" content="广联帐户管理中心-员工管理" />
<meta name="author" content="GLSX Web Team" /> <meta name="author" content="GLSX Web Team" />
<meta name="keywords" itemprop="keywords" content="广联,帐户管理,员工管理" /> <meta name="keywords" itemprop="keywords" content="广联,帐户管理,员工管理" />
<link rel="stylesheet" type="text/css" href="../../css/main.css" /> <link rel="stylesheet" type="text/css" href="/css/main.css" />
<title>角色管理</title> <title>角色管理</title>
</head> </head>
<body> <body>
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<main>角色管理-详情</main> <main>角色管理-详情</main>
</div> </div>
<script src="https://www.layuicdn.com/layui/layui.js"></script> <script src="https://www.layuicdn.com/layui/layui.js"></script>
<script src="../../../js/load.js"></script> <script src="/js/load.js"></script>
<script></script> <script></script>
</body> </body>
</html> </html>
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
<html lang="zh"> <html lang="zh">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0,user-scalable=0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="广联帐户管理中心-员工管理" /> <meta name="description" content="广联帐户管理中心-员工管理" />
<meta name="author" content="GLSX Web Team" /> <meta name="author" content="GLSX Web Team" />
<meta name="keywords" itemprop="keywords" content="广联,帐户管理,员工管理" /> <meta name="keywords" itemprop="keywords" content="广联,帐户管理,员工管理" />
<link rel="stylesheet" type="text/css" href="../../css/main.css" /> <link rel="stylesheet" type="text/css" href="/css/main.css" />
<title>角色管理</title> <title>角色管理</title>
</head> </head>
<body> <body>
...@@ -15,7 +15,11 @@ ...@@ -15,7 +15,11 @@
<main>角色管理</main> <main>角色管理</main>
</div> </div>
<script src="https://www.layuicdn.com/layui/layui.js"></script> <script src="https://www.layuicdn.com/layui/layui.js"></script>
<script src="../../../js/load.js"></script> <script src="/js/load.js"></script>
<script></script> <script>
layui.use('request', function () {
console.log(layui.request)
})
</script>
</body> </body>
</html> </html>
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-07-19 16:37:36
* @LastEditors: limin
* @LastEditTime: 2021-07-19 19:30:15
* @FilePath: \account\js\gtree.js
*/
layui.define(['ztree'], function (exports) {
// var tree = layui.tree
// var gtree = {
// inst: null,
// create: function (id, data) {
// this.inst = tree.render({
// elem: '#' + id, //绑定元素
// data: data,
// showLine: false,
// showCheckbox: true
// })
// return this.inst
// }
// }
var $ = layui.$
var tree = layui.ztree
function nodeClasses(treeId, treeNode) {}
var setting = {
view: {
selectedMulti: false
// nodeClasses: nodeClasses
},
check: {
enable: true,
chkboxType: { Y: 'ps', N: 's' }
}
}
var inst = null
var gtree = {
create: function (id, nodes) {
var $treeDom = $('#' + id)
$treeDom.addClass('ztree')
inst = tree.init($treeDom, setting, nodes)
return inst
}
}
exports('gtree', gtree)
})
...@@ -4,13 +4,12 @@ ...@@ -4,13 +4,12 @@
* @Author: limin * @Author: limin
* @Date: 2021-07-15 15:46:53 * @Date: 2021-07-15 15:46:53
* @LastEditors: limin * @LastEditors: limin
* @LastEditTime: 2021-07-16 21:07:00 * @LastEditTime: 2021-07-19 17:25:55
* @FilePath: \account\js\load.js * @FilePath: \account\js\load.js
*/ */
;(function load() { ;(function load() {
window.layui = layui loadLayConfig()
window.$ = layui.$ loadHeaderFooter()
self == top && append()
})() })()
/** /**
...@@ -21,12 +20,19 @@ function go(module, page, params) { ...@@ -21,12 +20,19 @@ function go(module, page, params) {
var href = '/html/' + module + '/' + page + '.html' var href = '/html/' + module + '/' + page + '.html'
window.location.href = href + '?' + _p window.location.href = href + '?' + _p
} }
function loadLayConfig() {
function append() { layui.config({
base: '/js/'
})
}
function loadHeaderFooter() {
self == top && append(layui.$)
}
function append($) {
var header = document.createElement('header') var header = document.createElement('header')
var footer = document.createElement('footer') var footer = document.createElement('footer')
$(header).load('../components/header.html') $(header).load('/html/components/header.html')
$(footer).load('../components/footer.html') $(footer).load('/html/components/footer.html')
$('main').before(header).after(footer) $('main').before(header).after(footer)
} }
......
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-07-19 10:15:48
* @LastEditors: limin
* @LastEditTime: 2021-07-19 11:10:06
* @FilePath: \account\js\request.js
*/
layui.define(function (exports) {
function request(opt) {
var defaultSettings = {
data: {},
type: 'get',
dataType: 'json',
headers: { Authorization: getStore('token') },
beforeSend: function () {
openLoad('loading.gif')
},
complete: function () {
closeLoad()
},
error: function (xhr) {
if (xhr.status == 401) {
showTips('您未登录')
} else if (xhr.status == 403) {
showTips('您没有权限')
} else if (xhr.status == 500) {
showTips('服务器发生错误,请稍后刷新页面')
} else {
showTips('未知错误')
}
}
}
for (var key in opt) {
defaultSettings[key] = opt[key]
if (key == 'url') defaultSettings[key] = '/api/' + opt[key] + '?format=json&time=' + new Date().getTime()
}
if (arguments[1]) {
//如果是图片上传,需要传递第二个参数,必须内容
defaultSettings.traditional = true
defaultSettings.processData = false
defaultSettings.contentType = false
}
return $.ajax(defaultSettings)
}
function getStore(name) {
if (!name) return
return window.localStorage.getItem(name)
}
exports('request', request)
})
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!