king
2024-03-15 05eada1e66951fbb4d388518206c6f5adc93841c
2024-03-15
13个文件已修改
269 ■■■■ 已修改文件
src/components/header/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcellcomponent/formconfig.jsx 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/base-table/columns/editColumn/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/normal-table/columns/editColumn/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/basetable/index.jsx 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/cardcellList/index.jsx 71 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/share/normalTable/index.jsx 109 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/share/normalTable/index.scss 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/index.jsx 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/popview/index.jsx 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/topSearch/index.scss 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/menudesign/index.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tabledesign/index.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/header/index.jsx
@@ -336,6 +336,7 @@
                  trdItem.OpenType = PageParam.OpenType || 'newtab'
                  trdItem.hidden = PageParam.hidden || 'false'
                  trdItem.menuColor = PageParam.menuColor || ''
                  trdItem.urlFields = PageParam.urlFields || ''
                  if (trdItem.type === 'NewPage') {
                    trdItem.OpenType = 'newpage'
src/menu/components/card/cardcellcomponent/formconfig.jsx
@@ -60,6 +60,7 @@
  let linkTypes = [
    { value: 'tel', text: '电话' },
    { value: 'email', text: '邮箱' },
    { value: 'linkmenu', text: '关联菜单' },
    { value: 'download', text: '下载' },
    { value: 'other', text: '其他' }
  ]
@@ -89,13 +90,25 @@
      card.linkType = ''
      card.linkurl = ''
    }
  } else if (card.linkType === 'linkmenu') {
    if (appType !== 'mob' && appType !== 'pc') {
      card.link = ''
      card.linkType = ''
      card.linkurl = ''
      card.linkmenu = ''
  // } else if (card.linkType === 'linkmenu') {
  //   if (appType !== 'mob' && appType !== 'pc') {
  //     card.link = ''
  //     card.linkType = ''
  //     card.linkurl = ''
  //     card.linkmenu = ''
  //   }
    }
  let menulist = sessionStorage.getItem('fstMenuList')
  if (appType === '' && menulist) {
    try {
      menulist = JSON.parse(menulist)
    } catch (e) {
      menulist = []
    }
  } else {
    menulist = []
  }
  let appMenus = sessionStorage.getItem('appMenus')
@@ -589,7 +602,7 @@
      forbid: isHeader
    },
    {
      type: linkTypes.length > 4 ? 'select' : 'radio',
      type: 'select',
      key: 'linkType',
      label: '链接类型',
      initVal: card.linkType || 'other',
@@ -617,6 +630,15 @@
      forbid: !['pc', 'mob'].includes(appType)
    },
    {
      type: 'cascader',
      key: 'linkmenu',
      label: '关联菜单',
      initVal: card.linkmenu || [],
      required: true,
      options: menulist,
      forbid: ['pc', 'mob'].includes(appType)
    },
    {
      type: 'select',
      key: 'linkurl',
      label: '链接地址',
src/menu/components/table/base-table/columns/editColumn/index.jsx
@@ -91,7 +91,7 @@
    if (this.record.type === 'text' || this.record.type === 'number') {
      if (this.record.perspective === 'linkmenu') {
        _options.push('linkmenu', 'linkfields', 'open')
        _options.push('linkmenu', 'open')
      } else if (this.record.perspective === 'linkurl') {
        _options.push('linkurl', 'linkfields', 'open')
      }
src/menu/components/table/normal-table/columns/editColumn/index.jsx
@@ -89,7 +89,7 @@
    if (this.record.type === 'text' || this.record.type === 'number') {
      if (this.record.perspective === 'linkmenu') {
        _options.push('linkmenu', 'linkfields', 'open')
        _options.push('linkmenu', 'open')
      } else if (this.record.perspective === 'linkurl') {
        _options.push('linkurl', 'linkfields', 'open')
      }
src/tabviews/basetable/index.jsx
@@ -410,9 +410,20 @@
                }
              }
              if (cell.linkmenu && cell.linkmenu.length > 0) {
                let menu_id = cell.linkmenu.pop()
                cell.linkThdMenu = window.GLOB.mkThdMenus.get(menu_id) || ''
                if (!cell.linkThdMenu) {
                  cell.link = ''
                }
              }
              if (cell.marks && cell.marks.length === 0) {
                cell.marks = null
              }
              if (cell.anchors && cell.anchors.length === 0) {
                cell.anchors = null
              }
              return true
            })
src/tabviews/custom/components/card/cardcellList/index.jsx
@@ -8,6 +8,7 @@
import asyncComponent from '@/utils/asyncComponent'
import { getMark } from '@/utils/utils.js'
import MkIcon from '@/components/mk-icon'
import MKEmitter from '@/utils/events.js'
import Encrypts from '@/components/encrypts'
import './index.scss'
@@ -93,16 +94,45 @@
  openNewView = (e, card) => {
    const { cardCell, data, cards } = this.props
    if (data.$disabled) return
    e.stopPropagation()
    if (card.anchors && card.anchors.length > 0) {
    if (card.anchors) {
      let id = card.anchors[card.anchors.length - 1]
      let node = document.getElementById('anchor' + id)
      node && node.scrollIntoView({behavior: 'smooth', block: 'center', inline: 'nearest'})
    }
    if (!card.link || (card.linkType === 'qywx' || card.linkType === 'linkmenu')) return
    e.stopPropagation()
    if (card.linkType === 'qywx') return
    if (card.linkType === 'linkmenu') {
      if (card.linkThdMenu) {
        let __param = {
          $BID: data.$$uuid
        }
        if (card.field) {
          __param.$searchkey = card.field
          __param.$searchval = data[card.field] || ''
        }
        if (card.joint === 'true' && card.linkThdMenu.urlFields) {
          let lower = {}
          Object.keys(data).forEach(key => {
            lower[key.toLowerCase()] = data[key]
          })
          card.linkThdMenu.urlFields.split(',').forEach(field => {
            __param[field] = lower[field.toLowerCase()] || ''
          })
        }
        let tabmenu = card.linkThdMenu
        tabmenu.param = __param
        MKEmitter.emit('modifyTabs', tabmenu, true)
      }
      return
    }
    
    let url = ''
@@ -434,7 +464,7 @@
          }
          if (card.copyable === 'true') {
            if (card.link || (card.anchors && card.anchors.length > 0)) {
            if (card.link || card.anchors) {
              let url = orival
              if (card.link === 'static') {
@@ -475,14 +505,12 @@
          className = mark.signType
        }
  
        if (card.link || (card.anchors && card.anchors.length > 0)) {
          _style.cursor = 'pointer'
        }
        if (card.bgImage && data[card.bgImage]) {
          _style.backgroundImage = `url('${data[card.bgImage]}')`
        }
  
        if (!data.$disabled && (card.link || card.anchors)) {
          _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)}}>
@@ -491,6 +519,16 @@
            </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 === 'number') {
        let val = ''
        let _style = {...card.style}
@@ -688,10 +726,6 @@
        _imagestyle.backgroundPosition = _style.backgroundPosition || 'center'
        _imagestyle.backgroundRepeat = _style.backgroundRepeat || 'no-repeat'
  
        if (card.link) {
          _style.cursor = 'pointer'
        }
        if (_style.position === 'absolute') {
          _style.width = '100%'
        }
@@ -699,6 +733,8 @@
        let scale = url && card.scale === 'true'
        let urls = url ? url.split(',').filter(Boolean) : ['']
        if (card.link && !data.$disabled) {
          _style.cursor = 'pointer'
        urls.forEach((u, i) => {
          contents.push(<div className={'ant-col ant-col-' + card.width} key={card.uuid + i} style={_style_} span={card.width}>
            <div style={_style} onClick={(e) => {this.openNewView(e, card)}}>
@@ -706,6 +742,15 @@
            </div>
          </div>)
        })
        } else {
          urls.forEach((u, i) => {
            contents.push(<div className={'ant-col ant-col-' + card.width} key={card.uuid + i} style={_style_} span={card.width}>
              <div style={_style}>
                <MkPicture style={_imagestyle} lostTip={card.lostTip !== 'false'} scale={scale} url={u} urls={urls}/>
              </div>
            </div>)
          })
        }
      } else if (card.eleType === 'splitline') {
        let _borderWidth = card.borderWidth === undefined ? 1 : card.borderWidth
        _style_ = _style_ || {}
src/tabviews/custom/components/share/normalTable/index.jsx
@@ -20,6 +20,60 @@
  '5:1': '20%', '6:1': '16.67%', '7:1': '14.29%', '8:1': '12.5%', '9:1': '11.11%',
  '10:1': '10%', '3:4': '133.33%', '2:3': '150%', '9:16': '177.78%'
}
// 字段透视
const triggerLink = (e, item, record) => {
  e.stopPropagation()
  if (item.linkThdMenu) {
    let __param = {
      $searchkey: item.field,
      $searchval: record[item.field] || '',
      $BID: record.$$uuid
    }
    if (item.linkThdMenu.urlFields) {
      let lower = {}
      Object.keys(record).forEach(key => {
        lower[key.toLowerCase()] = record[key]
      })
      item.linkThdMenu.urlFields.split(',').forEach(field => {
        __param[field] = lower[field.toLowerCase()] || ''
      })
    } else if (item.linkfields && item.linkfields.length > 0) {
      item.linkfields.forEach(field => {
        __param[field] = record[field] || ''
      })
    }
    let tabmenu = item.linkThdMenu
    tabmenu.param = __param
    MKEmitter.emit('modifyTabs', tabmenu, true)
  } else if (item.linkurl) {
    let src = item.linkurl
    let con = '?'
    if (/\?/ig.test(src)) {
      con = '&'
    }
    if (item.linkfields && item.linkfields.length > 0) {
      item.linkfields.forEach(field => {
        if (field.toLowerCase() === 'id') return
        con += `${field}=${record[field] || ''}&`
      })
    }
    src = src + `${con}id=${record.$$uuid}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}`
    window.open(src)
  }
}
class BodyRow extends React.Component {
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.props.data), fromJS(nextProps.data)) || this.props.className !== nextProps.className
@@ -107,7 +161,7 @@
  }
  render() {
    let { col, config, record, className, style, triggerLink, ...resProps } = this.props
    let { col, config, record, className, style, ...resProps } = this.props
    if (!col) return (<td {...resProps} className={className} style={style}/>)
@@ -169,10 +223,7 @@
      resProps.children = content
      if (!record.$disabled && (col.linkThdMenu || col.linkurl)) {
        style = style || {}
        style.cursor = 'pointer'
        return (<td {...resProps} className={className} onDoubleClick={() => triggerLink(col, record)} style={style}/>)
        return (<td {...resProps} className={className + ' clickable'} onClick={(e) => triggerLink(e, col, record)} style={style}/>)
      }
    } else if (col.type === 'number') {
      let content = ''
@@ -243,10 +294,7 @@
      resProps.children = content
      if (!record.$disabled && (col.linkThdMenu || col.linkurl)) {
        style = style || {}
        style.cursor = 'pointer'
        return (<td {...resProps} className={className} onDoubleClick={() => triggerLink(col, record)} style={style}/>)
        return (<td {...resProps} className={className + ' clickable'} onClick={(e) => triggerLink(e, col, record)} style={style}/>)
      }
    } else if (col.type === 'picture') {
      let photos = ''
@@ -528,7 +576,6 @@
                record,
                col: item,
                config: item.type === 'custom' ? {setting, columns: fields} : null,
                triggerLink: this.triggerLink
              })
            }
          }
@@ -802,48 +849,6 @@
  
      MKEmitter.emit('resetSelectLine', MenuID, '', '')
      MKEmitter.emit('syncBalconyData', MenuID, [], false)
    }
  }
  // 字段透视
  triggerLink = (item, record) => {
    let __param = {
      $searchkey: item.field,
      $searchval: record[item.field] || '',
      $BID: record.$$uuid
    }
    if (item.linkfields && item.linkfields.length > 0) {
      item.linkfields.forEach(field => {
        __param[field] = record[field] || ''
      })
    }
    if (item.linkThdMenu) {
      let tabmenu = item.linkThdMenu
      tabmenu.param = __param
      MKEmitter.emit('modifyTabs', tabmenu, true)
    } else if (item.linkurl) {
      let src = item.linkurl
      let con = '?'
      if (/\?/ig.test(src)) {
        con = '&'
      }
      if (item.linkfields && item.linkfields.length > 0) {
        item.linkfields.forEach(field => {
          if (field.toLowerCase() === 'id') return
          con += `${field}=${record[field] || ''}&`
        })
      }
      src = src + `${con}id=${record.$$uuid}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}`
      window.open(src)
    }
  }
src/tabviews/custom/components/share/normalTable/index.scss
@@ -33,6 +33,14 @@
    font-size: inherit;
  }
  .clickable {
    color: var(--mk-sys-color);
    cursor: pointer;
  }
  .clickable:hover {
    text-decoration: underline;
  }
  .mk-disabled {
    color: #bcbcbc;
    cursor: not-allowed;
src/tabviews/custom/index.jsx
@@ -981,6 +981,17 @@
    if (cell.marks && cell.marks.length === 0) {
      cell.marks = null
    }
    if (cell.anchors && cell.anchors.length === 0) {
      cell.anchors = null
    }
    if (cell.linkmenu && cell.linkmenu.length > 0) {
      let menu_id = cell.linkmenu.pop()
      cell.linkThdMenu = window.GLOB.mkThdMenus.get(menu_id) || ''
      if (!cell.linkThdMenu) {
        cell.link = ''
      }
    }
    if (['text', 'number', 'formula'].includes(cell.eleType)) {
      if (!cell.height) {
src/tabviews/custom/popview/index.jsx
@@ -699,6 +699,17 @@
    if (cell.marks && cell.marks.length === 0) {
      cell.marks = null
    }
    if (cell.anchors && cell.anchors.length === 0) {
      cell.anchors = null
    }
    if (cell.linkmenu && cell.linkmenu.length > 0) {
      let menu_id = cell.linkmenu.pop()
      cell.linkThdMenu = window.GLOB.mkThdMenus.get(menu_id) || ''
      if (!cell.linkThdMenu) {
        cell.link = ''
      }
    }
    if (['text', 'number', 'formula'].includes(cell.eleType)) {
      if (!cell.height) {
src/tabviews/zshare/topSearch/index.scss
@@ -5,6 +5,7 @@
    display: inline-block;
    float: none;
    vertical-align: top;
    text-align: left;
  }
  .ant-checkbox-wrapper {
    color: rgba(0, 0, 0, 0.85);
src/views/menudesign/index.jsx
@@ -828,6 +828,7 @@
      }
      let interfaces = getFuncsAndInters(config)
      let urlFields = config.urlFields ? config.urlFields.join(',') : ''
      let param = {
        func: 'sPC_TrdMenu_AddUpt',
@@ -839,7 +840,7 @@
        EasyCode: config.easyCode || '',
        Template: 'CustomPage',
        MenuName: config.MenuName || '',
        PageParam: JSON.stringify({Template: 'CustomPage', OpenType: config.OpenType || 'newtab', hidden: config.hidden || 'false', menuColor: config.menuColor || '', interfaces}),
        PageParam: JSON.stringify({Template: 'CustomPage', OpenType: config.OpenType || 'newtab', hidden: config.hidden || 'false', menuColor: config.menuColor || '', interfaces, urlFields}),
        open_edition: config.open_edition,
        LText: '',
        LTexttb: '',
src/views/tabledesign/index.jsx
@@ -581,6 +581,7 @@
      }
      let interfaces = getFuncsAndInters(config)
      let urlFields = config.urlFields ? config.urlFields.join(',') : ''
      let param = {
        func: 'sPC_TrdMenu_AddUpt',
@@ -592,7 +593,7 @@
        EasyCode: config.easyCode || '',
        Template: 'BaseTable',
        MenuName: config.MenuName || '',
        PageParam: JSON.stringify({Template: 'BaseTable', OpenType: config.OpenType || 'newtab', hidden: config.hidden || 'false', menuColor: config.menuColor || '', interfaces}),
        PageParam: JSON.stringify({Template: 'BaseTable', OpenType: config.OpenType || 'newtab', hidden: config.hidden || 'false', menuColor: config.menuColor || '', interfaces, urlFields}),
        open_edition: config.open_edition,
        LText: '',
        LTexttb: '',