From 92224e3d5e03f223bf2fb4b0eb88b74e790d8da9 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 17 一月 2022 10:00:05 +0800
Subject: [PATCH] 2022-01-17

---
 src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx |  113 ++++++++++++--------------------------------------------
 1 files changed, 25 insertions(+), 88 deletions(-)

diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx
index 1fef86d..c2bf0ab 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, Tooltip, notification, Modal, message, InputNumber, Radio, Typography } from 'antd'
+import { EditOutlined, QuestionCircleOutlined, StopOutlined, CheckCircleOutlined, SwapOutlined, DeleteOutlined } 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,35 +204,33 @@
         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>
-            <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>
+          (<div style={{textAlign: 'center'}}>
+            <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record, 'scripts')} style={{color: '#1890ff'}}><EditOutlined /></span>
+            <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'scripts')} style={{color: '#8E44AD'}}><SwapOutlined /></span>
             <Popconfirm
               overlayClassName="popover-confirm"
               title={this.props.dict['model.query.delete']}
               onConfirm={() => this.handleDelete(record, 'scripts')
             }>
-              <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span>
+              <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span>
             </Popconfirm>
           </div>)
       }
@@ -250,6 +246,8 @@
     _columns = _columns.map(col => {
       col.required = col.required || 'true'
       col.type = col.type || 'Nvarchar(50)'
+      col.import = col.import || 'true'
+      col.required = col.required || 'true'
       
       if (/^Nvarchar/ig.test(col.type)) {
         col.limit = col.type.match(/\d+/)[0]
@@ -587,68 +585,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 +814,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}>

--
Gitblit v1.8.0