| | |
| | | |
| | | this.props.modifyMenuTree(res.menulist) |
| | | this.props.modifyMainMenu(mainMenu) |
| | | this.props.initMenuPermission(res.permMenus) |
| | | this.props.initMenuPermission(res.thdMenuList) |
| | | |
| | | resolve(_menu) |
| | | }) |
| | |
| | | |
| | | getMenulist = (result) => { |
| | | let thdMenuList = [] |
| | | let permMenus = {} |
| | | let iframes = ['Main/Index', 'bda/rdt', 'Home/rdt'] |
| | | let menulist = result.fst_menu.map(fst => { |
| | | let fstItem = { |
| | |
| | | } |
| | | } |
| | | |
| | | permMenus[trd.MenuID] = true |
| | | thdMenuList.push(trdItem) |
| | | |
| | | return trdItem |
| | |
| | | return fstItem |
| | | }) |
| | | |
| | | return { menulist, thdMenuList, permMenus} |
| | | return { menulist, thdMenuList } |
| | | } |
| | | |
| | | reload = () => { |
| | |
| | | sessionStorage.removeItem('isEditState') |
| | | sessionStorage.removeItem('loginError') |
| | | |
| | | // fetch(`./${process.env.NODE_ENV === 'production' ? 'build/' : ''}options.json`) |
| | | fetch(`./options.json`) |
| | | .then(response => response.json()) |
| | | .catch(() => { |
| | |
| | | UNSAFE_componentWillMount () { |
| | | const { card, type } = this.props |
| | | |
| | | let _menulist = this.props.formlist.filter(form => form.key === 'linkmenu')[0] || '' |
| | | let _opentype = card.OpenType // 打开方式 |
| | | let _intertype = card.intertype || 'system' // 接口类型 |
| | | let _funcType = card.funcType || 'print' // 功能按钮默认类型 |
| | |
| | | |
| | | this.setState({ |
| | | openType: _opentype, |
| | | menulist: _menulist.options || [], |
| | | interType: _intertype, |
| | | funcType: _funcType, |
| | | formlist: this.props.formlist.map(item => { |
| | |
| | | } |
| | | ] |
| | | })( |
| | | <Cascader |
| | | options={this.state.menulist} |
| | | placeholder="" |
| | | /> |
| | | <Cascader options={item.options || []} placeholder=""/> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | |
| | | handleConfirm = () => { |
| | | const { setting } = this.props |
| | | const { menulist } = this.state |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | |
| | | } else if (this.props.card.Ot === 'requiredOnce' && ['notRequired', 'requiredSgl', 'required'].includes(values.Ot)) { |
| | | values.verify.uniques = [] |
| | | } |
| | | } |
| | | |
| | | // 关联三级菜单 |
| | | if (values.OpenType === 'tab' && values.linkmenu && values.linkmenu.length > 0) { |
| | | let linkThdMenu = '' |
| | | menulist.forEach(menu => { |
| | | if (menu.value === values.linkmenu[0]) { |
| | | menu.children.forEach(item => { |
| | | if (item.value === values.linkmenu[1]) { |
| | | item.children.forEach(cell => { |
| | | if (cell.value === values.linkmenu[2]) { |
| | | linkThdMenu = cell |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | values.linkThdMenu = linkThdMenu |
| | | } |
| | | |
| | | resolve(values) |
| | |
| | | <p>{this.state.dict['model.tooltip.func.outface']}</p> |
| | | </div> |
| | | |
| | | let menulist = [] |
| | | |
| | | if (menu.fstMenuList) { |
| | | let trees = fromJS(menu.fstMenuList).toJS() |
| | | |
| | | menulist = trees.map(fst => { |
| | | fst.value = fst.MenuID |
| | | fst.label = fst.MenuName |
| | | fst.isLeaf = false |
| | | fst.children = fst.children.map(snd => { |
| | | snd.value = snd.MenuID |
| | | snd.label = snd.MenuName |
| | | |
| | | snd.children = snd.children.map(thd => { |
| | | thd.value = thd.MenuID |
| | | thd.label = thd.MenuName |
| | | thd.disabled = thd.MenuID === menu.MenuID |
| | | return thd |
| | | }) |
| | | return snd |
| | | }) |
| | | return fst |
| | | }) |
| | | } |
| | | |
| | | let menulist = menu.fstMenuList ? menu.fstMenuList : [] |
| | | let modules = this.getModules(menu.components, config.uuid) |
| | | |
| | | this.setState({ |
| | |
| | | * @param {object} card // 图表对象 |
| | | * @param {Array} columns // 显示列 |
| | | */ |
| | | export function getBaseForm (card, MenuType, fstMenuList = []) { |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | if (roleList) { |
| | | try { |
| | | roleList = JSON.parse(roleList) |
| | | } catch { |
| | | roleList = [] |
| | | } |
| | | } else { |
| | | roleList = [] |
| | | } |
| | | |
| | | return [ |
| | | { |
| | | type: 'text', |
| | | key: 'title', |
| | | label: '标题', |
| | | initVal: card.title, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'name', |
| | | label: '组件名称', |
| | | initVal: card.name, |
| | | tooltip: '用于组件间的区分。', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'width', |
| | | label: '宽度', |
| | | initVal: card.width, |
| | | tooltip: '栅格布局,每行等分为24列。', |
| | | min: 1, |
| | | max: 24, |
| | | decimal: 0, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'height', |
| | | label: '高度', |
| | | initVal: card.height, |
| | | min: 100, |
| | | max: 1000, |
| | | decimal: 0, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'blacklist', |
| | | label: '黑名单', |
| | | initVal: card.blacklist || [], |
| | | multi: true, |
| | | required: false, |
| | | forbid: MenuType === 'billPrint', |
| | | options: roleList |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | | key: 'linkmenu', |
| | | label: '关联菜单', |
| | | initVal: card.linkmenu || [], |
| | | tooltip: '双击饼图,会打开关联的菜单。', |
| | | required: false, |
| | | forbid: MenuType === 'billPrint', |
| | | options: fstMenuList |
| | | } |
| | | ] |
| | | } |
| | | /** |
| | | * @description 获取图表视图配置表单 |
| | | * @param {object} card // 图表对象 |
| | | * @param {Array} columns // 显示列 |
| | | */ |
| | | export function getOptionForm (card, columns) { |
| | | let xfields = columns.filter(item => /^Nvarchar/ig.test(item.datatype)) |
| | | let yfields = columns.filter(item => /^(Int|Decimal)/ig.test(item.datatype)) |
| | |
| | | import { Modal, Form, Row, Col, Select, Icon, Radio, Tooltip, Input, InputNumber, Tabs, Button } from 'antd' |
| | | |
| | | import Utils from '@/utils/utils.js' |
| | | import { getOptionForm } from './formconfig' |
| | | import { getBaseForm } from '../../antv-bar/chartcompile/formconfig' |
| | | import { getBaseForm, getOptionForm } from './formconfig' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import ColorSketch from '@/mob/colorsketch' |
| | | import './index.scss' |
| | |
| | | |
| | | class LineChartDrawerForm extends Component { |
| | | static propTpyes = { |
| | | MenuType: PropTypes.any, |
| | | menu: PropTypes.any, |
| | | dict: PropTypes.object, |
| | | plot: PropTypes.object, |
| | | config: PropTypes.object, |
| | |
| | | } |
| | | |
| | | showDrawer = () => { |
| | | const { config, MenuType } = this.props |
| | | const { config, menu } = this.props |
| | | |
| | | this.setState({ |
| | | visible: true, |
| | | view: 'normal', |
| | | plot: fromJS(config.plot).toJS(), |
| | | baseFormlist: getBaseForm(config.plot, MenuType), |
| | | baseFormlist: getBaseForm(config.plot, menu.MenuType, menu.fstMenuList), |
| | | formlist: getOptionForm(config.plot, config.columns) |
| | | }) |
| | | } |
| | |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | {menu && menu.MenuType !== 'billPrint' ? <Icon className="plus" title="添加搜索" onClick={this.addSearch} type="plus-circle" /> : null} |
| | | {menu ? <ChartCompileForm config={card} MenuType={menu.MenuType} dict={this.state.dict} plotchange={this.updateComponent}/> : null} |
| | | <ChartCompileForm config={card} menu={menu} dict={this.state.dict} plotchange={this.updateComponent}/> |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
| | | <Icon className="close" title="delete" type="delete" onClick={() => this.props.deletecomponent(card.uuid)} /> |
| | | <SettingComponent config={card} updateConfig={this.updateComponent}/> |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Input, Tooltip, Icon, InputNumber, Select, Radio } from 'antd' |
| | | import { Form, Row, Col, Input, Tooltip, Icon, InputNumber, Select, Radio, Cascader } from 'antd' |
| | | |
| | | import './index.scss' |
| | | |
| | |
| | | })( |
| | | <Select mode={item.multi ? 'multiple' : ''}> |
| | | {item.options.map((option, index) => |
| | | <Select.Option key={index} value={option.field}> |
| | | {option.label} |
| | | <Select.Option key={index} value={option.field || option.value}> |
| | | {option.label || option.text} |
| | | </Select.Option> |
| | | )} |
| | | </Select> |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'cascader') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <Icon type="question-circle" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || [], |
| | | rules: [ |
| | | { |
| | | required: !!item.required, |
| | | message: this.props.dict['form.required.select'] + item.label + '!' |
| | | } |
| | | ] |
| | | })( |
| | | <Cascader options={item.options} placeholder=""/> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } |
| | | }) |
| | | return fields |
| | |
| | | const { card } = this.props |
| | | |
| | | if (card.isNew) { |
| | | let subcards = null |
| | | |
| | | if (card.config) { |
| | | subcards = JSON.parse(card.config) |
| | | subcards = subcards.map(scard => { |
| | | scard.uuid = Utils.getuuid() |
| | | scard.elements = scard.elements.map(elem => { |
| | | elem.uuid = Utils.getuuid() |
| | | return elem |
| | | }) |
| | | return scard |
| | | }) |
| | | } else { |
| | | subcards = [{ |
| | | uuid: Utils.getuuid(), |
| | | setting: { width: 24, type: 'simple'}, |
| | | style: { |
| | | paddingTop: '5px', paddingBottom: '5px', paddingLeft: '15px', paddingRight: '15px', |
| | | }, |
| | | elements: [] |
| | | }] |
| | | } |
| | | |
| | | let _card = { |
| | | uuid: card.uuid, |
| | | type: card.type, |
| | |
| | | style: { marginLeft: '8px', marginRight: '8px', marginTop: '8px', marginBottom: '8px' }, |
| | | headerStyle: { fontSize: '16px' }, |
| | | columns: [], |
| | | scripts: [], |
| | | subcards: subcards |
| | | scripts: [] |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | this.props.updateConfig(component) |
| | | } |
| | | |
| | | /** |
| | | * @description 单个卡片信息更新 |
| | | */ |
| | | updateCard = (cell) => { |
| | | let card = fromJS(this.state.card).toJS() |
| | | |
| | | card.subcards = card.subcards.map(item => { |
| | | if (item.uuid === cell.uuid) return cell |
| | | return item |
| | | }) |
| | | |
| | | this.setState({card}) |
| | | |
| | | this.props.updateConfig(card) |
| | | } |
| | | |
| | | /** |
| | | * @description 单个卡片信息更新 |
| | | */ |
| | | deleteCard = (cell) => { |
| | | deleteCard = () => { |
| | | let card = fromJS(this.state.card).toJS() |
| | | let _this = this |
| | | |
| | | confirm({ |
| | | content: '确定删除卡片吗?', |
| | | onOk() { |
| | | card.subcards = card.subcards.filter(item => item.uuid !== cell.uuid) |
| | | |
| | | _this.setState({card}) |
| | | _this.props.updateConfig(card) |
| | | }, |
| | |
| | | addCard = () => { |
| | | let card = fromJS(this.state.card).toJS() |
| | | |
| | | let newcard = { |
| | | uuid: Utils.getuuid(), |
| | | setting: { width: 6, type: 'simple'}, |
| | | style: { |
| | | paddingTop: '5px', paddingBottom: '5px', paddingLeft: '15px', paddingRight: '15px', |
| | | }, |
| | | elements: [] |
| | | } |
| | | |
| | | if (card.subcards.length > 0) { |
| | | newcard = fromJS(card.subcards[card.subcards.length - 1]).toJS() |
| | | newcard.uuid = Utils.getuuid() |
| | | newcard.elements = newcard.elements.map(elem => { |
| | | elem.uuid = Utils.getuuid() |
| | | return elem |
| | | }) |
| | | } |
| | | |
| | | card.subcards.push(newcard) |
| | | // let newcard = { |
| | | // uuid: Utils.getuuid(), |
| | | // setting: { width: 6, type: 'simple'}, |
| | | // style: { |
| | | // paddingTop: '5px', paddingBottom: '5px', paddingLeft: '15px', paddingRight: '15px', |
| | | // }, |
| | | // elements: [] |
| | | // } |
| | | |
| | | this.setState({card}) |
| | | this.props.updateConfig(card) |
| | |
| | | |
| | | return ( |
| | | <div className="menu-normal-table-edit-box" style={{...card.style, height: card.wrap.height}}> |
| | | <SearchComponent |
| | | config={card} |
| | | updatesearch={this.updatesearch} |
| | | /> |
| | | <div className="table-header" style={card.headerStyle}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <Icon className="style" title="调整样式" onClick={this.changeTitleStyle} type="font-colors" /> |
| | | </div> |
| | | } trigger="hover"> |
| | | <span className="table-title">{card.wrap.title || ''}</span> |
| | | </Popover> |
| | | {/* <SearchComponent config={card} updatesearch={this.updateComponent}/> */} |
| | | </div> |
| | | <SearchComponent config={card} updatesearch={this.updatesearch}/> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <Icon className="plus" title="添加卡片" onClick={this.addCard} type="plus" /> |
| | |
| | | editLevel: null, // 编辑菜单级别,值为level1、level2、level3、HS |
| | | permRoles: [], // 用户角色列表 |
| | | permAction: {}, // 用户按钮权限 |
| | | permMenus: {}, // 用户三级菜单权限 |
| | | permMenus: [], // 用户三级菜单列表 |
| | | dataManager: false, // 数据管理员 |
| | | memberLevel: _level, // 会员等级 |
| | | customMenu: null // 编辑中的菜单(自定义页面) |
| | |
| | | editState: false, |
| | | editLevel: null, |
| | | permAction: {}, |
| | | permMenus: {}, |
| | | permMenus: [], |
| | | customMenu: null |
| | | } |
| | | default: |
| | |
| | | // 生成显示列,处理合并列中的字段 |
| | | config.columns.forEach((col, index) => { |
| | | if (_hideCol.includes(col.uuid)) return |
| | | |
| | | if (col.linkThdMenu && !permMenus[col.linkThdMenu.MenuID]) { |
| | | |
| | | if (col.linkmenu && col.linkmenu.length > 0) { |
| | | let menu_id = col.linkmenu[col.linkmenu.length - 1] |
| | | col.linkThdMenu = permMenus.filter(m => m.MenuID === menu_id)[0] || '' |
| | | } else { |
| | | col.linkThdMenu = '' |
| | | } |
| | | |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Chart } from '@antv/g2' |
| | | import { connect } from 'react-redux' |
| | | import DataSet from '@antv/data-set' |
| | | import { Spin, Empty, notification } from 'antd' |
| | | |
| | | // import searchLine from '../../share/searchLine' |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | | import { modifyTabview } from '@/store/action' |
| | | import { chartColors } from '@/utils/option.js' |
| | | import UtilsDM from '@/utils/utils-datamanage.js' |
| | | import './index.scss' |
| | | |
| | | class LineChart extends Component { |
| | | class PieChart extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, // 父级Id |
| | | data: PropTypes.array, // 统一查询数据 |
| | |
| | | chart.legend(X_axis, { |
| | | position: plot.legend, |
| | | itemName: { |
| | | style: { |
| | | fill: color, |
| | | } |
| | | style: { fill: color } |
| | | } |
| | | }) |
| | | } else { |
| | | chart.legend({ |
| | | position: plot.legend, |
| | | itemName: { |
| | | style: { |
| | | fill: color, |
| | | } |
| | | style: { fill: color } |
| | | } |
| | | }) |
| | | } |
| | |
| | | }) |
| | | } |
| | | } |
| | | |
| | | if (plot.linkmenu && plot.linkmenu.length > 0) { |
| | | let menu_id = plot.linkmenu[plot.linkmenu.length - 1] |
| | | let menu = this.props.permMenus.filter(m => m.MenuID === menu_id)[0] || '' |
| | | |
| | | chart.on('element:dblclick', (ev) => { |
| | | if (!menu) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '菜单已删除或没有访问权限!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | try { |
| | | let data = ev.data.data |
| | | let primaryId = '' |
| | | if (this.state.config.setting.primaryKey && data) { |
| | | primaryId = data[this.state.config.setting.primaryKey] || '' |
| | | } |
| | | |
| | | let newtab = { |
| | | ...menu, |
| | | selected: true, |
| | | param: { |
| | | BID: primaryId, |
| | | data: data |
| | | } |
| | | } |
| | | |
| | | let tabs = this.props.tabviews.filter(tab => { |
| | | 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) |
| | | }) |
| | | } catch { |
| | | console.warn('菜单打开失败!') |
| | | } |
| | | }) |
| | | } |
| | | |
| | | chart.render() |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | export default LineChart |
| | | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | tabviews: state.tabviews, |
| | | permMenus: state.permMenus, |
| | | } |
| | | } |
| | | |
| | | const mapDispatchToProps = (dispatch) => { |
| | | return { |
| | | modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)) |
| | | } |
| | | } |
| | | |
| | | export default connect(mapStateToProps, mapDispatchToProps)(PieChart) |
| | |
| | | config.columns.forEach((col, index) => { |
| | | if (_hideCol.includes(col.uuid)) return |
| | | |
| | | if (col.linkThdMenu && !permMenus[col.linkThdMenu.MenuID]) { |
| | | if (col.linkmenu && col.linkmenu.length > 0) { |
| | | let menu_id = col.linkmenu[col.linkmenu.length - 1] |
| | | col.linkThdMenu = permMenus.filter(m => m.MenuID === menu_id)[0] || '' |
| | | } else { |
| | | col.linkThdMenu = '' |
| | | } |
| | | |
| | |
| | | config = UtilsUpdate.updateSubTable(config) |
| | | |
| | | // 仅支持exec、prompt、pop 三种类型按钮 |
| | | let labels = [] |
| | | if (type === 'calendar') { |
| | | config.action = config.action.filter(item => ['exec', 'prompt', 'pop', 'tab', 'excelIn', 'excelOut'].includes(item.OpenType)) |
| | | config.action = config.action.filter(item => { |
| | | if (['exec', 'prompt', 'pop', 'tab', 'excelIn', 'excelOut'].includes(item.OpenType)) return true |
| | | |
| | | labels.push(item.label) |
| | | |
| | | return false |
| | | }) |
| | | |
| | | } else { |
| | | config.action = config.action.filter(item => ['exec', 'prompt', 'pop'].includes(item.OpenType)) |
| | | config.action = config.action.filter(item => { |
| | | if (['exec', 'prompt', 'pop'].includes(item.OpenType)) return true |
| | | |
| | | labels.push(item.label) |
| | | |
| | | return false |
| | | }) |
| | | } |
| | | |
| | | if (window.GLOB.systemType !== 'production' && labels.length > 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: `不支持按钮(${labels.join('、')})的打开方式!`, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | |
| | | |
| | | // 权限过滤 |
| | | if (this.props.menuType !== 'HS') { |
| | |
| | | config.columns.forEach(col => { |
| | | if (_hideCol.includes(col.uuid)) return |
| | | |
| | | if (col.linkThdMenu) { |
| | | col.linkThdMenu = '' |
| | | } |
| | | col.linkThdMenu = '' // 弹窗中不可使用字段透视 |
| | | |
| | | if (col.type === 'colspan' && col.sublist) { |
| | | let _col = JSON.parse(JSON.stringify(col)) |
| | |
| | | } |
| | | } |
| | | } else if (btn.tabTemplate === 'ThdMenu') { |
| | | let _type = 'CommonTable' |
| | | if (btn.linkThdMenu && btn.linkThdMenu.PageParam) { |
| | | try { |
| | | _type = JSON.parse(btn.linkThdMenu.PageParam).Template |
| | | } catch { |
| | | _type = 'CommonTable' |
| | | } |
| | | let menu = null |
| | | |
| | | if (btn.linkmenu && btn.linkmenu.length > 0) { |
| | | let menu_id = btn.linkmenu[btn.linkmenu.length - 1] |
| | | menu = this.props.permMenus.filter(m => m.MenuID === menu_id)[0] || '' |
| | | } |
| | | |
| | | if (!menu) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '菜单已删除或没有访问权限!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | newtab = { |
| | | MenuNo: btn.linkThdMenu.MenuNo, |
| | | MenuID: btn.linkThdMenu.MenuID, |
| | | MenuName: btn.linkThdMenu.MenuName, |
| | | type: _type, |
| | | ...menu, |
| | | selected: true, |
| | | param: { |
| | | BID: primaryId, |
| | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | tabviews: state.tabviews, |
| | | permMenus: state.permMenus, |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | if (item.linkThdMenu) { |
| | | let tabmenu = item.linkThdMenu |
| | | let iframes = ['Main/Index', 'bda/rdt', 'Home/rdt'] |
| | | |
| | | if (tabmenu.LinkUrl === 'CommonTable') { |
| | | tabmenu.type = 'CommonTable' |
| | | } else if (tabmenu.LinkUrl && iframes.includes(tabmenu.LinkUrl.split('?')[0])) { |
| | | tabmenu.type = 'iframe' |
| | | } |
| | | |
| | | if (tabmenu.type !== 'iframe') { |
| | | try { |
| | | tabmenu.PageParam = JSON.parse(tabmenu.PageParam) |
| | | } catch (e) { |
| | | tabmenu.PageParam = {} |
| | | } |
| | | tabmenu.type = tabmenu.PageParam.Template || tabmenu.type |
| | | } |
| | | |
| | | |
| | | tabmenu.param = { |
| | | searchkey: item.field, |
| | | searchval: record[item.field] || '', |
| | |
| | | UNSAFE_componentWillMount () { |
| | | const { card } = this.props |
| | | |
| | | let _menulist = this.props.formlist.filter(form => form.key === 'linkmenu')[0] || '' |
| | | let _opentype = card.OpenType // 打开方式 |
| | | let _tabType = card.tabType || 'SubTable' // 按钮为弹窗(标签)时,标签的类型 |
| | | let _intertype = card.intertype || 'system' // 接口类型 |
| | |
| | | this.setState({ |
| | | openType: _opentype, |
| | | pageTemplate: _pageTemplate, |
| | | menulist: _menulist.options || [], |
| | | interType: _intertype, |
| | | position: card.position || 'toolbar', |
| | | funcType: _funcType, |
| | |
| | | } |
| | | ] |
| | | })( |
| | | <Cascader options={this.state.menulist} placeholder="" /> |
| | | <Cascader options={item.options || []} placeholder="" /> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | |
| | | handleConfirm = () => { |
| | | const { setting } = this.props |
| | | const { menulist } = this.state |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | |
| | | } |
| | | } |
| | | |
| | | // 关联三级菜单 |
| | | if (values.OpenType === 'tab' && values.linkmenu && values.linkmenu.length > 0) { |
| | | let linkThdMenu = '' |
| | | menulist.forEach(menu => { |
| | | if (menu.value === values.linkmenu[0]) { |
| | | menu.children.forEach(item => { |
| | | if (item.value === values.linkmenu[1]) { |
| | | item.children.forEach(cell => { |
| | | if (cell.value === values.linkmenu[2]) { |
| | | linkThdMenu = cell |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | values.linkThdMenu = linkThdMenu |
| | | } |
| | | resolve(values) |
| | | } else { |
| | | reject(err) |
| | |
| | | * @description 按钮双击触发子配置 |
| | | */ |
| | | btnDoubleClick = (element) => { |
| | | if (!element.origin && (element.OpenType === 'pop' || element.OpenType === 'popview' || element.OpenType === 'blank' || element.OpenType === 'tab')) { |
| | | if (!element.origin && (element.OpenType === 'pop' || element.OpenType === 'popview' || element.OpenType === 'blank')) { |
| | | this.props.setSubConfig(element) |
| | | } else { |
| | | notification.warning({ |
| | |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | const { menulist } = this.state |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | values.uuid = this.props.card.uuid |
| | | values.marks = this.props.card.marks || '' |
| | | |
| | | if ((values.type === 'text' || values.type === 'number') && values.linkmenu && values.linkmenu.length > 0) { |
| | | let linkThdMenu = '' |
| | | menulist.forEach(menu => { |
| | | if (menu.value === values.linkmenu[0]) { |
| | | menu.children.forEach(item => { |
| | | if (item.value === values.linkmenu[1]) { |
| | | item.children.forEach(cell => { |
| | | if (cell.value === values.linkmenu[2]) { |
| | | linkThdMenu = cell |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | values.linkThdMenu = linkThdMenu |
| | | } |
| | | |
| | | resolve(values) |
| | | } else { |
| | |
| | | duration: 5 |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | loading: true |
| | | }) |
| | | |
| | | // 子菜单信息验证通过后,跳转子按钮配置页面 |
| | | let _view = '' |
| | | let _subtab = editSubTab |
| | |
| | | } else if (btn.OpenType === 'popview') { |
| | | _view = btn.tabType // 新弹窗标签模板 |
| | | _subtab = btn |
| | | |
| | | if (editSubTab) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '弹窗(标签)中不支持此按钮打开方式!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | } |
| | | |
| | | if (editSubTab) { |
| | |
| | | subConfig: '', |
| | | tabview: _view |
| | | } |
| | | |
| | | this.setState({ |
| | | loading: true |
| | | }) |
| | | |
| | | Api.getSystemConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | |
| | | render () { |
| | | const { activeKey, config, chartview } = this.state |
| | | |
| | | const confActions = config.action.filter(_action => !_action.origin && ['pop', 'popview', 'blank', 'tab'].includes(_action.OpenType)) |
| | | const confActions = config.action.filter(_action => !_action.origin && ['pop', 'popview', 'blank'].includes(_action.OpenType)) |
| | | |
| | | return ( |
| | | <div className="model-subtable-board"> |
| | |
| | | let fstItem = { |
| | | MenuID: fst.MenuID, |
| | | MenuName: fst.MenuName, |
| | | value: fst.MenuID, |
| | | label: fst.MenuName, |
| | | isLeaf: false, |
| | | children: [] |
| | | } |
| | | |
| | |
| | | ParentId: fst.MenuID, |
| | | MenuID: snd.MenuID, |
| | | MenuName: snd.MenuName, |
| | | value: snd.MenuID, |
| | | label: snd.MenuName, |
| | | children: [] |
| | | } |
| | | |
| | |
| | | MenuID: trd.MenuID, |
| | | MenuName: trd.MenuName, |
| | | MenuNo: trd.MenuNo, |
| | | EasyCode: trd.EasyCode |
| | | EasyCode: trd.EasyCode, |
| | | value: trd.MenuID, |
| | | label: trd.MenuName, |
| | | disabled: trd.MenuID === MenuId |
| | | } |
| | | |
| | | if (MenuId === trd.MenuID) { |