You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
86
hyhproject/home/view/default/shops/shoproles/edit.html
Executable file
86
hyhproject/home/view/default/shops/shoproles/edit.html
Executable file
@ -0,0 +1,86 @@
|
||||
{extend name="default/shops/base" /}
|
||||
{block name="title"}角色管理-卖家中心{__block__}{/block}
|
||||
{block name="css"}
|
||||
<link href="__STATIC__/plugins/validator/jquery.validator.css?v={$v}" rel="stylesheet">
|
||||
{/block}
|
||||
{block name="content"}
|
||||
|
||||
<div class="wst-body">
|
||||
<div class="wst-shop-head"><span>角色管理</span></div>
|
||||
<div class="wst-clear"></div>
|
||||
<div class="wst-shop-content">
|
||||
{php}$homeMenus = WSTHomeMenus(1);{/php}
|
||||
<form name="shoprole" id="shoprole" autocomplete="off">
|
||||
<table class="wst-form">
|
||||
<tr>
|
||||
<th width='120' align='right'>角色名称<font color='red'>*</font>:</th>
|
||||
<td>
|
||||
<input type='hidden' id='id' name='id' class="ipt" value='{$object.id}' />
|
||||
<input type='text' id='roleName' name='roleName' class="ipt" value='{$object.roleName}' data-rule='请输入角色名称:required;' style='width:350px;' maxLength='25' />
|
||||
<span>设定角色名称,方便区分权限类型。</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th width='120'>操作权限:</th>
|
||||
<td>
|
||||
<div >
|
||||
{volist name="$homeMenus['menus']" key="k1" id="menus1"}
|
||||
<dl {$k1==count($homeMenus['menus'])?"style='border-bottom:0'":""}>
|
||||
<dt class="dt1">
|
||||
<label><input type="checkbox" id="{$menus1['menuId']}" class="role_{$menus1['menuId']}" value="{$menus1['menuId']}" onclick="javascript:WST.checkChks(this,'.role_{$menus1['menuId']}')"/> {$menus1["menuName"]}</label>
|
||||
</dt>
|
||||
<dd class="dd1">
|
||||
{volist name="$menus1['list']" key="k2" id="menus2"}
|
||||
<dl {$k2==count($menus1['list'])?"style='border-bottom:0'":""}>
|
||||
<dt class="dt2">
|
||||
<label><input type="checkbox" id="{$menus2['menuId']}" class="role_{$menus1['menuId']}" value="{$menus2['menuId']}" onclick="javascript:WST.checkChks(this,'.role_{$menus2['menuId']}')" /> {$menus2["menuName"]}</label>
|
||||
</dt>
|
||||
<dd class="dd2">
|
||||
{if isset($menus2['list'])}
|
||||
{volist name="$menus2['list']" id="menus3"}
|
||||
<label>
|
||||
|
||||
<input type="checkbox" id="{$menus3['menuId']}" name="menuIds" class="role_{$menus1['menuId']} role_{$menus2['menuId']} ipt" value="{$menus3['menuId']}" {if isset($object['menuUrls'])}{:in_array(strtolower($menus3['menuUrl']),$object['menuUrls'])?"checked":""}{/if}/> {$menus3["menuName"]}
|
||||
</label>
|
||||
{/volist}
|
||||
{/if}
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
{/volist}
|
||||
</dd>
|
||||
</dl>
|
||||
{/volist}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th width='120'>消息接收权限:</th>
|
||||
<td>
|
||||
{volist name=":WSTDatas('SHOP_MESSAGE')" id="vo"}
|
||||
<label>
|
||||
|
||||
<input type="checkbox" name="privilegeMsgs" class="ipt" value="{$vo['dataVal']}" {if $object['privilegeMsgs']}{:in_array($vo['dataVal'],$object['privilegeMsgs'])?"checked":""}{/if}/> {$vo["dataName"]}
|
||||
|
||||
</label>
|
||||
{/volist}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2' style='text-align:center;padding:20px;'>
|
||||
<a class='s-btn' href="javascript:save()">保 存</a>
|
||||
<a class='s-btn2' href='{:url("home/shoproles/index")}'>返 回</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="footer"}
|
||||
{include file="default/footer" /}
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type='text/javascript' src='__STYLE__/shops/shoproles/shoproles.js?v={$v}'></script>
|
||||
<script type="text/javascript" src="__STATIC__/plugins/validator/jquery.validator.min.js?v={$v}"></script>
|
||||
{/block}
|
54
hyhproject/home/view/default/shops/shoproles/list.html
Executable file
54
hyhproject/home/view/default/shops/shoproles/list.html
Executable file
@ -0,0 +1,54 @@
|
||||
{extend name="default/shops/base" /}
|
||||
{block name="title"}店铺角色-卖家中心{__block__}{/block}
|
||||
{block name="content"}
|
||||
<div class="wst-shop-head"><span>店铺角色管理</span></div>
|
||||
<div class='wst-shop-tbar'>
|
||||
角色名称:<input type='text' id="roleName" name='roleName' class="s-query" />
|
||||
<a class="s-btn" onclick="queryByPage(0)">查询</a>
|
||||
<a class="s-btn wst-list-add" href='{:url("home/shoproles/add")}'>添加</a>
|
||||
</div>
|
||||
|
||||
<div class="wst-shop-content">
|
||||
<table class='wst-list'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="40">序号</th>
|
||||
<th width="300">角色名称</th>
|
||||
<th>创建时间</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id='loading' style='display:none'>
|
||||
<tr class='empty-row'>
|
||||
<td colspan='4'><img src="__STYLE__/img/loading.gif">正在加载数据...</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody id='list'></tbody>
|
||||
<tfoot>
|
||||
<tr><td colspan='4' style='padding-top:10px;text-align:center;'>
|
||||
<div id='pager'></div>
|
||||
</td></tr>
|
||||
</tfoot>
|
||||
|
||||
<script id="tblist" type="text/html">
|
||||
{{# for(var i = 0; i < d.length; i++){ }}
|
||||
<tr>
|
||||
<td>{{i+1}}</td>
|
||||
<td>{{d[i]["roleName"]}}</td>
|
||||
<td>{{d[i]["createTime"]}}</td>
|
||||
<td>
|
||||
<a class="g-handle" href='javascript:toEdit({{d[i]["id"]}})'>[编辑]</a>
|
||||
<a class="g-handle" href='javascript:del({{d[i]["id"]}})'>[删除]</a>
|
||||
</td>
|
||||
</tr>
|
||||
{{# } }}
|
||||
</script>
|
||||
</table>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type='text/javascript' src='__STYLE__/shops/shoproles/shoproles.js?v={$v}'></script>
|
||||
<script>
|
||||
$(function(){queryByPage()})
|
||||
</script>
|
||||
{/block}
|
72
hyhproject/home/view/default/shops/shoproles/shoproles.js
Executable file
72
hyhproject/home/view/default/shops/shoproles/shoproles.js
Executable file
@ -0,0 +1,72 @@
|
||||
|
||||
|
||||
function queryByPage(p){
|
||||
$('#loading').show();
|
||||
var params = {};
|
||||
params = WST.getParams('.s-query');
|
||||
params.page = p;
|
||||
$.post(WST.U('home/shoproles/pageQuery'),params,function(data,textStatus){
|
||||
$('#loading').hide();
|
||||
var json = WST.toJson(data);
|
||||
$('#list').empty();
|
||||
var gettpl = document.getElementById('tblist').innerHTML;
|
||||
laytpl(gettpl).render(json.Rows, function(html){
|
||||
$('#list').html(html);
|
||||
});
|
||||
laypage({
|
||||
cont: 'pager',
|
||||
pages:json.TotalPage,
|
||||
curr: json.CurrentPage,
|
||||
skin: '#e23e3d',
|
||||
groups: 3,
|
||||
jump: function(e, first){
|
||||
if(!first){
|
||||
queryByPage(e.curr);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function toEdit(id){
|
||||
location.href = WST.U('home/shoproles/edit','id='+id);
|
||||
}
|
||||
|
||||
/**保存角色数据**/
|
||||
function save(){
|
||||
$('#shoprole').isValid(function(v){
|
||||
if(v){
|
||||
var params = WST.getParams('.ipt');
|
||||
var loading = WST.msg('正在提交数据,请稍后...', {icon: 16,time:60000});
|
||||
$.post(WST.U('home/shoproles/'+((params.id==0)?"toAdd":"toEdit")),params,function(data,textStatus){
|
||||
layer.close(loading);
|
||||
var json = WST.toJson(data);
|
||||
if(json.status=='1'){
|
||||
WST.msg(json.msg,{icon:1},function(){
|
||||
location.href=WST.U('home/shoproles/index');
|
||||
});
|
||||
}else{
|
||||
WST.msg(json.msg,{icon:2});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
//删除角色
|
||||
function del(id){
|
||||
var c = WST.confirm({content:'您确定要删除该角色吗?',yes:function(){
|
||||
layer.close(c);
|
||||
var load = WST.load({msg:'正在删除,请稍后...'});
|
||||
$.post(WST.U('home/shoproles/del'),{id:id},function(data,textStatus){
|
||||
layer.close(load);
|
||||
var json = WST.toJson(data);
|
||||
if(json.status==1){
|
||||
WST.msg(json.msg,{icon:1});
|
||||
queryByPage(0);
|
||||
}else{
|
||||
WST.msg(json.msg,{icon:2});
|
||||
}
|
||||
});
|
||||
}});
|
||||
}
|
Reference in New Issue
Block a user