From 6e7e09300fdbe74e7cb453a80d2de42caf54b39c Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 15 三月 2024 09:50:21 +0800 Subject: [PATCH] 2024-03-15 --- src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx | 67 ++++++++------------------------- 1 files changed, 17 insertions(+), 50 deletions(-) diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx index 21d53fe..d1f3338 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx @@ -227,12 +227,12 @@ 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> @@ -392,14 +392,9 @@ }) } - 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) @@ -415,19 +410,17 @@ } } - handleStatus = (record, type) => { + handleStatus = (record) => { let verify = JSON.parse(JSON.stringify(this.state.verify)) record.status = record.status === 'false' ? 'true' : 'false' - if (type === 'scripts') { - verify.scripts = verify.scripts.map(item => { - if (item.uuid === record.uuid) { - return record - } else { - return item - } - }) - } + verify.scripts = verify.scripts.map(item => { + if (item.uuid === record.uuid) { + return record + } else { + return item + } + }) this.setState({ verify: verify @@ -459,38 +452,12 @@ }) } - handleDelete = (record, type) => { - const { verify } = this.state + handleDelete = (record) => { + let verify = JSON.parse(JSON.stringify(this.state.verify)) - verify.columns = verify.columns.filter(item => item.uuid !== record.uuid) + verify.scripts = verify.scripts.filter(item => item.uuid !== record.uuid) this.setState({ verify: verify }) - } - - handleUpDown = (record, type, direction) => { - let verify = JSON.parse(JSON.stringify(this.state.verify)) - let index = 0 - - verify.columns = verify.columns.filter((item, i) => { - if (item.uuid === record.uuid) { - index = i - } - - return item.uuid !== record.uuid - }) - if ((index === 0 && direction === 'up') || (index === verify.columns.length && direction === 'down')) { - return - } - - if (direction === 'up') { - verify.columns.splice(index - 1, 0, record) - } else { - verify.columns.splice(index + 1, 0, record) - } - - this.setState({ - verify: verify - }) } showError = (errorType) => { -- Gitblit v1.8.0