king
2023-08-01 0e1e13bfab090a513c6b5e2c58eeb6e56c46868b
2023-08-01
2个文件已修改
70 ■■■■ 已修改文件
src/tabviews/custom/components/code/sand-box/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/billprint/index.jsx 66 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/code/sand-box/index.jsx
@@ -319,8 +319,8 @@
      if (js) {
        try {
          // eslint-disable-next-line
          let evalfunc = eval('(true && function (data, result) {' + js + '})')
          evalfunc(data, result)
          let evalfunc = eval('(true && function (data, result, Api, notification) {' + js + '})')
          evalfunc(data, result, Api, notification)
        } catch (e) {
          console.warn(e)
        }
src/views/billprint/index.jsx
@@ -314,7 +314,14 @@
        window.GLOB.CacheData.set(tempId, {$BID: BID})
        config.components = config.components.map(component => {
          if (component.action) component.action = []
          if (component.action) {
            component.action = component.action.filter(cell => {
              cell = this.resetButton(component, cell)
              cell.$toolbtn = true
              return !cell.hidden
            })
          }
          if (component.search) {
            component.search = []
            component.$searches = []
@@ -345,10 +352,15 @@
                  }
                } else if (item.type === 'custom') {
                  item.elements = item.elements.filter(cell => {
                    if (cell.eleType === 'button') return false
                    if (cell.eleType === 'button') {
                      cell = this.resetButton(component, cell)
                      return !cell.hidden
                    }
                    cell = this.resetElement(cell)
                    return cell
                    return true
                  })
                  if (item.elements.length === 0) {
                    return false
@@ -372,18 +384,26 @@
              }
    
              card.elements = card.elements.filter(cell => {
                if (cell.eleType === 'button') return false
                if (cell.eleType === 'button') {
                  cell = this.resetButton(component, cell)
                  return !cell.hidden
                }
                cell = this.resetElement(cell)
                return true
              })
    
              if (!card.backElements || card.backElements.length === 0) return
    
              card.backElements = card.backElements.filter(cell => {
                if (cell.eleType === 'button') return false
                if (cell.eleType === 'button') {
                  cell = this.resetButton(component, cell)
                  return !cell.hidden
                }
                cell = this.resetElement(cell)
    
                return true
@@ -391,8 +411,12 @@
            })
          } else if (component.type === 'balcony') {
            component.elements = component.elements.filter(cell => {
              if (cell.eleType === 'button') return false
              if (cell.eleType === 'button') {
                cell = this.resetButton(component, cell)
                return !cell.hidden
              }
              cell = this.resetElement(cell)
    
              return true
@@ -504,6 +528,28 @@
    })
  }
  resetButton = (item, cell) => {
    cell.logLabel = item.$menuname + '-' + cell.label
    cell.Ot = cell.Ot || 'requiredSgl'
    cell.syncComponentId = ''
    cell.$menuId = item.uuid
    cell.hidden = cell.hidden === 'true'
    if (!['pop', 'prompt', 'exec', 'innerpage', 'form'].includes(cell.OpenType)) {
      cell.hidden = true
    }
    if (cell.controlField) {
      if (/,/ig.test(cell.controlVal)) {
        cell.controlVals = cell.controlVal.split(',')
      } else {
        cell.controlVals = [(cell.controlVal || '')]
      }
    }
    return cell
  }
  resetElement = (cell) => {
    cell.style = cell.style || {}
    if (['text', 'number', 'formula'].includes(cell.eleType)) {