This commit is contained in:
chndfang 2025-06-06 22:36:16 +08:00
parent c4166e94a3
commit 4d38da8d67
8 changed files with 36 additions and 30 deletions

2
.env
View File

@ -1,3 +1,3 @@
ENV_APP_TITLE=大众一汽发动机AMR调度系统
ENV_APP_TITLE=运输控制系统
ENV_HTTP_BASE=/api
ENV_WEBSOCKET_BASE=/ws

View File

@ -1,2 +1,2 @@
ENV_APP_TITLE=运输控制系统(开发)
ENV_HTTP_BASE=/mocks
# ENV_HTTP_BASE=/mocks

View File

@ -0,0 +1,3 @@
ENV_APP_TITLE=大众一汽发动机AMR调度系统
ENV_HTTP_BASE=/jeecg-boot/
ENV_WEBSOCKET_BASE=/ws

View File

@ -1,5 +1,7 @@
# 页面路由
路由统一前缀 web-amr
1. 场景编辑
/scene-editor/:id [id为场景id]
2. 组编辑

View File

@ -51,25 +51,25 @@ const client = shallowRef<WebSocket>();
onMounted(async () => {
await readScene();
await editor.value?.initRobots();
// await monitorScene();
await monitorScene();
const id = 'mock-robot-1';
let x = 800;
let y = 500;
const active = true;
const angle = -90;
const path = <[number, number][]>[
[600, 500],
[100, 400],
];
editor.value?.refreshRobot(id, { x, y, active, angle, path });
const test = () =>
requestAnimationFrame(() => {
x -= 0.1;
editor.value?.refreshRobot(id, { x, y });
test();
});
test();
// const id = 'mock-robot-1';
// let x = 800;
// let y = 500;
// const active = true;
// const angle = -90;
// const path = <[number, number][]>[
// [600, 500],
// [100, 400],
// ];
// editor.value?.refreshRobot(id, { x, y, active, angle, path });
// const test = () =>
// requestAnimationFrame(() => {
// x -= 0.1;
// editor.value?.refreshRobot(id, { x, y });
// test();
// });
// test();
});
onUnmounted(() => {
client.value?.close();

View File

@ -400,7 +400,8 @@ export class EditorService extends Meta2d {
active?: boolean,
): Required<Pick<MapPen, 'image' | 'iconWidth' | 'iconHeight' | 'iconTop'>> {
const theme = this.data().theme;
const image = active ? `/robot/${type}-active-${theme}.png` : `/robot/${type}-${theme}.png`;
const image =
import.meta.env.BASE_URL + active ? `/robot/${type}-active-${theme}.png` : `/robot/${type}-${theme}.png`;
return { image, iconWidth: 34, iconHeight: 54, iconTop: -5 };
}
//#endregion
@ -452,7 +453,7 @@ export class EditorService extends Meta2d {
}
#mapPointImage(type: MapPointType): Required<Pick<MapPen, 'image' | 'canvasLayer'>> {
const theme = this.data().theme;
const image = type < 10 ? '' : `/point/${type}-${theme}.png`;
const image = type < 10 ? '' : `${import.meta.env.BASE_URL}/point/${type}-${theme}.png`;
return { image, canvasLayer: CanvasLayer.CanvasMain };
}
//#endregion

View File

@ -19,7 +19,7 @@ http.interceptors.request.use(
http.interceptors.response.use(
(response) => {
const res = <CommonRes>response.data;
if (res?.success) return <never>res.data;
if (res?.success) return <never>res.result;
const hint = res?.message ?? '未知异常';
message.error(hint);
return Promise.reject(hint);
@ -39,6 +39,6 @@ type HttpInstance = Omit<AxiosInstance, 'get' | 'post'> & {
type CommonRes<T = void> = {
code: number;
success: boolean;
data: T | undefined;
result: T | undefined;
message: string;
};

View File

@ -13,7 +13,7 @@ export default ({ mode }: Record<string, unknown>) =>
resolvers: [AntDesignVueResolver({ importStyle: false, resolveIcons: true })],
}),
],
base: '/',
base: '/web-amr',
envPrefix: 'ENV_',
resolve: {
alias: {
@ -43,11 +43,11 @@ export default ({ mode }: Record<string, unknown>) =>
port: 8888,
host: true,
proxy: {
// '/mocks/': {
// target: 'http://82.156.39.91:18085/jeecg-boot',
// rewrite: (path) => path.replace(/^\/api/, ''),
// changeOrigin: true,
// },
'/api/': {
target: 'http://82.156.39.91:18080/jeecg-boot',
rewrite: (path) => path.replace(/^\/api/, ''),
changeOrigin: true,
},
// '/ws/': {
// target: 'ws://82.157.33.186:26981/jeecg-boot',
// rewrite: (path) => path.replace(/^\/ws/, ''),