impl:完善项目

master
bobi 2020-07-25 13:45:41 +08:00
parent e0bd8b5ade
commit d15b9a1814
11 changed files with 611 additions and 798 deletions

View File

@ -1,447 +1,440 @@
[
{
"title": "控制台",
"href": "pages/console.html",
"fontFamily": "ok-icon",
"icon": "",
"spread": true,
"isCheck": true
},
{
"title": "控制台示例",
"href": "",
"fontFamily": "ok-icon",
"icon": "",
"children": [
{
"title": "控制台一",
{
"title": "控制台",
"href": "pages/console.html",
"fontFamily": "ok-icon",
"icon": "",
"spread": true,
"isCheck": true
},
{
"title": "仪表盘",
"href": "pages/console1.html",
"icon": ""
}
]
},
{
"title": "框架使用",
"fontFamily": "ok-icon",
"icon": "ok-icon-yooxi",
"spread": false,
"children": [
{
"title": "字体图标",
"href": "pages/help/ok_font.html",
"icon": "",
"spread": false
},
{
"title": "插件目录",
"href": "pages/help/plug_directory.html",
"icon": "",
"spread": false
},
{
"title": "内部添加导航",
"href": "pages/help/nav_operate.html",
"icon": "",
"spread": false
},
{
"title": "导航的图标",
"href": "pages/help/nav_icon.html",
"icon": "",
"spread": false
},
{
"title": "导航的参数",
"href": "pages/help/nav_parameter.html",
"icon": "",
"spread": false
},
{
"title": "okUtils",
"href": "pages/help/okUtils.html",
"icon": "",
"spread": false
},
{
"title": "okLayer",
"href": "pages/help/okLayer.html",
"icon": "",
"spread": false
},
{
"title": "okFly",
"href": "pages/help/okFly.html",
"icon": "",
"spread": false
}
]
},
{
"title": "会员管理",
"href": "",
"icon": "",
"spread": false,
"children": [
{
"title": "用户列表",
"href": "pages/member/user.html",
"fontFamily": "layui-icon",
"icon": "",
"spread": false
},
{
"title": "角色列表",
"href": "pages/member/role.html",
"icon": "",
"spread": false
},
{
"title": "权限列表",
"href": "pages/member/permission.html",
"icon": "",
"spread": false
}
]
},
{
"title": "图表管理",
"href": "",
"icon": "",
"spread": false,
"children": [
{
"title": "地图",
"fontFamily": "ok-icon",
"icon": "",
"spread": false,
"children": [
{
"title": "中国地图",
"href": "pages/chart/chart-china.html",
"icon": "",
"spread": false
},
{
"title": "区域地图",
"href": "pages/chart/chart-area.html",
"icon": "",
"spread": false
}
]
},
{
"title": "数据图",
"fontFamily": "ok-icon",
"icon": "ok-icon-shuju1",
"spread": false,
"children": [
{
"title": "统计图",
"href": "pages/chart/chart1.html",
"icon": "",
"spread": false
},
{
"title": "折线图",
"href": "pages/chart/chart2.html",
"icon": "",
"spread": false
},
{
"title": "馅饼图",
"href": "pages/chart/chart4.html",
"icon": "",
"spread": false
},
{
"title": "圆形图",
"href": "pages/chart/chart5.html",
"icon": "",
"spread": false
},
{
"title": "指数图",
"href": "pages/chart/chart6.html",
"icon": "",
"spread": false
}
]
}
]
},
{
"title": "常用页面",
"href": "",
"icon": "",
"spread": false,
"children": [
{
"title": "复杂表单一",
"href": "pages/often/form-complex1.html",
"icon": "",
"spread": false
},
{
"title": "复杂表单二",
"href": "pages/often/form-complex2.html",
"icon": "",
"spread": false
},
{
"title": "文章列表",
"href": "pages/often/article.html",
"icon": "",
"spread": false
},
{
"title": "留言列表",
"href": "pages/often/message.html",
"icon": "",
"spread": false
},
{
"title": "产品列表",
"href": "pages/often/product.html",
"icon": "",
"spread": false
},
{
"title": "下载列表",
"href": "pages/often/download.html",
"icon": "",
"spread": false
},
{
"title": "链接列表",
"href": "pages/often/link.html",
"icon": "",
"spread": false
},
{
"title": "任务列表",
"href": "pages/often/task.html",
"icon": "",
"spread": false
},
{
"title": "图片列表",
"href": "pages/often/image.html",
"icon": "",
"spread": false
},
{
"title": "帖子列表",
"href": "pages/often/bbs.html",
"icon": "",
"spread": false
}
]
},
{
"title": "系统管理",
"href": "",
"fontFamily": "ok-icon",
"icon": "",
"spread": false,
"children": [
{
"title": "系统设置",
"href": "pages/system/setup.html",
"icon": "",
"spread": false
},
{
"title": "日志列表",
"href": "pages/system/log.html",
"icon": "",
"spread": false
},
{
"title": "屏蔽词",
"href": "pages/system/shield.html",
"icon": "",
"spread": false
},
{
"title": "登录页面",
"href": "pages/login.html",
"icon": "",
"spread": false,
"target": "_blank"
},
{
"title": "403页面",
"href": "pages/system/403.html",
"icon": "",
"spread": false
},
{
"title": "404页面",
"href": "pages/system/404.html",
"icon": "",
"spread": false
},
{
"title": "500页面",
"href": "pages/system/500.html",
"icon": "",
"spread": false
}
]
},
{
"title": "文本编辑",
"href": "",
"icon": "",
"spread": false,
"children": [
{
"title": "wangEditor",
"href": "pages/txtedit/wangEditor.html",
"icon": "",
"spread": false
},
{
"title": "CKEditor",
"href": "pages/txtedit/CKEditor.html",
"icon": "",
"spread": false
},
{
"title": "layedit",
"href": "pages/txtedit/layedit.html",
"icon": "",
"spread": false
}
]
},
{
"title": "数据表格",
"href": "",
"icon": "",
"spread": false,
"children": [
{
"title": "Datatables",
"href": "pages/datatable/datatables.html",
"icon": "",
"spread": false
},
{
"title": "bsgrid",
"href": "pages/datatable/bsgrid.html",
"icon": "",
"spread": false
}
]
},
{
"title": "多级导航",
"fontFamily": "ok-icon",
"icon": "",
"spread": false,
"children": [
{
"title": "购物网站",
"icon": "",
"spread": true,
"isCheck": true
},
{
"title": "会员管理",
"href": "",
"icon": "",
"icon": "",
"spread": false,
"children": [
{
"title": "京东",
"href": "https://www.jd.com",
"icon": "",
"spread": false
},
{
"title": "苏宁",
"href": "https://www.suning.com",
"icon": "",
"spread": false
},
{
"title": "阿里",
"href": "",
"icon": "",
"spread": false,
"children": [
{
"title": "淘宝",
"href": "https://www.taobao.com",
"icon": "",
{
"title": "用户列表",
"href": "pages/member/user-list.html",
"fontFamily": "layui-icon",
"icon": "",
"spread": false
},
{
"title": "天猫",
"href": "https://www.tmall.com",
},
{
"title": "角色列表",
"href": "pages/member/role-list.html",
"icon": "",
"spread": false
},
{
"title": "权限列表",
"href": "pages/member/permission-list.html",
"icon": "",
"spread": false
}
]
},
{
"title": "系统管理",
"href": "",
"fontFamily": "ok-icon",
"icon": "",
"spread": false,
"children": [
{
"title": "系统设置",
"href": "pages/system/setup.html",
"icon": "",
"spread": false
},
{
"title": "日志列表",
"href": "pages/system/log.html",
"icon": "",
"spread": false
},
{
"title": "屏蔽词",
"href": "pages/system/shield.html",
"icon": "",
"spread": false
},
{
"title": "登录页面",
"href": "pages/login.html",
"icon": "",
"spread": false,
"target": "_blank"
},
{
"title": "403页面",
"href": "pages/system/403.html",
"icon": "",
"spread": false
},
{
"title": "404页面",
"href": "pages/system/404.html",
"icon": "",
"spread": false
},
{
"title": "500页面",
"href": "pages/system/500.html",
"icon": "",
"spread": false
}
]
},
{
"title": "常用页面",
"href": "",
"icon": "",
"spread": false,
"children": [
{
"title": "复杂表单一",
"href": "pages/often/form-complex1.html",
"icon": "",
"spread": false
},
{
"title": "复杂表单二",
"href": "pages/often/form-complex2.html",
"icon": "",
"spread": false
},
{
"title": "文章列表",
"href": "pages/often/article.html",
"icon": "",
"spread": false
},
{
"title": "留言列表",
"href": "pages/often/message.html",
"icon": "",
"spread": false
},
{
"title": "产品列表",
"href": "pages/often/product.html",
"icon": "",
"spread": false
},
{
"title": "下载列表",
"href": "pages/often/download.html",
"icon": "",
"spread": false
},
{
"title": "链接列表",
"href": "pages/often/link.html",
"icon": "",
"spread": false
},
{
"title": "任务列表",
"href": "pages/often/task.html",
"icon": "",
"spread": false
},
{
"title": "图片列表",
"href": "pages/often/image.html",
"icon": "",
"spread": false
},
{
"title": "帖子列表",
"href": "pages/often/bbs.html",
"icon": "",
"spread": false
}
]
},
{
"title": "图表管理",
"href": "",
"icon": "",
"spread": false,
"children": [
{
"title": "地图",
"fontFamily": "ok-icon",
"icon": "",
"spread": false,
"children": [
{
"title": "中国地图",
"href": "pages/chart/chart-china.html",
"icon": "",
"spread": false
},
{
"title": "区域地图",
"href": "pages/chart/chart-area.html",
"icon": "",
"spread": false
}
]
},
{
"title": "数据图",
"fontFamily": "ok-icon",
"icon": "ok-icon-shuju1",
"spread": false,
"children": [
{
"title": "统计图",
"href": "pages/chart/chart1.html",
"icon": "",
"spread": false
},
{
"title": "折线图",
"href": "pages/chart/chart2.html",
"icon": "",
"spread": false
},
{
"title": "馅饼图",
"href": "pages/chart/chart4.html",
"icon": "",
"spread": false
},
{
"title": "圆形图",
"href": "pages/chart/chart5.html",
"icon": "",
"spread": false
},
{
"title": "指数图",
"href": "pages/chart/chart6.html",
"icon": "",
"spread": false
}
]
}
]
},
{
"title": "文本编辑",
"href": "",
"icon": "",
"spread": false,
"children": [
{
"title": "wangEditor",
"href": "pages/txtedit/wangEditor.html",
"icon": "",
"spread": false
},
{
"title": "CKEditor",
"href": "pages/txtedit/CKEditor.html",
"icon": "",
"spread": false
},
{
"title": "layedit",
"href": "pages/txtedit/layedit.html",
"icon": "",
"spread": false
}
]
},
{
"title": "数据表格",
"href": "",
"icon": "",
"spread": false,
"children": [
{
"title": "Datatables",
"href": "pages/datatable/datatables.html",
"icon": "",
"spread": false
},
{
"title": "bsgrid",
"href": "pages/datatable/bsgrid.html",
"icon": "",
"spread": false
}
]
},
{
"title": "多级导航",
"fontFamily": "ok-icon",
"icon": "",
"spread": false,
"children": [
{
"title": "购物网站",
"href": "",
"icon": "",
"spread": false,
"children": [
{
"title": "天猫超市",
"href": "https://chaoshi.tmall.com",
"icon": "",
"spread": false
},
{
"title": "天猫电器",
"href": "https://3c.tmall.com",
"icon": "",
"spread": false
}
{
"title": "京东",
"href": "https://www.jd.com",
"icon": "",
"spread": false
},
{
"title": "苏宁",
"href": "https://www.suning.com",
"icon": "",
"spread": false
},
{
"title": "阿里",
"href": "",
"icon": "",
"spread": false,
"children": [
{
"title": "淘宝",
"href": "https://www.taobao.com",
"icon": "",
"spread": false
},
{
"title": "天猫",
"href": "https://www.tmall.com",
"icon": "",
"spread": false,
"children": [
{
"title": "天猫超市",
"href": "https://chaoshi.tmall.com",
"icon": "",
"spread": false
},
{
"title": "天猫电器",
"href": "https://3c.tmall.com",
"icon": "",
"spread": false
}
]
}
]
}
]
}
]
}
}
]
}
]
},
{
"title": "第三方库",
"icon": "",
"children": [
{
"title": "jquery.okQrcode.js",
"href": "pages/tripartite/qrcode.html"
},
{
"title": "jquery.okCountup.js",
"href": "pages/tripartite/countup.html"
},
{
"title": "okCookie",
"href": "pages/tripartite/okCookie.html"
},
{
"title": "okToastr",
"href": "pages/tripartite/okToastr.html"
},
{
"title": "okMd5",
"href": "pages/tripartite/okMd5.html"
},
{
"title": "okBarcode",
"href": "pages/tripartite/okBarcode.html"
},
{
"title": "okNprogress",
"href": "pages/tripartite/okNprogress.html"
},
{
"title": "okSweetAlert2",
"href": "pages/tripartite/okSweetAlert2.html"
},
{
"title": "okAnimate",
"href": "pages/tripartite/okAnimate.html"
},
{
"title": "okLayx",
"href": "pages/tripartite/okLayx.html"
}
]
}
},
{
"title": "第三方库",
"icon": "",
"children": [
{
"title": "jquery.okQrcode.js",
"href": "pages/tripartite/qrcode.html"
},
{
"title": "jquery.okCountup.js",
"href": "pages/tripartite/countup.html"
},
{
"title": "okCookie",
"href": "pages/tripartite/okCookie.html"
},
{
"title": "okToastr",
"href": "pages/tripartite/okToastr.html"
},
{
"title": "okMd5",
"href": "pages/tripartite/okMd5.html"
},
{
"title": "okBarcode",
"href": "pages/tripartite/okBarcode.html"
},
{
"title": "okNprogress",
"href": "pages/tripartite/okNprogress.html"
},
{
"title": "okSweetAlert2",
"href": "pages/tripartite/okSweetAlert2.html"
},
{
"title": "okAnimate",
"href": "pages/tripartite/okAnimate.html"
},
{
"title": "okLayx",
"href": "pages/tripartite/okLayx.html"
}
]
},
{
"title": "框架使用",
"fontFamily": "ok-icon",
"icon": "ok-icon-yooxi",
"spread": false,
"children": [
{
"title": "字体图标",
"href": "pages/help/ok_font.html",
"icon": "",
"spread": false
},
{
"title": "插件目录",
"href": "pages/help/plug_directory.html",
"icon": "",
"spread": false
},
{
"title": "内部添加导航",
"href": "pages/help/nav_operate.html",
"icon": "",
"spread": false
},
{
"title": "导航的图标",
"href": "pages/help/nav_icon.html",
"icon": "",
"spread": false
},
{
"title": "导航的参数",
"href": "pages/help/nav_parameter.html",
"icon": "",
"spread": false
},
{
"title": "okUtils",
"href": "pages/help/okUtils.html",
"icon": "",
"spread": false
},
{
"title": "okLayer",
"href": "pages/help/okLayer.html",
"icon": "",
"spread": false
},
{
"title": "okFly",
"href": "pages/help/okFly.html",
"icon": "",
"spread": false
}
]
}
]

View File

@ -1,219 +0,0 @@
function randomData() {
return Math.round(Math.random() * 500);
}
function ecchartData(color) {
color = color || "#00c292";
return {
color: color,
toolbox: {
show: false,
feature: {
saveAsImage: {}
}
},
grid: {
left: '-1%',
right: '0',
bottom: '0',
top: '5px',
containLabel: false
},
xAxis: [
{
type: 'category',
boundaryGap: false,
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
splitLine: {
show: false
},
}
],
yAxis: [
{
type: 'value',
splitLine: {
show: false
},
}
],
series: [
{
name: '用户',
type: 'line',
stack: '总量',
smooth: true,
symbol: "none",
clickable: false,
areaStyle: {},
data: [randomData(), randomData(), randomData(), randomData(), randomData(), randomData(), randomData()]
}
]
}
}
var echOne = {
color: "#03a9f3",
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
series: [{
data: [120, 200, 150, 80, 70, 110, 130],
type: 'bar'
}]
};
var echTwo = {
title: {
show: false,
text: '用户访问来源',
subtext: '纯属虚构',
x: 'center'
},
tooltip: {
trigger: 'item',
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
legend: {
orient: 'vertical',
left: 'left',
data: ['直接访问', '邮件营销', '联盟广告', '视频广告', '搜索引擎']
},
series: [
{
name: '访问来源',
type: 'pie',
radius: '55%',
center: ['50%', '60%'],
data: [
{value: 335, name: '直接访问'},
{value: 310, name: '邮件营销'},
{value: 234, name: '联盟广告'},
{value: 135, name: '视频广告'},
{value: 1548, name: '搜索引擎'}
],
itemStyle: {
emphasis: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
};
var mapThree = {
title: {
show: false,
text: '堆叠区域图xxxx'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#6a7985'
}
}
},
legend: {
data: ['邮件营销', '联盟广告', '视频广告', '直接访问', '搜索引擎']
},
toolbox: {
show: false,
feature: {
saveAsImage: {}
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: [
{
type: 'category',
boundaryGap: false,
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
}
],
yAxis: [
{
type: 'value',
splitLine: {//设置横线样式
show: false//隐藏横线
},
}
],
series: [
{
name: '邮件营销',
type: 'line',
stack: '总量',
smooth: true,//曲线线条
areaStyle: {},
data: [120, 132, 101, 134, 90, 230, 210]
},
{
name: '联盟广告',
type: 'line',
stack: '总量',
smooth: true,//曲线线条
areaStyle: {},
data: [220, 182, 191, 234, 290, 330, 310]
},
{
name: '视频广告',
type: 'line',
stack: '总量',
smooth: true,//曲线线条
areaStyle: {},
data: [150, 232, 201, 154, 190, 330, 410]
},
{
name: '直接访问',
type: 'line',
stack: '总量',
smooth: true,//曲线线条
areaStyle: {normal: {}},
data: [320, 332, 301, 334, 390, 330, 320]
},
{
name: '搜索引擎',
type: 'line',
stack: '总量',
smooth: true,//曲线线条
label: {
normal: {
show: true,
position: 'top'
}
},
areaStyle: {normal: {}},
data: [370, 932, 901, 934, 1290, 1330, 1320]
}
]
};
layui.define(function (exports) {
var income = ecchartData("#00c292");
var goods = ecchartData("#ab8ce4");
var blogs = ecchartData("#03a9f3");
var user = ecchartData("#fb9678");
exports('home2Data', {
income: income,
goods: goods,
blogs: blogs,
user: user,
echOne: echOne,
echTwo: echTwo,
mapThree: mapThree,
});
});

View File

@ -38,7 +38,9 @@
let tree = layui.tree;
let okUtils = layui.okUtils;
let okMock = layui.okMock;
okLoading.close();
laydate.render({elem: '#startTime', type: "datetime"});
laydate.render({elem: '#endTime', type: "datetime"});

View File

@ -1,47 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>角色授权</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="../../lib/layui/css/layui.css">
<link rel="stylesheet" href="../../css/oksub.css">
<script type="text/javascript" src="../../lib/loading/okLoading.js"></script>
</head>
<body>
<div class="ok-body">
<!--form表单-->
<form class="layui-form layui-form-pane ok-form">
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit lay-filter="auth">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
</div>
<!--js逻辑-->
<script src="../../lib/layui/layui.js"></script>
<script>
layui.config({
base: 'lib/layui/lay/modules/authtree/'
}).extend({
authtree: 'authtree',
});
layui.use(['element', 'jquery', 'form'], function () {
var element = layui.element;
var $ = layui.jquery;
var form = layui.form;
okLoading.close();
form.on('submit(auth)', function (data) {
console.log(data.field);
layer.msg("授权成功!", {icon: 6, time: 1000, anim: 4}, function () {
parent.layer.close(parent.layer.getFrameIndex(window.name));
});
return false;
});
})
</script>
</body>
</html>

View File

@ -1,67 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>编辑角色</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="../../css/oksub.css">
<script type="text/javascript" src="../../lib/loading/okLoading.js"></script>
</head>
<body>
<div class="ok-body">
<!--form表单-->
<form class="layui-form ok-form">
<div class="layui-form-item">
<label class="layui-form-label">角色名</label>
<div class="layui-input-block">
<input type="text" name="name" placeholder="请输入角色名" autocomplete="off" class="layui-input"
lay-verify="required">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">备注</label>
<div class="layui-input-block">
<input type="text" name="remarks" placeholder="请输入备注" autocomplete="off" class="layui-input"
lay-verify="required">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">权限</label>
<div class="layui-input-block">
<!-- TODO -->
<div id="authTree"></div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit lay-filter="edit">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
</div>
<!--js逻辑-->
<script src="../../lib/layui/layui.js"></script>
<script>
layui.config({
base: ''
}).extend({
authtree: 'authtree',
});
layui.use(['element', 'form', 'jquery'], function () {
var element = layui.element;
var form = layui.form;
var $ = layui.jquery;
okLoading.close();
form.on('submit(edit)', function (data) {
console.log(data.field);
layer.msg("编辑成功!", {icon: 6, time: 1000, anim: 4}, function () {
parent.layer.close(parent.layer.getFrameIndex(window.name));
});
return false;
});
})
</script>
</body>
</html>

View File

@ -12,21 +12,19 @@
<!--form表单-->
<form class="layui-form layui-form-pane ok-form">
<div class="layui-form-item">
<label class="layui-form-label">角色名</label>
<label class="layui-form-label">角色名</label>
<div class="layui-input-block">
<input type="text" name="name" placeholder="请输入角色名" autocomplete="off" class="layui-input"
lay-verify="required">
<input type="text" name="name" placeholder="角色名称" autocomplete="off" class="layui-input" lay-verify="required">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">备注</label>
<label class="layui-form-label">角色备注</label>
<div class="layui-input-block">
<input type="text" name="remarks" placeholder="请输入备注" autocomplete="off" class="layui-input"
lay-verify="required">
<input type="text" name="remarks" placeholder="角色备注" autocomplete="off" class="layui-input" lay-verify="required">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">权限</label>
<label class="layui-form-label">角色权限</label>
<div class="layui-input-block">
<div id="permissionTree"></div>
</div>
@ -42,12 +40,14 @@
<!--js逻辑-->
<script src="../../lib/layui/layui.js"></script>
<script type="text/javascript">
layui.use(["element", "form", "tree", "okLayer", "okUtils"], function () {
layui.use(["form", "tree", "okLayer", "okUtils"], function () {
let form = layui.form;
let tree = layui.tree;
let okLayer = layui.okLayer;
let okUtils = layui.okUtils;
okLoading.close();
let data = [{
"title": "根目录",
"spread": true,
@ -72,7 +72,7 @@
tree.render({
elem: "#permissionTree",
// data: okUtils.mockApi.permission.list,
// data: okMock.permission.list,
data: data,
showCheckbox: true
});

View File

@ -14,7 +14,7 @@
<form class="layui-form layui-col-md12 ok-search">
<input class="layui-input" placeholder="开始日期" autocomplete="off" id="startTime" name="startTime">
<input class="layui-input" placeholder="截止日期" autocomplete="off" id="endTime" name="endTime">
<input class="layui-input" placeholder="请输入角色名" autocomplete="off" name="name">
<input class="layui-input" placeholder="角色名" autocomplete="off" name="name">
<button class="layui-btn" lay-submit="" lay-filter="search">
<i class="layui-icon layui-icon-search"></i>
</button>
@ -33,7 +33,9 @@
let okLayer = layui.okLayer;
let okUtils = layui.okUtils;
let okMock = layui.okMock;
okLoading.close();
laydate.render({elem: "#startTime", type: "datetime"});
laydate.render({elem: "#endTime", type: "datetime"});
@ -46,11 +48,11 @@
size: "sm",
cols: [[
{type: "checkbox"},
{field: "id", title: "ID", width: 170, sort: true},
{field: "name", title: "角色名", width: 100},
{field: "remarks", title: "备注", width: 100},
{field: "createUsername", title: "创建者", width: 85},
{field: "status", title: "状态", width: 85, templet: "#statusTpl"},
{field: "id", title: "ID", sort: true, width: 200},
{field: "name", title: "角色名"},
{field: "remarks", title: "备注"},
{field: "createUsername", title: "创建者"},
{field: "status", title: "状态", templet: "#statusTpl"},
{field: "createTime", title: "创建时间", width: 150},
{title: "操作", width: 80, align: "center", templet: "#operationTpl"}
]],
@ -64,7 +66,6 @@
where: data.field,
page: {curr: 1}
});
console.log("0000")
return false;
});
@ -92,7 +93,7 @@
});
function add() {
okLayer.open("添加角色", "role-add.html", "90%", "90%", null, function () {
okLayer.open("添加角色", "role-insert.html", "90%", "90%", null, function () {
roleTable.reload();
})
}
@ -112,7 +113,7 @@
}
function edit(id) {
okLayer.open("编辑角色", "role-edit.html?id=" + id, "90%", "90%", null, function () {
okLayer.open("编辑角色", "role-update.html?id=" + id, "90%", "90%", null, function () {
roleTable.reload();
})
}

View File

@ -0,0 +1,88 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>编辑角色</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="../../css/oksub.css">
<script type="text/javascript" src="../../lib/loading/okLoading.js"></script>
</head>
<body>
<div class="ok-body">
<!--form表单-->
<form class="layui-form ok-form">
<div class="layui-form-item">
<label class="layui-form-label">角色名称</label>
<div class="layui-input-block">
<input type="text" name="name" placeholder="角色名称" autocomplete="off" class="layui-input" lay-verify="required">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">角色备注</label>
<div class="layui-input-block">
<input type="text" name="remarks" placeholder="角色备注" autocomplete="off" class="layui-input" lay-verify="required">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">角色权限</label>
<div class="layui-input-block">
<div id="permissionTree"></div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit lay-filter="edit">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
</div>
<!--js逻辑-->
<script src="../../lib/layui/layui.js"></script>
<script>
layui.use(['form', "tree"], function () {
let form = layui.form;
let tree = layui.tree;
okLoading.close();
let data = [{
"title": "根目录",
"spread": true,
"children": [{
"title": "会员管理",
"spread": true,
"children": [{
"title": "用户管理",
"spread": true,
"children": [{"title": "添加用户"}, {"title": "编辑用户"}, {"title": "删除用户"}]
}, {
"title": "角色管理",
"spread": true,
"children": [{"title": "添加角色"}, {"title": "编辑角色"}, {"title": "删除角色"}]
}, {
"title": "权限管理",
"spread": true,
"children": [{"title": "添加权限"}, {"title": "编辑权限"}, {"title": "删除权限"}]
}]
}]
}];
tree.render({
elem: "#permissionTree",
// data: okMock.permission.list,
data: data,
showCheckbox: true
});
form.on('submit(edit)', function (data) {
console.log(data.field);
layer.msg("编辑成功!", {icon: 6, time: 1000, anim: 4}, function () {
parent.layer.close(parent.layer.getFrameIndex(window.name));
});
return false;
});
})
</script>
</body>
</html>

View File

@ -104,7 +104,9 @@
let laydate = layui.laydate;
let okLayer = layui.okLayer;
let okUtils = layui.okUtils;
okLoading.close();
laydate.render({elem: "#birthday", type: "datetime"});
form.verify({

View File

@ -11,13 +11,72 @@
<div class="ok-body">
<!--模糊搜索区域-->
<div class="layui-row">
<form class="layui-form layui-col-md12 ok-search">
<input class="layui-input" placeholder="开始日期" autocomplete="off" id="startTime" name="startTime">
<input class="layui-input" placeholder="截止日期" autocomplete="off" id="endTime" name="endTime">
<input class="layui-input" placeholder="账号" autocomplete="off" name="username">
<button class="layui-btn" lay-submit="" lay-filter="search">
<i class="layui-icon">&#xe615;</i>
</button>
<form class="layui-form ok-search-form">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">开始日期</label>
<div class="layui-input-inline">
<input type="text" class="layui-input" placeholder="开始日期" autocomplete="off" id="startTime" name="startTime">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">截止日期</label>
<div class="layui-input-inline">
<input type="text" class="layui-input" placeholder="截止日期" autocomplete="off" id="endTime" name="endTime">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">账号</label>
<div class="layui-input-inline">
<input type="text" class="layui-input" placeholder="账号" autocomplete="off" name="username">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">姓名</label>
<div class="layui-input-inline">
<input type="text" class="layui-input" placeholder="姓名" autocomplete="off" name="name">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">昵称</label>
<div class="layui-input-inline">
<input type="text" class="layui-input" placeholder="昵称" autocomplete="off" name="nickname">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">邮箱</label>
<div class="layui-input-inline">
<input type="text" class="layui-input" placeholder="邮箱" autocomplete="off" name="email">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">请选择角色</label>
<div class="layui-input-inline">
<select name="role" lay-verify="" lay-search>
<option value="" selected>请选择角色</option>
<option value="0">超级会员</option>
<option value="1">普通用户</option>
</select>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">请选择状态</label>
<div class="layui-input-inline">
<select name="status" lay-verify="" lay-search>
<option value="" selected>请选择状态</option>
<option value="0">启用</option>
<option value="1">停用</option>
</select>
</div>
</div>
<div class="layui-inline">
<div class="layui-input-inline">
<button class="layui-btn" lay-submit="" lay-filter="search">
<i class="layui-icon">&#xe615;</i>
</button>
</div>
</div>
</div>
</form>
</div>
<!--数据表格-->
@ -35,9 +94,10 @@
let okMock = layui.okMock;
let $ = layui.jquery;
okLoading.close($);
laydate.render({elem: "#startTime", type: "datetime"});
laydate.render({elem: "#endTime", type: "datetime"});
okLoading.close($);
let userTable = table.render({
elem: '#tableId',
url: okMock.api.listUser,
@ -152,13 +212,13 @@
}
function add() {
okLayer.open("添加用户", "user-add.html", "90%", "90%", null, function () {
okLayer.open("添加用户", "user-insert.html", "90%", "90%", null, function () {
userTable.reload();
})
}
function edit(data) {
okLayer.open("更新用户", "user-edit.html", "90%", "90%", function (layero) {
okLayer.open("更新用户", "user-update.html", "90%", "90%", function (layero) {
let iframeWin = window[layero.find("iframe")[0]["name"]];
iframeWin.initForm(data);
}, function () {
@ -195,9 +255,9 @@
<!-- 启用|停用模板 -->
<script type="text/html" id="statusTpl">
{{# if(d.status == 0){ }}
<span class="layui-btn layui-btn-normal layui-btn-xs">启用</span>
<span class="layui-btn layui-btn-normal layui-btn-xs">启用</span>
{{# } else if(d.status == 1) { }}
<span class="layui-btn layui-btn-warm layui-btn-xs">停用</span>
<span class="layui-btn layui-btn-warm layui-btn-xs">停用</span>
{{# } }}
</script>
<script type="text/html" id="roleTpl">