From 50b49c1b760489c3430fc382656d57c5fbbab07c Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 29 四月 2024 16:07:24 +0800
Subject: [PATCH] 2024-04-29
---
src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx | 44 +++++++++++++++++++++++++++++++++-----------
1 files changed, 33 insertions(+), 11 deletions(-)
diff --git a/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx
index ccad7dd..bbad3ad 100644
--- a/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx
+++ b/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx
@@ -97,12 +97,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>
@@ -333,14 +333,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)
@@ -356,6 +351,33 @@
}
}
+ 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({
--
Gitblit v1.8.0