| | |
| | | dataIndex: 'operation', |
| | | render: (text, record) => |
| | | (<div style={{textAlign: 'center'}}> |
| | | <span className="operation-btn" title="编辑" onClick={() => this.handleEdit(record, 'scripts')} style={{color: '#1890ff'}}><EditOutlined /></span> |
| | | <span className="operation-btn" title="状态切换" onClick={() => this.handleStatus(record, 'scripts')} style={{color: '#8E44AD'}}><SwapOutlined /></span> |
| | | <span className="operation-btn" title="编辑" onClick={() => this.handleEdit(record)} style={{color: '#1890ff'}}><EditOutlined /></span> |
| | | <span className="operation-btn" title="状态切换" onClick={() => this.handleStatus(record)} style={{color: '#8E44AD'}}><SwapOutlined /></span> |
| | | <Popconfirm |
| | | overlayClassName="popover-confirm" |
| | | title="确定删除吗?" |
| | | onConfirm={() => this.handleDelete(record, 'scripts') |
| | | onConfirm={() => this.handleDelete(record) |
| | | }> |
| | | <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> |
| | | </Popconfirm> |
| | |
| | | }) |
| | | } |
| | | |
| | | handleEdit = (record, type) => { |
| | | let node = null |
| | | |
| | | if (type === 'scripts') { |
| | | this.scriptsForm.edit(record) |
| | | node = document.getElementById('mk-exout-script') |
| | | } |
| | | |
| | | handleEdit = (record) => { |
| | | this.scriptsForm.edit(record) |
| | | let node = document.getElementById('mk-exout-script') |
| | | |
| | | if (node && node.scrollTop) { |
| | | let inter = Math.ceil(node.scrollTop / 10) |
| | |
| | | } |
| | | } |
| | | |
| | | handleStatus = (record) => { |
| | | let verify = fromJS(this.state.verify).toJS() |
| | | record.status = record.status === 'false' ? 'true' : 'false' |
| | | |
| | | verify.scripts = verify.scripts.map(item => { |
| | | if (item.uuid === record.uuid) { |
| | | return record |
| | | } else { |
| | | return item |
| | | } |
| | | }) |
| | | |
| | | this.setState({ |
| | | verify: verify |
| | | }) |
| | | } |
| | | |
| | | handleDelete = (record) => { |
| | | let verify = fromJS(this.state.verify).toJS() |
| | | |
| | | verify.scripts = verify.scripts.filter(item => item.uuid !== record.uuid) |
| | | |
| | | this.setState({ verify: verify }) |
| | | |
| | | this.scriptsForm.check(record) |
| | | } |
| | | |
| | | showError = (errorType) => { |
| | | if (errorType === 'S') { |
| | | notification.success({ |