import React from 'react'; import { Button, Icon, Checkbox } from 'antd'; import { WeaTools, WeaDialog, WeaSearchGroup, WeaTable } from 'ecCom'; import './style/'; class WeaPlugin extends React.Component { state = { visible: this.props.visible || false, test: false, data: {}, isCheck: false }; constructor(props) { super(props); this.getButtons = this.getButtons.bind(this); this.getPlugins = this.getPlugins.bind(this); this.getPluginStatus = this.getPluginStatus.bind(this); this.onChange = this.onChange.bind(this); this.onTest = this.onTest.bind(this); this.onCancel = this.onCancel.bind(this); this.onShow = this.onShow.bind(this); } componentWillMount() { if (this.state.visible) { this.getPlugins(); } } render() { const { test, data = {}, isCheck = false } = this.state; const { plugins = [], otherPlugins = [] } = data; let columns = [ { key: 'index', title: '序号', dataIndex: 'index', width: '10%' }, { key: 'name', title: '名称', dataIndex: 'name', width: '20%' }, { key: 'explain', title: '描述', dataIndex: 'explain', width: '35%' }, { key: 'size', title: '大小', dataIndex: 'size', width: '10%' }, { key: 'status', title: '状态', dataIndex: 'status', width: '10%', render: (text, record) => this.getPluginStatus(record.progid), }, { key: 'download', title: '下载并安装', dataIndex: 'download', width: '15%', render: (text, record) => 下载, }, ]; let displayComp = (
每次进入系统时检测
注意:安装完毕请重启计算机!
); if (test) { columns = [ { key: 'index', title: '序号', dataIndex: 'index', width: '10%', render: (text, record) => parseInt(record.index) - 1, }, { key: 'name', title: '名称', dataIndex: 'name', width: '15%' }, { key: 'clsid', title: '控件编号', dataIndex: 'clsid', width: '20%' }, { key: 'clsname', title: '控件名称', dataIndex: 'clsname', width: '20%' }, { key: 'version', title: '版本', dataIndex: 'version', width: '10%' }, { key: 'status', title: '状态', dataIndex: 'status', width: '10%', render: (text, record) => this.getPluginStatus(record.progid), }, { key: 'download', title: '检测', dataIndex: 'download', width: '15%', render: (text, record) => , }, ]; displayComp = (
1
第一步:从 C:\WINDOWS\Downloaded Program Files 删除通过自动提示安装方式注册的控件,对应名称参见clsname列;
2
第二步:从“控制面板 -> 删除或添加程序”删除通过下载控件方式安装的控件;
3
第三步:删除用手工方式注册的控件:

1、在命令行执行 regedit.exe;

2、在键 HKEY_CLASSES_ROOT\CLSID 下查找对应的 clsid,如Office 控件的注册项为 {'{23739A7E-5741-4D1C-88D5-D50B18F7C347}'};

3、如果找到该注册项,表明控件已安装。安装的文件路径见 InprocServer32 项的值,在命令行执行“regsvr32 /u <带路径的文件名称>”即可删除;

4
第四步:点击 this.setState({ test: false })}>重新下载控件方式安装控件!
卸载控件之前需要关闭所有 IE 窗口和使用控件的程序。
); } return ( {displayComp} ); } getButtons() { let buttons = []; if (this.state.test) { buttons.push(); } else { buttons.push(); } return buttons; } getPlugins() { WeaTools.callApi('/api/portal/systemInfo/getPlugins', 'GET', {}).then((result) => { const { data } = result; this.setState({ data, isCheck: data.isCheck }); }); } onChange(e) { const checked = e.target.checked; this.setState({ isCheck: checked }); WeaTools.callApi('/api/portal/systemInfo/setIsCheck', 'POST', { isCheck: checked ? '0' : '1' }); } getPluginStatus(progid) { let status = false; try { const obj = new ActiveXObject(progid); if (obj) { status = true; } } catch (e) { } return status ? : ; } onTest(obj) { const dialog = new window.top.Dialog(); dialog.currentWindow = window; dialog.Width = 650; dialog.Height = 400; dialog.Title = `控件检测:${obj.name}`; dialog.URL = obj.checkpageurl; dialog.show(); } onCancel() { this.setState({ visible: false }); } onShow() { this.setState({ visible: true }); this.getPlugins(); } } export default WeaPlugin;