// src/js/tools/systemTool.js import BaseTool from '../baseTool.js'; class SystemTool extends BaseTool { constructor() { super('system-tool', '系统工具'); this.isAdmin = false; // 保存管理员权限状态 // 扩充后的工具列表 this.tools = [ // 常用工具 { id: 'calc', name: '计算器', icon: 'fa-calculator', command: 'calc' }, { id: 'notepad', name: '记事本', icon: 'fa-file-alt', command: 'notepad' }, { id: 'mspaint', name: '画图', icon: 'fa-paint-brush', command: 'mspaint' }, { id: 'snippingtool', name: '截图工具', icon: 'fa-cut', command: 'snippingtool' }, { id: 'osk', name: '屏幕键盘', icon: 'fa-keyboard', command: 'osk' }, { id: 'charmap', name: '字符映射表', icon: 'fa-font', command: 'charmap' }, // 音频与多媒体 { id: 'soundrecorder', name: '录音机', icon: 'fa-microphone', command: 'ms-winsoundrecorder:' }, { id: 'sound', name: '声音设置', icon: 'fa-volume-up', command: 'mmsys.cpl' }, // 系统与诊断 { id: 'clock', name: '时钟', icon: 'fa-clock', command: 'ms-clock:' }, { id: 'control', name: '控制面板', icon: 'fa-sliders-h', command: 'control' }, { id: 'dxdiag', name: 'DirectX诊断', icon: 'fa-gamepad', command: 'dxdiag' }, { id: 'mstsc', name: '远程桌面', icon: 'fa-headset', command: 'mstsc' }, // 需要管理员权限的工具 { id: 'taskmgr', name: '任务管理器', icon: 'fa-tasks', command: 'taskmgr', requiresAdmin: true }, { id: 'power', name: '电源选项', icon: 'fa-battery-full', command: 'powercfg.cpl', requiresAdmin: true }, { id: 'display', name: '桌面/分辨率', icon: 'fa-desktop', command: 'desk.cpl', requiresAdmin: true }, { id: 'system', name: '系统属性', icon: 'fa-cogs', command: 'sysdm.cpl', requiresAdmin: true }, { id: 'regedit', name: '注册表编辑器', icon: 'fa-list-alt', command: 'regedit', requiresAdmin: true }, { id: 'services', name: '服务', icon: 'fa-running', command: 'services.msc', requiresAdmin: true }, { id: 'devmgmt', name: '设备管理器', icon: 'fa-microchip', command: 'devmgmt.msc', requiresAdmin: true }, { id: 'diskmgmt', name: '磁盘管理', icon: 'fa-hdd', command: 'diskmgmt.msc', requiresAdmin: true }, { id: 'perfmon', name: '性能监视器', icon: 'fa-tachometer-alt', command: 'perfmon.msc', requiresAdmin: true }, { id: 'msconfig', name: '系统配置', icon: 'fa-cog', command: 'msconfig', requiresAdmin: true }, { id: 'eventvwr', name: '事件查看器', icon: 'fa-clipboard-list', command: 'eventvwr.msc', requiresAdmin: true }, { id: 'gpedit', name: '组策略编辑器', icon: 'fa-list-ul', command: 'gpedit.msc', requiresAdmin: true }, { id: 'compmgmt', name: '计算机管理', icon: 'fa-laptop-medical', command: 'compmgmt.msc', requiresAdmin: true }, { id: 'cleanmgr', name: '磁盘清理', icon: 'fa-broom', command: 'cleanmgr', requiresAdmin: true }, { id: 'ncpa', name: '网络连接', icon: 'fa-network-wired', command: 'ncpa.cpl', requiresAdmin: true }, ]; } // 渲染静态框架 render() { // [修改] 确保 id="system-tool-content" 存在且样式正确 return `
正在检查权限...
正在以管理员身份重启应用...
${isDisabled ? '需要管理员权限' : `启动 ${tool.command}`}
${isDisabled ? '