king
2025-05-08 b6c698c8833836971184a0a9c2645a15f8174d37
src/tabviews/custom/components/card/double-data-card/index.jsx
@@ -116,6 +116,12 @@
    })
    _config.subcards = null
    if (!_config.wrap.cardType) {
      _config.wrap.selStyle = 'none'
      _config.wrap.selected = 'false'
      _config.wrap.pickup = 'false'
    }
    
    let selected = 'false'
    if (_config.wrap.selected === 'always' || _config.wrap.selected === 'init' || _config.wrap.selected === 'sign') {
@@ -124,26 +130,29 @@
      _config.wrap.selected = 'false'
    }
    _config.wrap.selStyle = _config.wrap.selStyle || 'active'
    _config.wrap.selStyle = _config.wrap.selStyle || 'check'
    _config.wrap.pagestyle = _config.wrap.pagestyle || 'page'
    _config.wrap.wrapClass =  `${_config.wrap.selStyle} ${_config.wrap.cardType || ''}`
    _config.wrap.wrapClass =  `${_config.wrap.selStyle} ${_config.wrap.cardType || ''} ${config.wrap.empSign === 'hidden' ? 'mk-empty-hide' : ''}`
    if (_config.wrap.zHeight || _config.wrap.minWidth) {
      _config.wrap.zoomStyle = {
        maxHeight: 'none',
        '--mk-data-zoom-width': _config.wrap.minWidth ? _config.wrap.minWidth + 'px' : '100%'
      }
      if (_config.wrap.zHeight) {
        if (_config.wrap.zHeight <= 100) {
          if (_config.wrap.zHeight < 0) {
            _config.wrap.zHeight = `calc(100vh - ${-_config.wrap.zHeight}px)`
            _config.wrap.zoomStyle.maxHeight = `calc(100vh - ${-_config.wrap.zHeight}px)`
            _config.wrap.zoomStyle.minHeight = '100px'
          } else {
            _config.wrap.zHeight = _config.wrap.zHeight + 'vh'
            _config.wrap.zoomStyle.maxHeight = _config.wrap.zHeight + 'vh'
          }
        } else {
          _config.wrap.zoomStyle.maxHeight = _config.wrap.zHeight + 'px'
        }
        _config.wrap.wrapClass += ' fix-height'
      }
      _config.wrap.minWidth = _config.wrap.minWidth ? _config.wrap.minWidth + 'px' : '100%'
      _config.wrap.zoomStyle = {
        maxHeight: _config.wrap.zHeight || 'none',
        '--mk-data-zoom-width': _config.wrap.minWidth
      }
    } else {
      _config.wrap.zoomStyle = null
@@ -175,8 +184,10 @@
      })
    }
    _config.setting.sub_field = subconfig.columns.map(col => col.field).join(',')
    _config.setting.all_field = _config.setting.arr_field + ',' + _config.setting.sub_field
    if (_config.setting.subdata !== 'sub_data_string') {
      _config.setting.sub_field = subconfig.columns.map(col => col.field).join(',')
      _config.setting.all_field = _config.setting.arr_field + ',' + _config.setting.sub_field
    }
    let pageOptions = ['10', '25', '50', '100', '500', '1000']
@@ -278,6 +289,10 @@
            delete item[config.setting.subdata]
            if (config.setting.subdata === 'sub_data_string') {
              _children = this.parseSubData(_children)
            }
            _children.forEach((cell, i) => {
              cell.key = i
              cell.$$uuid = cell[config.setting.subKey] || ''
@@ -336,6 +351,21 @@
        this.loadData()
      }, config.setting.delay || 0)
    }
  }
  parseSubData = (data) => {
    try {
      data = JSON.parse(data)
      if (typeof(data) !== 'object') {
        data = []
      } else if (!Array.isArray(data)) {
        data = [data]
      }
    } catch(e) {
      console.warn('Data parsing error.')
      data = []
    }
    return data
  }
  autoExec = (times) => {
@@ -654,6 +684,10 @@
            let _children = item[config.setting.subdata]
            delete item[config.setting.subdata]
            if (config.setting.subdata === 'sub_data_string') {
              _children = this.parseSubData(_children)
            }
            
            _children.forEach((cell, i) => {
              cell.key = i
@@ -694,6 +728,10 @@
            let _children = item[config.setting.subdata]
            delete item[config.setting.subdata]
            if (config.setting.subdata === 'sub_data_string') {
              _children = this.parseSubData(_children)
            }
            _children.forEach((cell, i) => {
              cell.key = i
@@ -821,6 +859,10 @@
              delete _data[config.setting.subdata]
              if (config.setting.subdata === 'sub_data_string') {
                _children = this.parseSubData(_children)
              }
              _children.forEach((cell, i) => {
                cell.key = i
                cell.$$uuid = cell[config.setting.subKey] || ''