如何制作响应式网站,网络营销的方法有哪些?举例说明,网页版面,可以充值的网站怎么建设公司服务升级确定了新的架构#xff0c;假如当前部门是二级部门#xff0c;二级部门下的三级部门全部已选择#xff0c;那么后端接口要求只需要传二级部门的id#xff0c;并且操作符传参为 like#xff1b;如果某一个部门已选择#xff0c;切父级部门没有选择#xff0c…公司服务升级确定了新的架构假如当前部门是二级部门二级部门下的三级部门全部已选择那么后端接口要求只需要传二级部门的id并且操作符传参为 like如果某一个部门已选择切父级部门没有选择那么就需要传参为具体子部门的id操作符为 in① 只要所选部门中包含一个或一个以上的父级部门(父级部门标识 isParent 为true)传参将属于该父级部门中的子级部门全部去除并保留该父级部门操作符 like② 只要所选部门中不包含任何一个父级部门(父级部门标识 isParent 为true)传参 所有已选部门的id操作符 in这个之前我翻了好多的elementUI tree的文档都没有找到合适的解决方案上次看到了一个解决方法但是对性能不是很好所以我优化了一下思路 可以使用 getCheckedNodes() 获取到所有已选的数据(包括所有的父子部门)根据父部门的特点isParent true 来去除所有的父级部门并且树绑定的treePos是有特殊规律的根据当前树的层级来的解决方案一let treeNodes this.$refs.tree.getCheckedNodes()let treeKeys this.$refs.tree.getCheckedKeys()this.checkPos []this.operatorType this.scope.dataScope.operatorType || likelet parentNodes treeNodes.filter((item) {return item.isParent true})if (parentNodes.length ! 0) {let parentPos parentNodes.map(it {return it.treePos})this.operatorType likethis.checkPos treeKeys.filter(elem {let isBottom parentPos.every((el) {return elem.includes(el) elem ! el})if (!isBottom) {return elem}})} else {this.operatorType inthis.checkPos treeKeys}解决方案二循环遍历树结构找到上一级或者最后一级已选中的datafindParents(store) {const checkedNodes [];const filterNodes function(node) {const treeNodes node.root ? node.root.childNodes : node.childNodes;treeNodes.forEach(child {if (child.checked) { // 已找到选中的上一级或者当前最后一级checkedNodes.push(child);}if (child.indeterminate) { // 节点的子树中是否有被选中的节点filterNodes(child);}});};filterNodes(store)return checkedNodes;}findParents(this.$refs.tree.store) // 输出树数据