king
2021-09-17 eb0c4703ec7cd21dc921ae113b7e3be69c641c1d
2021-09-17
23个文件已修改
294 ■■■■■ 已修改文件
public/README.txt 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/options.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/breadview/index.jsx 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/sidemenu/index.jsx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/sidemenu/index.scss 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/tabview/index.jsx 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/index.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcellcomponent/formconfig.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/clockcomponent/index.jsx 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/clockcomponent/settingform/index.jsx 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/action-type.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/action.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/reducer.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/index.jsx 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/balcony/index.jsx 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/prop-card/index.jsx 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/normal-table/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/excelInbutton/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/exceloutbutton/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/popupbutton/index.jsx 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/printbutton/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/design/sidemenu/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/README.txt
@@ -11,4 +11,5 @@
defaultLang       -- 默认打开的子应用语言类型,填入defaultApp时有效
WXAppID           -- 使用公众号时,绑定的公众号ID
debugger          -- debugger模式是否开启,开启后移动端子应用中会有控制台
licenseKey        -- 许可密钥,在内部网络中使用系统时,会跳过epc验证
licenseKey        -- 许可密钥,在内部网络中使用系统时,会跳过epc验证
probation         -- 试用期(YYYY-MM-DD),在正式系统中,试用期内调用系统接口的脚本会记录下来
public/options.json
@@ -11,6 +11,7 @@
  "WXAppID": "",
  "debugger": false,
  "licenseKey": "E1A8FE",
  "probation": "",
  "host": "http://qingqiumarket.cn",
  "service": "mkwms/"
}
src/components/breadview/index.jsx
@@ -1,6 +1,5 @@
import React, {Component} from 'react'
import {connect} from 'react-redux'
import { is, fromJS } from 'immutable'
import { BackTop, Breadcrumb, Icon, notification} from 'antd'
import moment from 'moment'
import 'moment/locale/zh-cn'
@@ -140,18 +139,21 @@
    this.setState({tabview: home})
  }
  UNSAFE_componentWillReceiveProps (nextProps) {
    if (nextProps.tabviews && !is(fromJS(this.state.tabviews), fromJS(nextProps.tabviews))) {
      // 保存修改标签集
      this.setState({
        tabview: nextProps.tabviews[nextProps.tabviews.length - 1]
      })
  modifyTabs = (tab, type) => {
    if (!tab || type !== 'replace') return
      let node = document.getElementById('root').parentNode.parentNode
      if (node) {
        node.scrollTop = 0
      }
    this.setState({
      tabview: tab,
    })
    let node = document.getElementById('root').parentNode.parentNode
    if (node) {
      node.scrollTop = 0
    }
  }
  componentDidMount () {
    MKEmitter.addListener('modifyTabs', this.modifyTabs)
  }
  /**
@@ -161,6 +163,7 @@
    this.setState = () => {
      return
    }
    MKEmitter.removeListener('modifyTabs', this.modifyTabs)
  }
  render () {
@@ -195,10 +198,8 @@
  }
}
const mapStateToProps = (state) => {
  return {
    tabviews: state.tabviews
  }
const mapStateToProps = () => {
  return {}
}
const mapDispatchToProps = (dispatch) => {
src/components/sidemenu/index.jsx
@@ -97,7 +97,7 @@
    if (mainMenu === '') return (<span className="mk-side-menu-hidden"></span>)
    return (
      <aside id="mk-sidemenu-wrap" className={'mk-side-menu ant-menu-dark' + (this.props.collapse ? ' collapsed' : '') + (this.props.isiframe ? ' mk-iframe' : '')}>
      <aside id="mk-sidemenu-wrap" className={'mk-side-menu ant-menu-dark' + (this.props.collapse ? ' collapsed' : '')}>
        <Menu openKeys={this.state.openKeys} onOpenChange={this.onOpenChange} mode="inline" theme="dark" inlineCollapsed={this.props.collapse}>
          {this.state.subMenulist && this.state.subMenulist.map((item) => {
            return (
@@ -129,13 +129,11 @@
const mapStateToProps = (state) => {
  return {
    collapse: state.collapse,
    isiframe: state.isiframe,
    mainMenu: state.mainMenu,
    menuTree: state.menuTree,
  }
}
const mapDispatchToProps = (dispatch) => {
const mapDispatchToProps = () => {
  return {}
}
src/components/sidemenu/index.scss
@@ -94,13 +94,13 @@
  }
}
.mk-side-menu.mk-iframe { // tab页中为iframe时
  max-height: 100vh;
  overflow-y: scroll;
  &::-webkit-scrollbar {
    display: none;
  }
}
// .mk-side-menu.mk-iframe { // tab页中为iframe时
//   max-height: 100vh;
//   overflow-y: scroll;
//   &::-webkit-scrollbar {
//     display: none;
//   }
// }
.mk-side-menu.collapsed { // 左侧菜单合并时
  flex: 0 0 80px;
  width: 80px;
src/components/tabview/index.jsx
@@ -6,7 +6,7 @@
import moment from 'moment'
import 'moment/locale/zh-cn'
import { toggleIsiframe, initActionPermission } from '@/store/action'
import { initActionPermission } from '@/store/action'
import asyncComponent from '@/utils/asyncLoadComponent'
import NotFount from '@/components/404'
import options from '@/store/options.js'
@@ -64,7 +64,9 @@
    
    if (index > -1) {
      let activeId = ''
      if (index > 0) {
      if (id !== this.state.activeId) {
        activeId = this.state.activeId
      } else if (index > 0) {
        activeId = tabs[index - 1].MenuID || ''
      } else if (tabs[index]) {
        activeId = tabs[index].MenuID || ''
@@ -74,10 +76,6 @@
        activeId,
        tabviews: tabs
      })
      if (this.props.isiframe) {
        this.props.toggleIsiframe(false)
      }
      let node = document.getElementById('root').parentNode.parentNode
      if (node) {
@@ -174,16 +172,6 @@
  changeTab = (e, menu) => {
    e.stopPropagation()
    // 窗口切换
    let _isiframe = this.props.isiframe
    if (menu.type === 'iframe') {
      _isiframe = true
    } else {
      _isiframe = false
    }
    if (_isiframe !== this.props.isiframe) {
      this.props.toggleIsiframe(_isiframe)
    }
    
    this.setState({
      activeId: menu.MenuID || ''
@@ -252,10 +240,6 @@
    MKEmitter.addListener('closeTabView', this.closeTabView)
  }
  UNSAFE_componentWillReceiveProps (nextProps) {
  }
  /**
   * @description 组件销毁,清除state更新
   */
@@ -314,14 +298,12 @@
const mapStateToProps = (state) => {
  return {
    collapse: state.collapse,
    isiframe: state.isiframe
  }
}
const mapDispatchToProps = (dispatch) => {
  return {
    initActionPermission: (permAction) => dispatch(initActionPermission(permAction)),
    toggleIsiframe: (isiframe) => dispatch(toggleIsiframe(isiframe))
    initActionPermission: (permAction) => dispatch(initActionPermission(permAction))
  }
}
src/index.js
@@ -71,6 +71,7 @@
    GLOB.appId = config.appId || ''
    GLOB.lineColor = config.lineColor || ''
    GLOB.licenseKey = config.licenseKey || ''
    GLOB.probation = false
    if (config.externalDatabase !== false && config.externalDatabase !== 'false' && config.externalDatabase !== undefined) {
      GLOB.externalDatabase = config.externalDatabase ? `[${config.externalDatabase}]..` : ''
@@ -81,6 +82,9 @@
    // 只有业务系统才可以设置为正式系统
    if (options.sysType === 'local' && (config.systemType === 'official' || config.systemType === 'production')) {
      GLOB.systemType = 'production'
      if (config.probation && /^20\d{2}-\d{2}-\d{2}$/.test(config.probation) && new Date(config.probation).getTime() > new Date().getTime()) {
        GLOB.probation = true
      }
    } else {
      GLOB.systemType = ''
    }
src/menu/components/card/cardcellcomponent/formconfig.jsx
@@ -216,7 +216,7 @@
      type: 'number',
      key: 'barHeight',
      min: 5,
      max: 50,
      max: 500,
      label: '高度',
      initVal: card.barHeight || 25,
      required: true,
@@ -225,7 +225,7 @@
      type: 'number',
      key: 'qrWidth',
      min: 5,
      max: 500,
      max: 1000,
      label: '宽度',
      initVal: card.qrWidth || 50,
      required: true,
src/menu/components/share/clockcomponent/index.jsx
@@ -10,14 +10,12 @@
class ClockComponent extends Component {
  static propTpyes = {
    btnlog: PropTypes.array,
    updateConfig: PropTypes.func
  }
  state = {
    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    visible: false,
    timer: '',
    visible: false
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -25,11 +23,8 @@
  }
  trigger = () => {
    const { config } = this.props
    this.setState({
      visible: true,
      timer: config.timer || ''
      visible: true
    })
  }
@@ -45,7 +40,8 @@
  }
  render () {
    const { visible, loading, timer } = this.state
    const { config } = this.props
    const { visible, loading } = this.state
    return (
      <div className="clock-component-wrap">
@@ -60,7 +56,7 @@
          onCancel={() => this.setState({ visible: false })}
          destroyOnClose
        >
          <ClockForm timer={timer} inputSubmit={this.submit} wrappedComponentRef={(inst) => this.verifyRef = inst}/>
          <ClockForm config={config} inputSubmit={this.submit} wrappedComponentRef={(inst) => this.verifyRef = inst}/>
        </Modal>
      </div>
    )
src/menu/components/share/clockcomponent/settingform/index.jsx
@@ -1,16 +1,18 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Select } from 'antd'
import { Form, Row, Col, Select, Tooltip, Icon, Input } from 'antd'
import './index.scss'
class SettingForm extends Component {
  static propTpyes = {
    timer: PropTypes.string,      // 组件名称
    inputSubmit: PropTypes.func   // 回车事件
    config: PropTypes.string,
    inputSubmit: PropTypes.func
  }
  state = {}
  state = {
    clearField: this.props.config.clearField || ''
  }
  handleConfirm = () => {
    // 表单提交时检查输入值是否正确
@@ -26,6 +28,8 @@
  }
  render() {
    const { config } = this.props
    const { clearField } = this.state
    const { getFieldDecorator } = this.props.form
    const formItemLayout = {
@@ -46,7 +50,7 @@
            <Col span={22}>
              <Form.Item label="定时器">
                {getFieldDecorator('timer', {
                  initialValue: this.props.timer || ''
                  initialValue: config.timer || ''
                })(
                  <Select>
                    <Select.Option value=""> 无 </Select.Option>
@@ -63,6 +67,34 @@
                )}
              </Form.Item>
            </Col>
            {config.subtype === 'balcony' || config.subtype === 'propcard' ? <Col span={22}>
              <Form.Item label={
                <Tooltip placement="topLeft" title="可以指定字段用于控制定时器的关闭。">
                  <Icon type="question-circle" style={{marginRight: '3px', color: '#c49f47'}} />
                  关闭定时
                </Tooltip>
              }>
                {getFieldDecorator('clearField', {
                  initialValue: clearField || ''
                })(
                  <Select allowClear onChange={(val) => this.setState({clearField: val})}>
                    {config.columns.map(col => (<Select.Option key={col.uuid} value={col.field}>{col.label}</Select.Option>))}
                  </Select>
                )}
              </Form.Item>
            </Col> : null}
            {(config.subtype === 'balcony' || config.subtype === 'propcard') && clearField ? <Col span={22}>
              <Form.Item label={
                <Tooltip placement="topLeft" title="当字段值与关闭值相等时,关闭定时器,多个值可用逗号分隔。">
                  <Icon type="question-circle" style={{marginRight: '3px', color: '#c49f47'}} />
                  关闭值
                </Tooltip>
              }>
                {getFieldDecorator('clearValue', {
                  initialValue: config.clearValue || ''
                })(<Input placeholder="" autoComplete="off" onPressEnter={this.props.inputSubmit}/>)}
              </Form.Item>
            </Col> : null}
          </Row>
        </Form>
      </div>
src/store/action-type.js
@@ -7,9 +7,6 @@
// 展开合并菜单栏
export const Toggle_COLLAPSE = 'Toggle_COLLAPSE'
// 修改窗口样式,区分iframe与正常页面
export const TOGGLE_ISIFRAME = 'TOGGLE_ISIFRAME'
// 刷新tab页面
export const REFRESH_TABVIEW = 'REFRESH_TABVIEW'
src/store/action.js
@@ -24,14 +24,6 @@
  }
}
// 修改窗口样式,区分iframe与正常页面
export const toggleIsiframe = (isiframe) => {
  return {
    type: user.TOGGLE_ISIFRAME,
    isiframe
  }
}
// 重置编辑级别
export const resetEditLevel = (editLevel) => {
  return {
src/store/reducer.js
@@ -25,7 +25,6 @@
  menuTree: null,       // 菜单结构树
  mainMenu: _mainMenu,  // 已选主菜单
  collapse: _collapse,  // 是否收起侧边栏导航
  isiframe: false,      // 是否为iframe窗口
  editLevel: null,      // 编辑菜单级别,值为level1、level2、level3、HS
  permAction: {},       // 用户按钮权限
  permMenus: [],        // 用户三级菜单列表
@@ -52,12 +51,6 @@
      return {
        ...state,
        mainMenu: action.mainMenu
      }
    case Type.TOGGLE_ISIFRAME:
    // 切换是否为iframe状态
      return {
        ...state,
        isiframe: action.isiframe
      }
    case Type.RESET_EDITLEVEL:
    // 重置编辑级别
@@ -88,7 +81,6 @@
        menuTree: null,
        mainMenu: null,
        collapse: localStorage.getItem('collapse') === 'true',
        isiframe: false,
        editLevel: null,
        permAction: {},
        permMenus: [],
src/tabviews/commontable/index.jsx
@@ -1012,15 +1012,6 @@
    this.loadconfig()
  }
  UNSAFE_componentWillReceiveProps(nextProps) {
    if (!is(fromJS(this.props.tabviews), fromJS(nextProps.tabviews))) {
      let selectTab = nextProps.tabviews.filter(tab => tab.selected)[0]
      if (selectTab && selectTab.MenuID === this.props.MenuID) {
        this.setShortcut()
      }
    }
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState))
  }
@@ -1176,7 +1167,6 @@
const mapStateToProps = (state) => {
  return {
    menuType: state.editLevel,
    tabviews: state.tabviews,
    permAction: state.permAction,
    permMenus: state.permMenus
  }
src/tabviews/custom/components/card/balcony/index.jsx
@@ -2,8 +2,10 @@
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'
@@ -111,6 +113,7 @@
    MKEmitter.addListener('syncBalconyData', this.syncBalconyData)
    MKEmitter.addListener('resetSelectLine', this.resetParentParam)
    MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult)
    this.handleTimer()
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -118,6 +121,7 @@
  }
  componentWillUnmount () {
    clearTimeout(this.timer)
    this.setState = () => {
      return
    }
@@ -148,6 +152,56 @@
      this.setState({sync: false, data: _data})
    }
  }
  handleTimer = () => {
    const { config } = this.state
    if (!config.timer) return
    const _change = { '5s': 5000, '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)
  }
  /**
@@ -225,7 +279,7 @@
    this.loadData()
  }
  async loadData () {
  async loadData (hastimer) {
    const { menuType } = this.props
    const { config, arr_field, BID, BData } = this.state
@@ -243,9 +297,11 @@
    let searches = []
    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)
@@ -260,6 +316,13 @@
        data: _data,
        loading: false
      })
      if (config.timer && config.clearField) {
        let vals = (config.clearValue || '').split(',')
        if (vals.includes(_data[config.clearField])) {
          clearTimeout(this.timer)
        }
      }
    } else {
      this.setState({
        loading: false,
src/tabviews/custom/components/card/prop-card/index.jsx
@@ -319,6 +319,13 @@
        data: _data,
        loading: false
      })
      if (config.timer && config.clearField) {
        let vals = (config.clearValue || '').split(',')
        if (vals.includes(_data[config.clearField])) {
          clearTimeout(this.timer)
        }
      }
    } else {
      this.setState({
        loading: false,
src/tabviews/custom/components/table/normal-table/index.jsx
@@ -648,7 +648,6 @@
const mapStateToProps = (state) => {
  return {
    menuType: state.editLevel,
    tabviews: state.tabviews,
    permAction: state.permAction,
    permMenus: state.permMenus
  }
src/tabviews/zshare/actionList/excelInbutton/index.jsx
@@ -323,6 +323,10 @@
      param.menuname = btn.logLabel
      if (window.GLOB.probation) {
        param.s_debug_type = 'Y'
      }
      Api.genericInterface(param).then((res) => {
        if (res.status) {
          this.execSuccess(res)
src/tabviews/zshare/actionList/exceloutbutton/index.jsx
@@ -606,12 +606,16 @@
    param.exec_type = 'y' // 后台解码
    param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
    param.secretkey = Utils.encrypt('', param.timestamp)
    param.LText = Utils.formatOptions(param.LText)
    param.LText = Utils.formatOptions(script)
    if (this.props.menuType === 'HS') { // 函数 sPC_TableData_InUpDe 云端验证
      param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp)
    }
    if (window.GLOB.probation) {
      param.s_debug_type = 'Y'
    }
    Api.genericInterface(param).then((res) => {
      if (res.status) {
        this.execSuccess({ErrCode: 'S', ErrMesg: '导出成功!'})
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -426,6 +426,10 @@
      param.menuname = btn.logLabel
      if (window.GLOB.probation) {
        param.s_debug_type = 'Y'
      }
      if (check_param) {
        check_param.menuname = btn.logLabel
        this.setState({checkParam: check_param})
@@ -532,6 +536,9 @@
        if (param.func === 'sPC_TableData_InUpDe') {
          param.menuname = btn.logLabel
          if (window.GLOB.probation) {
            param.s_debug_type = 'Y'
          }
        }
        return param
@@ -1047,6 +1054,10 @@
      param.secretkey = Utils.encrypt('', param.timestamp)
      param.LText = Utils.formatOptions(param.LText)
      param.menuname = btn.logLabel
      if (window.GLOB.probation) {
        param.s_debug_type = 'Y'
      }
      if (this.props.menuType === 'HS') { // 函数 sPC_TableData_InUpDe 云端验证
        param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp)
@@ -1856,7 +1867,6 @@
const mapStateToProps = (state) => {
  return {
    tabviews: state.tabviews,
    menuType: state.editLevel
  }
}
src/tabviews/zshare/actionList/popupbutton/index.jsx
@@ -1,6 +1,5 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import {connect} from 'react-redux'
import { is, fromJS } from 'immutable'
import { Button, Modal, notification, Icon, Drawer } from 'antd'
@@ -318,15 +317,4 @@
    )
  }
}
const mapStateToProps = (state) => {
  return {
    tabviews: state.tabviews,
  }
}
const mapDispatchToProps = () => {
  return {}
}
export default connect(mapStateToProps, mapDispatchToProps)(PopupButton)
export default PopupButton
src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -1554,7 +1554,6 @@
const mapStateToProps = (state) => {
  return {
    tabviews: state.tabviews,
    menuType: state.editLevel
  }
}
src/views/design/sidemenu/index.jsx
@@ -236,7 +236,7 @@
  render () {
    return (
      <aside id="mk-sidemenu-wrap" className="mk-sys-side-menu ant-menu-dark mk-edit">
      <aside className="mk-sys-side-menu ant-menu-dark mk-edit">
        {!(this.props.editLevel === 'level2' || this.props.editLevel === 'level3') &&
          <Menu openKeys={this.state.openKeys} onOpenChange={this.onOpenChange} mode="inline" theme="dark">
          {!this.props.editLevel && <li className="sup-menu"><Icon onClick={this.enterSubEdit} className="edit-check" type="edit" /></li>}