信呼OA版本v2.3.8
This commit is contained in:
28
webmain/system/home/homeAction.php
Normal file
28
webmain/system/home/homeAction.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
class homeClassAction extends Action
|
||||
{
|
||||
public function delhomeAjax()
|
||||
{
|
||||
$id = c('check')->onlynumber($this->post('id','0'));
|
||||
m('homeitems')->delete('id in('.$id.')');
|
||||
$this->backmsg();
|
||||
}
|
||||
|
||||
//导入默认的官网首页项
|
||||
public function daordriwsAjax()
|
||||
{
|
||||
$rows = json_decode('[{"num":"kjrk","row":"0","name":"快捷入口","sort":"0"},{"num":"kjrko","row":"0","name":"快捷入口(大图标)","sort":"0"},{"num":"gong","row":"0","name":"通知公告","sort":"0"},{"num":"bianjian","row":"0","name":"便笺","sort":"1"},{"num":"tjlogin","row":"0","name":"登录统计","sort":"5","receid":"u1","recename":"管理员"},{"num":"kqtotal","row":"0","name":"今日出勤情况","sort":"2"},{"num":"news","row":"0","name":"新闻资讯","sort":"3"},{"num":"kqdk","row":"0","name":"考勤打卡","sort":"4"},{"num":"officic","row":"1","name":"公文查阅","sort":"3"},{"num":"gwwx","row":"0","receid":"u1","recename":"管理员","name":"微信办公","sort":"10"},{"num":"apply","row":"1","name":"我的申请","sort":"0"},{"num":"meet","row":"1","name":"今日会议","sort":"2"},{"num":"syslog","receid":"u1","recename":"管理员","row":"1","name":"系统日志","sort":"3"},{"num":"about","row":"1","receid":"u1","recename":"管理员","name":"关于信呼","sort":"10"}]', true);
|
||||
$db = m('homeitems');
|
||||
foreach($rows as $k=>$rs){
|
||||
$num = $rs['num'];
|
||||
$where = "`num`='$num'";
|
||||
if($db->rows($where)==0){
|
||||
$where='';
|
||||
}else{
|
||||
unset($rs['row']);
|
||||
unset($rs['sort']);
|
||||
}
|
||||
$db->record($rs, $where);
|
||||
}
|
||||
}
|
||||
}
|
||||
108
webmain/system/home/rock_home.php
Normal file
108
webmain/system/home/rock_home.php
Normal file
@@ -0,0 +1,108 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
var lestore = [[0,'第一列'],[1,'第二列'],[2,'第三列'],[3,'第四列']];
|
||||
var a = $('#veiw_{rand}').bootstable({
|
||||
tablename:'homeitems',celleditor:true,defaultorder:'`row`,`sort`',
|
||||
columns:[{
|
||||
text:'名称',dataIndex:'name',editor:true
|
||||
},{
|
||||
text:'编号',dataIndex:'num',editor:true
|
||||
},{
|
||||
text:'适用对象',dataIndex:'recename'
|
||||
},{
|
||||
text:'位置列',dataIndex:'row',editor:true,type:'select',store:lestore,renderer:function(v){
|
||||
var v1=parseFloat(v);
|
||||
return lestore[v1][1];
|
||||
}
|
||||
},{
|
||||
text:'排序号',dataIndex:'sort',editor:true,type:'number'
|
||||
},{
|
||||
text:'状态',dataIndex:'status',type:'checkbox',editor:true
|
||||
},{
|
||||
text:'ID',dataIndex:'id'
|
||||
}],
|
||||
itemclick:function(){
|
||||
btn(false);
|
||||
},
|
||||
beforeload:function(){
|
||||
btn(true);
|
||||
}
|
||||
});
|
||||
|
||||
function btn(bo){
|
||||
get('del_{rand}').disabled = bo;
|
||||
get('edit_{rand}').disabled = bo;
|
||||
}
|
||||
|
||||
var c = {
|
||||
del:function(){
|
||||
a.del({url:js.getajaxurl('delhome','{mode}','{dir}')});
|
||||
},
|
||||
refresh:function(){
|
||||
a.reload();
|
||||
},
|
||||
clickwin:function(o1,lx){
|
||||
var h = $.bootsform({
|
||||
title:'首页项',height:400,width:400,
|
||||
tablename:'homeitems',isedit:lx,
|
||||
submitfields:'name,sort,num,receid,recename,row',
|
||||
items:[{
|
||||
labelText:'名称',name:'name',required:true
|
||||
},{
|
||||
labelText:'编号',name:'num',required:true
|
||||
},{
|
||||
labelText:'适用对象',type:'changeuser',changeuser:{
|
||||
type:'deptusercheck',idname:'receid',title:'选择人员'
|
||||
},name:'recename',clearbool:true
|
||||
|
||||
},{
|
||||
name:'receid',type:'hidden'
|
||||
},{
|
||||
labelText:'位置列',name:'row',type:'select',value:'0',store:lestore,valuefields:0,displayfields:1
|
||||
},{
|
||||
labelText:'序号',name:'sort',type:'number',value:'0'
|
||||
}],
|
||||
success:function(){
|
||||
a.reload();
|
||||
}
|
||||
});
|
||||
if(lx==1){
|
||||
h.setValues(a.changedata);
|
||||
}
|
||||
h.getField('name').focus();
|
||||
},
|
||||
daoru:function(){
|
||||
js.confirm('导入官网默认项,会直接覆盖你的修改哦',function(jg){
|
||||
if(jg=='yes')c.daoruss();
|
||||
});
|
||||
},
|
||||
daoruss:function(){
|
||||
js.msg('wait','导入中...');
|
||||
js.ajax(js.getajaxurl('daordriws','{mode}', '{dir}'),{}, function(d){
|
||||
js.msg('success', '导入成功');
|
||||
a.reload();
|
||||
},'get');
|
||||
}
|
||||
};
|
||||
|
||||
js.initbtn(c);
|
||||
});
|
||||
</script>
|
||||
|
||||
<div>
|
||||
<ul class="floats">
|
||||
<li class="floats50">
|
||||
<button class="btn btn-primary" click="clickwin,0" type="button"><i class="icon-plus"></i> 新增首页项</button>
|
||||
<button class="btn btn-default" click="refresh,0" type="button">刷新</button>
|
||||
<button class="btn btn-default" click="daoru" type="button">导入官网默认项</button>
|
||||
</li>
|
||||
<li class="floats50" style="text-align:right">
|
||||
<button class="btn btn-danger" id="del_{rand}" click="del" disabled type="button"><i class="icon-trash"></i> 删除</button>
|
||||
<button class="btn btn-info" id="edit_{rand}" click="clickwin,1" disabled type="button"><i class="icon-edit"></i> 编辑 </button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="veiw_{rand}"></div>
|
||||
<div class="tishi">首页项内容显示需要到webmain/home/desktop下创建对应文件编写代码。</div>
|
||||
Reference in New Issue
Block a user