king
2024-04-29 f9816a4078fdba44115c69025d9982997f23b484
src/views/billprint/index.jsx
@@ -1,6 +1,6 @@
import React, { Component } from 'react'
import { is, fromJS } from 'immutable'
import { Col, Row, Spin, notification, Button } from 'antd'
import { Col, Row, Spin, notification, Button, Modal } from 'antd'
import moment from 'moment'
import Api from '@/api'
@@ -47,6 +47,8 @@
    auto: true,
    ismob: /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(navigator.userAgent)
  }
  reloading = false
  UNSAFE_componentWillMount() {
    const { params } = this.props.match
@@ -368,6 +370,8 @@
              return cols.filter(item => {
                if (item.Hide === 'true') return false
                  
                item.IsSort = 'false'
                if (item.type === 'number') {
                  if (typeof(item.decimal) === 'number') {
                    item.round = Math.pow(10, item.decimal)
@@ -629,6 +633,9 @@
    if (cell.marks && cell.marks.length === 0) {
      cell.marks = null
    }
    if (cell.anchors && cell.anchors.length === 0) {
      cell.anchors = null
    }
    
    if (['text', 'number', 'formula'].includes(cell.eleType)) {
@@ -912,11 +919,15 @@
            if (item.func === 'sPC_Get_structured_data' && /将截断字符串或二进制数据/ig.test(res.message)) {
              res.message = res.message + '请检查字段集'
            }
            if (res.ErrCode === 'version_up') {
              this.reloadTabs()
            } else {
            notification.warning({
              top: 92,
              message: res.message,
              duration: 5
            })
            }
            resolve(false)
          } else {
            res.componentId = componentId
@@ -1076,6 +1087,20 @@
    })
  }
  reloadTabs = () => {
    if (this.reloading) return
    this.reloading = true
    Api.getAppVersion(true).then(() => {
      window.location.reload()
    }, (message) => {
      Modal.error({
        title: message || '系统配置更新失败!',
      })
    })
  }
  canvasToImage(canvas) {
    let image = new Image()
    image.src = canvas.toDataURL('image/jpg')