|
@@ -43,6 +43,7 @@ function localHideList() {
|
|
|
$('.c-body tr td span[cid="' + cid + '"]').children('i').removeClass('fa-minus-square-o').addClass('fa-plus-square-o');
|
|
|
$('.c-body tr td span[cid="' + cid + '"]').attr('title', '展开');
|
|
|
doTrStatus(returnItem, 'hide');
|
|
|
+ console.log(returnItem);
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
@@ -61,34 +62,36 @@ function setTopTr() {
|
|
|
}
|
|
|
|
|
|
function doTrStatus(node, status, all = '') {
|
|
|
- if (status === 'show') {
|
|
|
- $('.c-body').find('tr[pid="'+ node.sort_id +'"]').show();
|
|
|
- if (all === 'all') {
|
|
|
- $('.c-body').find('tr[pid="'+ node.sort_id +'"] .fold-switch').attr('title', '收起');
|
|
|
- $('.c-body').find('tr[pid="'+ node.sort_id +'"] .fold-switch i').removeClass('fa-plus-square-o').removeClass('fa-minus-square-o').addClass('fa-minus-square-o');
|
|
|
- }
|
|
|
- } else {
|
|
|
- $('.c-body').find('tr[pid="'+ node.sort_id +'"]').hide();
|
|
|
- if (all === 'all') {
|
|
|
- if (node.children) {
|
|
|
- hideList.push({sort_id: node.sort_id});
|
|
|
- setLocalCache(uphlname, JSON.stringify(hideList));
|
|
|
+ if (node) {
|
|
|
+ if (status === 'show') {
|
|
|
+ $('.c-body').find('tr[pid="'+ node.sort_id +'"]').show();
|
|
|
+ if (all === 'all') {
|
|
|
+ $('.c-body').find('tr[pid="'+ node.sort_id +'"] .fold-switch').attr('title', '收起');
|
|
|
+ $('.c-body').find('tr[pid="'+ node.sort_id +'"] .fold-switch i').removeClass('fa-plus-square-o').removeClass('fa-minus-square-o').addClass('fa-minus-square-o');
|
|
|
}
|
|
|
- $('.c-body').find('tr[pid="'+ node.sort_id +'"] .fold-switch').attr('title', '展开');
|
|
|
- $('.c-body').find('tr[pid="'+ node.sort_id +'"] .fold-switch i').removeClass('fa-minus-square-o').removeClass('fa-plus-square-o').addClass('fa-plus-square-o');
|
|
|
- }
|
|
|
- }
|
|
|
- // 判断是否还有一层
|
|
|
- if (node.children && all === '') {
|
|
|
- for (const [index,c] of node.children.entries()) {
|
|
|
- const title = $('.c-body').find('tr[pid="'+ node.sort_id +'"] .fold-switch').eq(index).attr('title');
|
|
|
- if (title === '收起') {
|
|
|
- doTrStatus(c, status);
|
|
|
+ } else {
|
|
|
+ $('.c-body').find('tr[pid="'+ node.sort_id +'"]').hide();
|
|
|
+ if (all === 'all') {
|
|
|
+ if (node.children) {
|
|
|
+ hideList.push({sort_id: node.sort_id});
|
|
|
+ setLocalCache(uphlname, JSON.stringify(hideList));
|
|
|
+ }
|
|
|
+ $('.c-body').find('tr[pid="'+ node.sort_id +'"] .fold-switch').attr('title', '展开');
|
|
|
+ $('.c-body').find('tr[pid="'+ node.sort_id +'"] .fold-switch i').removeClass('fa-minus-square-o').removeClass('fa-plus-square-o').addClass('fa-plus-square-o');
|
|
|
}
|
|
|
}
|
|
|
- } else if (node.children && all === 'all') {
|
|
|
- for (const c of node.children) {
|
|
|
- doTrStatus(c, status, 'all');
|
|
|
+ // 判断是否还有一层
|
|
|
+ if (node.children && all === '') {
|
|
|
+ for (const [index,c] of node.children.entries()) {
|
|
|
+ const title = $('.c-body').find('tr[pid="'+ node.sort_id +'"] .fold-switch').eq(index).attr('title');
|
|
|
+ if (title === '收起') {
|
|
|
+ doTrStatus(c, status);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (node.children && all === 'all') {
|
|
|
+ for (const c of node.children) {
|
|
|
+ doTrStatus(c, status, 'all');
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|