You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
// import qs from 'qs'
// import { exportFile } from '@/utils/index'
// import { FetchTableDisplayFields, FetchInitArchivesView, FetchFormDisplayFields } from '@/api/archivesManage/archivesList'
export const preLibraryCrud = { // 组件共用属性
data() { return { } }, // 组件共用方法
methods: { filterData(data) { return data.filter(node => { if (node.children && node.children.length > 0) { node.children = this.filterData(node.children) // 递归处理子节点
} return node.isType !== 3 // 过滤掉isType为3的节点
}) }, // 逆归实现 获取指定元素
findNode(tree, func) { for (const node of tree) { if (func(node)) return node if (node.children) { const res = this.findNode(node.children, func) if (res) return res } } return null }, // 展开选中的父级
expandParents(node) { node.expanded = true if (node.parent) { this.expandParents(node.parent) } } }, // 组件挂载时的共用方法
mounted() {
} }
|