| | |
| | | "verror": "1.10.0" |
| | | } |
| | | }, |
| | | "jssha": { |
| | | "version": "3.2.0", |
| | | "resolved": "https://registry.npmjs.org/jssha/-/jssha-3.2.0.tgz", |
| | | "integrity": "sha512-QuruyBENDWdN4tZwJbQq7/eAK85FqrI4oDbXjy5IBhYD+2pTJyBUWZe8ctWaCkrV0gy6AaelgOZZBMeswEa/6Q==" |
| | | }, |
| | | "jsx-ast-utils": { |
| | | "version": "2.2.1", |
| | | "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.2.1.tgz", |
| | |
| | | "jest-resolve": "24.8.0", |
| | | "jest-watch-typeahead": "0.3.1", |
| | | "jsbarcode": "^3.11.3", |
| | | "jssha": "^3.2.0", |
| | | "md5": "^2.2.1", |
| | | "mini-css-extract-plugin": "0.5.0", |
| | | "moment": "^2.24.0", |
| | |
| | | import qs from 'qs' |
| | | import { notification } from 'antd' |
| | | import md5 from 'md5' |
| | | import jsSHA from 'jssha' |
| | | import moment from 'moment' |
| | | import Utils from '@/utils/utils.js' |
| | | import CacheUtils from './cacheutils' |
| | |
| | | * @description 登录系统, 获取用户信息 |
| | | */ |
| | | getusermsg (username, password, isCloud = false) { |
| | | |
| | | let param = { |
| | | // func: 'webapi_login', |
| | | UserName: username, |
| | | Password: password, |
| | | systemType: options.sysType, |
| | | Type: 'X' |
| | | Type: 'S' |
| | | } |
| | | |
| | | param.Password = Utils.formatOptions(param.Password) |
| | | // Type: 'S' 时 |
| | | let shaObj = new jsSHA('SHA-1', 'TEXT') |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | shaObj.update(password) |
| | | param.Password = shaObj.getHash('HEX').toUpperCase() |
| | | param.Password = md5(username + param.Password + param.timestamp) |
| | | |
| | | // Type: 'X' 时 |
| | | // param.Password = Utils.formatOptions(password) |
| | | param.appkey = window.GLOB.appkey || '' |
| | | |
| | | if (isCloud) { |
| | |
| | | param.lang = param.lang || sessionStorage.getItem('lang') || '' |
| | | param.appkey = window.GLOB.appkey || '' |
| | | param.SessionUid = localStorage.getItem('SessionUid') || '' |
| | | |
| | | if (sessionStorage.getItem('CloudUserID') && options.cloudServiceApi) { // 存在云端登录信息,且存在云端地址 |
| | | param.rduri = options.cloudServiceApi |
| | | param.userid = sessionStorage.getItem('CloudUserID') |
| | | param.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' |
| | | } else if (window.GLOB.mainSystemApi) { |
| | | param.rduri = window.GLOB.mainSystemApi |
| | | param.userid = sessionStorage.getItem('UserID') |
| | | param.LoginUID = sessionStorage.getItem('LoginUID') || '' |
| | | } else { |
| | | param.userid = sessionStorage.getItem('UserID') |
| | | param.LoginUID = sessionStorage.getItem('LoginUID') || '' |
| | | } |
| | | param.rduri = options.cloudServiceApi || '' |
| | | param.userid = sessionStorage.getItem('CloudUserID') || '' |
| | | param.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' |
| | | |
| | | param = this.encryptParam(param) |
| | | |
| | |
| | | param.appkey = window.GLOB.appkey || '' |
| | | param.SessionUid = localStorage.getItem('SessionUid') || '' |
| | | |
| | | if (sessionStorage.getItem('CloudUserID') && options.cloudServiceApi) { // 存在云端登录信息,且存在云端地址 |
| | | if (options.cloudServiceApi) { // 非云端请求 |
| | | param.rduri = options.cloudServiceApi |
| | | param.userid = sessionStorage.getItem('CloudUserID') |
| | | param.userid = sessionStorage.getItem('CloudUserID') || '' |
| | | param.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' |
| | | } else if (window.GLOB.mainSystemApi) { |
| | | param.rduri = window.GLOB.mainSystemApi |
| | | param.userid = sessionStorage.getItem('UserID') |
| | | param.LoginUID = sessionStorage.getItem('LoginUID') || '' |
| | | } else { |
| | | } else { // 云端请求 |
| | | param.userid = sessionStorage.getItem('UserID') |
| | | param.LoginUID = sessionStorage.getItem('LoginUID') || '' |
| | | } |
| | |
| | | * @description 获取业务通用接口 |
| | | */ |
| | | genericInterface (param) { |
| | | param.userid = sessionStorage.getItem('UserID') |
| | | param.userid = sessionStorage.getItem('UserID') || '' |
| | | param.lang = sessionStorage.getItem('lang') || '' |
| | | param.SessionUid = localStorage.getItem('SessionUid') || '' |
| | | param.LoginUID = sessionStorage.getItem('LoginUID') || '' |
| | | param.appkey = window.GLOB.appkey || '' |
| | | |
| | | if (options.cloudServiceApi && param.rduri === options.cloudServiceApi) { // HS下菜单 |
| | | param.userid = sessionStorage.getItem('CloudUserID') || '' |
| | | param.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' |
| | | param.userid = sessionStorage.getItem('CloudUserID') || param.userid || '' |
| | | param.LoginUID = sessionStorage.getItem('CloudLoginUID') || param.LoginUID || '' |
| | | } |
| | | |
| | | param = this.encryptParam(param) |
| | |
| | | method: 'post', |
| | | data: param |
| | | }).then(res => { |
| | | |
| | | try { |
| | | const blob = new Blob([res]) |
| | | |
| | |
| | | |
| | | if (trd.LinkUrl && iframes.includes(trd.LinkUrl.split('?')[0])) { |
| | | trdItem.type = 'iframe' |
| | | trdItem.LinkUrl = trd.LinkUrl |
| | | trdItem.LinkUrl = trd.LinkUrl.replace('&', '&') |
| | | } else { |
| | | try { |
| | | trdItem.PageParam = trd.PageParam ? JSON.parse(trd.PageParam) : {OpenType: 'newtab'} |
| | |
| | | sessionStorage.setItem('role_id', sessionStorage.getItem('localRole_id') || '') |
| | | sessionStorage.setItem('dataM', sessionStorage.getItem('localDataM') || '') |
| | | |
| | | // 测试系统文件置于admin中 |
| | | // 新系统文件置于admin中 ../options.json |
| | | |
| | | fetch('./options.json') |
| | | // fetch(process.env.NODE_ENV === 'production' ? '../options.json' : './options.json') |
| | | .then(response => response.json()) |
| | | .catch(() => { |
| | | document.getElementById('root').innerHTML = '<div style="text-align: center; font-size: 30px; margin-top: 40vh;">系统配置信息获取失败,请联系管理员!</div>' |
| | |
| | | } |
| | | if (config.mainSystemApi) { |
| | | let systemApi = config.mainSystemApi |
| | | |
| | | // if (/^(http|https):\/\//ig.test(systemApi)) { |
| | | // let _systemApi = /^(http|https):\/\/[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62}|(:[0-9]{1,4}))+\.?/ig.exec(systemApi) |
| | | |
| | | // systemApi = _systemApi ? _systemApi[0] : '' |
| | | // } else { |
| | | // systemApi = '' |
| | | // } |
| | | |
| | | // // 业务系统连接云端时,格式化处理 |
| | | // if (systemApi && systemApi === /^(http|https):\/\/[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62}|(:[0-9]{1,4}))+\.?/ig.exec(options.cloudServiceApi)[0]) { |
| | | // GLOB.dataFormat = true |
| | | // } |
| | | |
| | | // if (systemApi) { |
| | | // systemApi = systemApi + '/webapi/dostars' |
| | | // } |
| | | |
| | | // 业务系统不允许连接云端,业务系统连接sso.mk9h.cn时,数据虚化处理 |
| | | if (systemApi && systemApi.indexOf('cloud.mk9h.cn') > -1) { |
| | | systemApi = '' |
| | |
| | | const PasteComponent = asyncIconComponent(() => import('@/menu/components/share/pastecomponent')) |
| | | const LogComponent = asyncIconComponent(() => import('@/menu/components/share/logcomponent')) |
| | | const UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent')) |
| | | const ClockComponent = asyncIconComponent(() => import('@/menu/components/share/clockcomponent')) |
| | | const NormalHeader = asyncComponent(() => import('@/menu/components/share/normalheader')) |
| | | |
| | | const { confirm } = Modal |
| | |
| | | <PasteComponent config={card} options={['cardcell']} updateConfig={this.updateComponent} /> |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
| | | <LogComponent btnlog={card.btnlog || []} handlelog={this.handleLog} /> |
| | | <ClockComponent config={card} updateConfig={this.updateComponent}/> |
| | | <UserComponent config={card}/> |
| | | <Icon className="close" title="删除组件" type="delete" onClick={() => this.props.deletecomponent(card.uuid)} /> |
| | | {card.wrap.datatype !== 'static' ? <SettingComponent config={card} updateConfig={this.updateComponent} /> : null} |
| | |
| | | const NormalHeader = asyncComponent(() => import('@/menu/components/share/normalheader')) |
| | | const ActionComponent = asyncComponent(() => import('@/menu/components/share/actioncomponent')) |
| | | const UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent')) |
| | | const ClockComponent = asyncIconComponent(() => import('@/menu/components/share/clockcomponent')) |
| | | |
| | | class antvBarLineChart extends Component { |
| | | static propTpyes = { |
| | |
| | | |
| | | let _card = {...card, style} |
| | | |
| | | // this.setState({ |
| | | // card: _card |
| | | // }) |
| | | |
| | | this.updateComponent(_card) |
| | | // this.props.updateConfig(_card) |
| | | } |
| | | |
| | | handleLog = (type, logs, item) => { |
| | |
| | | <PasteComponent config={card} options={['action', 'search', 'form']} updateConfig={this.updateComponent} /> |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
| | | <LogComponent btnlog={card.btnlog || []} handlelog={this.handleLog} /> |
| | | <ClockComponent config={card} updateConfig={this.updateComponent}/> |
| | | <UserComponent config={card}/> |
| | | <Icon className="close" title="delete" type="delete" onClick={() => this.props.deletecomponent(card.uuid)} /> |
| | | <SettingComponent config={card} updateConfig={this.updateComponent}/> |
| | |
| | | const LogComponent = asyncIconComponent(() => import('@/menu/components/share/logcomponent')) |
| | | const NormalHeader = asyncComponent(() => import('@/menu/components/share/normalheader')) |
| | | const UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent')) |
| | | const ClockComponent = asyncIconComponent(() => import('@/menu/components/share/clockcomponent')) |
| | | |
| | | class antvBarLineChart extends Component { |
| | | static propTpyes = { |
| | |
| | | <PasteComponent config={card} options={['search', 'form']} updateConfig={this.updateComponent} /> |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
| | | <LogComponent btnlog={card.btnlog || []} handlelog={this.handleLog} /> |
| | | <ClockComponent config={card} updateConfig={this.updateComponent}/> |
| | | <UserComponent config={card}/> |
| | | <Icon className="close" title="delete" type="delete" onClick={() => this.props.deletecomponent(card.uuid)} /> |
| | | <SettingComponent config={card} updateConfig={this.updateComponent}/> |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Icon, Modal } from 'antd' |
| | | |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import ClockForm from './settingform' |
| | | import './index.scss' |
| | | |
| | | class ClockComponent extends Component { |
| | | static propTpyes = { |
| | | btnlog: PropTypes.array, |
| | | updateConfig: PropTypes.func |
| | | } |
| | | |
| | | state = { |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | visible: false, |
| | | timer: '', |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | trigger = () => { |
| | | const { config } = this.props |
| | | |
| | | this.setState({ |
| | | visible: true, |
| | | timer: config.timer || '' |
| | | }) |
| | | } |
| | | |
| | | submit = () => { |
| | | const { config } = this.props |
| | | |
| | | this.verifyRef.handleConfirm().then(res => { |
| | | this.setState({ |
| | | visible: false |
| | | }) |
| | | this.props.updateConfig({...config, timer: res.timer}) |
| | | }) |
| | | } |
| | | |
| | | render () { |
| | | const { visible, loading, timer } = this.state |
| | | |
| | | return ( |
| | | <div className="clock-component-wrap"> |
| | | <Icon type="clock-circle" title="定时器" onClick={this.trigger} /> |
| | | <Modal |
| | | title="定时器设置" |
| | | visible={visible} |
| | | width={500} |
| | | maskClosable={false} |
| | | confirmLoading={loading} |
| | | onOk={this.submit} |
| | | onCancel={() => this.setState({ visible: false })} |
| | | destroyOnClose |
| | | > |
| | | <ClockForm timer={timer} inputSubmit={this.submit} wrappedComponentRef={(inst) => this.verifyRef = inst}/> |
| | | </Modal> |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default ClockComponent |
New file |
| | |
| | | .clock-component-wrap { |
| | | display: inline-block; |
| | | |
| | | >.anticon-clock-circle { |
| | | color: rgb(38, 194, 129); |
| | | } |
| | | } |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Select } from 'antd' |
| | | |
| | | import './index.scss' |
| | | |
| | | class SettingForm extends Component { |
| | | static propTpyes = { |
| | | timer: PropTypes.string, // 组件名称 |
| | | inputSubmit: PropTypes.func // 回车事件 |
| | | } |
| | | |
| | | state = {} |
| | | |
| | | handleConfirm = () => { |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | resolve(values) |
| | | } else { |
| | | reject(err) |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | render() { |
| | | const { getFieldDecorator } = this.props.form |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 8 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 } |
| | | } |
| | | } |
| | | |
| | | return ( |
| | | <div> |
| | | <Form {...formItemLayout}> |
| | | <Row gutter={24}> |
| | | <Col span={22}> |
| | | <Form.Item label="定时器"> |
| | | {getFieldDecorator('timer', { |
| | | initialValue: this.props.timer || '' |
| | | })( |
| | | <Select> |
| | | <Select.Option value=""> 无 </Select.Option> |
| | | <Select.Option value="15s"> 15秒 </Select.Option> |
| | | <Select.Option value="30s"> 30秒 </Select.Option> |
| | | <Select.Option value="1min"> 1分钟 </Select.Option> |
| | | <Select.Option value="5min"> 5分钟 </Select.Option> |
| | | <Select.Option value="10min"> 10分钟 </Select.Option> |
| | | <Select.Option value="15min"> 15分钟 </Select.Option> |
| | | <Select.Option value="30min"> 30分钟 </Select.Option> |
| | | <Select.Option value="1hour"> 1小时 </Select.Option> |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | | </Form> |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default Form.create()(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 = { |
| | |
| | | } |
| | | } |
| | | |
| | | export default DataSource |
| | | export default UserComponent |
| | |
| | | import { is, fromJS } from 'immutable' |
| | | import { connect } from 'react-redux' |
| | | import { Spin, notification, Col } from 'antd' |
| | | import moment from 'moment' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | | import UtilsDM from '@/utils/utils-datamanage.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import { modifyTabview } from '@/store/action' |
| | | import './index.scss' |
| | |
| | | loading: false, // 数据加载状态 |
| | | activeKey: '', // 选中数据 |
| | | sync: false, // 是否统一请求数据 |
| | | data: {} // 数据 |
| | | data: {}, // 数据 |
| | | timer: null // 定时器时间间隔 |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | MKEmitter.addListener('reloadData', this.reloadData) |
| | | MKEmitter.addListener('resetSelectLine', this.resetParentParam) |
| | | MKEmitter.removeListener('refreshByButtonResult', this.refreshByButtonResult) |
| | | this.handleTimer() |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | |
| | | } |
| | | |
| | | componentWillUnmount () { |
| | | clearTimeout(this.timer) |
| | | this.setState = () => { |
| | | return |
| | | } |
| | |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | |
| | | handleTimer = () => { |
| | | const { config } = this.state |
| | | |
| | | if (!config.timer) return |
| | | |
| | | const _change = { |
| | | '15s': 15000, |
| | | '30s': 30000, |
| | | '1min': 60000, |
| | | '5min': 300000, |
| | | '10min': 600000, |
| | | '15min': 900000, |
| | | '30min': 1800000, |
| | | '1hour': 3600000 |
| | | } |
| | | |
| | | let timer = _change[config.timer] |
| | | |
| | | if (!timer) return |
| | | |
| | | let _param = { |
| | | func: 's_get_timers_role', |
| | | LText: `select '${window.GLOB.appkey || ''}','${config.uuid}'`, |
| | | timer_type: config.timer, |
| | | component_id: config.uuid |
| | | } |
| | | |
| | | _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') // 时间戳 |
| | | _param.LText = Utils.formatOptions(_param.LText) // 关键字符替换,base64加密 |
| | | _param.secretkey = Utils.encrypt(_param.LText, _param.timestamp) // md5密钥 |
| | | |
| | | Api.getSystemConfig(_param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (result.run_type) { |
| | | this.setState({timer}) |
| | | this.timer = setTimeout(() => { |
| | | this.timerTask() |
| | | }, timer) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | timerTask = () => { |
| | | const { timer } = this.state |
| | | if (!timer) return |
| | | |
| | | this.loadData(true) |
| | | |
| | | this.timer = setTimeout(() => { |
| | | this.timerTask() |
| | | }, timer) |
| | | } |
| | | |
| | | /** |
| | |
| | | this.loadData() |
| | | } |
| | | |
| | | async loadData () { |
| | | async loadData (hastimer) { |
| | | const { mainSearch, menuType } = this.props |
| | | const { config, arr_field, BID } = this.state |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | loading: true |
| | | }) |
| | | if (!hastimer) { |
| | | this.setState({ |
| | | loading: true |
| | | }) |
| | | } |
| | | |
| | | let _orderBy = config.setting.order || '' |
| | | let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, 1, 1, BID, menuType) |
| | |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | loading: false |
| | | loading: false, |
| | | timer: null |
| | | }) |
| | | notification.error({ |
| | | top: 92, |
| | |
| | | import { connect } from 'react-redux' |
| | | import DataSet from '@antv/data-set' |
| | | import { Spin, Empty, Select, notification } from 'antd' |
| | | import moment from 'moment' |
| | | |
| | | import asyncComponent from './asyncButtonComponent' |
| | | import { chartColors } from '@/utils/option.js' |
| | |
| | | MKEmitter.addListener('resetSelectLine', this.resetParentParam) |
| | | MKEmitter.addListener('getexceloutparam', this.getexceloutparam) |
| | | MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult) |
| | | this.handleTimer() |
| | | } |
| | | |
| | | /** |
| | | * @description 组件销毁,清除state更新,清除快捷键设置 |
| | | */ |
| | | componentWillUnmount () { |
| | | clearTimeout(this.timer) |
| | | this.setState = () => { |
| | | return |
| | | } |
| | |
| | | MKEmitter.removeListener('resetSelectLine', this.resetParentParam) |
| | | MKEmitter.removeListener('getexceloutparam', this.getexceloutparam) |
| | | MKEmitter.removeListener('refreshByButtonResult', this.refreshByButtonResult) |
| | | } |
| | | |
| | | handleTimer = () => { |
| | | const { config } = this.state |
| | | |
| | | if (!config.timer) return |
| | | |
| | | const _change = { |
| | | '15s': 15000, |
| | | '30s': 30000, |
| | | '1min': 60000, |
| | | '5min': 300000, |
| | | '10min': 600000, |
| | | '15min': 900000, |
| | | '30min': 1800000, |
| | | '1hour': 3600000 |
| | | } |
| | | |
| | | let timer = _change[config.timer] |
| | | |
| | | if (!timer) return |
| | | |
| | | let _param = { |
| | | func: 's_get_timers_role', |
| | | LText: `select '${window.GLOB.appkey || ''}','${config.uuid}'`, |
| | | timer_type: config.timer, |
| | | component_id: config.uuid |
| | | } |
| | | |
| | | _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') // 时间戳 |
| | | _param.LText = Utils.formatOptions(_param.LText) // 关键字符替换,base64加密 |
| | | _param.secretkey = Utils.encrypt(_param.LText, _param.timestamp) // md5密钥 |
| | | |
| | | Api.getSystemConfig(_param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (result.run_type) { |
| | | this.setState({timer}) |
| | | this.timer = setTimeout(() => { |
| | | this.timerTask() |
| | | }, timer) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | timerTask = () => { |
| | | const { timer } = this.state |
| | | if (!timer) return |
| | | |
| | | this.loadData(true) |
| | | |
| | | this.timer = setTimeout(() => { |
| | | this.timerTask() |
| | | }, timer) |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * @description 数据加载 |
| | | */ |
| | | async loadData () { |
| | | async loadData (hastimer) { |
| | | const { mainSearch, menuType } = this.props |
| | | const { config, arr_field, BID, search } = this.state |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | loading: true |
| | | }) |
| | | if (!hastimer) { |
| | | this.setState({ |
| | | loading: true |
| | | }) |
| | | } |
| | | |
| | | let _orderBy = config.setting.order || '' |
| | | let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, '', '', BID, menuType) |
| | |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | loading: false |
| | | loading: false, |
| | | timer: null |
| | | }) |
| | | notification.error({ |
| | | top: 92, |
| | |
| | | import { connect } from 'react-redux' |
| | | import DataSet from '@antv/data-set' |
| | | import { Spin, Empty, notification } from 'antd' |
| | | import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('reloadData', this.reloadData) |
| | | MKEmitter.addListener('resetSelectLine', this.resetParentParam) |
| | | this.handleTimer() |
| | | } |
| | | |
| | | /** |
| | | * @description 组件销毁,清除state更新,清除快捷键设置 |
| | | */ |
| | | componentWillUnmount () { |
| | | clearTimeout(this.timer) |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | MKEmitter.removeListener('reloadData', this.reloadData) |
| | | MKEmitter.removeListener('resetSelectLine', this.resetParentParam) |
| | | } |
| | | |
| | | handleTimer = () => { |
| | | const { config } = this.state |
| | | |
| | | if (!config.timer) return |
| | | |
| | | const _change = { |
| | | '15s': 15000, |
| | | '30s': 30000, |
| | | '1min': 60000, |
| | | '5min': 300000, |
| | | '10min': 600000, |
| | | '15min': 900000, |
| | | '30min': 1800000, |
| | | '1hour': 3600000 |
| | | } |
| | | |
| | | let timer = _change[config.timer] |
| | | |
| | | if (!timer) return |
| | | |
| | | let _param = { |
| | | func: 's_get_timers_role', |
| | | LText: `select '${window.GLOB.appkey || ''}','${config.uuid}'`, |
| | | timer_type: config.timer, |
| | | component_id: config.uuid |
| | | } |
| | | |
| | | _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') // 时间戳 |
| | | _param.LText = Utils.formatOptions(_param.LText) // 关键字符替换,base64加密 |
| | | _param.secretkey = Utils.encrypt(_param.LText, _param.timestamp) // md5密钥 |
| | | |
| | | Api.getSystemConfig(_param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (result.run_type) { |
| | | this.setState({timer}) |
| | | this.timer = setTimeout(() => { |
| | | this.timerTask() |
| | | }, timer) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | timerTask = () => { |
| | | const { timer } = this.state |
| | | if (!timer) return |
| | | |
| | | this.loadData(true) |
| | | |
| | | this.timer = setTimeout(() => { |
| | | this.timerTask() |
| | | }, timer) |
| | | } |
| | | |
| | | reloadData = (menuId) => { |
| | |
| | | this.pierender() |
| | | } |
| | | |
| | | async loadData () { |
| | | async loadData (hastimer) { |
| | | const { mainSearch, menuType } = this.props |
| | | const { config, arr_field, search, BID } = this.state |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | loading: true |
| | | }) |
| | | if (!hastimer) { |
| | | this.setState({ |
| | | loading: true |
| | | }) |
| | | } |
| | | |
| | | let _orderBy = config.setting.order || '' |
| | | let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, '', '', BID, menuType) |
| | |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | loading: false |
| | | loading: false, |
| | | timer: null |
| | | }) |
| | | notification.error({ |
| | | top: 92, |
| | |
| | | _fieldlen = item.decimal ? item.decimal : 0 |
| | | } |
| | | |
| | | if (_initval === undefined) { |
| | | _initval = '' |
| | | } |
| | | |
| | | return { |
| | | key: item.field, |
| | | readonly: item.readonly === 'true', |
| | |
| | | _fieldlen = item.decimal ? item.decimal : 0 |
| | | } |
| | | |
| | | if (_initval === undefined) { |
| | | _initval = '' |
| | | } |
| | | |
| | | return { |
| | | key: item.field, |
| | | readonly: item.readonly === 'true', |
| | |
| | | { title: '应用名称', dataIndex: 'remark', key: 'remark', align: 'center' }, |
| | | { title: '应用编码', dataIndex: 'kei_no', key: 'kei_no', align: 'center' }, |
| | | { |
| | | title: 'Action', |
| | | title: '操作', |
| | | key: 'action', |
| | | align: 'center', |
| | | render: (text, record) => (<Button type="link" onClick={() => this.deleteApp(record)} style={{color: '#ff4d4f'}}>删除</Button>), |
| | |
| | | render: (text, record) => (text ? <img style={{width: '32px', height: '32px'}} src={text} alt="" /> : null) |
| | | }, |
| | | { |
| | | title: 'Action', |
| | | title: '操作', |
| | | key: 'action', |
| | | align: 'center', |
| | | width: '190px', |
| | |
| | | |
| | | if (trd.LinkUrl && iframes.includes(trd.LinkUrl.split('?')[0])) { |
| | | trdItem.type = 'iframe' |
| | | trdItem.LinkUrl = trd.LinkUrl |
| | | trdItem.LinkUrl = trd.LinkUrl.replace('&', '&') |
| | | trdItem.forbidden = true |
| | | } else { |
| | | try { |
| | |
| | | {editLevel === 'HS' ? <Button className="level4-close" type="primary" onClick={this.exitManage}>退出</Button> : null} |
| | | {/* 进入编辑按钮 */} |
| | | {!editLevel ? <Icon onClick={this.enterEdit} className="edit-check" type="edit" /> : null} |
| | | {!editLevel && options.sysType === 'local' && window.GLOB.systemType !== 'production' && this.props.memberLevel >= 30 ? |
| | | {!editLevel && options.sysType === 'local' && window.GLOB.systemType !== 'production' && this.props.memberLevel >= 20 ? |
| | | <span onClick={() => {window.open('#/appmanage')}} className="mobile" type="edit"> 应用管理 <Icon type="arrow-right" /></span> : null |
| | | } |
| | | {/* window.btoa(window.encodeURIComponent(JSON.stringify({ MenuType: 'home', MenuId: 'home_page_id', MenuName: '首页' }))) */} |
| | |
| | | |
| | | if (trd.LinkUrl && iframes.includes(trd.LinkUrl.split('?')[0])) { |
| | | trdItem.type = 'iframe' |
| | | trdItem.LinkUrl = trd.LinkUrl |
| | | trdItem.LinkUrl = trd.LinkUrl.replace('&', '&') |
| | | trdItem.forbidden = true |
| | | } else { |
| | | try { |