diff --git a/app/.env b/app/.env
index bda0ef7ff..6a503c9b5 100644
--- a/app/.env
+++ b/app/.env
@@ -7,7 +7,7 @@ proxy_url=https://api.jikip.com/ip-get?num=1&minute=1&format=json&area=all&proto
proxy_mode=2
client_name=NanriAI
-java_api_base=http://8.136.19.173:18080
-# java_api_base=http://127.0.0.1:18080
+# java_api_base=http://8.136.19.173:18080
+java_api_base=http://127.0.0.1:18080
diff --git a/app/__pycache__/config.cpython-312.pyc b/app/__pycache__/config.cpython-312.pyc
index 419f847b3..75469398c 100644
Binary files a/app/__pycache__/config.cpython-312.pyc and b/app/__pycache__/config.cpython-312.pyc differ
diff --git a/app/assets/delete-brand.js b/app/assets/delete-brand.js
index e486b0470..d110e9be2 100644
--- a/app/assets/delete-brand.js
+++ b/app/assets/delete-brand.js
@@ -1 +1 @@
-import{d as is,o as cs,J as us,a as n,c as o,b as ds,B as fs,e as a,F as w,r as N,t as r,f as i,K as vs,L as Q,n as W,g as d,h as R,i as m,E as u,j as _s,M as ps,N as hs,O as ys,P as ks,Q as gs,_ as bs,q as ws,s as ms}from"./pywebview-C8Bik-Sc.js";const Is={class:"page-shell module-page"},Cs={class:"main-content"},$s={class:"left-panel"},xs={class:"upload-zone"},Ps={class:"selected-files clean-placeholder split-selected-files"},Ss={key:0,class:"more-line"},Fs={key:1},Rs={class:"run-row"},Ts=["disabled"],Bs={class:"loading-msg"},Ds={key:0,class:"queue-debug-card"},Es={key:0,class:"queue-debug-line"},Ns={key:1,class:"queue-debug-payload"},Us={class:"right-panel"},qs={class:"task-list-wrap"},Ms={class:"clean-result-summary"},js={class:"summary-card"},Vs={class:"summary-card"},zs={class:"summary-card"},As={class:"result-list-wrap"},Ks={key:0,class:"empty-tasks"},Hs={key:0,class:"result-subsection"},Js={class:"task-list clean-result-list"},Ls={class:"left split-result-main"},Os=["title"],Gs={class:"files"},Qs={class:"files"},Ws={key:0,class:"files"},Xs={key:1,class:"files"},Ys={key:2,class:"time"},Zs={key:3,class:"delete-brand-progress-block"},se={class:"delete-brand-progress-header"},ee={class:"delete-brand-progress-bar"},te={class:"files delete-brand-progress"},ae={key:4,class:"files split-entry-list delete-brand-preview"},le={key:5,class:"files"},ne={class:"task-right split-result-actions"},oe=["onClick"],re=["onClick"],ie=["onClick"],ce={key:1,class:"result-subsection"},ue={class:"task-list clean-result-list"},de={class:"left split-result-main"},fe=["title"],ve={class:"files"},_e={class:"files"},pe={key:0,class:"files"},he={key:1,class:"files"},ye={key:2,class:"time"},ke={key:3,class:"delete-brand-progress-block"},ge={class:"delete-brand-progress-header"},be={class:"delete-brand-progress-bar"},we={class:"files delete-brand-progress"},me={key:4,class:"files split-entry-list delete-brand-preview"},Ie={key:5,class:"files"},Ce={class:"task-right split-result-actions"},$e=["onClick"],xe=["onClick"],Pe=["onClick"],Se=is({__name:"BrandDeleteBrandTab",setup(Re){const h=d([]),I=d([]),k=d(!1),U=d([]),v=d([]),C=d([]),$=d({total:0,successCount:0,failedCount:0,items:[]}),y=d(""),g=d(""),_=d({}),p=d(null),T=d(!1),B=R(()=>h.value.slice(0,10)),x=R(()=>v.value),P=R(()=>C.value.filter(t=>!v.value.some(e=>(e.resultId||e.taskId||e.fileKey||e.sourceFilename)===(t.resultId||t.taskId||t.fileKey||t.sourceFilename)))),X=R(()=>x.value.length>0||P.value.length>0);function q(t){return t.map(e=>e.matched?e:{...e,success:!1,error:e.error||"未匹配到紫鸟店铺",taskId:void 0,openStoreUrl:void 0})}function Y(){U.value=[...x.value,...P.value]}function D(){Y(),Z(U.value)}function Z(t){$.value={total:t.length,successCount:t.filter(e=>e.success).length,failedCount:t.filter(e=>!e.success).length,items:t}}function ss(t){return t.taskId||0}function M(t){if(!t)return"";const e=_.value[t],s=e?.line_progress?.info;if(!e?.line_progress?.has_progress||!s){const c=e?.task?.status;return c?`任务状态:${c}`:""}const l=[];return s.phase&&l.push(`阶段:${s.phase}`),s.file_index&&s.file_total&&l.push(`文件:${s.file_index}/${s.file_total}`),s.file_name&&l.push(`当前文件:${s.file_name}`),s.current_line!==void 0&&s.total_lines!==void 0&&l.push(`进度:${s.current_line}/${s.total_lines}`),s.current_country&&l.push(`国家:${s.current_country}`),s.current_asin&&l.push(`ASIN:${s.current_asin}`),s.finished_files!==void 0&&l.push(`已完成文件:${s.finished_files}`),l.join("|")}function S(t){if(!t)return 0;const e=_.value[t]?.line_progress?.info;return e?e.current_line!==void 0&&e.total_lines&&e.total_lines>0?Math.max(0,Math.min(100,Math.round(e.current_line/e.total_lines*100))):e.finished_files!==void 0&&e.file_total&&e.file_total>0?Math.max(0,Math.min(100,Math.round(e.finished_files/e.file_total*100))):_.value[t]?.task?.status==="SUCCESS"?100:0:0}function es(t){return _.value[t]?.task?.status==="RUNNING"}function ts(t){const e=_.value[t]?.task?.status;return e==="SUCCESS"||e==="FAILED"}function F(){return Array.from(new Set(v.value.filter(t=>t.matched&&(t.taskId||0)>0).map(ss).filter(t=>t>0&&!ts(t))))}function j(t){const e=t.taskId;return!e||!t.matched?!1:_.value[e]?.task?.status==="SUCCESS"}async function V(t){const e=t||F();if(e.length)try{const s=await gs(e);for(const l of s.items||[]){const c=l?.task?.id;typeof c=="number"&&c>0&&(_.value[c]=l)}}catch{}}function as(){return document.visibilityState==="visible"?4500:1e4}function E(){p.value||(p.value=window.setTimeout(async()=>{if(p.value=null,T.value){E();return}const t=F();if(!t.length)return;T.value=!0;try{await V(t)}finally{T.value=!1}t.some(s=>es(s))&&E()},as()))}function ls(){p.value||E()}function z(){p.value&&(window.clearTimeout(p.value),p.value=null)}async function A(t){const e=m();if(!e?.upload_file_to_java)throw new Error("当前桌面端未提供文件上传桥接能力");const s=[];for(const l of t){const c=typeof l=="string"?l:l.absolutePath,f=typeof l=="string"?void 0:l.relativePath,b=await e.upload_file_to_java(c,f);if(!b?.success||!b.data)throw new Error(b?.error||b?.message||`上传失败:${c}`);s.push(b.data)}return s}async function ns(){const t=m();if(!t?.select_brand_xlsx_files){u.warning("当前环境不支持文件选择,请在本机客户端中打开");return}try{const e=await t.select_brand_xlsx_files();if(!e?.length)return;h.value=e,I.value=await A(e),u.success(`已选择 ${e.length} 个删除品牌文件`)}catch(e){u.error(e instanceof Error?e.message:"选择失败")}}async function os(){const t=m();if(!t?.select_brand_folder){u.warning("当前环境不支持文件夹选择,请在本机客户端中打开");return}try{const e=await t.select_brand_folder();if(!e)return;const s=await _s(e);if(!s.success||!s.items?.length){u.warning(s.error||"该文件夹下没有 xlsx 文件");return}h.value=s.items.map(l=>l.relativePath||l.absolutePath),I.value=await A(s.items),u.success(`已选择文件夹内 ${s.items.length} 个 xlsx 文件`)}catch(e){u.error(e instanceof Error?e.message:"选择失败")}}async function rs(){if(!I.value.length){u.warning("请先选择待处理文件");return}try{k.value=!0;const t=await ps({files:I.value.map(c=>({fileKey:c.fileKey,originalFilename:c.originalFilename,relativePath:c.relativePath}))}),e=q(t.items||[]);v.value=e,D(),await V(F()),ls();const s=m(),l=e.some(c=>!c.matched);if(!l&&s?.enqueue_json){const c={type:"delete-brand-run",ts:Date.now(),data:{...t,items:e}};g.value=JSON.stringify(c,null,2);const f=await s.enqueue_json(c);f?.success?y.value=`已推送到 Python 队列,当前队列长度:${f.queue_size??"-"}`:y.value=`推送到 Python 队列失败:${f?.error||"未知错误"}`}else y.value=l?"存在未匹配到紫鸟店铺的文件,已跳过推送到 Python 队列":"当前环境未启用 pywebview enqueue_json(浏览器环境不会推送)",g.value="";l?u.error("存在未匹配到紫鸟店铺的文件,已标记为失败"):u.success("删除品牌解析完成")}catch(t){u.error(t instanceof Error?t.message:"执行失败")}finally{k.value=!1}}async function K(t){const e=t.taskId;if(!e){u.warning("未找到任务ID");return}const s=m(),l=hs(e),c=t.outputFilename||t.sourceFilename||`delete-brand_${e}.xlsx`;if(s?.save_file_from_url){const f=await s.save_file_from_url(l,c);f.success?u.success(`已保存:${f.path||c}`):f.error&&f.error!=="用户取消"&&u.error(f.error);return}window.open(l,"_blank")}async function H(){try{const t=await ys();C.value=q(t.items||[]),D()}catch{}}function J(t){const s=v.value.find(l=>l.resultId===t)?.taskId;v.value=v.value.filter(l=>l.resultId!==t),C.value=C.value.filter(l=>l.resultId!==t),s&&!v.value.some(l=>l.taskId===s)&&delete _.value[s],D(),F().length===0&&z()}async function L(t){try{await ks(t),J(t),await H(),u.success("已删除")}catch(e){const s=e instanceof Error?e.message:"删除失败";if(typeof s=="string"&&s.includes("记录不存在")){J(t),u.success("已删除");return}u.error(s)}}function O(t){const e=t.slice(0,5).map(l=>`${l.country}:${l.asin}${l.status?`(${l.status})`:""}`);return t.length-e.length>0?`${e.join("、")} 等 ${t.length} 条`:e.join("、")}function G(t){window.open(t,"_blank")}return cs(()=>{H().catch(()=>{})}),us(()=>{z()}),(t,e)=>(n(),o("div",Is,[ds(fs,{active:"delete-brand"}),a("div",Cs,[a("aside",$s,[e[2]||(e[2]=a("div",{class:"section-title"},"选择文件",-1)),a("div",xs,[e[0]||(e[0]=a("div",{class:"hint"},"上传删除品牌 Excel;无论是直接上传文件还是上传文件夹批量导入,都会按每个 Excel 文件名作为店铺名。",-1)),a("div",{class:"btns"},[a("button",{type:"button",class:"opt-btn",onClick:ns},"选择 Excel 文件"),a("button",{type:"button",class:"opt-btn",onClick:os},"选择文件夹")]),a("div",Ps,[h.value.length?(n(),o(w,{key:0},[(n(!0),o(w,null,N(B.value,s=>(n(),o("span",{key:s},r(s),1))),128)),h.value.length>B.value.length?(n(),o("span",Ss," 还有 "+r(h.value.length-B.value.length)+" 个文件未展开显示 ",1)):i("",!0)],64)):(n(),o("span",Fs,"暂未选择删除品牌文件"))])]),e[3]||(e[3]=vs('
执行说明
',2)),a("div",Rs,[a("button",{type:"button",class:"btn-run",disabled:k.value,onClick:rs},r(k.value?"解析中...":"开始解析"),9,Ts),a("span",Bs,r(k.value?"正在读取删除品牌数据,请稍候…":"解析后会在右侧展示按国家分组的去重结果"),1)]),y.value||g.value?(n(),o("div",Ds,[e[1]||(e[1]=a("div",{class:"section-title queue-debug-title"},"Python 队列推送结果",-1)),y.value?(n(),o("div",Es,r(y.value),1)):i("",!0),g.value?(n(),o("pre",Ns,r(g.value),1)):i("",!0)])):i("",!0)]),a("section",Us,[e[12]||(e[12]=a("div",{class:"panel-header"},"删除品牌结果",-1)),a("div",qs,[a("div",Ms,[a("div",js,[e[4]||(e[4]=a("span",{class:"summary-label"},"已处理文件",-1)),a("strong",null,r($.value.total),1)]),a("div",Vs,[e[5]||(e[5]=a("span",{class:"summary-label"},"成功结果",-1)),a("strong",null,r($.value.successCount),1)]),a("div",zs,[e[6]||(e[6]=a("span",{class:"summary-label"},"失败文件",-1)),a("strong",null,r($.value.failedCount),1)])]),a("div",As,[e[11]||(e[11]=a("div",{class:"result-list-header"},[a("span",null,"删除品牌结果列表")],-1)),X.value?(n(),o(w,{key:1},[x.value.length?(n(),o("div",Hs,[e[8]||(e[8]=a("div",{class:"result-subsection-title"},"当前任务",-1)),a("ul",Js,[(n(!0),o(w,null,N(x.value,s=>(n(),o("li",{key:`current-${s.resultId||s.taskId||s.sourceFilename}`,class:"task-item split-result-item"},[a("div",Ls,[a("span",{class:"id",title:s.sourceFilename},r(s.sourceFilename||"-"),9,Os),a("div",Gs,"店铺名:"+r(s.shopName||"-"),1),a("div",Qs,"匹配结果:"+r(s.matched?`已匹配 ${s.shopId||""}`:"未匹配到紫鸟店铺"),1),s.platform?(n(),o("div",Ws,"平台:"+r(s.platform),1)):i("",!0),s.countryCount!==void 0&&s.matched?(n(),o("div",Xs,"国家数:"+r(s.countryCount),1)):i("",!0),s.totalRows!==void 0&&s.matched?(n(),o("div",Ys,"去重后 "+r(s.totalRows)+" 条",1)):i("",!0),s.taskId&&s.matched?(n(),o("div",Zs,[a("div",se,[e[7]||(e[7]=a("span",null,"任务进度",-1)),a("span",null,r(S(s.taskId))+"%",1)]),a("div",ee,[a("div",{class:"delete-brand-progress-bar-fill",style:Q({width:`${S(s.taskId)}%`})},null,4)]),a("div",te,r(M(s.taskId)),1)])):i("",!0),s.previewRows?.length?(n(),o("div",ae,r(O(s.previewRows)),1)):i("",!0),s.error?(n(),o("div",le,"错误信息:"+r(s.error),1)):i("",!0)]),a("div",ne,[a("span",{class:W(["status",s.success?"success":"failed"])},r(s.success?"已完成":"失败"),3),s.openStoreUrl?(n(),o("button",{key:0,type:"button",class:"download",onClick:l=>G(s.openStoreUrl)}," 打开紫鸟 ",8,oe)):i("",!0),j(s)?(n(),o("button",{key:1,type:"button",class:"download",onClick:l=>K(s)}," 下载 ",8,re)):i("",!0),s.resultId?(n(),o("button",{key:2,type:"button",class:"btn-delete",onClick:l=>L(s.resultId)}," 删除 ",8,ie)):i("",!0)])]))),128))])])):i("",!0),P.value.length?(n(),o("div",ce,[e[10]||(e[10]=a("div",{class:"result-subsection-title"},"历史记录",-1)),a("ul",ue,[(n(!0),o(w,null,N(P.value,s=>(n(),o("li",{key:`history-${s.resultId||s.taskId||s.sourceFilename}`,class:"task-item split-result-item"},[a("div",de,[a("span",{class:"id",title:s.sourceFilename},r(s.sourceFilename||"-"),9,fe),a("div",ve,"店铺名:"+r(s.shopName||"-"),1),a("div",_e,"匹配结果:"+r(s.matched?`已匹配 ${s.shopId||""}`:"未匹配到紫鸟店铺"),1),s.platform?(n(),o("div",pe,"平台:"+r(s.platform),1)):i("",!0),s.countryCount!==void 0&&s.matched?(n(),o("div",he,"国家数:"+r(s.countryCount),1)):i("",!0),s.totalRows!==void 0&&s.matched?(n(),o("div",ye,"去重后 "+r(s.totalRows)+" 条",1)):i("",!0),s.taskId&&s.matched?(n(),o("div",ke,[a("div",ge,[e[9]||(e[9]=a("span",null,"任务进度",-1)),a("span",null,r(S(s.taskId))+"%",1)]),a("div",be,[a("div",{class:"delete-brand-progress-bar-fill",style:Q({width:`${S(s.taskId)}%`})},null,4)]),a("div",we,r(M(s.taskId)),1)])):i("",!0),s.previewRows?.length?(n(),o("div",me,r(O(s.previewRows)),1)):i("",!0),s.error?(n(),o("div",Ie,"错误信息:"+r(s.error),1)):i("",!0)]),a("div",Ce,[a("span",{class:W(["status",s.success?"success":"failed"])},r(s.success?"已完成":"失败"),3),s.openStoreUrl?(n(),o("button",{key:0,type:"button",class:"download",onClick:l=>G(s.openStoreUrl)}," 打开紫鸟 ",8,$e)):i("",!0),j(s)?(n(),o("button",{key:1,type:"button",class:"download",onClick:l=>K(s)}," 下载 ",8,xe)):i("",!0),s.resultId?(n(),o("button",{key:2,type:"button",class:"btn-delete",onClick:l=>L(s.resultId)}," 删除 ",8,Pe)):i("",!0)])]))),128))])])):i("",!0)],64)):(n(),o("div",Ks," 暂无删除品牌结果,完成解析后会在这里展示按国家分组的去重结果 "))])])])])]))}}),Fe=bs(Se,[["__scopeId","data-v-d0cf6f24"]]);ws(Fe).use(ms).mount("#app");
+import{d as fs,o as vs,J as _s,a as l,c as o,b as ps,B as hs,e as a,F as m,r as M,t as r,f as u,K as ks,L as ss,n as es,g as f,h as C,i as S,E as c,j as ys,M as bs,N as gs,O as Is,P as ws,Q as ms,_ as Cs,q as Ss,s as Ns}from"./pywebview-C8Bik-Sc.js";const xs={class:"page-shell module-page"},$s={class:"main-content"},Ps={class:"left-panel"},Rs={class:"upload-zone"},Es={class:"selected-files clean-placeholder split-selected-files"},Fs={key:0,class:"more-line"},Ts={key:1},Ds={class:"run-row"},Us=["disabled"],Bs={class:"loading-msg"},qs={key:0,class:"queue-debug-card"},Ms={key:0,class:"queue-debug-line"},js={key:1,class:"queue-debug-payload"},As={class:"right-panel"},Gs={class:"task-list-wrap"},Vs={class:"clean-result-summary"},zs={class:"summary-card"},Hs={class:"summary-card"},Ls={class:"summary-card"},Js={class:"result-list-wrap"},Ks={key:0,class:"empty-tasks"},Os={key:0,class:"result-subsection"},Qs={class:"task-list clean-result-list"},Ws={class:"left split-result-main"},Xs=["title"],Ys={class:"files"},Zs={class:"files"},se={key:0,class:"files"},ee={key:1,class:"files"},te={key:2,class:"time"},ae={key:3,class:"delete-brand-progress-block"},ne={class:"delete-brand-progress-header"},le={class:"delete-brand-progress-bar"},oe={class:"files delete-brand-progress"},re={key:4,class:"files split-entry-list delete-brand-preview"},ue={key:5,class:"files"},ie={class:"task-right split-result-actions"},ce=["onClick"],de=["onClick"],fe=["onClick"],ve={key:1,class:"result-subsection"},_e={class:"task-list clean-result-list"},pe={class:"left split-result-main"},he=["title"],ke={class:"files"},ye={class:"files"},be={key:0,class:"files"},ge={key:1,class:"files"},Ie={key:2,class:"time"},we={key:3,class:"delete-brand-progress-block"},me={class:"delete-brand-progress-header"},Ce={class:"delete-brand-progress-bar"},Se={class:"files delete-brand-progress"},Ne={key:4,class:"files split-entry-list delete-brand-preview"},xe={key:5,class:"files"},$e={class:"task-right split-result-actions"},Pe=["onClick"],Re=["onClick"],Ee=["onClick"],Fe=fs({__name:"BrandDeleteBrandTab",setup(De){const k=f([]),N=f([]),b=f(!1),j=f([]),p=f([]),h=f([]),x=f({total:0,successCount:0,failedCount:0,items:[]}),y=f(""),g=f(""),d=f({}),_=f(null),T=f(!1),D=C(()=>k.value.slice(0,10)),ts=C(()=>h.value.filter(t=>{const s=t.taskId?d.value[t.taskId]?.task?.status:null;return s?s==="RUNNING":t.taskStatus?t.taskStatus==="RUNNING":(t.taskId||0)>0&&t.success===!1&&!t.error}).map(t=>t.taskId)),I=C(()=>{const t=[...p.value];return h.value.forEach(s=>{s.taskId&&ts.value.includes(s.taskId)&&(t.some(e=>e.taskId===s.taskId)||t.push(s))}),t}),$=C(()=>h.value.filter(t=>!I.value.some(s=>s.taskId===t.taskId||s.resultId&&s.resultId===t.resultId))),as=C(()=>I.value.length>0||$.value.length>0);function ns(t){return t&&d.value[t]?.task?.status||""}function P(t){if(t.error)return t.error;const s=t.taskId;return s&&d.value[s]?.task?.errorMessage||""}function A(t){const s=t.taskId;return s?ns(s)==="RUNNING":!1}function G(t){return t.map(s=>s.matched===!1?{...s,success:!1,error:s.error||"未匹配到紫鸟店铺",openStoreUrl:void 0}:s)}function ls(){j.value=[...I.value,...$.value]}function U(){ls(),os(j.value)}function os(t){x.value={total:t.length,successCount:t.filter(s=>s.success).length,failedCount:t.filter(s=>!s.success).length,items:t}}function V(t){if(!t)return"";const s=d.value[t],e=s?.line_progress?.info;if(!s?.line_progress?.has_progress||!e){const i=s?.task?.status;return i?`任务状态:${i}`:""}const n=[];return e.phase&&n.push(`阶段:${e.phase}`),e.file_index&&e.file_total&&n.push(`文件:${e.file_index}/${e.file_total}`),e.file_name&&n.push(`当前文件:${e.file_name}`),e.current_line!=null&&e.total_lines!=null&&n.push(`进度:${e.current_line}/${e.total_lines}`),e.current_country&&n.push(`国家:${e.current_country}`),e.current_asin&&n.push(`ASIN:${e.current_asin}`),e.finished_files!=null&&n.push(`已完成文件:${e.finished_files}`),n.join("|")}function R(t){if(!t)return 0;const s=d.value[t]?.line_progress?.info;return s?s.current_line!=null&&s.total_lines&&s.total_lines>0?Math.max(0,Math.min(100,Math.round(s.current_line/s.total_lines*100))):s.finished_files!=null&&s.file_total&&s.file_total>0?Math.max(0,Math.min(100,Math.round(s.finished_files/s.file_total*100))):d.value[t]?.task?.status==="SUCCESS"?100:0:0}function rs(t){return d.value[t]?.task?.status==="RUNNING"}function z(t){const s=d.value[t]?.task?.status;return s==="SUCCESS"||s==="FAILED"}function E(){const t=new Set;return p.value.forEach(s=>{s.taskId&&!z(s.taskId)&&t.add(s.taskId)}),h.value.forEach(s=>{s.taskId&&(d.value[s.taskId]?z(s.taskId)||t.add(s.taskId):(s.taskStatus==="RUNNING"||!s.taskStatus&&!s.success&&!s.error)&&t.add(s.taskId))}),Array.from(t)}function H(t){const s=t.taskId;return!s||!t.matched?!1:d.value[s]?.task?.status==="SUCCESS"}async function B(t){const s=t||E();if(s.length)try{const e=await ms(s);for(const n of e.items||[]){const i=n?.task?.id;typeof i=="number"&&i>0&&(d.value[i]=n)}}catch{}}function us(){return document.visibilityState==="visible"?4500:1e4}function q(t=!1){if(_.value){if(!t)return;clearTimeout(_.value),_.value=null}const s=async()=>{if(_.value=null,T.value){q();return}const e=E();if(!e.length)return;T.value=!0;try{await B(e)}finally{T.value=!1}e.some(i=>rs(i))&&q()};t?s():_.value=window.setTimeout(s,us())}function L(t=!1){_.value&&!t||q(t)}function F(t){const s=t.taskId?d.value[t.taskId]?.task?.status:null;return s==="SUCCESS"?{className:"success",text:"已完成"}:s==="FAILED"?{className:"failed",text:"失败"}:s==="RUNNING"?{className:"running",text:"执行中"}:t.taskStatus==="SUCCESS"?{className:"success",text:"已完成"}:t.taskStatus==="FAILED"?{className:"failed",text:"失败"}:t.taskStatus==="RUNNING"?{className:"running",text:"执行中"}:t.success?{className:"success",text:"已完成"}:{className:"failed",text:"失败"}}function J(){_.value&&(window.clearTimeout(_.value),_.value=null)}async function K(t){const s=S();if(!s?.upload_file_to_java)throw new Error("当前桌面端未提供文件上传桥接能力");const e=[];for(const n of t){const i=typeof n=="string"?n:n.absolutePath,v=typeof n=="string"?void 0:n.relativePath,w=await s.upload_file_to_java(i,v);if(!w?.success||!w.data)throw new Error(w?.error||w?.message||`上传失败:${i}`);e.push(w.data)}return e}async function is(){const t=S();if(!t?.select_brand_xlsx_files){c.warning("当前环境不支持文件选择,请在本机客户端中打开");return}try{const s=await t.select_brand_xlsx_files();if(!s?.length)return;k.value=s,N.value=await K(s),c.success(`已选择 ${s.length} 个删除品牌文件`)}catch(s){c.error(s instanceof Error?s.message:"选择失败")}}async function cs(){const t=S();if(!t?.select_brand_folder){c.warning("当前环境不支持文件夹选择,请在本机客户端中打开");return}try{const s=await t.select_brand_folder();if(!s)return;const e=await ys(s);if(!e.success||!e.items?.length){c.warning(e.error||"该文件夹下没有 xlsx 文件");return}k.value=e.items.map(n=>n.relativePath||n.absolutePath),N.value=await K(e.items),c.success(`已选择文件夹内 ${e.items.length} 个 xlsx 文件`)}catch(s){c.error(s instanceof Error?s.message:"选择失败")}}async function ds(){if(!N.value.length){c.warning("请先选择待处理文件");return}try{b.value=!0;const t=await bs({files:N.value.map(i=>({fileKey:i.fileKey,originalFilename:i.originalFilename,relativePath:i.relativePath}))}),s=G(t.items||[]);p.value=s,U(),await B(E()),L();const e=S(),n=s.some(i=>!i.matched);if(!n&&e?.enqueue_json){const i={type:"delete-brand-run",ts:Date.now(),data:{...t,items:s}};g.value=JSON.stringify(i,null,2);const v=await e.enqueue_json(i);v?.success?y.value=`已推送到 Python 队列,当前队列长度:${v.queue_size??"-"}`:y.value=`推送到 Python 队列失败:${v?.error||"未知错误"}`}else y.value=n?"存在未匹配到紫鸟店铺的文件,已跳过推送到 Python 队列":"当前环境未启用 pywebview enqueue_json(浏览器环境不会推送)",g.value="";n?c.error("存在未匹配到紫鸟店铺的文件,已标记为失败"):c.success("删除品牌解析完成")}catch(t){c.error(t instanceof Error?t.message:"执行失败")}finally{b.value=!1}}async function O(t){const s=t.taskId;if(!s){c.warning("未找到任务ID");return}const e=S(),n=gs(s),i=t.outputFilename||t.sourceFilename||`delete-brand_${s}.xlsx`;if(e?.save_file_from_url){const v=await e.save_file_from_url(n,i);v.success?c.success(`已保存:${v.path||i}`):v.error&&v.error!=="用户取消"&&c.error(v.error);return}window.open(n,"_blank")}async function Q(){try{const t=await Is();h.value=G(t.items||[]),U(),await B(),L(!0)}catch(t){console.error("loadHistory error:",t)}}function W(t){const e=p.value.find(n=>n.resultId===t)?.taskId;p.value=p.value.filter(n=>n.resultId!==t),h.value=h.value.filter(n=>n.resultId!==t),e&&!p.value.some(n=>n.taskId===e)&&delete d.value[e],U(),E().length===0&&J()}async function X(t){try{await ws(t),W(t),await Q(),c.success("已删除")}catch(s){const e=s instanceof Error?s.message:"删除失败";if(typeof e=="string"&&e.includes("记录不存在")){W(t),c.success("已删除");return}c.error(e)}}function Y(t){const s=t.slice(0,5).map(n=>`${n.country}:${n.asin}${n.status?`(${n.status})`:""}`);return t.length-s.length>0?`${s.join("、")} 等 ${t.length} 条`:s.join("、")}function Z(t){window.open(t,"_blank")}return vs(()=>{Q().catch(()=>{})}),_s(()=>{J()}),(t,s)=>(l(),o("div",xs,[ps(hs,{active:"delete-brand"}),a("div",$s,[a("aside",Ps,[s[2]||(s[2]=a("div",{class:"section-title"},"选择文件",-1)),a("div",Rs,[s[0]||(s[0]=a("div",{class:"hint"},"上传删除品牌 Excel;无论是直接上传文件还是上传文件夹批量导入,都会按每个 Excel 文件名作为店铺名。",-1)),a("div",{class:"btns"},[a("button",{type:"button",class:"opt-btn",onClick:is},"选择 Excel 文件"),a("button",{type:"button",class:"opt-btn",onClick:cs},"选择文件夹")]),a("div",Es,[k.value.length?(l(),o(m,{key:0},[(l(!0),o(m,null,M(D.value,e=>(l(),o("span",{key:e},r(e),1))),128)),k.value.length>D.value.length?(l(),o("span",Fs," 还有 "+r(k.value.length-D.value.length)+" 个文件未展开显示 ",1)):u("",!0)],64)):(l(),o("span",Ts,"暂未选择删除品牌文件"))])]),s[3]||(s[3]=ks('执行说明
',2)),a("div",Ds,[a("button",{type:"button",class:"btn-run",disabled:b.value,onClick:ds},r(b.value?"解析中...":"开始解析"),9,Us),a("span",Bs,r(b.value?"正在读取删除品牌数据,请稍候…":"解析后会在右侧展示按国家分组的去重结果"),1)]),y.value||g.value?(l(),o("div",qs,[s[1]||(s[1]=a("div",{class:"section-title queue-debug-title"},"Python 队列推送结果",-1)),y.value?(l(),o("div",Ms,r(y.value),1)):u("",!0),g.value?(l(),o("pre",js,r(g.value),1)):u("",!0)])):u("",!0)]),a("section",As,[s[12]||(s[12]=a("div",{class:"panel-header"},"删除品牌结果",-1)),a("div",Gs,[a("div",Vs,[a("div",zs,[s[4]||(s[4]=a("span",{class:"summary-label"},"已处理文件",-1)),a("strong",null,r(x.value.total),1)]),a("div",Hs,[s[5]||(s[5]=a("span",{class:"summary-label"},"成功结果",-1)),a("strong",null,r(x.value.successCount),1)]),a("div",Ls,[s[6]||(s[6]=a("span",{class:"summary-label"},"失败文件",-1)),a("strong",null,r(x.value.failedCount),1)])]),a("div",Js,[s[11]||(s[11]=a("div",{class:"result-list-header"},[a("span",null,"删除品牌结果列表")],-1)),as.value?(l(),o(m,{key:1},[I.value.length?(l(),o("div",Os,[s[8]||(s[8]=a("div",{class:"result-subsection-title"},"当前任务",-1)),a("ul",Qs,[(l(!0),o(m,null,M(I.value,e=>(l(),o("li",{key:`current-${e.resultId||e.taskId||e.sourceFilename}`,class:"task-item split-result-item"},[a("div",Ws,[a("span",{class:"id",title:e.sourceFilename},r(e.sourceFilename||"-"),9,Xs),a("div",Ys,"店铺名:"+r(e.shopName||"-"),1),a("div",Zs,"匹配结果:"+r(e.matched?`已匹配 ${e.shopId||""}`:"未匹配到紫鸟店铺"),1),e.platform?(l(),o("div",se,"平台:"+r(e.platform),1)):u("",!0),e.countryCount!==void 0&&e.matched?(l(),o("div",ee,"国家数:"+r(e.countryCount),1)):u("",!0),e.totalRows!==void 0&&e.matched?(l(),o("div",te,"去重后 "+r(e.totalRows)+" 条",1)):u("",!0),A(e)?(l(),o("div",ae,[a("div",ne,[s[7]||(s[7]=a("span",null,"任务进度",-1)),a("span",null,r(R(e.taskId))+"%",1)]),a("div",le,[a("div",{class:"delete-brand-progress-bar-fill",style:ss({width:`${R(e.taskId)}%`})},null,4)]),a("div",oe,r(V(e.taskId)),1)])):u("",!0),e.previewRows?.length?(l(),o("div",re,r(Y(e.previewRows)),1)):u("",!0),P(e)?(l(),o("div",ue,"错误信息:"+r(P(e)),1)):u("",!0)]),a("div",ie,[a("span",{class:es(["status",F(e).className])},r(F(e).text),3),e.openStoreUrl?(l(),o("button",{key:0,type:"button",class:"download",onClick:n=>Z(e.openStoreUrl)}," 打开紫鸟 ",8,ce)):u("",!0),H(e)?(l(),o("button",{key:1,type:"button",class:"download",onClick:n=>O(e)}," 下载 ",8,de)):u("",!0),e.resultId?(l(),o("button",{key:2,type:"button",class:"btn-delete",onClick:n=>X(e.resultId)}," 删除 ",8,fe)):u("",!0)])]))),128))])])):u("",!0),$.value.length?(l(),o("div",ve,[s[10]||(s[10]=a("div",{class:"result-subsection-title"},"历史记录",-1)),a("ul",_e,[(l(!0),o(m,null,M($.value,e=>(l(),o("li",{key:`history-${e.resultId||e.taskId||e.sourceFilename}`,class:"task-item split-result-item"},[a("div",pe,[a("span",{class:"id",title:e.sourceFilename},r(e.sourceFilename||"-"),9,he),a("div",ke,"店铺名:"+r(e.shopName||"-"),1),a("div",ye,"匹配结果:"+r(e.matched?`已匹配 ${e.shopId||""}`:"未匹配到紫鸟店铺"),1),e.platform?(l(),o("div",be,"平台:"+r(e.platform),1)):u("",!0),e.countryCount!==void 0&&e.matched?(l(),o("div",ge,"国家数:"+r(e.countryCount),1)):u("",!0),e.totalRows!==void 0&&e.matched?(l(),o("div",Ie,"去重后 "+r(e.totalRows)+" 条",1)):u("",!0),A(e)?(l(),o("div",we,[a("div",me,[s[9]||(s[9]=a("span",null,"任务进度",-1)),a("span",null,r(R(e.taskId))+"%",1)]),a("div",Ce,[a("div",{class:"delete-brand-progress-bar-fill",style:ss({width:`${R(e.taskId)}%`})},null,4)]),a("div",Se,r(V(e.taskId)),1)])):u("",!0),e.previewRows?.length?(l(),o("div",Ne,r(Y(e.previewRows)),1)):u("",!0),P(e)?(l(),o("div",xe,"错误信息:"+r(P(e)),1)):u("",!0)]),a("div",$e,[a("span",{class:es(["status",F(e).className])},r(F(e).text),3),e.openStoreUrl?(l(),o("button",{key:0,type:"button",class:"download",onClick:n=>Z(e.openStoreUrl)}," 打开紫鸟 ",8,Pe)):u("",!0),H(e)?(l(),o("button",{key:1,type:"button",class:"download",onClick:n=>O(e)}," 下载 ",8,Re)):u("",!0),e.resultId?(l(),o("button",{key:2,type:"button",class:"btn-delete",onClick:n=>X(e.resultId)}," 删除 ",8,Ee)):u("",!0)])]))),128))])])):u("",!0)],64)):(l(),o("div",Ks," 暂无删除品牌结果,完成解析后会在这里展示按国家分组的去重结果 "))])])])])]))}}),Te=Cs(Fe,[["__scopeId","data-v-4f4b198a"]]);Ss(Te).use(Ns).mount("#app");
diff --git a/app/config.py b/app/config.py
index ce6fe05ea..3e86f279c 100644
--- a/app/config.py
+++ b/app/config.py
@@ -18,8 +18,8 @@ proxy_url = os.getenv("proxy_url")
proxy_mode = int(os.getenv("proxy_mode",1))
client_name=os.getenv("client_name") + ".exe"
-JAVA_API_BASE = os.getenv("java_api_base", "http://8.136.19.173:18080")
-# JAVA_API_BASE = os.getenv("java_api_base", "http://127.0.0.1:18080")
+# JAVA_API_BASE = os.getenv("java_api_base", "http://8.136.19.173:18080")
+JAVA_API_BASE = os.getenv("java_api_base", "http://127.0.0.1:18080")
cache_path = "./user_data"
diff --git a/app/new_web_source/delete-brand.html b/app/new_web_source/delete-brand.html
index febd46f70..10225d78f 100644
--- a/app/new_web_source/delete-brand.html
+++ b/app/new_web_source/delete-brand.html
@@ -7,7 +7,7 @@
-
+
diff --git a/app/web_source/brand.html b/app/web_source/brand.html
index 89605a0b1..70ede5ef0 100644
--- a/app/web_source/brand.html
+++ b/app/web_source/brand.html
@@ -1,17 +1,11 @@
-
- 亚马逊 - 南日AI
+ 亚马逊 - 数富AI
-