king
2022-09-18 7046b2568593b72f3640df6796a2b81980134030
2022-09-18
29个文件已修改
1个文件已添加
943 ■■■■■ 已修改文件
public/README.txt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcellcomponent/dragaction/index.scss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/data-card/index.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/table-card/index.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/carousel/data-card/index.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/carousel/prop-card/index.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/clockcomponent/index.jsx 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/clockcomponent/settingform/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/normal-table/index.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/timeline/normal-timeline/index.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/balcony/index.jsx 85 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/cardcellList/index.scss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/data-card/index.jsx 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/prop-card/index.jsx 87 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/table-card/index.jsx 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/carousel/data-card/index.jsx 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/carousel/prop-card/index.jsx 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-bar-line/index.jsx 82 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-dashboard/index.jsx 82 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-pie/index.jsx 82 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-scatter/index.jsx 82 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/custom-chart/index.jsx 83 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/share/normalTable/index.scss 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/edit-table/normalTable/index.scss 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/normal-table/index.jsx 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/timeline/normal-timeline/index.jsx 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/tree/antd-tree/index.jsx 86 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/normalTable/index.scss 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/timer-task.js 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/README.txt
@@ -14,6 +14,6 @@
debugger          -- 值为 true 时开启调试模式,开启后移动端子应用中会有控制台
licenseKey        -- 许可密钥,在内部网络中使用系统时,会跳过epc验证
probation         -- 试用期(YYYY-MM-DD),在正式系统中,试用期内调用系统接口的脚本会记录下来
transfer          -- 是否使用转接口,使用转接口时请设置为 true
transfer          -- 是否使用转接口,使用转接口时请设置为 true, 使用转接口时,外部接口调用前不会做登录验证
keepPassword      -- 记住密码,默认开启,当值为 false 时禁用
platforms         -- 移动端可使用的平台类型,默认为 ["H5", "wechat", "android", "ios", "wxMiniProgram"] 分别代表H5页面、微信公众号、安卓APP、苹果APP、微信小程序
src/api/index.js
@@ -216,16 +216,6 @@
      TypeCharOne: 'pc',
      kei_id: window.btoa(window.encodeURIComponent(window.GLOB.host))
    }
    param.LText = md5(window.btoa(_SessionUid + param.timestamp))
    // param.secretkey = md5(param.LText + 'mingke' + param.timestamp) // v_type 为空时
    let solt = md5((window.GLOB.appkey + window.btoa(window.GLOB.appkey + 'mingke') + 'mingke').toLowerCase()).slice(-6).toUpperCase()
    param.v_type = 'Y'
    param.secretkey = md5(param.LText + solt + param.timestamp)
    param.appkey = window.GLOB.appkey || ''
    let url = '/webapi/dologon/s_visitor_login'
    if (window.GLOB.mainSystemApi) {
@@ -246,7 +236,19 @@
      if (!param.rduri) {
        param.rduri = window.GLOB.baseurl + 'webapi/dologon/s_visitor_login'
      }
      param.linkurl = appid.replace(/\/webapi(.*)/, '/index.html')
    }
    param.LText = md5(window.btoa(_SessionUid + param.timestamp + (param.linkurl || '')))
    // param.secretkey = md5(param.LText + 'mingke' + param.timestamp) // v_type 为空时
    let solt = md5((window.GLOB.appkey + window.btoa(window.GLOB.appkey + 'mingke') + 'mingke').toLowerCase()).slice(-6).toUpperCase()
    param.v_type = param.v_type || 'Y'
    param.secretkey = md5(param.LText + solt + param.timestamp)
    param.appkey = window.GLOB.appkey || ''
    return axios({
      url: url,
src/menu/components/card/cardcellcomponent/dragaction/index.scss
@@ -114,7 +114,7 @@
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: #e9e9e9;
    background-color: #f5f5f5;
  }
  .ant-mk-icon {
    vertical-align: top;
src/menu/components/card/data-card/index.jsx
@@ -21,6 +21,7 @@
const UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent'))
const PasteComponent = asyncIconComponent(() => import('@/components/paste'))
const NormalHeader = asyncComponent(() => import('@/menu/components/share/normalheader'))
const ClockComponent = asyncIconComponent(() => import('@/menu/components/share/clockcomponent'))
const ActionComponent = asyncComponent(() => import('@/menu/components/share/actioncomponent'))
const { confirm } = Modal
@@ -779,6 +780,7 @@
            <PasteComponent options={['action', 'search', 'form', 'cardcell']} updateConfig={this.pasteComponent} />
            <FontColorsOutlined className="style" title="调整样式" onClick={this.changeStyle}/>
            {/* <LogComponent btnlog={card.btnlog || []} handlelog={this.handleLog} /> */}
            <ClockComponent config={card} updateConfig={this.updateComponent}/>
            <UserComponent config={card}/>
            <DeleteOutlined className="close" title="删除组件" onClick={() => this.props.deletecomponent(card.uuid)} />
            <SettingComponent config={card} updateConfig={this.updateComponent} />
src/menu/components/card/table-card/index.jsx
@@ -21,6 +21,7 @@
// const LogComponent = asyncIconComponent(() => import('@/menu/components/share/logcomponent'))
const UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent'))
const NormalHeader = asyncComponent(() => import('@/menu/components/share/normalheader'))
const ClockComponent = asyncIconComponent(() => import('@/menu/components/share/clockcomponent'))
const ActionComponent = asyncComponent(() => import('@/menu/components/share/actioncomponent'))
const { confirm } = Modal
@@ -589,6 +590,7 @@
            <PasteComponent options={['cardcell', 'search', 'form']} updateConfig={this.pasteComponent} />
            <FontColorsOutlined className="style" title="调整样式" onClick={this.changeStyle}/>
            {/* <LogComponent btnlog={card.btnlog || []} handlelog={this.handleLog} /> */}
            <ClockComponent config={card} updateConfig={this.updateComponent}/>
            <UserComponent config={card}/>
            <DeleteOutlined className="close" title="删除组件" onClick={() => this.props.deletecomponent(card.uuid)} />
            {card.wrap.datatype !== 'static' ? <SettingComponent config={card} updateConfig={this.updateComponent} /> : null}
src/menu/components/carousel/data-card/index.jsx
@@ -17,6 +17,7 @@
const CardSimpleComponent = asyncComponent(() => import('@/menu/components/card/cardsimplecomponent'))
// const LogComponent = asyncIconComponent(() => import('@/menu/components/share/logcomponent'))
const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent'))
const ClockComponent = asyncIconComponent(() => import('@/menu/components/share/clockcomponent'))
const UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent'))
const { confirm } = Modal
@@ -311,6 +312,7 @@
            <CopyComponent type="datacard" card={card}/>
            <FontColorsOutlined className="style" title="调整样式" onClick={this.changeStyle}/>
            {/* <LogComponent btnlog={card.btnlog || []} handlelog={this.handleLog}/> */}
            <ClockComponent config={card} updateConfig={this.updateComponent}/>
            <UserComponent config={card}/>
            <DeleteOutlined className="close" title="删除组件" onClick={() => this.props.deletecomponent(card.uuid)}/>
            <SettingComponent config={card} updateConfig={this.updateComponent}/>
src/menu/components/carousel/prop-card/index.jsx
@@ -18,6 +18,7 @@
const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent'))
const PasteComponent = asyncIconComponent(() => import('@/menu/components/share/pastecomponent'))
// const LogComponent = asyncIconComponent(() => import('@/menu/components/share/logcomponent'))
const ClockComponent = asyncIconComponent(() => import('@/menu/components/share/clockcomponent'))
const UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent'))
const { confirm } = Modal
@@ -419,6 +420,7 @@
            <PasteComponent config={card} options={['cardcell']} updateConfig={this.updateComponent} />
            <FontColorsOutlined className="style" title="调整样式" onClick={this.changeStyle}/>
            {/* <LogComponent btnlog={card.btnlog || []} handlelog={this.handleLog} /> */}
            <ClockComponent config={card} updateConfig={this.updateComponent}/>
            <UserComponent config={card}/>
            <DeleteOutlined className="close" title="删除组件" onClick={() => this.props.deletecomponent(card.uuid)} />
            {card.wrap.datatype !== 'static' ? <SettingComponent config={card} updateConfig={this.updateComponent} /> : null}
src/menu/components/share/clockcomponent/index.jsx
@@ -1,6 +1,5 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Modal } from 'antd'
import { ClockCircleOutlined } from '@ant-design/icons'
@@ -14,10 +13,6 @@
  state = {
    visible: false
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.state), fromJS(nextState))
  }
  trigger = () => {
src/menu/components/share/clockcomponent/settingform/index.jsx
@@ -100,7 +100,7 @@
                })(<InputNumber min={0} max={500} precision={0} />)}
              </Form.Item>
            </Col> : null}
            {(config.subtype === 'balcony' || config.subtype === 'propcard') && timer && timer !== '2s' ? <Col span={22}>
            {config.type === 'card' && (config.subtype === 'balcony' || config.subtype === 'propcard') && timer && timer !== '2s' ? <Col span={22}>
              <Form.Item label={
                <Tooltip placement="topLeft" title="可以指定字段用于控制定时器的关闭。">
                  <QuestionCircleOutlined className="mk-form-tip" />
src/menu/components/table/normal-table/index.jsx
@@ -21,6 +21,7 @@
const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent'))
const UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent'))
const PasteComponent = asyncIconComponent(() => import('@/menu/components/share/pastecomponent'))
const ClockComponent = asyncIconComponent(() => import('@/menu/components/share/clockcomponent'))
// const LogComponent = asyncIconComponent(() => import('@/menu/components/share/logcomponent'))
const ColumnComponent = asyncComponent(() => import('./columns'))
@@ -522,6 +523,7 @@
            <PasteComponent config={card} options={options} updateConfig={this.updateComponent} />
            <FontColorsOutlined className="style" title="调整样式" onClick={this.changeStyle}/>
            {/* <LogComponent btnlog={card.btnlog || []} handlelog={this.handleLog} /> */}
            <ClockComponent config={card} updateConfig={this.updateComponent}/>
            <UserComponent config={card}/>
            <DeleteOutlined className="close" title="删除组件" onClick={() => this.props.deletecomponent(card.uuid)} />
            <SettingComponent config={card} updateConfig={this.updateComponent} />
src/menu/components/timeline/normal-timeline/index.jsx
@@ -16,6 +16,7 @@
const NormalForm = asyncIconComponent(() => import('@/components/normalform'))
const CardSimpleComponent = asyncComponent(() => import('@/menu/components/card/cardsimplecomponent'))
const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent'))
const ClockComponent = asyncIconComponent(() => import('@/menu/components/share/clockcomponent'))
const UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent'))
const NormalHeader = asyncComponent(() => import('@/menu/components/share/normalheader'))
@@ -217,6 +218,7 @@
            </NormalForm>
            <CopyComponent type="timeline" card={card}/>
            <FontColorsOutlined className="style" title="调整样式" onClick={this.changeStyle}/>
            <ClockComponent config={card} updateConfig={this.updateComponent}/>
            <UserComponent config={card}/>
            <DeleteOutlined className="close" title="删除组件" onClick={() => this.props.deletecomponent(card.uuid)} />
            <SettingComponent config={card} updateConfig={this.updateComponent} />
src/tabviews/custom/components/card/balcony/index.jsx
@@ -2,13 +2,12 @@
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Spin, notification, Checkbox } from 'antd'
import moment from 'moment'
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 TimerTask from '@/utils/timer-task.js'
import './index.scss'
const CardCellComponent = asyncComponent(() => import('../cardcellList'))
@@ -123,12 +122,18 @@
  }
  componentDidMount () {
    const { config } = this.state
    MKEmitter.addListener('reloadData', this.reloadData)
    MKEmitter.addListener('syncBalconyData', this.syncBalconyData)
    MKEmitter.addListener('resetSelectLine', this.resetParentParam)
    MKEmitter.addListener('queryModuleParam', this.queryModuleParam)
    MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult)
    this.handleTimer()
    if (config.timer) {
      this.timer = new TimerTask()
      this.timer.init(config.uuid, config.timer, config.timerRepeats, () => {this.loadData(true)})
    }
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -136,7 +141,6 @@
  }
  componentWillUnmount () {
    clearTimeout(this.timer)
    this.setState = () => {
      return
    }
@@ -145,6 +149,8 @@
    MKEmitter.removeListener('resetSelectLine', this.resetParentParam)
    MKEmitter.removeListener('queryModuleParam', this.queryModuleParam)
    MKEmitter.removeListener('refreshByButtonResult', this.refreshByButtonResult)
    this.timer && this.timer.stop()
  }
  /**
@@ -168,72 +174,6 @@
      this.setState({sync: false, data: _data})
    }
  }
  handleTimer = () => {
    const { config } = this.state
    if (!config.timer) return
    const _change = { '2s': 2000, '5s': 5000, '15s': 15000, '30s': 30000, '1min': 60000, '5min': 300000, '10min': 600000, '15min': 900000, '30min': 1800000, '1hour': 3600000 }
    let timer = _change[config.timer]
    let repeats = config.timerRepeats || 0
    if (!timer) return
    if (repeats > 0 && repeats <=3) {
      this.setState({timer, repeats})
      this.timer = setTimeout(() => {
        this.timerTask(repeats)
      }, 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, repeats})
        this.timer = setTimeout(() => {
          this.timerTask(repeats)
        }, timer)
      }
    })
  }
  timerTask = (times) => {
    const { timer, repeats } = this.state
    if (!timer) return
    this.loadData(true)
    if (repeats) {
      times = times - 1
      if (times <= 0) {
        clearTimeout(this.timer)
        return
      }
    }
    this.timer = setTimeout(() => {
      this.timerTask(times)
    }, timer)
  }
  /**
@@ -370,13 +310,14 @@
      if (config.timer && config.clearField) {
        let vals = (config.clearValue || '').split(',')
        if (vals.includes(_data[config.clearField])) {
          clearTimeout(this.timer)
          this.timer && this.timer.stop()
        }
      }
    } else {
      this.setState({
        loading: false,
        loading: false
      })
      this.timer && this.timer.stop()
      notification.error({
        top: 92,
        message: result.message,
src/tabviews/custom/components/card/cardcellList/index.scss
@@ -155,7 +155,7 @@
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: #e9e9e9;
    background-color: #f5f5f5;
  }
  .ant-mk-picture.scale {
    cursor: zoom-in;
src/tabviews/custom/components/card/data-card/index.jsx
@@ -10,6 +10,7 @@
import preImg from '@/assets/img/prev.png'
import nextImg from '@/assets/img/next.png'
import MKEmitter from '@/utils/events.js'
import TimerTask from '@/utils/timer-task.js'
import asyncComponent from '@/utils/asyncComponent'
import './index.scss'
@@ -195,11 +196,24 @@
  }
  componentDidMount () {
    const { config } = this.state
    MKEmitter.addListener('reloadData', this.reloadData)
    MKEmitter.addListener('mkCheckAll', this.mkCheckAll)
    MKEmitter.addListener('resetSelectLine', this.resetParentParam)
    MKEmitter.addListener('queryModuleParam', this.queryModuleParam)
    MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult)
    if (config.timer) {
      this.timer = new TimerTask()
      this.timer.init(config.uuid, config.timer, config.timerRepeats, () => {
        this.setState({
          pageIndex: 1
        }, () => {
          this.loadData('', 'timer')
        })
      })
    }
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -256,6 +270,8 @@
    MKEmitter.removeListener('resetSelectLine', this.resetParentParam)
    MKEmitter.removeListener('queryModuleParam', this.queryModuleParam)
    MKEmitter.removeListener('refreshByButtonResult', this.refreshByButtonResult)
    this.timer && this.timer.stop()
  }
  /**
@@ -510,9 +526,11 @@
      return
    }
    this.setState({
      loading: true
    })
    if (type !== 'timer') {
      this.setState({
        loading: true
      })
    }
    let _orderBy = config.setting.order || ''
    let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, pageIndex, config.setting.pageSize, BID)
@@ -585,6 +603,7 @@
      this.setState({
        loading: false
      })
      this.timer && this.timer.stop()
      notification.error({
        top: 92,
        message: result.message,
src/tabviews/custom/components/card/prop-card/index.jsx
@@ -2,13 +2,12 @@
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Spin, notification, Col, Row } from 'antd'
import moment from 'moment'
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 TimerTask from '@/utils/timer-task.js'
import './index.scss'
const CardItem = asyncComponent(() => import('../cardItem'))
@@ -28,7 +27,6 @@
    activeKey: '',             // 选中数据
    sync: false,               // 是否统一请求数据
    data: {},                  // 数据
    timer: null,               // 定时器时间间隔
    BData: '',
    selected: 'false',
  }
@@ -137,11 +135,17 @@
  }
  componentDidMount () {
    const { config } = this.state
    MKEmitter.addListener('reloadData', this.reloadData)
    MKEmitter.addListener('resetSelectLine', this.resetParentParam)
    MKEmitter.addListener('queryModuleParam', this.queryModuleParam)
    MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult)
    this.handleTimer()
    if (config.timer) {
      this.timer = new TimerTask()
      this.timer.init(config.uuid, config.timer, config.timerRepeats, () => {this.loadData(true)})
    }
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -149,7 +153,6 @@
  }
  componentWillUnmount () {
    clearTimeout(this.timer)
    this.setState = () => {
      return
    }
@@ -157,6 +160,8 @@
    MKEmitter.removeListener('resetSelectLine', this.resetParentParam)
    MKEmitter.removeListener('queryModuleParam', this.queryModuleParam)
    MKEmitter.removeListener('refreshByButtonResult', this.refreshByButtonResult)
    this.timer && this.timer.stop()
  }
  /**
@@ -208,72 +213,6 @@
    }
    MKEmitter.emit('resetSelectLine', config.uuid, primaryId, data)
  }
  handleTimer = () => {
    const { config } = this.state
    if (!config.timer) return
    const _change = { '2s': 2000, '5s': 5000, '15s': 15000, '30s': 30000, '1min': 60000, '5min': 300000, '10min': 600000, '15min': 900000, '30min': 1800000, '1hour': 3600000 }
    let timer = _change[config.timer]
    let repeats = config.timerRepeats || 0
    if (!timer) return
    if (repeats > 0 && repeats <=3) {
      this.setState({timer, repeats})
      this.timer = setTimeout(() => {
        this.timerTask(repeats)
      }, 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, repeats})
        this.timer = setTimeout(() => {
          this.timerTask(repeats)
        }, timer)
      }
    })
  }
  timerTask = (times) => {
    const { timer, repeats } = this.state
    if (!timer) return
    this.loadData(true)
    if (repeats) {
      times = times - 1
      if (times <= 0) {
        clearTimeout(this.timer)
        return
      }
    }
    this.timer = setTimeout(() => {
      this.timerTask(times)
    }, timer)
  }
  /**
@@ -395,14 +334,14 @@
      if (config.timer && config.clearField) {
        let vals = (config.clearValue || '').split(',')
        if (vals.includes(_data[config.clearField])) {
          clearTimeout(this.timer)
          this.timer && this.timer.stop()
        }
      }
    } else {
      this.setState({
        loading: false,
        timer: null
        loading: false
      })
      this.timer && this.timer.stop()
      notification.error({
        top: 92,
        message: result.message,
src/tabviews/custom/components/card/table-card/index.jsx
@@ -10,6 +10,7 @@
import asyncComponent from '@/utils/asyncComponent'
import UtilsDM from '@/utils/utils-datamanage.js'
import MKEmitter from '@/utils/events.js'
import TimerTask from '@/utils/timer-task.js'
import './index.scss'
const CardCellComponent = asyncComponent(() => import('../cardcellList'))
@@ -122,10 +123,23 @@
  }
  componentDidMount () {
    const { config } = this.state
    MKEmitter.addListener('reloadData', this.reloadData)
    MKEmitter.addListener('resetSelectLine', this.resetParentParam)
    MKEmitter.addListener('queryModuleParam', this.queryModuleParam)
    MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult)
    if (config.timer) {
      this.timer = new TimerTask()
      this.timer.init(config.uuid, config.timer, config.timerRepeats, () => {
        this.setState({
          pageIndex: 1
        }, () => {
          this.loadData('timer')
        })
      })
    }
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -140,6 +154,8 @@
    MKEmitter.removeListener('resetSelectLine', this.resetParentParam)
    MKEmitter.removeListener('queryModuleParam', this.queryModuleParam)
    MKEmitter.removeListener('refreshByButtonResult', this.refreshByButtonResult)
    this.timer && this.timer.stop()
  }
  /**
@@ -266,9 +282,11 @@
      return
    }
    this.setState({
      loading: true
    })
    if (type !== 'timer') {
      this.setState({
        loading: true
      })
    }
    let _orderBy = config.setting.order || ''
    let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, pageIndex, config.setting.pageSize, BID)
@@ -312,6 +330,7 @@
      this.setState({
        loading: false
      })
      this.timer && this.timer.stop()
      notification.error({
        top: 92,
        message: result.message,
src/tabviews/custom/components/carousel/data-card/index.jsx
@@ -7,6 +7,7 @@
import UtilsDM from '@/utils/utils-datamanage.js'
import MKEmitter from '@/utils/events.js'
import asyncComponent from '@/utils/asyncComponent'
import TimerTask from '@/utils/timer-task.js'
import './index.scss'
const CardItem = asyncComponent(() => import('../cardItem'))
@@ -106,9 +107,18 @@
  }
  componentDidMount () {
    const { config } = this.state
    MKEmitter.addListener('resetSelectLine', this.resetParentParam)
    MKEmitter.addListener('queryModuleParam', this.queryModuleParam)
    MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult)
    if (config.timer) {
      this.timer = new TimerTask()
      this.timer.init(config.uuid, config.timer, config.timerRepeats, () => {
        this.loadData('timer')
      })
    }
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -148,6 +158,8 @@
    MKEmitter.removeListener('resetSelectLine', this.resetParentParam)
    MKEmitter.removeListener('queryModuleParam', this.queryModuleParam)
    MKEmitter.removeListener('refreshByButtonResult', this.refreshByButtonResult)
    this.timer && this.timer.stop()
  }
  /**
@@ -202,7 +214,7 @@
    })
  }
  async loadData () {
  async loadData (type) {
    const { mainSearch } = this.props
    const { config, arr_field, BID, BData } = this.state
@@ -220,9 +232,11 @@
      return
    }
    this.setState({
      loading: true
    })
    if (type !== 'timer') {
      this.setState({
        loading: true
      })
    }
    let _orderBy = config.setting.order || ''
    let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, '', '', BID)
@@ -244,6 +258,7 @@
      this.setState({
        loading: false
      })
      this.timer && this.timer.stop()
      notification.error({
        top: 92,
        message: result.message,
src/tabviews/custom/components/carousel/prop-card/index.jsx
@@ -7,6 +7,7 @@
import Api from '@/api'
import UtilsDM from '@/utils/utils-datamanage.js'
import MKEmitter from '@/utils/events.js'
import TimerTask from '@/utils/timer-task.js'
import './index.scss'
const CardItem = asyncComponent(() => import('../cardItem'))
@@ -105,10 +106,19 @@
  }
  componentDidMount () {
    const { config } = this.state
    MKEmitter.addListener('reloadData', this.reloadData)
    MKEmitter.addListener('resetSelectLine', this.resetParentParam)
    MKEmitter.addListener('queryModuleParam', this.queryModuleParam)
    MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult)
    if (config.timer) {
      this.timer = new TimerTask()
      this.timer.init(config.uuid, config.timer, config.timerRepeats, () => {
        this.loadData('timer')
      })
    }
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -123,6 +133,8 @@
    MKEmitter.removeListener('resetSelectLine', this.resetParentParam)
    MKEmitter.removeListener('queryModuleParam', this.queryModuleParam)
    MKEmitter.removeListener('refreshByButtonResult', this.refreshByButtonResult)
    this.timer && this.timer.stop()
  }
  /**
@@ -211,7 +223,7 @@
    this.loadData()
  }
  async loadData () {
  async loadData (type) {
    const { mainSearch } = this.props
    const { config, arr_field, BID, BData } = this.state
@@ -234,9 +246,11 @@
      return
    }
    this.setState({
      loading: true
    })
    if (type !== 'timer') {
      this.setState({
        loading: true
      })
    }
    let _orderBy = config.setting.order || ''
    let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, 1, 1, BID)
@@ -262,6 +276,7 @@
      this.setState({
        loading: false
      })
      this.timer && this.timer.stop()
      notification.error({
        top: 92,
        message: result.message,
src/tabviews/custom/components/chart/antv-bar-line/index.jsx
@@ -13,6 +13,7 @@
import Utils from '@/utils/utils.js'
import UtilsDM from '@/utils/utils-datamanage.js'
import MKEmitter from '@/utils/events.js'
import TimerTask from '@/utils/timer-task.js'
import NormalHeader from '@/tabviews/custom/components/share/normalheader'
import './index.scss'
@@ -375,18 +376,25 @@
  }
  componentDidMount () {
    const { config } = this.state
    MKEmitter.addListener('reloadData', this.reloadData)
    MKEmitter.addListener('resetSelectLine', this.resetParentParam)
    MKEmitter.addListener('queryModuleParam', this.queryModuleParam)
    MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult)
    this.handleTimer()
    if (config.timer) {
      this.timer = new TimerTask()
      this.timer.init(config.uuid, config.timer, config.timerRepeats, () => {
        this.loadData(true)
      })
    }
  }
  /**
   * @description 组件销毁,清除state更新,清除快捷键设置
   */
  componentWillUnmount () {
    clearTimeout(this.timer)
    this.setState = () => {
      return
    }
@@ -394,72 +402,8 @@
    MKEmitter.removeListener('resetSelectLine', this.resetParentParam)
    MKEmitter.removeListener('queryModuleParam', this.queryModuleParam)
    MKEmitter.removeListener('refreshByButtonResult', this.refreshByButtonResult)
  }
  handleTimer = () => {
    const { config } = this.state
    if (!config.timer) return
    const _change = { '2s': 2000, '5s': 5000, '15s': 15000, '30s': 30000, '1min': 60000, '5min': 300000, '10min': 600000, '15min': 900000, '30min': 1800000, '1hour': 3600000 }
    let timer = _change[config.timer]
    let repeats = config.timerRepeats || 0
    if (!timer) return
    if (repeats > 0 && repeats <=3) {
      this.setState({timer, repeats})
      this.timer = setTimeout(() => {
        this.timerTask(repeats)
      }, 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, repeats})
        this.timer = setTimeout(() => {
          this.timerTask(repeats)
        }, timer)
      }
    })
  }
  timerTask = (times) => {
    const { timer, repeats } = this.state
    if (!timer) return
    this.loadData(true)
    if (repeats) {
      times = times - 1
      if (times <= 0) {
        clearTimeout(this.timer)
        return
      }
    }
    this.timer = setTimeout(() => {
      this.timerTask(times)
    }, timer)
    this.timer && this.timer.stop()
  }
  /**
@@ -587,9 +531,9 @@
      })
    } else {
      this.setState({
        loading: false,
        timer: null
        loading: false
      })
      this.timer && this.timer.stop()
      notification.error({
        top: 92,
        message: result.message,
src/tabviews/custom/components/chart/antv-dashboard/index.jsx
@@ -10,6 +10,7 @@
import Utils from '@/utils/utils.js'
import UtilsDM from '@/utils/utils-datamanage.js'
import MKEmitter from '@/utils/events.js'
import TimerTask from '@/utils/timer-task.js'
import NormalHeader from '@/tabviews/custom/components/share/normalheader'
import './index.scss'
@@ -166,87 +167,30 @@
  }
  componentDidMount () {
    const { config } = this.state
    MKEmitter.addListener('reloadData', this.reloadData)
    MKEmitter.addListener('resetSelectLine', this.resetParentParam)
    this.handleTimer()
    if (config.timer) {
      this.timer = new TimerTask()
      this.timer.init(config.uuid, config.timer, config.timerRepeats, () => {
        this.loadData(true)
      })
    }
  }
  /**
   * @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 = { '2s': 2000, '5s': 5000, '15s': 15000, '30s': 30000, '1min': 60000, '5min': 300000, '10min': 600000, '15min': 900000, '30min': 1800000, '1hour': 3600000 }
    let timer = _change[config.timer]
    let repeats = config.timerRepeats || 0
    if (!timer) return
    if (repeats > 0 && repeats <=3) {
      this.setState({timer, repeats})
      this.timer = setTimeout(() => {
        this.timerTask(repeats)
      }, 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, repeats})
        this.timer = setTimeout(() => {
          this.timerTask(repeats)
        }, timer)
      }
    })
  }
  timerTask = (times) => {
    const { timer, repeats } = this.state
    if (!timer) return
    this.loadData(true)
    if (repeats) {
      times = times - 1
      if (times <= 0) {
        clearTimeout(this.timer)
        return
      }
    }
    this.timer = setTimeout(() => {
      this.timerTask(times)
    }, timer)
    this.timer && this.timer.stop()
  }
  reloadData = (menuId) => {
@@ -331,9 +275,9 @@
      })
    } else {
      this.setState({
        loading: false,
        timer: null
        loading: false
      })
      this.timer && this.timer.stop()
      notification.error({
        top: 92,
        message: result.message,
src/tabviews/custom/components/chart/antv-pie/index.jsx
@@ -13,6 +13,7 @@
import { chartColors } from '@/utils/option.js'
import UtilsDM from '@/utils/utils-datamanage.js'
import MKEmitter from '@/utils/events.js'
import TimerTask from '@/utils/timer-task.js'
import NormalHeader from '@/tabviews/custom/components/share/normalheader'
import './index.scss'
@@ -122,87 +123,30 @@
  }
  componentDidMount () {
    const { config } = this.state
    MKEmitter.addListener('reloadData', this.reloadData)
    MKEmitter.addListener('resetSelectLine', this.resetParentParam)
    this.handleTimer()
    if (config.timer) {
      this.timer = new TimerTask()
      this.timer.init(config.uuid, config.timer, config.timerRepeats, () => {
        this.loadData(true)
      })
    }
  }
  /**
   * @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 = { '2s': 2000, '5s': 5000, '15s': 15000, '30s': 30000, '1min': 60000, '5min': 300000, '10min': 600000, '15min': 900000, '30min': 1800000, '1hour': 3600000 }
    let timer = _change[config.timer]
    let repeats = config.timerRepeats || 0
    if (!timer) return
    if (repeats > 0 && repeats <=3) {
      this.setState({timer, repeats})
      this.timer = setTimeout(() => {
        this.timerTask(repeats)
      }, 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, repeats})
        this.timer = setTimeout(() => {
          this.timerTask(repeats)
        }, timer)
      }
    })
  }
  timerTask = (times) => {
    const { timer, repeats } = this.state
    if (!timer) return
    this.loadData(true)
    if (repeats) {
      times = times - 1
      if (times <= 0) {
        clearTimeout(this.timer)
        return
      }
    }
    this.timer = setTimeout(() => {
      this.timerTask(times)
    }, timer)
    this.timer && this.timer.stop()
  }
  reloadData = (menuId) => {
@@ -293,9 +237,9 @@
      })
    } else {
      this.setState({
        loading: false,
        timer: null
        loading: false
      })
      this.timer && this.timer.stop()
      notification.error({
        top: 92,
        message: result.message,
src/tabviews/custom/components/chart/antv-scatter/index.jsx
@@ -11,6 +11,7 @@
import asyncBtnComponent from './asyncButtonComponent'
import UtilsDM from '@/utils/utils-datamanage.js'
import MKEmitter from '@/utils/events.js'
import TimerTask from '@/utils/timer-task.js'
import NormalHeader from '@/tabviews/custom/components/share/normalheader'
import './index.scss'
@@ -112,18 +113,25 @@
  }
  componentDidMount () {
    const { config } = this.state
    MKEmitter.addListener('reloadData', this.reloadData)
    MKEmitter.addListener('resetSelectLine', this.resetParentParam)
    MKEmitter.addListener('queryModuleParam', this.queryModuleParam)
    MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult)
    this.handleTimer()
    if (config.timer) {
      this.timer = new TimerTask()
      this.timer.init(config.uuid, config.timer, config.timerRepeats, () => {
        this.loadData(true)
      })
    }
  }
  /**
   * @description 组件销毁,清除state更新,清除快捷键设置
   */
  componentWillUnmount () {
    clearTimeout(this.timer)
    this.setState = () => {
      return
    }
@@ -131,72 +139,8 @@
    MKEmitter.removeListener('resetSelectLine', this.resetParentParam)
    MKEmitter.removeListener('queryModuleParam', this.queryModuleParam)
    MKEmitter.removeListener('refreshByButtonResult', this.refreshByButtonResult)
  }
  handleTimer = () => {
    const { config } = this.state
    if (!config.timer) return
    const _change = { '2s': 2000, '5s': 5000, '15s': 15000, '30s': 30000, '1min': 60000, '5min': 300000, '10min': 600000, '15min': 900000, '30min': 1800000, '1hour': 3600000 }
    let timer = _change[config.timer]
    let repeats = config.timerRepeats || 0
    if (!timer) return
    if (repeats > 0 && repeats <=3) {
      this.setState({timer, repeats})
      this.timer = setTimeout(() => {
        this.timerTask(repeats)
      }, 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, repeats})
        this.timer = setTimeout(() => {
          this.timerTask(repeats)
        }, timer)
      }
    })
  }
  timerTask = (times) => {
    const { timer, repeats } = this.state
    if (!timer) return
    this.loadData(true)
    if (repeats) {
      times = times - 1
      if (times <= 0) {
        clearTimeout(this.timer)
        return
      }
    }
    this.timer = setTimeout(() => {
      this.timerTask(times)
    }, timer)
    this.timer && this.timer.stop()
  }
  /**
@@ -326,9 +270,9 @@
      })
    } else {
      this.setState({
        loading: false,
        timer: null
        loading: false
      })
      this.timer && this.timer.stop()
      notification.error({
        top: 92,
        message: result.message,
src/tabviews/custom/components/chart/custom-chart/index.jsx
@@ -5,12 +5,12 @@
import DataSet from '@antv/data-set'
import * as echarts from 'echarts'
import { Spin, Empty, notification } from 'antd'
import moment from 'moment'
import Api from '@/api'
import Utils from '@/utils/utils.js'
import UtilsDM from '@/utils/utils-datamanage.js'
import MKEmitter from '@/utils/events.js'
import TimerTask from '@/utils/timer-task.js'
import NormalHeader from '@/tabviews/custom/components/share/normalheader'
import './index.scss'
@@ -107,18 +107,25 @@
  }
  componentDidMount () {
    const { config } = this.state
    MKEmitter.addListener('reloadData', this.reloadData)
    MKEmitter.addListener('resetSelectLine', this.resetParentParam)
    MKEmitter.addListener('queryModuleParam', this.queryModuleParam)
    MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult)
    this.handleTimer()
    if (config.timer) {
      this.timer = new TimerTask()
      this.timer.init(config.uuid, config.timer, config.timerRepeats, () => {
        this.loadData(true)
      })
    }
  }
  /**
   * @description 组件销毁,清除state更新,清除快捷键设置
   */
  componentWillUnmount () {
    clearTimeout(this.timer)
    this.setState = () => {
      return
    }
@@ -126,72 +133,8 @@
    MKEmitter.removeListener('resetSelectLine', this.resetParentParam)
    MKEmitter.removeListener('queryModuleParam', this.queryModuleParam)
    MKEmitter.removeListener('refreshByButtonResult', this.refreshByButtonResult)
  }
  handleTimer = () => {
    const { config } = this.state
    if (!config.timer) return
    const _change = { '2s': 2000, '5s': 5000, '15s': 15000, '30s': 30000, '1min': 60000, '5min': 300000, '10min': 600000, '15min': 900000, '30min': 1800000, '1hour': 3600000 }
    let timer = _change[config.timer]
    let repeats = config.timerRepeats || 0
    if (!timer) return
    if (repeats > 0 && repeats <=3) {
      this.setState({timer, repeats})
      this.timer = setTimeout(() => {
        this.timerTask(repeats)
      }, 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, repeats})
        this.timer = setTimeout(() => {
          this.timerTask(repeats)
        }, timer)
      }
    })
  }
  timerTask = (times) => {
    const { timer, repeats } = this.state
    if (!timer) return
    this.loadData(true)
    if (repeats) {
      times = times - 1
      if (times <= 0) {
        clearTimeout(this.timer)
        return
      }
    }
    this.timer = setTimeout(() => {
      this.timerTask(times)
    }, timer)
    this.timer && this.timer.stop()
  }
  /**
@@ -320,9 +263,9 @@
      })
    } else {
      this.setState({
        loading: false,
        timer: null
        loading: false
      })
      this.timer && this.timer.stop()
      notification.error({
        top: 92,
        message: result.message,
src/tabviews/custom/components/share/normalTable/index.scss
@@ -100,7 +100,8 @@
          position: relative;
          background-position: center center;
          background-size: cover;
          background-color: #e9e9e9;
          background-repeat: no-repeat;
          background-color: #f5f5f5;
          margin: 2px;
        }
        .ant-mk-picture.scale {
src/tabviews/custom/components/table/edit-table/normalTable/index.scss
@@ -78,7 +78,8 @@
          position: relative;
          background-position: center center;
          background-size: cover;
          background-color: #e9e9e9;
          background-repeat: no-repeat;
          background-color: #f5f5f5;
          margin: 2px;
        }
        .ant-mk-picture.scale {
src/tabviews/custom/components/table/normal-table/index.jsx
@@ -8,6 +8,7 @@
import UtilsDM from '@/utils/utils-datamanage.js'
import asyncComponent from '@/utils/asyncComponent'
import MKEmitter from '@/utils/events.js'
import TimerTask from '@/utils/timer-task.js'
import './index.scss'
// 通用组件
@@ -180,7 +181,7 @@
   * @param { Boolean } reset  表格是否重置
   * @param { String }  repage 表格是否重置页码
   */
  async loadmaindata (reset, repage, id) {
  async loadmaindata (reset, repage, id, type) {
    const { mainSearch } = this.props
    const { setting, config, arr_field, search, orderBy, BID, pageIndex, pageSize, BData } = this.state
@@ -214,9 +215,11 @@
      return
    }
    this.setState({
      loading: true
    })
    if (type !== 'timer') {
      this.setState({
        loading: true
      })
    }
    let _orderBy = orderBy || setting.order
    let param = UtilsDM.getQueryDataParams(setting, arr_field, searches, _orderBy, pageIndex, pageSize, BID)
@@ -269,6 +272,7 @@
      this.setState({
        loading: false
      })
      this.timer && this.timer.stop()
      notification.error({
        top: 92,
        message: result.message,
@@ -612,10 +616,24 @@
  }
  componentDidMount () {
    const { config } = this.state
    MKEmitter.addListener('reloadData', this.reloadData)
    MKEmitter.addListener('resetSelectLine', this.resetParentParam)
    MKEmitter.addListener('queryModuleParam', this.queryModuleParam)
    MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult)
    if (config.timer) {
      this.timer = new TimerTask()
      this.timer.init(config.uuid, config.timer, config.timerRepeats, () => {
        this.setState({
          pageIndex: 1
        }, () => {
          this.loadmaindata(true, 'true', '', 'timer')
          this.getStatFieldsValue()
        })
      })
    }
  }
  /**
@@ -629,6 +647,8 @@
    MKEmitter.removeListener('resetSelectLine', this.resetParentParam)
    MKEmitter.removeListener('queryModuleParam', this.queryModuleParam)
    MKEmitter.removeListener('refreshByButtonResult', this.refreshByButtonResult)
    this.timer && this.timer.stop()
  }
  render() {
src/tabviews/custom/components/timeline/normal-timeline/index.jsx
@@ -8,6 +8,7 @@
import asyncComponent from '@/utils/asyncComponent'
import UtilsDM from '@/utils/utils-datamanage.js'
import MKEmitter from '@/utils/events.js'
import TimerTask from '@/utils/timer-task.js'
import './index.scss'
const CardCellComponent = asyncComponent(() => import('@/tabviews/custom/components/card/cardcellList'))
@@ -109,10 +110,19 @@
  }
  componentDidMount () {
    const { config } = this.state
    MKEmitter.addListener('reloadData', this.reloadData)
    MKEmitter.addListener('resetSelectLine', this.resetParentParam)
    MKEmitter.addListener('queryModuleParam', this.queryModuleParam)
    MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult)
    if (config.timer) {
      this.timer = new TimerTask()
      this.timer.init(config.uuid, config.timer, config.timerRepeats, () => {
        this.loadData(true)
      })
    }
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -127,6 +137,8 @@
    MKEmitter.removeListener('resetSelectLine', this.resetParentParam)
    MKEmitter.removeListener('queryModuleParam', this.queryModuleParam)
    MKEmitter.removeListener('refreshByButtonResult', this.refreshByButtonResult)
    this.timer && this.timer.stop()
  }
  /**
@@ -226,7 +238,7 @@
    })
  }
  async loadData () {
  async loadData (hastimer) {
    const { mainSearch } = this.props
    const { config, arr_field, BID, BData } = this.state
    
@@ -257,9 +269,11 @@
      return
    }
    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, config.setting.pageSize, BID)
@@ -281,6 +295,7 @@
      this.setState({
        loading: false
      })
      this.timer && this.timer.stop()
      notification.error({
        top: 92,
        message: result.message,
src/tabviews/custom/components/tree/antd-tree/index.jsx
@@ -3,12 +3,11 @@
import { is, fromJS } from 'immutable'
import { Spin, Empty, notification, Input, Tree } from 'antd'
import { FolderOpenOutlined, FolderOutlined, FileOutlined } from '@ant-design/icons'
import moment from 'moment'
import Api from '@/api'
import Utils from '@/utils/utils.js'
import UtilsDM from '@/utils/utils-datamanage.js'
import MKEmitter from '@/utils/events.js'
import TimerTask from '@/utils/timer-task.js'
import './index.scss'
const { TreeNode } = Tree
@@ -73,7 +72,7 @@
    }, () => {
      if (config.setting.sync !== 'true' && config.setting.onload === 'true') {
        setTimeout(() => {
          this.loadData(null)
          this.loadData()
        }, config.setting.delay || 0)
      } else if (config.setting.sync === 'true' && _data) {
        this.handleData()
@@ -108,87 +107,30 @@
  }
  componentDidMount () {
    const { config } = this.state
    MKEmitter.addListener('reloadData', this.reloadData)
    MKEmitter.addListener('resetSelectLine', this.resetParentParam)
    this.handleTimer()
    if (config.timer) {
      this.timer = new TimerTask()
      this.timer.init(config.uuid, config.timer, config.timerRepeats, () => {
        this.loadData(true)
      })
    }
  }
  /**
   * @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 = { '2s': 2000, '5s': 5000, '15s': 15000, '30s': 30000, '1min': 60000, '5min': 300000, '10min': 600000, '15min': 900000, '30min': 1800000, '1hour': 3600000 }
    let timer = _change[config.timer]
    let repeats = config.timerRepeats || 0
    if (!timer) return
    if (repeats > 0 && repeats <=3) {
      this.setState({timer, repeats})
      this.timer = setTimeout(() => {
        this.timerTask(repeats)
      }, 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, repeats})
        this.timer = setTimeout(() => {
          this.timerTask(repeats)
        }, timer)
      }
    })
  }
  timerTask = (times) => {
    const { timer, repeats } = this.state
    if (!timer) return
    this.loadData(true)
    if (repeats) {
      times = times - 1
      if (times <= 0) {
        clearTimeout(this.timer)
        return
      }
    }
    this.timer = setTimeout(() => {
      this.timerTask(times)
    }, timer)
    this.timer && this.timer.stop()
  }
  reloadData = (menuId) => {
@@ -252,9 +194,9 @@
      })
    } else {
      this.setState({
        loading: false,
        timer: null
        loading: false
      })
      this.timer && this.timer.stop()
      notification.error({
        top: 92,
        message: result.message,
src/tabviews/zshare/normalTable/index.scss
@@ -175,9 +175,10 @@
            padding: 5px;
          }
          .mk-picture {
            background-color: #e9e9e9;
            background-color: #f5f5f5;
            background-position: center center;
            background-size: cover;
            background-repeat: no-repeat;
          }
          .image-scale {
            cursor: zoom-in;
src/utils/timer-task.js
New file
@@ -0,0 +1,71 @@
import { notification } from 'antd'
import moment from 'moment'
import Api from '@/api'
import Utils from '@/utils/utils.js'
export default class timerTask {
  constructor() {
    this.timer = null
    this.interval = null
    this.repeats = 0
  }
  init(uuid, interval, repeats, callback) {
    const _change = { '2s': 2000, '5s': 5000, '15s': 15000, '30s': 30000, '1min': 60000, '5min': 300000, '10min': 600000, '15min': 900000, '30min': 1800000, '1hour': 3600000 }
    this.interval = _change[interval]
    this.repeats = repeats || 0
    if (!this.interval) return
    if (this.repeats > 0 && this.repeats <=3) {
      this.timer = setTimeout(() => {
        this.timerTask(this.repeats, callback)
      }, this.interval)
    } else {
      let _param = {
        func: 's_get_timers_role',
        LText: `select '${window.GLOB.appkey || ''}','${uuid}'`,
        timer_type: interval,
        component_id: 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
          })
        } else if (result.run_type) {
          this.timer = setTimeout(() => {
            this.timerTask(this.repeats, callback)
          }, this.interval)
        }
      })
    }
  }
  timerTask(times, callback) {
    callback()
    if (this.repeats) {
      times = times - 1
      if (times <= 0) {
        clearTimeout(this.timer)
        return
      }
    }
    this.timer = setTimeout(() => {
      this.timerTask(times, callback)
    }, this.interval)
  }
  stop() {
    clearTimeout(this.timer)
  }
}