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/actioncomponent/verifyexcelin/index.jsx | 105 ++++++++++------------------------------------------ 1 files changed, 20 insertions(+), 85 deletions(-) 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}> -- Gitblit v1.8.0