添加管理员逻辑
This commit is contained in:
@@ -23,13 +23,13 @@ export interface MainPageModule {
|
||||
|
||||
export class MainPageModule {
|
||||
private pageContext: any;
|
||||
private dataModule: DataModule;
|
||||
private loginModule: LoginModule;
|
||||
private mapModule: MapModule;
|
||||
private orderModule: OrderModule;
|
||||
private warehouseModule: WarehouseModule;
|
||||
private employeeModule: EmployeeModule;
|
||||
private locationModule: LocationModule;
|
||||
private dataModule: DataModule;
|
||||
|
||||
constructor(pageContext: any) {
|
||||
this.pageContext = pageContext;
|
||||
@@ -198,13 +198,15 @@ export class MainPageModule {
|
||||
* 重置用户标记点
|
||||
*/
|
||||
private resetUserMarker(): void {
|
||||
const { markers } = this.pageContext.data;
|
||||
const { markers, userInfo } = this.pageContext.data;
|
||||
const userRole = userInfo?.role || 'employee';
|
||||
const iconPath = userRole === 'ADMIN' ? '/images/crown.png' : '/images/truck.png';
|
||||
|
||||
const updatedMarkers = markers.map((marker: any) => {
|
||||
if (marker.id === -1) {
|
||||
return {
|
||||
...marker,
|
||||
iconPath: '/images/trucks.png'
|
||||
iconPath: iconPath
|
||||
};
|
||||
}
|
||||
return marker;
|
||||
@@ -334,6 +336,19 @@ export class MainPageModule {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 清理资源
|
||||
*/
|
||||
cleanup(): void {
|
||||
console.log('清理主页面模块资源');
|
||||
|
||||
// 清理位置模块
|
||||
this.locationModule.cleanup();
|
||||
|
||||
// 这里可以添加其他需要清理的资源
|
||||
console.log('✅ 主页面模块清理完成');
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理错误
|
||||
*/
|
||||
|
Reference in New Issue
Block a user