Files
Migu2.0/MiGu.Server/wwwroot/assets/OpsConfigView-CYCdWXE0.js
T
zhaowei.huangandCursor 42978930ca feat: 迁入 MiGu.Server、平台前端与车辆列表 reflection 回退
从 Simple-FR 拆出 Platform.Server 并重命名为 MiGu.Server;frontends 源码与构建脚本迁入本仓库。地图监控在 projection/cars 失败或为空时回退 reflection 车辆列表;Simple 仓库已移除旧 Platform.Server。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-29 18:16:34 +08:00

2 lines
6.7 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 G,b0 as Y,b1 as q,aA as g,bB as n,bm as K,f as J,ba as Q,bb as N,b3 as u,aF as l,I as W,aE as _,P as X,T as Z,E as ee,y as te,aC as k,bd as T,z as oe,w as ae,ai as M,v as le,bj as O,O as ne,Y as $,al as se}from"./index-DrvLDslf.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{s as z,n as R,C as ie,l as me}from"./ConfigPageBase-CPF7i-FB.js";import{r as V,e as re}from"./reflection-Dr3WM5Rz.js";/* empty css *//* empty css *//* empty css *//* empty css */import"./PermissionGuard-BxagL6-4.js";const ue=450,ce=G({__name:"OpsConfigView",setup(de){const c=Q(re()),x=N([]),C=N([]),U=N([]),y=N(!1);let d=null,b=null;function A(t){b=t,d&&clearTimeout(d),d=setTimeout(()=>{E()},ue)}async function E(){if(d=null,y.value){d=setTimeout(()=>{E()},200);return}const t=b;if(b=null,!!t){y.value=!0;try{await z(t),$.success({message:"地图监控配置已自动保存",duration:1200,grouping:!0})}catch(e){$.error(`地图监控配置自动保存失败:${e instanceof Error?e.message:String(e)}`)}finally{y.value=!1,b&&A(b)}}}Y(()=>{d&&(clearTimeout(d),d=null),b&&!y.value&&E()});function F(t){return R({monitor:t}).monitor}async function I(t,e){e(await me(t))}function h(t){return F(t.monitor)}function S(t,e,o,m,i){const f=h(e),r={...e,monitor:{...f,[o]:{...f[o],[m]:[...i]}}};t(r),A(r)}function L(t,e,o,m){const i=h(e),f={...i.carActionByType,[o.typeKey]:[...m]};o.shortTypeName!==o.typeKey&&delete f[o.shortTypeName];const r={...e,monitor:{...i,carActionByType:f}};t(r),A(r)}function w(t,e){const o=h(t);return o.carActionByType[e.typeKey]??o.carActionByType[e.shortTypeName]??[]}q(async()=>{try{const t=await V.getMonitorConfig();c.car=t.available.car,c.site=t.available.site,c.track=t.available.track}catch{c.car={fields:[],status:[],methods:[]},c.site={fields:[],status:[],methods:[]},c.track={fields:[],status:[],methods:[]}}try{const t=await V.listMethodsByType("car");x.value=t.map(e=>({typeKey:e.fullTypeName??e.typeName,shortTypeName:e.typeName,title:`${e.typeLabel??e.typeName} / ${e.fullTypeName??e.typeName} [${e.assemblyName}]`,methods:e.methods.map(o=>({methodName:o.methodName,label:o.label||o.methodName})).filter(o=>!!o.methodName)})).filter(e=>e.methods.length>0).sort((e,o)=>e.title.localeCompare(o.title))}catch{x.value=[]}try{const t=await V.listMethodsByType("site");C.value=D(t.flatMap(e=>e.methods))}catch{C.value=c.site.methods.map(t=>({methodName:t,label:t}))}try{const t=await V.listMethodsByType("track");U.value=D(t.flatMap(e=>e.methods))}catch{U.value=c.track.methods.map(t=>({methodName:t,label:t}))}});function D(t){const e=new Map;for(const o of t)o.methodName&&(e.has(o.methodName)||e.set(o.methodName,{methodName:o.methodName,label:o.label||o.methodName}));return[...e.values()].sort((o,m)=>o.label.localeCompare(m.label))}return(t,e)=>{const o=W,m=Z,i=X,f=ee,r=le,B=ae,P=oe,H=te,j=ne;return u(),g(ie,{section:"ops",title:"运营维护",description:"调度回放、日志管理、版本维护(OpsConfig",defaults:K(J),"normalize-payload":K(R),"after-load":I,"before-save":K(z)},{default:n(({payload:s,update:p})=>[l(j,{"label-width":"200px",model:s},{default:n(()=>[l(o,{"content-position":"left"},{default:n(()=>[...e[0]||(e[0]=[_("调度回放",-1)])]),_:1}),l(i,{label:"保留时长 (天)"},{default:n(()=>[l(m,{"model-value":s.playback.retentionDays,min:1,max:3650,"onUpdate:modelValue":a=>p({...s,playback:{...s.playback,retentionDays:a??0}})},null,8,["model-value","onUpdate:modelValue"])]),_:2},1024),l(i,{label:"采样频率 (Hz)"},{default:n(()=>[l(m,{"model-value":s.playback.samplingHz,min:1,max:100,"onUpdate:modelValue":a=>p({...s,playback:{...s.playback,samplingHz:a??0}})},null,8,["model-value","onUpdate:modelValue"])]),_:2},1024),l(o,{"content-position":"left"},{default:n(()=>[...e[1]||(e[1]=[_("日志保留",-1)])]),_:1}),l(i,{label:"热数据 (天)"},{default:n(()=>[l(m,{"model-value":s.logRetention.hotDays,min:1,max:365,"onUpdate:modelValue":a=>p({...s,logRetention:{...s.logRetention,hotDays:a??0}})},null,8,["model-value","onUpdate:modelValue"])]),_:2},1024),l(i,{label:"冷数据 (天)"},{default:n(()=>[l(m,{"model-value":s.logRetention.coldDays,min:1,max:3650,"onUpdate:modelValue":a=>p({...s,logRetention:{...s.logRetention,coldDays:a??0}})},null,8,["model-value","onUpdate:modelValue"])]),_:2},1024),l(o,{"content-position":"left"},{default:n(()=>[...e[2]||(e[2]=[_("版本维护",-1)])]),_:1}),l(i,{label:"保留发布版本"},{default:n(()=>[l(m,{"model-value":s.version.keepReleases,min:1,max:100,"onUpdate:modelValue":a=>p({...s,version:{keepReleases:a??0}})},null,8,["model-value","onUpdate:modelValue"])]),_:2},1024),l(o,{"content-position":"left"},{default:n(()=>[...e[3]||(e[3]=[_("地图监控信息与动作管理",-1)])]),_:1}),l(f,{type:"info",closable:!1,"show-icon":"",title:y.value?"正在自动保存…":"支持直接多选,修改后会自动保存到地图监控(simple.json),无需点击上方「保存」。若某组不勾选,表示该组在地图监控中显示全部。",style:{"margin-bottom":"10px"}},null,8,["title"]),l(i,{label:"按车型动作配置"},{default:n(()=>[l(H,{class:"type-actions"},{default:n(()=>[(u(!0),k(M,null,T(x.value,a=>(u(),g(P,{key:a.typeKey,name:a.typeKey,title:`${a.title}${a.methods.length}`},{default:n(()=>[l(B,{"model-value":w(s,a),class:"cfg-check-grid","onUpdate:modelValue":v=>L(p,s,a,v)},{default:n(()=>[(u(!0),k(M,null,T(a.methods,v=>(u(),g(r,{key:`${a.typeKey}-${v.methodName}`,label:v.methodName},{default:n(()=>[_(O(v.label),1)]),_:2},1032,["label"]))),128))]),_:2},1032,["model-value","onUpdate:modelValue"])]),_:2},1032,["name","title"]))),128))]),_:2},1024)]),_:2},1024),l(i,{label:"站点动作显示项"},{default:n(()=>[l(B,{"model-value":h(s).site.actionKeys,class:"cfg-check-grid","onUpdate:modelValue":a=>S(p,s,"site","actionKeys",a)},{default:n(()=>[(u(!0),k(M,null,T(C.value,a=>(u(),g(r,{key:`sa-${a.methodName}`,label:a.methodName},{default:n(()=>[_(O(a.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])]),_:2},1024),l(i,{label:"路径动作显示项"},{default:n(()=>[l(B,{"model-value":h(s).track.actionKeys,class:"cfg-check-grid","onUpdate:modelValue":a=>S(p,s,"track","actionKeys",a)},{default:n(()=>[(u(!0),k(M,null,T(U.value,a=>(u(),g(r,{key:`ta-${a.methodName}`,label:a.methodName},{default:n(()=>[_(O(a.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])]),_:2},1024)]),_:2},1032,["model"])]),_:1},8,["defaults","normalize-payload","before-save"])}}}),Ee=se(ce,[["__scopeId","data-v-e66d9ef7"]]);export{Ee as default};