king
2019-12-26 4c2ef2d3a98d7d9a2592721db2f5858528eb5c86
src/tabviews/tableshare/actionList/index.jsx
File was renamed from src/tabviews/commontable/mainAction/index.jsx
@@ -2,7 +2,7 @@
import PropTypes from 'prop-types'
import moment from 'moment'
import { Button, Affix, Modal, notification, Spin } from 'antd'
import MutilForm from '../mutilform'
import MutilForm from '@/tabviews/tableshare/mutilform'
import Utils from '@/utils/utils.js'
import Api from '@/api'
import './index.scss'
@@ -11,6 +11,8 @@
class MainAction extends Component {
  static propTpyes = {
    BID: PropTypes.string,
    type: PropTypes.string,
    MenuID: PropTypes.string,
    actions: PropTypes.array, // 搜索条件列表
    dict: PropTypes.object, // 字典项
@@ -26,6 +28,10 @@
    loadingUuid: '',
    btnloading: false,
    configMap: {}
  }
  UNSAFE_componentWillMount() {
    console.log(this.props.type)
  }
  
  refreshdata = (item, type) => {
@@ -120,7 +126,8 @@
        (btn.OpenType === 'pop' && !btn.innerFunc && btn.sql && btn.sqlType === 'insert')
      ) {
        let param = { // 系统存储过程
          func: 'sPC_TableData_InUpDe'
          func: 'sPC_TableData_InUpDe',
          BID: this.props.BID
        }
        if (btn.OpenType === 'prompt' || btn.OpenType === 'exec') { // 是否弹框或直接执行
@@ -135,7 +142,6 @@
          }
          param.ID = ID
          param.BID = ''
          if (btn.innerFunc) {
            param.func = btn.innerFunc
@@ -159,18 +165,13 @@
            if (!param.hasOwnProperty('ID') && setting.primaryKey && data[0] && data[0][setting.primaryKey]) {
              param.ID = data[0][setting.primaryKey]
            }
            if (!param.hasOwnProperty('BID')) {
              param.BID = ''
            }
          } else if (btn.sql && btn.sqlType === 'insert') {
            param.ID = Utils.getguid()
            param.BID = ''
            param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata)) // 数据源
            param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
            param.secretkey = Utils.encrypt(param.LText, param.timestamp)
          } else if (btn.sql) {
            param.ID = data[0][setting.primaryKey]
            param.BID = ''
            param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata)) // 数据源
            param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
            param.secretkey = Utils.encrypt(param.LText, param.timestamp)
@@ -189,12 +190,12 @@
      } else if (btn.Ot === 'required' || (btn.Ot === 'requiredOnce' && btn.OpenType === 'pop')) {
        let deffers = data.map(cell => {
          let param = {
            func: 'sPC_TableData_InUpDe'
            func: 'sPC_TableData_InUpDe',
            BID: this.props.BID
          }
          if (btn.OpenType === 'prompt' || btn.OpenType === 'exec') { // 是否弹框或直接执行
            param.ID = cell[setting.primaryKey]
            param.BID = ''
            if (btn.innerFunc) {
              param.func = btn.innerFunc
@@ -218,7 +219,6 @@
              }
            } else if (btn.sql) {
              param.ID = cell[setting.primaryKey]
              param.BID = ''
              param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata)) // 数据源
              param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
              param.secretkey = Utils.encrypt(param.LText, param.timestamp)
@@ -263,7 +263,7 @@
      /** *********************调用外部接口************************* */
      let param = {
        ID: '',
        BID: ''
        BID: this.props.BID
      }
      if (!btn.interface) { // 接口地址不存在时报错
@@ -359,7 +359,7 @@
          if (btn.innerFunc) {
            let deffers = data.map(cell => {
              let _param = {
                BID: '',
                BID: this.props.BID,
                func: btn.innerFunc
              }
              _param.ID = cell[setting.primaryKey]
@@ -393,7 +393,7 @@
          } else {
            let params = data.map(cell => {
              return {
                BID: '',
                BID: this.props.BID,
                ID: cell[setting.primaryKey]
              }
            })
@@ -781,7 +781,7 @@
  render() {
    const { loadingUuid, btnloading } = this.state
    if (this.props.setting.actionfixed) { // 按钮是否固定在头部
    if (this.props.setting.actionfixed && this.props.type === 'main') { // 按钮是否固定在头部
      return (
        <Affix offsetTop={48}>
          <div className="button-list" id={this.props.MenuID + 'mainaction'}>