信呼v2.5.3版本

This commit is contained in:
雨中磐石
2023-02-16 16:04:13 +08:00
parent 6bd0ce491e
commit 117f629dcc
26 changed files with 217 additions and 23 deletions

View File

@@ -72,6 +72,13 @@ class optionClassAction extends Action
}
}
public function downshubefore()
{
$pid = (int)$this->post('pid','0');
$this->pid = $pid;
return 'and `pid`='.$pid.'';
}
public function downshuafter($table, $rows)
{
$db = m($table);
@@ -79,8 +86,26 @@ class optionClassAction extends Action
$dcount = $db->rows('pid='.$rs['id'].'');
if($dcount>0)$rows[$k]['dcount'] = $dcount;
}
$darr = array();
if($this->pid>0){
$this->getdonwds($db,$this->pid);
$darr = $this->downarr;
}
return array(
'rows' => $rows
'rows' => $rows,
'darr' => $darr
);
}
private $downarr = array();
private function getdonwds($db,$id)
{
if($id>1){
$rs = $db->getone('`id`='.$id.'','id,pid,name,num');
if($rs){
$this->getdonwds($db, $rs['pid']);
$this->downarr[] = $rs;
}
}
}
}

View File

@@ -29,8 +29,8 @@ $(document).ready(function(){
});
var a = $('#view_{rand}').bootstable({
tablename:'option',celleditor:true,sort:'sort',dir:'asc',modedir:'{mode}:{dir}',storeafteraction:'downshuafter',
autoLoad:false,where:'and pid=-1',bodyStyle:'height:'+(viewheight-72)+'px;overflow:auto',
tablename:'option',celleditor:true,sort:'sort',dir:'asc',modedir:'{mode}:{dir}',storeafteraction:'downshuafter',storebeforeaction:'downshubefore',
autoLoad:false,params:{pid:-1},bodyStyle:'height:'+(viewheight-72)+'px;overflow:auto',
columns:[{
text:'名称',dataIndex:'name',sortable:true,editor:true
},{
@@ -54,9 +54,10 @@ $(document).ready(function(){
return s;
}
}],
load:function(){
load:function(d){
get('add_{rand}').disabled=false;
get('del_{rand}').disabled=true;
c.showdownlist(d.darr);
},
itemclick:function(){
get('del_{rand}').disabled=false;
@@ -72,8 +73,19 @@ $(document).ready(function(){
var c = {
zhankai:function(ad){
$('#downshow_{rand}').html('<b>['+ad.id+'.'+ad.name+']</b>的下级选项');
nowid = ad.id;
a.search("and `pid`="+ad.id+"");
this.showdown(ad.id);
},
showdownlist:function(dl){
var str='<b>路径:</b>';
for(var i=0;i<dl.length;i++){
if(i>0)str+=' <font color="#cccccc">&gt;</font> ';
str+=' <a href="javascript:;" onclick="option{rand}.showdown('+dl[i].id+')">'+dl[i].name+'</a> ';
}
$('#downshow_{rand}').html(str);
},
showdown:function(id1){
nowid = id1;
a.setparams({'pid':id1}, true);
},
search:function(){
var s = get('key_{rand}').value;
@@ -95,7 +107,8 @@ $(document).ready(function(){
var ad = this.optdata;
if(d.lx==0){
$('#downshow_{rand}').html('<b>['+ad.id+'.'+ad.name+']</b>的下级选项');
a.search("and `pid`="+ad.id+"");
//a.search("and `pid`="+ad.id+"");
a.setparams({'pid':ad.id}, true);
}
if(d.lx==1){
c.xiajili();
@@ -123,9 +136,9 @@ $(document).ready(function(){
this.showdwon(num);
},
clickwin:function(o, lx){
var a = this.clicktypewin(false, 0);
var as = this.clicktypewin(false, 0);
optlx = 1;
a.setValue('pid', nowid);
as.setValue('pid', nowid);
},
clicktypeeidt:function(){
var d = at.changedata;
@@ -165,6 +178,8 @@ $(document).ready(function(){
};
js.initbtn(c);
$('#optionview_{rand}').css('height',''+(viewheight-142)+'px');
option{rand} = c;
});
</script>