king
2020-07-07 73597636ab6062c7ce06cc4d09866cc54cedc744
2020-07-07
4个文件已修改
43 ■■■■ 已修改文件
src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/columncomponent/dragcolumn/index.jsx 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/columncomponent/index.jsx 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx
@@ -383,7 +383,7 @@
    let fields = columns.map(item => item.Column)
    config.columns.forEach(item => {
      if (fields.includes(item.field)) return
      if (fields.includes(item.field) || !item.field) return
      fields.push(item.field)
      columns.push({
src/templates/sharecomponent/columncomponent/dragcolumn/index.jsx
@@ -100,11 +100,14 @@
  // 过滤合并列
    let _hideCol = []
  if (!showfield) {
    cards.forEach(col => {
      if (col.type === 'colspan' && col.sublist) {
        _hideCol.push(...col.sublist)
      }
    })
  }
    cards.forEach(col => {
      if (_hideCol.includes(col.uuid)) return
src/templates/sharecomponent/columncomponent/index.jsx
@@ -323,6 +323,20 @@
            if (column.marks && column.marks.filter(mark => mark.field === card.field || mark.contrastField === card.field).length > 0) {
              refers.push(column.label)
            }
            if (column.type === 'colspan') {
              let _length = column.sublist.length
              column.sublist = column.sublist.filter(cell => cell !== card.uuid)
              if (column.sublist.length < _length) {
                let subfield = []  // 合并列字段
                _columnlist.forEach(col => {
                  if (col.field && column.sublist.includes(col.uuid)) {
                    subfield.push(col.field)
                  }
                })
                column.subfield = subfield.join(', ')
              }
            }
          })
          if (refers.length > 0) {
src/utils/utils.js
@@ -747,8 +747,11 @@
      })
    }
    // 控制台打印数据
    let conLtext = []
    let _Ltext = data.map((item, lindex) => {
      let vals = []
      let convals = []
      btn.columns.forEach((col, cindex) => {
        if (col.import === 'false') return
@@ -838,16 +841,29 @@
        }
        if (col.type === 'date') {
          vals.push(`case when ${col.Column}='' then '1900-01-01' else dateadd(day,cast('${val}' as int)-2,'1900-01-01') end as ${col.Column}`)
          vals.push(`case when '${val}'='' then '1900-01-01' else dateadd(day,cast('${val}' as int)-2,'1900-01-01') end`)
        } else {
          vals.push(`'${val}' as ${col.Column}`)
          vals.push(`'${val}'`)
        }
        if (lindex < 40) {
          if (col.type === 'date') {
            convals.push(`case when '${val}'='' then '1900-01-01' else dateadd(day,cast('${val}' as int)-2,'1900-01-01') end as ${col.Column}`)
          } else {
            convals.push(`'${val}' as ${col.Column}`)
          }
        }
      })
      let _lineIndex = '0000' + (lindex + 1) + '0'
      _lineIndex = _lineIndex.substring(_lineIndex.length - 6)
      vals.push(`'${upId + _lineIndex}' as jskey`)
      vals.push(`'${upId + _lineIndex}'`)
      if (lindex < 40) {
        convals.push(`'${upId + _lineIndex}' as jskey`)
        conLtext.push(`Select ${convals.join(',')}`)
      }
      return `Select ${vals.join(',')}`
    })
@@ -952,7 +968,7 @@
        ${_sqlInsert}
        
        /* excel数据(前40条) */
        ${_Ltext.slice(0, 40).join(' Union all ')}
        ${conLtext.join(' Union all ')}
        ${_sqlBottom}
        `
        fsql = fsql.replace(/\n\s{8}/ig, '\n')