king
2020-04-17 bf772e586c29b4858366dbad143b1eaeca3c46ed
src/templates/zshare/verifycardexcelin/index.jsx
@@ -1,7 +1,9 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Tabs, Row, Col, Input, Button, Table, Popconfirm, Icon, notification, Modal, message, InputNumber, Radio } from 'antd'
import moment from 'moment'
import Api from '@/api'
import Utils from '@/utils/utils.js'
import UniqueForm from './uniqueform'
@@ -21,6 +23,7 @@
  state = {
    verify: {},
    systemScripts: [],
    excelColumns: [
      {
        title: 'Column',
@@ -142,7 +145,13 @@
      {
        title: 'SQL',
        dataIndex: 'sql',
        width: '70%'
        width: '60%'
      },
      {
        title: '执行位置',
        dataIndex: 'position',
        width: '10%',
        render: (text, record) => record.position !== 'front' ? 'sql后' : 'sql前'
      },
      {
        title: '状态',
@@ -214,6 +223,41 @@
        columns: _columns,
        scripts: _verify.scripts || [],
        uniques: _verify.uniques || []
      }
    })
  }
  componentDidMount () {
    let _scriptSql = `Select distinct func+Remark as funcname,longparam from s_custom_script s inner join (select OpenID from sapp where ID=@Appkey@) p on s.openid = case when s.appkey='' then s.openid else p.OpenID end`
    _scriptSql = Utils.formatOptions(_scriptSql)
    let _sParam = {
      func: 'sPC_Get_SelectedList',
      LText: _scriptSql,
      obj_name: 'data',
      arr_field: 'funcname,longparam'
    }
    _sParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
    _sParam.secretkey = Utils.encrypt(_sParam.LText, _sParam.timestamp)
    Api.getSystemConfig(_sParam).then(res => {
      if (res.status) {
        this.setState({
          systemScripts: res.data.map(item => {
            return {
              name: item.funcname,
              value: Utils.formatOptions(item.longparam, true)
            }
          })
        })
      } else {
        notification.warning({
          top: 92,
          message: res.message,
          duration: 10
        })
      }
    })
  }
@@ -673,6 +717,7 @@
              isdefault={verify.default}
              usefulfields={verify.columns}
              scripts={verify.scripts}
              systemScripts={this.state.systemScripts}
              scriptsChange={this.scriptsChange}
              wrappedComponentRef={(inst) => this.scriptsForm = inst}
            />