king
2020-03-11 2d1ecb2628680c31ed075261b40d6f16ca6363dd
2020-03-11
7个文件已修改
130 ■■■■ 已修改文件
src/api/index.js 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/tabview/index.jsx 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/tabview/index.scss 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/formtab/index.jsx 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/tableshare/actionList/index.jsx 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/tableshare/verifycard/index.jsx 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js
@@ -33,7 +33,7 @@
  }
}
let GlobMap = new Map()
window.GLOB.CacheMap = new Map()
axios.interceptors.response.use((response) => {
  if (response.data.ErrCode === 'LoginError') {
@@ -260,8 +260,8 @@
    _param = JSON.stringify(_param)
    _param  = md5(_param)
    if (GlobMap.has(_param)) {
      return Promise.resolve(GlobMap.get(_param))
    if (window.GLOB.CacheMap.has(_param)) {
      return Promise.resolve(window.GLOB.CacheMap.get(_param))
    } else {
      param.nonc = Utils.getuuid()
      
@@ -283,8 +283,9 @@
          url: '/webapi/dostars',
          data: param
        }).then(res => {
          GlobMap.set(_param, res)
          if (res.status) {
            window.GLOB.CacheMap.set(_param, res)
          }
          resolve(res)
        })
      })
src/components/tabview/index.jsx
@@ -3,7 +3,7 @@
import {connect} from 'react-redux'
import { is, fromJS } from 'immutable'
import {Tabs, Icon, Button, ConfigProvider, message, BackTop} from 'antd'
import {modifyTabview, toggleIsiframe} from '@/store/action'
import {modifyTabview, toggleIsiframe, refreshTabView} from '@/store/action'
// import asyncComponent from '@/utils/asyncComponent'
import asyncComponent from '@/utils/asyncLoadComponent'
import NotFount from '@/components/404'
@@ -38,7 +38,7 @@
    locale: (!sessionStorage.getItem('lang') || sessionStorage.getItem('lang') === 'zh-CN') ? zhCN : enUS
  }
  handleTabview (e, menu) {
  handleTabview = (e, menu) => {
    e.stopPropagation()
    // 关闭tab页,重新选择显示页
    let tabs = JSON.parse(JSON.stringify(this.state.tabviews))
@@ -53,7 +53,18 @@
    this.props.modifyTabview(tabs)
  }
  changeTab (e, menu) {
  refreshTabview = (e, menu) => {
    e.stopPropagation()
    window.GLOB.CacheMap = new Map()
    let _menu = {
      MenuID: menu.MenuID,
      position: 'view'
    }
    this.props.refreshTabView(_menu)
  }
  changeTab = (e, menu) => {
    e.stopPropagation()
    // 窗口切换
    let tabs = JSON.parse(JSON.stringify(this.state.tabviews))
@@ -74,7 +85,7 @@
    this.props.modifyTabview(tabs)
  }
  selectcomponent (view) {
  selectcomponent = (view) => {
    // 根据tab页中菜单信息,选择所需的组件
    if (view.type === 'Home') {
      return (<Comps.Home MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>)
@@ -97,7 +108,7 @@
    }
  }
  resetWindow (view) {
  resetWindow = (view) => {
    // 窗口在iframe与普通页面切换时,修改左侧菜单栏样式
    if (!view) return
    let _isiframe = this.props.isiframe
@@ -210,10 +221,15 @@
                      className="test"
                      tab={
                        <span className="tab-control">
                          {['CommonTable', 'FormTab'].includes(view.type) ?
                            <Icon type="redo" onClick={(e) => {this.refreshTabview(e, view)}}/> : null
                          }
                          <span className="tab-name" onClick={(e) => {this.changeTab(e, view)}}>
                            {view.MenuName}
                          </span>
                          {view.type !== 'Home' ? <Icon type="close" onClick={(e) => {this.handleTabview(e, view)}}/> : null}
                          {view.type !== 'Home' ?
                            <Icon type="close" onClick={(e) => {this.handleTabview(e, view)}}/> : null
                          }
                        </span>
                      }
                      key={view.MenuID}
@@ -258,6 +274,7 @@
const mapDispatchToProps = (dispatch) => {
  return {
    modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)),
    refreshTabView: (refreshTab) => dispatch(refreshTabView(refreshTab)),
    toggleIsiframe: (isiframe) => dispatch(toggleIsiframe(isiframe))
  }
}
src/components/tabview/index.scss
@@ -14,7 +14,7 @@
    .ant-tabs-tab {
      padding: 18px 16px 6px 6px;
      cursor: default;
      span.tab-control i {
      span.tab-control i.anticon-close {
        position: absolute;
        right: -7px;
        top: 10px;
@@ -23,11 +23,31 @@
        padding: 5px;
        cursor: pointer;
      }
      span.tab-control i.anticon-redo {
        position: absolute;
        left: -5px;
        top: 18px;
        font-size: 14px;
        margin: 0px;
        padding: 3px;
        cursor: pointer;
        display: none;
      }
      span.tab-name {
        cursor: pointer;
        padding: 6px 0px 6px 10px;
      }
    }
    .ant-tabs-tab-active.ant-tabs-tab {
      span.tab-name {
        cursor: default;
      }
    }
    .ant-tabs-tab-active.ant-tabs-tab:hover {
      span.tab-control i.anticon-redo {
        display: inline-block;
      }
    }
    iframe {
      width: 100%;
      height: calc(100vh - 115px);
src/tabviews/formtab/index.jsx
@@ -568,11 +568,42 @@
    return this.formGroupRef.handleConfirm()
  }
  reloadview = () => {
    this.setState({
      loadingview: true,
      viewlost: false,
      lostmsg: '',
      config: {},
      groups: null,
      actions: null,
      arr_field: '',
      setting: null,
      data: null,
      configMap: {},
      BIDs: {},
      setsingle: false,
      pickup: false,
      popData: false,
      visible: false,
      primaryId: null,
      refreshtabs: null
    }, () => {
      this.loadconfig()
    })
  }
  UNSAFE_componentWillMount () {
    // 组件加载时,获取菜单数据
    this.loadconfig()
  }
  UNSAFE_componentWillReceiveProps(nextProps) {
    if (nextProps.refreshTab && nextProps.refreshTab.MenuID === this.props.MenuID) {
      this.reloadview()
      this.props.refreshTabView('')
    }
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState))
  }
src/tabviews/tableshare/actionList/index.jsx
@@ -627,7 +627,17 @@
        })
      }
    }
    console.log(JSON.stringify(printdata))
    if (list.length === 0) {
      notification.warning({
        top: 92,
        message: '未获取到打印信息!',
        duration: 10
      })
      this.setState({loadingUuid: ''})
      return
    }
    if (!socket || socket.readyState !== 1 || socket.url !== 'ws://' + item.verify.linkUrl) {
      socket = new WebSocket('ws://' + item.verify.linkUrl)
    } else {
@@ -685,7 +695,7 @@
        }
      }
      if (data && data.defaultPrinter) {
      if (data && data.cmd === 'getPrinters' && data.status) {
        printdata.task.printer = data.defaultPrinter
        this.setState({loadingUuid: ''})
        notification.success({
@@ -694,6 +704,13 @@
          duration: 2
        })
        socket.send(JSON.stringify(printdata))
      } else if (data && data.message && !data.status) {
        notification.warning({
          top: 92,
          message: data.message,
          duration: 10
        })
        this.setState({loadingUuid: ''})
      }
    }
src/tabviews/tableshare/verifycard/index.jsx
@@ -137,7 +137,7 @@
            data = ''
          }
          if (data && data.defaultPrinter) {
          if (data && data.cmd === 'getPrinters' && data.status) {
            let printers = Array.from(new Set(data.printers))
            
            let _config = JSON.parse(JSON.stringify(this.state.config))
@@ -158,6 +158,12 @@
            this.setState({
              config: _config
            })
          } else if (data && data.cmd === 'getPrinters' && !data.status) {
            notification.warning({
              top: 92,
              message: data.message,
              duration: 10
            })
          }
        }
src/utils/utils.js
@@ -1269,6 +1269,12 @@
      `
    }
    // 打印自定义模板字段提示
    let _printRemark = ''
    if (btn.funcType === 'print') {
      _printRemark = '/* 自定义数据打印模板时,请使用TemplateID字段 */'
    }
    let Ltext = `create proc ${param.funcName}
    ( /*${menu.MenuName}  ${btn.label}*/
    @BID nvarchar(50)='',${formParam}
@@ -1291,7 +1297,7 @@
      /*事务操作*/
      BEGIN TRAN
        /*具体业务操作*/
        ${_printRemark}
        /* 
        select top 10 * from sProcExcep order by id desc