1import{r as B,t as u,k as r,j as e,l as n,m as i,n as d,o,S as D,ab as G,B as v,Q as C,R as M,K as N,a_ as T,y as x,A as R,b1 as E,bj as W,D as Q}from"./index-CDydTNgN.js";function F(){const[l,h]=B.useState([]),[g,f]=B.useState(!1),[p,b]=B.useState([]),{data:t,isLoading:w,refetch:O}=u.blog.getPostsWithoutSeo.useQuery(),{data:I}=u.blog.getAllPosts.useQuery(),k=u.blog.batchGenerateSeo.useMutation({onSuccess:s=>{b(s.results);const a=s.results.filter(j=>j.success).length,c=s.results.filter(j=>!j.success).length;a>0&&c===0?r.success(`æåçº ${a} ç¯æç« çæ SEO è¨å®`):a>0&&c>0?r.warning(`æå ${a} ç¯ï¼å¤±æ ${c} ç¯`):r.error("æææç« é½çæå¤±æ"),h([]),O()},onError:s=>{r.error(`æ¹æ¬¡çæå¤±æï¼${s.message}`)},onSettled:()=>{f(!1)}}),A=()=>{t&&(l.length===t.length?h([]):h(t.map(s=>s.post.id)))},P=s=>{h(a=>a.includes(s)?a.filter(c=>c!==s):[...a,s])},$=()=>{if(l.length===0){r.error("è«å
鏿è¦çæ SEO çæç« ");return}f(!0),b([]),k.mutate({postIds:l})},m=I?.filter(s=>s.post.status==="published")||[],y=m.filter(s=>s.post.metaTitle&&s.post.metaDescription),S=m.length>0?Math.round(y.length/m.length*100):0;return e.jsxs("div",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:84",className:"space-y-6",children:[e.jsxs("div",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:86",children:[e.jsx("h1",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:87",className:"text-2xl font-bold text-gray-900",children:"æ¹æ¬¡ SEO æ´æ°"}),e.jsx("p",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:88",className:"text-gray-600 mt-1",children:"ä½¿ç¨ AI çºå·²ç¼å¸çæç« æ¹æ¬¡çæ SEO æ¨é¡ãæè¿°åééµå"})]}),e.jsxs("div",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:94",className:"grid gap-4 md:grid-cols-3",children:[e.jsxs(n,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:95",children:[e.jsx(i,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:96",className:"pb-2",children:e.jsx(d,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:97",className:"text-sm font-medium text-gray-600",children:"å·²ç¼å¸æç« "})}),e.jsx(o,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:99",children:e.jsx("div",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:100",className:"text-2xl font-bold",children:m.length})})]}),e.jsxs(n,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:103",children:[e.jsx(i,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:104",className:"pb-2",children:e.jsx(d,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:105",className:"text-sm font-medium text-gray-600",children:"å·²è¨å® SEO"})}),e.jsx(o,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:107",children:e.jsx("div",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:108",className:"text-2xl font-bold text-green-600",children:y.length})})]}),e.jsxs(n,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:111",children:[e.jsx(i,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:112",className:"pb-2",children:e.jsx(d,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:113",className:"text-sm font-medium text-gray-600",children:"SEO 宿ç"})}),e.jsx(o,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:115",children:e.jsx("div",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:116",className:"text-2xl font-bold",children:e.jsxs("span",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:117",className:S>=80?"text-green-600":S>=50?"text-yellow-600":"text-red-600",children:[S,"%"]})})})]})]}),e.jsxs(n,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:126",children:[e.jsx(i,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:127",children:e.jsxs("div",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:128",className:"flex items-center justify-between",children:[e.jsxs("div",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:129",children:[e.jsxs(d,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:130",className:"flex items-center gap-2",children:[e.jsx(D,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:131",className:"h-5 w-5"}),"å¾
è¨å® SEO çæç« "]}),e.jsx(G,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:134",children:"ä»¥ä¸æç« å°æªè¨å® SEO æ¨é¡ææè¿°"})]}),e.jsxs("div",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:138",className:"flex items-center gap-2",children:[e.jsx(v,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:139",variant:"outline",size:"sm",onClick:A,disabled:!t||t.length===0,children:l.length===t?.length?"åæ¶å
¨é¸":"å
¨é¸"}),e.jsx(v,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:147",onClick:$,disabled:l.length===0||g,children:g?e.jsxs(e.Fragment,{children:[e.jsx(C,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:153",className:"mr-2 h-4 w-4 animate-spin"}),"çæä¸..."]}):e.jsxs(e.Fragment,{children:[e.jsx(M,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:158",className:"mr-2 h-4 w-4"}),"æ¹æ¬¡çæ SEO (",l.length,")"]})})]})]})}),e.jsx(o,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:166",children:w?e.jsx("div",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:168",className:"flex items-center justify-center py-8",children:e.jsx(C,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:169",className:"h-8 w-8 animate-spin text-gray-400"})}):!t||t.length===0?e.jsxs("div",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:172",className:"text-center py-8 text-gray-500",children:[e.jsx(N,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:173",className:"h-12 w-12 mx-auto mb-4 text-green-500"}),e.jsx("p",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:174",className:"text-lg font-medium",children:"æææç« é½å·²è¨å® SEOï¼"}),e.jsx("p",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:175",className:"text-sm",children:"æ¨çç¶²ç« SEO è¨å®å·²å®æ"})]}):e.jsx("div",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:178",className:"space-y-2",children:t.map(s=>{const a=p.find(c=>c.postId===s.post.id);return e.jsxs("div",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:182",className:`flex items-center gap-4 p-4 rounded-lg border transition-colors ${l.includes(s.post.id)?"bg-blue-50 border-blue-200":"bg-white hover:bg-gray-50"}`,children:[e.jsx(T,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:190",checked:l.includes(s.post.id),onCheckedChange:()=>P(s.post.id),disabled:g}),e.jsxs("div",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:195",className:"flex-1 min-w-0",children:[e.jsx("h3",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:196",className:"font-medium text-gray-900 truncate",children:s.post.title}),e.jsxs("div",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:199",className:"flex items-center gap-2 mt-1 text-sm text-gray-500",children:[s.category&&e.jsx(x,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:201",variant:"secondary",className:"text-xs",children:s.category.name}),e.jsx("span",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:205",children:s.post.publishedAt?R(new Date(s.post.publishedAt),"yyyy/MM/dd",{locale:Q}):"æªç¼å¸"})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:213",className:"flex items-center gap-2",children:[!s.post.metaTitle&&e.jsx(x,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:215",variant:"outline",className:"text-xs text-orange-600 border-orange-300",children:"ç¼ºå°æ¨é¡"}),!s.post.metaDescription&&e.jsx(x,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:220",variant:"outline",className:"text-xs text-orange-600 border-orange-300",children:"ç¼ºå°æè¿°"}),a&&(a.success?e.jsxs(x,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:226",className:"bg-green-100 text-green-700",children:[e.jsx(N,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:227",className:"h-3 w-3 mr-1"}),"å·²çæ"]}):e.jsxs(x,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:231",className:"bg-red-100 text-red-700",children:[e.jsx(E,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:232",className:"h-3 w-3 mr-1"}),"失æ"]}))]})]},s.post.id)})})})]}),p.length>0&&e.jsxs(n,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:248",children:[e.jsx(i,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:249",children:e.jsxs(d,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:250",className:"flex items-center gap-2",children:[e.jsx(W,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:251",className:"h-5 w-5"}),"çæçµæ"]}
1)}),e.jsx(o,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:255",children:e.jsx("div",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:256",className:"space-y-2",children:p.map(s=>{const a=t?.find(c=>c.post.id===s.postId);return e.jsxs("div",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:260",className:`flex items-center gap-4 p-3 rounded-lg ${s.success?"bg-green-50":"bg-red-50"}`,children:[s.success?e.jsx(N,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:267",className:"h-5 w-5 text-green-600"}):e.jsx(E,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:269",className:"h-5 w-5 text-red-600"}),e.jsxs("div",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:271",className:"flex-1",children:[e.jsx("span",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:272",className:"font-medium",children:a?.post.title||`æç« ID: ${s.postId}`}),s.error&&e.jsx("p",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:276",className:"text-sm text-red-600 mt-1",children:s.error})]})]},s.postId)})})})]}),e.jsxs(n,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:288",children:[e.jsx(i,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:289",children:e.jsx(d,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:290",children:"使ç¨èªªæ"})}),e.jsxs(o,{"data-loc":"client/src/pages/admin/BatchSeo.tsx:292",className:"prose prose-sm max-w-none",children:[e.jsxs("ol",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:293",className:"list-decimal list-inside space-y-2 text-gray-600",children:[e.jsx("li",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:294",children:"å¾é¸è¦çæ SEO çæç« ï¼æé»æãå
¨é¸ãé¸ææææç« ï¼"}),e.jsx("li",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:295",children:"é»æãæ¹æ¬¡çæ SEOãæééå§çæ"}),e.jsx("li",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:296",children:"AI ææ ¹ææç« å
§å®¹èªåçæ SEO æ¨é¡ãæè¿°åééµå"}),e.jsx("li",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:297",children:"çæå®æå¾ï¼æ¨å¯ä»¥å¨æç« 編輯é 颿¥çåä¿®æ¹ SEO è¨å®"})]}),e.jsxs("p",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:299",className:"mt-4 text-sm text-gray-500",children:[e.jsx("strong",{"data-loc":"client/src/pages/admin/BatchSeo.tsx:300",children:"æç¤ºï¼"}),"æ¹æ¬¡çæå¯è½éè¦ä¸äºæéï¼è«èå¿çå¾
ãæ¯ç¯æç« ç SEO è¨å®é½ææ ¹æå
¶å
§å®¹ç¨ç«çæã"]})]})]})]})}export{F 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.