| | |
| | | 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 md5 from 'md5' |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | |
| | | 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 |
| | | |
| | |
| | | let param = JSON.parse(window.decodeURIComponent(window.atob(params.param))) |
| | | |
| | | sessionStorage.setItem('dataM', param.dataM || '') |
| | | |
| | | this.setState({ |
| | | BID: param.id || '', |
| | | tempId: param.tempId, |
| | |
| | | } |
| | | |
| | | componentDidMount() { |
| | | const _this = this |
| | | const that = this |
| | | |
| | | if (window.GLOB.sysType !== 'cloud') { |
| | | Object.defineProperty(window, 'debugger', { |
| | |
| | | window.GLOB.breakpoint = value + '' |
| | | sessionStorage.setItem('breakpoint', value) |
| | | } |
| | | _this.debugChange() |
| | | that.debugChange() |
| | | } |
| | | }) |
| | | } |
| | |
| | | window.GLOB.breakpoint = false |
| | | sessionStorage.removeItem('breakpoint') |
| | | |
| | | _this.debugChange() |
| | | that.debugChange() |
| | | } |
| | | } |
| | | } |
| | |
| | | let _pars = [] |
| | | |
| | | config.components = config.components.filter(item => !['tabs', 'search'].includes(item.type)) |
| | | |
| | | if (window.backend && config.allSqls) { |
| | | let urlparam = urlParam || {} |
| | | let keys = Object.keys(urlparam) |
| | | config.allSqls.forEach(item => { |
| | | item.id = md5(window.GLOB.appkey + item.v_id) |
| | | if (item.type === 'datasource' || item.type === 'excelOut') { |
| | | item.urlkeys = keys |
| | | item.urlparam = urlparam |
| | | if (config.flow_code) { |
| | | item.works_flow_code = config.flow_code |
| | | } |
| | | } |
| | | window.GLOB.CacheData.set('sql_' + item.uuid, item) |
| | | }) |
| | | } |
| | | |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | | let fullName = sessionStorage.getItem('Full_Name') || '' |
| | |
| | | component.setting.sync = 'false' |
| | | return component |
| | | } |
| | | |
| | | component.setting.uuid = component.uuid |
| | | |
| | | let _customScript = '' |
| | | let _tailScript = '' |
| | |
| | | |
| | | component.setting.customScript = _customScript // 整理后自定义脚本 |
| | | component.setting.tailScript = _tailScript // 后置自定义脚本 |
| | | |
| | | if (window.backend && config.allSqls) { |
| | | component.setting.sync = 'false' |
| | | } else if (_tailScript) { |
| | | component.setting.sync = 'false' |
| | | } |
| | | |
| | | // floor 组件的层级 |
| | | // pageable 是否分页,组件属性,不分页的组件才可以统一查询 |
| | |
| | | return |
| | | } |
| | | |
| | | inter.setting.uuid = inter.uuid |
| | | |
| | | let _customScript = '' |
| | | let _tailScript = '' |
| | | inter.scripts.forEach(script => { |
| | |
| | | { reg: /@SessionUid@/ig, value: `'${localStorage.getItem('SessionUid') || ''}'`}, |
| | | { reg: /@UserID@/ig, value: `'${sessionStorage.getItem('UserID') || ''}'`}, |
| | | { reg: /@Appkey@/ig, value: `'${window.GLOB.appkey || ''}'`}, |
| | | { reg: /@lang@/ig, value: `'${sessionStorage.getItem('lang')}'`}, |
| | | { reg: /@typename@/ig, value: `'admin'`}, |
| | | ] |
| | | |
| | |
| | | |
| | | // 测试系统打印查询语句 |
| | | if (window.GLOB.debugger === true) { |
| | | _script && console.info(`${_sql ? '' : '/*不执行默认sql*/\n'}${_script}`) |
| | | _sql && console.info(_sql) |
| | | _script && window.mkInfo(`${_sql ? '' : '/*不执行默认sql*/\n'}${_script}`) |
| | | _sql && window.mkInfo(_sql) |
| | | } |
| | | |
| | | item.columns.forEach(cell => { |
| | |
| | | if (item.func === 'sPC_Get_structured_data' && /将截断字符串或二进制数据/ig.test(res.message)) { |
| | | res.message = res.message + '请检查字段集' |
| | | } |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 5 |
| | | }) |
| | | if (res.ErrCode === 'version_up') { |
| | | this.reloadTabs() |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | resolve(false) |
| | | } else { |
| | | res.componentId = componentId |
| | |
| | | }) |
| | | } |
| | | |
| | | reloadTabs = () => { |
| | | if (this.reloading) return |
| | | |
| | | let time = new Date().getTime() |
| | | |
| | | let oldTime = sessionStorage.getItem('mk_reloadTabs') |
| | | |
| | | if (oldTime && time - oldTime < 180000) return |
| | | |
| | | sessionStorage.setItem('mk_reloadTabs', time) |
| | | |
| | | 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') |