2025-09-24 16:43:10 +08:00
|
|
|
import { appRegistry } from './AppRegistry'
|
|
|
|
|
import { markRaw } from 'vue'
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 注册所有内置应用
|
|
|
|
|
*/
|
|
|
|
|
export function registerBuiltInApps() {
|
|
|
|
|
// 注册计算器应用
|
|
|
|
|
appRegistry.registerApp({
|
|
|
|
|
manifest: {
|
|
|
|
|
id: 'calculator',
|
|
|
|
|
name: '计算器',
|
|
|
|
|
version: '1.0.0',
|
|
|
|
|
description: '简单而功能强大的计算器,支持基本数学运算',
|
|
|
|
|
author: 'System',
|
|
|
|
|
icon: '🧮',
|
|
|
|
|
permissions: ['storage'],
|
|
|
|
|
window: {
|
|
|
|
|
width: 400,
|
|
|
|
|
height: 600,
|
|
|
|
|
minWidth: 320,
|
|
|
|
|
minHeight: 480,
|
|
|
|
|
resizable: true,
|
|
|
|
|
minimizable: true,
|
2025-09-25 15:31:11 +08:00
|
|
|
maximizable: false,
|
2025-09-24 16:43:10 +08:00
|
|
|
},
|
|
|
|
|
category: 'utilities',
|
2025-09-25 15:31:11 +08:00
|
|
|
keywords: ['计算器', '数学', '运算', 'calculator', 'math'],
|
2025-09-24 16:43:10 +08:00
|
|
|
},
|
2025-09-25 15:31:11 +08:00
|
|
|
// 使用动态导入实现懒加载
|
|
|
|
|
component: async () => {
|
|
|
|
|
const { default: Calculator } = await import('./calculator/Calculator.vue')
|
|
|
|
|
return markRaw(Calculator)
|
|
|
|
|
},
|
|
|
|
|
isBuiltIn: true,
|
2025-09-24 16:43:10 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 注册记事本应用
|
|
|
|
|
appRegistry.registerApp({
|
|
|
|
|
manifest: {
|
|
|
|
|
id: 'notepad',
|
|
|
|
|
name: '记事本',
|
|
|
|
|
version: '1.0.0',
|
|
|
|
|
description: '功能丰富的文本编辑器,支持文件管理和多种编辑选项',
|
|
|
|
|
author: 'System',
|
|
|
|
|
icon: '📝',
|
|
|
|
|
permissions: ['storage', 'notification'],
|
|
|
|
|
window: {
|
|
|
|
|
width: 800,
|
|
|
|
|
height: 600,
|
|
|
|
|
minWidth: 400,
|
|
|
|
|
minHeight: 300,
|
2025-09-25 15:31:11 +08:00
|
|
|
resizable: true,
|
2025-09-24 16:43:10 +08:00
|
|
|
},
|
|
|
|
|
category: 'productivity',
|
2025-09-25 15:31:11 +08:00
|
|
|
keywords: ['记事本', '文本编辑', '笔记', 'notepad', 'text', 'editor'],
|
|
|
|
|
},
|
|
|
|
|
// 使用动态导入实现懒加载
|
|
|
|
|
component: async () => {
|
|
|
|
|
const { default: Notepad } = await import('./notepad/Notepad.vue')
|
|
|
|
|
return markRaw(Notepad)
|
2025-09-24 16:43:10 +08:00
|
|
|
},
|
2025-09-25 15:31:11 +08:00
|
|
|
isBuiltIn: true,
|
2025-09-24 16:43:10 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 注册待办事项应用
|
|
|
|
|
appRegistry.registerApp({
|
|
|
|
|
manifest: {
|
|
|
|
|
id: 'todo',
|
|
|
|
|
name: '待办事项',
|
|
|
|
|
version: '1.0.0',
|
|
|
|
|
description: '高效的任务管理工具,帮助您组织和跟踪日常任务',
|
|
|
|
|
author: 'System',
|
|
|
|
|
icon: '✅',
|
|
|
|
|
permissions: ['storage', 'notification'],
|
|
|
|
|
window: {
|
|
|
|
|
width: 600,
|
|
|
|
|
height: 700,
|
|
|
|
|
minWidth: 400,
|
|
|
|
|
minHeight: 500,
|
2025-09-25 15:31:11 +08:00
|
|
|
resizable: true,
|
2025-09-24 16:43:10 +08:00
|
|
|
},
|
|
|
|
|
category: 'productivity',
|
2025-09-25 15:31:11 +08:00
|
|
|
keywords: ['待办事项', '任务管理', 'todo', 'task', 'productivity'],
|
|
|
|
|
},
|
|
|
|
|
// 使用动态导入实现懒加载
|
|
|
|
|
component: async () => {
|
|
|
|
|
const { default: Todo } = await import('./todo/Todo.vue')
|
|
|
|
|
return markRaw(Todo)
|
2025-09-24 16:43:10 +08:00
|
|
|
},
|
2025-09-25 15:31:11 +08:00
|
|
|
isBuiltIn: true,
|
2025-09-24 16:43:10 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
console.log('内置应用注册完成')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 导出应用注册中心
|
|
|
|
|
export { appRegistry } from './AppRegistry'
|
2025-09-25 15:31:11 +08:00
|
|
|
export type { InternalAppManifest, AppRegistration } from './types/AppManifest'
|