king
2021-03-01 c45a375e5b4ce0e33c7fc8a1aecdad67d60acc9e
src/menu/components/share/usercomponent/index.jsx
@@ -6,6 +6,7 @@
import Api from '@/api'
import Utils from '@/utils/utils.js'
import options from '@/store/options.js'
import zhCN from '@/locales/zh-CN/model.js'
import enUS from '@/locales/en-US/model.js'
import UserForm from './settingform'
@@ -19,7 +20,7 @@
  }
  state = {
    dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    visible: false,
    loading: false,
    name: '',
@@ -54,6 +55,8 @@
    _config.cols = config.cols || []
    _config.plot = config.plot || {}
    _config.html = config.html || ''
    _config.css = config.css || ''
    _config.js = config.js || ''
    _config.width = _config.wrap.width || _config.plot.width || config.width || 24
@@ -145,8 +148,17 @@
      setTimeout(() => {
        let template = this.getUserComponent()
        html2canvas(document.getElementById(config.uuid)).then(canvas => {
          let img = canvas.toDataURL('image/png') // 获取生成的图片
          Api.fileuploadbase64(img, 'cloud').then(result => {
          let param = {
            Base64Img: canvas.toDataURL('image/png') // 获取生成的图片
          }
          if (options.cloudServiceApi) {
            param.rduri = options.cloudServiceApi
            param.userid = sessionStorage.getItem('CloudUserID') || ''
            param.LoginUID = sessionStorage.getItem('CloudLoginUID') || ''
          }
          Api.fileuploadbase64(param).then(result => {
            if (result.status) {
              Api.getSystemConfig({
                func: 's_custom_components_adduptdel',
@@ -200,7 +212,6 @@
      <div className="user-component-wrap">
        <Icon type="user" title="生成自定义组件" onClick={this.trigger} />
        <Modal
          wrapClassName="popview-modal"
          title="自定义组件"
          visible={visible}
          width={500}