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_HTTP_BASE=/api
ENV_WEBSOCKET_BASE=/ws ENV_WEBSOCKET_BASE=/ws

View File

@ -1,2 +1,2 @@
ENV_APP_TITLE=运输控制系统(开发) 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. 场景编辑 1. 场景编辑
/scene-editor/:id [id为场景id] /scene-editor/:id [id为场景id]
2. 组编辑 2. 组编辑

View File

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

View File

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

View File

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

View File

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