king
2020-11-23 f8c3c53f9e29541f8c0e3fcbf682c301fd17e06a
src/tabviews/custom/components/share/tabtransfer/index.jsx
@@ -178,8 +178,8 @@
  loadmaindata = (params) => {
    const { config } = this.props
    let LText_field = []
    let diffUser = false
    let LText = params.map((item, index) => {
      let _sql = item.sql
      let _script = item.script
      if (index === 0) {
@@ -187,11 +187,14 @@
          ${_script}
        `
      }
      if (!diffUser && (/@userid@/ig.test(item.sql) || /@userid@/ig.test(_script))) {
        diffUser = true
      }
      item.columns.forEach(cell => {
        LText_field.push(`Select '${item.name}' as tablename,'${cell.field}' as fieldname,'${cell.datatype}' as field_type`)
      })
      return `Select '${item.name}' as tablename,'${window.btoa(window.encodeURIComponent(_sql))}' as LText,'${window.btoa(window.encodeURIComponent(_script))}' as Lcustomize,'${item.type}' as table_type,'${item.primaryKey}' as primary_key,'${item.par_tablename}' as par_tablename,'${item.foreign_key}' as foreign_key,'${index}' as Sort`
      return `Select '${item.name}' as tablename,'${window.btoa(window.encodeURIComponent(item.sql))}' as LText,'${window.btoa(window.encodeURIComponent(_script))}' as Lcustomize,'${item.type}' as table_type,'${item.primaryKey}' as primary_key,'${item.par_tablename}' as par_tablename,'${item.foreign_key}' as foreign_key,'${index}' as Sort`
    })
    let param = {
@@ -206,7 +209,7 @@
    if (config.cacheUseful === 'true') {
      param.time_type = config.timeUnit
      param.time_limit = config.cacheTime
      if (config.diffUser) {
      if (diffUser) {
        param.userid = sessionStorage.getItem('UserID')
      }
      param.data_md5 = md5(JSON.stringify(param))