storage.ts 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import { QueentreeExplorer_Storage } from "@queenjs-modules/queentree-explorer/storage";
  2. import {
  3. HostRootItem,
  4. NodeRootItem,
  5. } from "@queenjs-modules/queentree-explorer/typings";
  6. QueentreeExplorer_Storage.setVersion("1.0.0").setDefaultValue(() => {
  7. const expHosts: { [name: string]: HostRootItem } = {};
  8. const cloudRootNode: NodeRootItem = {
  9. names: ["云盘"],
  10. ids: [Math.random().toString()],
  11. nodeType: "host",
  12. tabPerms: ["rename", "login"],
  13. nodePerms: ["editable", "saveAs"],
  14. };
  15. const platformRootNode: NodeRootItem = {
  16. names: ["平台", "楦库", "面料"],
  17. ids: [
  18. cloudRootNode.ids[0],
  19. "628b4ae8633d10f8e3658557",
  20. "62a300a0a4fd6456392ebe76",
  21. ],
  22. nodeType: "branch",
  23. assetType: 31,
  24. tabPerms: [],
  25. nodePerms: ["saveAs"],
  26. };
  27. const myRootNodes = [cloudRootNode];
  28. expHosts[cloudRootNode.ids[0]] = {
  29. baseURL: "https://www.3dqueen.cloud/tree/v1/assetcenter",
  30. authURL: "https://www.3dqueen.cloud/cloud/v1/usercenter",
  31. authKey: "queentreesku3d",
  32. };
  33. const expNodeRoots = [...myRootNodes, platformRootNode];
  34. return {
  35. expHosts,
  36. expWindows: [
  37. {
  38. groupName: "我的资源",
  39. rootNodeIds: myRootNodes.map((rootNode) => rootNode.ids.at(-1) || ""),
  40. },
  41. {
  42. groupName: "平台资源",
  43. rootNodeIds: [platformRootNode.ids.at(-1) as string],
  44. },
  45. {
  46. groupName: "共享资源",
  47. rootNodeIds: [],
  48. showShareBtn: true,
  49. },
  50. ],
  51. expNodeRoots,
  52. expActiveState: {
  53. currWindowName: "我的资源",
  54. },
  55. };
  56. });