阅行客电子档案
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.

43 lines
1.1 KiB

  1. // import qs from 'qs'
  2. // import { exportFile } from '@/utils/index'
  3. // import { FetchTableDisplayFields, FetchInitArchivesView, FetchFormDisplayFields } from '@/api/archivesManage/archivesList'
  4. export const preLibraryCrud = {
  5. // 组件共用属性
  6. data() {
  7. return {
  8. }
  9. },
  10. // 组件共用方法
  11. methods: {
  12. filterData(data) {
  13. return data.filter(node => {
  14. if (node.children && node.children.length > 0) {
  15. node.children = this.filterData(node.children) // 递归处理子节点
  16. }
  17. return node.isType !== 3 // 过滤掉isType为3的节点
  18. })
  19. },
  20. // 逆归实现 获取指定元素
  21. findNode(tree, func) {
  22. for (const node of tree) {
  23. if (func(node)) return node
  24. if (node.children) {
  25. const res = this.findNode(node.children, func)
  26. if (res) return res
  27. }
  28. }
  29. return null
  30. },
  31. // 展开选中的父级
  32. expandParents(node) {
  33. node.expanded = true
  34. if (node.parent) {
  35. this.expandParents(node.parent)
  36. }
  37. }
  38. },
  39. // 组件挂载时的共用方法
  40. mounted() {
  41. }
  42. }