king
2024-07-01 866db6d8afa6980fd485570acda6b5fcebda4da3
src/tabviews/custom/components/card/cardcellList/index.jsx
@@ -4,7 +4,7 @@
import { Col, Tooltip, notification, Typography, message } from 'antd'
import moment from 'moment'
// import Api from '@/api'
import Api from '@/api'
import asyncComponent from '@/utils/asyncComponent'
import { getMark } from '@/utils/utils.js'
import MkIcon from '@/components/mk-icon'
@@ -25,7 +25,7 @@
const FuncMegvii = asyncComponent(() => import('@/tabviews/zshare/actionList/funcMegvii'))
const FuncZip = asyncComponent(() => import('@/tabviews/zshare/actionList/funczip'))
const ExportPdf = asyncComponent(() => import('@/tabviews/zshare/actionList/exportPdf'))
const ShareLink = asyncComponent(() => import('@/tabviews/zshare/actionList/shareLink'))
const FuncButton = asyncComponent(() => import('@/tabviews/zshare/actionList/funcbutton'))
const EditLine = asyncComponent(() => import('@/tabviews/zshare/actionList/editLine'))
const BarCode = asyncComponent(() => import('@/components/barcode'))
const QrCode = asyncComponent(() => import('@/components/qrcode'))
@@ -162,68 +162,67 @@
    }
    // positecgroup
    // if (/^sso$/ig.test(url)) {
    //   if (!data.LinkUrl1) {
    //     notification.warning({
    //       top: 92,
    //       message: '链接地址不存在!',
    //       duration: 5
    //     })
    //     return
    //   }
    if (/^sso$/ig.test(url)) {
      if (!data.LinkUrl1) {
        notification.warning({
          top: 92,
          message: '链接地址不存在!',
          duration: 5
        })
        return
      }
    //   let _url = data.LinkUrl1
    //   if (/index\.html/ig.test(_url)) {
    //     _url = _url.replace(/index\.html.*/ig, '')
    //   } else if (!/\/$/ig.test(_url)) {
    //     _url = _url + '/'
    //   }
      let _url = data.LinkUrl1
      if (/index\.html/ig.test(_url)) {
        _url = _url.replace(/index\.html.*/ig, '')
      } else if (!/\/$/ig.test(_url)) {
        _url = _url + '/'
      }
    //   let key = (() => {
    //     let uuid = []
    //     let timestamp = new Date().getTime()
    //     let _options = '0123456789abcdefghigklmnopqrstuv'
    //     for (let i = 0; i < 19; i++) {
    //       uuid.push(_options.substr(Math.floor(Math.random() * 0x20), 1))
    //     }
    //     uuid = timestamp + uuid.join('')
    //     return uuid
    //   })()
      let key = (() => {
        let uuid = []
        let timestamp = new Date().getTime()
        let _options = '0123456789abcdefghigklmnopqrstuv'
        for (let i = 0; i < 19; i++) {
          uuid.push(_options.substr(Math.floor(Math.random() * 0x20), 1))
        }
        uuid = timestamp + uuid.join('')
        return uuid
      })()
    //   let _param = {
    //     func: 'webapi_scan_binding_key',
    //     binding_type: 'mk',
    //     scan_type: 'toggle',
    //     scan_appkey: data.scan_appkey || '',
    //     id: key
    //   }
      let _param = {
        func: 'webapi_scan_binding_key',
        binding_type: 'mk',
        scan_type: 'toggle',
        scan_appkey: data.scan_appkey || '',
        id: key
      }
  
    //   Api.getSystemConfig(_param).then(res => {
    //     if (!res.status) {
    //       notification.warning({
    //         top: 92,
    //         message: res.message,
    //         duration: 5
    //       })
    //     } else if (res.thd_party_appid && res.thd_party_member_id && res.thd_party_openid) {
    //       let href = _url + 'admin/index.html#/ssologin/' + window.btoa(window.encodeURIComponent(JSON.stringify({
    //         appid: res.thd_party_appid,
    //         memberId: res.thd_party_member_id,
    //         openid: res.thd_party_openid,
    //         key: key
    //       })))
    //       window.open(href)
    //     } else {
    //       notification.warning({
    //         top: 92,
    //         message: '信息缺失,请联系管理员!',
    //         duration: 5
    //       })
    //     }
    //   })
    //   return
    // }
      Api.getSystemConfig(_param).then(res => {
        if (!res.status) {
          notification.warning({
            top: 92,
            message: res.message,
            duration: 5
          })
        } else if (res.thd_party_appid && res.thd_party_member_id && res.thd_party_openid) {
          let href = _url + 'admin/index.html#/ssologin/' + window.btoa(window.encodeURIComponent(JSON.stringify({
            appid: res.thd_party_appid,
            memberId: res.thd_party_member_id,
            openid: res.thd_party_openid,
            key: key
          })))
          window.open(href)
        } else {
          notification.warning({
            top: 92,
            message: '信息缺失,请联系管理员!',
            duration: 5
          })
        }
      })
      return
    }
    
    if (/^http.+(.txt|.doc|.docx|.pdf|.xlsx|.xls|.zip|.rar|.ppt)$/i.test(url)) {
      let name = url.replace(/.+\//g, '').replace(/\.{1}[^.]*$/g, '')
@@ -991,8 +990,10 @@
  
        if (val !== '') {
          if (val && typeof(val) === 'string') {
            val = val.replace(/\n/ig, '<br/>')
            if (!/<(span|div|p|a|img)\s/g.test(val)) {
            if (!card.evalchars || card.evalchars.includes('enter')) {
              val = val.replace(/\n/ig, '<br/>')
            }
            if ((!card.evalchars || card.evalchars.includes('space')) && !/<(span|div|p|a|img)\s/g.test(val)) {
              val = val.replace(/\s/ig, '&nbsp;')
            }
@@ -1032,14 +1033,26 @@
          className = mark.signType
        }
        contents.push(
          <div className={'ant-col ant-col-' + card.width} key={card.uuid} style={_style_} span={card.width}>
            <div style={_style}>
              {card.alignItems ? <TextCell card={card} className={'ant-mk-text line' + (card.height || '') + className} value={val}/> :
              <div className={'ant-mk-text line' + (card.height || '') + className} style={{height: card.innerHeight}}>{val}</div>}
        if (card.link && !data.$disabled) {
          _style.cursor = 'pointer'
          contents.push(
            <div className={'ant-col ant-col-' + card.width} key={card.uuid} style={_style_} span={card.width}>
              <div style={_style} onClick={(e) => {this.openNewView(e, card)}}>
                {card.alignItems ? <TextCell card={card} className={'ant-mk-text line' + (card.height || '') + className} value={val}/> :
                <div className={'ant-mk-text line' + (card.height || '') + className} style={{height: card.innerHeight}}>{val}</div>}
              </div>
            </div>
          </div>
        )
          )
        } else {
          contents.push(
            <div className={'ant-col ant-col-' + card.width} key={card.uuid} style={_style_} span={card.width}>
              <div style={_style}>
                {card.alignItems ? <TextCell card={card} className={'ant-mk-text line' + (card.height || '') + className} value={val}/> :
                <div className={'ant-mk-text line' + (card.height || '') + className} style={{height: card.innerHeight}}>{val}</div>}
              </div>
            </div>
          )
        }
      } else if (card.eleType === 'tag') {
        let vals = ''
  
@@ -1221,6 +1234,7 @@
            name={name}
            BID={data.$$BID}
            LID={lid}
            columns={cards.columns}
            BData={data.$$BData || ''}
            disabled={_disabled}
            selectedData={_data}
@@ -1271,19 +1285,21 @@
              btn={card}
              LID={lid}
            />
          } else if (card.funcType === 'shareLink') {
            MkButton = <ShareLink
              BID={data.$$BID}
              LID={lid}
              btn={card}
              selectedData={_data}
            />
          } else if (card.funcType === 'addline' || card.funcType === 'delline') {
            MkButton = <EditLine
              btn={card}
              disabled={_disabled}
              selectedData={_data}
            />
          } else {
            MkButton = <FuncButton
              BID={data.$$BID}
              disabled={_disabled}
              LID={lid}
              btn={card}
              columns={cards.columns}
              selectedData={_data}
            />
          }
        }