king
2020-11-12 f830c733cbc071f023c9a9a4e1571b7c81d672bf
src/templates/zshare/createinterface/index.jsx
@@ -452,7 +452,7 @@
                  fieldlen: _fieldlen,
                  key: cell.field,
                  required: cell.required === 'true' ? 'required' : '',
                  writein: cell.required !== 'false',
                  writein: cell.writein !== 'false',
                  value: cell.initval || ''
                }
@@ -720,10 +720,10 @@
        `
    }
    if (_initcolumnfields.length > 0) {
      _sql += `select ${_initcolumnfields.join(',')} from ${setting.dataresource} where ${primaryKey}=@ID@
        `
    }
    // if (_initcolumnfields.length > 0) {
    //   _sql += `select ${_initcolumnfields.join(',')} from (${setting.dataresource})tb where ${primaryKey}=@ID@
    //     `
    // }
    
    // 去除禁用的验证
    if (verify.contrasts) {
@@ -955,8 +955,10 @@
      receiptKeys.push('bid')
    }
    let _insertsql = ''
    let _updatesql = ''
    // 添加、修改、逻辑删除、物理删除
    if (_actionType === 'insert') {
    if (_actionType === 'insert' || _actionType === 'insertOrUpdate') {
      let keys = []
      let values = []
@@ -991,10 +993,12 @@
      keys = keys.join(',')
      values = values.join(',')
      _sql += `
      _insertsql = `
        /* 默认sql */
        insert into ${btn.sql} (${keys}) select ${values};`
    } else if (_actionType === 'update') {
    }
    if (_actionType === 'update' || _actionType === 'audit' || _actionType === 'insertOrUpdate') {
      let _form = []
      let _arr = []
@@ -1034,9 +1038,28 @@
      }
      _form = _form.join(',')
      _sql += `
      _updatesql = `
        /* 默认sql */
        update ${btn.sql} set ${_form} where ${primaryKey}=@${primaryKey}@;`
    }
    if (_actionType === 'insert') {
      _sql += _insertsql
    } else if (_actionType === 'update' || _actionType === 'audit') {
      _sql += _updatesql
    } else if (_actionType === 'insertOrUpdate') {
      _sql += `
        select @tbid=''
        select @tbid='X' from ${btn.sql} where ${primaryKey}=@ID@
        if @tbid=''
          begin
          ${_insertsql}
          end
        else
          begin
          ${_updatesql}
          end
      `
    } else if (_actionType === 'LogicDelete') { // 逻辑删除
      _sql += `
        /* 默认sql */