| | |
| | | } |
| | | } |
| | | |
| | | let GlobMap = new Map() |
| | | window.GLOB.CacheMap = new Map() |
| | | |
| | | axios.interceptors.response.use((response) => { |
| | | if (response.data.ErrCode === 'LoginError') { |
| | |
| | | _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() |
| | | |
| | |
| | | url: '/webapi/dostars', |
| | | data: param |
| | | }).then(res => { |
| | | |
| | | GlobMap.set(_param, res) |
| | | if (res.status) { |
| | | window.GLOB.CacheMap.set(_param, res) |
| | | } |
| | | resolve(res) |
| | | }) |
| | | }) |
| | |
| | | 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' |
| | |
| | | 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)) |
| | |
| | | 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)) |
| | |
| | | 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}/>) |
| | |
| | | } |
| | | } |
| | | |
| | | resetWindow (view) { |
| | | resetWindow = (view) => { |
| | | // 窗口在iframe与普通页面切换时,修改左侧菜单栏样式 |
| | | if (!view) return |
| | | let _isiframe = this.props.isiframe |
| | |
| | | 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} |
| | |
| | | const mapDispatchToProps = (dispatch) => { |
| | | return { |
| | | modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)), |
| | | refreshTabView: (refreshTab) => dispatch(refreshTabView(refreshTab)), |
| | | toggleIsiframe: (isiframe) => dispatch(toggleIsiframe(isiframe)) |
| | | } |
| | | } |
| | |
| | | .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; |
| | |
| | | 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); |
| | |
| | | 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)) |
| | | } |
| | |
| | | }) |
| | | } |
| | | } |
| | | 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 { |
| | |
| | | } |
| | | } |
| | | |
| | | if (data && data.defaultPrinter) { |
| | | if (data && data.cmd === 'getPrinters' && data.status) { |
| | | printdata.task.printer = data.defaultPrinter |
| | | this.setState({loadingUuid: ''}) |
| | | notification.success({ |
| | |
| | | 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: ''}) |
| | | } |
| | | } |
| | | |
| | |
| | | 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)) |
| | |
| | | this.setState({ |
| | | config: _config |
| | | }) |
| | | } else if (data && data.cmd === 'getPrinters' && !data.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: data.message, |
| | | duration: 10 |
| | | }) |
| | | } |
| | | } |
| | | |
| | |
| | | ` |
| | | } |
| | | |
| | | // 打印自定义模板字段提示 |
| | | let _printRemark = '' |
| | | if (btn.funcType === 'print') { |
| | | _printRemark = '/* 自定义数据打印模板时,请使用TemplateID字段 */' |
| | | } |
| | | |
| | | let Ltext = `create proc ${param.funcName} |
| | | ( /*${menu.MenuName} ${btn.label}*/ |
| | | @BID nvarchar(50)='',${formParam} |
| | |
| | | /*事务操作*/ |
| | | BEGIN TRAN |
| | | /*具体业务操作*/ |
| | | |
| | | ${_printRemark} |
| | | /* |
| | | select top 10 * from sProcExcep order by id desc |
| | | |