Skip to content

Commit

Permalink
[FIX]修复添加分类BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
Exrick committed Jul 24, 2018
1 parent 5305dd2 commit 185f0d2
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
1 change: 1 addition & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
```
- 支持多维度IP、uid等限流 详见代码
### 技术疑问交流
- 给作者项目Star或捐赠后可加入交流群 `475743731`,还可获取共享学习资源和 和 [UI框架](https://github.com/Exrick/xmall/blob/master/study/FlatLab.md) [![](https://pub.idqqimg.com/wpa/images/group.png)](https://shang.qq.com/wpa/qunwpa?idkey=7b60cec12ba93ebed7568b0a63f22e6e034c0d1df33125ac43ed753342ec6ce7)
- QQ交流群 `475743731`,可获取详细文档、共享付费学习资源和 和 [UI框架](https://github.com/Exrick/xmall/blob/master/study/FlatLab.md) [![](https://pub.idqqimg.com/wpa/images/group.png)](https://shang.qq.com/wpa/qunwpa?idkey=7b60cec12ba93ebed7568b0a63f22e6e034c0d1df33125ac43ed753342ec6ce7)
- 作者博客:[https://blog.exrick.cn](https://blog.exrick.cn)
### 商用授权
- 个人学习使用遵循GPL开源协议
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@
<form action="" method="post" class="form form-horizontal" id="category-add">
<input type="text" hidden class="input-text" value="0" id="parentId" name="parentId">
<input type="text" hidden class="input-text" value="true" id="isParent" name="isParent">
<input type="text" hidden class="input-text" value="1" id="status" name="status">
<input type="text" hidden class="input-text" value="1" id="sortOrder" name="sortOrder">
<div class="row cl" id="parentName" style="display:none">
<label class="form-label col-xs-4 col-sm-2">
<span class="c-red">*</span>
上级名称:</label>
<div class="formControls col-xs-6 col-sm-6">
<span id="parentCatName"></span>
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-4 col-sm-2">
<span class="c-red">*</span>
Expand Down Expand Up @@ -73,16 +83,20 @@
maxlength:100
});
if(parent.id!=""){
$("#parentId").val(parent.id);
}
if(!parent.isRoot){
// 不是根节点
$('#parentSwitch').bootstrapSwitch('setState', false);
$("#isParent").val(0);
$("#parentName").css("display","block");
$("#parentCatName").html(parent.clickCatName);
}else{
$('#parentSwitch').bootstrapSwitch('setState', true);
$("#isParent").val(1);
}
if(parent.id!=""){
$("#parentId").val(parent.id);
$("#parentId").val(0);
}
$('#parentSwitch').on('switch-change', function (e, data) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
layer_show("选择父节点分类","choose-parent-category",300,510);
}
var isParent=false,id="",name="";
var isParent=false,id="",name="",clickCatName="";
var index = layer.load(3);
Expand Down Expand Up @@ -164,6 +164,7 @@
changeSwitch2(treeNode.status);
id=treeNode.id;
name=treeNode.name;
clickCatName=treeNode.name;
if (treeNode.isParent) {
isParent=true;
Expand Down Expand Up @@ -267,7 +268,7 @@
return;
}
isRoot=false;
layer_show(title,url,700,350);
layer_show(title,url,700,380);
}
/*根节点分类-添加*/
Expand Down

0 comments on commit 185f0d2

Please sign in to comment.