king
2020-04-17 4f8ffec8fc4aa9918264a3b3b4952421d896f5eb
src/templates/zshare/verifycard/customscript/index.jsx
@@ -15,6 +15,7 @@
    usefulfields: PropTypes.string, // 可用字段
    initsql: PropTypes.string,      // sql前缀
    systemScripts: PropTypes.array, // 系统脚本
    customScripts: PropTypes.array, // 自定义脚本
    scriptsChange: PropTypes.func   // 表单
  }
@@ -52,21 +53,21 @@
          notification.warning({
            top: 92,
            message: 'sql中\'必须成对出现',
            duration: 10
            duration: 5
          })
          return
        } else if (_lparen !== _rparen) {
          notification.warning({
            top: 92,
            message: 'sql中()必须成对出现',
            duration: 10
            duration: 5
          })
          return
        } else if (/--/ig.test(values.sql)) {
          notification.warning({
            top: 92,
            message: '自定义sql语句中,不可出现字符 -- ,注释请用 /*内容*/',
            duration: 10
            duration: 5
          })
          return
        }
@@ -77,7 +78,7 @@
          notification.warning({
            top: 92,
            message: 'sql中不可使用' + error,
            duration: 10
            duration: 5
          })
          return
        }
@@ -86,9 +87,19 @@
          aaa:
        `
        let _initsql = ''
        this.props.customScripts.forEach(script => {
          if (this.state.editItem && this.state.editItem.uuid === script.uuid) return
          if (script.status === 'false' || script.position !== 'init') return
          _initsql += `
            ${script.sql}
            `
        })
        let param = {
          func: 's_debug_sql',
          LText: this.props.initsql + values.sql + tail
          LText: this.props.initsql + _initsql + values.sql + tail
        }
        param.LText = Utils.formatOptions(param.LText)
@@ -173,6 +184,7 @@
                <Radio.Group>
                  <Radio value="front">sql前</Radio>
                  <Radio value="back">sql后</Radio>
                  <Radio value="init">初始化</Radio>
                </Radio.Group>
              )}
            </Form.Item>