1 line
31 KiB
JavaScript
1 line
31 KiB
JavaScript
import{C as e,D as t,F as n,I as r,L as i,M as a,N as o,O as s,R as c,S as l,T as u,_ as d,c as f,f as ee,g as p,h as m,i as h,j as g,k as _,l as v,m as y,r as b,s as x,u as S,v as C,x as w,y as T}from"./index-Dngmm__P.js";import{a as E}from"./utils-COFIQvWo.js";var te={class:`page-container`},ne={class:`page-header`},re={key:1,class:`result-container`},ie={class:`result-header`},ae={class:`result-anchor-nav`},oe=[`href`],se={class:`result-grid result-priority-grid`},ce={class:`summary-header`},le={class:`info-list`},ue={class:`info-item`},de={class:`info-value`,style:{"font-weight":`600`,"font-size":`1.05rem`,color:`var(--text-primary)`}},fe={class:`info-item`},pe={class:`info-value`},me={class:`info-item`},he={class:`info-value`},ge={class:`info-item`},_e={class:`info-value`},ve={class:`info-item`},ye={class:`info-value`},D={class:`info-item`},O={class:`info-value`},k={class:`summary-header`},A={class:`info-list`},j={class:`info-item`},M={class:`info-value`},N={class:`info-item`},P={class:`info-value`},be={class:`info-item`},xe={class:`info-value`},Se={class:`info-item`},Ce={class:`info-value`},we={class:`info-item`},Te={class:`info-value`},Ee={key:1,class:`result-card result-card-highlight`},De={class:`summary-header`},Oe={class:`info-list`},ke={class:`info-item`},Ae={class:`info-value`,style:{"font-weight":`500`}},je={key:0,class:`export-buttons-bar`,style:{display:`flex`,gap:`var(--space-2)`,"flex-wrap":`wrap`,"justify-content":`center`,padding:`var(--space-3) 0`}},Me={key:1,id:`preview-3d`,class:`viewer-section viewer-section-hero`},Ne={class:`summary-header`},Pe=[`src`],Fe={key:2,id:`preview-3d-placeholder`,class:`viewer-section viewer-section-hero`},Ie={class:`summary-header`},Le={key:3,id:`candidate-schemes`,class:`viewer-section diagnostic-panel`,style:{"margin-top":`var(--space-3)`}},Re={class:`result-card full-width diagnostic-panel-body`},ze={key:0,style:{color:`var(--primary-color)`,"font-weight":`600`}},Be={key:1,style:{color:`var(--warning-color)`,"font-weight":`600`}},Ve={id:`ai-side-action`,class:`viewer-section`},He={class:`summary-header`},Ue={key:0,class:`result-grid`},We={class:`result-card`},Ge={class:`info-list`},Ke={class:`info-item`},qe={class:`info-value`},Je={class:`info-item`},Ye={class:`info-value`},Xe={class:`info-item`},Ze={class:`info-value`},Qe={class:`info-item`},$e={class:`info-value`},et={class:`result-card result-card-highlight`},tt={class:`info-list`},nt={class:`info-item`},rt={class:`info-value`},it={class:`info-item`},at={class:`info-value`},ot={key:0,class:`info-item`},st={class:`info-value`},ct={class:`info-item`},lt={class:`info-value`},ut={class:`inline-note`,style:{"margin-top":`var(--space-2)`,"font-weight":`600`,"font-size":`1rem`,color:`var(--text-primary)`}},dt={class:`result-card`},ft={key:0},pt={class:`recommendations-list`},mt={class:`recommendation-text`},ht={key:1,style:{"margin-top":`var(--space-3)`}},gt={class:`recommendations-list`},_t={class:`recommendation-text`},vt={key:2,style:{"margin-top":`var(--space-3)`}},yt={class:`recommendations-list`},bt={class:`recommendation-text`},xt={id:`export-cam`,class:`viewer-section`},St={class:`summary-header`},Ct={class:`result-card`,style:{"margin-bottom":`var(--space-4)`}},wt={class:`info-list`},Tt={class:`info-item`},Et={class:`info-item`},Dt={class:`info-item`},Ot={class:`info-item`},kt={class:`checkbox-group`},At={class:`result-grid`},jt={class:`result-card`},Mt={class:`info-list`},Nt={class:`info-item`},Pt={class:`info-value`},Ft={class:`info-item`},It={class:`info-value`},Lt={class:`info-item`},Rt={class:`info-value`},zt={class:`info-item`},Bt={class:`info-value`},Vt={class:`result-card`},Ht={class:`info-list`},Ut={class:`info-item`},Wt={class:`info-value`},Gt={class:`info-item`},Kt={class:`info-value`},qt={class:`result-card full-width`},Jt={class:`result-card full-width`},Yt={class:`recommendations-list`},Xt={class:`recommendation-text`},Zt={id:`cost-estimate`,class:`viewer-section`},Qt={class:`summary-header`},$t={class:`result-card`,style:{"margin-bottom":`var(--space-3)`}},en={class:`result-grid`},tn={class:`result-card result-card-highlight`},nn={class:`info-list`},rn={class:`info-item`},an={class:`info-value`,style:{"font-size":`1.2rem`,"font-weight":`700`,color:`var(--primary-color)`}},on={class:`info-item`},sn={class:`info-value`},cn={class:`info-item`},ln={class:`info-value`},un={class:`info-item`},dn={class:`info-value`},fn={class:`result-card`},pn={class:`info-list`},mn={class:`info-item`},hn={class:`info-value`,style:{"font-size":`1.1rem`,"font-weight":`600`,color:`var(--warning-color)`}},gn={class:`info-item`},_n={class:`info-value`},vn={class:`info-item`},yn={class:`info-value`},bn={class:`info-item`},xn={class:`info-value`},Sn={key:0,class:`result-card full-width`,style:{"margin-top":`var(--space-3)`}},Cn={class:`recommendations-list`},wn={class:`recommendation-text`},Tn={key:4,id:`llm-report`,class:`viewer-section`},En={class:`summary-header`},Dn={key:0,class:`inline-note`,style:{"margin-bottom":`var(--space-4)`,"font-size":`0.95rem`,color:`var(--text-primary)`}},On={class:`result-grid`},kn={key:0,class:`recommendations-list`},An={class:`recommendation-text`},jn={key:2,class:`recommendations-list`},Mn={class:`recommendation-text`},Nn={key:3,class:`inline-note`},F=e({__name:`ResultView`,setup(e){let F=v(),I=S(),L=f(),R=o({task:null,loading:!0,error:``,selectedSchemeId:null,previewStatus:`idle`,camLoading:!1,camError:``,camPlan:null,camForm:{mold_steel:`P20`,surface_quality:`standard`,controller:`fanuc`,include_gcode:!1},creatingProduct:!1,costLoading:!1,costError:``,costResult:null}),Pn=[{value:`P20`,label:`P20`},{value:`718H`,label:`718H`},{value:`NAK80`,label:`NAK80`},{value:`S136`,label:`S136`},{value:`H13`,label:`H13`}],Fn=[{value:`standard`,label:`标准`},{value:`fine`,label:`精细`},{value:`mirror`,label:`镜面`}],In=[{value:`fanuc`,label:`Fanuc`},{value:`siemens`,label:`Siemens`}],Ln=async()=>{try{R.task=await x(`/api/status/${F.params.taskId}`,{method:`POST`}),R.task?.best_scheme_id?R.selectedSchemeId=R.task.best_scheme_id:R.task?.candidate_schemes?.length&&(R.selectedSchemeId=R.task.candidate_schemes[0].scheme_id);let e=R.task?.cam_preferences||{};R.camForm.mold_steel=e.mold_steel||`P20`,R.camForm.surface_quality=e.surface_quality||`standard`,R.camForm.controller=e.controller||`fanuc`,R.camForm.include_gcode=!!e.include_gcode,R.previewStatus=`loading`}catch(e){R.error=h(e,`加载任务详情`)}finally{R.loading=!1}},Rn=async()=>{let e=F.params.taskId;try{R.creatingProduct=!0;let t=await x(`/api/products/from-task/${e}`,{method:`POST`});b(`已创建成品:${t.name}(SKU: ${t.sku})`,`success`)}catch(e){h(e,`创建成品`)}finally{R.creatingProduct=!1}};u(()=>{if(!L.user){I.push(`/login`);return}Ln()});let z=m(()=>R.task?.candidate_schemes||[]);m(()=>z.value.length===1);let B=m(()=>z.value.length?z.value.find(e=>e.scheme_id===R.selectedSchemeId)||z.value[0]:null),V=m(()=>B.value?.cavity_data||R.task?.cavity_data||null),zn=m(()=>B.value?.key_info||R.task?.key_info||null),H=m(()=>B.value?.html_file||R.task?.html_file||``),U=m(()=>B.value?.dfm_violations||[]),Bn=m(()=>V.value?.injection_system||R.task?.plan_result?.injection_system||null),Vn=m(()=>B.value?.side_actions||V.value?.side_actions||R.task?.side_actions||null),Hn=e=>{let t=String(e||``).match(/<!--SIDE_ACTION_AI_BEGIN-->\s*([\s\S]*?)\s*<!--SIDE_ACTION_AI_END-->/);if(!t)return null;try{return JSON.parse(t[1])}catch(e){return console.warn(`AI 倒扣分析解析失败:`,e),null}},W=e=>{let t=String(e||``).match(/<!--DESIGN_REPORT_BEGIN-->\s*([\s\S]*?)\s*<!--DESIGN_REPORT_END-->/);if(!t)return null;try{return JSON.parse(t[1])}catch(e){return console.warn(`LLM 设计报告解析失败:`,e),null}},G=(e,t=`ai`)=>{if(!e||typeof e!=`object`)return null;let n=[`required`,`not_required`,`manual_review`].includes(e.status)?e.status:`manual_review`,r=[`slider`,`lifter`,`mixed`,`none`,`manual_review`].includes(e.mechanism_recommendation)?e.mechanism_recommendation:`manual_review`,i=Number(e.confidence),a={required:`需要倒扣/抽芯`,not_required:`无需倒扣/抽芯`,manual_review:`需人工确认`};return{source:t,status:n,statusLabel:a[n],mechanismRecommendation:r,mechanismLabel:{slider:`优先滑块`,lifter:`优先斜顶`,mixed:`滑块 + 斜顶`,none:`无需侧向机构`,manual_review:`人工评审`}[r],confidence:Number.isFinite(i)?Math.max(0,Math.min(i,1)):null,conclusion:e.conclusion||a[n],summary:e.summary||``,reasons:Array.isArray(e.reasons)?e.reasons.filter(Boolean).slice(0,5):[],standardAdvice:Array.isArray(e.standard_advice)?e.standard_advice.filter(Boolean).slice(0,5):[],manualReviewItems:Array.isArray(e.manual_review_items)?e.manual_review_items.filter(Boolean).slice(0,4):[]}},Un=m(()=>{let e=Vn.value;if(!e||typeof e!=`object`)return null;let t=e.summary||{},n=(e.slider_mechanisms||[]).length,r=(e.lifter_mechanisms||[]).length,i=n+r,a=n&&r?`mixed`:n?`slider`:r?`lifter`:`none`,o=i>0?`required`:t.total_undercut_faces===0?`not_required`:`manual_review`;return G({status:o,confidence:.55,conclusion:o===`required`?`规则分析判断当前产品需要倒扣/抽芯机构`:o===`not_required`?`规则分析未发现必须采用倒扣/抽芯机构的特征`:`当前规则结果不足以完成稳定判断,建议人工复核`,mechanism_recommendation:a===`none`?`none`:a,summary:o===`required`?`检测到 ${n} 个滑块需求、${r} 个斜顶需求,建议先按标准机构路线做结构评审。`:o===`not_required`?`当前方案未发现明显倒扣特征,可优先按常规模具结构推进。`:`现有数据可用于初筛,但不足以替代工程师对复杂倒扣的最终确认。`,reasons:[i>0?`规则分析识别出 ${i} 处侧向机构需求`:`规则分析未识别出明确侧向机构需求`,t.complexity?`当前复杂度判定为 ${t.complexity}`:`当前复杂度信息不足`,`当前倒扣方案若存在大行程滑块,优先按气动抽芯条件评估`].filter(Boolean),standard_advice:(e.recommendations||[]).slice(0,4),manual_review_items:[`结合 3D 预览复核倒扣是否可通过改产品取消`,`确认侧向机构与顶出、冷却、分型面是否存在干涉`]},`rules`)});m(()=>{let e={critical:0,high:0,medium:0,low:0};return(U.value||[]).forEach(t=>{let n=String(t.level||`medium`).toLowerCase();e[n]===void 0?e.medium+=1:e[n]+=1}),e});let K=m(()=>G(Hn(R.task?.llm_report||``),`ai`)||Un.value),q=m(()=>{let e=B.value?.side_actions?.summary||{};return{total_slider_count:e.total_slider_count??0,total_lifter_count:e.total_lifter_count??0,total_mechanism_count:e.total_mechanism_count??0,complexity:e.complexity||`未知`}}),J=m(()=>W(R.task?.llm_report||``)),Wn=m(()=>J.value&&(J.value.sections&&J.value.sections.length>0||!!J.value.overview)),Gn=m(()=>(J.value?.sections||[]).filter(e=>e.type===`issues`?e.items?.length>0:e.type===`params_table`?e.rows?.length>0:e.type===`recommendations`?e.items?.length>0:!0));m(()=>{let e=R.task?.stage_timings||{};return Object.entries(e).filter(([,e])=>typeof e==`number`).sort((e,t)=>t[1]-e[1])});let Kn=m(()=>{let e={critical:0,high:1,medium:2,low:3};return[...R.task?.analysis_result?.design_recommendations||[]].sort((t,n)=>(e[t.priority]??99)-(e[n.priority]??99))});m(()=>Kn.value[0]||null);let Y=m(()=>U.value?.length||0),qn=m(()=>{let e=V.value?.mold_cavities?.cavity_count;if(typeof e==`number`)return e;let t=V.value?.mold_cavities||zn.value?.mold_cavities||{};return t.cavity_count||Object.keys(t).filter(e=>e.startsWith(`cavity_`)).length||1});m(()=>Y.value?Y.value>=4?`高风险`:Y.value>=2?`中风险`:`低风险`:`低风险`);let Jn=[{id:`candidate-schemes`,label:`方案`},{id:`preview-3d`,label:`预览`},{id:`ai-side-action`,label:`AI倒扣分析`},{id:`export-cam`,label:`CAM/CNC`},{id:`cost-estimate`,label:`成本估算`},{id:`llm-report`,label:`设计报告`}],Yn=e=>e.map((e,t)=>{let n={_rowId:t};return e.forEach((e,t)=>{n[`col_`+t]=e}),n}),X=e=>{e&&(R.selectedSchemeId=e),R.previewStatus=`loading`,R.camPlan=null,R.camError=``},Xn=()=>{R.previewStatus=`loaded`},Zn=()=>{R.previewStatus=`error`},Z=e=>{if(!e)return`N/A`;if(e.parting?.axis)return`${e.parting.axis} 轴`;let t=e.parting?.direction;return Array.isArray(t)?`[${t.map(e=>Number(e).toFixed(2)).join(`, `)}]`:`N/A`};m(()=>R.task?.analysis_result?.detected_features||[]);let Qn=async(e,t)=>{let n={};L.token&&(n.Authorization=`Bearer ${L.token}`);let r=await fetch(e,{headers:n});if(!r.ok)throw Error(`下载失败 (${r.status}): 无法下载,需要授权`);let i=await r.blob(),a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=t,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a)},Q=async e=>{try{let t=F.params.taskId,n=await x(`/api/export-mold`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({task_id:t,scheme_id:B.value?.scheme_id||R.selectedSchemeId,formats:[e],components:[`cavity`,`core`,`parting_surface`]})});if(n.status===`success`&&n.data.files){for(let e of n.data.files){let n=e.relative_path||(e.filepath?e.filepath.replace(/\\/g,`/`).split(`/`).slice(-2).join(`/`):``);await Qn(e.download_path||`/api/export-download/${encodeURI(n)}?task_id=${encodeURIComponent(t)}`,e.filename)}b(`已导出 ${n.data.files.length} 个 ${e.toUpperCase()} 文件`,`success`)}else n.data.errors&&n.data.errors.length>0&&b(`导出失败: ${n.data.errors[0]}`,`error`)}catch(e){b(`导出失败: ${e.message}`,`error`)}},$n=async()=>{try{R.camLoading=!0,R.camError=``;let e={task_id:F.params.taskId,scheme_id:B.value?.scheme_id,mold_steel:R.camForm.mold_steel,surface_quality:R.camForm.surface_quality,controller:R.camForm.controller,include_gcode:R.camForm.include_gcode},t=await x(`/api/cam/plan`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});R.camPlan=t?.data||null,t?.cam_preferences&&(R.camForm.mold_steel=t.cam_preferences.mold_steel||R.camForm.mold_steel,R.camForm.surface_quality=t.cam_preferences.surface_quality||R.camForm.surface_quality,R.camForm.controller=t.cam_preferences.controller||R.camForm.controller,R.camForm.include_gcode=!!t.cam_preferences.include_gcode),b(`CAM 计划生成完成`,`success`)}catch(e){R.camPlan=null,R.camError=e.message||`CAM 计划生成失败`,b(`CAM 计划生成失败: ${R.camError}`,`error`)}finally{R.camLoading=!1}},$=async()=>{try{R.costLoading=!0,R.costError=``;let e=F.params.taskId,t=await x(`/api/cost-estimate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({task_id:e})});R.costResult=t?.data||null,b(t?.data?.source===`ai`?`AI 成本估算完成`:`规则成本估算完成`,`success`)}catch(e){R.costResult=null,R.costError=e.message||`成本估算失败`,b(`成本估算失败: ${R.costError}`,`error`)}finally{R.costLoading=!1}};return(e,o)=>{let u=_(`t-button`),f=_(`t-alert`),m=_(`t-tag`),h=_(`t-table-column`),v=_(`t-table`),b=_(`t-option`),x=_(`t-select`),S=_(`t-loading`);return t(),T(`div`,te,[p(`div`,ne,[l(u,{variant:`text`,onClick:o[0]||=e=>n(I).back()},{default:g(()=>[...o[14]||=[p(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[p(`path`,{d:`M19 12H5M12 19l-7-7 7-7`})],-1),w(` 返回 `,-1)]]),_:1}),o[15]||=p(`h1`,null,`分析结果`,-1)]),l(S,{loading:R.loading,text:`加载中...`},{default:g(()=>[R.error?(t(),d(f,{key:0,theme:`error`,message:R.error},null,8,[`message`])):R.task?(t(),T(`div`,re,[p(`div`,ie,[p(`h2`,null,c(R.task.filename),1),l(m,{type:R.task.status===`completed`?`success`:`danger`},{default:g(()=>[w(c(R.task.status),1)]),_:1},8,[`type`])]),p(`div`,ae,[(t(),T(y,null,s(Jn,e=>p(`a`,{key:e.id,class:`anchor-pill`,href:`#`+e.id},c(e.label),9,oe)),64))]),p(`div`,se,[p(`div`,{class:`result-card result-card-highlight`,style:{cursor:`pointer`},onClick:o[1]||=e=>X(B.value?.scheme_id)},[p(`div`,ce,[o[16]||=p(`h3`,null,`推荐方案`,-1),l(m,{theme:`primary`},{default:g(()=>[w(c(B.value?.title||B.value?.scheme_id||`方案待定`),1)]),_:1})]),p(`div`,le,[p(`div`,ue,[o[17]||=p(`span`,{class:`info-label`},`方案说明`,-1),p(`span`,de,c(B.value?.summary||B.value?.reason||`基于当前几何与制造约束自动推荐`),1)]),p(`div`,fe,[o[18]||=p(`span`,{class:`info-label`},`分型方向`,-1),p(`span`,pe,c(Z(B.value)),1)]),p(`div`,me,[o[19]||=p(`span`,{class:`info-label`},`模具结构`,-1),p(`span`,he,c(B.value?.mold_structure_type===`two_half_cavity`?`两板半腔(无独立模芯)`:`型腔 + 模芯`),1)]),p(`div`,ge,[o[20]||=p(`span`,{class:`info-label`},`分型面位置`,-1),p(`span`,_e,c(B.value?.offset_label||`中面`),1)]),p(`div`,ve,[o[21]||=p(`span`,{class:`info-label`},`型腔数`,-1),p(`span`,ye,c(qn.value)+` 腔`,1)]),p(`div`,D,[o[22]||=p(`span`,{class:`info-label`},`预计成型周期`,-1),p(`span`,O,c(Bn.value?.overall_assessment?.estimated_cycle_time||`N/A`)+` s`,1)])])]),z.value.length>1?(t(),T(`div`,{key:0,class:`result-card result-card-highlight`,style:{cursor:`pointer`},onClick:o[2]||=e=>X(z.value[1]?.scheme_id)},[p(`div`,k,[o[24]||=p(`h3`,null,`备选方案`,-1),l(m,{theme:`warning`},{default:g(()=>[...o[23]||=[w(`1 个备选`,-1)]]),_:1})]),p(`div`,A,[(t(!0),T(y,null,s(z.value.slice(1,2),e=>(t(),T(y,{key:`alt-`+e.scheme_id},[p(`div`,j,[o[25]||=p(`span`,{class:`info-label`},`方案说明`,-1),p(`span`,M,c(e.summary||e.reason||`暂无说明`),1)]),p(`div`,N,[o[26]||=p(`span`,{class:`info-label`},`分型方向`,-1),p(`span`,P,c(Z(e)),1)]),p(`div`,be,[o[27]||=p(`span`,{class:`info-label`},`模具结构`,-1),p(`span`,xe,c(e.mold_structure_type===`two_half_cavity`?`两板半腔(无独立模芯)`:`型腔 + 模芯`),1)]),p(`div`,Se,[o[28]||=p(`span`,{class:`info-label`},`分型面位置`,-1),p(`span`,Ce,c(e.offset_label||`中面`),1)]),p(`div`,we,[o[29]||=p(`span`,{class:`info-label`},`方案总分`,-1),p(`span`,Te,c(n(E)(e.score)),1)])],64))),128))])])):(t(),T(`div`,Ee,[p(`div`,De,[o[31]||=p(`h3`,null,`方案概览`,-1),l(m,{theme:`success`},{default:g(()=>[...o[30]||=[w(`单一方案`,-1)]]),_:1})]),p(`div`,Oe,[p(`div`,ke,[o[32]||=p(`span`,{class:`info-label`},`详细方案说明`,-1),p(`span`,Ae,c(B.value?.summary||B.value?.reason||`当前仅生成 1 套可用分模方案,已在推荐方案区域展示核心参数。`),1)])])]))]),R.task.status===`completed`?(t(),T(`div`,je,[l(u,{type:`primary`,size:`small`,onClick:o[3]||=e=>Q(`step`),title:`导出装配体STEP格式(UG/FreeCAD/SolidWorks通用)`},{default:g(()=>[...o[33]||=[w(` 📦 导出 STEP `,-1)]]),_:1}),l(u,{type:`default`,size:`small`,onClick:o[4]||=e=>Q(`iges`),title:`导出IGES格式(兼容旧系统)`},{default:g(()=>[...o[34]||=[w(` 导出 IGES `,-1)]]),_:1}),l(u,{type:`default`,size:`small`,onClick:o[5]||=e=>Q(`stl`),title:`导出STL网格格式(3D打印预览)`},{default:g(()=>[...o[35]||=[w(` 导出 STL `,-1)]]),_:1}),l(u,{type:`default`,size:`small`,onClick:o[6]||=e=>Q(`brep`),title:`导出BRep格式(FreeCAD原生)`},{default:g(()=>[...o[36]||=[w(` 导出 BRep `,-1)]]),_:1}),l(u,{type:`default`,size:`small`,onClick:Rn,loading:R.creatingProduct,title:`将本次模具分析创建为进销存成品,可在进销存模块继续配置 BOM / 销售`},{default:g(()=>[...o[37]||=[w(` 📋 创建为成品 `,-1)]]),_:1},8,[`loading`]),l(u,{type:`default`,size:`small`,onClick:$,loading:R.costLoading,title:`估算模具造价与单件成本`},{default:g(()=>[...o[38]||=[w(` 💰 成本估算 `,-1)]]),_:1},8,[`loading`])])):C(``,!0),H.value?(t(),T(`div`,Me,[p(`div`,Ne,[o[40]||=p(`h3`,null,`3D 预览`,-1),l(m,{theme:`primary`},{default:g(()=>[...o[39]||=[w(`重点区域`,-1)]]),_:1})]),R.previewStatus===`error`?(t(),d(f,{key:0,theme:`warning`,title:`预览加载失败`,message:`HTML 已生成但加载异常,请检查该链接是否可访问:`+H.value,style:{"margin-bottom":`var(--space-3)`}},null,8,[`message`])):C(``,!0),(t(),T(`iframe`,{key:H.value,src:H.value,class:`viewer-frame viewer-frame-hero`,onLoad:Xn,onError:Zn},null,40,Pe))])):(t(),T(`div`,Fe,[p(`div`,Ie,[o[42]||=p(`h3`,null,`3D 预览`,-1),l(m,{theme:`warning`},{default:g(()=>[...o[41]||=[w(`未生成`,-1)]]),_:1})]),l(f,{theme:`warning`,title:`预览未生成`,message:`当前任务没有返回 HTML 预览链接,属于未生成状态。`})])),z.value.length>1?(t(),T(`div`,Le,[o[43]||=p(`summary`,null,`📊 方案对比`,-1),p(`div`,Re,[l(v,{data:z.value.slice(0,2),"row-key":`scheme_id`,stripe:``,hover:``,onRowClick:o[7]||=e=>X(e.row.scheme_id)},{default:g(()=>[l(h,{title:`方案`},{default:g(({rowIndex:e})=>[e===0?(t(),T(`span`,ze,`★ 推荐方案`)):(t(),T(`span`,Be,`备选方案`))]),_:1}),l(h,{title:`方向`},{default:g(({row:e})=>[w(c(Z(e)),1)]),_:1}),l(h,{title:`位置`},{default:g(({row:e})=>[w(c(e.offset_label||`中面`),1)]),_:1}),l(h,{title:`总分`},{default:g(({row:e})=>[w(c(n(E)(e.score)),1)]),_:1}),l(h,{title:`可制造性`},{default:g(({row:e})=>[w(c(n(E)(e.score_breakdown?.manufacturability||0)),1)]),_:1}),l(h,{title:`分型质量`},{default:g(({row:e})=>[w(c(n(E)(e.score_breakdown?.parting_quality||0)),1)]),_:1}),l(h,{title:`倒扣数`},{default:g(({row:e})=>[w(c(e.key_info?.quality_considerations?.undercut_count||0),1)]),_:1}),l(h,{title:`锁模力`},{default:g(({row:e})=>[w(c(e.cavity_data?.manufacturing_info?.estimated_clamping_force||`N/A`),1)]),_:1})]),_:1},8,[`data`])])])):C(``,!0),p(`div`,Ve,[p(`div`,He,[o[45]||=p(`h3`,null,`AI 倒扣与抽芯分析`,-1),K.value?(t(),d(m,{key:0,type:K.value.status===`required`?`danger`:K.value.status===`not_required`?`success`:`warning`},{default:g(()=>[w(c(K.value.statusLabel),1)]),_:1},8,[`type`])):(t(),d(m,{key:1,theme:`warning`},{default:g(()=>[...o[44]||=[w(`未生成`,-1)]]),_:1}))]),K.value?(t(),T(`div`,Ue,[p(`div`,We,[o[50]||=p(`h4`,null,`规则检测摘要`,-1),p(`div`,Ge,[p(`div`,Ke,[o[46]||=p(`span`,{class:`info-label`},`检测状态`,-1),p(`span`,qe,c(q.value.total_mechanism_count>0?`检测到倒扣`:`未检测到倒扣`),1)]),p(`div`,Je,[o[47]||=p(`span`,{class:`info-label`},`滑块数量`,-1),p(`span`,Ye,c(q.value.total_slider_count||0),1)]),p(`div`,Xe,[o[48]||=p(`span`,{class:`info-label`},`斜顶数量`,-1),p(`span`,Ze,c(q.value.total_lifter_count||0),1)]),p(`div`,Qe,[o[49]||=p(`span`,{class:`info-label`},`复杂度`,-1),p(`span`,$e,c(q.value.complexity||`未知`),1)])])]),p(`div`,et,[o[55]||=p(`h4`,null,`AI 结论`,-1),p(`div`,tt,[p(`div`,nt,[o[51]||=p(`span`,{class:`info-label`},`判断结果`,-1),p(`span`,rt,c(K.value.conclusion),1)]),p(`div`,it,[o[52]||=p(`span`,{class:`info-label`},`推荐方案`,-1),p(`span`,at,c(K.value.mechanismLabel),1)]),K.value.confidence==null?C(``,!0):(t(),T(`div`,ot,[o[53]||=p(`span`,{class:`info-label`},`置信度`,-1),p(`span`,st,c(Math.round(K.value.confidence*100))+`%`,1)])),p(`div`,ct,[o[54]||=p(`span`,{class:`info-label`},`分析来源`,-1),p(`span`,lt,c(K.value.source===`ai`?`AI 模型`:`规则回退`),1)])]),p(`div`,ut,c(K.value.summary||`当前任务未返回更多摘要。`),1)]),p(`div`,dt,[K.value.reasons.length?(t(),T(`div`,ft,[o[56]||=p(`h4`,null,`判断依据`,-1),p(`div`,pt,[(t(!0),T(y,null,s(K.value.reasons,(e,n)=>(t(),T(`div`,{class:`recommendation-item medium`,key:`ai-reason-`+n},[p(`div`,mt,c(e),1)]))),128))])])):C(``,!0),K.value.standardAdvice.length?(t(),T(`div`,ht,[o[57]||=p(`h4`,null,`标准化建议`,-1),p(`div`,gt,[(t(!0),T(y,null,s(K.value.standardAdvice,(e,n)=>(t(),T(`div`,{class:`recommendation-item low`,key:`ai-advice-`+n},[p(`div`,_t,c(e),1)]))),128))])])):C(``,!0),K.value.manualReviewItems.length?(t(),T(`div`,vt,[o[58]||=p(`h4`,null,`人工复核项`,-1),p(`div`,yt,[(t(!0),T(y,null,s(K.value.manualReviewItems,(e,n)=>(t(),T(`div`,{class:`recommendation-item medium`,key:`ai-review-`+n},[p(`div`,bt,c(e),1)]))),128))])])):C(``,!0)])])):(t(),d(f,{key:1,theme:`warning`,title:`AI 结论未生成`,message:`当前任务未生成倒扣与抽芯 AI 分析,请检查模型配置或重新运行分析。`}))]),p(`div`,xt,[p(`div`,St,[o[60]||=p(`h3`,null,`CAM 与 CNC 加工`,-1),l(m,{theme:`primary`},{default:g(()=>[...o[59]||=[w(`工艺规划`,-1)]]),_:1})]),p(`div`,Ct,[o[66]||=p(`h4`,null,`CAM 参数`,-1),p(`div`,wt,[p(`div`,Tt,[o[61]||=p(`span`,{class:`info-label`},`模具钢`,-1),l(x,{modelValue:R.camForm.mold_steel,"onUpdate:modelValue":o[8]||=e=>R.camForm.mold_steel=e,style:{width:`200px`}},{default:g(()=>[(t(),T(y,null,s(Pn,e=>l(b,{key:`steel-`+e.value,value:e.value,label:e.label},null,8,[`value`,`label`])),64))]),_:1},8,[`modelValue`])]),p(`div`,Et,[o[62]||=p(`span`,{class:`info-label`},`表面质量`,-1),l(x,{modelValue:R.camForm.surface_quality,"onUpdate:modelValue":o[9]||=e=>R.camForm.surface_quality=e,style:{width:`200px`}},{default:g(()=>[(t(),T(y,null,s(Fn,e=>l(b,{key:`surf-`+e.value,value:e.value,label:e.label},null,8,[`value`,`label`])),64))]),_:1},8,[`modelValue`])]),p(`div`,Dt,[o[63]||=p(`span`,{class:`info-label`},`控制器`,-1),l(x,{modelValue:R.camForm.controller,"onUpdate:modelValue":o[10]||=e=>R.camForm.controller=e,style:{width:`200px`}},{default:g(()=>[(t(),T(y,null,s(In,e=>l(b,{key:`ctrl-`+e.value,value:e.value,label:e.label},null,8,[`value`,`label`])),64))]),_:1},8,[`modelValue`])]),p(`div`,Ot,[o[65]||=p(`span`,{class:`info-label`},`包含G代码`,-1),p(`label`,kt,[a(p(`input`,{type:`checkbox`,class:`checkbox-input`,"onUpdate:modelValue":o[11]||=e=>R.camForm.include_gcode=e},null,512),[[ee,R.camForm.include_gcode]]),o[64]||=p(`span`,{class:`checkbox-label`},`返回G代码文本`,-1)])])]),l(u,{type:`primary`,size:`small`,disabled:R.camLoading,onClick:o[12]||=e=>$n(),style:{"margin-top":`var(--space-2)`},title:`基于当前选中方案生成CAM工艺计划`},{default:g(()=>[w(c(R.camLoading?`⏳ 生成中...`:`🔧 生成 CAM 计划`),1)]),_:1},8,[`disabled`])]),R.camError?(t(),d(f,{key:0,theme:`warning`,title:`CAM 计划生成失败`,message:R.camError},null,8,[`message`])):R.camPlan?(t(),T(y,{key:2},[p(`div`,At,[p(`div`,jt,[o[71]||=p(`h4`,null,`计划摘要`,-1),p(`div`,Mt,[p(`div`,Nt,[o[67]||=p(`span`,{class:`info-label`},`方案ID`,-1),p(`span`,Pt,c(R.camPlan.scheme_id||`N/A`),1)]),p(`div`,Ft,[o[68]||=p(`span`,{class:`info-label`},`总工序数`,-1),p(`span`,It,c(R.camPlan.summary?.total_operations||0),1)]),p(`div`,Lt,[o[69]||=p(`span`,{class:`info-label`},`预计总时长`,-1),p(`span`,Rt,c(n(E)(R.camPlan.summary?.total_estimated_time_min||0))+` min`,1)]),p(`div`,zt,[o[70]||=p(`span`,{class:`info-label`},`方案可信度`,-1),p(`span`,Bt,c(n(E)(R.camPlan.confidence?.score||0)),1)])])]),p(`div`,Vt,[o[74]||=p(`h4`,null,`刀具建议`,-1),p(`div`,Ht,[p(`div`,Ut,[o[72]||=p(`span`,{class:`info-label`},`粗加工刀具`,-1),p(`span`,Wt,c(R.camPlan.tooling_suggestion?.roughing_tool?.tool_id||`N/A`),1)]),p(`div`,Gt,[o[73]||=p(`span`,{class:`info-label`},`精加工刀具`,-1),p(`span`,Kt,c(R.camPlan.tooling_suggestion?.finishing_tool?.tool_id||`N/A`),1)])])])]),p(`div`,qt,[o[75]||=p(`h4`,null,`工序计划`,-1),l(v,{data:R.camPlan.process_plan||[],"row-key":`seq`,stripe:``},{default:g(()=>[l(h,{colKey:`seq`,title:`序号`}),l(h,{colKey:`operation`,title:`工序`}),l(h,{title:`刀具`},{default:g(({row:e})=>[w(c(e.tool_id||`N/A`),1)]),_:1}),l(h,{title:`主轴转速`},{default:g(({row:e})=>[w(c(n(E)(e.spindle_speed_rpm||0)),1)]),_:1}),l(h,{title:`进给率`},{default:g(({row:e})=>[w(c(n(E)(e.feed_rate_mm_min||0)),1)]),_:1}),l(h,{title:`预计时长(min)`},{default:g(({row:e})=>[w(c(n(E)(e.estimated_time_min||0)),1)]),_:1})]),_:1},8,[`data`])]),p(`div`,Jt,[o[76]||=p(`h4`,null,`制造风险提示`,-1),p(`div`,Yt,[(t(!0),T(y,null,s(R.camPlan.manufacturing_warnings||[],(e,n)=>(t(),T(`div`,{class:`recommendation-item medium`,key:`cam-warn-`+n},[p(`div`,Xt,c(e),1)]))),128))])])],64)):(t(),d(f,{key:1,theme:`warning`,title:`尚未生成 CAM 计划`,message:`点击上方"生成 CAM 计划"后,将返回工序计划、刀具建议与制造风险提示。`}))]),p(`div`,Zt,[p(`div`,Qt,[o[78]||=p(`h3`,null,`成本估算`,-1),R.costResult?(t(),d(m,{key:0,type:R.costResult.source===`ai`?`success`:`warning`},{default:g(()=>[w(c(R.costResult.source===`ai`?`AI 估算`:`规则估算`),1)]),_:1},8,[`type`])):(t(),d(m,{key:1,theme:`primary`},{default:g(()=>[...o[77]||=[w(`待生成`,-1)]]),_:1}))]),p(`div`,$t,[l(u,{type:`primary`,size:`small`,disabled:R.costLoading,onClick:o[13]||=e=>$(),title:`基于当前方案估算模具造价与单件成本`},{default:g(()=>[w(c(R.costLoading?`⏳ 估算中...`:`💰 生成成本估算`),1)]),_:1},8,[`disabled`])]),R.costError?(t(),d(f,{key:0,theme:`warning`,title:`成本估算失败`,message:R.costError},null,8,[`message`])):C(``,!0),R.costResult?(t(),T(y,{key:1},[p(`div`,en,[p(`div`,tn,[o[83]||=p(`h4`,null,`模具造价`,-1),p(`div`,nn,[p(`div`,rn,[o[79]||=p(`span`,{class:`info-label`},`总造价`,-1),p(`span`,an,c(R.costResult.total_mold_cost),1)]),p(`div`,on,[o[80]||=p(`span`,{class:`info-label`},`材料费`,-1),p(`span`,sn,c(R.costResult.mold_cost.material),1)]),p(`div`,cn,[o[81]||=p(`span`,{class:`info-label`},`加工费`,-1),p(`span`,ln,c(R.costResult.mold_cost.machining),1)]),p(`div`,un,[o[82]||=p(`span`,{class:`info-label`},`复杂度系数`,-1),p(`span`,dn,c(R.costResult.mold_cost.complexity_factor),1)])])]),p(`div`,fn,[o[88]||=p(`h4`,null,`单件成本`,-1),p(`div`,pn,[p(`div`,mn,[o[84]||=p(`span`,{class:`info-label`},`单件费用`,-1),p(`span`,hn,c(R.costResult.cost_per_part),1)]),p(`div`,gn,[o[85]||=p(`span`,{class:`info-label`},`材料用量`,-1),p(`span`,_n,c(R.costResult.part_cost.material),1)]),p(`div`,vn,[o[86]||=p(`span`,{class:`info-label`},`成型周期`,-1),p(`span`,yn,c(R.costResult.part_cost.cycle_time),1)]),p(`div`,bn,[o[87]||=p(`span`,{class:`info-label`},`置信度`,-1),p(`span`,xn,c(Math.round((R.costResult.confidence||0)*100))+`%`,1)])])])]),R.costResult.assumptions?.length?(t(),T(`div`,Sn,[o[89]||=p(`h4`,null,`估算假设`,-1),p(`div`,Cn,[(t(!0),T(y,null,s(R.costResult.assumptions,(e,n)=>(t(),T(`div`,{key:`cost-assumption-`+n,class:`recommendation-item low`},[p(`div`,wn,`ℹ️ `+c(e),1)]))),128))])])):C(``,!0)],64)):R.costError?C(``,!0):(t(),d(f,{key:2,theme:`info`,title:`尚未生成`,message:`点击“生成成本估算”后,将基于当前方案估算模具造价与单件成本。`}))]),Wn.value?(t(),T(`div`,Tn,[p(`div`,En,[o[90]||=p(`h3`,null,`LLM 设计报告`,-1),l(m,{type:(J.value?.overall_score||0)>=7?`success`:(J.value?.overall_score||0)>=5?`warning`:`danger`},{default:g(()=>[w(` 评分 `+c(J.value?.overall_score||`N/A`)+` / 10 `,1)]),_:1},8,[`type`])]),J.value?.overview?(t(),T(`div`,Dn,c(J.value?.overview),1)):C(``,!0),p(`div`,On,[(t(!0),T(y,null,s(Gn.value,(e,n)=>(t(),T(`div`,{key:`dr-sec-`+n,class:r([`result-card`,e.type===`issues`?`result-card-highlight`:``])},[p(`h4`,{style:i(e.type===`issues`?`color: var(--danger-color);`:``)},c(e.heading),5),e.type===`issues`?(t(),T(`div`,kn,[(t(!0),T(y,null,s(e.items,(e,n)=>(t(),T(`div`,{key:`dr-issue-`+n,class:r([`recommendation-item`,e.level===`high`?`high`:e.level===`medium`?`medium`:`low`])},[p(`span`,{class:r([`priority-badge`,e.level||`medium`]),style:{"margin-right":`var(--space-1)`}},c(e.level===`high`?`🔴`:e.level===`medium`?`🟡`:`🟢`),3),p(`div`,An,c(e.content),1)],2))),128))])):e.type===`params_table`?(t(),d(v,{key:1,columns:e.headers.map((e,t)=>({colKey:`col_`+t,title:e})),data:Yn(e.rows),"row-key":`_rowId`,stripe:``,bordered:``},null,8,[`columns`,`data`])):e.type===`recommendations`?(t(),T(`div`,jn,[(t(!0),T(y,null,s(e.items,(e,n)=>(t(),T(`div`,{class:`recommendation-item low`,key:`dr-rec-`+n},[p(`div`,Mn,`💡 `+c(e),1)]))),128))])):(t(),T(`div`,Nn,c(JSON.stringify(e)),1))],2))),128))])])):C(``,!0)])):C(``,!0)]),_:1},8,[`loading`])])}}});export{F as default}; |