1import{j as e,D as H,a as U,b as V,aS as i,s as S,dw as N,p as w,aE as k,d as W,B as $,ca as K,n as E,bM as G,aU as M,b$ as L,iw as J,aO as Q,cJ as X,x as R,aN as Y,I as A,hP as Z,aH as ee,T as se,b8 as q,bi as te,cb as ae}from"./@mui-DIvZKyk5.js";import{q as oe,r as ne,g as I,F as ie,w as z,k as re,m as y,y as F,ji as le,av as ce,o as de,j as ue,b8 as me,aw as pe,bl as xe,jj as he,jk as ge,f as je,ac as fe,a3 as _e,dn as Se,dx as we}from"./index-ChlzNN7f.js";import{r as P}from"./@dnd-kit-lk9a0Fnl.js";import{f as Ce}from"./table-pMgz8yty.js";import"./recoil-Qt05xcsG.js";import"./lodash-BGDvc8uJ.js";import"./cheerio-CC_BxCXR.js";import"./parse5-CnDYI-t1.js";import{a as be}from"./time-cells-CKBQdk27.js";import"./i18next-vSwsns86.js";import"./framer-motion-zf-c6Y7J.js";import"./ali-oss-C0WPLnSs.js";import"./apexcharts-B416p9gJ.js";const ve=re().shape({product_name:y().required("产ååç§°ä¸è½ä¸ºç©º").max(512,"æå¤512å"),main_business:y().required("产åç®ä»ä¸è½ä¸ºç©º").max(512,"æå¤512å"),core_value_proposition:y().optional().max(512,"æå¤512å"),excluded_customer_types:y().optional().max(512,"æå¤512å"),other_message:y().optional().max(512,"æå¤512å")}),ze={product_name:"",main_business:"",core_value_proposition:"",excluded_customer_types:"",other_message:""};function ye({open:u,onClose:o,onSuccess:g,rowData:m}){const p=oe({resolver:ne(ve),defaultValues:ze}),{setValue:n,handleSubmit:C}=p,{run:_,loading:j}=I(le,{manual:!0,onSuccess:a=>{const{success:c}=a??{};c&&(F("æä½æå"),g(),o())}}),b=C(async a=>{const{_id:c}=m??{};try{console.info("DATA",a),_({...a,id:c})}catch(r){console.error(r)}});return P.useEffect(()=>{if(u){const{product_name:a,main_business:c,core_value_proposition:r,excluded_customer_types:x,other_message:f}=m;n("product_name",a),n("main_business",c),n("core_value_proposition",r),n("excluded_customer_types",x),n("other_message",f)}},[u,m]),e.jsx(H,{open:u,onClose:o,fullWidth:!0,maxWidth:"sm",scroll:"body",translate:"no",children:e.jsxs(ie,{methods:p,onSubmit:b,children:[e.jsx(U,{id:"alert-dialog-title",children:"ä¿®æ¹äº§åæ¡£æ¡"}),e.jsx(V,{children:e.jsxs(i,{spacing:2,sx:{mt:1},children:[e.jsxs(i,{spacing:.25,children:[e.jsxs(i,{direction:"row",alignItems:"center",spacing:.5,sx:{px:1},children:[e.jsx(S,{variant:"subtitle2",children:"产ååç§°"}),e.jsx(N,{sx:{fontSize:16,color:"red"}})]}),e.jsx(z,{name:"product_name",size:"small",placeholder:"示ä¾ï¼å¯å®å¶ä¸éé¢ä¿æ¸©æ¯ (æä¾è´´ç/设计å®å¶)"})]}),e.jsxs(i,{spacing:.5,children:[e.jsxs(i,{direction:"row",alignItems:"center",spacing:.5,sx:{px:1},children:[e.jsx(S,{variant:"subtitle2",children:"产åç®ä»"}),e.jsx(N,{sx:{fontSize:16,color:"red"}}),e.jsx(w,{title:"ç¨å å¥è¯è¯´æ¸ æ¨ç产åãAIä¼ä»è¿éçè§£æ¨çæ ¸å¿ä¸å¡ã",children:e.jsx(k,{sx:{color:"gray"},fontSize:"small"})})]}),e.jsx(z,{multiline:!0,rows:3,name:"main_business",size:"small",placeholder:"ä¸ºå ¨ççåç礼ååãçµååçæä¾ä¸ç«å¼ä¿æ¸©æ¯ä»£å·¥æå¡ï¼æä»¬ä¸æ³¨äºé«åè´¨ãåè§è®¤è¯åææ§ä¾åºé¾"})]}),e.jsxs(i,{spacing:.5,children:[e.jsxs(i,{direction:"row",alignItems:"center",spacing:.5,sx:{px:1},children:[e.jsx(S,{variant:"subtitle2",children:"æä»¬çç¬ç¹ç¹(éå¡«)"}),e.jsx(w,{title:"ç¸æ¯åè¡ï¼æ¨æçªåºçä¼å¿æ¯ä»ä¹ï¼è¿æ¯AI夿å¹é 度çå ³é®ã",children:e.jsx(k,{sx:{color:"gray"},fontSize:"small"})})]}),e.jsx(z,{multiline:!0,rows:3,name:"core_value_proposition",size:"small",placeholder:`[åè´¨ä¿é] éç¨é£å级304é¢æï¼æ¿è¯ºç¾åç¾éè¿æ¬§ç¾é£å级æ åæµè¯ã 2[ææ§æå¡] æ¯æ500ä»¶å°æ¹é起订ï¼å¯å®å¶åçæ å¿ãé¢è²ãå è£ ï¼24å°æ¶å æä¾è®¾è®¡å¾ã`})]}),e.jsxs(i,{spacing:.5,children:[e.jsxs(i,{direction:"row",alignItems:"center",spacing:.5,sx:{px:1},children:[e.jsx(S,{variant:"subtitle2",children:"æç¡®æé¤ç客æ·ç±»å(éå¡«)"}),e.jsx(w,{title:"请æè¿°æ¨ç»å¯¹ä¸æ³åä½ç客æ·ç¹å¾ï¼AIä¼ä¸ºæ¨èªå¨è¿æ»¤æä»ä»¬ãåå¥åæå ³é®è¯é½å¯ä»¥ã",children:e.jsx(k,{sx:{color:"gray"},fontSize:"small"})})]}),e.jsx(z,{multiline:!0,rows:3,name:"excluded_customer_types",size:"small",placeholder:`ç±»åï¼ä¸ªäººæ¶è´¹è ãä¸ä»¶ä»£å模å¼çåå®¶ 3å®ä½ï¼ä¸»è¥ä½ä»·ä¿éåæå»ä»·ææ£åºæ¸ éçè¿å£å`})]}),e.jsxs(i,{spacing:.5,children:[e.jsxs(i,{direction:"row",alignItems:"center",spacing:.5,sx:{px:1},children:[e.jsx(S,{variant:"subtitle2",children:"å ³é®ä¿¡æ¯è¡¥å (éå¡«)"}),e.jsx(w,{title:"æä¾ä»¥ä¸ä¿¡æ¯è½æå¤§æåå¹é ç²¾å度ï¼è¯·åå«è¯´æã",children:e.jsx(k,{sx:{color:"gray"},fontSize:"small"})})]}),e.jsx(z,{multiline:!0,rows:3,name:"other_message",size:"small",placeholder:`æ ¸å¿è®¤è¯ï¼ä¼ä¸ç¤¾ä¼è´£ä»»ãè´¨é管çä½ç³»ã欧ç¾é£å级æ å 4æå°èµ·è®¢éï¼500ä»¶/款 5ç®æ å¸åºï¼åç¾ã欧çãæ¥æ¬`})]})]})}),e.jsxs(W,{children:[e.jsx($,{onClick:o,variant:"outlined",children:"å ³é"}),e.jsx(K,{variant:"contained",color:"primary",type:"submit",id:"addTimeBlockButton",loading:j,children:"ç¡®å®"})]})]})})}function Pe({tableData:u,loading:o,flushData:g,total:m,page:p,pageSize:n,onPageChange:C,sortModel:_,onSortChange:j,onSelectChange:b,selectKeys:a}){const[c,r]=P.useState(!1),[x,f]=P.useState({}),d=ce(),t=de(),{run:h}=I(he,{manual:!0,onSuccess:({success:s})=>{s&&(t.onFalse(),F("å 餿å"),g())}}),{run:v}=I(ge,{manual:!0,onSuccess:({success:s})=>{s&&(F("æä½æå"),g())}}),D=s=>
5e.jsxs(R,{direction:"row",alignItems:"center",spacing:1,children:[e.jsx(w,{title:"ä¿®æ¹",children:e.jsx(A,{size:"small",onClick:l=>{l==null||l.stopPropagation(),r(!0),f(s)},children:e.jsx(L,{fontSize:"small"})})}),e.jsx(w,{title:"æ´å¤æä½",children:e.jsx(A,{size:"small",onClick:l=>{l.stopPropagation(),f(s),d.onOpen(l)},children:e.jsx(Z,{fontSize:"small"})})})]}),T=[{headerName:"åç§°",field:"product_name",width:256,renderCell:({row:s})=>{const{product_name:l,isDefault:B}=s;return e.jsxs(R,{position:"relative",direction:"row",alignItems:"center",spacing:1,sx:{width:240},children:[e.jsx(S,{sx:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},variant:B?"subtitle1":void 0,children:l}),B&&e.jsx(Y,{label:"é»è®¤",color:"primary",size:"small"})]})}},{headerName:"主è¥ä¸å¡",field:"main_business",width:256},{headerName:"è§£å³çç¹",field:"pain_points_solved",width:256},{headerName:"æ ¸å¿ä»·å¼/ä¼å¿",field:"core_value_proposition",width:256},{headerName:"å建è
",field:"userid",width:128,renderCell:({row:s})=>e.jsx(xe,{value:s.userid})},{headerName:"å建æ¶é´",field:"create_time",renderCell:({row:s})=>be(s.create_time),width:160},{headerName:"æä½",field:"actions",headerClassName:"actions-header",width:100,renderCell:({row:s})=>D(s)}],{windowHeight:O}=ue();return e.jsxs(E,{sx:{height:O-176<300?300:O-176},children:[e.jsx(G,{getRowId:s=>s==null?void 0:s._id,loading:o,disableColumnMenu:!0,disableRowSelectionOnClick:!0,hideFooterSelectedRowCount:!0,rows:u,columns:T,pagination:!0,paginationMode:"server",rowCount:m,pageSizeOptions:[10,20,50,100],columnHeaderHeight:a.length?0:56,paginationModel:{page:p,pageSize:n},onPaginationModelChange:({page:s,pageSize:l})=>C(s,l),sortingMode:"server",sortModel:_,rowSelectionModel:a,onSortModelChange:s=>j(s),onRowSelectionModelChange:s=>b("current",s.length,s),initialState:{pinnedColumns:{right:["actions"]}}}),e.jsx(ye,{open:c,rowData:x,onClose:()=>r(!1),onSuccess:()=>g()}),e.jsx(me,{open:t.value,onClose:t.onFalse,title:"å é¤äº§åæ¡£æ¡",content:`确认å é¤ ${x.product_name}? 该æä½ä¸å¯æ¢å¤`,action:e.jsx($,{variant:"contained",color:"error",onClick:()=>h({id:x._id}),children:"å é¤"})}),e.jsxs(pe,{open:d.open,onClose:d.onClose,sx:{width:128},children:[e.jsxs(M,{onClick:()=>{d.onClose(),r(!0)},children:[e.jsx(L,{fontSize:"small"}),"ä¿®æ¹"]}),e.jsxs(M,{onClick:()=>{d.onClose(),v({id:x._id})},children:[e.jsx(J,{fontSize:"small"}),"设置é»è®¤"]}),e.jsx(Q,{}),e.jsxs(M,{onClick:()=>{d.onClose(),t.onTrue()},sx:{color:"error.main"},children:[e.jsx(X,{fontSize:"small"}),"å é¤"]})]})]})}function qe(){const[u,o]=je({countData:{},pageSize:10,page:1,total:0,tableData:[],sortModel:[{field:"create_time",sort:"desc"}],keyword:"",selectKeys:[],selectOption:"current",selectTotal:0,filter:{}}),[g,m]=P.useState(!1),{page:p,pageSize:n,total:C,filter:_,sortModel:j,tableData:b,keyword:a}=u,{run:c,refresh:r,loading:x}=I(we,{manual:!0,loadingDelay:300,debounceWait:300,onSuccess:t=>{const{data:h}=t;if(!h)return;const{current:v,list:D,total:T}=h??{};D&&o({tableData:D,page:v,total:T})}}),f=()=>{const t=Ce(j);c({current:p,pageSize:n,filter:_,sort:t,keyword:a})};P.useEffect(()=>{f()},[_,n,p,j,a]);const d=t=>{o({keyword:t.toLowerCase()})};return e.jsx(fe,{children:e.jsxs(ee,{children:[e.jsxs(R,{alignItems:{xs:"flex-end",md:"center"},direction:{xs:"column",md:"row"},spacing:2,sx:{p:2},children:[e.jsx(se,{size:"small",sx:{flexShrink:0,width:{xs:1,md:256}},value:a,onChange:t=>d(t.target.value),onBlur:()=>f(),placeholder:"æç´¢åç§°",InputProps:{startAdornment:e.jsx(q,{position:"start",children:e.jsx(_e,{icon:"eva:search-fill",sx:{color:"text.disabled"}})}),endAdornment:a?e.jsx(q,{position:"end",children:e.jsx(A,{onClick:()=>d(""),edge:"end",size:"small",children:e.jsx(te,{fontSize:"small"})})}):void 0}}),e.jsx(E,{flexGrow:1,sx:{display:{xs:"none",md:"block"}}}),e.jsx($,{startIcon:e.jsx(ae,{}),variant:"contained",color:"primary",onClick:()=>m(!0),children:"å¢å 产å"})]}),e.jsx(Pe,{tableData:b,loading:x,flushData:()=>r(),total:C,page:p-1,pageSize:n,onPageChange:(t,h)=>o({page:t+1,pageSize:h}),sortModel:j,onSortChange:t=>o({sortModel:t}),selectKeys:u.selectKeys,onSelectChange:(t,h,v)=>o({selectOption:t,selectTotal:h,selectKeys:v})}),e.jsx(Se,{open:g,onClose:()=>m(!1),onSuccess:()=>r()})]})})}export{qe as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.