Files
Migu2.0/MiGu.Server/wwwroot/assets/reflection-BmVSriDn.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
3.8 KiB
JavaScript

import{aS as i}from"./index-D5OuyicD.js";const c="/sl/projection/reflection";function p(){return{fields:[],status:[],methods:[]}}function f(){return{car:p(),site:p(),track:p()}}const g=f;async function o(e){const{data:t}=await i.get(`${c}${e}`);if(!t?.success)throw new Error(t?.message??`reflection ${e} failed`);return t.data}async function r(e,t){const{data:s}=await i.post(`${c}${e}`,null,{params:t});if(!s?.success)throw new Error(s?.message??`reflection ${e} failed`);return s.data}async function d(e){const{data:t}=await i.delete(`${c}${e}`);if(!t?.success)throw new Error(t?.message??`reflection ${e} failed`);return t.data}async function u(e,t){const{data:s}=await i.patch(`${c}${e}`,t);if(!s?.success)throw new Error(s?.message??`reflection PATCH ${e} failed`);return s.data}const y={listKinds:()=>o("/kinds"),listAssemblies:()=>o("/assemblies"),listObjects:e=>o(`/objects/${e}`),listCreatableTypes:e=>o(`/types/${e}`),createObject:(e,t,s)=>{const n={};if(t&&(n.typeName=t),s)for(const[a,l]of Object.entries(s))l==null||l===""||(n[a]=l);return r(`/objects/${e}`,n)},deleteObject:(e,t)=>d(`/objects/${e}/${t}`),reloadPlugins:()=>r("/plugins/reload"),listPlugins:()=>o("/plugins"),unloadPlugin:e=>r(`/plugins/${encodeURIComponent(e)}/unload`),listMethods:(e,t)=>o(`/methods/${e}/${t}`),listMethodsByType:e=>o(`/methods-by-type/${e}`),getStatus:(e,t)=>o(`/status/${e}/${t}`),getFields:(e,t)=>o(`/fields/${e}/${t}`),setField:(e,t,s,n)=>r(`/fields/${e}/${t}/${encodeURIComponent(s)}`,{value:n}),deleteField:(e,t,s)=>d(`/fields/${e}/${t}/${encodeURIComponent(s)}`),getBundle:(e,t)=>o(`/bundle/${e}/${t}`),execute:(e,t,s,n)=>r(`/execute/${e}/${t}/${encodeURIComponent(s)}`,n),gotoCarSite:(e,t)=>r(`/car/${e}/goto-site`,{siteId:t}),getScriptSource:e=>o(`/scripts/${e}/source`),getScriptExceptionStatus:e=>o(`/scripts/${e}/exception-status`),getMonitorConfig:()=>o("/monitor-config"),saveMonitorConfig:async e=>{const{data:t}=await i.post(`${c}/monitor-config`,e);if(!t?.success)throw new Error(t?.message??"saveMonitorConfig failed");return t.data},getSelection:()=>o("/selection"),setSelection:(e,t)=>r("/selection",{kind:e,id:t}),clearSelection:()=>r("/selection/clear"),getProjectFields:()=>o("/project/fields"),setProjectField:(e,t)=>r(`/project/fields/${encodeURIComponent(e)}`,{value:t}),saveProject:e=>r("/project/save",e?{path:e}:void 0),getAppConfigFields:()=>o("/app-config/fields"),setAppConfigField:(e,t)=>r(`/app-config/fields/${encodeURIComponent(e)}`,{value:t}),saveAppConfig:()=>r("/app-config/save"),getViewportStyle:()=>o("/viewport-style"),patchViewportStyle:e=>u("/viewport-style",e),getCarStyleTypes:()=>o("/car-style/types"),getCarStyle:e=>o(`/car-style/${encodeURIComponent(e)}`),putCarStyle:async(e,t)=>{const{data:s}=await i.post(`${c}/car-style/${encodeURIComponent(e)}`,t);if(!s?.success)throw new Error(s?.message??"putCarStyle failed");return s.data},deleteCarStyle:e=>d(`/car-style/${encodeURIComponent(e)}`),getAlarmColors:()=>o("/car-style/alarm-colors"),putAlarmColors:async e=>{const{data:t}=await i.post(`${c}/car-style/alarm-colors`,e);if(!t?.success)throw new Error(t?.message??"putAlarmColors failed");return t.data},saveCarStyle:()=>r("/car-style/save")};function m(e){const t=e>>>24&255,s=e>>>16&255,n=e>>>8&255,a=e&255;return t>=255?`#${s.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}${a.toString(16).padStart(2,"0")}`:`#${t.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}${a.toString(16).padStart(2,"0")}`}function S(e){const t=e.replace("#","").trim();if(t.length===6){const s=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),a=parseInt(t.slice(4,6),16);return 255<<24|s<<16|n<<8|a}if(t.length===8){const s=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),a=parseInt(t.slice(4,6),16),l=parseInt(t.slice(6,8),16);return s<<24|n<<16|a<<8|l}return 4294967295}export{m as a,f as b,g as e,S as h,y as r};