king
2021-11-12 0c84df247914f893ef5e41d57a422e10a2dc814c
src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx
@@ -2,6 +2,7 @@
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 moment from 'moment'
import Api from '@/api'
@@ -170,9 +171,18 @@
        title: 'SQL',
        dataIndex: 'sql',
        width: '60%',
        render: (text) => (
          <Paragraph copyable ellipsis={{ rows: 5, expandable: true }}>{text}</Paragraph>
        )
        render: (text) => {
          let title = text.match(/^\s*\/\*.+\*\//)
          title = title && title[0] ? title[0] : ''
          text = title ? text.replace(title, '') : text
          return (
            <div>
              {title ? <span style={{color: '#a50'}}>{title}</span> : null}
              <Paragraph copyable ellipsis={{ rows: 4, expandable: true }}>{text}</Paragraph>
            </div>
          )
        }
      },
      {
        title: '执行位置',
@@ -290,7 +300,7 @@
          systemScripts: res.data.map(item => {
            return {
              name: item.funcname,
              value: Utils.UnformatOptions(item.longparam)
              value: window.decodeURIComponent(window.atob(item.longparam))
            }
          })
        })
@@ -419,6 +429,22 @@
  changeColumns = (columns) => {
    const { verify } = this.state
    if (columns[0] && (columns[0].type === 'image' || columns[0].type === 'text')) {
      columns = columns.map(col => {
        let _cell = {
          uuid: Utils.getuuid(),
          Column: col.Column,
          Text: col.Text,
          type: 'Nvarchar(50)',
          limit: '50',
          import: 'true',
          required: 'true'
        }
        return _cell
      })
    }
    columns = columns.map(col => {
      if (/^Nvarchar/ig.test(col.type)) {
@@ -664,9 +690,7 @@
          if (this.scriptsForm && this.scriptsForm.state.editItem) {
            _loading = true
            this.setState({activeKey: 'scripts'})
          }
          if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql')) {
          } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) {
            _loading = true
            this.setState({activeKey: 'scripts'})
          }
@@ -794,7 +818,7 @@
                <Col span={8}>
                  <Form.Item label={
                    <Tooltip placement="bottomLeft" title="忽略首行时,会校验excel中表头名称与excel列设置是否一致。">
                      <Icon type="question-circle" style={{color: '#c49f47', marginRight: '5px'}}/>
                      <QuestionCircleOutlined className="mk-form-tip" />
                      忽略行
                    </Tooltip>
                  }>
@@ -828,7 +852,7 @@
              清空Excel列
            </Button>
            <Col style={{fontSize: '12px', color: '#757575', paddingLeft: '10px'}} span={24}>注:数值类型(int 或 decimal),内容为必填;最大值和最小值在类型为数值时有效。</Col>
            <EditTable data={verify.columns} columns={excelColumns} onChange={this.changeColumns}/>
            <EditTable actions={['edit', 'move', 'copy', 'del']} type="excelcolumn" data={verify.columns} columns={excelColumns} onChange={this.changeColumns}/>
          </TabPane>
          {card.intertype === 'system' ? <TabPane tab={
            <span>
@@ -837,7 +861,7 @@
            </span>
          } key="unique">
            <UniqueForm fields={verify.columns} dict={this.props.dict} uniqueChange={this.uniqueChange}/>
            <EditTable data={verify.uniques} columns={uniqueColumns} onChange={this.changeUniques}/>
            <EditTable actions={['edit', 'move', 'del']} data={verify.uniques} columns={uniqueColumns} onChange={this.changeUniques}/>
          </TabPane> : null}
          {card.intertype === 'system' ? <TabPane tab={
            <span>