king
2021-01-19 1af91a055d0de9b2ac3fc94ad68bb7670939410c
2021-01-19
9个文件已修改
1个文件已添加
161 ■■■■ 已修改文件
src/components/querylog/index.jsx 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/sidemenu/index.jsx 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/excelInbutton/index.jsx 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/exceloutbutton/index.jsx 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/newpagebutton/index.jsx 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/popupbutton/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/printbutton/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/tabbutton/index.jsx 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/main/index.jsx 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/querylog/index.jsx
New file
@@ -0,0 +1,80 @@
import { Component } from 'react'
import moment from 'moment'
import Api from '@/api'
import Utils from '@/utils/utils.js'
import MKEmitter from '@/utils/events.js'
class QueryLog extends Component {
  state = {
    logs: []
  }
  componentDidMount () {
    if (window.GLOB.systemType === 'production') {
      MKEmitter.addListener('queryTrigger', this.queryTrigger)
      setTimeout(() => {
        this.sendLog()
      }, 300000)
    }
  }
  /**
   * @description 组件销毁,清除state更新
   */
  componentWillUnmount () {
    this.setState = () => {
      return
    }
    MKEmitter.removeListener('queryTrigger', this.queryTrigger)
  }
  sendLog = () => {
    const { logs } = this.state
    if (logs && logs.length > 0 && sessionStorage.getItem('isEditState') !== 'true') {
      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}'`)
      let param = {
        func: 's_get_users_operation_log',
        exec_type: 'y', // 后台解码
        LText: LText.join(' union all ')
      }
      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)
      this.setState({logs: []})
    }
    setTimeout(() => {
      this.sendLog()
    }, 300000)
  }
  queryTrigger = (item) => {
    this.setState({logs: [...this.state.logs, item]})
  }
  render () {
    return null
  }
}
export default QueryLog
src/components/sidemenu/index.jsx
@@ -9,6 +9,7 @@
import { modifyTabview, resetEditLevel, modifyMenuTree, modifyMainMenu } from '@/store/action'
import { SySMenuList } from './config'
import options from '@/store/options.js'
import MKEmitter from '@/utils/events.js'
import zhCN from '@/locales/zh-CN/main.js'
import enUS from '@/locales/en-US/main.js'
import Api from '@/api'
@@ -83,21 +84,16 @@
    })
  }
  changemenu(e) {
  changemenu(menu) {
    if (this.props.editState && this.props.editLevel !== 'HS') {
      e.preventDefault()
      return
    }
    let menu = JSON.parse(e.target.dataset.item)
    if (menu.OpenType === 'newpage' || menu.OpenType === 'NewPage') {
      e.preventDefault()
      window.open(menu.src)
    } else if (menu.OpenType === 'blank') {
      menu.selected = true
      this.props.modifyTabview([menu])
      e.preventDefault()
    } else {
      let tabs = fromJS(this.props.tabviews).toJS()
      tabs = tabs.filter(tab => {
@@ -114,8 +110,10 @@
        tabs.push(menu)
        this.props.modifyTabview(tabs)
      })
      e.preventDefault()
    }
    if (window.GLOB.systemType === 'production') {
      MKEmitter.emit('queryTrigger', {menuId: menu.MenuID, name: '菜单'})
    }
  }
@@ -306,7 +304,7 @@
                {item.children.map(cell => {
                  return (
                    <Menu.Item key={cell.MenuID}>
                      <a href={cell.src} id={cell.MenuID} data-item={JSON.stringify(cell)} onClick={this.changemenu.bind(this)}>{cell.MenuName}</a>
                      <a href={cell.src} id={cell.MenuID} onClick={() => this.changemenu(cell)}>{cell.MenuName}</a>
                    </Menu.Item>
                  )
                })}
src/tabviews/zshare/actionList/excelInbutton/index.jsx
@@ -93,25 +93,28 @@
        duration: 5
      })
      return
    }
    if (btn.verify && btn.verify.sheet && btn.verify.columns && btn.verify.columns.length > 0) {
      let primaryId = '' // 导入时行Id
      if (btn.Ot === 'requiredSgl') {
        primaryId = data[0][setting.primaryKey] || ''
      }
      this.setState({
        primaryId: primaryId
      }, () => {
        this.refs.excelIn.exceltrigger()
      })
    } else {
    } else if (!btn.verify || !btn.verify.sheet || !btn.verify.columns || btn.verify.columns.length === 0) {
      notification.warning({
        top: 92,
        message: 'excel导入验证信息未设置!',
        duration: 5
      })
      return
    }
    let primaryId = '' // 导入时行Id
    if (btn.Ot === 'requiredSgl') {
      primaryId = data[0][setting.primaryKey] || ''
    }
    this.setState({
      primaryId: primaryId
    }, () => {
      this.refs.excelIn.exceltrigger()
    })
    if (window.GLOB.systemType === 'production') {
      MKEmitter.emit('queryTrigger', {menuId: btn.uuid, name: '导入Excel'})
    }
  }
src/tabviews/zshare/actionList/exceloutbutton/index.jsx
@@ -111,6 +111,9 @@
    }
    MKEmitter.emit('getexceloutparam', btn.$menuId, btn.uuid)
    if (window.GLOB.systemType === 'production') {
      MKEmitter.emit('queryTrigger', {menuId: btn.uuid, name: '导出Excel'})
    }
  }
  /**
src/tabviews/zshare/actionList/newpagebutton/index.jsx
@@ -97,7 +97,10 @@
      Remark = data[0].Remark || ''
    }
    let _name = '新页面'
    if (btn.pageTemplate === 'billprint') {
      _name = '单据打印'
      if (btn.Ot === 'required' && data && data.length > 0) {
        data.forEach((item, i) => {
          let _id = item[setting.primaryKey] || ''
@@ -118,6 +121,7 @@
    } else if (btn.pageTemplate === 'pay') {
      let _p = `ID=${Id}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID')}&logo=${window.GLOB.doclogo}&name=${sessionStorage.getItem('Full_Name')}&icp=${window.GLOB.ICP}&copyRight=${window.GLOB.copyRight}`
      let url = '#/pay/' +  window.btoa(window.encodeURIComponent(_p))
      _name = '支付'
      
      confirm({
        title: '请在付款页面完成订单支付。',
@@ -152,6 +156,10 @@
      window.open(url)
    }
    if (window.GLOB.systemType === 'production') {
      MKEmitter.emit('queryTrigger', {menuId: btn.uuid, name: _name})
    }
  }
  render() {
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -184,6 +184,15 @@
        this.improveAction()
      })
    }
    if (window.GLOB.systemType === 'production') {
      let _change = {
        prompt: '提示框',
        exec: '直接执行',
        pop: '弹窗(表单)'
      }
      MKEmitter.emit('queryTrigger', {menuId: btn.uuid, name: _change[btn.OpenType]})
    }
  }
  /**
src/tabviews/zshare/actionList/popupbutton/index.jsx
@@ -144,6 +144,10 @@
      primaryId: primaryId,
      visible: true
    })
    if (window.GLOB.systemType === 'production') {
      MKEmitter.emit('queryTrigger', {menuId: btn.uuid, name: '弹窗(标签)'})
    }
  }
  /**
src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -160,6 +160,10 @@
    } else {
      this.triggerPrint(data)
    }
    if (window.GLOB.systemType === 'production') {
      MKEmitter.emit('queryTrigger', {menuId: btn.uuid, name: '标签打印'})
    }
  }
  /**
src/tabviews/zshare/actionList/tabbutton/index.jsx
@@ -148,6 +148,9 @@
    })
    MKEmitter.emit('openNewTab')
    if (window.GLOB.systemType === 'production') {
      MKEmitter.emit('queryTrigger', {menuId: btn.uuid, name: '标签页'})
    }
  }
  render() {
src/views/main/index.jsx
@@ -2,9 +2,11 @@
import { ConfigProvider } from 'antd'
import enUS from 'antd/es/locale/en_US'
import zhCN from 'antd/es/locale/zh_CN'
import Header from '@/components/header'
import Sidemenu from '@/components/sidemenu'
import Tabview from '@/components/tabview'
import QueryLog from '@/components/querylog'
import './index.scss'
@@ -18,6 +20,7 @@
          <Header key="header"/>
          <Sidemenu key="sidemenu"/>
          <Tabview key="tabview"/>
          <QueryLog />
        </ConfigProvider>
      </div>
    )