king
2022-10-26 fb64bcf1fab18b33d21470c83f28d4cda8d309ce
src/tabviews/custom/index.jsx
@@ -409,12 +409,16 @@
        }
      }
      if (item.subtype === 'tablecard') { // 兼容
        item.type = 'card'
      }
      // 搜索条件初始化
      if (item.search && item.search.length > 0) {
        item.search = Utils.initSearchVal(item.search)
      }
      if (item.type === 'table' && (item.subtype === 'normaltable' || item.subtype === 'editable')) {
      if (item.type === 'table') {
        let statFields = []
        let getCols = (cols) => {
          return cols.filter(col => {
@@ -519,7 +523,7 @@
        })
      }
      if (item.type === 'card') {
      if (item.type === 'card' || item.type === 'carousel' || item.type === 'timeline') {
        item.subcards && item.subcards.forEach(card => {
          if (card.style.boxShadow) {
            delete card.style.hShadow
@@ -566,6 +570,9 @@
            return cell.eleType !== 'button' || skip || permAction[cell.uuid]
          })
          if (!card.backElements || card.backElements.length === 0) return
          card.backElements = card.backElements.filter(cell => {
            if (cell.eleType === 'button') {
              if (cell.hidden === 'true') return false
@@ -646,47 +653,7 @@
          return cell.eleType !== 'button' || skip || permAction[cell.uuid]
        })
      } else if ((item.type === 'table' && item.subtype === 'tablecard') || item.type === 'carousel' || item.type === 'timeline') {
        item.subcards && item.subcards.forEach(card => {
          card.elements = card.elements.filter(cell => {
            if (cell.eleType === 'button') {
              if (cell.hidden === 'true') return false
              cell.logLabel = item.$menuname + '-' + cell.label
              cell.Ot = cell.Ot || 'requiredSgl'
              cell.ContainerId = this.state.ContainerId
              cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : ''
              cell.$menuId = item.uuid
              cell.$MenuID = this.props.MenuID
              cell.$tabId = tabId
              cell.$view = 'CustomPage'
              if (cell.syncComponentId === item.setting.supModule) {
                cell.syncComponentId = ''
              }
              if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置
                cell = this.getPrinter(cell, item.uuid)
              }
              if (card.btnstyle) { // 兼容
                card.style = card.style || {}
                card.style = {...card.style, ...card.btnstyle}
              }
            } else if (['text', 'number', 'formula'].includes(cell.eleType)) {
              if (!cell.height) {
                cell.innerHeight = 'auto'
              }
              if (cell.eleType === 'number' && typeof(cell.decimal) === 'number') {
                cell.round = Math.pow(10, cell.decimal)
                if (cell.format === 'percent') {
                  cell.decimal = cell.decimal > 2 ? cell.decimal - 2 : 0
                }
              }
            }
            return cell.eleType !== 'button' || skip || permAction[cell.uuid]
          })
        })
      } else if (item.type === 'table' && (item.subtype === 'normaltable' || item.subtype === 'editable')) {
      } else if (item.type === 'table') {
        item.cols = item.cols.filter(col => {
          if (col.type !== 'action') return true
          col.elements = col.elements.filter(cell => {
@@ -1215,7 +1182,7 @@
            <CarouselPropCard config={item} data={data} mainSearch={mainSearch}/>
          </Col>
        )
      } else if (item.type === 'table' && item.subtype === 'tablecard') {
      } else if (item.type === 'card' && item.subtype === 'tablecard') {
        return (
          <Col span={item.width} key={item.uuid}>
            <TableCard config={item} data={data} mainSearch={mainSearch}/>