| | |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? mzhCN : menUS, |
| | | } |
| | | |
| | | handleTabview = (e, menu) => { |
| | | handleTabview = (e, menu, index) => { |
| | | e.stopPropagation() |
| | | // 关闭tab页,重新选择显示页 |
| | | let tabs = fromJS(this.state.tabviews).toJS() |
| | |
| | | return tab.MenuID !== menu.MenuID |
| | | }) |
| | | |
| | | if (menu.selected && tabs[0]) { |
| | | tabs[0].selected = true |
| | | if (menu.selected && tabs[index - 1]) { |
| | | tabs[index - 1].selected = true |
| | | this.setState({ |
| | | activeId: tabs[0].MenuID || '' |
| | | activeId: tabs[index - 1].MenuID || '' |
| | | }) |
| | | |
| | | if (this.props.isiframe) { |
| | | this.props.toggleIsiframe(false) |
| | | } |
| | | } |
| | | |
| | | this.props.modifyTabview(tabs) |
| | | } |
| | | |
| | | closeTabView = (id) => { |
| | | // 关闭tab页,重新选择显示页 |
| | | let tabs = fromJS(this.state.tabviews).toJS() |
| | | let index = 0 |
| | | tabs = tabs.filter((tab, i) => { |
| | | if (tab.MenuID === id) { |
| | | index = i |
| | | return false |
| | | } else { |
| | | return true |
| | | } |
| | | }) |
| | | |
| | | if (tabs[index - 1]) { |
| | | tabs[index - 1].selected = true |
| | | this.setState({ |
| | | activeId: tabs[index - 1].MenuID || '' |
| | | }) |
| | | |
| | | if (this.props.isiframe) { |
| | |
| | | } |
| | | this.props.modifyTabview([home]) |
| | | } |
| | | MKEmitter.addListener('closeTabView', this.closeTabView) |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | MKEmitter.removeListener('closeTabView', this.closeTabView) |
| | | } |
| | | |
| | | render () { |
| | |
| | | <div className="content-header"> |
| | | {tabviews && tabviews.length > 0 && |
| | | <Tabs activeKey={activeId}> |
| | | {tabviews.map(view => { |
| | | {tabviews.map((view, index) => { |
| | | return ( |
| | | <Tabs.TabPane |
| | | tab={ |
| | |
| | | {view.MenuName} |
| | | </span> |
| | | {view.type !== 'Home' ? |
| | | <Icon type="close" onClick={(e) => {this.handleTabview(e, view)}}/> : null |
| | | <Icon type="close" onClick={(e) => {this.handleTabview(e, view, index)}}/> : null |
| | | } |
| | | </span> |
| | | } |
| | |
| | | MKEmitter.emit('changeEditMenu', {MenuID: btn.uuid, copyMenuId: btn.copyMenuId}) |
| | | } else if (btn.OpenType === 'innerpage' && btn.pageTemplate === 'linkpage') { |
| | | MKEmitter.emit('changeEditMenu', {MenuID: btn.linkmenu}) |
| | | } else { |
| | | this.handleElement(item) |
| | | } |
| | | } else { |
| | | if (btn.link === 'page') { |
| | |
| | | } |
| | | } else if (_opentype === 'funcbutton') { |
| | | if (_funcType === 'print') { |
| | | _options.push('execMode', 'intertype', 'Ot', 'execSuccess', 'execError', 'resetPageIndex') |
| | | _options.push('execMode', 'intertype', 'Ot', 'execSuccess', 'execError', 'resetPageIndex', 'controlField', 'controlVal') |
| | | if (_intertype === 'outer') { |
| | | _options.push('innerFunc', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackFunc') |
| | | } else if (_intertype === 'inner') { |
| | |
| | | } |
| | | } else if (_funcType === 'mkBinding' || _funcType === 'mkUnBinding') { |
| | | _options.push('execSuccess', 'execError') |
| | | } else if (_funcType === 'closetab') { |
| | | _options.push('refreshTab') |
| | | } |
| | | } else if (_opentype !== 'popview' && _opentype !== 'tab') { |
| | | if (_intertype === 'custom') { |
| | |
| | | } |
| | | } |
| | | |
| | | if (_Ot !== 'notRequired' && _opentype !== 'excelOut') { |
| | | if (this.state.appType === 'mob') { |
| | | if (_opentype !== 'funcbutton') { |
| | | _options.push('controlField', 'controlVal') |
| | | } |
| | | } else { |
| | | _options.push('controlField', 'controlVal') |
| | | } |
| | | if (_Ot !== 'notRequired' && _opentype !== 'excelOut' && _opentype !== 'funcbutton') { |
| | | _options.push('controlField', 'controlVal') |
| | | } |
| | | if (_Ot === 'requiredSgl' && ['pop', 'prompt', 'exec'].includes(_opentype)) { |
| | | _options.push('swipe') |
| | |
| | | |
| | | let funTypes = [ |
| | | { value: 'changeuser', text: Formdict['header.form.func.changeuser'] }, |
| | | { value: 'print', text: '标签打印' } |
| | | { value: 'print', text: '标签打印' }, |
| | | { value: 'closetab', text: '标签关闭' }, |
| | | ] |
| | | |
| | | if (isApp) { |
| | |
| | | options: opentypes |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | type: 'select', |
| | | key: 'funcType', |
| | | label: Formdict['header.form.funcType'], |
| | | initVal: card.funcType || '', |
| | |
| | | options: menulist |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | | key: 'refreshTab', |
| | | label: '刷新标签', |
| | | initVal: card.refreshTab || [], |
| | | required: false, |
| | | forbid: isApp, |
| | | options: menulist |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'execSuccess', |
| | | label: Formdict['model.form.afterSuccess'], |
| | |
| | | } else if (element.OpenType === 'innerpage' && element.pageTemplate === 'linkpage') { |
| | | MKEmitter.emit('changeEditMenu', {MenuID: element.linkmenu}) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '此按钮无子配置项!', |
| | | duration: 5 |
| | | }) |
| | | this.handleAction(element) |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | if (index !== undefined) { |
| | | return connectDragSource( |
| | | connectDropTarget(<th {...restProps} index={index} style={{ cursor: 'move', textAlign: align }}> |
| | | connectDropTarget(<th {...restProps} index={index} style={{ cursor: 'move', textAlign: align }} onDoubleClick={() => column && this.props.editColumn(column)}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | {column && ['custom', 'colspan', 'action'].includes(column.type) ? |
| | |
| | | ) |
| | | } else if (column) { |
| | | return ( |
| | | <th {...restProps} key={column.uuid}> |
| | | <th {...restProps} key={column.uuid} onDoubleClick={() => this.props.editColumn(column)}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | {column && ['custom', 'colspan'].includes(column.type) ? |
| | |
| | | } |
| | | } |
| | | |
| | | reloadMenuView = (menuId) => { |
| | | reloadMenuView = (menuId, position) => { |
| | | const { MenuID } = this.props |
| | | |
| | | if (MenuID !== menuId) return |
| | | |
| | | this.reloadview() |
| | | if (position === 'table') { |
| | | this.reloadtable() |
| | | } else { |
| | | this.reloadview() |
| | | } |
| | | } |
| | | |
| | | resetActiveMenu = (menuId) => { |
| | |
| | | </Col> |
| | | ) |
| | | } else if (card.OpenType === 'funcbutton') { |
| | | if (card.funcType === 'changeuser') { |
| | | if (card.funcType === 'changeuser' || card.funcType === 'closetab') { |
| | | return ( |
| | | <Col key={card.uuid} className="mk-cell-btn" span={card.width}> |
| | | <ChangeUserButton |
| | |
| | | |
| | | if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置 |
| | | cell = this.getPrinter(cell, item.uuid) |
| | | } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'closetab') { // 标签关闭按钮,重置菜单Id |
| | | cell.$menuId = this.props.MenuID |
| | | } |
| | | |
| | | if (cell.btnstyle) { // 兼容 |
| | |
| | | |
| | | if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置 |
| | | cell = this.getPrinter(cell, item.uuid) |
| | | } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'closetab') { // 标签关闭按钮,重置菜单Id |
| | | cell.$menuId = this.props.MenuID |
| | | } |
| | | if (card.btnstyle) { // 兼容 |
| | | card.style = card.style || {} |
| | |
| | | |
| | | if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置 |
| | | cell = this.getPrinter(cell, item.uuid) |
| | | } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'closetab') { // 标签关闭按钮,重置菜单Id |
| | | cell.$menuId = this.props.MenuID |
| | | } |
| | | if (card.btnstyle) { // 兼容 |
| | | card.style = card.style || {} |
| | |
| | | |
| | | if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置 |
| | | cell = this.getPrinter(cell, item.uuid) |
| | | } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'closetab') { // 标签关闭按钮,重置菜单Id |
| | | cell.$menuId = this.props.MenuID |
| | | } |
| | | } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height) { |
| | | cell.innerHeight = 'auto' |
| | |
| | | |
| | | if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置 |
| | | cell = this.getPrinter(cell, item.uuid) |
| | | } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'closetab') { // 标签关闭按钮,重置菜单Id |
| | | cell.$menuId = this.props.MenuID |
| | | } |
| | | |
| | | if (card.btnstyle) { // 兼容 |
| | |
| | | |
| | | if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置 |
| | | cell = this.getPrinter(cell, item.uuid) |
| | | } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'closetab') { // 标签关闭按钮,重置菜单Id |
| | | cell.$menuId = this.props.MenuID |
| | | } |
| | | |
| | | if (cell.btnstyle) { // 兼容 |
| | |
| | | static propTpyes = { |
| | | show: PropTypes.any, // 按钮显示样式控制 |
| | | position: PropTypes.any, // 按钮位置,工具栏为toolbar |
| | | MenuID: PropTypes.any, // 菜单ID |
| | | BID: PropTypes.string, // 主表ID |
| | | btn: PropTypes.object, // 按钮 |
| | | selectedData: PropTypes.any, // 子表中选择数据 |
| | |
| | | * @description 触发按钮操作 |
| | | */ |
| | | actionTrigger = (triggerId, record) => { |
| | | const { setting, selectedData, btn } = this.props |
| | | const { setting, selectedData, btn, MenuID } = this.props |
| | | const { loading } = this.state |
| | | |
| | | if ((triggerId && btn.uuid !== triggerId) || loading) return |
| | | |
| | | if (btn.funcType === 'closetab') { |
| | | MKEmitter.emit('closeTabView', MenuID || btn.$menuId) |
| | | |
| | | if (btn.refreshTab && btn.refreshTab.length > 0) { |
| | | MKEmitter.emit('reloadMenuView', btn.refreshTab[btn.refreshTab.length - 1], 'table') |
| | | } |
| | | return |
| | | } |
| | | |
| | | let data = record || selectedData || [] |
| | | |
| | |
| | | /> |
| | | ) |
| | | } else if (item.OpenType === 'funcbutton') { |
| | | if (item.funcType === 'changeuser') { |
| | | if (item.funcType === 'changeuser' || item.funcType === 'closetab') { |
| | | return ( |
| | | <ChangeUserButton |
| | | key={item.uuid} |
| | | show={item.show || 'actionList'} |
| | | BID={BID} |
| | | btn={item} |
| | | MenuID={MenuID} |
| | | setting={setting} |
| | | position="toolbar" |
| | | selectedData={selectedData} |
| | |
| | | /> |
| | | ) |
| | | } else if (item.OpenType === 'funcbutton') { |
| | | if (item.funcType === 'changeuser') { |
| | | if (item.funcType === 'changeuser' || item.funcType === 'closetab') { |
| | | return ( |
| | | <ChangeUserButton |
| | | key={item.uuid} |
| | |
| | | } |
| | | |
| | | return ( |
| | | <Form className={'main-form-field ' + _align} id="main-form-box"> |
| | | <Form className={'main-form-field ' + _align}> |
| | | <Row gutter={24}>{this.getFields()}</Row> |
| | | </Form> |
| | | ) |
| | |
| | | } |
| | | } else if (_opentype === 'funcbutton') { |
| | | if (_funcType === 'print') { |
| | | _options.push('execMode', 'intertype', 'Ot', 'execSuccess', 'execError') |
| | | _options.push('execMode', 'intertype', 'Ot', 'execSuccess', 'execError', 'controlField', 'controlVal') |
| | | if (_intertype === 'outer') { |
| | | _options.push('innerFunc', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackFunc') |
| | | } else if (_intertype === 'inner') { |
| | | _options.push('innerFunc') |
| | | } |
| | | } else if (_funcType === 'closetab') { |
| | | _options.push('refreshTab') |
| | | } |
| | | } else if (_opentype !== 'popview') { // 打开方式不是弹窗页面时 |
| | | if (_intertype === 'custom') { |
| | |
| | | _options.push('resetPageIndex') |
| | | } |
| | | |
| | | if (_Ot !== 'notRequired' && _opentype !== 'excelOut') { |
| | | if (_Ot !== 'notRequired' && _opentype !== 'excelOut' && _opentype !== 'funcbutton') { |
| | | _options.push('controlField', 'controlVal') |
| | | } |
| | | |
| | |
| | | showSearch |
| | | filterOption={(input, option) => option.props.children[2].toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | onChange={(value) => {this.optionChange(item.key, value)}} |
| | | allowClear={item.key === 'icon'} |
| | | getPopupContainer={() => document.getElementById('winter')} |
| | | > |
| | | {item.options.map((option, index) => |
| | |
| | | if (!el.origin && (el.OpenType === 'pop' || el.execMode === 'pop' || el.OpenType === 'popview' || (el.OpenType === 'tab' && el.tabTemplate === 'FormTab'))) { |
| | | this.props.setSubConfig(el) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '此按钮无子配置项!', |
| | | duration: 5 |
| | | }) |
| | | this.handleAction(el) |
| | | } |
| | | } |
| | | |
| | |
| | | </div> |
| | | } trigger="hover"> |
| | | <div className="page-card" style={{ flex: card.Width, opacity: opacity}}> |
| | | <div ref={node => drag(drop(node))}> |
| | | <div ref={node => drag(drop(node))} onDoubleClick={() => editCard(id)}> |
| | | <span className="ant-table-header-column"> |
| | | <div className="ant-table-column-sorters" title={card.label} style={{textAlign: card.Align}}> |
| | | <span className="ant-table-column-title">{card.label}</span> |
| | |
| | | options: opentypes |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | type: 'select', |
| | | key: 'funcType', |
| | | label: Formdict['header.form.funcType'], |
| | | initVal: card.funcType || '', |
| | |
| | | }, { |
| | | value: 'print', |
| | | text: '标签打印' |
| | | }, { |
| | | value: 'closetab', |
| | | text: '标签关闭' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | options: menulist |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | | key: 'refreshTab', |
| | | label: '刷新标签', |
| | | initVal: card.refreshTab || [], |
| | | required: false, |
| | | options: menulist |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'afterExecSuccess', |
| | | label: Formdict['header.form.afterExecSuccess'], |