注册修改为绑定
This commit is contained in:
@@ -1,12 +1,8 @@
|
||||
// 员工模块 - 处理所有员工(管理员和货运人员)管理、位置跟踪、交互
|
||||
import employeeService from '../../../services/employeeService';
|
||||
|
||||
// getApp是微信小程序全局函数,无需导入
|
||||
|
||||
import { showToast } from '../../../utils/helpers';
|
||||
// 货运人员模块 - 专门处理货运人员相关功能
|
||||
import { showToast } from '../../utils/helpers';
|
||||
import { DataModule } from './dataModule';
|
||||
|
||||
export class EmployeeModule {
|
||||
export class DeliveryPersonModule {
|
||||
private pageContext: any;
|
||||
private dataModule: DataModule;
|
||||
|
||||
@@ -16,31 +12,25 @@ export class EmployeeModule {
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载所有员工数据(包括管理员和货运人员)
|
||||
* 处理货运人员标记点点击
|
||||
*/
|
||||
async loadAllEmployees(): Promise<void> {
|
||||
try {
|
||||
// 获取所有员工数据
|
||||
const allEmployees = await employeeService.getEmployees();
|
||||
|
||||
console.log('所有员工数据加载完成,数量:', allEmployees.length);
|
||||
} catch (error) {
|
||||
console.error('加载员工数据失败:', error);
|
||||
showToast('加载员工数据失败');
|
||||
}
|
||||
onDeliveryPersonMarkerClick(deliveryPerson: any, position: { x: number, y: number }): void {
|
||||
console.log('货运人员被点击:', deliveryPerson);
|
||||
|
||||
// 显示货运人员详情面板(包含订单列表)
|
||||
this.showDeliveryPersonPanel(deliveryPerson, position);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 显示货运人员详情面板
|
||||
*/
|
||||
showDeliveryPersonPanel(person: any, position: { x: number, y: number }): void {
|
||||
// 关闭其他面板
|
||||
this.pageContext.hideAllPanels();
|
||||
private showDeliveryPersonPanel(deliveryPerson: any, position: { x: number, y: number }): void {
|
||||
console.log('显示货运人员详情面板:', deliveryPerson);
|
||||
|
||||
this.dataModule.setCurrentDeliveryPerson(person);
|
||||
this.dataModule.setPanelPosition(position);
|
||||
// 设置当前货运人员
|
||||
this.dataModule.setCurrentDeliveryPerson(deliveryPerson);
|
||||
|
||||
// 显示面板
|
||||
this.dataModule.toggleDeliveryPersonModal(true, 'bottom');
|
||||
}
|
||||
|
||||
@@ -67,13 +57,10 @@ export class EmployeeModule {
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理货运人员标记点点击
|
||||
* 获取货运人员信息摘要
|
||||
*/
|
||||
onDeliveryPersonMarkerClick(person: any, position: { x: number, y: number }): void {
|
||||
console.log('货运人员被点击:', person);
|
||||
|
||||
// 显示货运人员详情面板
|
||||
this.showDeliveryPersonPanel(person, position);
|
||||
getDeliveryPersonSummary(deliveryPerson: any): string {
|
||||
return `${deliveryPerson.name || '货运人员'} - ${deliveryPerson.role || 'DRIVER'}`;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -129,4 +116,11 @@ export class EmployeeModule {
|
||||
};
|
||||
return statusMap[status] || status;
|
||||
}
|
||||
|
||||
/**
|
||||
* 清理资源
|
||||
*/
|
||||
cleanup(): void {
|
||||
console.log('清理货运人员模块资源');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user