Guanghu Domestic Migration d1e47f4565
Some checks are pending
自动更新代码和重启 / update-and-restart (push) Waiting to run
CI检查 + 自动部署 / check (push) Waiting to run
CI检查 + 自动部署 / deploy (push) Blocked by required conditions
重启聊天服务 / restart (push) Waiting to run
chore: import sanitized domestic snapshot for REPO-002
Source snapshot: ca48d3ddf926d79aa138306164169baf764bb829
2026-07-17 15:54:41 +08:00

48 lines
1.3 KiB
JavaScript

// M08 数据统计模块适配器
window.M08Adapter = {
moduleId: 'm08',
moduleName: '数据统计',
init: function(containerId) {
console.log('[M08Adapter] 初始化');
if (window.ModuleAdapter) {
return ModuleAdapter.loadModule(this.moduleId, containerId);
} else {
console.error('[M08Adapter] ModuleAdapter 未加载');
return null;
}
},
sendMessage: function(type, payload) {
return ModuleAdapter.sendMessage(this.moduleId, { type, payload });
},
// 监听统计模块事件
onStatsRefresh: function(callback) {
EventBus.on('module:m08:message', function(data) {
if (data.type === 'stats:refresh') {
callback(data.payload);
}
});
},
onStatsExport: function(callback) {
EventBus.on('module:m08:message', function(data) {
if (data.type === 'stats:export') {
callback(data.payload);
}
});
},
destroy: function() {
ModuleAdapter.unloadModule(this.moduleId);
}
};
if (window.ModuleRegistry) {
ModuleRegistry.register('m08', window.M08Adapter);
console.log('[M08Adapter] 已注册到模块注册表');
}
console.log('[M08Adapter] 已加载');