king
2022-11-01 8dd9031104d69f42b16e442fb4fd44dd0109609a
2022-11-01
4个文件已修改
97 ■■■■■ 已修改文件
src/api/index.js 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/querylog/index.jsx 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils-datamanage.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/main/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js
@@ -527,11 +527,6 @@
  deleteMenuStorage (menuId) {
    if (window.GLOB.IndexDB) {
      let key = menuId + (sessionStorage.getItem('UserID') || '')
      if (sessionStorage.getItem('isEditState') === 'true' && options.cloudServiceApi) {
        key = menuId + (sessionStorage.getItem('CloudUserID') || '')
      }
      return CacheUtils.delMenuIndexDBConfig(key)
    } else {
      return CacheUtils.delMenuWebSqlConfig(menuId)
@@ -831,7 +826,7 @@
    param.LoginUID = param.LoginUID || sessionStorage.getItem('LoginUID') || ''
    param.appkey = window.GLOB.appkey || ''
    if (['sPC_Get_TableData', 'sPC_Get_TableData_debug', 'sPC_TableData_InUpDe', 'sPC_TableData_InUpDe_debug'].includes(param.func)) {
    if (['sPC_Get_TableData', 'sPC_Get_TableData_debug', 'sPC_TableData_InUpDe', 'sPC_TableData_InUpDe_debug', 'sPC_Get_structured_data'].includes(param.func)) {
      if (sessionStorage.getItem('isEditState') === 'true') {
        param.username = sessionStorage.getItem('CloudUserName') || ''
        param.fullname = sessionStorage.getItem('CloudFullName') || ''
src/components/querylog/index.jsx
@@ -1,4 +1,5 @@
import { Component } from 'react'
import { notification } from 'antd'
import moment from 'moment'
import Api from '@/api'
@@ -6,7 +7,7 @@
import MKEmitter from '@/utils/events.js'
/**
 * @description 操作记录,每隔六分钟更新一次
 * @description 操作记录,每隔10分钟更新一次
 */
class QueryLog extends Component {
  state = {
@@ -14,12 +15,10 @@
  }
  componentDidMount () {
    if (window.GLOB.systemType === 'production') {
      MKEmitter.addListener('queryTrigger', this.queryTrigger)
      setTimeout(() => {
        this.sendLog()
      }, 300000)
    }
    MKEmitter.addListener('queryTrigger', this.queryTrigger)
    setTimeout(() => {
      this.sendLog()
    }, 600000)
  }
  /**
@@ -35,40 +34,66 @@
  sendLog = () => {
    const { logs } = this.state
    if (logs && logs.length > 0 && sessionStorage.getItem('isEditState') !== 'true') {
      let logMap = new Map()
    let logMap = new Map()
      logs.forEach(item => {
        if (logMap.has(item.menuId)) {
          let _item = logMap.get(item.menuId)
          _item.times++
          logMap.set(item.menuId, _item)
        } else {
          item.times = 1
          logMap.set(item.menuId, item)
        }
      })
      let userid = sessionStorage.getItem('UserID') || ''
      let LText = [...logMap.values()].map(item => `select '${item.menuId}','${item.times}','${item.name}','${window.GLOB.appkey}','${userid}'`)
    logs.forEach(item => {
      if (logMap.has(item.menuId)) {
        let _item = logMap.get(item.menuId)
        _item.times++
        logMap.set(item.menuId, _item)
      } else {
        item.times = 1
        logMap.set(item.menuId, item)
      }
    })
    let userid = sessionStorage.getItem('UserID') || ''
    let LText = [...logMap.values()].map(item => `select '${item.menuId}','${item.times}','${item.name}','${window.GLOB.appkey}','${userid}'`)
    Api.genericInterface({func: 's_get_local_users_operation_log'}).then(res => {
      if (!res.status) {
        notification.warning({
          top: 92,
          message: res.message,
          duration: 3
        })
        return
      }
      if (LText.length === 0 && !res.long_param) {
        setTimeout(() => {
          this.sendLog()
        }, 600000)
        return
      }
      let param = {
        func: 's_get_users_operation_log',
        exec_type: 'y', // 后台解码
        LText: LText.join(' union all ')
        exec_type: 'y',
        LText: LText.join(' union all '),
        long_param: res.long_param
      }
      param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      param.secretkey = Utils.encrypt('', param.timestamp)
      param.LText = Utils.formatOptions(param.LText)
      Api.getSystemConfig(param)
      Api.getSystemConfig(param).then(result => {
        if (!result.status) {
          notification.warning({
            top: 92,
            message: result.message,
            duration: 3
          })
          return
        }
      this.setState({logs: []})
    }
    setTimeout(() => {
      this.sendLog()
    }, 300000)
        setTimeout(() => {
          this.sendLog()
        }, 600000)
        this.setState({logs: []})
      })
    })
  }
  queryTrigger = (item) => {
src/utils/utils-datamanage.js
@@ -859,6 +859,9 @@
    BID: BID
  }
  if (config.MenuName) {
    param.menuname = config.MenuName
  }
  // if (transaction) {
  //   param.func = 'sPC_Get_structured_data_try'
  // }
src/views/main/index.jsx
@@ -61,7 +61,7 @@
          {isSideMenu && navBar !== 'menu_board_navigation' ? <Sidemenu key="sidemenu"/> : null}
          {isSideMenu ? <Tabview key="tabview"/> : null}
          {!isSideMenu ? <Breadview key="breadview"/> : null}
          <QueryLog />
          {window.GLOB.systemType === 'production' ? <QueryLog /> : null}
        </ConfigProvider>
        <ImgScale />
      </div>