@petercjl/omni-desktop-app 0.1.7 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/INSTALL.md +9 -0
  2. package/README.md +4 -4
  3. package/UPDATE.md +7 -0
  4. package/app/assets/{CartesianChart-acGhtLrw.js → CartesianChart-CP7p2vlm.js} +4 -4
  5. package/app/assets/{CollaborationWorkspace-DAWo2Vol.js → CollaborationWorkspace-Cnp5PNn_.js} +6 -6
  6. package/app/assets/CollaborationWorkspace-D7ttfUjn.css +1 -0
  7. package/app/assets/CompetitorAnalysis-Cujy_a2L.js +1 -0
  8. package/app/assets/CompetitorAnalysis-h1zdt0F2.css +1 -0
  9. package/app/assets/EmptyState-CUHuNsaV.js +1 -0
  10. package/app/assets/ErrorBarContext-BJE5-ljg.js +1 -0
  11. package/app/assets/{EvidenceSourceGuide-qBsaH1fx.js → EvidenceSourceGuide-B1AJCZm2.js} +1 -1
  12. package/app/assets/FavoritePicker-XD1a_uOa.js +1 -0
  13. package/app/assets/Favorites-B5_fdEvZ.js +1 -0
  14. package/app/assets/{HelpTip-X4GpEnvk.js → HelpTip-BqRBO41J.js} +1 -1
  15. package/app/assets/LineChart-Ckvg5wfQ.js +4 -0
  16. package/app/assets/Opportunities-BvH64-dz.js +1 -0
  17. package/app/assets/{ProgressiveRows-DPZqhsXV.js → ProgressiveRows-NojOUgmr.js} +1 -1
  18. package/app/assets/ShopLayoutPage-CCrRwaAx.js +1 -0
  19. package/app/assets/TrendChart-BF4JgwxH.js +1 -0
  20. package/app/assets/arrow-down-B1nil3T4.js +1 -0
  21. package/app/assets/arrow-left-BhFSpYzK.js +1 -0
  22. package/app/assets/arrow-up-right-IBQoN72x.js +1 -0
  23. package/app/assets/book-open-Cqdn6s-H.js +1 -0
  24. package/app/assets/chart-column-DCwNhXki.js +1 -0
  25. package/app/assets/{chart-no-axes-combined-dFluBLOV.js → chart-no-axes-combined-DVgKs36j.js} +1 -1
  26. package/app/assets/check-DBnlZFEo.js +1 -0
  27. package/app/assets/chevron-down-DO6RUQm8.js +1 -0
  28. package/app/assets/chevron-right-e65CaeL6.js +1 -0
  29. package/app/assets/{clock-3-DpvJxor3.js → clock-3-CDHtQwAe.js} +1 -1
  30. package/app/assets/competitor-analysis-D6eM9ugQ.js +1 -0
  31. package/app/assets/components-B5Xyjfpi.js +2 -0
  32. package/app/assets/{download-BQwcTDwB.js → download-DfM49VvV.js} +1 -1
  33. package/app/assets/entry-Bq7tA83b.js +1 -0
  34. package/app/assets/entry-BryQeuNT.css +1 -0
  35. package/app/assets/entry-CMur_AE7.css +1 -0
  36. package/app/assets/entry-DC4oDjzU.js +2 -0
  37. package/app/assets/entry-DM64sJfS.js +1 -0
  38. package/app/assets/entry-DbqMDIJi.js +1 -0
  39. package/app/assets/entry-N8bfKXTF.js +2 -0
  40. package/app/assets/entry-kAWoaIsV.js +2 -0
  41. package/app/assets/favorites.module-CHYv-Z8y.js +1 -0
  42. package/app/assets/{file-text-DF8-c_Tb.js → file-text-DKAT5fzJ.js} +1 -1
  43. package/app/assets/getRadiusAndStrokeWidthFromDot-bv_ksZ7y.js +1 -0
  44. package/app/assets/{grid-2x2-BNdV1X54.js → grid-2x2-DB6zRPIV.js} +1 -1
  45. package/app/assets/index-BgJNmU0Z.css +1 -0
  46. package/app/assets/index-DLSVWUSu.js +10 -0
  47. package/app/assets/{layers-BY0DtVnH.js → layers-CjsT_HGi.js} +1 -1
  48. package/app/assets/layout-dashboard-sgUrlApv.js +1 -0
  49. package/app/assets/{link-2-B7GAWapc.js → link-2-VLti-YG9.js} +1 -1
  50. package/app/assets/{list-DrSHrHvT.js → list-Dfzc0sXQ.js} +1 -1
  51. package/app/assets/market-SuD7x_Hf.css +1 -0
  52. package/app/assets/market.module-VpU4XmGg.js +1 -0
  53. package/app/assets/module-host-DNtiV4gZ.js +1 -0
  54. package/app/assets/orbit-CrQs6cpl.js +1 -0
  55. package/app/assets/play-BxTFlaQX.js +1 -0
  56. package/app/assets/plus-D78h7lrw.js +1 -0
  57. package/app/assets/products-B5vjXM_b.js +1 -0
  58. package/app/assets/project-public-CgW1u7BI.js +4 -0
  59. package/app/assets/project-public-DWTt808B.js +1 -0
  60. package/app/assets/public-C-PBMVOQ.js +1 -0
  61. package/app/assets/{refresh-cw-BZ6-gKfF.js → refresh-cw-CxbRf97c.js} +1 -1
  62. package/app/assets/search-DFdSppzm.js +1 -0
  63. package/app/assets/triangle-alert-C7qiylOf.js +1 -0
  64. package/app/assets/{ui-public-BPe2GJZ-.css → ui-public-DHoRDp5_.css} +1 -1
  65. package/app/assets/ui-public-Dt5dHt-8.js +1 -0
  66. package/app/assets/workbench-DIKJZNJQ.js +2 -0
  67. package/app/assets/workbench-Db45mF6t.css +1 -0
  68. package/app/assets/workspace-view-state-D0ujRczW.js +1 -0
  69. package/app/desktop/main.mjs +7719 -0
  70. package/app/desktop/preload.cjs +30 -0
  71. package/app/index.html +2 -2
  72. package/app/package.json +1 -0
  73. package/app/public/omni-icon.png +0 -0
  74. package/app/tools/bootstrap.bin +0 -0
  75. package/app/tools/omni-desktop.mjs +526 -0
  76. package/package.json +7 -2
  77. package/release.json +1 -1
  78. package/release.sig +1 -1
  79. package/app/assets/CollaborationWorkspace-DHP4cb-p.css +0 -1
  80. package/app/assets/EmptyState-BgcduNtk.js +0 -1
  81. package/app/assets/Favorites-C3gPJxbl.js +0 -1
  82. package/app/assets/LineChart-CyiCaQMM.js +0 -4
  83. package/app/assets/Opportunities-DDR6jMz5.js +0 -1
  84. package/app/assets/ShopLayoutPage-7lNMFD1W.js +0 -1
  85. package/app/assets/TrendChart-ClEBAnKO.js +0 -1
  86. package/app/assets/activity-idEO2qnr.js +0 -1
  87. package/app/assets/arrow-left-rfprDrQc.js +0 -1
  88. package/app/assets/arrow-up-right-Bp3gzP7v.js +0 -1
  89. package/app/assets/check-DokC3Ug0.js +0 -1
  90. package/app/assets/chevron-down-CHQKhw_4.js +0 -1
  91. package/app/assets/chevron-right-2HEa4oQb.js +0 -1
  92. package/app/assets/components-zDEQpnyp.js +0 -2
  93. package/app/assets/entry-BNiO6CiP.js +0 -2
  94. package/app/assets/entry-BleRLT_W.js +0 -1
  95. package/app/assets/entry-CO870j9p.css +0 -1
  96. package/app/assets/entry-CYsrxe4a.js +0 -2
  97. package/app/assets/entry-D2FD-KFx.js +0 -1
  98. package/app/assets/entry-DAnTlYgL.js +0 -1
  99. package/app/assets/entry-DSEbJ79v.js +0 -2
  100. package/app/assets/entry-OPB3MGoc.css +0 -1
  101. package/app/assets/git-branch-CMQGDByc.js +0 -1
  102. package/app/assets/index-7NKGenq7.css +0 -1
  103. package/app/assets/index-BBySSIJT.js +0 -10
  104. package/app/assets/market-B2oImfqS.css +0 -1
  105. package/app/assets/market.module-BXeOH_ee.js +0 -1
  106. package/app/assets/module-host-BHOsDk69.js +0 -1
  107. package/app/assets/package-C_xD77DO.js +0 -1
  108. package/app/assets/pin-BEsLCHJL.js +0 -1
  109. package/app/assets/plus-C301wuGJ.js +0 -1
  110. package/app/assets/products-CfPFkCnk.js +0 -1
  111. package/app/assets/project-public-CYza4XVS.js +0 -4
  112. package/app/assets/project-public-DqjxO6ad.js +0 -1
  113. package/app/assets/public-DoBzMSlG.js +0 -1
  114. package/app/assets/ui-public-CX7L8QF_.js +0 -1
  115. package/app/assets/use-favorites-ChTJGQkB.js +0 -1
  116. package/app/assets/workbench-13XxpUuA.css +0 -1
  117. package/app/assets/workbench-BCuh9Nyq.js +0 -2
  118. package/app/assets/workspace-view-state-CYNxOsyc.js +0 -1
  119. /package/app/assets/{api-DP_rt0Zx.js → api-KZa8CR8X.js} +0 -0
  120. /package/app/assets/{use-favorites-_eKBQGeF.css → favorites-_eKBQGeF.css} +0 -0
  121. /package/app/assets/{format-jsGSJ1GL.js → format-DL7i7_eV.js} +0 -0
  122. /package/app/assets/{graphicalItemSelectors-GhHIivGe.js → graphicalItemSelectors-CJfZ6cht.js} +0 -0
  123. /package/app/assets/{group--adLvfC6.js → group-Ed305HyG.js} +0 -0
@@ -1 +0,0 @@
1
- .wb-shared-nav{--ws-rail-width:72px;--ws-menu-width:208px;--ws-header-height:0px}.wb-shared-nav.ws-content-navigation{--ws-menu-width:0px}.wb-shared-nav.ws-content-navigation .wb-mobile-menu,.wb-shared-nav.ws-content-navigation>.wb-main>.wb-topbar{display:none}.wb-shared-nav.ws-content-navigation>.wb-main>.wb-content,.wb-shared-nav.ws-market-content>.wb-main>.wb-content{max-width:none;padding:0}.wb-shared-nav.ws-market-content>.wb-main>.wb-content>footer{padding-inline:24px}.wb-shared-nav.ws-content-navigation>.wb-main>.wb-content>footer{display:none}.omni-workspace .wb-shared-nav{--ws-header-height:48px}.wb-shared-nav .ws-module-rail{inset:var(--ws-header-height) auto 0 0;width:var(--ws-rail-width);z-index:46;background:var(--omni-bg,var(--omni-paint-surface-0a1729,#0a1729));border-right:1px solid var(--omni-line,var(--omni-paint-line-294468,#294468));flex-direction:column;align-items:center;gap:8px;padding:12px 6px 170px;display:flex;position:fixed;overflow-y:auto}.wb-shared-nav .ws-module-rail button{width:58px;min-height:58px;color:var(--omni-muted,var(--omni-paint-ink-91abc5,#91abc5));white-space:nowrap;background:0 0;border:1px solid #0000;border-radius:9px;flex-direction:column;flex-shrink:0;justify-content:center;align-items:center;gap:6px;padding:7px 2px;font-size:10px;display:flex}.wb-shared-nav .ws-module-rail button[aria-current]{color:var(--omni-accent,var(--omni-paint-accent-61d6f1,#61d6f1));background:var(--omni-panel,var(--omni-paint-surface-132d49,#132d49));border-color:var(--omni-line,var(--omni-paint-line-315775,#315775))}.wb-shared-nav .ws-module-rail button:hover{background:var(--omni-panel,var(--omni-paint-surface-132d49,#132d49))}.ws-rail-mark{flex:0 0 38px;place-items:center;width:38px;height:38px;display:grid}.ws-rail-mark img{object-fit:contain;border-radius:10px;width:38px;height:38px;display:block}.wb-shared-nav .ws-module-sidebar,.omni-workspace .wb-shared-nav .ws-module-sidebar{left:var(--ws-rail-width);top:var(--ws-header-height);width:var(--ws-menu-width);height:calc(100dvh - var(--ws-header-height));z-index:40;padding:22px 12px;display:flex;overflow-y:auto}.wb-shared-nav .wb-main{margin-left:calc(var(--ws-rail-width) + var(--ws-menu-width));width:calc(100% - var(--ws-rail-width) - var(--ws-menu-width))}.ws-module-heading{color:var(--omni-text,var(--omni-paint-ink-d7e8fa,#d7e8fa));justify-content:space-between;align-items:center;padding:4px 12px 22px;font-size:18px;display:flex}.ws-module-sidebar .ws-context{padding-top:0}.ws-module-sidebar .ws-context button{justify-content:space-between;gap:8px;min-height:38px;font-size:12px;display:flex}.ws-module-sidebar .ws-project{border-top:1px solid var(--omni-line,var(--omni-paint-line-294468,#294468));margin-top:12px;padding:12px 8px}.ws-module-note{color:var(--omni-muted,var(--omni-paint-ink-91abc5,#91abc5));margin-top:auto;padding:24px 12px 0;font-size:11px;line-height:1.8}.omni-workspace .omni-workspace-tools,.omni-workspace.omni-sidebar-collapsed .omni-workspace-tools{border:0;border-right:1px solid var(--omni-line);background:var(--omni-bg);z-index:48;border-radius:0;flex-direction:column;justify-content:center;gap:5px;width:72px;height:180px;display:flex;bottom:0;left:0;right:auto}.omni-workspace .omni-workspace-tools .omni-account-popover{bottom:0;left:76px;right:auto}.omni-workspace .omni-workspace-tools .omni-store-popover{bottom:90px;left:76px;right:auto}.omni-workspace .omni-workspace-tools .omni-update-popover{bottom:42px;left:76px;right:auto}.omni-sidebar-collapsed .wb-shared-nav .ws-module-sidebar{display:none}.omni-workspace.omni-sidebar-collapsed .wb-shared-nav.wb-unified .wb-main{width:calc(100% - 72px);margin-left:72px}.wb-shared-nav .ws-module-rail button:focus-visible,.ws-module-sidebar button:focus-visible{outline:2px solid var(--omni-accent,var(--omni-paint-line-61d6f1,#61d6f1));outline-offset:2px}@media (width<=760px){.wb-shared-nav .ws-module-sidebar,.omni-workspace .wb-shared-nav .ws-module-sidebar{display:none}.wb-shared-nav .ws-module-sidebar.is-open,.omni-workspace .wb-shared-nav .ws-module-sidebar.is-open{box-shadow:12px 0 30px var(--omni-paint-shadow-0004,#0004);display:flex}.wb-shared-nav .wb-main{width:calc(100% - 72px);margin-left:72px}}.omni-workspace .wb-shared-nav .ws-module-rail{padding-bottom:12px;bottom:180px}:root[data-omni-theme=light]{--omni-paint-surface-0a1729:#f5f6fa;--omni-paint-line-294468:#dde1eb;--omni-paint-ink-91abc5:#626e80;--omni-paint-accent-61d6f1:#4055db;--omni-paint-surface-132d49:#fff;--omni-paint-line-315775:#dde1eb;--omni-paint-ink-d7e8fa:#252831;--omni-paint-line-61d6f1:#dde1eb;--omni-paint-shadow-0004:#0001}:root[data-omni-theme=dark]{--omni-paint-surface-0a1729:#0b1727;--omni-paint-line-294468:#2c435b;--omni-paint-ink-91abc5:#91a9bd;--omni-paint-accent-61d6f1:#61d3df;--omni-paint-surface-132d49:#102235;--omni-paint-line-315775:#2c435b;--omni-paint-ink-d7e8fa:#dceaf7;--omni-paint-line-61d6f1:#2c435b;--omni-paint-shadow-0004:#0001}
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./entry-BleRLT_W.js","./index-BBySSIJT.js","./index-7NKGenq7.css","./activity-idEO2qnr.js","./clock-3-DpvJxor3.js","./git-branch-CMQGDByc.js","./pin-BEsLCHJL.js","./layers-BY0DtVnH.js","./workspace-view-state-CYNxOsyc.js","./module-host-BHOsDk69.js","./public-DoBzMSlG.js","./entry-OPB3MGoc.css","./entry-CYsrxe4a.js","./api-DP_rt0Zx.js","./components-zDEQpnyp.js","./format-jsGSJ1GL.js","./market.module-BXeOH_ee.js","./market-B2oImfqS.css","./chevron-down-CHQKhw_4.js","./chevron-right-2HEa4oQb.js","./ProgressiveRows-DPZqhsXV.js","./link-2-B7GAWapc.js","./grid-2x2-BNdV1X54.js","./list-DrSHrHvT.js","./package-C_xD77DO.js","./entry-D2FD-KFx.js","./group--adLvfC6.js","./ui-public-CX7L8QF_.js","./products-CfPFkCnk.js","./plus-C301wuGJ.js","./products-BTd3YVqO.css","./CollaborationWorkspace-DAWo2Vol.js","./check-DokC3Ug0.js","./file-text-DF8-c_Tb.js","./CollaborationWorkspace-DHP4cb-p.css","./refresh-cw-BZ6-gKfF.js","./EmptyState-BgcduNtk.js","./EvidenceSourceGuide-qBsaH1fx.js","./HelpTip-X4GpEnvk.js","./HelpTip-BsHPhMNf.css","./ui-public-BPe2GJZ-.css","./arrow-left-rfprDrQc.js","./arrow-up-right-Bp3gzP7v.js","./chart-no-axes-combined-dFluBLOV.js","./entry-CO870j9p.css","./entry-DSEbJ79v.js","./entry-B_LLuTIf.css","./entry-DAnTlYgL.js","./entry-BNiO6CiP.js"])))=>i.map(i=>d[i]);
2
- import{n as e,t}from"./git-branch-CMQGDByc.js";import{t as n}from"./chevron-right-2HEa4oQb.js";import{a as r,i,r as a}from"./ui-public-CX7L8QF_.js";import{t as o}from"./download-BQwcTDwB.js";import{t as s}from"./layers-BY0DtVnH.js";import{t as c}from"./workspace-view-state-CYNxOsyc.js";import{_ as l,d as u,f as d,i as f,l as p,m,o as h,s as g,t as _}from"./index-BBySSIJT.js";import{t as ee}from"./module-host-BHOsDk69.js";import"./public-DoBzMSlG.js";var v=u(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),y=u(`layout-dashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),b=u(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),x=l(m(),1),S=[{id:`home`,label:`首页`,menus:[[`overview`,`首页总览`],[`recent`,`最近访问`],[`favorites`,`我的收藏`]],note:`从这里继续你的工作`,load:()=>_(()=>import(`./entry-BleRLT_W.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url)},{id:`market`,label:`市场大盘`,menus:[[`categories`,`类目概览`],[`opportunities`,`机会发现`],[`products`,`商品排行榜`],[`shops`,`店铺排行榜`],[`shop-layout`,`店铺品类布局`],[`favorites`,`我的收藏`]],note:`按企业授权查看市场类目`,load:()=>_(()=>import(`./entry-CYsrxe4a.js`),__vite__mapDeps([12,1,2,13,14,15,16,17,18,19,8,10,20,21,22,23,24]),import.meta.url)},{id:`overview`,label:`工作台`,menus:[[`overview`,`经营总览`],[`tasks`,`待处理事项`],[`records`,`执行记录`]],shopScope:!0,note:`仅展示当前账号获准的资料`,load:()=>_(()=>import(`./entry-D2FD-KFx.js`),__vite__mapDeps([25,1,2,26,27,28,4,29,30,31,32,18,19,33,6,23,8,9,10,34,35,36,7,37,38,39,40,3,41,42,43,44]),import.meta.url)},{id:`products`,label:`商品`,menus:[[`all`,`全部商品`],[`test`,`新品测试`],[`incubate`,`持续孵化`],[`scale`,`重点推广`],[`unassigned`,`待分组`]],projectMenus:[[`dashboard`,`指标概览`],[`monitor`,`每日监控`],[`optimization`,`商品优化`],[`finance`,`经营核算`],[`fulfillment`,`库存与售后`]],shopScope:!0,note:`仅展示当前账号获准的资料`,projectEntry:!0,load:()=>_(()=>import(`./entry-DSEbJ79v.js`),__vite__mapDeps([45,1,2,26,28,4,29,30,19,7,35,8,9,10,46]),import.meta.url)},{id:`projects`,label:`项目`,menus:[[`all`,`全部项目`]],load:()=>_(()=>import(`./entry-DAnTlYgL.js`),__vite__mapDeps([47,1,2,31,32,18,19,33,6,23,29,8,9,10,34]),import.meta.url),contentNavigation:!0,note:`企业成员共享项目、任务与文档`},{id:`data`,label:`资料中心`,menus:[[`all`,`数据集目录`]],projectMenus:[[`data`,`项目数据`],[`files`,`证据附件`],[`wiki`,`分析复盘`],[`insight`,`结论行动`],[`methods`,`任务方法`],[`archive`,`分析任务`]],projectEntry:!0,load:()=>_(()=>import(`./entry-BNiO6CiP.js`),__vite__mapDeps([48,1,2,35,8,9,10]),import.meta.url),shopScope:!0,note:`仅展示当前账号获准的资料`}],C=S.map(e=>[e.id,e.label]),w=Object.fromEntries(S.map(e=>[e.id,e.menus]));function T(e){return S.find(t=>t.id===e)}function E(e){return T(e)?.menus[0]?.[0]||`overview`}function D(e){return T(e)?.label||`工作区`}var O=[`home`,`market`,`overview`,`products`,`projects`,`data`],k=[`overview`,`pipeline`,`work`,`methods`,`demand`,`monitor`,`optimization`,`finance`,`content`,`visual`,`publish`,`fulfillment`,`data`,`dashboard`,`wiki`,`insight`,`files`,`archive`],A={center:!0,centerNav:`home`,section:`overview`,projectId:``,tab:`overview`,step:0,node:``,itemId:``,datasetId:``,wikiRef:``,wikiEntry:``,methodNode:``,methodRecord:``},j={projectId:`project`,node:`node`,itemId:`item`,datasetId:`dataset`,wikiRef:`evidence`,wikiEntry:`record`,methodNode:`methodNode`,methodRecord:`method`};function M(e){let t=new URL(e,`https://omni.local`),n=t.searchParams,r={...A};for(let[e,t]of Object.entries(j))r[e]=(n.get(t)||``).slice(0,256);r.center=n.get(`mode`)===`center`||!n.has(`mode`)&&!r.projectId,O.some(e=>e===n.get(`view`))&&(r.centerNav=n.get(`view`)),k.some(e=>e===n.get(`tab`))&&(r.tab=n.get(`tab`));let i=Number(n.get(`step`));return r.step=Number.isInteger(i)&&i>=0&&i<6?i:0,t.pathname===`/market-overview`&&(r.center=!0,r.centerNav=`market`),t.pathname===`/archive-analysis`&&(r.center=!1,r.tab=`archive`),r.section=w[r.centerNav]?.some(([e])=>e===n.get(`section`))?n.get(`section`):E(r.centerNav),F(r)}function N(e){let t=new URLSearchParams({mode:e.center?`center`:`project`,view:e.centerNav,section:e.section,tab:e.tab});for(let[n,r]of Object.entries(j))e[n]&&t.set(r,e[n]);return e.step&&t.set(`step`,String(e.step)),`/?`+t.toString()}function P(e){return e.center?e.centerNav:S.find(t=>t.projectMenus?.some(([t])=>t===e.tab)||t.legacyTabs?.includes(e.tab))?.id||`projects`}function F(e){return!e.center&&P(e)===`projects`||e.center&&e.centerNav===`projects`?{...e,center:!0,centerNav:`projects`,section:`all`,tab:`overview`,step:0,node:``,itemId:``,datasetId:``,wikiRef:``,wikiEntry:``,methodNode:``,methodRecord:``}:e}var I=h(),te={home:v,market:e,overview:y,products:s,projects:t,data:p};function L({projects:e,project:t,route:r,menuOpen:i,busy:a,onClose:o,onProject:s,onCenter:c,onSection:l,onNavigate:u,onCreate:p}){(0,x.useEffect)(()=>{let e=e=>{let t=e.detail;C.some(([e])=>e===t)&&c(String(t))};return window.addEventListener(`omni:navigate`,e),()=>window.removeEventListener(`omni:navigate`,e)},[c]);let m=P(r),h=T(m),_=h?.projectMenus;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`nav`,{className:`ws-module-rail`,"aria-label":`主模块`,children:[(0,I.jsx)(`div`,{className:`ws-rail-mark`,children:(0,I.jsx)(`img`,{src:d,alt:`山海 · OMNI`,width:38,height:38,draggable:!1})}),C.map(([e,t])=>{let n=te[e];return(0,I.jsxs)(`button`,{"aria-label":t,"aria-current":m===e?`page`:void 0,onClick:()=>c(e),children:[(0,I.jsx)(n,{size:21}),(0,I.jsx)(`span`,{children:t})]},e)})]}),!(r.center&&h?.contentNavigation)&&(0,I.jsxs)(`aside`,{className:`wb-sidebar ws-sidebar ws-module-sidebar `+(i?`is-open`:``),"aria-label":D(m)+`菜单`,children:[(0,I.jsxs)(`div`,{className:`ws-module-heading`,children:[(0,I.jsx)(`strong`,{children:D(m)}),(0,I.jsx)(`button`,{className:`wb-mobile-close`,"aria-label":`关闭模块菜单`,onClick:o,children:(0,I.jsx)(g,{size:18})})]}),h?.shopScope&&(0,I.jsx)(f,{}),(0,I.jsx)(`nav`,{"aria-label":`模块导航`,children:(0,I.jsx)(`div`,{className:`wb-nav-group ws-context`,children:(w[m]||[]).map(([e,t])=>(0,I.jsxs)(`button`,{className:r.center&&r.section===e?`active`:``,"aria-current":r.center&&r.section===e?`page`:void 0,onClick:()=>l(e),children:[(0,I.jsx)(`span`,{children:t}),(0,I.jsx)(n,{size:14})]},e))})}),h?.projectPicker&&(0,I.jsxs)(`div`,{className:`ws-project`,children:[(0,I.jsxs)(`label`,{children:[`当前项目`,(0,I.jsxs)(`select`,{"aria-label":`当前项目`,value:t?.id||``,disabled:a,onChange:e=>s(e.target.value),children:[(0,I.jsx)(`option`,{value:``,children:`请选择项目`}),e.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),t&&(0,I.jsx)(`small`,{children:t.simulated?`模拟项目`:`资料项目 · 按来源核验`}),(0,I.jsx)(`button`,{className:`ws-new-project`,disabled:a,onClick:p,children:`+ 新建项目`})]}),_&&(0,I.jsx)(`nav`,{"aria-label":`项目功能`,children:(0,I.jsxs)(`div`,{className:`wb-nav-group ws-context`,children:[(0,I.jsx)(`p`,{children:t?.name||`项目内功能`}),_.map(([e,t])=>(0,I.jsx)(`button`,{disabled:a,className:!r.center&&r.tab===e?`active`:``,"aria-current":!r.center&&r.tab===e?`page`:void 0,onClick:()=>u(e),children:(0,I.jsx)(`span`,{children:t})},e))]})}),(0,I.jsx)(`p`,{className:`ws-module-note`,children:h?.note})]})]})}function ne({navigation:e,canGoBack:t,onBack:r,onOpenMenu:i,title:a,dirty:o,children:s}){let c=(0,x.useRef)(null),l=(0,x.useRef)(null);(0,x.useEffect)(()=>{let e=l.current;if(!e)return;let t=()=>{let t=getComputedStyle(e),n=t.position===`sticky`?(parseFloat(t.top)||0)+e.getBoundingClientRect().height:0;c.current?.style.setProperty(`--workspace-sticky-top`,`${n}px`)},n=new ResizeObserver(t);return n.observe(e),window.addEventListener(`resize`,t),t(),()=>{n.disconnect(),window.removeEventListener(`resize`,t)}},[]);let{route:u}=e,d=t&&!(u.center&&u.centerNav===`market`),f=u.center&&T(u.centerNav)?.contentNavigation;return(0,I.jsxs)(`main`,{ref:c,className:`wb-shell wb-unified wb-shared-nav`+(u.center?` wb-mission-home`:``)+(f?` ws-content-navigation`:``)+(u.center&&u.centerNav===`market`?` ws-market-content`:``),children:[(0,I.jsx)(`a`,{className:`wb-skip`,href:`#workspace-content`,children:`跳到工作区`}),(0,I.jsx)(L,{...e}),(0,I.jsxs)(`section`,{className:`main wb-main`,children:[(0,I.jsxs)(`header`,{ref:l,className:`wb-topbar`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`button`,{className:`wb-mobile-menu`,"aria-label":`打开导航`,onClick:i,children:(0,I.jsx)(b,{size:20})}),d&&(0,I.jsx)(`button`,{className:`wb-back`,"aria-label":`返回上一工作位置`,onClick:r,children:`← 返回`}),(0,I.jsx)(`span`,{children:u.center?`全局视图`:`项目工作区`}),(0,I.jsx)(n,{size:14}),(0,I.jsx)(`b`,{children:u.center?D(u.centerNav):a})]}),(0,I.jsx)(`div`,{children:o&&(0,I.jsx)(`span`,{className:`wb-chip warning`,children:`有未保存修改`})})]}),(0,I.jsxs)(`div`,{id:`workspace-content`,className:`wb-content`,tabIndex:-1,children:[s,(0,I.jsx)(`footer`,{children:`新品经营工作台 · 数据有来源,判断有版本,行动可追溯`})]})]})]})}var R=new Map(S.filter(e=>e.load).map(e=>[e.id,(0,x.lazy)(e.load)])),z=class extends x.Component{constructor(...e){super(...e),this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?(0,I.jsxs)(`section`,{role:`alert`,className:`card`,children:[(0,I.jsxs)(`h2`,{children:[this.props.label,`暂时无法打开`]}),(0,I.jsx)(`p`,{children:`可以重试,或从左侧进入其他模块。`}),(0,I.jsx)(`button`,{onClick:this.props.onRetry,children:`重试`})]}):(0,I.jsx)(`div`,{className:`ws-module-surface`,children:this.props.children})}};function B({moduleId:e,section:t,onSection:n,project:r,selectedId:i,children:a}){let o=T(e),[s,c]=(0,x.useState)(0),l=R.get(e);function u(){o?.load&&R.set(e,(0,x.lazy)(o.load)),c(e=>e+1)}return(0,I.jsx)(z,{label:o?.label||`模块`,onRetry:u,children:(0,I.jsx)(x.Suspense,{fallback:(0,I.jsxs)(`p`,{role:`status`,children:[`正在打开`,o?.label,`…`]}),children:l?(0,I.jsx)(l,{section:t,onSection:n,project:r,selectedId:i}):a})},`${e}:${r?.projectId||`center`}:${s}`)}function re(e,t=`web`){let n=typeof window<`u`&&!!window.omni,r=e=>e?.scope===t&&e.route?M(N(e.route)):null,[i,a]=(0,x.useState)(()=>typeof window>`u`?{...A}:r(window.history.state?.omniWorkspace)||M(window.location.href)),[o,s]=(0,x.useState)(!1),[c,l]=(0,x.useState)([]);function u(e){e.center&&e.centerNav===`home`||l(t=>[{route:{...e},at:new Date().toISOString()},...t.filter(t=>N(t.route)!==N(e))].slice(0,30))}let d=(0,x.useRef)(i),f=(0,x.useRef)(e),p=(0,x.useRef)(0),m=(0,x.useRef)(!1),h=(0,x.useRef)(new Map),g=(0,x.useRef)(null);f.current=e,d.current=i,(0,x.useEffect)(()=>{let e=window.history.state?.omniWorkspace,i=e?.scope===t?e:null;p.current=Number.isInteger(i?.index)?i.index:0,s(p.current>0),window.history.replaceState({...window.history.state,omniWorkspace:{scope:t,index:p.current,route:d.current}},``,n?window.location.pathname:N(d.current));let o=window.history.scrollRestoration;window.history.scrollRestoration=`manual`;let c=()=>{g.current===null&&h.current.set(p.current,window.scrollY)},l=e=>{if(m.current){m.current=!1;return}let i=e.state?.omniWorkspace,o=i?.scope===t?i.index:0;if(!f.current()){Number.isInteger(o)&&o!==p.current?(m.current=!0,window.history.go(p.current-o)):window.history.replaceState({omniWorkspace:{scope:t,index:p.current,route:d.current}},``,n?window.location.pathname:N(d.current));return}u(d.current),p.current=Number.isInteger(o)?o:0,g.current=h.current.get(p.current)||0,s(p.current>0),a(r(i)||(n?{...A}:M(window.location.href)))};return window.addEventListener(`popstate`,l),window.addEventListener(`scroll`,c,{passive:!0}),()=>{window.removeEventListener(`popstate`,l),window.removeEventListener(`scroll`,c),window.history.scrollRestoration=o}},[]),(0,x.useEffect)(()=>{if(g.current===null)return;let e=g.current,t=performance.now()+2500,n=0,r=()=>{cancelAnimationFrame(n),g.current=null},i=()=>{if(window.scrollTo(0,e),document.documentElement.scrollHeight-window.innerHeight>=e||performance.now()>t){g.current=null;return}n=requestAnimationFrame(i)};return n=requestAnimationFrame(i),window.addEventListener(`wheel`,r,{once:!0,passive:!0}),window.addEventListener(`pointerdown`,r,{once:!0}),()=>{cancelAnimationFrame(n),window.removeEventListener(`wheel`,r),window.removeEventListener(`pointerdown`,r)}},[i]);function _(e,r={}){let i=F({...d.current,...e});if(N(i)===N(d.current))return!0;if(!r.confirmed&&!f.current())return!1;u(d.current),h.current.set(p.current,window.scrollY),r.replace||(g.current=0),r.replace||p.current++;let o={...window.history.state,omniWorkspace:{scope:t,index:p.current,route:i}};return n?window.history[r.replace?`replaceState`:`pushState`](o,``):window.history[r.replace?`replaceState`:`pushState`](o,``,N(i)),d.current=i,a(i),s(p.current>0),!0}return{route:i,go:_,visits:c,canGoBack:o,back:()=>{p.current>0&&window.history.back()}}}async function V(e=``,t){let n=await fetch(`/api/workbench`+e,{method:t?`POST`:`GET`,headers:t?{"Content-Type":`application/json`}:{},body:t?JSON.stringify(t):void 0}),r=await n.json();if(!n.ok)throw Error(r.error||`操作失败`);return r}function H({historyScope:e=`web`}={}){return(0,I.jsx)(c,{children:(0,I.jsx)(U,{historyScope:e})})}function U({historyScope:e}){let[t,n]=(0,x.useState)([]),[s,c]=(0,x.useState)(null),[l,u]=(0,x.useState)(``),[d,f]=(0,x.useState)(``),[p,m]=(0,x.useState)(!1),[h,g]=(0,x.useState)(!1),[_,v]=(0,x.useState)(!1),[y,b]=(0,x.useState)(!1),[S,C]=(0,x.useState)(0);(0,x.useEffect)(()=>{let e=e=>C(e.detail);return window.addEventListener(`omni:writes`,e),()=>window.removeEventListener(`omni:writes`,e)},[]);let O=(0,x.useRef)(()=>!0),{route:k,go:A,back:j,canGoBack:F,visits:te}=re(()=>O.current(),e),{center:L,centerNav:R,tab:z,step:H,node:U,itemId:ie,datasetId:ae}=k,[W,oe]=(0,x.useState)(null),[se,G]=(0,x.useState)(!1),[K,q]=(0,x.useState)(!1),ce=r(),le=(0,x.useRef)(new Map),ue=te.map(e=>({...e,key:N(e.route),moduleLabel:D(P(e.route)),title:e.route.center?D(e.route.centerNav)+` · `+(w[e.route.centerNav]?.find(([t])=>t===e.route.section)?.[1]||`总览`):(t.find(t=>t.id===e.route.projectId)?.name||`项目`)+` · `+(i[e.route.tab]||`项目资料`)}));function de(e){A({center:!0,centerNav:P(k),section:e})&&g(!1)}let[fe,pe]=(0,x.useState)({tab:`overview`}),J=(0,x.useRef)(0),Y=y;function X(e=!0){return p||S?(f(`正在保存,请完成后再切换。`),!1):(Y||e&&K)&&!confirm(`当前有未保存修改,放弃修改并切换?`)?!1:(e&&K&&(q(!1),G(!1)),b(!1),!0)}function Z(e){!L&&e===z||(A({center:!1,tab:e,node:``,datasetId:``,wikiRef:``,wikiEntry:``,methodNode:``,methodRecord:``}),g(!1))}O.current=X;async function Q(){try{n(await V())}catch(e){u(e.message)}}(0,x.useEffect)(()=>{let e=e=>A(M(e.detail));return window.addEventListener(`omni:route`,e),()=>window.removeEventListener(`omni:route`,e)}),(0,x.useEffect)(()=>{Q()},[]),(0,x.useEffect)(()=>{if(L||!k.projectId){c(null);return}if(s?.project.id===k.projectId)return;let e=++J.current;return v(!0),u(``),V(`/`+encodeURIComponent(k.projectId)).then(t=>{e===J.current&&(c(t),oe({id:t.project.id,name:t.project.name}))}).catch(t=>{e===J.current&&(c(null),u(t.message))}).finally(()=>{e===J.current&&v(!1)}),()=>{J.current++}},[L,k.projectId]),(0,x.useEffect)(()=>{let e=e=>{O.current()||e.preventDefault()};return window.addEventListener(`omni:before-leave`,e),()=>window.removeEventListener(`omni:before-leave`,e)},[]),(0,x.useEffect)(()=>(window.dispatchEvent(new CustomEvent(`omni:workspace-safety`,{detail:{dirty:Y||K,busy:p||S}})),()=>{window.dispatchEvent(new CustomEvent(`omni:workspace-safety`,{detail:{dirty:!1,busy:!1}}))}),[Y,K,p,S]),(0,x.useEffect)(()=>{let e=e=>{(Y||K||p||S)&&(e.preventDefault(),e.returnValue=``)};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[Y,K,p,S]);function me(e){!L&&s&&pe({tab:z,step:H,node:U,itemId:ie,datasetId:ae}),le.current.set(P(k),{...k}),A(le.current.get(e)||{center:!0,centerNav:e,section:E(e),projectId:``})&&g(!1)}function he(){X()&&(G(!0),g(!1))}async function $(e,t,n=!1){if(!X())return;let r=t?.step??0;A({projectId:e,center:n,tab:t?.tab||`overview`,step:r,node:t?.node||``,itemId:t?.itemId||``,datasetId:t?.datasetId||``,wikiRef:``,wikiEntry:``,methodNode:``,methodRecord:``},{confirmed:!0}),u(``),f(``),g(!1),G(!1)}async function ge(){c(await V(`/`+s.project.id)),z!==`insight`&&b(!1),await Q()}return(0,I.jsxs)(ne,{navigation:{projects:t,project:s?.project,route:k,menuOpen:h,busy:p||_||!!S,onClose:()=>g(!1),onProject:e=>$(e,{tab:`overview`}),onCenter:me,onSection:de,onNavigate:Z,onCreate:he},canGoBack:F,onBack:j,onOpenMenu:()=>g(!0),title:z===`archive`?`分析任务`:i[z],dirty:Y||K,children:[l&&(0,I.jsx)(`div`,{role:`alert`,className:`error`,children:l}),d&&(0,I.jsx)(`div`,{role:`status`,className:`notice`,children:d}),se&&(0,I.jsx)(a,{api:V,onDirty:q,onBusy:m,onClose:()=>G(!1),onCreated:async(e,t)=>{await Q(),A({projectId:e,center:!1,tab:`overview`,step:0,node:``,itemId:``,datasetId:``,wikiRef:``,wikiEntry:``,methodNode:``,methodRecord:``},{confirmed:!0}),G(!1),q(!1),t&&f(t)}}),!L&&(_||k.projectId&&s?.project.id!==k.projectId&&!l)?(0,I.jsx)(`section`,{className:`card`,children:(0,I.jsx)(`p`,{role:`status`,children:`正在读取项目资料…`})}):L?(0,I.jsxs)(I.Fragment,{children:[W&&R!==`home`&&R!==`projects`&&(0,I.jsxs)(`p`,{className:`pn-return`,children:[(0,I.jsx)(`span`,{children:`当前查看全局资料`}),(0,I.jsxs)(`button`,{onClick:()=>$(W.id,fe),children:[`返回刚才项目:`,W.name]})]}),(0,I.jsx)(ee,{value:{layoutScope:e===`web`?void 0:e.split(`:`)[0],api:V,visits:ue,onGo:e=>{A(e)},onOpen:$,onModule:me,onCreate:he,onDirty:b,onBusy:m,onProductGroup:(e,t,n)=>{A({center:!0,centerNav:`products`,section:e})&&ce(t?.key,n)}},children:(0,I.jsx)(B,{moduleId:R,selectedId:k.projectId,section:k.section,onSection:(e,t)=>A({section:e},t)})})]}):s?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`wb-page-heading`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`wb-kicker`,children:i[z]}),(0,I.jsx)(`h1`,{children:s.project.name}),(0,I.jsxs)(`p`,{children:[(0,I.jsx)(`span`,{className:`wb-chip `+(s.project.simulated?`warning`:``),children:s.project.simulated?`模拟项目 · 非真实经营`:`资料项目 · 真实性按来源核验`}),(0,I.jsxs)(`span`,{className:`muted`,children:[`项目 `,s.project.id.slice(0,8),` · `,s.project.version,` 条阶段版本`]})]})]}),(0,I.jsxs)(`details`,{className:`wb-export-menu`,children:[(0,I.jsxs)(`summary`,{children:[(0,I.jsx)(o,{size:15}),` 导出资料`]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`a`,{href:`/api/workbench/`+s.project.id+`/wiki`,children:`分析 Wiki · Markdown`}),(0,I.jsx)(`a`,{href:`/api/workbench/`+s.project.id+`/export`,children:`完整项目资料包 · JSON`})]})]})]}),T(P(k))?.projectEntry&&(0,I.jsx)(B,{moduleId:P(k),section:z,onSection:e=>Z(e),project:{route:k,onRoute:(e,t)=>{A(e,t)},projectId:s.project.id,data:s,api:V,initialItemId:ie,dirty:y,onDirty:b,onBusy:m,onSaved:ge,onPrepare:()=>Z(`data`)}})]}):(0,I.jsxs)(`section`,{className:`card wb-menu-welcome`,children:[(0,I.jsxs)(`h1`,{children:[i[z],` · 先选择项目`]}),(0,I.jsxs)(`p`,{children:[`选好项目就会直接打开`,i[z],`。之后可在左侧直接切换功能。`]}),(0,I.jsxs)(`label`,{children:[`选择项目`,(0,I.jsxs)(`select`,{"aria-label":`主菜单选择项目`,value:``,onChange:e=>e.target.value&&$(e.target.value,{tab:z}),children:[(0,I.jsx)(`option`,{value:``,children:`请选择要处理的项目`}),t.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]})]})]})}export{H as default};
@@ -1 +0,0 @@
1
- import{_ as e,d as t,m as n,o as r}from"./index-BBySSIJT.js";var i=t(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),a=e(n(),1),o=r(),s=(0,a.createContext)(null);function c({children:e}){let t=(0,a.useRef)(new Map);return(0,o.jsx)(s.Provider,{value:t.current,children:e})}function l(e,t){let n=(0,a.useContext)(s),[r,i]=(0,a.useState)(()=>n?.has(e)?n.get(e):t);return[r,(0,a.useCallback)(t=>{i(r=>{let i=typeof t==`function`?t(r):t;return n?.set(e,i),i})},[n,e])]}export{l as n,i as r,c as t};
File without changes