Files
WXProgram/miniprogram/pages/index/modules/adminModule.ts

71 lines
1.6 KiB
TypeScript
Raw Normal View History

2025-10-21 21:51:51 +08:00
// 管理员模块 - 专门处理管理员相关功能
2025-10-26 13:15:04 +08:00
2025-10-21 21:51:51 +08:00
import { DataModule } from './dataModule';
export class AdminModule {
2025-10-26 13:15:04 +08:00
2025-10-21 21:51:51 +08:00
private dataModule: DataModule;
2025-10-26 13:15:04 +08:00
constructor(_pageContext: any, dataModule: DataModule) {
2025-10-21 21:51:51 +08:00
this.dataModule = dataModule;
}
/**
*
*/
onAdminMarkerClick(admin: any, position: { x: number, y: number }): void {
console.log('管理员被点击:', admin);
// 显示管理员详情面板
this.showAdminPanel(admin, position);
}
/**
*
*/
2025-10-26 13:15:04 +08:00
private showAdminPanel(admin: any, _position: { x: number, y: number }): void {
2025-10-21 21:51:51 +08:00
console.log('显示管理员详情面板:', admin);
// 设置当前管理员
this.dataModule.setCurrentDeliveryPerson(admin);
// 显示面板
this.dataModule.toggleDeliveryPersonModal(true, 'bottom');
}
/**
*
*/
hideAdminPanel(): void {
this.dataModule.toggleDeliveryPersonModal(false);
this.dataModule.setCurrentDeliveryPerson(null);
}
/**
*
*/
expandAdminPanel(): void {
this.dataModule.toggleDeliveryPersonModal(true, 'full');
}
/**
*
*/
collapseAdminPanel(): void {
this.dataModule.toggleDeliveryPersonModal(true, 'bottom');
}
/**
*
*/
getAdminSummary(admin: any): string {
return `${admin.name || '管理员'} - ${admin.role || 'ADMIN'}`;
}
/**
*
*/
cleanup(): void {
console.log('清理管理员模块资源');
}
}