feat:实现自定义文档树的展开状态

This commit is contained in:
lifei6671
2018-08-14 18:17:46 +08:00
parent aa2842cdf8
commit 57a745cc63
7 changed files with 63 additions and 15 deletions

View File

@@ -109,10 +109,17 @@ function openEditCatalogDialog($node) {
var text = $node ? $node.text : '';
var parentId = $node && $node.parent !== '#' ? $node.parent : 0;
$then.find("input[name='doc_id']").val(doc_id);
$then.find("input[name='parent_id']").val(parentId);
$then.find("input[name='doc_name']").val(text);
if($node.a_attr && $node.a_attr.is_open){
$then.find("input[name='is_open'][value='1']").prop("checked","checked");
}else{
$then.find("input[name='is_open'][value='0']").prop("checked","checked");
}
for (var index in window.documentCategory){
var item = window.documentCategory[index];
if(item.id === doc_id){
@@ -196,9 +203,11 @@ $("#btnAddDocument").on("click",function () {
});
//用于还原创建文档的遮罩层
$("#addDocumentModal").on("hidden.bs.modal",function () {
$(this).find("form").html(window.addDocumentModalFormHtml);
// $(this).find("form").html(window.sessionStorage.getItem("addDocumentModal"));
}).on("shown.bs.modal",function () {
$(this).find("input[name='doc_name']").focus();
}).on("show.bs.modal",function () {
// window.sessionStorage.setItem("addDocumentModal",$(this).find("form").html())
});
function showError($msg,$id) {
@@ -344,7 +353,6 @@ $(function () {
type : "post",
data : { "attach_id" : $attach_id},
success : function (res) {
console.log(res);
if(res.errcode === 0){
$this.lists = $this.lists.filter(function ($item) {
return $item.attachment_id != $attach_id;