king
2020-05-03 6def3330d1d1cf4036916ed04c8bbc4128e1e5d0
src/templates/zshare/createinterface/index.jsx
@@ -23,11 +23,17 @@
    btn: null
  }
  /**
   * @description 触发创建读数据接口
   * @param { object } menu    菜单类型(三级菜单或标签页)、菜单ID、菜单参数、菜单名称
   * @param { object } config  菜单配置信息
   */
  triggerOutInterface = (menu, config) => {
    let _search = []
    let _index = 1
    if (menu.type !== 'main') {
      // 子表页面增加BID字段,数据源中使用了@BID@时,BID类型为必传
      if (config.setting.dataresource && /@BID@/ig.test(config.setting.dataresource)) {
        _search.push(`select 'BID' as searchfield,'BID' as label,'0' as Sort,'' as defaultvalue,'required' as DefaultType`)
      } else {
@@ -113,11 +119,14 @@
      Ltextsearchparam: _search.join(' union all '),
      AppendWhere: config.setting.queryType === 'query' ? searchText.join(' AND ') : '',
      WhereType: config.setting.queryType === 'statistics' ? 'Statistics' : 'query',
      custom_script: config.setting.customScript || '',
      // default_sql: config.setting.default || 'true',
      OrderCol: config.setting.order
    }
    param.Ltextsearchparam = Utils.formatOptions(param.Ltextsearchparam)
    param.AppendWhere = Utils.formatOptions(param.AppendWhere)
    param.custom_script = Utils.formatOptions(param.custom_script)
    this.setState({
      type: 'out',
@@ -238,7 +247,7 @@
          notification.warning({
            top: 92,
            message: result.message,
            duration: 10
            duration: 5
          })
          resolve(false)
        } else {
@@ -261,7 +270,7 @@
        notification.warning({
          top: 92,
          message: result.message,
          duration: 10
          duration: 5
        })
        return false
      } else {
@@ -283,7 +292,26 @@
    })
  }
  /**
   * @description 触发创建写入接口(按钮)
   */
  triggerInInterface = (btn, config, menu) => {
    if (!['pop', 'exec', 'prompt'].includes(btn.OpenType) || btn.funcType || btn.intertype !== 'inner' || btn.innerFunc ) {
      notification.warning({
        top: 92,
        message: '打开方式为 弹窗(表单)、提示框或直接执行,且使用系统函数时,才可以创建接口!',
        duration: 5
      })
      return
    } else if (btn.Ot === 'requiredOnce') {
      notification.warning({
        top: 92,
        message: '多行拼接时,不支持创建接口!',
        duration: 5
      })
      return
    }
    let param = {
      func: 's_get_para_for_in',
      Menuid: btn.uuid,
@@ -343,6 +371,9 @@
    })
  }
  /**
   * @description 执行接口创建
   */
  createBtnInterfaceExec = (param, config, btn) => {
    let formlist = []
    let receipt = param.Return === 'Y'
@@ -424,14 +455,14 @@
            notification.warning({
              top: 92,
              message: result.message,
              duration: 10
              duration: 5
            })
            resolve(false)
          } else {
            notification.warning({
              top: 92,
              message: '请完善表单信息!',
              duration: 10
              duration: 5
            })
            resolve(false)
          }
@@ -448,7 +479,12 @@
      })
      if (param.menuType !== 'main' && !_keys.includes('bid')) {
        _keys.push('bid')
        param.Ltexttableparam.unshift(`select 'BID' as searchfield,'BID' as label,'0' as Sort,'nvarchar(50)' as fieldtype,'required' as requiredtype,'' as defaultvalue`)
      }
      if (btn.Ot !== 'notRequired' && !_keys.includes(config.setting.primaryKey.toLowerCase())) {
        param.Ltexttableparam.unshift(`select '${config.setting.primaryKey}' as searchfield,'${config.setting.primaryKey}' as label,'1' as Sort,'nvarchar(50)' as fieldtype,'required' as requiredtype,'' as defaultvalue`)
      }
      param.Ltexttableparam = param.Ltexttableparam.join(' union all ')
@@ -509,7 +545,7 @@
        notification.warning({
          top: 92,
          message: res.message,
          duration: 10
          duration: 5
        })
        return false
      } else {
@@ -531,7 +567,7 @@
        notification.warning({
          top: 92,
          message: res.message,
          duration: 10
          duration: 5
        })
        return false
      } else {
@@ -805,6 +841,9 @@
          @VoucherTypeOne ='${_voucher.VoucherTypeOne}',
          @VoucherTypeTwo ='${_voucher.VoucherTypeTwo}',
          @Type =${_voucher.Type},
          @UserID=@UserID@,
          @Username=@Username,
          @FullName=@FullName,
          @BVoucher =@BVoucher OUTPUT ,
          @FIBVoucherDate =@FIBVoucherDate OUTPUT ,
          @FiYear =@FiYear OUTPUT ,