From 5cfe6db94c1449810a44660b299dba8e7e98e5c5 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 10 六月 2021 14:43:39 +0800 Subject: [PATCH] 2021-06-10 --- src/menu/components/share/usercomponent/index.jsx | 27 +++++++++++++++++++-------- 1 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/menu/components/share/usercomponent/index.jsx b/src/menu/components/share/usercomponent/index.jsx index cff1df6..e10fa99 100644 --- a/src/menu/components/share/usercomponent/index.jsx +++ b/src/menu/components/share/usercomponent/index.jsx @@ -6,20 +6,20 @@ 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' import MKEmitter from '@/utils/events.js' import './index.scss' -class DataSource extends Component { +class UserComponent extends Component { static propTpyes = { - btnlog: PropTypes.array, - handlelog: PropTypes.func + btnlog: PropTypes.array } state = { - dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, + dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, visible: false, loading: false, name: '', @@ -54,6 +54,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,13 +147,23 @@ 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', c_id: config.uuid, images: Utils.getcloudurl(result.Images), + typename: sessionStorage.getItem('appType') || '', c_name: res.name, long_param: window.btoa(window.encodeURIComponent(JSON.stringify(template))), del_type: '' @@ -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} @@ -217,4 +228,4 @@ } } -export default DataSource \ No newline at end of file +export default UserComponent \ No newline at end of file -- Gitblit v1.8.0