| | |
| | | card: null, // 卡片信息,包括正反面 |
| | | formlist: null, // 设置表单信息 |
| | | elements: null, // 编辑组 |
| | | side: 'front' |
| | | side: 'front', |
| | | appType: sessionStorage.getItem('appType') |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | getSettingForms = () => { |
| | | const { cards } = this.props |
| | | const { setting } = this.state.card |
| | | const { card, appType } = this.state |
| | | |
| | | return getSettingForm(setting, cards.subtype === 'propcard') |
| | | let buttons = [] |
| | | card.elements && card.elements.forEach(item => { |
| | | if (item.eleType === 'button') { |
| | | buttons.push({ |
| | | value: item.uuid, |
| | | label: item.label |
| | | }) |
| | | } |
| | | }) |
| | | if (appType !== 'mob' && card.backElements) { |
| | | card.backElements.forEach(item => { |
| | | if (item.eleType === 'button') { |
| | | buttons.push({ |
| | | value: item.uuid, |
| | | label: item.label |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | return getSettingForm(card.setting, cards.subtype === 'propcard', buttons) |
| | | } |
| | | |
| | | updateSetting = (res) => { |
| | | const { card, side } = this.state |
| | | const { card, side, appType } = this.state |
| | | |
| | | if (appType === '' && res.menu) { |
| | | let list = null |
| | | try { |
| | | list = JSON.parse(sessionStorage.getItem('thdMenuList')) || [] |
| | | } catch (e) { |
| | | list = [] |
| | | } |
| | | |
| | | let id = res.menu[res.menu.length - 1] |
| | | |
| | | list.forEach(item => { |
| | | if (item.MenuID === id) { |
| | | res.MenuID = id |
| | | res.MenuName = item.MenuName |
| | | res.MenuNo = item.MenuNo |
| | | res.tabType = item.type |
| | | } |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | card: {...card, setting: res} |
| | |
| | | /** |
| | | * @description Setting表单配置信息 |
| | | */ |
| | | export default function (setting, hasPrimaryKey) { |
| | | export default function (setting, hasPrimaryKey, buttons = []) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | |
| | | let menulist = [] |
| | |
| | | {field: 'linkurl', values: ['link']}, |
| | | {field: 'open', values: ['menu', 'link']}, |
| | | {field: 'joint', values: ['menu', 'link']}, |
| | | {field: 'linkbtn', values: ['button']}, |
| | | ] |
| | | }, |
| | | { |
| | |
| | | {value: 'false', label: '否'}, |
| | | ], |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'linkbtn', |
| | | label: '关联按钮', |
| | | initval: setting.linkbtn || '', |
| | | required: true, |
| | | options: buttons |
| | | } |
| | | ] |
| | | |
| | | return cardSettingForm |
| | |
| | | |
| | | getSettingForms = () => { |
| | | const { cards } = this.props |
| | | const { setting } = this.state.card |
| | | const { card } = this.state |
| | | |
| | | if (cards.type !== 'carousel') { |
| | | return getTableSetting(setting, cards.columns) |
| | | let buttons = [] |
| | | card.elements && card.elements.forEach(item => { |
| | | if (item.eleType === 'button') { |
| | | buttons.push({ |
| | | value: item.uuid, |
| | | label: item.label |
| | | }) |
| | | } |
| | | }) |
| | | return getTableSetting(card.setting, cards.columns, buttons) |
| | | } else { |
| | | return getCarouselSetting(setting, cards.subtype === 'propcard') |
| | | return getCarouselSetting(card.setting, cards.subtype === 'propcard') |
| | | } |
| | | } |
| | | |
| | |
| | | <div className="mk-popover-control"> |
| | | <Icon className="plus" title="添加元素" onClick={this.addElement} type="plus" /> |
| | | <Icon className="plus" title="添加按钮" onClick={this.addButton} type="plus-square" /> |
| | | <NormalForm title="卡片设置" width={700} update={this.updateSetting} getForms={this.getSettingForms}> |
| | | <NormalForm title="卡片设置" width={800} update={this.updateSetting} getForms={this.getSettingForms}> |
| | | <Icon type="edit" style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <CopyComponent type="cardcell" card={card}/> |
| | |
| | | /** |
| | | * @description tablecard setting表单配置信息 |
| | | */ |
| | | export function getTableSetting (setting, columns) { |
| | | export function getTableSetting (setting, columns, buttons = []) { |
| | | let _columns = columns.map(item => ({value: item.field, label: item.label})) |
| | | _columns.push({value: '$Index', label: '序号(前端)'}) |
| | | let appType = sessionStorage.getItem('appType') |
| | | let menulist = [] |
| | | let appmenulist = [] |
| | | |
| | | if (appType) { |
| | | appmenulist = sessionStorage.getItem('appMenus') |
| | | if (appmenulist) { |
| | | try { |
| | | appmenulist = JSON.parse(appmenulist) |
| | | } catch (e) { |
| | | appmenulist = [] |
| | | } |
| | | } else { |
| | | appmenulist = [] |
| | | } |
| | | } else { |
| | | menulist = sessionStorage.getItem('fstMenuList') |
| | | if (menulist) { |
| | | try { |
| | | menulist = JSON.parse(menulist) |
| | | } catch (e) { |
| | | menulist = [] |
| | | } |
| | | } else { |
| | | menulist = [] |
| | | } |
| | | } |
| | | |
| | | const settingForm = [ |
| | | { |
| | |
| | | label: '对比值', |
| | | initval: setting.controlValue || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'click', |
| | | label: '点击事件', |
| | | initval: setting.click || '', |
| | | tooltip: '当选择触发按钮时,只有当卡片中只存在一个按钮时有效。', |
| | | required: false, |
| | | options: [ |
| | | {value: '', label: '无'}, |
| | | {value: 'menu', label: '菜单'}, |
| | | {value: 'link', label: '链接'}, |
| | | {value: 'button', label: '按钮'}, |
| | | ], |
| | | controlFields: [ |
| | | {field: 'menu', values: ['menu']}, |
| | | {field: 'linkurl', values: ['link']}, |
| | | {field: 'open', values: ['menu', 'link']}, |
| | | {field: 'joint', values: ['menu', 'link']}, |
| | | {field: 'linkbtn', values: ['button']}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'joint', |
| | | label: '参数拼接', |
| | | initval: setting.joint || 'true', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '是'}, |
| | | {value: 'false', label: '否'}, |
| | | ], |
| | | }, |
| | | { |
| | | type: appType ? 'select' : 'cascader', |
| | | field: 'menu', |
| | | label: '关联菜单', |
| | | initval: setting.menu || (appType ? '' : []), |
| | | required: true, |
| | | options: appType ? appmenulist : menulist, |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | | field: 'linkurl', |
| | | label: '链接', |
| | | initval: setting.linkurl || '', |
| | | required: true, |
| | | options: [], |
| | | span: 24 |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'open', |
| | | label: '打开方式', |
| | | initval: setting.open || 'blank', |
| | | required: false, |
| | | options: [ |
| | | {value: 'blank', label: '新窗口'}, |
| | | {value: 'self', label: '当前窗口'}, |
| | | ], |
| | | forbid: appType !== 'pc' |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'linkbtn', |
| | | label: '关联按钮', |
| | | initval: setting.linkbtn || '', |
| | | required: true, |
| | | options: buttons |
| | | } |
| | | ] |
| | | |
| | |
| | | const LogComponent = asyncIconComponent(() => import('@/menu/components/share/logcomponent')) |
| | | const UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent')) |
| | | const NormalHeader = asyncComponent(() => import('@/menu/components/share/normalheader')) |
| | | const ActionComponent = asyncComponent(() => import('@/menu/components/share/actioncomponent')) |
| | | |
| | | const { confirm } = Modal |
| | | |
| | |
| | | }, |
| | | elements: [] |
| | | }], |
| | | action: [], |
| | | btnlog: [], |
| | | } |
| | | |
| | |
| | | col.uuid = Utils.getuuid() |
| | | return col |
| | | }) |
| | | if (config.action) { |
| | | _card.action = config.action.map(col => { |
| | | col.uuid = Utils.getuuid() |
| | | return col |
| | | }) |
| | | } |
| | | } |
| | | this.setState({ |
| | | card: _card |
| | | }) |
| | | this.props.updateConfig(_card) |
| | | } else { |
| | | let _card = fromJS(card).toJS() |
| | | if (!_card.action) { |
| | | _card.action = [] |
| | | } |
| | | this.setState({ |
| | | card: fromJS(card).toJS() |
| | | card: _card |
| | | }) |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | addButton = (copy) => { |
| | | const { card } = this.state |
| | | |
| | | let newcard = {} |
| | | |
| | | if (copy) { |
| | | newcard = copy |
| | | newcard.focus = true |
| | | } else { |
| | | newcard.uuid = Utils.getuuid() |
| | | newcard.focus = true |
| | | |
| | | newcard.label = 'label' |
| | | newcard.Ot = 'requiredSgl' |
| | | newcard.OpenType = 'pop' |
| | | newcard.icon = '' |
| | | newcard.class = 'green' |
| | | newcard.intertype = card.setting.interType || 'system' |
| | | newcard.innerFunc = card.setting.innerFunc || '' |
| | | newcard.sysInterface = card.setting.sysInterface || '' |
| | | newcard.outerFunc = card.setting.outerFunc || '' |
| | | newcard.interface = card.setting.interface || '' |
| | | newcard.execSuccess = 'grid' |
| | | newcard.execError = 'never' |
| | | newcard.verify = null |
| | | newcard.show = 'button' |
| | | newcard.style = {marginRight: '15px'} |
| | | } |
| | | |
| | | // 注册事件-添加按钮 |
| | | MKEmitter.emit('addButton', card.uuid, newcard) |
| | | } |
| | | |
| | | setSubConfig = (item) => { |
| | | const { card, appType } = this.state |
| | | let btn = fromJS(item).toJS() |
| | | |
| | | if (btn.OpenType === 'pop' || btn.execMode === 'pop') { |
| | | if (!btn.modal) { |
| | | btn.modal = { |
| | | setting: { title: btn.label, width: appType === 'mob' ? 100 : 60, cols: '2', container: 'view', focus: '', finish: 'close', clickouter: 'unclose', display: 'modal' }, |
| | | tables: [], |
| | | groups: [], |
| | | fields: [] |
| | | } |
| | | } |
| | | MKEmitter.emit('changeModal', card, btn) |
| | | } else if (btn.OpenType === 'popview' && appType !== 'mob') { |
| | | MKEmitter.emit('changePopview', card, btn) |
| | | } |
| | | } |
| | | |
| | | clickComponent = (e) => { |
| | | if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') { |
| | | e.stopPropagation() |
| | |
| | | <div className="mk-popover-control"> |
| | | <Icon className="plus" title="添加卡片" onClick={() => this.addCard()} type="plus" /> |
| | | {appType !== 'mob' ? <Icon className="plus" title="添加搜索" onClick={() => this.addSearch()} type="plus-circle" /> : null} |
| | | <Icon className="plus" title="添加按钮" onClick={() => this.addButton()} type="plus-square" /> |
| | | <NormalForm title="表格设置" width={800} update={this.updateWrap} getForms={this.getWrapForms}> |
| | | <Icon type="edit" style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | |
| | | } trigger="hover"> |
| | | <Icon type="tool" /> |
| | | </Popover> |
| | | <ActionComponent config={card} type="datacard" setSubConfig={this.setSubConfig} updateaction={this.updateComponent}/> |
| | | <div style={{minHeight: 'calc(100% - 90px)'}}> |
| | | {card.subcards.map(subcard => (<CardSimpleComponent key={subcard.uuid} cards={card} card={subcard} updateElement={this.updateCard} move={this.move} deleteElement={this.deleteCard}/>))} |
| | | </div> |
| | |
| | | const { TextArea } = Input |
| | | const MkIcon = asyncComponent(() => import('@/components/mkIcon')) |
| | | const actionTypeOptions = { |
| | | pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'openmenu', 'open', 'output'], |
| | | prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'openmenu', 'open', 'output'], |
| | | exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'openmenu', 'open', 'output'], |
| | | pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'openmenu', 'open', 'output', 'refreshTab'], |
| | | prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'openmenu', 'open', 'output', 'refreshTab'], |
| | | exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'openmenu', 'open', 'output', 'refreshTab'], |
| | | excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'sheet', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width'], |
| | | excelOut: ['label', 'OpenType', 'intertype', 'show', 'icon', 'class', 'execSuccess', 'execError', 'syncComponent', 'resetPageIndex', 'pagination', 'search', 'width'], |
| | | popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'popClose', 'resetPageIndex', 'width', 'display', 'ratio', 'placement'], |
| | |
| | | } else if (item.type === 'cascader') { // 多选 |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.label}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}> |
| | | <Icon type="question-circle" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || [], |
| | | rules: [ |
| | |
| | | } else if (item.type === 'mcascader') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.label}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}> |
| | | <Icon type="question-circle" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal |
| | | })( |
| | |
| | | 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'], |
| | |
| | | }, { |
| | | value: 'mainline', |
| | | text: '刷新上级组件 - 行' |
| | | }, { |
| | | value: 'closetab', |
| | | text: '关闭标签' |
| | | }, |
| | | ...refresh] |
| | | }, |
| | |
| | | { |
| | | type: 'mcascader', |
| | | key: 'syncComponent', |
| | | label: '同步刷新', |
| | | label: '刷新组件', |
| | | initVal: card.syncComponent || [], |
| | | tooltip: '执行成功后,需要同步刷新的组件', |
| | | required: false, |
| | | options: modules |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | | key: 'refreshTab', |
| | | label: '刷新标签', |
| | | initVal: card.refreshTab || [], |
| | | tooltip: '执行成功后或标签关闭时,需要同步刷新的标签', |
| | | required: false, |
| | | forbid: isApp, |
| | | options: menulist |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'controlField', |
| | | label: '控制字段', |
| | |
| | | subtype: card.subtype, |
| | | setting: { interType: 'system' }, |
| | | wrap: { name: card.name, datatype: 'static', height: 50 }, |
| | | style: {borderTopColor: '#bcbcbc', borderTopWidth: '1px', paddingTop: '5px', fontSize: '13px' }, |
| | | style: {boxShadow: '0 0 3px #D9D9D9', shadowColor: '#D9D9D9', shadowBlur: '3px', paddingTop: '5px', fontSize: '13px' }, |
| | | menus: [], |
| | | columns: [], |
| | | scripts: [], |
| | |
| | | .modal-search-groups-row { |
| | | min-height: 20px!important; |
| | | padding-right: 30px; |
| | | padding-left: 20px; |
| | | margin-bottom: 15px; |
| | | .page-card { |
| | | float: left; |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { connect } from 'react-redux' |
| | | import { is, fromJS } from 'immutable' |
| | | import { notification } from 'antd' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import { modifyTabview } from '@/store/action' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import './index.scss' |
| | | |
| | | const CardCellComponent = asyncComponent(() => import('../cardcellList')) |
| | |
| | | } |
| | | } |
| | | |
| | | openView = () => { |
| | | const { card, data } = this.props |
| | | |
| | | if (card.setting.click === 'menu') { |
| | | let menu = null |
| | | |
| | | if (card.setting.MenuID) { |
| | | menu = { |
| | | MenuID: card.setting.MenuID, |
| | | MenuName: card.setting.MenuName, |
| | | MenuNo: card.setting.MenuNo, |
| | | type: card.setting.tabType |
| | | } |
| | | } else if (card.setting.menu && card.setting.menu.length > 0) { |
| | | let menu_id = card.setting.menu.slice(-1)[0] |
| | | menu = this.props.permMenus.filter(m => m.MenuID === menu_id)[0] || '' |
| | | |
| | | if (!menu) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '菜单已删除或没有访问权限!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | } |
| | | |
| | | let newtab = { |
| | | ...menu, |
| | | selected: true, |
| | | param: {} |
| | | } |
| | | |
| | | if (card.setting.joint === 'true') { |
| | | newtab.param.$BID = data.$$uuid || '' |
| | | } |
| | | |
| | | if (['linkage_navigation', 'linkage', 'menu_board'].includes(window.GLOB.navBar)) { |
| | | this.props.modifyTabview([newtab]) |
| | | } else { |
| | | let tabs = this.props.tabviews.filter((tab, i) => { |
| | | tab.selected = false |
| | | return tab.MenuID !== newtab.MenuID |
| | | }) |
| | | |
| | | if (this.props.tabviews.length > tabs.length) { |
| | | this.props.modifyTabview(fromJS(tabs).toJS()) |
| | | } |
| | | |
| | | this.setState({}, () => { |
| | | tabs.push(newtab) |
| | | this.props.modifyTabview(tabs) |
| | | }) |
| | | } |
| | | } else if (card.setting.click === 'link') { |
| | | let src = card.setting.linkurl |
| | | |
| | | if (card.setting.joint === 'true') { |
| | | let con = '?' |
| | | |
| | | if (/\?/ig.test(src)) { |
| | | con = '&' |
| | | } |
| | | |
| | | src = src + `${con}id=${data.$$uuid || ''}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}` |
| | | } |
| | | |
| | | window.open(src) |
| | | } else if (card.setting.click === 'button' && card.setting.linkbtn) { |
| | | MKEmitter.emit('triggerBtnId', card.setting.linkbtn, [data]) |
| | | } |
| | | } |
| | | |
| | | render() { |
| | | const { card, data, cards } = this.props |
| | | |
| | | return ( |
| | | <div className="card-item-box" style={card.style}> |
| | | <div className="card-item-box" style={card.style} onClick={this.openView}> |
| | | <CardCellComponent data={data} cards={cards} cardCell={card} elements={card.elements}/> |
| | | {card.setting.type === 'multi' ? <div className={'back-side ' + card.setting.transform} style={card.backStyle}> |
| | | <CardCellComponent data={data} cards={cards} cardCell={card} elements={card.backElements}/> |
| | |
| | | } |
| | | } |
| | | |
| | | export default CardBoxComponent |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | permMenus: state.permMenus, |
| | | tabviews: state.tabviews, |
| | | } |
| | | } |
| | | |
| | | const mapDispatchToProps = (dispatch) => { |
| | | return { |
| | | modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)) |
| | | } |
| | | } |
| | | |
| | | export default connect(mapStateToProps, mapDispatchToProps)(CardBoxComponent) |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { connect } from 'react-redux' |
| | | import { Spin, Empty, notification, message, Row, Col, Pagination } from 'antd' |
| | | |
| | | import Api from '@/api' |
| | |
| | | import nextImg from '@/assets/img/next.png' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import { modifyTabview } from '@/store/action' |
| | | import './index.scss' |
| | | |
| | | const CardItem = asyncComponent(() => import('../cardItem')) |
| | |
| | | let nextcards = [] |
| | | |
| | | _config.subcards.forEach(item => { |
| | | item.setting.$click = '' |
| | | if (item.setting.click === 'button') { |
| | | if (item.elements.filter(ele => ele.eleType === 'button').length < 2) { |
| | | item.setting.$click = ' trigger-button' |
| | | if (item.setting.click === 'button' && !item.setting.linkbtn) { |
| | | item.elements.forEach(ele => { |
| | | if (ele.eleType === 'button') { |
| | | item.setting.linkbtn = ele.uuid |
| | | } |
| | | }) |
| | | if (!item.setting.linkbtn) { |
| | | item.setting.click = '' |
| | | } |
| | | item.setting.click = '' |
| | | } |
| | | |
| | | if (item.$cardType !== 'extendCard') { |
| | |
| | | changeCard = (index, item) => { |
| | | const { config, selectKeys, selectedData, activeKey, data } = this.state |
| | | |
| | | this.openView(item) |
| | | |
| | | if (!config.wrap.cardType) return |
| | | |
| | | let _selectKeys = [] |
| | |
| | | MKEmitter.emit('resetSelectLine', config.uuid, (_item ? _item.$$uuid : ''), _item) |
| | | if (config.setting.$hasSyncModule) { |
| | | MKEmitter.emit('syncBalconyData', config.uuid, _selectedData, data.length === _selectedData.length) |
| | | } |
| | | } |
| | | |
| | | openView = (item) => { |
| | | const { card } = this.state |
| | | |
| | | if (card.setting.click === 'menu') { |
| | | let menu = null |
| | | |
| | | if (card.setting.menu && card.setting.menu.length > 0) { |
| | | let menu_id = card.setting.menu.slice(-1)[0] |
| | | menu = this.props.permMenus.filter(m => m.MenuID === menu_id)[0] || '' |
| | | } |
| | | |
| | | if (!menu) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '菜单已删除或没有访问权限!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let newtab = { |
| | | ...menu, |
| | | selected: true, |
| | | param: {} |
| | | } |
| | | |
| | | if (card.setting.joint === 'true') { |
| | | newtab.param.$BID = item.$$uuid |
| | | } |
| | | |
| | | if (['linkage_navigation', 'linkage', 'menu_board'].includes(window.GLOB.navBar)) { |
| | | this.props.modifyTabview([newtab]) |
| | | } else { |
| | | let tabs = this.props.tabviews.filter((tab, i) => { |
| | | tab.selected = false |
| | | return tab.MenuID !== newtab.MenuID |
| | | }) |
| | | |
| | | if (this.props.tabviews.length > tabs.length) { |
| | | this.props.modifyTabview(fromJS(tabs).toJS()) |
| | | } |
| | | |
| | | this.setState({}, () => { |
| | | tabs.push(newtab) |
| | | this.props.modifyTabview(tabs) |
| | | }) |
| | | } |
| | | } else if (card.setting.click === 'link') { |
| | | let src = card.setting.linkurl |
| | | |
| | | if (src.indexOf('paramsmain/') > -1) { |
| | | try { |
| | | let _url = src.split('paramsmain/')[0] + 'paramsmain/' |
| | | let _param = JSON.parse(window.decodeURIComponent(window.atob(src.split('paramsmain/')[1]))) |
| | | |
| | | _param.UserID = sessionStorage.getItem('UserID') |
| | | _param.LoginUID = sessionStorage.getItem('LoginUID') |
| | | _param.User_Name = sessionStorage.getItem('User_Name') |
| | | _param.param = { BID: item.$$uuid } |
| | | src = _url + window.btoa(window.encodeURIComponent(JSON.stringify(_param))) |
| | | } catch (e) { |
| | | console.warn('菜单参数解析错误!') |
| | | } |
| | | } else if (card.setting.joint === 'true') { |
| | | let con = '?' |
| | | |
| | | if (/\?/ig.test(src)) { |
| | | con = '&' |
| | | } |
| | | |
| | | src = src + `${con}id=${item.$$uuid}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}` |
| | | } |
| | | |
| | | window.open(src) |
| | | } |
| | | } |
| | | |
| | |
| | | <Row className="card-row-list"> |
| | | {offset ? <Col span={offset} style={{height: '10px'}}> </Col> : null} |
| | | {precards.map((item, index) => ( |
| | | <Col key={'pre' + index} className={'extend-card ' + item.setting.$click} span={item.setting.width || 6}> |
| | | <Col key={'pre' + index} className="extend-card" span={item.setting.width || 6}> |
| | | <CardItem card={item} cards={config} data={{$$BID: BID, $$type: 'extendCard'}}/> |
| | | </Col> |
| | | ))} |
| | | {data && data.map((item, index) => ( |
| | | <Col className={(activeKey === index ? ' active' : (selectKeys.indexOf(index) > -1 ? ' selected' : '')) + (card.setting.$click ? ' pointer' : '') + card.setting.$click} key={index} span={card.setting.width} onClick={() => {this.changeCard(index, item)}}> |
| | | <Col className={(activeKey === index ? ' active' : (selectKeys.indexOf(index) > -1 ? ' selected' : '')) + (card.setting.click ? ' pointer' : '')} key={index} span={card.setting.width} onClick={() => {this.changeCard(index, item)}}> |
| | | <CardItem card={card} cards={config} data={item}/> |
| | | </Col> |
| | | ))} |
| | | {nextcards.map((item, index) => ( |
| | | <Col key={'next' + index} className={'extend-card ' + item.setting.$click} span={item.setting.width || 6}> |
| | | <Col key={'next' + index} className="extend-card" span={item.setting.width || 6}> |
| | | <CardItem card={item} cards={config} data={{$$BID: BID, $$type: 'extendCard'}}/> |
| | | </Col> |
| | | ))} |
| | |
| | | } |
| | | } |
| | | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | permMenus: state.permMenus, |
| | | tabviews: state.tabviews, |
| | | } |
| | | } |
| | | |
| | | const mapDispatchToProps = (dispatch) => { |
| | | return { |
| | | modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)) |
| | | } |
| | | } |
| | | |
| | | export default connect(mapStateToProps, mapDispatchToProps)(DataCard) |
| | | export default DataCard |
| | |
| | | padding: 10px; |
| | | text-align: right; |
| | | } |
| | | .trigger-button { |
| | | .card-item-box { |
| | | .card-cell-list { |
| | | position: unset; |
| | | .mk-cell-btn { |
| | | position: unset; |
| | | .ant-btn { |
| | | position: unset; |
| | | } |
| | | .ant-btn::after { |
| | | content: ' '; |
| | | position: absolute; |
| | | top: 0; |
| | | bottom: 0; |
| | | left: 0; |
| | | right: 0; |
| | | z-index: 2; |
| | | opacity: 0; |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .custom-card-box::after { |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { connect } from 'react-redux' |
| | | import { Spin, notification, Col, Row } from 'antd' |
| | | import moment from 'moment' |
| | | |
| | |
| | | import UtilsDM from '@/utils/utils-datamanage.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import { modifyTabview } from '@/store/action' |
| | | import './index.scss' |
| | | |
| | | const CardItem = asyncComponent(() => import('../cardItem')) |
| | |
| | | |
| | | let _width = 0 |
| | | _config.subcards.forEach(card => { |
| | | card.setting.$click = '' |
| | | if (card.setting.click === 'button') { |
| | | if (card.elements.filter(ele => ele.eleType === 'button').length < 2) { |
| | | card.setting.$click = ' trigger-button' |
| | | if (card.setting.click === 'button' && !card.setting.linkbtn) { |
| | | card.elements.forEach(ele => { |
| | | if (ele.eleType === 'button') { |
| | | card.setting.linkbtn = ele.uuid |
| | | } |
| | | }) |
| | | if (!card.setting.linkbtn) { |
| | | card.setting.click = '' |
| | | } |
| | | card.setting.click = '' |
| | | } |
| | | _width += card.setting.width |
| | | card.elements = card.elements.map(item => { |
| | |
| | | changeCard = (index, item) => { |
| | | const { config, data, activeKey } = this.state |
| | | |
| | | this.openView(item) |
| | | |
| | | if (!config.wrap.cardType || activeKey === index) return |
| | | |
| | | this.setState({ |
| | |
| | | |
| | | MKEmitter.emit('resetSelectLine', config.uuid, (item.setting.primaryId || ''), data) |
| | | } |
| | | |
| | | openView = (item) => { |
| | | if (item.setting.click === 'menu') { |
| | | let menu = null |
| | | |
| | | if (item.setting.menu && item.setting.menu.length > 0) { |
| | | let menu_id = item.setting.menu.slice(-1)[0] |
| | | menu = this.props.permMenus.filter(m => m.MenuID === menu_id)[0] || '' |
| | | } |
| | | |
| | | if (!menu) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '菜单已删除或没有访问权限!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let newtab = { |
| | | ...menu, |
| | | selected: true, |
| | | param: {} |
| | | } |
| | | |
| | | if (item.setting.joint === 'true') { |
| | | newtab.param.$BID = item.setting.primaryId || '' |
| | | } |
| | | |
| | | if (['linkage_navigation', 'linkage', 'menu_board'].includes(window.GLOB.navBar)) { |
| | | this.props.modifyTabview([newtab]) |
| | | } else { |
| | | let tabs = this.props.tabviews.filter((tab, i) => { |
| | | tab.selected = false |
| | | return tab.MenuID !== newtab.MenuID |
| | | }) |
| | | |
| | | if (this.props.tabviews.length > tabs.length) { |
| | | this.props.modifyTabview(fromJS(tabs).toJS()) |
| | | } |
| | | |
| | | this.setState({}, () => { |
| | | tabs.push(newtab) |
| | | this.props.modifyTabview(tabs) |
| | | }) |
| | | } |
| | | } else if (item.setting.click === 'link') { |
| | | let src = item.setting.linkurl |
| | | |
| | | if (src.indexOf('paramsmain/') > -1) { |
| | | try { |
| | | let _url = src.split('paramsmain/')[0] + 'paramsmain/' |
| | | let _param = JSON.parse(window.decodeURIComponent(window.atob(src.split('paramsmain/')[1]))) |
| | | |
| | | _param.UserID = sessionStorage.getItem('UserID') |
| | | _param.LoginUID = sessionStorage.getItem('LoginUID') |
| | | _param.User_Name = sessionStorage.getItem('User_Name') |
| | | _param.param = { BID: item.setting.primaryId } |
| | | src = _url + window.btoa(window.encodeURIComponent(JSON.stringify(_param))) |
| | | } catch (e) { |
| | | console.warn('菜单参数解析错误!') |
| | | } |
| | | } else if (item.setting.joint === 'true') { |
| | | let con = '?' |
| | | |
| | | if (/\?/ig.test(src)) { |
| | | con = '&' |
| | | } |
| | | |
| | | src = src + `${con}id=${item.setting.primaryId}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}` |
| | | } |
| | | |
| | | window.open(src) |
| | | } |
| | | } |
| | | |
| | | |
| | | render() { |
| | | const { config, loading, data, activeKey } = this.state |
| | |
| | | <NormalHeader config={config}/> |
| | | <Row className={`card-row-list ${config.wrap.cardType || ''} ${config.wrap.scale || ''}`}> |
| | | {config.subcards.map((item, index) => ( |
| | | <Col className={(activeKey === index ? 'active' : '') + (item.setting.click ? ' pointer' : '') + item.setting.$click} key={index} span={item.setting.width || 6} offset={item.offset || 0} onClick={() => {this.changeCard(index, item)}}> |
| | | <Col className={(activeKey === index ? 'active' : '') + (item.setting.click ? ' pointer' : '')} key={index} span={item.setting.width || 6} offset={item.offset || 0} onClick={() => {this.changeCard(index, item)}}> |
| | | <CardItem card={item} cards={config} data={data}/> |
| | | </Col> |
| | | ))} |
| | |
| | | } |
| | | } |
| | | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | permMenus: state.permMenus, |
| | | tabviews: state.tabviews, |
| | | } |
| | | } |
| | | |
| | | const mapDispatchToProps = (dispatch) => { |
| | | return { |
| | | modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)) |
| | | } |
| | | } |
| | | |
| | | export default connect(mapStateToProps, mapDispatchToProps)(PropCard) |
| | | export default PropCard |
| | |
| | | background: #ffffff; |
| | | } |
| | | } |
| | | .trigger-button { |
| | | .card-item-box { |
| | | .card-cell-list { |
| | | position: unset; |
| | | .mk-cell-btn { |
| | | position: unset; |
| | | .ant-btn { |
| | | position: unset; |
| | | } |
| | | .ant-btn::after { |
| | | content: ' '; |
| | | position: absolute; |
| | | top: 0; |
| | | bottom: 0; |
| | | left: 0; |
| | | right: 0; |
| | | z-index: 2; |
| | | opacity: 0; |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .custom-card-box::after { |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { connect } from 'react-redux' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Spin, notification, Row, Col, Empty, Pagination } from 'antd' |
| | | |
| | |
| | | import Utils from '@/utils/utils.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import UtilsDM from '@/utils/utils-datamanage.js' |
| | | import { modifyTabview } from '@/store/action' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import './index.scss' |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | openView = (card, data) => { |
| | | if (card.setting.click === 'menu') { |
| | | let menu = null |
| | | |
| | | if (card.setting.MenuID) { |
| | | menu = { |
| | | MenuID: card.setting.MenuID, |
| | | MenuName: card.setting.MenuName, |
| | | MenuNo: card.setting.MenuNo, |
| | | type: card.setting.tabType |
| | | } |
| | | } else if (card.setting.menu && card.setting.menu.length > 0) { |
| | | let menu_id = card.setting.menu.slice(-1)[0] |
| | | menu = this.props.permMenus.filter(m => m.MenuID === menu_id)[0] || '' |
| | | |
| | | if (!menu) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '菜单已删除或没有访问权限!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | } |
| | | |
| | | let newtab = { |
| | | ...menu, |
| | | selected: true, |
| | | param: {} |
| | | } |
| | | |
| | | if (card.setting.joint === 'true') { |
| | | newtab.param.$BID = data.$$uuid || '' |
| | | } |
| | | |
| | | if (['linkage_navigation', 'linkage', 'menu_board'].includes(window.GLOB.navBar)) { |
| | | this.props.modifyTabview([newtab]) |
| | | } else { |
| | | let tabs = this.props.tabviews.filter((tab, i) => { |
| | | tab.selected = false |
| | | return tab.MenuID !== newtab.MenuID |
| | | }) |
| | | |
| | | if (this.props.tabviews.length > tabs.length) { |
| | | this.props.modifyTabview(fromJS(tabs).toJS()) |
| | | } |
| | | |
| | | this.setState({}, () => { |
| | | tabs.push(newtab) |
| | | this.props.modifyTabview(tabs) |
| | | }) |
| | | } |
| | | } else if (card.setting.click === 'link') { |
| | | let src = card.setting.linkurl |
| | | |
| | | if (card.setting.joint === 'true') { |
| | | let con = '?' |
| | | |
| | | if (/\?/ig.test(src)) { |
| | | con = '&' |
| | | } |
| | | |
| | | src = src + `${con}id=${data.$$uuid || ''}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}` |
| | | } |
| | | |
| | | window.open(src) |
| | | } else if (card.setting.click === 'button' && card.setting.linkbtn) { |
| | | MKEmitter.emit('triggerBtnId', card.setting.linkbtn, [data]) |
| | | } |
| | | } |
| | | |
| | | getLines = (data) => { |
| | | const { config } = this.state |
| | | |
| | |
| | | |
| | | line.push( |
| | | <Col key={index} span={24}> |
| | | <div className="card-item-box" style={item.style}> |
| | | <div className="card-item-box" style={item.style} onClick={() => {this.openView(item, data)}}> |
| | | <CardCellComponent data={data} cards={config} cardCell={item} elements={item.elements}/> |
| | | </div> |
| | | </Col> |
| | |
| | | } |
| | | } |
| | | |
| | | export default TableCard |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | permMenus: state.permMenus, |
| | | tabviews: state.tabviews, |
| | | } |
| | | } |
| | | |
| | | const mapDispatchToProps = (dispatch) => { |
| | | return { |
| | | modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)) |
| | | } |
| | | } |
| | | |
| | | export default connect(mapStateToProps, mapDispatchToProps)(TableCard) |
| | |
| | | } else if (card.setting.click === 'link') { |
| | | let src = card.setting.linkurl |
| | | |
| | | if (src.indexOf('paramsmain/') > -1) { |
| | | try { |
| | | let _url = src.split('paramsmain/')[0] + 'paramsmain/' |
| | | let _param = JSON.parse(window.decodeURIComponent(window.atob(src.split('paramsmain/')[1]))) |
| | | |
| | | _param.UserID = sessionStorage.getItem('UserID') |
| | | _param.LoginUID = sessionStorage.getItem('LoginUID') |
| | | _param.User_Name = sessionStorage.getItem('User_Name') |
| | | _param.param = { BID: item.$$uuid } |
| | | src = _url + window.btoa(window.encodeURIComponent(JSON.stringify(_param))) |
| | | } catch (e) { |
| | | console.warn('菜单参数解析错误!') |
| | | } |
| | | } else if (card.setting.joint === 'true') { |
| | | if (card.setting.joint === 'true') { |
| | | let con = '?' |
| | | |
| | | if (/\?/ig.test(src)) { |
| | |
| | | } else if (item.setting.click === 'link') { |
| | | let src = item.setting.linkurl |
| | | |
| | | if (src.indexOf('paramsmain/') > -1) { |
| | | try { |
| | | let _url = src.split('paramsmain/')[0] + 'paramsmain/' |
| | | let _param = JSON.parse(window.decodeURIComponent(window.atob(src.split('paramsmain/')[1]))) |
| | | |
| | | _param.UserID = sessionStorage.getItem('UserID') |
| | | _param.LoginUID = sessionStorage.getItem('LoginUID') |
| | | _param.User_Name = sessionStorage.getItem('User_Name') |
| | | _param.param = { BID: item.setting.primaryId } |
| | | src = _url + window.btoa(window.encodeURIComponent(JSON.stringify(_param))) |
| | | } catch (e) { |
| | | console.warn('菜单参数解析错误!') |
| | | } |
| | | } else if (item.setting.joint === 'true') { |
| | | if (item.setting.joint === 'true') { |
| | | let con = '?' |
| | | |
| | | if (/\?/ig.test(src)) { |
| | |
| | | cell.ContainerId = this.state.ContainerId |
| | | cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' |
| | | cell.$menuId = item.uuid |
| | | cell.$MenuID = this.props.MenuID |
| | | cell.$tabId = tabId |
| | | cell.$view = 'CustomPage' |
| | | |
| | | 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) { // 兼容 |
| | |
| | | cell.ContainerId = this.state.ContainerId |
| | | cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' |
| | | cell.$menuId = item.uuid |
| | | cell.$MenuID = this.props.MenuID |
| | | cell.$tabId = tabId |
| | | cell.$view = 'CustomPage' |
| | | |
| | | 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 || {} |
| | |
| | | cell.ContainerId = this.state.ContainerId |
| | | cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' |
| | | cell.$menuId = item.uuid |
| | | cell.$MenuID = this.props.MenuID |
| | | cell.$tabId = tabId |
| | | cell.$view = 'CustomPage' |
| | | |
| | | 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 || {} |
| | |
| | | cell.ContainerId = this.state.ContainerId |
| | | cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' |
| | | cell.$menuId = item.uuid |
| | | cell.$MenuID = this.props.MenuID |
| | | cell.$tabId = tabId |
| | | cell.$view = 'CustomPage' |
| | | |
| | | 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' |
| | |
| | | cell.ContainerId = this.state.ContainerId |
| | | cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' |
| | | cell.$menuId = item.uuid |
| | | cell.$MenuID = this.props.MenuID |
| | | cell.$tabId = tabId |
| | | cell.$view = 'CustomPage' |
| | | |
| | | 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 || {} |
| | | card.style = {...card.style, ...card.btnstyle} |
| | |
| | | cell.ContainerId = this.state.ContainerId |
| | | cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' |
| | | cell.$menuId = item.uuid |
| | | cell.$MenuID = this.props.MenuID |
| | | cell.$tabId = tabId |
| | | cell.$view = 'CustomPage' |
| | | |
| | | 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) { // 兼容 |
| | |
| | | } |
| | | |
| | | componentDidMount () { |
| | | const { position } = this.props |
| | | |
| | | if (position === 'toolbar') { |
| | | MKEmitter.addListener('triggerBtnId', this.actionTrigger) |
| | | } |
| | | MKEmitter.addListener('triggerBtnId', this.actionTrigger) |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | |
| | | if ((triggerId && btn.uuid !== triggerId) || loading) return |
| | | |
| | | if (btn.funcType === 'closetab') { |
| | | MKEmitter.emit('closeTabView', MenuID || btn.$menuId) |
| | | MKEmitter.emit('closeTabView', MenuID || btn.$MenuID) |
| | | |
| | | if (btn.refreshTab && btn.refreshTab.length > 0) { |
| | | MKEmitter.emit('reloadMenuView', btn.refreshTab[btn.refreshTab.length - 1], 'table') |
| | |
| | | } |
| | | |
| | | componentDidMount () { |
| | | const { position } = this.props |
| | | |
| | | if (position === 'toolbar') { |
| | | MKEmitter.addListener('triggerBtnId', this.actionTrigger) |
| | | } |
| | | MKEmitter.addListener('triggerBtnId', this.actionTrigger) |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | |
| | | } |
| | | |
| | | componentDidMount () { |
| | | const { position } = this.props |
| | | |
| | | if (position === 'toolbar') { |
| | | MKEmitter.addListener('triggerBtnId', this.actionTrigger) |
| | | } |
| | | MKEmitter.addListener('triggerBtnId', this.actionTrigger) |
| | | MKEmitter.addListener('returnModuleParam', this.triggerExcelout) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | componentDidMount () { |
| | | const { position } = this.props |
| | | |
| | | if (position === 'toolbar') { |
| | | MKEmitter.addListener('triggerBtnId', this.actionTrigger) |
| | | } |
| | | MKEmitter.addListener('triggerBtnId', this.actionTrigger) |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | |
| | | id = res.mk_b_id || res[btn.output] || '' |
| | | } |
| | | |
| | | if (btn.execSuccess !== 'never') { |
| | | if (btn.execSuccess === 'closetab') { |
| | | MKEmitter.emit('closeTabView', btn.$MenuID) |
| | | } else if (btn.execSuccess !== 'never') { |
| | | MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execSuccess, btn, id) |
| | | } |
| | | |
| | | if (btn.refreshTab && btn.refreshTab.length > 0) { |
| | | MKEmitter.emit('reloadMenuView', btn.refreshTab[btn.refreshTab.length - 1], 'table') |
| | | } |
| | | } |
| | | |
| | | sendMessage = () => { |
| | |
| | | } |
| | | |
| | | componentDidMount () { |
| | | const { position } = this.props |
| | | |
| | | if (position === 'toolbar') { |
| | | MKEmitter.addListener('triggerBtnId', this.actionTrigger) |
| | | } |
| | | MKEmitter.addListener('triggerBtnId', this.actionTrigger) |
| | | MKEmitter.addListener('openNewTab', this.openNewTab) |
| | | MKEmitter.addListener('refreshPopButton', this.refreshPopButton) |
| | | } |
| | |
| | | } |
| | | |
| | | componentDidMount () { |
| | | const { position } = this.props |
| | | |
| | | if (position === 'toolbar') { |
| | | MKEmitter.addListener('triggerBtnId', this.actionTrigger) |
| | | } |
| | | MKEmitter.addListener('triggerBtnId', this.actionTrigger) |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | |
| | | } |
| | | |
| | | componentDidMount () { |
| | | const { position } = this.props |
| | | |
| | | if (position === 'toolbar') { |
| | | MKEmitter.addListener('triggerBtnId', this.actionTrigger) |
| | | } |
| | | MKEmitter.addListener('triggerBtnId', this.actionTrigger) |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | |
| | | |
| | | Api.getSystemConfig(_param).then(result => { |
| | | if (result.status) { |
| | | let thdMenuList = [] |
| | | let menulist = result.fst_menu.map(fst => { |
| | | let fstItem = { |
| | | MenuID: fst.MenuID, |
| | |
| | | EasyCode: trd.EasyCode, |
| | | value: trd.MenuID, |
| | | label: trd.MenuName, |
| | | type: 'CommonTable', |
| | | disabled: false |
| | | } |
| | | |
| | | if (trd.PageParam) { |
| | | try { |
| | | trd.PageParam = JSON.parse(trd.PageParam) |
| | | trdItem.type = trd.PageParam.Template || 'CommonTable' |
| | | } catch (e) { |
| | | |
| | | } |
| | | } |
| | | |
| | | thdMenuList.push(trdItem) |
| | | |
| | | return trdItem |
| | | }) |
| | |
| | | }) |
| | | |
| | | sessionStorage.setItem('fstMenuList', JSON.stringify(menulist)) |
| | | sessionStorage.setItem('thdMenuList', JSON.stringify(thdMenuList)) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | Api.getSystemConfig(_param).then(result => { |
| | | if (result.status) { |
| | | let thdMenu = null |
| | | let thdMenuList = [] |
| | | let menulist = result.fst_menu.map(fst => { |
| | | let fstItem = { |
| | | MenuID: fst.MenuID, |
| | |
| | | EasyCode: trd.EasyCode, |
| | | value: trd.MenuID, |
| | | label: trd.MenuName, |
| | | type: 'CommonTable', |
| | | disabled: trd.MenuID === MenuId |
| | | } |
| | | |
| | | if (MenuId === trd.MenuID) { |
| | | thdMenu = trdItem |
| | | } |
| | | |
| | | if (trd.PageParam) { |
| | | try { |
| | | trd.PageParam = JSON.parse(trd.PageParam) |
| | | trdItem.type = trd.PageParam.Template || 'CommonTable' |
| | | } catch (e) { |
| | | |
| | | } |
| | | } |
| | | |
| | | thdMenuList.push(trdItem) |
| | | |
| | | return trdItem |
| | | }) |
| | | } |
| | |
| | | } |
| | | }) |
| | | sessionStorage.setItem('fstMenuList', JSON.stringify(menulist)) |
| | | sessionStorage.setItem('thdMenuList', JSON.stringify(thdMenuList)) |
| | | this.props.updateConfig({...config, fstMenuId: thdMenu ? thdMenu.FstId : ''}) |
| | | |
| | | this.setState({ |