king
2020-04-29 9b6ce1a5778c6e1a813237e87588c0052aae1bbb
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 {
@@ -283,7 +289,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 +368,9 @@
    })
  }
  /**
   * @description 执行接口创建
   */
  createBtnInterfaceExec = (param, config, btn) => {
    let formlist = []
    let receipt = param.Return === 'Y'
@@ -448,9 +476,14 @@
      })
      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 ')
      
      if (receipt) {