king
2021-12-02 828462b5c75a4c90f6754a79e16858e5e30c527e
2021-12-02
6个文件已修改
207 ■■■■■ 已修改文件
src/menu/datasource/verifycard/index.jsx 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx 105 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/customscript/index.jsx 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/index.jsx 68 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/index.scss 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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>
          )
      },
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}>
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>
          )
      },
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>
          )
      },
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>
          )
      },
src/templates/zshare/verifycard/index.scss
@@ -69,4 +69,7 @@
    padding: 0 5px;
    cursor: pointer;
  }
  .operation-btn:not(:first-child) {
    margin-left: 5px;
  }
}