@lumyne/omni-desktop-app 0.1.16 → 0.1.20
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.
- package/app/assets/{CartesianChart-CGNvk6St.js → CartesianChart-aa0EJ6w3.js} +1 -1
- package/app/assets/{CollaborationWorkspace-YQKm5DVb.js → CollaborationWorkspace-mIgLrpSm.js} +1 -1
- package/app/assets/{CompetitorAnalysis-BGZeiXTW.js → CompetitorAnalysis-Ct6wLjw6.js} +1 -1
- package/app/assets/EmptyState-CpQOdGYD.js +1 -0
- package/app/assets/{ErrorBarContext-BRHs6mfT.js → ErrorBarContext-BeuyujN4.js} +1 -1
- package/app/assets/{EvidenceSourceGuide-ByFna5T0.js → EvidenceSourceGuide-BeBcvVcI.js} +1 -1
- package/app/assets/{FavoritePicker-DLuTORpI.js → FavoritePicker-LfvebaXO.js} +1 -1
- package/app/assets/{Favorites-BL-1v7QD.js → Favorites-C6Xd2Vyz.js} +1 -1
- package/app/assets/{HelpTip-DaIyNCfF.js → HelpTip-BfrAVfV_.js} +1 -1
- package/app/assets/{LineChart-Dg6rxQct.js → LineChart-tppycNHl.js} +1 -1
- package/app/assets/{Opportunities-Dw5CnA2W.js → Opportunities-BfmikZ5o.js} +1 -1
- package/app/assets/{ProgressiveRows-DfUZC_6R.js → ProgressiveRows-CNmxc71t.js} +1 -1
- package/app/assets/{ShopLayoutPage-AkChJyxu.js → ShopLayoutPage-B943t2t1.js} +1 -1
- package/app/assets/{TrendChart-DURd5oGd.js → TrendChart-Doe6C5Aa.js} +1 -1
- package/app/assets/arrow-down-Dm8ejo47.js +1 -0
- package/app/assets/arrow-left-CrtjcWhu.js +1 -0
- package/app/assets/arrow-up-right-FAUwydEi.js +1 -0
- package/app/assets/{book-open-Bce54GC0.js → book-open-BHnwW_0N.js} +1 -1
- package/app/assets/{calendar-days-A-WQG43X.js → calendar-days-DQXKth-z.js} +1 -1
- package/app/assets/{chart-column-DueDyWTO.js → chart-column-B3ugUaKH.js} +1 -1
- package/app/assets/{chart-no-axes-combined-0SqHx_x6.js → chart-no-axes-combined-DbjiVuVa.js} +1 -1
- package/app/assets/check-B7m80-Hk.js +1 -0
- package/app/assets/chevron-down-9e3l9_Db.js +1 -0
- package/app/assets/chevron-right-DyOe1NsY.js +1 -0
- package/app/assets/{clock-3-BpHSopJF.js → clock-3-TXgD8tS6.js} +1 -1
- package/app/assets/{components-HGHI0_0I.js → components-DMbkJLkK.js} +2 -2
- package/app/assets/{download-Dsft-5wR.js → download-BMipQ3n8.js} +1 -1
- package/app/assets/entry-C4p4TKbJ.js +1 -0
- package/app/assets/{entry-TXFczQeM.js → entry-CGu91Jpg.js} +2 -2
- package/app/assets/{entry-CJFtoBLa.js → entry-CeW_5ZGi.js} +1 -1
- package/app/assets/{entry-CNxdnf29.js → entry-Cxj3NkyT.js} +3 -3
- package/app/assets/{entry-CZo_9EKi.js → entry-DcwBlAO0.js} +2 -2
- package/app/assets/{entry-DQEAnjCp.js → entry-aDwWfs__.js} +1 -1
- package/app/assets/{favorites.module-D06hxuat.js → favorites.module-CaTR2ido.js} +1 -1
- package/app/assets/{file-text-BpkjdOot.js → file-text-D6meDmAz.js} +1 -1
- package/app/assets/{getRadiusAndStrokeWidthFromDot-BX82bq7e.js → getRadiusAndStrokeWidthFromDot-zEte6bM_.js} +1 -1
- package/app/assets/{grid-2x2-Cb1v7yqK.js → grid-2x2-sRKLAhuD.js} +1 -1
- package/app/assets/{index-CShNDEcL.js → index-Dfy2jMWq.js} +2 -2
- package/app/assets/{layers-C4KI3Uxn.js → layers-B4gCFnEm.js} +1 -1
- package/app/assets/{layout-dashboard-CTmjmcDE.js → layout-dashboard-C54_ZKS5.js} +1 -1
- package/app/assets/{link-2-BrR_cwPw.js → link-2-CC7rgyRC.js} +1 -1
- package/app/assets/{list-Djz-XKts.js → list-DI2UZ46g.js} +1 -1
- package/app/assets/{module-host-rk0glcaW.js → module-host-BIy_fI1T.js} +1 -1
- package/app/assets/{orbit-Bw_YF8Ru.js → orbit-tMF8WRbG.js} +1 -1
- package/app/assets/{package-b8jiLApm.js → package-rnaOiBPn.js} +1 -1
- package/app/assets/play-DjZ3mG-r.js +1 -0
- package/app/assets/plus-_W4OFi32.js +1 -0
- package/app/assets/{products-DTLdF8-b.js → products-6S_LnOq6.js} +1 -1
- package/app/assets/{project-public-DQMVYsEz.js → project-public-B9DNEfwS.js} +1 -1
- package/app/assets/{project-public-CnKWSlv4.js → project-public-DN0-E_G2.js} +1 -1
- package/app/assets/public-Csb687JC.js +1 -0
- package/app/assets/{refresh-cw-BwEoF6sI.js → refresh-cw-CiIEylYp.js} +1 -1
- package/app/assets/search-DlLds8Ae.js +1 -0
- package/app/assets/{star-CjnKtEU7.js → star-CcsEzP_q.js} +1 -1
- package/app/assets/trending-up-CWfLLrC6.js +1 -0
- package/app/assets/{triangle-alert-3SxL0RNM.js → triangle-alert-CEMUxCrJ.js} +1 -1
- package/app/assets/{ui-public-4hoRHIFG.js → ui-public-DVwBGbKN.js} +1 -1
- package/app/assets/{workbench-DRbHsOSr.js → workbench-jvMSCBRw.js} +2 -2
- package/app/assets/{workspace-view-state-DRhGUGLj.js → workspace-view-state-BuK4-c0r.js} +1 -1
- package/app/desktop/main.mjs +10 -9
- package/app/index.html +1 -1
- package/app/tools/bootstrap.bin +0 -0
- package/package.json +1 -1
- package/release.json +1 -1
- package/release.sig +1 -1
- package/app/assets/EmptyState-BrzYB6Fm.js +0 -1
- package/app/assets/arrow-down-f54IiPCV.js +0 -1
- package/app/assets/arrow-left-D6ZJJ6TV.js +0 -1
- package/app/assets/arrow-up-right-D1eLXOum.js +0 -1
- package/app/assets/check-DpavxwQP.js +0 -1
- package/app/assets/chevron-down-DjHGm5jP.js +0 -1
- package/app/assets/chevron-right-D8cbEJBE.js +0 -1
- package/app/assets/entry-bIaBkZxY.js +0 -1
- package/app/assets/play-eKkJOouQ.js +0 -1
- package/app/assets/plus-CuQU-dIh.js +0 -1
- package/app/assets/public-D27wclc8.js +0 -1
- package/app/assets/search-BDEOXxcW.js +0 -1
- package/app/assets/trending-up-BPVwzUjj.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./TrendChart-
|
|
2
|
-
import{t as e}from"./chevron-down-DjHGm5jP.js";import{t}from"./chevron-right-D8cbEJBE.js";import{t as n}from"./search-BDEOXxcW.js";import{_ as r,c as i,l as a,p as o,r as s,v as c,x as l}from"./index-CShNDEcL.js";import{n as u}from"./workspace-view-state-DRhGUGLj.js";import"./public-D27wclc8.js";import{r as d,t as f}from"./format-B2iJpu8S.js";import{t as p}from"./market.module-MVB-GO7b.js";var m=[[`sales`,`销售额`,`money`],[`marketShare`,`市占率`,`percent`],[`views`,`浏览量`,`number`],[`conversionRate`,`支付转化率`,`percent`],[`unitPrice`,`件单价`,`money`],[`units`,`成交件数`,`number`],[`searches`,`搜索量`,`number`],[`searchShare`,`搜索量占比`,`percent`],[`paidClicks`,`付费点击量`,`number`],[`paidClickShare`,`付费点击量占比`,`percent`],[`listingDays`,`上架天数`,`number`],[`listedProducts`,`在榜商品数`,`number`],[`promotionRoi`,`推广 ROI`,`number`],[`uvValue`,`UV 价值`,`money`],[`viewValue`,`浏览价值`,`money`],[`orderPrice`,`客单价`,`money`],[`orders`,`成交订单数`,`number`],[`cartRate`,`加购率`,`percent`],[`salesYoy`,`销售额同比`,`percent`],[`salesMom`,`销售额环比`,`percent`],[`activeProducts`,`动销商品数`,`number`]],h={categoryId:``,month:``,view:`categories`,metric:`sales`,recentYear:!1,q:``,sort:`sales`,direction:`desc`,page:1,pageSize:100,minPrice:``,maxPrice:``};function g(e,t){return u(`market.`+e,t)}var _=l(c(),1),v=l(r(),1),y=i();function b({text:e,label:t,title:n,children:r}){let[i,a]=(0,_.useState)(!1),[s,c]=(0,_.useState)(``),l=(0,_.useRef)(null),u=(0,_.useRef)(0);(0,_.useEffect)(()=>()=>{u.current++,l.current&&clearTimeout(l.current)},[]);async function d(){let t=++u.current,n=`已复制`;try{if(window.omni){let t=await window.omni.copyText(e);if(!t.ok)throw Error(t.error)}else await navigator.clipboard.writeText(e);if(t!==u.current)return;a(!0)}catch{if(t!==u.current)return;n=`复制失败,请重试`,a(!1)}l.current&&clearTimeout(l.current),c(n),l.current=setTimeout(()=>c(``),1e3)}return(0,y.jsxs)(`span`,{className:p.copyControl,children:[(0,y.jsx)(`button`,{className:p.copyButton,"data-copied":i,"aria-label":t,title:n,onClick:()=>void d(),children:r||(0,y.jsx)(o,{size:12})}),s&&(0,y.jsx)(`span`,{className:p.copyFeedback,role:`status`,children:s})]})}function x({src:e,name:t,onClose:n}){let r=(0,_.useRef)(null),[i,o]=(0,_.useState)(!1);return(0,_.useEffect)(()=>{let e=document.activeElement;return r.current?.showModal(),()=>e?.focus()},[]),(0,v.createPortal)((0,y.jsxs)(`dialog`,{ref:r,className:p.imageViewer,"aria-label":`${t}大图`,onCancel:e=>{e.preventDefault(),n()},onClick:e=>{e.target===e.currentTarget&&n()},children:[(0,y.jsx)(`button`,{autoFocus:!0,className:p.imageViewerClose,"aria-label":`关闭商品大图`,onClick:n,children:(0,y.jsx)(a,{size:24})}),i?(0,y.jsx)(`p`,{role:`status`,children:`图片暂时无法加载`}):(0,y.jsx)(`img`,{src:e,alt:t,referrerPolicy:`no-referrer`,onError:()=>o(!0),onClick:e=>{let t=e.currentTarget,r=t.getBoundingClientRect();if(!t.naturalWidth||!t.naturalHeight)return;let i=Math.min(r.width/t.naturalWidth,r.height/t.naturalHeight),a=t.naturalWidth*i/2,o=t.naturalHeight*i/2;(Math.abs(e.clientX-r.left-r.width/2)>a||Math.abs(e.clientY-r.top-r.height/2)>o)&&n()}})]}),document.body)}function S({src:e,name:t,hoverPreview:n=!0}){let[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(!1);(0,_.useEffect)(()=>{if(!r)return;let e=()=>i(null);return window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[r]);function s(e){if(!n)return;let t=e.getBoundingClientRect(),r=Math.min(320,window.innerWidth-24,window.innerHeight-24);i({left:t.right+r+12<=window.innerWidth?t.right+8:Math.max(12,t.left-r-8),top:Math.max(12,Math.min(t.top,window.innerHeight-r-12)),size:r})}return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`button`,{className:p.imageButton,"aria-label":`放大查看${t}`,"aria-haspopup":`dialog`,onMouseEnter:e=>s(e.currentTarget),onMouseLeave:()=>i(null),onFocus:e=>s(e.currentTarget),onBlur:()=>i(null),onClick:()=>{i(null),o(!0)},children:(0,y.jsx)(`img`,{src:e,alt:t,loading:`lazy`,referrerPolicy:`no-referrer`})}),r&&!a&&(0,v.createPortal)((0,y.jsx)(`div`,{className:p.imageHoverPreview,"aria-hidden":`true`,style:{left:r.left,top:r.top,width:r.size,height:r.size},children:(0,y.jsx)(`img`,{src:e,alt:``,referrerPolicy:`no-referrer`})}),document.body),a&&(0,y.jsx)(x,{src:e,name:t,onClose:()=>{i(null),o(!1)}})]})}function C({title:e,children:t,onClose:n}){let r=(0,_.useRef)(null);return(0,_.useEffect)(()=>{let e=document.activeElement;return r.current?.showModal(),()=>e?.focus()},[]),(0,y.jsxs)(`dialog`,{ref:r,className:p.dialog,onCancel:n,onClick:e=>{e.target===e.currentTarget&&n()},children:[(0,y.jsxs)(`header`,{children:[(0,y.jsx)(`h2`,{children:e}),(0,y.jsx)(`button`,{autoFocus:!0,onClick:n,"aria-label":`关闭弹窗`,children:(0,y.jsx)(a,{size:18})})]}),t]})}function w({categories:e,onChoose:t,disabled:r}){let[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(!1),c=(0,_.useRef)(null),l=d(e,i);(0,_.useEffect)(()=>{let e=e=>{e.target instanceof Node&&!c.current?.contains(e.target)&&s(!1)};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[]);function u(e){t(e),a(``),s(!1),c.current?.querySelector(`input`)?.focus()}return(0,y.jsxs)(`div`,{ref:c,className:p.categorySearch,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||s(!1)},onKeyDown:e=>{e.key===`Escape`&&(s(!1),c.current?.querySelector(`input`)?.focus()),e.key===`ArrowDown`&&e.target instanceof HTMLInputElement&&(e.preventDefault(),c.current?.querySelector(`[data-category-result]`)?.focus()),e.key===`Enter`&&e.target instanceof HTMLInputElement&&l[0]&&(e.preventDefault(),u(l[0].id))},children:[(0,y.jsxs)(`label`,{className:p.search,children:[(0,y.jsx)(n,{size:14}),(0,y.jsx)(`input`,{type:`search`,"aria-label":`搜索类目`,placeholder:`搜索类目名称或ID`,maxLength:100,disabled:r,value:i,onFocus:()=>s(!0),onChange:e=>{a(e.target.value),s(!0)}})]}),o&&!!i.trim()&&(0,y.jsxs)(`section`,{className:p.categorySearchResults,"aria-label":`类目搜索结果`,children:[(0,y.jsx)(`p`,{role:`status`,children:l.length?`找到 ${l.length} 个类目${l.length>100?`,显示前100个,请继续输入缩小范围`:``}`:`没有匹配的获准类目`}),l.slice(0,100).map(t=>(0,y.jsx)(`button`,{"data-category-result":!0,onClick:()=>u(t.id),children:f(e,t.id).map(e=>e.name).join(` / `)},t.id))]})]})}function T({categories:r,value:i,onChoose:a,disabled:o,favoriteIds:s}){let[c,l]=(0,_.useState)(``),[u,d]=(0,_.useState)(``),[m,h]=(0,_.useState)(!1),[g,v]=(0,_.useState)(!1),b=(0,_.useRef)(null);(0,_.useEffect)(()=>{function e(e){let t=b.current;t?.open&&e.target instanceof Node&&!t.contains(e.target)&&(t.open=!1)}return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[]);let x=f(r,u||i),S=r.filter(e=>s.includes(e.id)),C=(m?S:r).filter(e=>e.name.includes(c.trim()));function w(e){a(e),l(``),d(e),b.current&&(b.current.open=!1)}let T=[r.filter(e=>!e.parentId),...x.filter(e=>!e.leaf).map(e=>r.filter(t=>t.parentId===e.id))];return(0,y.jsxs)(`details`,{className:p.picker,ref:b,onToggle:e=>v(e.currentTarget.open),onKeyDown:e=>{e.key===`Escape`&&b.current&&(b.current.open=!1,b.current.querySelector(`summary`)?.focus())},children:[(0,y.jsxs)(`summary`,{"aria-label":`选择市场类目`,"aria-disabled":o,onClick:e=>{o&&e.preventDefault()},children:[f(r,i).map(e=>e.name).join(` / `)||`全部类目`,(0,y.jsx)(e,{size:14})]}),g&&(0,y.jsxs)(`div`,{className:p.pickerPanel,children:[(0,y.jsxs)(`label`,{children:[(0,y.jsx)(n,{size:14}),(0,y.jsx)(`input`,{"aria-label":`查找授权类目`,placeholder:`搜索类目名称`,value:c,onChange:e=>l(e.target.value)})]}),(0,y.jsxs)(`nav`,{className:p.pickerModes,"aria-label":`类目选择方式`,children:[(0,y.jsx)(`button`,{"aria-pressed":!m,onClick:()=>h(!1),children:`全部类目`}),(0,y.jsxs)(`button`,{"aria-pressed":m,onClick:()=>h(!0),children:[`我的收藏(`,S.length,`)`]})]}),!m&&(0,y.jsx)(`button`,{onClick:()=>w(``),children:`全部获准类目`}),c.trim()||m?(0,y.jsxs)(`div`,{className:p.pickerResults,children:[!C.length&&(0,y.jsx)(`p`,{role:`status`,className:p.pickerEmpty,children:m&&!S.length?`暂无收藏类目,点击类目旁的星标即可收藏。`:`没有匹配的类目。`}),(m?C:C.slice(0,100)).map(e=>(0,y.jsx)(`button`,{onClick:()=>w(e.id),children:f(r,e.id).map(e=>e.name).join(` / `)},e.id))]}):(0,y.jsx)(`div`,{className:p.cascade,children:T.map((e,n)=>(0,y.jsx)(`div`,{children:e.map(e=>(0,y.jsxs)(`div`,{onPointerEnter:t=>{t.pointerType===`mouse`&&d(e.id)},className:x.some(t=>t.id===e.id)?p.selectedCategory:``,children:[(0,y.jsx)(`button`,{onClick:()=>w(e.id),children:e.name}),!e.leaf&&(0,y.jsx)(`button`,{"aria-label":`展开${e.name}`,"aria-expanded":x.some(t=>t.id===e.id),onClick:()=>d(e.id),children:(0,y.jsx)(t,{size:13})})]},e.id))},n))})]})]})}function E({columns:e,allowed:t,onSave:n,onClose:r}){let[i,a]=(0,_.useState)(e),[o,s]=(0,_.useState)(null),c=e=>m.find(t=>t[0]===e)?.[1];function l(e,t){a(n=>{let r=[...n],[i]=r.splice(e,1);return r.splice(t,0,i),r})}return(0,y.jsxs)(C,{title:`自定义数据字段(${i.length}/${t.length})`,onClose:r,children:[(0,y.jsxs)(`div`,{className:p.fieldLayout,children:[(0,y.jsxs)(`section`,{children:[(0,y.jsx)(`h3`,{children:`排行榜指标`}),t.map(e=>(0,y.jsxs)(`label`,{children:[(0,y.jsx)(`input`,{type:`checkbox`,checked:i.includes(e),onChange:t=>a(n=>t.target.checked?[...n,e]:n.filter(t=>t!==e))}),c(e)]},e))]}),(0,y.jsxs)(`section`,{children:[(0,y.jsxs)(`div`,{className:p.fieldTools,children:[(0,y.jsxs)(`span`,{children:[`已选 `,i.length,`/`,t.length]}),(0,y.jsx)(`button`,{onClick:()=>a(t),children:`恢复默认`}),(0,y.jsx)(`button`,{onClick:()=>a([]),children:`清空`})]}),(0,y.jsx)(`h3`,{children:`当前字段顺序`}),(0,y.jsx)(`ol`,{children:i.map((e,t)=>(0,y.jsxs)(`li`,{draggable:!0,onDragStart:()=>s(e),onDragOver:e=>e.preventDefault(),onDrop:()=>{o&&l(i.indexOf(o),t),s(null)},children:[(0,y.jsxs)(`span`,{children:[`⠿ `,t+1,`. `,c(e)]}),(0,y.jsx)(`button`,{disabled:t===0,"aria-label":`上移${c(e)}`,onClick:()=>l(t,t-1),children:`↑`}),(0,y.jsx)(`button`,{disabled:t===i.length-1,"aria-label":`下移${c(e)}`,onClick:()=>l(t,t+1),children:`↓`})]},e))})]})]}),(0,y.jsxs)(`footer`,{className:p.dialogActions,children:[(0,y.jsx)(`button`,{onClick:r,children:`取消`}),(0,y.jsx)(`button`,{className:p.primary,onClick:()=>n(i),children:`确定`})]})]})}var D=(0,_.lazy)(()=>s(()=>import(`./TrendChart-DURd5oGd.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url));function O(e){return(0,y.jsx)(_.Suspense,{fallback:(0,y.jsx)(`p`,{role:`status`,children:`正在加载趋势图…`}),children:(0,y.jsx)(D,{...e})})}export{C as a,h as c,b as i,g as l,w as n,S as o,E as r,O as s,T as t,m as u};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./TrendChart-Doe6C5Aa.js","./index-Dfy2jMWq.js","./index-DT6aELxD.css","./CartesianChart-aa0EJ6w3.js","./getRadiusAndStrokeWidthFromDot-zEte6bM_.js","./graphicalItemSelectors-DCiyiwSe.js","./format-B2iJpu8S.js","./market.module-MVB-GO7b.js","./market-BS0kvHW4.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./chevron-down-9e3l9_Db.js";import{t}from"./chevron-right-DyOe1NsY.js";import{t as n}from"./search-DlLds8Ae.js";import{_ as r,c as i,l as a,p as o,r as s,v as c,x as l}from"./index-Dfy2jMWq.js";import{n as u}from"./workspace-view-state-BuK4-c0r.js";import"./public-Csb687JC.js";import{r as d,t as f}from"./format-B2iJpu8S.js";import{t as p}from"./market.module-MVB-GO7b.js";var m=[[`sales`,`销售额`,`money`],[`marketShare`,`市占率`,`percent`],[`views`,`浏览量`,`number`],[`conversionRate`,`支付转化率`,`percent`],[`unitPrice`,`件单价`,`money`],[`units`,`成交件数`,`number`],[`searches`,`搜索量`,`number`],[`searchShare`,`搜索量占比`,`percent`],[`paidClicks`,`付费点击量`,`number`],[`paidClickShare`,`付费点击量占比`,`percent`],[`listingDays`,`上架天数`,`number`],[`listedProducts`,`在榜商品数`,`number`],[`promotionRoi`,`推广 ROI`,`number`],[`uvValue`,`UV 价值`,`money`],[`viewValue`,`浏览价值`,`money`],[`orderPrice`,`客单价`,`money`],[`orders`,`成交订单数`,`number`],[`cartRate`,`加购率`,`percent`],[`salesYoy`,`销售额同比`,`percent`],[`salesMom`,`销售额环比`,`percent`],[`activeProducts`,`动销商品数`,`number`]],h={categoryId:``,month:``,view:`categories`,metric:`sales`,recentYear:!1,q:``,sort:`sales`,direction:`desc`,page:1,pageSize:100,minPrice:``,maxPrice:``};function g(e,t){return u(`market.`+e,t)}var _=l(c(),1),v=l(r(),1),y=i();function b({text:e,label:t,title:n,children:r}){let[i,a]=(0,_.useState)(!1),[s,c]=(0,_.useState)(``),l=(0,_.useRef)(null),u=(0,_.useRef)(0);(0,_.useEffect)(()=>()=>{u.current++,l.current&&clearTimeout(l.current)},[]);async function d(){let t=++u.current,n=`已复制`;try{if(window.omni){let t=await window.omni.copyText(e);if(!t.ok)throw Error(t.error)}else await navigator.clipboard.writeText(e);if(t!==u.current)return;a(!0)}catch{if(t!==u.current)return;n=`复制失败,请重试`,a(!1)}l.current&&clearTimeout(l.current),c(n),l.current=setTimeout(()=>c(``),1e3)}return(0,y.jsxs)(`span`,{className:p.copyControl,children:[(0,y.jsx)(`button`,{className:p.copyButton,"data-copied":i,"aria-label":t,title:n,onClick:()=>void d(),children:r||(0,y.jsx)(o,{size:12})}),s&&(0,y.jsx)(`span`,{className:p.copyFeedback,role:`status`,children:s})]})}function x({src:e,name:t,onClose:n}){let r=(0,_.useRef)(null),[i,o]=(0,_.useState)(!1);return(0,_.useEffect)(()=>{let e=document.activeElement;return r.current?.showModal(),()=>e?.focus()},[]),(0,v.createPortal)((0,y.jsxs)(`dialog`,{ref:r,className:p.imageViewer,"aria-label":`${t}大图`,onCancel:e=>{e.preventDefault(),n()},onClick:e=>{e.target===e.currentTarget&&n()},children:[(0,y.jsx)(`button`,{autoFocus:!0,className:p.imageViewerClose,"aria-label":`关闭商品大图`,onClick:n,children:(0,y.jsx)(a,{size:24})}),i?(0,y.jsx)(`p`,{role:`status`,children:`图片暂时无法加载`}):(0,y.jsx)(`img`,{src:e,alt:t,referrerPolicy:`no-referrer`,onError:()=>o(!0),onClick:e=>{let t=e.currentTarget,r=t.getBoundingClientRect();if(!t.naturalWidth||!t.naturalHeight)return;let i=Math.min(r.width/t.naturalWidth,r.height/t.naturalHeight),a=t.naturalWidth*i/2,o=t.naturalHeight*i/2;(Math.abs(e.clientX-r.left-r.width/2)>a||Math.abs(e.clientY-r.top-r.height/2)>o)&&n()}})]}),document.body)}function S({src:e,name:t,hoverPreview:n=!0}){let[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(!1);(0,_.useEffect)(()=>{if(!r)return;let e=()=>i(null);return window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[r]);function s(e){if(!n)return;let t=e.getBoundingClientRect(),r=Math.min(320,window.innerWidth-24,window.innerHeight-24);i({left:t.right+r+12<=window.innerWidth?t.right+8:Math.max(12,t.left-r-8),top:Math.max(12,Math.min(t.top,window.innerHeight-r-12)),size:r})}return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`button`,{className:p.imageButton,"aria-label":`放大查看${t}`,"aria-haspopup":`dialog`,onMouseEnter:e=>s(e.currentTarget),onMouseLeave:()=>i(null),onFocus:e=>s(e.currentTarget),onBlur:()=>i(null),onClick:()=>{i(null),o(!0)},children:(0,y.jsx)(`img`,{src:e,alt:t,loading:`lazy`,referrerPolicy:`no-referrer`})}),r&&!a&&(0,v.createPortal)((0,y.jsx)(`div`,{className:p.imageHoverPreview,"aria-hidden":`true`,style:{left:r.left,top:r.top,width:r.size,height:r.size},children:(0,y.jsx)(`img`,{src:e,alt:``,referrerPolicy:`no-referrer`})}),document.body),a&&(0,y.jsx)(x,{src:e,name:t,onClose:()=>{i(null),o(!1)}})]})}function C({title:e,children:t,onClose:n}){let r=(0,_.useRef)(null);return(0,_.useEffect)(()=>{let e=document.activeElement;return r.current?.showModal(),()=>e?.focus()},[]),(0,y.jsxs)(`dialog`,{ref:r,className:p.dialog,onCancel:n,onClick:e=>{e.target===e.currentTarget&&n()},children:[(0,y.jsxs)(`header`,{children:[(0,y.jsx)(`h2`,{children:e}),(0,y.jsx)(`button`,{autoFocus:!0,onClick:n,"aria-label":`关闭弹窗`,children:(0,y.jsx)(a,{size:18})})]}),t]})}function w({categories:e,onChoose:t,disabled:r}){let[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(!1),c=(0,_.useRef)(null),l=d(e,i);(0,_.useEffect)(()=>{let e=e=>{e.target instanceof Node&&!c.current?.contains(e.target)&&s(!1)};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[]);function u(e){t(e),a(``),s(!1),c.current?.querySelector(`input`)?.focus()}return(0,y.jsxs)(`div`,{ref:c,className:p.categorySearch,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||s(!1)},onKeyDown:e=>{e.key===`Escape`&&(s(!1),c.current?.querySelector(`input`)?.focus()),e.key===`ArrowDown`&&e.target instanceof HTMLInputElement&&(e.preventDefault(),c.current?.querySelector(`[data-category-result]`)?.focus()),e.key===`Enter`&&e.target instanceof HTMLInputElement&&l[0]&&(e.preventDefault(),u(l[0].id))},children:[(0,y.jsxs)(`label`,{className:p.search,children:[(0,y.jsx)(n,{size:14}),(0,y.jsx)(`input`,{type:`search`,"aria-label":`搜索类目`,placeholder:`搜索类目名称或ID`,maxLength:100,disabled:r,value:i,onFocus:()=>s(!0),onChange:e=>{a(e.target.value),s(!0)}})]}),o&&!!i.trim()&&(0,y.jsxs)(`section`,{className:p.categorySearchResults,"aria-label":`类目搜索结果`,children:[(0,y.jsx)(`p`,{role:`status`,children:l.length?`找到 ${l.length} 个类目${l.length>100?`,显示前100个,请继续输入缩小范围`:``}`:`没有匹配的获准类目`}),l.slice(0,100).map(t=>(0,y.jsx)(`button`,{"data-category-result":!0,onClick:()=>u(t.id),children:f(e,t.id).map(e=>e.name).join(` / `)},t.id))]})]})}function T({categories:r,value:i,onChoose:a,disabled:o,favoriteIds:s}){let[c,l]=(0,_.useState)(``),[u,d]=(0,_.useState)(``),[m,h]=(0,_.useState)(!1),[g,v]=(0,_.useState)(!1),b=(0,_.useRef)(null);(0,_.useEffect)(()=>{function e(e){let t=b.current;t?.open&&e.target instanceof Node&&!t.contains(e.target)&&(t.open=!1)}return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[]);let x=f(r,u||i),S=r.filter(e=>s.includes(e.id)),C=(m?S:r).filter(e=>e.name.includes(c.trim()));function w(e){a(e),l(``),d(e),b.current&&(b.current.open=!1)}let T=[r.filter(e=>!e.parentId),...x.filter(e=>!e.leaf).map(e=>r.filter(t=>t.parentId===e.id))];return(0,y.jsxs)(`details`,{className:p.picker,ref:b,onToggle:e=>v(e.currentTarget.open),onKeyDown:e=>{e.key===`Escape`&&b.current&&(b.current.open=!1,b.current.querySelector(`summary`)?.focus())},children:[(0,y.jsxs)(`summary`,{"aria-label":`选择市场类目`,"aria-disabled":o,onClick:e=>{o&&e.preventDefault()},children:[f(r,i).map(e=>e.name).join(` / `)||`全部类目`,(0,y.jsx)(e,{size:14})]}),g&&(0,y.jsxs)(`div`,{className:p.pickerPanel,children:[(0,y.jsxs)(`label`,{children:[(0,y.jsx)(n,{size:14}),(0,y.jsx)(`input`,{"aria-label":`查找授权类目`,placeholder:`搜索类目名称`,value:c,onChange:e=>l(e.target.value)})]}),(0,y.jsxs)(`nav`,{className:p.pickerModes,"aria-label":`类目选择方式`,children:[(0,y.jsx)(`button`,{"aria-pressed":!m,onClick:()=>h(!1),children:`全部类目`}),(0,y.jsxs)(`button`,{"aria-pressed":m,onClick:()=>h(!0),children:[`我的收藏(`,S.length,`)`]})]}),!m&&(0,y.jsx)(`button`,{onClick:()=>w(``),children:`全部获准类目`}),c.trim()||m?(0,y.jsxs)(`div`,{className:p.pickerResults,children:[!C.length&&(0,y.jsx)(`p`,{role:`status`,className:p.pickerEmpty,children:m&&!S.length?`暂无收藏类目,点击类目旁的星标即可收藏。`:`没有匹配的类目。`}),(m?C:C.slice(0,100)).map(e=>(0,y.jsx)(`button`,{onClick:()=>w(e.id),children:f(r,e.id).map(e=>e.name).join(` / `)},e.id))]}):(0,y.jsx)(`div`,{className:p.cascade,children:T.map((e,n)=>(0,y.jsx)(`div`,{children:e.map(e=>(0,y.jsxs)(`div`,{onPointerEnter:t=>{t.pointerType===`mouse`&&d(e.id)},className:x.some(t=>t.id===e.id)?p.selectedCategory:``,children:[(0,y.jsx)(`button`,{onClick:()=>w(e.id),children:e.name}),!e.leaf&&(0,y.jsx)(`button`,{"aria-label":`展开${e.name}`,"aria-expanded":x.some(t=>t.id===e.id),onClick:()=>d(e.id),children:(0,y.jsx)(t,{size:13})})]},e.id))},n))})]})]})}function E({columns:e,allowed:t,onSave:n,onClose:r}){let[i,a]=(0,_.useState)(e),[o,s]=(0,_.useState)(null),c=e=>m.find(t=>t[0]===e)?.[1];function l(e,t){a(n=>{let r=[...n],[i]=r.splice(e,1);return r.splice(t,0,i),r})}return(0,y.jsxs)(C,{title:`自定义数据字段(${i.length}/${t.length})`,onClose:r,children:[(0,y.jsxs)(`div`,{className:p.fieldLayout,children:[(0,y.jsxs)(`section`,{children:[(0,y.jsx)(`h3`,{children:`排行榜指标`}),t.map(e=>(0,y.jsxs)(`label`,{children:[(0,y.jsx)(`input`,{type:`checkbox`,checked:i.includes(e),onChange:t=>a(n=>t.target.checked?[...n,e]:n.filter(t=>t!==e))}),c(e)]},e))]}),(0,y.jsxs)(`section`,{children:[(0,y.jsxs)(`div`,{className:p.fieldTools,children:[(0,y.jsxs)(`span`,{children:[`已选 `,i.length,`/`,t.length]}),(0,y.jsx)(`button`,{onClick:()=>a(t),children:`恢复默认`}),(0,y.jsx)(`button`,{onClick:()=>a([]),children:`清空`})]}),(0,y.jsx)(`h3`,{children:`当前字段顺序`}),(0,y.jsx)(`ol`,{children:i.map((e,t)=>(0,y.jsxs)(`li`,{draggable:!0,onDragStart:()=>s(e),onDragOver:e=>e.preventDefault(),onDrop:()=>{o&&l(i.indexOf(o),t),s(null)},children:[(0,y.jsxs)(`span`,{children:[`⠿ `,t+1,`. `,c(e)]}),(0,y.jsx)(`button`,{disabled:t===0,"aria-label":`上移${c(e)}`,onClick:()=>l(t,t-1),children:`↑`}),(0,y.jsx)(`button`,{disabled:t===i.length-1,"aria-label":`下移${c(e)}`,onClick:()=>l(t,t+1),children:`↓`})]},e))})]})]}),(0,y.jsxs)(`footer`,{className:p.dialogActions,children:[(0,y.jsx)(`button`,{onClick:r,children:`取消`}),(0,y.jsx)(`button`,{className:p.primary,onClick:()=>n(i),children:`确定`})]})]})}var D=(0,_.lazy)(()=>s(()=>import(`./TrendChart-Doe6C5Aa.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url));function O(e){return(0,y.jsx)(_.Suspense,{fallback:(0,y.jsx)(`p`,{role:`status`,children:`正在加载趋势图…`}),children:(0,y.jsx)(D,{...e})})}export{C as a,h as c,b as i,g as l,w as n,S as o,E as r,O as s,T as t,m as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e}from"./index-
|
|
1
|
+
import{h as e}from"./index-Dfy2jMWq.js";var t=e(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./CollaborationWorkspace-mIgLrpSm.js";import{c as t}from"./index-Dfy2jMWq.js";var n=t();function r({selectedId:t,project:r}){let i=t||r?.projectId;return(0,n.jsx)(e,{initialProjectId:i},i||`directory`)}export{r as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./project-public-
|
|
2
|
-
import{n as e}from"./clock-3-BpHSopJF.js";import{t}from"./chevron-right-D8cbEJBE.js";import{i as n,n as r,r as i,t as a}from"./products-DTLdF8-b.js";import{t as o}from"./layers-C4KI3Uxn.js";import{t as s}from"./refresh-cw-BwEoF6sI.js";import{t as c}from"./search-BDEOXxcW.js";import{c as l,h as u,l as d,r as f,s as p,v as m,x as h}from"./index-CShNDEcL.js";import{n as g}from"./module-host-rk0glcaW.js";import{n as _}from"./workspace-view-state-DRhGUGLj.js";import"./public-D27wclc8.js";import{t as v}from"./group-DIi_QccB.js";var y=u(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),b=h(m(),1);async function x(e){let t=await e(`/growth-center`);if(!t||!Array.isArray(t.products)||typeof t.updatedAt!=`string`||t.products.some(e=>!e||typeof e.key!=`string`||typeof e.itemId!=`string`||typeof e.project!=`string`||!Array.isArray(e.series)||e.series.some(e=>!e||!Array.isArray(e.points))))throw Error(`商品资料返回格式异常`);return t}function S(e){let[t,n]=(0,b.useState)(null),[r,i]=(0,b.useState)(``),[a,o]=(0,b.useState)(!0),s=(0,b.useRef)(0),c=(0,b.useRef)(!1),l=(0,b.useCallback)(()=>{let t=++s.current;return x(e).then(e=>c.current&&s.current===t?(n(e),i(``),!0):!1).catch(e=>(c.current&&s.current===t&&(n(null),i(e instanceof Error?e.message:`商品资料读取失败`)),!1)).finally(()=>{c.current&&s.current===t&&o(!1)})},[e]),u=(0,b.useCallback)(()=>(o(!0),i(``),l()),[l]);return(0,b.useEffect)(()=>(c.current=!0,l(),()=>{c.current=!1}),[l]),{data:t,error:r,loading:a,refresh:u}}var C=[{id:`test`,n:`03`,name:`新品测试`,caption:`运营策略 · 测试`,color:`var(--omni-chart-primary,#6fa7ff)`,goal:`少量投入,找到有人喜欢的商品`,cadence:`推广每天看 · 商品每5天看`,rule:`同品类、同属性、同材质一起测。对照店里第二梯队头部商品:低的继续跑,中的进入孵化候选,高的进一步评估。`,action:`查看点击、加购表现,筛选候选商品。`},{id:`incubate`,n:`02`,name:`持续孵化`,caption:`运营策略 · 培养`,color:`var(--omni-chart-secondary,#b99aff)`,goal:`培养潜力款,让成熟商品赚钱`,cadence:`新品每5天看 · 老品每7天看`,rule:`新商品看加购率与转化率;成熟商品看付费占比。低的放大,高的调整计划或暂停,同时优化主图、视频等。`,action:`区分赚钱款与潜力款,安排下一轮优化。`},{id:`scale`,n:`01`,name:`重点推广`,caption:`运营策略 · 放大`,color:`var(--omni-chart-teal,#44cdb5)`,goal:`集中资源,持续增加付款人数`,cadence:`推广每30–60分钟看 · 商品每天看`,rule:`拉新看点击成本、加购成本;收割看点击成本、成交成本。调整差计划,把预算分配给同类好计划;没有合适计划就新建测试。`,action:`查看广告计划,按老师给企业制定的标准处理。`}],w={unassigned:`待分组`,test:`新品测试`,incubate:`持续孵化`,scale:`重点推广`},T=e=>typeof e==`number`?e.toLocaleString(`zh-CN`,{maximumFractionDigits:2}):`—`;function E(e,t){return e.filter(e=>t===`stored-demo`?e.mode===`simulated`:e.mode!==`simulated`)}function D(e,t,n){let r=n.trim().toLowerCase();return e.filter(e=>(t===`all`||e.tier===t)&&`${e.itemId} ${e.projectName} ${e.title||``} ${e.shopName||``}`.toLowerCase().includes(r))}function O(e,t){return e.find(e=>e.key===t)||e[0]}var k=l();function A({series:e}){if(!e?.points.length)return(0,k.jsx)(`div`,{className:`gw-chart-empty`,children:`选择商品后,查看已有数据趋势。`});let t=e.points.slice(-30),n=t.flatMap(e=>e.value===null?[]:[e.value]),r=n.length?Math.min(...n):0,i=n.length?Math.max(...n):1,a=(e,n)=>[32+n*636/Math.max(1,t.length-1),150-((e.value??r)-r)/(i-r||1)*115],o=null,s=[];return t.forEach((t,n)=>{if(t.value===null){o=null;return}let[r,i]=a(t,n);o&&Date.parse(t.date)-Date.parse(o.date)===864e5&&s.push((0,k.jsx)(`line`,{x1:o.x,y1:o.y,x2:r,y2:i},`l`+n)),s.push((0,k.jsx)(`circle`,{cx:r,cy:i,r:`3`,children:(0,k.jsxs)(`title`,{children:[t.date,`:`,T(t.value),` `,e.unit]})},`p`+n)),o={x:r,y:i,date:t.date}}),(0,k.jsxs)(`div`,{className:`gw-chart`,children:[(0,k.jsxs)(`svg`,{viewBox:`0 0 700 185`,role:`img`,"aria-label":`${e.name}最近${t.length}个归档日期的趋势,缺失日期不连线`,children:[(0,k.jsx)(`defs`,{children:(0,k.jsxs)(`linearGradient`,{id:`product-chart-bg`,x1:`0`,x2:`0`,y1:`0`,y2:`1`,children:[(0,k.jsx)(`stop`,{stopColor:`var(--omni-chart-teal,#4cd5af)`,stopOpacity:`.1`}),(0,k.jsx)(`stop`,{offset:`1`,stopColor:`var(--omni-chart-teal,#4cd5af)`,stopOpacity:`0`})]})}),(0,k.jsx)(`rect`,{x:`30`,y:`20`,width:`640`,height:`145`,fill:`url(#product-chart-bg)`}),[35,92,150].map(e=>(0,k.jsx)(`line`,{x1:`30`,x2:`670`,y1:e,y2:e,className:`grid`},e)),(0,k.jsx)(`g`,{className:`plot`,children:s}),(0,k.jsx)(`text`,{x:`32`,y:`178`,children:t[0]?.date}),(0,k.jsx)(`text`,{x:`668`,y:`178`,textAnchor:`end`,children:t.at(-1)?.date}),(0,k.jsxs)(`text`,{x:`32`,y:`16`,children:[T(i),` `,e.unit]})]}),(0,k.jsx)(`span`,{children:`最近最多30个归档日期 · 缺失不补零 · 不同日期不汇总`})]})}function j({product:t,metricKey:n,onMetric:r,onGroup:i,onTask:o,onOpen:s}){if(!t)return(0,k.jsx)(`div`,{className:`gw-empty`,children:`选择商品查看趋势与后续操作。`});let c=t.series.find(e=>e.key===n)||t.series.find(e=>e.metric===`buyers`)||t.series[0],l=C.find(e=>e.id===t.tier);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{className:`gw-selected-product`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(a,{product:t}),(0,k.jsx)(`span`,{className:`gw-tag `+t.tier,children:w[t.tier]})]}),(0,k.jsxs)(`button`,{onClick:()=>i(t),children:[(0,k.jsx)(y,{size:14}),`分组`]})]}),(0,k.jsxs)(`div`,{className:`gw-metric-selector`,children:[(0,k.jsx)(`select`,{"aria-label":`商品趋势指标`,value:c?.key||``,onChange:e=>r(e.target.value),children:t.series.map(e=>(0,k.jsxs)(`option`,{value:e.key,children:[e.name,` · `,e.unit||`原始单位`]},e.key))}),(0,k.jsxs)(`strong`,{children:[T(c?.points.at(-1)?.value),(0,k.jsx)(`small`,{children:c?.unit})]}),(0,k.jsxs)(`span`,{children:[`最后统计日:`,c?.points.at(-1)?.date||`—`]})]}),(0,k.jsx)(A,{series:c}),(0,k.jsxs)(`details`,{className:`gw-points`,children:[(0,k.jsx)(`summary`,{children:`查看每日原值与来源`}),(0,k.jsx)(`div`,{className:`gw-table-scroll`,children:(0,k.jsxs)(`table`,{children:[(0,k.jsx)(`thead`,{children:(0,k.jsxs)(`tr`,{children:[(0,k.jsx)(`th`,{children:`日期`}),(0,k.jsx)(`th`,{children:`原值`}),(0,k.jsx)(`th`,{children:`来源`})]})}),(0,k.jsx)(`tbody`,{children:c?.points.slice(-30).map(e=>(0,k.jsxs)(`tr`,{children:[(0,k.jsx)(`td`,{children:e.date}),(0,k.jsx)(`td`,{children:T(e.value)}),(0,k.jsx)(`td`,{children:(0,k.jsx)(`a`,{href:`/api/workbench/`+t.project+`/file/`+e.fileId,children:`原始归档`})})]},e.date))})]})})]}),(0,k.jsxs)(`div`,{className:`gw-next`,children:[(0,k.jsx)(`span`,{children:`NEXT / 下一步`}),(0,k.jsx)(`h3`,{children:l?.action||`先选择这个商品的运营策略`}),(0,k.jsxs)(`p`,{children:[l?.cadence||`分组后查看对应检查频率和处理办法。`,t.note&&` · `+t.note]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`button`,{onClick:()=>o(t),children:`查看当前任务`}),(0,k.jsxs)(`button`,{className:`gw-primary`,onClick:()=>s(t.project,{tab:`monitor`,itemId:t.itemId}),children:[`查看监控与取数 `,(0,k.jsx)(e,{size:13})]}),(0,k.jsx)(`button`,{onClick:()=>s(t.project,{tab:`optimization`,itemId:t.itemId}),children:`商品优化`})]})]}),(0,k.jsx)(`p`,{className:`gw-detail-note`,children:`展示本项目归档的商品指标。点击率、加购率、计划成本等尚未汇入此表;请到来源数据中核对。`})]})}function M({section:e,onSection:l}){let u=g(),{data:d,error:f,loading:p,refresh:m}=S(u.api),h=u.archiveScope||`real`,[y,x]=_(`products.query`,``),[T,A]=_(`products.key`,``),[M,N]=_(`products.metric`,``),[P,F]=(0,b.useState)(``),[I,L]=(0,b.useState)(null),[R,z]=(0,b.useState)(null),B=(0,b.useRef)(null),V=e===`all`||w[e]?e:`all`,H=E(d?.products||[],h),U=D(H,V,y),W=O(U,T);function G(e){A(e.key),N(``),F(``)}function K(e,t){if(t===`work`){z(e);return}t===`data`?(l(`all`),x(``),G(e),requestAnimationFrame(()=>{B.current?.scrollIntoView({behavior:`smooth`,block:`start`}),B.current?.focus({preventScroll:!0})})):u.onOpen(e.project,{tab:t,itemId:e.itemId})}return(0,k.jsx)(`div`,{className:`products-module`,children:(0,k.jsx)(`div`,{className:`gw`,children:(0,k.jsxs)(`div`,{className:`gw-body`,children:[(0,k.jsxs)(`header`,{className:`gw-header`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`small`,{children:`商品 / 商品看板`}),(0,k.jsx)(`h1`,{children:`从测试到重点推广`})]}),(0,k.jsxs)(`div`,{className:`gw-header-actions`,children:[(0,k.jsxs)(`span`,{children:[(0,k.jsx)(`i`,{className:`gw-dot`}),`归档数据 · 非实时`]}),(0,k.jsxs)(`button`,{onClick:()=>void m(),disabled:p,children:[(0,k.jsx)(s,{size:14}),p?`读取中`:`刷新数据`]})]})]}),(0,k.jsx)(`div`,{className:`gw-scope`,children:(0,k.jsx)(`span`,{children:d?`${new Date(d.updatedAt).toLocaleString(`zh-CN`)} 读取归档`:p?`正在读取归档…`:`商品资料未就绪`})}),f&&(0,k.jsxs)(`p`,{role:`alert`,className:`gw-message`,children:[f,` `,(0,k.jsx)(`button`,{onClick:()=>void m(),children:`重试`})]}),P&&(0,k.jsx)(`p`,{role:`status`,className:`gw-message`,children:P}),(0,k.jsx)(n,{products:H,tiers:C,ready:!!d&&!p,onAction:K,onAssign:(e,t)=>L({product:e,suggestedTier:t})}),R&&(0,k.jsx)(i,{product:R,onOpen:u.onOpen,onClose:()=>z(null)}),I&&(0,k.jsx)(r,{...I,products:H,onDirty:u.onDirty,onBusy:u.onBusy,onClose:()=>L(null),onSave:async(e,t,n,r)=>{await v(u.api,e,t,n,r),F(await m()?`分组已保存,看板已更新。`:`分组已保存,但看板读取失败,请刷新后查看。`)}}),(0,k.jsxs)(`div`,{className:`gw-operating`,children:[(0,k.jsxs)(`section`,{className:`gw-panel gw-products`,children:[(0,k.jsxs)(`div`,{className:`gw-section-title`,children:[(0,k.jsx)(`h2`,{children:`商品工作清单`}),(0,k.jsxs)(`span`,{children:[U.length,` 个观察对象`]})]}),(0,k.jsxs)(`div`,{className:`gw-filters`,children:[(0,k.jsxs)(`label`,{children:[(0,k.jsx)(c,{size:14}),(0,k.jsx)(`input`,{"aria-label":`搜索经营商品`,placeholder:`搜索商品ID或项目`,value:y,onChange:e=>x(e.target.value)})]}),(0,k.jsxs)(`select`,{"aria-label":`商品运营分组`,value:V,onChange:e=>{l(e.target.value),A(``)},children:[(0,k.jsx)(`option`,{value:`all`,children:`全部运营分组`}),Object.entries(w).map(([e,t])=>(0,k.jsx)(`option`,{value:e,children:t},e))]})]}),V!==`all`&&(0,k.jsxs)(`div`,{className:`gw-rule`,children:[(0,k.jsx)(`b`,{children:w[V]}),(0,k.jsx)(`p`,{children:C.find(e=>e.id===V)?.rule||`选择商品后确认分组。归档记录不能直接证明商品属于哪个梯队。`})]}),(0,k.jsx)(`div`,{className:`gw-table-scroll`,children:(0,k.jsxs)(`table`,{children:[(0,k.jsx)(`thead`,{children:(0,k.jsxs)(`tr`,{children:[(0,k.jsx)(`th`,{children:`商品 / 所属项目`}),(0,k.jsx)(`th`,{children:`当前运营分组`}),(0,k.jsx)(`th`,{children:`已有指标`}),(0,k.jsx)(`th`,{children:`操作`})]})}),(0,k.jsx)(`tbody`,{children:U.map(e=>(0,k.jsxs)(`tr`,{className:W?.key===e.key?`selected`:``,children:[(0,k.jsx)(`td`,{children:(0,k.jsx)(a,{product:e})}),(0,k.jsx)(`td`,{children:(0,k.jsx)(`span`,{className:`gw-tag `+e.tier,children:w[e.tier]})}),(0,k.jsxs)(`td`,{children:[e.series.length,` 项`,(0,k.jsx)(`small`,{children:e.series.map(e=>e.name).slice(0,2).join(` / `)})]}),(0,k.jsx)(`td`,{children:(0,k.jsxs)(`button`,{"aria-label":`查看商品 `+e.itemId+` `+e.projectName,onClick:()=>G(e),children:[`查看 `,(0,k.jsx)(t,{size:12})]})})]},e.key))})]})}),!U.length&&(0,k.jsxs)(`div`,{className:`gw-empty`,children:[(0,k.jsx)(o,{size:29}),(0,k.jsx)(`b`,{children:f?`商品资料读取失败`:p?`正在读取商品…`:y?`没有匹配的商品`:`这个分组还没有商品`}),(0,k.jsx)(`p`,{children:`切换到“待分组”确认商品运营分组,或从项目监控中归档商品数据。`}),(0,k.jsx)(`button`,{onClick:()=>{x(``),l(`unassigned`)},children:`查看待分组`}),(0,k.jsx)(`button`,{onClick:()=>u.onModule(`projects`),children:`进入项目执行`})]})]}),(0,k.jsxs)(`section`,{ref:B,tabIndex:-1,className:`gw-panel gw-product-detail`,children:[(0,k.jsxs)(`div`,{className:`gw-section-title`,children:[(0,k.jsx)(`h2`,{children:`商品数据与下一步`}),(0,k.jsx)(`span`,{children:`点表格切换`})]}),(0,k.jsx)(j,{product:W,metricKey:M,onMetric:N,onGroup:e=>L({product:e}),onTask:z,onOpen:u.onOpen})]})]}),(0,k.jsx)(`p`,{className:`gw-detail-note`,children:`这里的“新品测试、持续孵化、重点推广”是人工保存的运营策略,不是按全店支付销售额贡献、访客和支付买家核验的第一、二、三梯队。切换分组不会自动投放或改变经营梯队。`}),(0,k.jsxs)(`footer`,{className:`gw-footer`,children:[(0,k.jsx)(`span`,{children:`规则来源:店铺链接 AI 自动化孵化与打爆`}),(0,k.jsxs)(`details`,{children:[(0,k.jsx)(`summary`,{children:`检查频率与执行状态说明`}),(0,k.jsx)(`p`,{children:`运营策略卡片展示原方案的建议检查频率,不表示调度已启用。老师结合企业数据制定具体判断标准;本页支持归档查询、趋势查看和分组保存。广告计划的建立、暂停及预算调整尚未在本页接通。`})]})]})]})})})}function N(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function P(e){return typeof e==`string`&&!!e.trim()}function F(e){if(e==null||e===``)return null;let t=typeof e==`number`?e:typeof e==`string`?Number(e):NaN;if(!Number.isFinite(t)||t<0)throw Error(`商品价格格式异常`);return t}async function I(e){async function t(t){let n=await fetch(`/v1/enterprise/`+t,{signal:e,cache:`no-store`});if(!n.ok)throw Error(n.status===401?`登录已失效,请重新登录`:n.status===403?`当前账号没有店铺商品读取权限`:`店铺商品读取失败,请重试`);if(!n.headers.get(`content-type`)?.includes(`application/json`))throw Error(`店铺商品服务尚未接入`);return n.json()}let[n,r]=await Promise.all([t(`products`),t(`shops`)]);if(!N(n)||!Array.isArray(n.products)||!Array.isArray(n.listings)||!N(r)||!Array.isArray(r.shops))throw Error(`店铺商品返回格式异常`);let i=new Map;for(let e of n.products){if(!N(e)||!P(e.product_id)||!P(e.project_id)||!P(e.name))throw Error(`商品关联项目格式异常`);i.set(e.product_id,{id:e.project_id,name:e.name})}let a=new Map;for(let e of r.shops){if(!N(e)||!P(e.id)||!P(e.name)||![`real`,`simulated`,`unverified`].includes(String(e.mode)))throw Error(`店铺资料格式异常`);a.set(e.id,{name:e.name,mode:e.mode===`real`?`declared-real`:e.mode})}let o=[],s=new Set;for(let e of n.listings){if(!N(e)||!P(e.id)||!P(e.product_id)||!P(e.shop_id)||!P(e.platform_item_id)||typeof e.title!=`string`)throw Error(`店铺商品记录不完整`);let t=a.get(e.shop_id),n=i.get(e.product_id);if(!t)continue;if(!n)throw Error(`店铺商品关联项目缺失,请刷新重试`);let r=JSON.stringify([e.shop_id,e.platform_item_id]);if(s.has(r))throw Error(`店铺商品身份重复,请核对资料`);s.add(r),o.push({key:e.id,itemId:e.platform_item_id,title:e.title,image:typeof e.image_data_url==`string`?e.image_data_url:void 0,shopId:e.shop_id,shopName:t.name,project:n.id,projectName:n.name,mode:t.mode,category:typeof e.category==`string`?e.category:void 0,price:F(e.price)})}return o}function L(){let[e,t]=(0,b.useState)(null),[n,r]=(0,b.useState)(``),[i,a]=(0,b.useState)(!0),o=(0,b.useRef)(null),s=(0,b.useCallback)(()=>{o.current?.abort();let e=new AbortController;return o.current=e,I(e.signal).then(n=>{e.signal.aborted||(t(n),r(``))}).catch(n=>{e.signal.aborted||(t(null),r(n instanceof Error?n.message:`店铺商品读取失败`))}).finally(()=>{e.signal.aborted||a(!1)})},[]),c=(0,b.useCallback)(()=>(a(!0),r(``),s()),[s]);return(0,b.useEffect)(()=>(s(),()=>o.current?.abort()),[s]),{data:e,error:n,loading:i,refresh:c}}function R(e,t,n,r=``){return e.filter(e=>(!r||e.shopId===r)&&(n===`stored-demo`?e.mode===`simulated`:e.mode!==`simulated`)).map(e=>({...e,archives:t.filter(t=>t.project===e.project&&t.itemId===e.itemId&&t.shopIds?.length===1&&t.shopIds[0]===e.shopId&&(n===`stored-demo`?t.mode===`simulated`:t.mode!==`simulated`))}))}function z(e){let t=e.archives.length===1?e.archives[0]:void 0,n=t?.series.flatMap(e=>e.points.map(e=>e.date)).sort().at(-1)||``;function r(e,r){let i=t?.series.filter(t=>e.includes(t.metric)&&r.includes(t.unit))||[];if(i.length!==1)return null;let a=i[0].points.find(e=>e.date===n);return typeof a?.value==`number`&&Number.isFinite(a.value)?a.value:null}return{date:n,paid:r([`paid`,`revenue`],[`元`,`CNY`]),uv:r([`visitors`,`uv`],[`人`]),buyers:r([`buyers`],[`人`])}}function B(e,t,n){let r=t.trim().toLowerCase();return e.filter(e=>`${e.itemId} ${e.title} ${e.shopName} ${e.projectName} ${e.category||``}`.toLowerCase().includes(r)&&(n===`all`||(e.archives.length===1?e.archives[0].tier:e.archives.length===0?`unassigned`:``)===n))}var V=20;function H(){let e=g(),n=p(),l=L(),u=S(e.api),f=e.archiveScope||`real`,[m,h]=_(`products.query`,``),[y,x]=_(`products.shopTier`,`all`),[C,E]=_(`products.key`,``),[D,O]=_(`products.metric`,``),[A,M]=(0,b.useState)(1),[N,P]=(0,b.useState)(``),[F,I]=(0,b.useState)(null),[H,U]=(0,b.useState)(null),W=(0,b.useRef)(null),G=R(l.data||[],u.data?.products||[],f,n?.selected),K=u.error||u.loading?`all`:y,q=B(G,m,K),J=Math.max(1,Math.ceil(q.length/V)),Y=Math.min(A,J),X=u.data?.products.find(e=>e.key===C&&(f===`stored-demo`?e.mode===`simulated`:e.mode!==`simulated`)),Z=G.filter(e=>e.archives.some(e=>e.series.some(e=>e.points.length))).length,Q=l.loading||u.loading;function $(e){E(e.key),O(``),requestAnimationFrame(()=>{W.current?.scrollIntoView({behavior:`smooth`,block:`start`}),W.current?.focus({preventScroll:!0})})}return(0,k.jsx)(`div`,{className:`products-module`,children:(0,k.jsx)(`div`,{className:`gw shop-catalog`,children:(0,k.jsxs)(`div`,{className:`gw-body`,children:[(0,k.jsxs)(`header`,{className:`gw-header`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`small`,{children:`商品 / 全部商品`}),(0,k.jsx)(`h1`,{children:`店铺商品`}),(0,k.jsx)(`p`,{children:`查看店铺内已建档的商品与经营数据,再安排测试、孵化和推广。`})]}),(0,k.jsxs)(`div`,{className:`gw-header-actions`,children:[(0,k.jsxs)(`span`,{children:[(0,k.jsx)(`i`,{className:`gw-dot`}),`店铺建档与归档数据 · 非实时`]}),(0,k.jsxs)(`button`,{disabled:Q,onClick:()=>{l.refresh(),u.refresh()},children:[(0,k.jsx)(s,{size:14}),Q?`读取中`:`刷新数据`]})]})]}),(0,k.jsx)(`div`,{className:`gw-scope`,children:(0,k.jsx)(`span`,{children:n?.shops.find(e=>e.id===n.selected)?.name||`全部授权店铺`})}),l.error&&(0,k.jsxs)(`p`,{className:`gw-message`,role:`alert`,children:[l.error,` `,(0,k.jsx)(`button`,{onClick:()=>void l.refresh(),children:`重试店铺商品`})]}),u.error&&(0,k.jsxs)(`p`,{className:`gw-message`,role:`alert`,children:[`经营指标暂不可用:`,u.error,` `,(0,k.jsx)(`button`,{onClick:()=>void u.refresh(),children:`重试经营指标`})]}),N&&(0,k.jsx)(`p`,{className:`gw-message`,role:`status`,children:N}),(0,k.jsxs)(`section`,{className:`gw-panel shop-catalog-list`,"aria-label":`店铺商品列表`,children:[(0,k.jsxs)(`div`,{className:`gw-section-title`,children:[(0,k.jsx)(`h2`,{children:`全部商品`}),(0,k.jsx)(`span`,{children:l.loading?`正在读取商品…`:l.error?`商品总数暂不可用`:`当前范围 ${G.length} 个已建档商品`})]}),!l.error&&l.data&&(0,k.jsxs)(`div`,{className:`shop-catalog-summary`,children:[(0,k.jsxs)(`span`,{children:[`已有经营归档 `,(0,k.jsx)(`b`,{children:u.error||u.loading?`—`:Z})]}),(0,k.jsxs)(`span`,{children:[`待补充经营数据 `,(0,k.jsx)(`b`,{children:u.error||u.loading?`—`:G.length-Z})]}),(0,k.jsx)(`span`,{children:`未归档的指标显示“—”`})]}),(0,k.jsxs)(`div`,{className:`gw-filters`,children:[(0,k.jsxs)(`label`,{children:[(0,k.jsx)(c,{size:15}),(0,k.jsx)(`input`,{"aria-label":`搜索店铺商品`,placeholder:`搜索商品名称、ID、店铺、类目或项目`,value:m,onChange:e=>{h(e.target.value),M(1)}})]}),(0,k.jsxs)(`select`,{"aria-label":`筛选店铺商品分组`,value:K,disabled:u.loading||!!u.error,onChange:e=>{x(e.target.value),M(1)},children:[(0,k.jsx)(`option`,{value:`all`,children:`全部运营分组`}),Object.entries(w).map(([e,t])=>(0,k.jsx)(`option`,{value:e,children:t},e))]})]}),(0,k.jsx)(`div`,{className:`gw-table-scroll`,children:(0,k.jsxs)(`table`,{children:[(0,k.jsx)(`thead`,{children:(0,k.jsxs)(`tr`,{children:[(0,k.jsx)(`th`,{children:`商品 / 店铺`}),(0,k.jsx)(`th`,{children:`建档价格(元)`}),(0,k.jsx)(`th`,{children:`访客数`}),(0,k.jsx)(`th`,{children:`支付买家数`}),(0,k.jsx)(`th`,{children:`支付销售额(元)`}),(0,k.jsx)(`th`,{children:`统计日期`}),(0,k.jsx)(`th`,{children:`运营分组`}),(0,k.jsx)(`th`,{children:`操作`})]})}),(0,k.jsx)(`tbody`,{children:q.slice((Y-1)*V,Y*V).map(n=>{let r=z(n),i=n.archives.length===1?n.archives[0]:void 0;return(0,k.jsxs)(`tr`,{className:i?.key===X?.key&&i?`selected`:``,children:[(0,k.jsxs)(`td`,{children:[(0,k.jsx)(a,{product:n}),(0,k.jsxs)(`small`,{children:[n.category||`类目未录入`,` · `,n.projectName]})]}),(0,k.jsx)(`td`,{children:T(n.price)}),(0,k.jsx)(`td`,{children:T(r.uv)}),(0,k.jsx)(`td`,{children:T(r.buyers)}),(0,k.jsx)(`td`,{children:T(r.paid)}),(0,k.jsxs)(`td`,{children:[r.date||`—`,(0,k.jsx)(`small`,{children:u.loading?`读取指标中`:u.error?`指标读取失败`:n.archives.length>1?`多份归档,分别查看`:r.date?`已归档`:`暂无经营数据`})]}),(0,k.jsx)(`td`,{children:u.error||u.loading?`—`:n.archives.length>1?`分组待核对`:(0,k.jsx)(`span`,{className:`gw-tag `+(i?.tier||`unassigned`),children:w[i?.tier||`unassigned`]})}),(0,k.jsx)(`td`,{children:n.archives.length?n.archives.map((e,r)=>(0,k.jsxs)(`button`,{"aria-label":`查看商品 ${n.itemId} ${n.shopName} 归档 ${r+1}`,onClick:()=>$(e),children:[n.archives.length>1?`查看归档 ${r+1}`:`查看数据`,(0,k.jsx)(t,{size:12})]},e.key)):(0,k.jsxs)(`button`,{disabled:u.loading||!!u.error,onClick:()=>e.onOpen(n.project,{tab:`monitor`,itemId:n.itemId}),children:[u.loading?`读取中`:u.error?`指标不可用`:`补充数据`,(0,k.jsx)(t,{size:12})]})})]},n.key)})})]})}),!q.length&&(0,k.jsxs)(`div`,{className:`gw-empty`,role:`status`,children:[(0,k.jsx)(o,{size:29}),(0,k.jsx)(`b`,{children:l.error?`店铺商品读取失败`:l.loading?`正在读取店铺商品…`:m||K!==`all`?`没有匹配的商品`:`当前范围还没有已建档商品`}),(0,k.jsx)(`p`,{children:l.error?`请重试,或检查账号与数据服务连接。`:l.loading?`正在读取当前授权范围的商品目录。`:m||K!==`all`?`调整搜索或运营分组筛选后再查看。`:`请先关联店铺商品。已关联商品即使没有经营归档,也会显示在这里。`}),!l.loading&&!l.error&&(m||K!==`all`)&&(0,k.jsx)(`button`,{onClick:()=>{h(``),x(`all`),M(1)},children:`清除筛选`})]}),q.length>0&&(0,k.jsxs)(`div`,{className:`shop-catalog-pagination`,children:[(0,k.jsxs)(`span`,{children:[`筛选结果 `,q.length,` 个 · 第 `,Y,` / `,J,` 页`]}),(0,k.jsx)(`button`,{disabled:Y<=1,onClick:()=>M(Y-1),children:`上一页`}),(0,k.jsx)(`button`,{disabled:Y>=J,onClick:()=>M(Y+1),children:`下一页`})]})]}),(0,k.jsx)(`p`,{className:`gw-detail-note`,children:`仅显示当前授权店铺已建档商品,尚不代表平台全店商品已同步。经营指标按每个商品的最新归档统计日展示,不同商品日期可能不同;缺值不补零,多店合并归档不分摊到单店。`}),X&&(0,k.jsxs)(`section`,{ref:W,tabIndex:-1,className:`gw-panel gw-product-detail shop-catalog-detail`,children:[(0,k.jsxs)(`div`,{className:`gw-section-title`,children:[(0,k.jsx)(`h2`,{children:`商品数据与下一步`}),(0,k.jsx)(`button`,{"aria-label":`关闭商品详情`,onClick:()=>E(``),children:(0,k.jsx)(d,{size:15})})]}),(0,k.jsx)(j,{product:X,metricKey:D,onMetric:O,onGroup:I,onTask:U,onOpen:e.onOpen})]}),H&&(0,k.jsx)(i,{product:H,onOpen:e.onOpen,onClose:()=>U(null)}),F&&(0,k.jsx)(r,{product:F,products:(u.data?.products||[]).filter(e=>f===`stored-demo`?e.mode===`simulated`:e.mode!==`simulated`),onDirty:e.onDirty,onBusy:e.onBusy,onClose:()=>I(null),onSave:async(t,n,r,i)=>{await v(e.api,t,n,r,i),P(await u.refresh()?`分组已保存,商品数据已更新。`:`分组已保存,但数据读取失败,请刷新后查看。`)}})]})})})}var U=(0,b.lazy)(()=>f(()=>import(`./project-public-CnKWSlv4.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url));function W({section:e,onSection:t,project:n}){return n?(0,k.jsx)(b.Suspense,{fallback:(0,k.jsx)(`p`,{role:`status`,children:`正在打开商品工具…`}),children:(0,k.jsx)(U,{section:e,project:n})}):e===`all`?(0,k.jsx)(H,{}):(0,k.jsx)(M,{section:e,onSection:t})}export{W as default};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./project-public-DN0-E_G2.js","./index-Dfy2jMWq.js","./index-DT6aELxD.css","./CartesianChart-aa0EJ6w3.js","./LineChart-tppycNHl.js","./ErrorBarContext-BeuyujN4.js","./getRadiusAndStrokeWidthFromDot-zEte6bM_.js","./EvidenceSourceGuide-BeBcvVcI.js","./HelpTip-BfrAVfV_.js","./HelpTip-BsHPhMNf.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{n as e}from"./clock-3-TXgD8tS6.js";import{t}from"./chevron-right-DyOe1NsY.js";import{i as n,n as r,r as i,t as a}from"./products-6S_LnOq6.js";import{t as o}from"./layers-B4gCFnEm.js";import{t as s}from"./refresh-cw-CiIEylYp.js";import{t as c}from"./search-DlLds8Ae.js";import{c as l,h as u,l as d,r as f,s as p,v as m,x as h}from"./index-Dfy2jMWq.js";import{n as g}from"./module-host-BIy_fI1T.js";import{n as _}from"./workspace-view-state-BuK4-c0r.js";import"./public-Csb687JC.js";import{t as v}from"./group-DIi_QccB.js";var y=u(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),b=h(m(),1);async function x(e){let t=await e(`/growth-center`);if(!t||!Array.isArray(t.products)||typeof t.updatedAt!=`string`||t.products.some(e=>!e||typeof e.key!=`string`||typeof e.itemId!=`string`||typeof e.project!=`string`||!Array.isArray(e.series)||e.series.some(e=>!e||!Array.isArray(e.points))))throw Error(`商品资料返回格式异常`);return t}function S(e){let[t,n]=(0,b.useState)(null),[r,i]=(0,b.useState)(``),[a,o]=(0,b.useState)(!0),s=(0,b.useRef)(0),c=(0,b.useRef)(!1),l=(0,b.useCallback)(()=>{let t=++s.current;return x(e).then(e=>c.current&&s.current===t?(n(e),i(``),!0):!1).catch(e=>(c.current&&s.current===t&&(n(null),i(e instanceof Error?e.message:`商品资料读取失败`)),!1)).finally(()=>{c.current&&s.current===t&&o(!1)})},[e]),u=(0,b.useCallback)(()=>(o(!0),i(``),l()),[l]);return(0,b.useEffect)(()=>(c.current=!0,l(),()=>{c.current=!1}),[l]),{data:t,error:r,loading:a,refresh:u}}var C=[{id:`test`,n:`03`,name:`新品测试`,caption:`运营策略 · 测试`,color:`var(--omni-chart-primary,#6fa7ff)`,goal:`少量投入,找到有人喜欢的商品`,cadence:`推广每天看 · 商品每5天看`,rule:`同品类、同属性、同材质一起测。对照店里第二梯队头部商品:低的继续跑,中的进入孵化候选,高的进一步评估。`,action:`查看点击、加购表现,筛选候选商品。`},{id:`incubate`,n:`02`,name:`持续孵化`,caption:`运营策略 · 培养`,color:`var(--omni-chart-secondary,#b99aff)`,goal:`培养潜力款,让成熟商品赚钱`,cadence:`新品每5天看 · 老品每7天看`,rule:`新商品看加购率与转化率;成熟商品看付费占比。低的放大,高的调整计划或暂停,同时优化主图、视频等。`,action:`区分赚钱款与潜力款,安排下一轮优化。`},{id:`scale`,n:`01`,name:`重点推广`,caption:`运营策略 · 放大`,color:`var(--omni-chart-teal,#44cdb5)`,goal:`集中资源,持续增加付款人数`,cadence:`推广每30–60分钟看 · 商品每天看`,rule:`拉新看点击成本、加购成本;收割看点击成本、成交成本。调整差计划,把预算分配给同类好计划;没有合适计划就新建测试。`,action:`查看广告计划,按老师给企业制定的标准处理。`}],w={unassigned:`待分组`,test:`新品测试`,incubate:`持续孵化`,scale:`重点推广`},T=e=>typeof e==`number`?e.toLocaleString(`zh-CN`,{maximumFractionDigits:2}):`—`;function E(e,t){return e.filter(e=>t===`stored-demo`?e.mode===`simulated`:e.mode!==`simulated`)}function D(e,t,n){let r=n.trim().toLowerCase();return e.filter(e=>(t===`all`||e.tier===t)&&`${e.itemId} ${e.projectName} ${e.title||``} ${e.shopName||``}`.toLowerCase().includes(r))}function O(e,t){return e.find(e=>e.key===t)||e[0]}var k=l();function A({series:e}){if(!e?.points.length)return(0,k.jsx)(`div`,{className:`gw-chart-empty`,children:`选择商品后,查看已有数据趋势。`});let t=e.points.slice(-30),n=t.flatMap(e=>e.value===null?[]:[e.value]),r=n.length?Math.min(...n):0,i=n.length?Math.max(...n):1,a=(e,n)=>[32+n*636/Math.max(1,t.length-1),150-((e.value??r)-r)/(i-r||1)*115],o=null,s=[];return t.forEach((t,n)=>{if(t.value===null){o=null;return}let[r,i]=a(t,n);o&&Date.parse(t.date)-Date.parse(o.date)===864e5&&s.push((0,k.jsx)(`line`,{x1:o.x,y1:o.y,x2:r,y2:i},`l`+n)),s.push((0,k.jsx)(`circle`,{cx:r,cy:i,r:`3`,children:(0,k.jsxs)(`title`,{children:[t.date,`:`,T(t.value),` `,e.unit]})},`p`+n)),o={x:r,y:i,date:t.date}}),(0,k.jsxs)(`div`,{className:`gw-chart`,children:[(0,k.jsxs)(`svg`,{viewBox:`0 0 700 185`,role:`img`,"aria-label":`${e.name}最近${t.length}个归档日期的趋势,缺失日期不连线`,children:[(0,k.jsx)(`defs`,{children:(0,k.jsxs)(`linearGradient`,{id:`product-chart-bg`,x1:`0`,x2:`0`,y1:`0`,y2:`1`,children:[(0,k.jsx)(`stop`,{stopColor:`var(--omni-chart-teal,#4cd5af)`,stopOpacity:`.1`}),(0,k.jsx)(`stop`,{offset:`1`,stopColor:`var(--omni-chart-teal,#4cd5af)`,stopOpacity:`0`})]})}),(0,k.jsx)(`rect`,{x:`30`,y:`20`,width:`640`,height:`145`,fill:`url(#product-chart-bg)`}),[35,92,150].map(e=>(0,k.jsx)(`line`,{x1:`30`,x2:`670`,y1:e,y2:e,className:`grid`},e)),(0,k.jsx)(`g`,{className:`plot`,children:s}),(0,k.jsx)(`text`,{x:`32`,y:`178`,children:t[0]?.date}),(0,k.jsx)(`text`,{x:`668`,y:`178`,textAnchor:`end`,children:t.at(-1)?.date}),(0,k.jsxs)(`text`,{x:`32`,y:`16`,children:[T(i),` `,e.unit]})]}),(0,k.jsx)(`span`,{children:`最近最多30个归档日期 · 缺失不补零 · 不同日期不汇总`})]})}function j({product:t,metricKey:n,onMetric:r,onGroup:i,onTask:o,onOpen:s}){if(!t)return(0,k.jsx)(`div`,{className:`gw-empty`,children:`选择商品查看趋势与后续操作。`});let c=t.series.find(e=>e.key===n)||t.series.find(e=>e.metric===`buyers`)||t.series[0],l=C.find(e=>e.id===t.tier);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{className:`gw-selected-product`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(a,{product:t}),(0,k.jsx)(`span`,{className:`gw-tag `+t.tier,children:w[t.tier]})]}),(0,k.jsxs)(`button`,{onClick:()=>i(t),children:[(0,k.jsx)(y,{size:14}),`分组`]})]}),(0,k.jsxs)(`div`,{className:`gw-metric-selector`,children:[(0,k.jsx)(`select`,{"aria-label":`商品趋势指标`,value:c?.key||``,onChange:e=>r(e.target.value),children:t.series.map(e=>(0,k.jsxs)(`option`,{value:e.key,children:[e.name,` · `,e.unit||`原始单位`]},e.key))}),(0,k.jsxs)(`strong`,{children:[T(c?.points.at(-1)?.value),(0,k.jsx)(`small`,{children:c?.unit})]}),(0,k.jsxs)(`span`,{children:[`最后统计日:`,c?.points.at(-1)?.date||`—`]})]}),(0,k.jsx)(A,{series:c}),(0,k.jsxs)(`details`,{className:`gw-points`,children:[(0,k.jsx)(`summary`,{children:`查看每日原值与来源`}),(0,k.jsx)(`div`,{className:`gw-table-scroll`,children:(0,k.jsxs)(`table`,{children:[(0,k.jsx)(`thead`,{children:(0,k.jsxs)(`tr`,{children:[(0,k.jsx)(`th`,{children:`日期`}),(0,k.jsx)(`th`,{children:`原值`}),(0,k.jsx)(`th`,{children:`来源`})]})}),(0,k.jsx)(`tbody`,{children:c?.points.slice(-30).map(e=>(0,k.jsxs)(`tr`,{children:[(0,k.jsx)(`td`,{children:e.date}),(0,k.jsx)(`td`,{children:T(e.value)}),(0,k.jsx)(`td`,{children:(0,k.jsx)(`a`,{href:`/api/workbench/`+t.project+`/file/`+e.fileId,children:`原始归档`})})]},e.date))})]})})]}),(0,k.jsxs)(`div`,{className:`gw-next`,children:[(0,k.jsx)(`span`,{children:`NEXT / 下一步`}),(0,k.jsx)(`h3`,{children:l?.action||`先选择这个商品的运营策略`}),(0,k.jsxs)(`p`,{children:[l?.cadence||`分组后查看对应检查频率和处理办法。`,t.note&&` · `+t.note]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`button`,{onClick:()=>o(t),children:`查看当前任务`}),(0,k.jsxs)(`button`,{className:`gw-primary`,onClick:()=>s(t.project,{tab:`monitor`,itemId:t.itemId}),children:[`查看监控与取数 `,(0,k.jsx)(e,{size:13})]}),(0,k.jsx)(`button`,{onClick:()=>s(t.project,{tab:`optimization`,itemId:t.itemId}),children:`商品优化`})]})]}),(0,k.jsx)(`p`,{className:`gw-detail-note`,children:`展示本项目归档的商品指标。点击率、加购率、计划成本等尚未汇入此表;请到来源数据中核对。`})]})}function M({section:e,onSection:l}){let u=g(),{data:d,error:f,loading:p,refresh:m}=S(u.api),h=u.archiveScope||`real`,[y,x]=_(`products.query`,``),[T,A]=_(`products.key`,``),[M,N]=_(`products.metric`,``),[P,F]=(0,b.useState)(``),[I,L]=(0,b.useState)(null),[R,z]=(0,b.useState)(null),B=(0,b.useRef)(null),V=e===`all`||w[e]?e:`all`,H=E(d?.products||[],h),U=D(H,V,y),W=O(U,T);function G(e){A(e.key),N(``),F(``)}function K(e,t){if(t===`work`){z(e);return}t===`data`?(l(`all`),x(``),G(e),requestAnimationFrame(()=>{B.current?.scrollIntoView({behavior:`smooth`,block:`start`}),B.current?.focus({preventScroll:!0})})):u.onOpen(e.project,{tab:t,itemId:e.itemId})}return(0,k.jsx)(`div`,{className:`products-module`,children:(0,k.jsx)(`div`,{className:`gw`,children:(0,k.jsxs)(`div`,{className:`gw-body`,children:[(0,k.jsxs)(`header`,{className:`gw-header`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`small`,{children:`商品 / 商品看板`}),(0,k.jsx)(`h1`,{children:`从测试到重点推广`})]}),(0,k.jsxs)(`div`,{className:`gw-header-actions`,children:[(0,k.jsxs)(`span`,{children:[(0,k.jsx)(`i`,{className:`gw-dot`}),`归档数据 · 非实时`]}),(0,k.jsxs)(`button`,{onClick:()=>void m(),disabled:p,children:[(0,k.jsx)(s,{size:14}),p?`读取中`:`刷新数据`]})]})]}),(0,k.jsx)(`div`,{className:`gw-scope`,children:(0,k.jsx)(`span`,{children:d?`${new Date(d.updatedAt).toLocaleString(`zh-CN`)} 读取归档`:p?`正在读取归档…`:`商品资料未就绪`})}),f&&(0,k.jsxs)(`p`,{role:`alert`,className:`gw-message`,children:[f,` `,(0,k.jsx)(`button`,{onClick:()=>void m(),children:`重试`})]}),P&&(0,k.jsx)(`p`,{role:`status`,className:`gw-message`,children:P}),(0,k.jsx)(n,{products:H,tiers:C,ready:!!d&&!p,onAction:K,onAssign:(e,t)=>L({product:e,suggestedTier:t})}),R&&(0,k.jsx)(i,{product:R,onOpen:u.onOpen,onClose:()=>z(null)}),I&&(0,k.jsx)(r,{...I,products:H,onDirty:u.onDirty,onBusy:u.onBusy,onClose:()=>L(null),onSave:async(e,t,n,r)=>{await v(u.api,e,t,n,r),F(await m()?`分组已保存,看板已更新。`:`分组已保存,但看板读取失败,请刷新后查看。`)}}),(0,k.jsxs)(`div`,{className:`gw-operating`,children:[(0,k.jsxs)(`section`,{className:`gw-panel gw-products`,children:[(0,k.jsxs)(`div`,{className:`gw-section-title`,children:[(0,k.jsx)(`h2`,{children:`商品工作清单`}),(0,k.jsxs)(`span`,{children:[U.length,` 个观察对象`]})]}),(0,k.jsxs)(`div`,{className:`gw-filters`,children:[(0,k.jsxs)(`label`,{children:[(0,k.jsx)(c,{size:14}),(0,k.jsx)(`input`,{"aria-label":`搜索经营商品`,placeholder:`搜索商品ID或项目`,value:y,onChange:e=>x(e.target.value)})]}),(0,k.jsxs)(`select`,{"aria-label":`商品运营分组`,value:V,onChange:e=>{l(e.target.value),A(``)},children:[(0,k.jsx)(`option`,{value:`all`,children:`全部运营分组`}),Object.entries(w).map(([e,t])=>(0,k.jsx)(`option`,{value:e,children:t},e))]})]}),V!==`all`&&(0,k.jsxs)(`div`,{className:`gw-rule`,children:[(0,k.jsx)(`b`,{children:w[V]}),(0,k.jsx)(`p`,{children:C.find(e=>e.id===V)?.rule||`选择商品后确认分组。归档记录不能直接证明商品属于哪个梯队。`})]}),(0,k.jsx)(`div`,{className:`gw-table-scroll`,children:(0,k.jsxs)(`table`,{children:[(0,k.jsx)(`thead`,{children:(0,k.jsxs)(`tr`,{children:[(0,k.jsx)(`th`,{children:`商品 / 所属项目`}),(0,k.jsx)(`th`,{children:`当前运营分组`}),(0,k.jsx)(`th`,{children:`已有指标`}),(0,k.jsx)(`th`,{children:`操作`})]})}),(0,k.jsx)(`tbody`,{children:U.map(e=>(0,k.jsxs)(`tr`,{className:W?.key===e.key?`selected`:``,children:[(0,k.jsx)(`td`,{children:(0,k.jsx)(a,{product:e})}),(0,k.jsx)(`td`,{children:(0,k.jsx)(`span`,{className:`gw-tag `+e.tier,children:w[e.tier]})}),(0,k.jsxs)(`td`,{children:[e.series.length,` 项`,(0,k.jsx)(`small`,{children:e.series.map(e=>e.name).slice(0,2).join(` / `)})]}),(0,k.jsx)(`td`,{children:(0,k.jsxs)(`button`,{"aria-label":`查看商品 `+e.itemId+` `+e.projectName,onClick:()=>G(e),children:[`查看 `,(0,k.jsx)(t,{size:12})]})})]},e.key))})]})}),!U.length&&(0,k.jsxs)(`div`,{className:`gw-empty`,children:[(0,k.jsx)(o,{size:29}),(0,k.jsx)(`b`,{children:f?`商品资料读取失败`:p?`正在读取商品…`:y?`没有匹配的商品`:`这个分组还没有商品`}),(0,k.jsx)(`p`,{children:`切换到“待分组”确认商品运营分组,或从项目监控中归档商品数据。`}),(0,k.jsx)(`button`,{onClick:()=>{x(``),l(`unassigned`)},children:`查看待分组`}),(0,k.jsx)(`button`,{onClick:()=>u.onModule(`projects`),children:`进入项目执行`})]})]}),(0,k.jsxs)(`section`,{ref:B,tabIndex:-1,className:`gw-panel gw-product-detail`,children:[(0,k.jsxs)(`div`,{className:`gw-section-title`,children:[(0,k.jsx)(`h2`,{children:`商品数据与下一步`}),(0,k.jsx)(`span`,{children:`点表格切换`})]}),(0,k.jsx)(j,{product:W,metricKey:M,onMetric:N,onGroup:e=>L({product:e}),onTask:z,onOpen:u.onOpen})]})]}),(0,k.jsx)(`p`,{className:`gw-detail-note`,children:`这里的“新品测试、持续孵化、重点推广”是人工保存的运营策略,不是按全店支付销售额贡献、访客和支付买家核验的第一、二、三梯队。切换分组不会自动投放或改变经营梯队。`}),(0,k.jsxs)(`footer`,{className:`gw-footer`,children:[(0,k.jsx)(`span`,{children:`规则来源:店铺链接 AI 自动化孵化与打爆`}),(0,k.jsxs)(`details`,{children:[(0,k.jsx)(`summary`,{children:`检查频率与执行状态说明`}),(0,k.jsx)(`p`,{children:`运营策略卡片展示原方案的建议检查频率,不表示调度已启用。老师结合企业数据制定具体判断标准;本页支持归档查询、趋势查看和分组保存。广告计划的建立、暂停及预算调整尚未在本页接通。`})]})]})]})})})}function N(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function P(e){return typeof e==`string`&&!!e.trim()}function F(e){if(e==null||e===``)return null;let t=typeof e==`number`?e:typeof e==`string`?Number(e):NaN;if(!Number.isFinite(t)||t<0)throw Error(`商品价格格式异常`);return t}async function I(e){async function t(t){let n=await fetch(`/v1/enterprise/`+t,{signal:e,cache:`no-store`});if(!n.ok)throw Error(n.status===401?`登录已失效,请重新登录`:n.status===403?`当前账号没有店铺商品读取权限`:`店铺商品读取失败,请重试`);if(!n.headers.get(`content-type`)?.includes(`application/json`))throw Error(`店铺商品服务尚未接入`);return n.json()}let[n,r]=await Promise.all([t(`products`),t(`shops`)]);if(!N(n)||!Array.isArray(n.products)||!Array.isArray(n.listings)||!N(r)||!Array.isArray(r.shops))throw Error(`店铺商品返回格式异常`);let i=new Map;for(let e of n.products){if(!N(e)||!P(e.product_id)||!P(e.project_id)||!P(e.name))throw Error(`商品关联项目格式异常`);i.set(e.product_id,{id:e.project_id,name:e.name})}let a=new Map;for(let e of r.shops){if(!N(e)||!P(e.id)||!P(e.name)||![`real`,`simulated`,`unverified`].includes(String(e.mode)))throw Error(`店铺资料格式异常`);a.set(e.id,{name:e.name,mode:e.mode===`real`?`declared-real`:e.mode})}let o=[],s=new Set;for(let e of n.listings){if(!N(e)||!P(e.id)||!P(e.product_id)||!P(e.shop_id)||!P(e.platform_item_id)||typeof e.title!=`string`)throw Error(`店铺商品记录不完整`);let t=a.get(e.shop_id),n=i.get(e.product_id);if(!t)continue;if(!n)throw Error(`店铺商品关联项目缺失,请刷新重试`);let r=JSON.stringify([e.shop_id,e.platform_item_id]);if(s.has(r))throw Error(`店铺商品身份重复,请核对资料`);s.add(r),o.push({key:e.id,itemId:e.platform_item_id,title:e.title,image:typeof e.image_data_url==`string`?e.image_data_url:void 0,shopId:e.shop_id,shopName:t.name,project:n.id,projectName:n.name,mode:t.mode,category:typeof e.category==`string`?e.category:void 0,price:F(e.price)})}return o}function L(){let[e,t]=(0,b.useState)(null),[n,r]=(0,b.useState)(``),[i,a]=(0,b.useState)(!0),o=(0,b.useRef)(null),s=(0,b.useCallback)(()=>{o.current?.abort();let e=new AbortController;return o.current=e,I(e.signal).then(n=>{e.signal.aborted||(t(n),r(``))}).catch(n=>{e.signal.aborted||(t(null),r(n instanceof Error?n.message:`店铺商品读取失败`))}).finally(()=>{e.signal.aborted||a(!1)})},[]),c=(0,b.useCallback)(()=>(a(!0),r(``),s()),[s]);return(0,b.useEffect)(()=>(s(),()=>o.current?.abort()),[s]),{data:e,error:n,loading:i,refresh:c}}function R(e,t,n,r=``){return e.filter(e=>(!r||e.shopId===r)&&(n===`stored-demo`?e.mode===`simulated`:e.mode!==`simulated`)).map(e=>({...e,archives:t.filter(t=>t.project===e.project&&t.itemId===e.itemId&&t.shopIds?.length===1&&t.shopIds[0]===e.shopId&&(n===`stored-demo`?t.mode===`simulated`:t.mode!==`simulated`))}))}function z(e){let t=e.archives.length===1?e.archives[0]:void 0,n=t?.series.flatMap(e=>e.points.map(e=>e.date)).sort().at(-1)||``;function r(e,r){let i=t?.series.filter(t=>e.includes(t.metric)&&r.includes(t.unit))||[];if(i.length!==1)return null;let a=i[0].points.find(e=>e.date===n);return typeof a?.value==`number`&&Number.isFinite(a.value)?a.value:null}return{date:n,paid:r([`paid`,`revenue`],[`元`,`CNY`]),uv:r([`visitors`,`uv`],[`人`]),buyers:r([`buyers`],[`人`])}}function B(e,t,n){let r=t.trim().toLowerCase();return e.filter(e=>`${e.itemId} ${e.title} ${e.shopName} ${e.projectName} ${e.category||``}`.toLowerCase().includes(r)&&(n===`all`||(e.archives.length===1?e.archives[0].tier:e.archives.length===0?`unassigned`:``)===n))}var V=20;function H(){let e=g(),n=p(),l=L(),u=S(e.api),f=e.archiveScope||`real`,[m,h]=_(`products.query`,``),[y,x]=_(`products.shopTier`,`all`),[C,E]=_(`products.key`,``),[D,O]=_(`products.metric`,``),[A,M]=(0,b.useState)(1),[N,P]=(0,b.useState)(``),[F,I]=(0,b.useState)(null),[H,U]=(0,b.useState)(null),W=(0,b.useRef)(null),G=R(l.data||[],u.data?.products||[],f,n?.selected),K=u.error||u.loading?`all`:y,q=B(G,m,K),J=Math.max(1,Math.ceil(q.length/V)),Y=Math.min(A,J),X=u.data?.products.find(e=>e.key===C&&(f===`stored-demo`?e.mode===`simulated`:e.mode!==`simulated`)),Z=G.filter(e=>e.archives.some(e=>e.series.some(e=>e.points.length))).length,Q=l.loading||u.loading;function $(e){E(e.key),O(``),requestAnimationFrame(()=>{W.current?.scrollIntoView({behavior:`smooth`,block:`start`}),W.current?.focus({preventScroll:!0})})}return(0,k.jsx)(`div`,{className:`products-module`,children:(0,k.jsx)(`div`,{className:`gw shop-catalog`,children:(0,k.jsxs)(`div`,{className:`gw-body`,children:[(0,k.jsxs)(`header`,{className:`gw-header`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`small`,{children:`商品 / 全部商品`}),(0,k.jsx)(`h1`,{children:`店铺商品`}),(0,k.jsx)(`p`,{children:`查看店铺内已建档的商品与经营数据,再安排测试、孵化和推广。`})]}),(0,k.jsxs)(`div`,{className:`gw-header-actions`,children:[(0,k.jsxs)(`span`,{children:[(0,k.jsx)(`i`,{className:`gw-dot`}),`店铺建档与归档数据 · 非实时`]}),(0,k.jsxs)(`button`,{disabled:Q,onClick:()=>{l.refresh(),u.refresh()},children:[(0,k.jsx)(s,{size:14}),Q?`读取中`:`刷新数据`]})]})]}),(0,k.jsx)(`div`,{className:`gw-scope`,children:(0,k.jsx)(`span`,{children:n?.shops.find(e=>e.id===n.selected)?.name||`全部授权店铺`})}),l.error&&(0,k.jsxs)(`p`,{className:`gw-message`,role:`alert`,children:[l.error,` `,(0,k.jsx)(`button`,{onClick:()=>void l.refresh(),children:`重试店铺商品`})]}),u.error&&(0,k.jsxs)(`p`,{className:`gw-message`,role:`alert`,children:[`经营指标暂不可用:`,u.error,` `,(0,k.jsx)(`button`,{onClick:()=>void u.refresh(),children:`重试经营指标`})]}),N&&(0,k.jsx)(`p`,{className:`gw-message`,role:`status`,children:N}),(0,k.jsxs)(`section`,{className:`gw-panel shop-catalog-list`,"aria-label":`店铺商品列表`,children:[(0,k.jsxs)(`div`,{className:`gw-section-title`,children:[(0,k.jsx)(`h2`,{children:`全部商品`}),(0,k.jsx)(`span`,{children:l.loading?`正在读取商品…`:l.error?`商品总数暂不可用`:`当前范围 ${G.length} 个已建档商品`})]}),!l.error&&l.data&&(0,k.jsxs)(`div`,{className:`shop-catalog-summary`,children:[(0,k.jsxs)(`span`,{children:[`已有经营归档 `,(0,k.jsx)(`b`,{children:u.error||u.loading?`—`:Z})]}),(0,k.jsxs)(`span`,{children:[`待补充经营数据 `,(0,k.jsx)(`b`,{children:u.error||u.loading?`—`:G.length-Z})]}),(0,k.jsx)(`span`,{children:`未归档的指标显示“—”`})]}),(0,k.jsxs)(`div`,{className:`gw-filters`,children:[(0,k.jsxs)(`label`,{children:[(0,k.jsx)(c,{size:15}),(0,k.jsx)(`input`,{"aria-label":`搜索店铺商品`,placeholder:`搜索商品名称、ID、店铺、类目或项目`,value:m,onChange:e=>{h(e.target.value),M(1)}})]}),(0,k.jsxs)(`select`,{"aria-label":`筛选店铺商品分组`,value:K,disabled:u.loading||!!u.error,onChange:e=>{x(e.target.value),M(1)},children:[(0,k.jsx)(`option`,{value:`all`,children:`全部运营分组`}),Object.entries(w).map(([e,t])=>(0,k.jsx)(`option`,{value:e,children:t},e))]})]}),(0,k.jsx)(`div`,{className:`gw-table-scroll`,children:(0,k.jsxs)(`table`,{children:[(0,k.jsx)(`thead`,{children:(0,k.jsxs)(`tr`,{children:[(0,k.jsx)(`th`,{children:`商品 / 店铺`}),(0,k.jsx)(`th`,{children:`建档价格(元)`}),(0,k.jsx)(`th`,{children:`访客数`}),(0,k.jsx)(`th`,{children:`支付买家数`}),(0,k.jsx)(`th`,{children:`支付销售额(元)`}),(0,k.jsx)(`th`,{children:`统计日期`}),(0,k.jsx)(`th`,{children:`运营分组`}),(0,k.jsx)(`th`,{children:`操作`})]})}),(0,k.jsx)(`tbody`,{children:q.slice((Y-1)*V,Y*V).map(n=>{let r=z(n),i=n.archives.length===1?n.archives[0]:void 0;return(0,k.jsxs)(`tr`,{className:i?.key===X?.key&&i?`selected`:``,children:[(0,k.jsxs)(`td`,{children:[(0,k.jsx)(a,{product:n}),(0,k.jsxs)(`small`,{children:[n.category||`类目未录入`,` · `,n.projectName]})]}),(0,k.jsx)(`td`,{children:T(n.price)}),(0,k.jsx)(`td`,{children:T(r.uv)}),(0,k.jsx)(`td`,{children:T(r.buyers)}),(0,k.jsx)(`td`,{children:T(r.paid)}),(0,k.jsxs)(`td`,{children:[r.date||`—`,(0,k.jsx)(`small`,{children:u.loading?`读取指标中`:u.error?`指标读取失败`:n.archives.length>1?`多份归档,分别查看`:r.date?`已归档`:`暂无经营数据`})]}),(0,k.jsx)(`td`,{children:u.error||u.loading?`—`:n.archives.length>1?`分组待核对`:(0,k.jsx)(`span`,{className:`gw-tag `+(i?.tier||`unassigned`),children:w[i?.tier||`unassigned`]})}),(0,k.jsx)(`td`,{children:n.archives.length?n.archives.map((e,r)=>(0,k.jsxs)(`button`,{"aria-label":`查看商品 ${n.itemId} ${n.shopName} 归档 ${r+1}`,onClick:()=>$(e),children:[n.archives.length>1?`查看归档 ${r+1}`:`查看数据`,(0,k.jsx)(t,{size:12})]},e.key)):(0,k.jsxs)(`button`,{disabled:u.loading||!!u.error,onClick:()=>e.onOpen(n.project,{tab:`monitor`,itemId:n.itemId}),children:[u.loading?`读取中`:u.error?`指标不可用`:`补充数据`,(0,k.jsx)(t,{size:12})]})})]},n.key)})})]})}),!q.length&&(0,k.jsxs)(`div`,{className:`gw-empty`,role:`status`,children:[(0,k.jsx)(o,{size:29}),(0,k.jsx)(`b`,{children:l.error?`店铺商品读取失败`:l.loading?`正在读取店铺商品…`:m||K!==`all`?`没有匹配的商品`:`当前范围还没有已建档商品`}),(0,k.jsx)(`p`,{children:l.error?`请重试,或检查账号与数据服务连接。`:l.loading?`正在读取当前授权范围的商品目录。`:m||K!==`all`?`调整搜索或运营分组筛选后再查看。`:`请先关联店铺商品。已关联商品即使没有经营归档,也会显示在这里。`}),!l.loading&&!l.error&&(m||K!==`all`)&&(0,k.jsx)(`button`,{onClick:()=>{h(``),x(`all`),M(1)},children:`清除筛选`})]}),q.length>0&&(0,k.jsxs)(`div`,{className:`shop-catalog-pagination`,children:[(0,k.jsxs)(`span`,{children:[`筛选结果 `,q.length,` 个 · 第 `,Y,` / `,J,` 页`]}),(0,k.jsx)(`button`,{disabled:Y<=1,onClick:()=>M(Y-1),children:`上一页`}),(0,k.jsx)(`button`,{disabled:Y>=J,onClick:()=>M(Y+1),children:`下一页`})]})]}),(0,k.jsx)(`p`,{className:`gw-detail-note`,children:`仅显示当前授权店铺已建档商品,尚不代表平台全店商品已同步。经营指标按每个商品的最新归档统计日展示,不同商品日期可能不同;缺值不补零,多店合并归档不分摊到单店。`}),X&&(0,k.jsxs)(`section`,{ref:W,tabIndex:-1,className:`gw-panel gw-product-detail shop-catalog-detail`,children:[(0,k.jsxs)(`div`,{className:`gw-section-title`,children:[(0,k.jsx)(`h2`,{children:`商品数据与下一步`}),(0,k.jsx)(`button`,{"aria-label":`关闭商品详情`,onClick:()=>E(``),children:(0,k.jsx)(d,{size:15})})]}),(0,k.jsx)(j,{product:X,metricKey:D,onMetric:O,onGroup:I,onTask:U,onOpen:e.onOpen})]}),H&&(0,k.jsx)(i,{product:H,onOpen:e.onOpen,onClose:()=>U(null)}),F&&(0,k.jsx)(r,{product:F,products:(u.data?.products||[]).filter(e=>f===`stored-demo`?e.mode===`simulated`:e.mode!==`simulated`),onDirty:e.onDirty,onBusy:e.onBusy,onClose:()=>I(null),onSave:async(t,n,r,i)=>{await v(e.api,t,n,r,i),P(await u.refresh()?`分组已保存,商品数据已更新。`:`分组已保存,但数据读取失败,请刷新后查看。`)}})]})})})}var U=(0,b.lazy)(()=>f(()=>import(`./project-public-DN0-E_G2.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url));function W({section:e,onSection:t,project:n}){return n?(0,k.jsx)(b.Suspense,{fallback:(0,k.jsx)(`p`,{role:`status`,children:`正在打开商品工具…`}),children:(0,k.jsx)(U,{section:e,project:n})}):e===`all`?(0,k.jsx)(H,{}):(0,k.jsx)(M,{section:e,onSection:t})}export{W as default};
|