king
2023-11-30 a6be5cfd9c6fb084af584b77f79100fe32b385c1
src/tabviews/custom/components/card/cardcellList/index.jsx
@@ -197,26 +197,36 @@
    //   })
    //   return
    // }
    let Id = ''
    if (cards.subtype === 'propcard' && cardCell) {
      Id = cardCell.setting.primaryId || ''
    } else {
      Id = data[cards.setting.primaryKey] || ''
    }
    
    if (card.joint === 'true') {
      let con = '?'
      if (/\?/ig.test(url)) {
        con = '&'
    if (/^http.+(.txt|.doc|.docx|.pdf|.xlsx|.xls|.zip|.rar|.ppt)$/i.test(url)) {
      let d = document.createElement('a')
      d.href = url
      d.setAttribute('download', 'download')
      d.setAttribute('target', '_blank')
      document.body.appendChild(d)
      d.click()
      d.remove()
    } else {
      if (card.joint === 'true') {
        let Id = ''
        if (cards.subtype === 'propcard' && cardCell) {
          Id = cardCell.setting.primaryId || ''
        } else {
          Id = data[cards.setting.primaryKey] || ''
        }
        let con = '?'
        if (/\?/ig.test(url)) {
          con = '&'
        }
        url = url + `${con}id=${Id}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}`
      }
      url = url + `${con}id=${Id}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}`
      window.open(url)
    }
    window.open(url)
  }
  getColor = (marks) => {
@@ -435,6 +445,30 @@
          }
          className = mark.signType
        }
        if (card.linkType === 'download') {
          let url = ''
          if (card.link === 'static') {
            url = card.linkurl
          } else {
            url = data[card.linkurl]
          }
          if (/^http.+(.txt|.doc|.docx|.pdf|.xlsx|.xls|.zip|.rar)$/i.test(url)) {
            if (/pdf$/i.test(url)) {
              val = <><img src="/media/pdf.png" className="file-image" alt=""/> {val}</>
            } else if (/(.doc|.docx)$/i.test(url)) {
              val = <><img src="/media/word.png" className="file-image" alt=""/> {val}</>
            } else if (/(.xlsx|.xls)$/i.test(url)) {
              val = <><img src="/media/excel.png" className="file-image" alt=""/> {val}</>
            } else if (/(.zip|.rar)$/i.test(url)) {
              val = <><img src="/media/rar.png" className="file-image" alt=""/> {val}</>
            } else {
              val = <><img src="/media/txt.png" className="file-image" alt=""/> {val}</>
            }
          }
        }
  
        if (card.link || (card.anchors && card.anchors.length > 0)) {
          _style.cursor = 'pointer'