Files
Migu2.0/MiGu.Server/wwwroot/assets/OpsConfigView-zdoGrqh4.js
T
zhaowei.huangandCursor be0503c535 chore(web): 重新构建前端静态资源
同步 simple-platform-vue 构建产物与 index.html 入口哈希。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-31 00:16:56 +08:00

2 lines
7.6 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{aG as te,b4 as oe,aA as h,bH as n,br as P,b7 as u,aF as s,N as le,H as ae,aE as b,O as ne,S as se,bI as B,aC as C,E as ie,x as re,ah as E,bh as T,y as ue,az as ce,v as me,u as de,bo as D,bz as fe,aB as pe,by as ve,e as _e,bn as $,bf as S,X as j,aj as ye}from"./index-D5OuyicD.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{C as he,n as w,c as be,d as ge,s as W,l as ke}from"./ConfigPageBase-DYlmkUIy.js";import{r as Ce}from"./reflection-BmVSriDn.js";import{f as Ve}from"./monitorConfigCache-deAxNrzx.js";/* empty css *//* empty css *//* empty css *//* empty css */import"./PermissionGuard-DhAzkl-X.js";/* empty css */function Ne(V,m,d){if(!V)return[];const g=V[m]??V[d];if(g?.length)return[...g];for(const[c,f]of Object.entries(V))if(f?.length){if(c===m||c===d)return[...f];if(m.endsWith("."+c)||c.endsWith("."+d))return[...f];if(m.endsWith("."+d)&&(c===d||c.endsWith("."+d)))return[...f]}return[]}const xe={class:"monitor-section"},Ae={key:0,class:"muted empty-hint"},G="simple-platform-methods-by-type-car-v1",Se=500,Ee=te({__name:"OpsConfigView",setup(V){const m=$([]),d=$([]),g=$([]),c=S(!1),f=S(!1),U=S([]),N=S(null),x=S(!1);let _=null,k=null;function M(l){k=l,_&&clearTimeout(_),_=setTimeout(()=>{O()},Se)}async function O(){if(_=null,x.value){_=setTimeout(()=>{O()},200);return}const l=k;if(k=null,!!l){x.value=!0;try{const e=await W(l,{cachedRoot:N.value});N.value=e,j.success({message:"地图监控配置已自动保存",duration:1200,grouping:!0})}catch(e){j.error(`地图监控配置自动保存失败:${e instanceof Error?e.message:String(e)}`)}finally{x.value=!1,k&&M(k)}}}oe(()=>{_&&(clearTimeout(_),_=null),k&&!x.value&&O()});async function J(l,e){c.value=!0,f.value=!0;try{const t=await Ve(),[{config:i,cache:r},p]=await Promise.all([ke(l,t),L()]);N.value=r,d.value=z(t.available.site.methods),g.value=z(t.available.track.methods),e(i)}catch{e(w(l)),d.value=[],g.value=[],await L()}finally{c.value=!1,f.value=!1}}async function Y(l){N.value=await W(l,{cachedRoot:N.value})}async function L(){try{const l=sessionStorage.getItem(G);if(l){const e=JSON.parse(l);if(Array.isArray(e)&&e.length){m.value=e;return}}}catch{}try{const e=(await Ce.listMethodsByType("car")).map(t=>({typeKey:t.fullTypeName??t.typeName,shortTypeName:t.typeName,title:`${t.typeLabel??t.typeName} / ${t.fullTypeName??t.typeName} [${t.assemblyName}]`,methods:t.methods.map(i=>({methodName:i.methodName,label:i.label||i.methodName})).filter(i=>!!i.methodName)})).filter(t=>t.methods.length>0).sort((t,i)=>t.title.localeCompare(i.title));m.value=e;try{sessionStorage.setItem(G,JSON.stringify(e))}catch{}}catch{m.value=[]}}function z(l){return l?.length?l.map(e=>({methodName:e,label:e})):[]}function K(l){return l.monitor??ge()}function F(l,e){const t=K(l).carActionByType;return Ne(t,e.typeKey,e.shortTypeName)}function X(l,e){const t=F(l,e).slice().sort().join("\0");return`${e.typeKey}\0${t}`}function I(l,e,t,i,r){const p=K(e),v={...e,monitor:{...p,[t]:{...p[t],[i]:[...r]}}};l(v),M(v)}function q(l,e,t,i){const r=K(e),p=be(r.carActionByType);p[t.typeKey]=[...i],t.shortTypeName!==t.typeKey&&delete p[t.shortTypeName];const v={...e,monitor:{...r,carActionByType:p}};l(v),M(v)}return(l,e)=>{const t=ae,i=se,r=ne,p=ie,v=de,R=me,Q=ue,Z=re,ee=le,H=ve;return u(),h(he,{section:"ops",title:"运营维护",description:"调度回放、日志管理、版本维护(OpsConfig",defaults:P(_e),"normalize-payload":P(w),"after-load":J,"before-save":Y},{default:n(({payload:a,update:y})=>[s(ee,{"label-width":"200px",model:a},{default:n(()=>[s(t,{"content-position":"left"},{default:n(()=>[...e[1]||(e[1]=[b("调度回放",-1)])]),_:1}),s(r,{label:"保留时长 (天)"},{default:n(()=>[s(i,{"model-value":a.playback.retentionDays,min:1,max:3650,"onUpdate:modelValue":o=>y({...a,playback:{...a.playback,retentionDays:o??0}})},null,8,["model-value","onUpdate:modelValue"])]),_:2},1024),s(r,{label:"采样频率 (Hz)"},{default:n(()=>[s(i,{"model-value":a.playback.samplingHz,min:1,max:100,"onUpdate:modelValue":o=>y({...a,playback:{...a.playback,samplingHz:o??0}})},null,8,["model-value","onUpdate:modelValue"])]),_:2},1024),s(t,{"content-position":"left"},{default:n(()=>[...e[2]||(e[2]=[b("日志保留",-1)])]),_:1}),s(r,{label:"热数据 (天)"},{default:n(()=>[s(i,{"model-value":a.logRetention.hotDays,min:1,max:365,"onUpdate:modelValue":o=>y({...a,logRetention:{...a.logRetention,hotDays:o??0}})},null,8,["model-value","onUpdate:modelValue"])]),_:2},1024),s(r,{label:"冷数据 (天)"},{default:n(()=>[s(i,{"model-value":a.logRetention.coldDays,min:1,max:3650,"onUpdate:modelValue":o=>y({...a,logRetention:{...a.logRetention,coldDays:o??0}})},null,8,["model-value","onUpdate:modelValue"])]),_:2},1024),s(t,{"content-position":"left"},{default:n(()=>[...e[3]||(e[3]=[b("版本维护",-1)])]),_:1}),s(r,{label:"保留发布版本"},{default:n(()=>[s(i,{"model-value":a.version.keepReleases,min:1,max:100,"onUpdate:modelValue":o=>y({...a,version:{keepReleases:o??0}})},null,8,["model-value","onUpdate:modelValue"])]),_:2},1024),s(t,{"content-position":"left"},{default:n(()=>[...e[4]||(e[4]=[b("地图监控信息与动作管理",-1)])]),_:1}),B((u(),C("div",xe,[s(p,{type:"info",closable:!1,"show-icon":"",title:x.value?"正在自动保存…":"支持直接多选,修改后会自动保存到地图监控(simple.json),无需点击上方「保存」。若某组不勾选,表示该组在地图监控中显示全部。",style:{"margin-bottom":"10px"}},null,8,["title"]),B((u(),h(r,{label:"按车型动作配置"},{default:n(()=>[s(Z,{modelValue:U.value,"onUpdate:modelValue":e[0]||(e[0]=o=>U.value=o),class:"type-actions"},{default:n(()=>[(u(!0),C(E,null,T(m.value,o=>(u(),h(Q,{key:o.typeKey,name:o.typeKey,title:`${o.title}${o.methods.length}`},{default:n(()=>[B(ce("div",null,[(u(),h(R,{key:X(a,o),"model-value":F(a,o),class:"cfg-check-grid","onUpdate:modelValue":A=>q(y,a,o,A)},{default:n(()=>[(u(!0),C(E,null,T(o.methods,A=>(u(),h(v,{key:`${o.typeKey}-${A.methodName}`,label:A.methodName},{default:n(()=>[b(D(A.label),1)]),_:2},1032,["label"]))),128))]),_:2},1032,["model-value","onUpdate:modelValue"]))],512),[[fe,U.value.includes(o.typeKey)]])]),_:2},1032,["name","title"]))),128))]),_:2},1032,["modelValue"]),!c.value&&!f.value&&!m.value.length?(u(),C("p",Ae," 暂未扫描到带 MethodMember 的车型(请确认 SimpleLite 已连接并已加载插件)。 ")):pe("",!0)]),_:2},1024)),[[H,f.value]]),s(r,{label:"站点动作显示项"},{default:n(()=>[s(R,{"model-value":a.monitor?.site?.actionKeys??[],class:"cfg-check-grid","onUpdate:modelValue":o=>I(y,a,"site","actionKeys",o)},{default:n(()=>[(u(!0),C(E,null,T(d.value,o=>(u(),h(v,{key:`sa-${o.methodName}`,label:o.methodName},{default:n(()=>[b(D(o.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])]),_:2},1024),s(r,{label:"路径动作显示项"},{default:n(()=>[s(R,{"model-value":a.monitor?.track?.actionKeys??[],class:"cfg-check-grid","onUpdate:modelValue":o=>I(y,a,"track","actionKeys",o)},{default:n(()=>[(u(!0),C(E,null,T(g.value,o=>(u(),h(v,{key:`ta-${o.methodName}`,label:o.methodName},{default:n(()=>[b(D(o.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])]),_:2},1024)])),[[H,c.value]])]),_:2},1032,["model"])]),_:1},8,["defaults","normalize-payload"])}}}),Ye=ye(Ee,[["__scopeId","data-v-bf134df3"]]);export{Ye as default};