$(document).ready(function() { autoFlashHeight(); console.log($(".sjs-height-0").height()); console.log($('#add-slibing').parent().parent().height()); $('#filing').height($(".sjs-height-0").height() - $('#add-slibing').parent().parent().height() - 10); class FilingObj { constructor(setting) { // 原始数据整理后的树结构,用来整理zTree显示 this.dragTree = createDragTree({ id: 'id', pid: 'tree_pid', level: 'tree_level', order: 'tree_order', rootId: '-1' }); // 界面显示的zTree this.setting = setting; this.filingTree = null; this.pageCount = 15; this.expandKey = 'filing-' + window.location.pathname.split('/')[2]; const cache = getLocalCache(this.expandKey); this.expandCache = cache ? _.uniq(cache.split(',')) : []; this.curFilingKey = 'cur-filing-' + window.location.pathname.split('/')[2]; } analysisFiling(data) { const self = this; this.dragTree.loadDatas(data); this.dragTree.recursiveFun(this.dragTree.children, x => { if (x.children && x.children.length > 0) { x.total_file_count = x.children.map(y => { return y.total_file_count; }).reduce((pre, value) => { return pre + value }, 0); } else { x.total_file_count = x.file_count; } }); const sortNodes = this.dragTree.nodes.map(x => { const result = { id: x.id, tree_pid: x.tree_pid, name: x.name + (x.total_file_count > 0 ? `(${x.total_file_count})` : ''), spid: x.spid, source_node: x, }; if (result.source_node.is_fixed) result.isParent = true; if (result.source_node.is_folder || result.source_node.is_fixed) result.open = self.expandCache.indexOf(result.id) >= 0; return result; }); this.filingTree = $.fn.zTree.init($('#filing'), this.setting, sortNodes); const curCache = getLocalCache(this.curFilingKey); const curNode = curCache ? this.filingTree.getNodeByParam('id', curCache) : null; if (curNode){ this.filingTree.selectNode(curNode); filingObj.setCurFiling(curNode); } } _getFileNameHtml(file) { const editHtml = file.canEdit ? `` : ''; const viewHtml = file.viewpath ? `` : ''; const downHtml = ``; const delHtml = file.canEdit ? `` : ''; return `
添加单位下全部用户
${u.name}${u.mobile}
`); html.push(`${u.role}`); html.push(`