创建角色js
This commit is contained in:
1 parent
9b3511851c
commit
bd00d57337
13 files changed
+508
-830
No files matched your search
@@ -1,68 +0,0 @@
|
||||
{extend name="common@create" /}
|
||||
{block name="formaa"}
|
||||
|
||||
<form action="/category/{$list.id}" method="PUT" class="form form-horizontal" id="form-member-add">
|
||||
<div class="row cl">
|
||||
<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>权限名称:</label>
|
||||
<div class="formControls col-xs-8 col-sm-9">
|
||||
<input type="text" class="input-text" value="{$list.title}" placeholder="显示的名称" id="title" name="title">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row cl">
|
||||
<label class="form-label col-xs-4 col-sm-3">所属权限:</label>
|
||||
<div class="formControls col-xs-8 col-sm-9 f-l">
|
||||
<span class="select-box f-l" style="width:180px;">
|
||||
{php} $ctp = getCategory();{/php}
|
||||
<select class="select" id="pidt" name="pid" size="1" required>
|
||||
<option value="">--请选择父级权限--</option>
|
||||
{volist name="$ctp" id="vo"}
|
||||
<option value="{$vo.id}" {eq name="$list.pid" value="$vo.id" }selected{/eq}>{$vo.title}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row cl">
|
||||
<label class="form-label col-xs-4 col-sm-3">排序:</label>
|
||||
<div class="formControls col-xs-8 col-sm-9">
|
||||
<input type="text" class="input-text" value="{$list.paixu}" placeholder="默认为999" id="paixu" name="paixu">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row cl">
|
||||
<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
|
||||
<input class="btn btn-primary radius" type="submit" value=" 提交 ">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{/block}
|
||||
{block name="yanzheng"}
|
||||
<script type="text/javascript">
|
||||
// 匹配用户名
|
||||
$.validator.addMethod("zh",function(value,element){
|
||||
var tel = /^[\u4e00-\u9fa5]*$/;
|
||||
return this.optional(element) || tel.test(value);
|
||||
}, "请输入中文");
|
||||
|
||||
// 匹配帐号
|
||||
$.validator.addMethod("ustr",function(value,element){
|
||||
var tel = /^[a-zA-Z\/]*$/;
|
||||
return this.optional(element) || tel.test(value);
|
||||
}, "由字母和 / 组成");
|
||||
|
||||
// 设置表单验证规则
|
||||
var myrules = {
|
||||
title:{
|
||||
required:true,
|
||||
zh:true,
|
||||
rangelength:[2,50]
|
||||
},
|
||||
paixu:{
|
||||
digits:true,
|
||||
max:999
|
||||
},
|
||||
};
|
||||
|
||||
// 设置表单提交方式
|
||||
var mytype = 'PUT';
|
||||
</script>
|
||||
{/block}
|
||||
@@ -56,23 +56,6 @@
|
||||
<a class="layui-btn-xs" lay-event="edit" title="编辑"><i class="layui-icon"></i></a>
|
||||
<a class="layui-btn-xs" lay-event="del" title="删除"><i class="layui-icon"></i></a>
|
||||
</script>
|
||||
<!-- 使用搜索中日期 -->
|
||||
<script>
|
||||
layui.use('laydate', function(){
|
||||
var laydate = layui.laydate;
|
||||
|
||||
//执行一个laydate实例
|
||||
laydate.render({
|
||||
elem: '#start' //指定元素
|
||||
});
|
||||
|
||||
//执行一个laydate实例
|
||||
laydate.render({
|
||||
elem: '#end' //指定元素
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
<!-- 表格操作 -->
|
||||
<script>
|
||||
layui.use(['table','laypage','form','cjgl'], function(){
|
||||
@@ -177,15 +160,5 @@ layui.use(['table','laypage','form','cjgl'], function(){
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
{/block}
|
||||
@@ -1,122 +0,0 @@
|
||||
{extend name="common@list" /}
|
||||
{block name="topnav"}
|
||||
<nav class="breadcrumb">
|
||||
<i class="Hui-iconfont"></i> 首页
|
||||
<span class="c-gray en">></span> 系统管理
|
||||
<span class="c-gray en">></span> 类别列表
|
||||
<a class="btn btn-success radius r"
|
||||
style="line-height:1.6em;margin-top:3px"
|
||||
href="javascript:location.replace(location.href);"
|
||||
title="刷新" >
|
||||
<i class="Hui-iconfont"></i>
|
||||
</a>
|
||||
</nav>
|
||||
{/block}
|
||||
{block name="bouttons"}
|
||||
<div class="cl pd-5 bg-1 bk-gray mt-20">
|
||||
<span class="l">
|
||||
<!-- 删除按钮 -->
|
||||
<a href="javascript:;" onclick="dels('/category/m')" class="btn btn-danger radius">
|
||||
<i class="Hui-iconfont"></i>
|
||||
批量删除
|
||||
</a>
|
||||
<!-- 添加按钮 -->
|
||||
<a href="javascript:;" onclick=add('添加类别',"/category/create",600,300) class="btn btn-primary radius">
|
||||
<i class="Hui-iconfont"></i>
|
||||
添加类别
|
||||
</a>
|
||||
</span>
|
||||
<span class="r">
|
||||
共有数据:<strong>{$list.count}</strong> 条
|
||||
</span>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="tables"}
|
||||
<table id="table1" class="display" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" name="" value=""></th>
|
||||
<th>名称</th>
|
||||
<th>父级类别</th>
|
||||
<th>排序</th>
|
||||
<th>状态</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
{/block}
|
||||
{block name="myjs"}
|
||||
<script type="text/javascript">
|
||||
|
||||
// 定义DTajax参数
|
||||
var myajax = {
|
||||
url: "{:url('ajaxdata')}",
|
||||
type: "get",
|
||||
data: {},
|
||||
};
|
||||
|
||||
// 定义列参数
|
||||
var mycolumns = [
|
||||
{ "data": "id" ,"name":"id","defaultContent": "" },
|
||||
{ "data": "title" ,"name":"title","defaultContent": "" },
|
||||
{ "data": "gl_pid.title" ,"name":"pid","defaultContent": "" },
|
||||
{ "data": "paixu" },
|
||||
{ "data": "status" },
|
||||
{ "data": "id" },
|
||||
];
|
||||
|
||||
// 定义修改列参数
|
||||
var mycolumnDefs =[
|
||||
// 对象格式
|
||||
{
|
||||
"targets": 0,
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<input type="checkbox" name="test" value="' + row.id + '" />'
|
||||
}
|
||||
},
|
||||
{
|
||||
"targets": -1,
|
||||
"className":'.td-manage',
|
||||
"render": function(data, type, row, meta) {
|
||||
// 停用按钮
|
||||
stopbut = '<a style="text-decoration:none" onClick="stop(this,'+ row.id +')" href="javascript:;" title="停用"><i class="Hui-iconfont"></i></a>';
|
||||
// 启用按钮
|
||||
startbut = '<a style="text-decoration:none" onClick="start(this,'+ row.id +')" href="javascript:;" title="启用"><i class="Hui-iconfont"></i></a>';
|
||||
// 编辑按钮
|
||||
editbut = '<a title="编辑" href="javascript:void(0);" onclick=add("编辑","/category/'+row.id+'/edit","500","300") class="ml-5" style="text-decoration:none"><i class="Hui-iconfont"></i></a>';
|
||||
delbut = '<a title="删除" href="javascript:void(0);" onclick=del(this,"/category/'+row.id+'") class="ml-5" style="text-decoration:none"><i class="Hui-iconfont"></i></a>';
|
||||
if(row.status == '已停用')
|
||||
{
|
||||
buts = startbut + editbut + delbut;
|
||||
}else{
|
||||
buts = stopbut + editbut + delbut;
|
||||
}
|
||||
|
||||
return buts;
|
||||
}
|
||||
},
|
||||
{
|
||||
"targets": -2,
|
||||
"className":'.td-status',
|
||||
"render": function(data, type, row, meta) {
|
||||
if(row.status == '已停用')
|
||||
{
|
||||
d = "<span class='label label-error radius'>" + row.status + "</span>";
|
||||
}else{
|
||||
d = "<span class='label label-success radius'>" + row.status + "</span>";
|
||||
}
|
||||
|
||||
return d;
|
||||
},
|
||||
},
|
||||
{
|
||||
"orderable": false,
|
||||
"targets": [0,-1]
|
||||
},
|
||||
];
|
||||
</script>
|
||||
{/block}
|
||||
Loaded 3 of 13 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user