From 828462b5c75a4c90f6754a79e16858e5e30c527e Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 02 十二月 2021 17:18:53 +0800
Subject: [PATCH] 2021-12-02

---
 src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx |   13 +-
 src/templates/zshare/customscript/index.jsx                                      |    9 +-
 src/templates/zshare/verifycard/index.jsx                                        |   68 ++++++++--------
 src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx             |  105 +++++---------------------
 src/menu/datasource/verifycard/index.jsx                                         |    9 +-
 src/templates/zshare/verifycard/index.scss                                       |    3 
 6 files changed, 74 insertions(+), 133 deletions(-)

diff --git a/src/menu/datasource/verifycard/index.jsx b/src/menu/datasource/verifycard/index.jsx
index e21bfda..095b693 100644
--- a/src/menu/datasource/verifycard/index.jsx
+++ b/src/menu/datasource/verifycard/index.jsx
@@ -2,6 +2,7 @@
 import PropTypes from 'prop-types'
 import { fromJS } from 'immutable'
 import { Form, Tabs, Popconfirm, Icon, notification, Modal, Typography, Spin, message } from 'antd'
+import { StopOutlined, CheckCircleOutlined } from '@ant-design/icons'
 import moment from 'moment'
 
 import Api from '@/api'
@@ -117,15 +118,15 @@
         width: '13%',
         render: (text, record) => record.status === 'false' ?
           (
-            <div>
+            <div style={{color: '#ff4d4f'}}>
               {this.props.dict['model.status.forbidden']}
-              <Icon style={{marginLeft: '5px'}} type="stop" theme="twoTone" twoToneColor="#ff4d4f" />
+              <StopOutlined style={{marginLeft: '5px'}} />
             </div>
           ) :
           (
-            <div>
+            <div style={{color: '#26C281'}}>
               {this.props.dict['model.status.open']}
-              <Icon style={{marginLeft: '5px'}} type="check-circle" theme="twoTone" twoToneColor="#52c41a" />
+              <CheckCircleOutlined style={{marginLeft: '5px'}}/>
             </div>
           )
       },
diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx
index 1fef86d..1328845 100644
--- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx
+++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx
@@ -1,8 +1,8 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { fromJS } from 'immutable'
-import { Form, Tabs, Row, Col, Input, Button, Table, Popconfirm, Icon, Tooltip, notification, Modal, message, InputNumber, Radio, Typography } from 'antd'
-import { QuestionCircleOutlined } from '@ant-design/icons'
+import { Form, Tabs, Row, Col, Input, Button, Popconfirm, Icon, Tooltip, notification, Modal, message, InputNumber, Radio, Typography } from 'antd'
+import { QuestionCircleOutlined, StopOutlined, CheckCircleOutlined } from '@ant-design/icons'
 import moment from 'moment'
 
 import Api from '@/api'
@@ -153,15 +153,15 @@
         inputType: 'switch',
         render: (text, record) => record.status === 'false' ?
           (
-            <div>
+            <div style={{color: '#ff4d4f'}}>
               {this.props.dict['model.status.forbidden']}
-              <Icon style={{marginLeft: '5px'}} type="stop" theme="twoTone" twoToneColor="#ff4d4f" />
+              <StopOutlined style={{marginLeft: '5px'}} />
             </div>
           ) :
           (
-            <div>
+            <div style={{color: '#26C281'}}>
               {this.props.dict['model.status.open']}
-              <Icon style={{marginLeft: '5px'}} type="check-circle" theme="twoTone" twoToneColor="#52c41a" />
+              <CheckCircleOutlined style={{marginLeft: '5px'}}/>
             </div>
           )
       },
@@ -189,15 +189,13 @@
         dataIndex: 'position',
         width: '10%',
         render: (text, record) => {
-          let _text = ''
-          if (record.position === 'front') {
-            _text = 'sql鍓�'
-          } else if (record.position === 'init') {
-            _text = '鍒濆鍖�'
+          if (record.position === 'init') {
+            return <span style={{color: 'orange'}}>鍒濆鍖�</span>
+          } else if (record.position === 'front') {
+            return <span style={{color: '#26C281'}}>sql鍓�</span>
           } else {
-            _text = 'sql鍚�'
+            return <span style={{color: '#1890ff'}}>sql鍚�</span>
           }
-          return _text
         }
       },
       {
@@ -206,28 +204,26 @@
         width: '10%',
         render: (text, record) => record.status === 'false' ?
           (
-            <div>
+            <div style={{color: '#ff4d4f'}}>
               {this.props.dict['model.status.forbidden']}
-              <Icon style={{marginLeft: '5px'}} type="stop" theme="twoTone" twoToneColor="#ff4d4f" />
+              <StopOutlined style={{marginLeft: '5px'}} />
             </div>
           ) :
           (
-            <div>
+            <div style={{color: '#26C281'}}>
               {this.props.dict['model.status.open']}
-              <Icon style={{marginLeft: '5px'}} type="check-circle" theme="twoTone" twoToneColor="#52c41a" />
+              <CheckCircleOutlined style={{marginLeft: '5px'}}/>
             </div>
           )
       },
       {
         title: '鎿嶄綔',
         align: 'center',
-        width: '20%',
+        width: '140px',
         dataIndex: 'operation',
         render: (text, record) =>
-          (<div>
+          (<div style={{textAlign: 'center'}}>
             <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record, 'scripts')} style={{color: '#1890ff'}}><Icon type="edit" /></span>
-            <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'scripts', 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span>
-            <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'scripts', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span>
             <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'scripts')} style={{color: '#8E44AD'}}><Icon type="swap" /></span>
             <Popconfirm
               overlayClassName="popover-confirm"
@@ -587,68 +583,6 @@
     })
   }
 
-  handleUpDown = (record, type, direction) => {
-    let verify = JSON.parse(JSON.stringify(this.state.verify))
-    let index = 0
-
-    if (type === 'columns') {
-      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)
-      }
-    } else if (type === 'unique') {
-      verify.uniques = verify.uniques.filter((item, i) => {
-        if (item.uuid === record.uuid) {
-          index = i
-        }
-
-        return item.uuid !== record.uuid
-      })
-      if ((index === 0 && direction === 'up') || (index === verify.uniques.length && direction === 'down')) {
-        return
-      }
-
-      if (direction === 'up') {
-        verify.uniques.splice(index - 1, 0, record)
-      } else {
-        verify.uniques.splice(index + 1, 0, record)
-      }
-    } else if (type === 'scripts') {
-      verify.scripts = verify.scripts.filter((item, i) => {
-        if (item.uuid === record.uuid) {
-          index = i
-        }
-
-        return item.uuid !== record.uuid
-      })
-      if ((index === 0 && direction === 'up') || (index === verify.scripts.length && direction === 'down')) {
-        return
-      }
-
-      if (direction === 'up') {
-        verify.scripts.splice(index - 1, 0, record)
-      } else {
-        verify.scripts.splice(index + 1, 0, record)
-      }
-    }
-
-    this.setState({
-      verify: verify
-    })
-  }
-
   handleConfirm = () => {
     const { verify } = this.state
     // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭�
@@ -878,14 +812,15 @@
               scriptsChange={this.scriptsChange}
               wrappedComponentRef={(inst) => this.scriptsForm = inst}
             />
-            <Table
+            <EditTable actions={['move']} data={verify.scripts} columns={scriptsColumns} onChange={(scripts) => {this.setState({verify: {...verify, scripts}})}}/>
+            {/* <Table
               bordered
               rowKey="uuid"
               className="custom-table"
               dataSource={verify.scripts}
               columns={scriptsColumns}
               pagination={false}
-            />
+            /> */}
           </TabPane> : null}
           <TabPane tab="淇℃伅鎻愮ず" key="tip">
             <Form {...formItemLayout}>
diff --git a/src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx
index d1ed393..41dce62 100644
--- a/src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx
+++ b/src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx
@@ -2,6 +2,7 @@
 import PropTypes from 'prop-types'
 import { fromJS } from 'immutable'
 import { Form, Row, Col, Icon, Button, notification, Select, Popconfirm, Typography, Modal, Radio } from 'antd'
+import { StopOutlined, CheckCircleOutlined } from '@ant-design/icons'
 import moment from 'moment'
 
 import Utils from '@/utils/utils.js'
@@ -55,9 +56,9 @@
         width: '13%',
         render: (text, record) => {
           if (record.position === 'front') {
-            return 'sql鍓�'
+            return <span style={{color: '#26C281'}}>sql鍓�</span>
           } else {
-            return 'sql鍚�'
+            return <span style={{color: '#1890ff'}}>sql鍚�</span>
           }
         }
       },
@@ -67,15 +68,15 @@
         width: '12%',
         render: (text, record) => record.status === 'false' ?
           (
-            <div>
+            <div style={{color: '#ff4d4f'}}>
               {this.props.dict['model.status.forbidden']}
-              <Icon style={{marginLeft: '5px'}} type="stop" theme="twoTone" twoToneColor="#ff4d4f" />
+              <StopOutlined style={{marginLeft: '5px'}} />
             </div>
           ) :
           (
-            <div>
+            <div style={{color: '#26C281'}}>
               {this.props.dict['model.status.open']}
-              <Icon style={{marginLeft: '5px'}} type="check-circle" theme="twoTone" twoToneColor="#52c41a" />
+              <CheckCircleOutlined style={{marginLeft: '5px'}}/>
             </div>
           )
       },
diff --git a/src/templates/zshare/customscript/index.jsx b/src/templates/zshare/customscript/index.jsx
index 9b211ba..bf6ddb4 100644
--- a/src/templates/zshare/customscript/index.jsx
+++ b/src/templates/zshare/customscript/index.jsx
@@ -2,6 +2,7 @@
 import PropTypes from 'prop-types'
 import { fromJS } from 'immutable'
 import { Form, Row, Col, Icon, Button, notification, Select, Popconfirm, Typography } from 'antd'
+import { StopOutlined, CheckCircleOutlined } from '@ant-design/icons'
 import moment from 'moment'
 
 import Utils from '@/utils/utils.js'
@@ -54,15 +55,15 @@
         width: '12%',
         render: (text, record) => record.status === 'false' ?
           (
-            <div>
+            <div style={{color: '#ff4d4f'}}>
               {this.props.dict['model.status.forbidden']}
-              <Icon style={{marginLeft: '5px'}} type="stop" theme="twoTone" twoToneColor="#ff4d4f" />
+              <StopOutlined style={{marginLeft: '5px'}} />
             </div>
           ) :
           (
-            <div>
+            <div style={{color: '#26C281'}}>
               {this.props.dict['model.status.open']}
-              <Icon style={{marginLeft: '5px'}} type="check-circle" theme="twoTone" twoToneColor="#52c41a" />
+              <CheckCircleOutlined style={{marginLeft: '5px'}}/>
             </div>
           )
       },
diff --git a/src/templates/zshare/verifycard/index.jsx b/src/templates/zshare/verifycard/index.jsx
index eb38446..9d42d79 100644
--- a/src/templates/zshare/verifycard/index.jsx
+++ b/src/templates/zshare/verifycard/index.jsx
@@ -97,15 +97,15 @@
         inputType: 'switch',
         render: (text, record) => record.status === 'false' ?
           (
-            <div>
+            <div style={{color: '#ff4d4f'}}>
               {this.props.dict['model.status.forbidden']}
-              <StopOutlined style={{marginLeft: '5px', color: '#ff4d4f'}} />
+              <StopOutlined style={{marginLeft: '5px'}} />
             </div>
           ) :
           (
-            <div>
+            <div style={{color: '#26C281'}}>
               {this.props.dict['model.status.open']}
-              <CheckCircleOutlined style={{marginLeft: '5px', color: '#52c41a'}}/>
+              <CheckCircleOutlined style={{marginLeft: '5px'}}/>
             </div>
           )
       }
@@ -133,15 +133,15 @@
         inputType: 'switch',
         render: (text, record) => record.status === 'false' ?
           (
-            <div>
+            <div style={{color: '#ff4d4f'}}>
               {this.props.dict['model.status.forbidden']}
-              <StopOutlined style={{marginLeft: '5px', color: '#ff4d4f'}} />
+              <StopOutlined style={{marginLeft: '5px'}} />
             </div>
           ) :
           (
-            <div>
+            <div style={{color: '#26C281'}}>
               {this.props.dict['model.status.open']}
-              <CheckCircleOutlined style={{marginLeft: '5px', color: '#52c41a'}}/>
+              <CheckCircleOutlined style={{marginLeft: '5px'}}/>
             </div>
           )
       },
@@ -207,15 +207,15 @@
         inputType: 'switch',
         render: (text, record) => record.status === 'false' ?
           (
-            <div>
+            <div style={{color: '#ff4d4f'}}>
               {this.props.dict['model.status.forbidden']}
-              <StopOutlined style={{marginLeft: '5px', color: '#ff4d4f'}} />
+              <StopOutlined style={{marginLeft: '5px'}} />
             </div>
           ) :
           (
-            <div>
+            <div style={{color: '#26C281'}}>
               {this.props.dict['model.status.open']}
-              <CheckCircleOutlined style={{marginLeft: '5px', color: '#52c41a'}}/>
+              <CheckCircleOutlined style={{marginLeft: '5px'}}/>
             </div>
           )
       }
@@ -259,15 +259,15 @@
         width: '9%',
         render: (text, record) => record.status === 'false' ?
           (
-            <div>
+            <div style={{color: '#ff4d4f'}}>
               {this.props.dict['model.status.forbidden']}
-              <StopOutlined style={{marginLeft: '5px', color: '#ff4d4f'}} />
+              <StopOutlined style={{marginLeft: '5px'}} />
             </div>
           ) :
           (
-            <div>
+            <div style={{color: '#26C281'}}>
               {this.props.dict['model.status.open']}
-              <CheckCircleOutlined style={{marginLeft: '5px', color: '#52c41a'}}/>
+              <CheckCircleOutlined style={{marginLeft: '5px'}}/>
             </div>
           )
       },
@@ -314,11 +314,11 @@
         width: '10%',
         render: (text, record) => {
           if (record.position === 'init') {
-            return '鍒濆鍖�'
+            return <span style={{color: 'orange'}}>鍒濆鍖�</span>
           } else if (record.position === 'front') {
-            return 'sql鍓�'
+            return <span style={{color: '#26C281'}}>sql鍓�</span>
           } else {
-            return 'sql鍚�'
+            return <span style={{color: '#1890ff'}}>sql鍚�</span>
           }
         }
       },
@@ -328,22 +328,22 @@
         width: '10%',
         render: (text, record) => record.status === 'false' ?
           (
-            <div>
+            <div style={{color: '#ff4d4f'}}>
               {this.props.dict['model.status.forbidden']}
-              <StopOutlined style={{marginLeft: '5px', color: '#ff4d4f'}} />
+              <StopOutlined style={{marginLeft: '5px'}} />
             </div>
           ) :
           (
-            <div>
+            <div style={{color: '#26C281'}}>
               {this.props.dict['model.status.open']}
-              <CheckCircleOutlined style={{marginLeft: '5px', color: '#52c41a'}}/>
+              <CheckCircleOutlined style={{marginLeft: '5px'}}/>
             </div>
           )
       },
       {
         title: '鎿嶄綔',
         align: 'center',
-        width: '20%',
+        width: '140px',
         dataIndex: 'operation',
         render: (text, record) =>
           (<div style={{textAlign: 'center'}}>
@@ -383,9 +383,9 @@
         width: '10%',
         render: (text, record) => {
           if (record.position === 'front') {
-            return 'sql鍓�'
+            return <span style={{color: '#26C281'}}>sql鍓�</span>
           } else {
-            return 'sql鍚�'
+            return <span style={{color: '#1890ff'}}>sql鍚�</span>
           }
         }
       },
@@ -395,15 +395,15 @@
         width: '10%',
         render: (text, record) => record.status === 'false' ?
           (
-            <div>
+            <div style={{color: '#ff4d4f'}}>
               {this.props.dict['model.status.forbidden']}
-              <StopOutlined style={{marginLeft: '5px', color: '#ff4d4f'}} />
+              <StopOutlined style={{marginLeft: '5px'}} />
             </div>
           ) :
           (
-            <div>
+            <div style={{color: '#26C281'}}>
               {this.props.dict['model.status.open']}
-              <CheckCircleOutlined style={{marginLeft: '5px', color: '#52c41a'}}/>
+              <CheckCircleOutlined style={{marginLeft: '5px'}}/>
             </div>
           )
       },
@@ -496,15 +496,15 @@
         width: '8%',
         render: (text, record) => record.status === 'false' ?
           (
-            <div>
+            <div style={{color: '#ff4d4f'}}>
               {this.props.dict['model.status.forbidden']}
-              <StopOutlined style={{marginLeft: '5px', color: '#ff4d4f'}} />
+              <StopOutlined style={{marginLeft: '5px'}} />
             </div>
           ) :
           (
-            <div>
+            <div style={{color: '#26C281'}}>
               {this.props.dict['model.status.open']}
-              <CheckCircleOutlined style={{marginLeft: '5px', color: '#52c41a'}}/>
+              <CheckCircleOutlined style={{marginLeft: '5px'}}/>
             </div>
           )
       },
diff --git a/src/templates/zshare/verifycard/index.scss b/src/templates/zshare/verifycard/index.scss
index 9fc9d9e..d3dab25 100644
--- a/src/templates/zshare/verifycard/index.scss
+++ b/src/templates/zshare/verifycard/index.scss
@@ -69,4 +69,7 @@
     padding: 0 5px;
     cursor: pointer;
   }
+  .operation-btn:not(:first-child) {
+    margin-left: 5px;
+  }
 }
\ No newline at end of file

--
Gitblit v1.8.0