| | |
| | | return Promise.reject(error) |
| | | }) |
| | | |
| | | const setCurrentUrl = () => { |
| | | const setCurrentUrl = (res) => { |
| | | if (!!(window.history && window.history.pushState)) { |
| | | if (window.location.href.indexOf('paramsmain') > -1) { |
| | | let _href = window.location.href.split('#') |
| | |
| | | } |
| | | |
| | | sessionStorage.clear() |
| | | sessionStorage.setItem('loginError', JSON.stringify({request: res.config ? res.config.data : '', response: JSON.stringify(res.data)})) |
| | | window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login') |
| | | window.location.reload() |
| | | } |
| | |
| | | response.data.ErrCode = 'E' |
| | | return Promise.resolve(response.data) |
| | | } else { |
| | | setCurrentUrl() |
| | | setCurrentUrl(response) |
| | | } |
| | | } else { |
| | | return Promise.resolve(response.data) |
| | |
| | | resetState, |
| | | resetEditState, |
| | | resetEditLevel, |
| | | initPermission, |
| | | modifyDataManager, |
| | | initActionPermission, |
| | | initMenuPermission, |
| | |
| | | _permFuncField = _permFuncField.sort() |
| | | } |
| | | |
| | | this.props.initPermission(_sysRoles, _permFuncField) |
| | | sessionStorage.setItem('sysRoles', JSON.stringify(_sysRoles)) |
| | | sessionStorage.setItem('permFuncField', JSON.stringify(_permFuncField)) |
| | | } |
| | | }) |
| | | } |
| | |
| | | editState: state.editState, |
| | | editLevel: state.editLevel, |
| | | permAction: state.permAction, |
| | | sysRoles: state.sysRoles, |
| | | memberLevel: state.memberLevel, |
| | | permFuncField: state.permFuncField |
| | | memberLevel: state.memberLevel |
| | | } |
| | | } |
| | | |
| | |
| | | resetEditState: (state) => dispatch(resetEditState(state)), |
| | | resetEditLevel: (level) => dispatch(resetEditLevel(level)), |
| | | initActionPermission: (permAction) => dispatch(initActionPermission(permAction)), |
| | | initPermission: (sysRoles, permFuncField) => dispatch(initPermission(sysRoles, permFuncField)), |
| | | initMenuPermission: (permMenus) => dispatch(initMenuPermission(permMenus)), |
| | | modifyDataManager: (dataManager) => dispatch(modifyDataManager(dataManager)), |
| | | resetState: () => dispatch(resetState()), |
| | |
| | | ) |
| | | } |
| | | |
| | | |
| | | if (sessionStorage.getItem('loginError')) { |
| | | try { |
| | | let res = JSON.parse(sessionStorage.getItem('loginError')) |
| | | console.info(res.request) |
| | | console.info(res.response) |
| | | } catch {} |
| | | } |
| | | sessionStorage.removeItem('isEditState') |
| | | sessionStorage.removeItem('loginError') |
| | | |
| | | // fetch(`./${process.env.NODE_ENV === 'production' ? 'build/' : ''}options.json`) |
| | | fetch(`./options.json`) |
| | |
| | | * @param {*} card 编辑按钮 |
| | | * @param {*} functip 生成存储过程提示 |
| | | * @param {*} setting 组件配置 |
| | | * @param {*} permFuncField 存储过程可用的开始字段 |
| | | * @param {*} usefulFields 存储过程可用的开始字段 |
| | | * @param {*} type 按钮类型,用于区分可选的打开方式 |
| | | */ |
| | | export function getActionForm (card, functip, setting, permFuncField = [], type, menulist = [], modules = []) { |
| | | export function getActionForm (card, functip, setting, usefulFields, type, menulist = [], modules = []) { |
| | | let opentypes = [ |
| | | { |
| | | value: 'pop', |
| | |
| | | label: Formdict['header.form.innerFunc'], |
| | | initVal: card.innerFunc || '', |
| | | tooltip: functip, |
| | | fields: permFuncField, |
| | | fields: usefulFields, |
| | | tooltipClass: 'middle', |
| | | required: false, |
| | | readonly: false |
| | |
| | | handleAction = (card) => { |
| | | const { menu, config } = this.props |
| | | |
| | | let ableField = menu.permFuncField ? menu.permFuncField.join(', ') : '' |
| | | let usefulFields = sessionStorage.getItem('permFuncField') |
| | | if (usefulFields) { |
| | | try { |
| | | usefulFields = JSON.parse(usefulFields) |
| | | } catch { |
| | | usefulFields = [] |
| | | } |
| | | } else { |
| | | usefulFields = [] |
| | | } |
| | | |
| | | let ableField = usefulFields.join(', ') |
| | | let functip = <div> |
| | | <p style={{marginBottom: '5px'}}>{this.state.dict['model.tooltip.func.innerface'].replace('@ableField', ableField)}</p> |
| | | <p>{this.state.dict['model.tooltip.func.outface']}</p> |
| | |
| | | this.setState({ |
| | | visible: true, |
| | | card: card, |
| | | formlist: getActionForm(card, functip, config.setting, menu.permFuncField, this.props.type, menulist, modules) |
| | | formlist: getActionForm(card, functip, config.setting, usefulFields, this.props.type, menulist, modules) |
| | | }) |
| | | } |
| | | |
| | |
| | | /** |
| | | * @description 获取按钮表单配置信息 |
| | | * @param {*} card 编辑按钮 |
| | | * @param {*} setting 组件配置 |
| | | * @param {*} permFuncField 存储过程可用的开始字段 |
| | | * @param {*} type 按钮类型,用于区分可选的打开方式 |
| | | */ |
| | | export function getCardCellForm (card, type) { |
| | |
| | | handleAction = (card) => { |
| | | const { menu, cards } = this.props |
| | | |
| | | let ableField = menu.permFuncField ? menu.permFuncField.join(', ') : '' |
| | | let usefulFields = sessionStorage.getItem('permFuncField') |
| | | if (usefulFields) { |
| | | try { |
| | | usefulFields = JSON.parse(usefulFields) |
| | | } catch { |
| | | usefulFields = [] |
| | | } |
| | | } else { |
| | | usefulFields = [] |
| | | } |
| | | |
| | | let ableField = usefulFields.join(', ') |
| | | let functip = <div> |
| | | <p style={{marginBottom: '5px'}}>{this.state.dict['model.tooltip.func.innerface'].replace('@ableField', ableField)}</p> |
| | | <p>{this.state.dict['model.tooltip.func.outface']}</p> |
| | |
| | | this.setState({ |
| | | actvisible: true, |
| | | card: card, |
| | | formlist: getActionForm(card, functip, cards.setting, menu.permFuncField, 'card', menulist, modules) |
| | | formlist: getActionForm(card, functip, cards.setting, usefulFields, 'card', menulist, modules) |
| | | }) |
| | | } |
| | | |
| | |
| | | <div className="menu-data-card-edit-box" style={{...card.style, minHeight: card.wrap.minHeight}}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | {menu ? <WrapComponent sysRoles={menu.sysRoles} MenuType={menu.MenuType} config={card} updateConfig={this.updateComponent} /> : null} |
| | | {menu ? <WrapComponent MenuType={menu.MenuType} config={card} updateConfig={this.updateComponent} /> : null} |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
| | | <Icon className="close" title="删除组件" type="delete" onClick={() => this.props.deletecomponent(card.uuid)} /> |
| | | <SettingComponent config={card} updateConfig={this.updateComponent} /> |
| | |
| | | static propTpyes = { |
| | | config: PropTypes.any, |
| | | MenuType: PropTypes.any, |
| | | sysRoles: PropTypes.array, |
| | | updateConfig: PropTypes.func |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | render () { |
| | | const { config, sysRoles, MenuType } = this.props |
| | | const { config, MenuType } = this.props |
| | | const { visible, dict, wrap } = this.state |
| | | |
| | | return ( |
| | |
| | | wrap={wrap} |
| | | config={config} |
| | | MenuType={MenuType} |
| | | sysRoles={sysRoles || []} |
| | | inputSubmit={this.verifySubmit} |
| | | wrappedComponentRef={(inst) => this.verifyRef = inst} |
| | | /> |
| | |
| | | class SettingForm extends Component { |
| | | static propTpyes = { |
| | | MenuType: PropTypes.any, // 菜单类型 |
| | | sysRoles: PropTypes.array, // 角色列表 |
| | | dict: PropTypes.object, // 字典项 |
| | | config: PropTypes.object, // 卡片行信息 |
| | | wrap: PropTypes.object, // 数据源配置 |
| | | inputSubmit: PropTypes.func // 回车事件 |
| | | } |
| | | |
| | | state = { |
| | | roleList: [] |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | if (roleList) { |
| | | try { |
| | | roleList = JSON.parse(roleList) |
| | | } catch { |
| | | roleList = [] |
| | | } |
| | | } else { |
| | | roleList = [] |
| | | } |
| | | |
| | | this.setState({roleList}) |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { wrap, config, sysRoles, MenuType } = this.props |
| | | const { wrap, config, MenuType } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { roleList } = this.state |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | mode="multiple" |
| | | filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | > |
| | | {sysRoles.map(option => |
| | | {roleList.map(option => |
| | | <Select.Option key={option.uuid} value={option.value}>{option.text}</Select.Option> |
| | | )} |
| | | </Select> |
| | |
| | | <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" /> |
| | | {menu ? <WrapComponent config={card} sysRoles={menu.sysRoles} MenuType={menu.MenuType} updateConfig={this.updateComponent} /> : null} |
| | | {menu ? <WrapComponent config={card} MenuType={menu.MenuType} updateConfig={this.updateComponent} /> : null} |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
| | | <Icon className="close" title="删除组件" type="delete" onClick={() => this.props.deletecomponent(card.uuid)} /> |
| | | {card.wrap.datatype !== 'static' ? <SettingComponent config={card} updateConfig={this.updateComponent} /> : null} |
| | |
| | | <div className="mk-popover-control"> |
| | | <Icon className="plus" title="添加卡片" onClick={this.addCard} type="plus" /> |
| | | <Icon className="plus" title="添加搜索" onClick={this.addSearch} type="plus-circle" /> |
| | | {menu ? <WrapComponent config={card} sysRoles={menu.sysRoles} MenuType={menu.MenuType} updateConfig={this.updateComponent} /> : null} |
| | | {menu ? <WrapComponent config={card} MenuType={menu.MenuType} updateConfig={this.updateComponent} /> : null} |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
| | | <Icon className="close" title="删除组件" type="delete" onClick={() => this.props.deletecomponent(card.uuid)} /> |
| | | {card.wrap.datatype !== 'static' ? <SettingComponent config={card} updateConfig={this.updateComponent} /> : null} |
| | |
| | | * @param {object} card // 图表对象 |
| | | * @param {Array} columns // 显示列 |
| | | */ |
| | | export function getBaseForm (card, sysRoles = [], MenuType) { |
| | | let _sysRoles = sysRoles.map(item => ({...item, field: item.value, label: item.text})) |
| | | export function getBaseForm (card, MenuType) { |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | if (roleList) { |
| | | try { |
| | | roleList = JSON.parse(roleList) |
| | | } catch { |
| | | roleList = [] |
| | | } |
| | | } else { |
| | | roleList = [] |
| | | } |
| | | |
| | | return [ |
| | | { |
| | |
| | | multi: true, |
| | | required: false, |
| | | forbid: MenuType === 'billPrint', |
| | | options: _sysRoles |
| | | options: roleList |
| | | } |
| | | ] |
| | | } |
| | |
| | | MenuType: PropTypes.any, |
| | | dict: PropTypes.object, |
| | | plot: PropTypes.object, |
| | | sysRoles: PropTypes.array, |
| | | config: PropTypes.object, |
| | | plotchange: PropTypes.func |
| | | } |
| | |
| | | } |
| | | |
| | | showDrawer = () => { |
| | | const { config, sysRoles, MenuType } = this.props |
| | | const { config, MenuType } = this.props |
| | | |
| | | let fieldName = {} |
| | | config.columns.forEach(col => { |
| | |
| | | datatype: config.plot.datatype || 'query', |
| | | fieldName: fieldName, |
| | | plot: fromJS(config.plot).toJS(), |
| | | baseFormlist: getBaseForm(config.plot, sysRoles, MenuType), |
| | | baseFormlist: getBaseForm(config.plot, MenuType), |
| | | formlist: getOptionForm(config.plot, config.columns, MenuType) |
| | | }) |
| | | } |
| | |
| | | })( |
| | | <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> |
| | |
| | | <div className="mk-popover-control"> |
| | | {menu && menu.MenuType !== 'billPrint' ? <Icon className="plus" title="添加搜索" onClick={this.addSearch} type="plus-circle" /> : null} |
| | | {menu && menu.MenuType !== 'billPrint' ? <Icon className="plus" title="添加按钮" onClick={this.addButton} type="plus-square" /> : null} |
| | | {menu ? <ChartCompileForm config={card} sysRoles={menu.sysRoles} MenuType={menu.MenuType} dict={this.state.dict} plotchange={this.updateComponent}/> : null} |
| | | {menu ? <ChartCompileForm config={card} MenuType={menu.MenuType} dict={this.state.dict} plotchange={this.updateComponent}/> : null} |
| | | <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}/> |
| | |
| | | MenuType: PropTypes.any, |
| | | dict: PropTypes.object, |
| | | plot: PropTypes.object, |
| | | sysRoles: PropTypes.array, |
| | | config: PropTypes.object, |
| | | plotchange: PropTypes.func |
| | | } |
| | |
| | | } |
| | | |
| | | showDrawer = () => { |
| | | const { config, sysRoles, MenuType } = this.props |
| | | const { config, MenuType } = this.props |
| | | |
| | | this.setState({ |
| | | visible: true, |
| | | view: 'normal', |
| | | plot: fromJS(config.plot).toJS(), |
| | | baseFormlist: getBaseForm(config.plot, sysRoles, MenuType), |
| | | baseFormlist: getBaseForm(config.plot, MenuType), |
| | | 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} sysRoles={menu.sysRoles} MenuType={menu.MenuType} dict={this.state.dict} plotchange={this.updateComponent}/> : null} |
| | | {menu ? <ChartCompileForm config={card} MenuType={menu.MenuType} dict={this.state.dict} plotchange={this.updateComponent}/> : null} |
| | | <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}/> |
| | |
| | | * @description 搜索条件编辑,获取搜索条件表单信息 |
| | | */ |
| | | handleSearch = (cell) => { |
| | | const { menu } = this.props |
| | | const { card } = this.state |
| | | let linkableFields = [] |
| | | |
| | |
| | | this.setState({ |
| | | visible: true, |
| | | editcard: cell, |
| | | formlist: getSearchForm(cell, menu.sysRoles, linkableFields) |
| | | formlist: getSearchForm(cell, linkableFields) |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { menu } = this.props |
| | | const { dict, card, visible, sqlVerifing } = this.state |
| | | |
| | | return ( |
| | |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <Icon className="plus" title="添加" onClick={this.addSearch} type="plus" /> |
| | | <WrapComponent config={card} sysRoles={menu ? menu.sysRoles : []} updateConfig={this.updateComponent}/> |
| | | <WrapComponent config={card} updateConfig={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)} /> |
| | | </div> |
| | |
| | | |
| | | class DataSource extends Component { |
| | | static propTpyes = { |
| | | sysRoles: PropTypes.any, // 角色列表 |
| | | config: PropTypes.any, |
| | | updateConfig: PropTypes.func |
| | | } |
| | |
| | | <SettingForm |
| | | dict={dict} |
| | | wrap={wrap} |
| | | sysRoles={this.props.sysRoles || []} |
| | | inputSubmit={this.verifySubmit} |
| | | wrappedComponentRef={(inst) => this.verifyRef = inst} |
| | | /> |
| | |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | | wrap: PropTypes.object, // 数据源配置 |
| | | sysRoles: PropTypes.array, // 角色列表 |
| | | inputSubmit: PropTypes.func // 回车事件 |
| | | } |
| | | |
| | | state = { |
| | | float: this.props.wrap.float |
| | | float: this.props.wrap.float, |
| | | roleList: [] |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | if (roleList) { |
| | | try { |
| | | roleList = JSON.parse(roleList) |
| | | } catch { |
| | | roleList = [] |
| | | } |
| | | } else { |
| | | roleList = [] |
| | | } |
| | | |
| | | this.setState({roleList}) |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { wrap, sysRoles } = this.props |
| | | const { wrap } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { float } = this.state |
| | | const { float, roleList } = this.state |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | mode="multiple" |
| | | filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | > |
| | | {sysRoles.map(option => |
| | | {roleList.map(option => |
| | | <Select.Option key={option.uuid} value={option.value}>{option.text}</Select.Option> |
| | | )} |
| | | </Select> |
| | |
| | | import { is, fromJS } from 'immutable' |
| | | import { Icon, Popover, Modal } from 'antd' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | // import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | |
| | | import SearchComponent from '@/templates/sharecomponent/searchcomponent' |
| | | import './index.scss' |
| | | |
| | | const SettingComponent = asyncIconComponent(() => import('@/menu/datasource')) |
| | | // const WrapComponent = asyncIconComponent(() => import('../data-card/wrapsetting')) |
| | | const SearchComponent = asyncComponent(() => import('@/menu/searchcomponent')) |
| | | // const SearchComponent = asyncComponent(() => import('@/menu/searchcomponent')) |
| | | |
| | | const { confirm } = Modal |
| | | |
| | |
| | | MKEmitter.emit('addSearch', card.uuid, newcard) |
| | | } |
| | | |
| | | /** |
| | | * @description 更新搜索条件配置信息 |
| | | */ |
| | | updatesearch = (config) => { |
| | | this.setState({ |
| | | card: config |
| | | }) |
| | | } |
| | | |
| | | render() { |
| | | const { card } = this.state |
| | | |
| | | return ( |
| | | <div className="menu-table-card-edit-box" style={{...card.style, height: card.wrap.height}}> |
| | | <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"> |
| | |
| | | } trigger="hover"> |
| | | <span className="table-title">{card.wrap.title || ''}</span> |
| | | </Popover> |
| | | <SearchComponent config={card} updatesearch={this.updateComponent}/> |
| | | {/* <SearchComponent config={card} updatesearch={this.updateComponent}/> */} |
| | | </div> |
| | | <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" /> |
| | | <Icon className="plus" title="添加搜索" onClick={this.addSearch} type="plus-circle" /> |
| | | {/* {menu ? <WrapComponent config={card} sysRoles={menu.sysRoles} MenuType={menu.MenuType} updateConfig={this.updateComponent} /> : null} */} |
| | | {/* {menu ? <WrapComponent config={card} MenuType={menu.MenuType} updateConfig={this.updateComponent} /> : null} */} |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
| | | <Icon className="close" title="删除组件" type="delete" onClick={() => this.props.deletecomponent(card.uuid)} /> |
| | | {card.wrap.datatype !== 'static' ? <SettingComponent config={card} updateConfig={this.updateComponent} /> : null} |
| | |
| | | .menu-table-card-edit-box { |
| | | .menu-normal-table-edit-box { |
| | | position: relative; |
| | | box-sizing: border-box; |
| | | background: #ffffff; |
| | |
| | | } |
| | | } |
| | | } |
| | | .menu-table-card-edit-box::after { |
| | | .menu-normal-table-edit-box::after { |
| | | display: block; |
| | | content: ' '; |
| | | clear: both; |
| | | } |
| | | .menu-table-card-edit-box:hover { |
| | | .menu-normal-table-edit-box:hover { |
| | | box-shadow: 0px 0px 2px #e8e8e8; |
| | | } |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { menu } = this.props |
| | | const { tabs, dict, labelvisible, editab } = this.state |
| | | |
| | | return ( |
| | |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <Icon className="plus" title="添加标签" type="plus" onClick={this.tabAdd} /> |
| | | <SettingComponent config={tabs} sysRoles={menu ? menu.sysRoles : []} updateConfig={this.updateComponent} /> |
| | | <SettingComponent config={tabs} updateConfig={this.updateComponent} /> |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
| | | <Icon className="close" title="delete" type="delete" onClick={() => this.props.deletecomponent(tabs.uuid)} /> |
| | | </div> |
| | |
| | | class DataSource extends Component { |
| | | static propTpyes = { |
| | | config: PropTypes.any, |
| | | sysRoles: PropTypes.any, // 角色列表 |
| | | updateConfig: PropTypes.func |
| | | } |
| | | |
| | |
| | | <SettingForm |
| | | dict={dict} |
| | | setting={setting} |
| | | sysRoles={this.props.sysRoles || []} |
| | | inputSubmit={this.verifySubmit} |
| | | wrappedComponentRef={(inst) => this.verifyRef = inst} |
| | | /> |
| | |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | | setting: PropTypes.object, // 数据源配置 |
| | | sysRoles: PropTypes.array, // 角色列表 |
| | | inputSubmit: PropTypes.func // 回车事件 |
| | | } |
| | | |
| | | state = {} |
| | | state = { |
| | | roleList: [] |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | if (roleList) { |
| | | try { |
| | | roleList = JSON.parse(roleList) |
| | | } catch { |
| | | roleList = [] |
| | | } |
| | | } else { |
| | | roleList = [] |
| | | } |
| | | |
| | | this.setState({roleList}) |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | // 表单提交时检查输入值是否正确 |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { setting, sysRoles } = this.props |
| | | const { setting } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { roleList } = this.state |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | mode="multiple" |
| | | filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | > |
| | | {sysRoles.map(option => |
| | | {roleList.map(option => |
| | | <Select.Option key={option.uuid} value={option.value}>{option.text}</Select.Option> |
| | | )} |
| | | </Select> |
| | |
| | | interType: this.props.setting.interType || 'system', |
| | | laypage: this.props.setting.laypage || 'true', |
| | | modules: [], |
| | | usefulFields: [], |
| | | useMSearch: this.props.setting.useMSearch || 'false', |
| | | supModule: this.props.setting.supModule || [] |
| | | } |
| | |
| | | label: '无' |
| | | }) |
| | | |
| | | this.setState({modules}) |
| | | let usefulFields = sessionStorage.getItem('permFuncField') |
| | | if (usefulFields) { |
| | | try { |
| | | usefulFields = JSON.parse(usefulFields) |
| | | } catch { |
| | | usefulFields = [] |
| | | } |
| | | } else { |
| | | usefulFields = [] |
| | | } |
| | | |
| | | this.setState({modules, usefulFields}) |
| | | } |
| | | |
| | | getModules = (components, selfId) => { |
| | |
| | | render() { |
| | | const { setting, menu, columns, config } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { interType, modules, useMSearch, laypage, supModule } = this.state |
| | | const { interType, modules, useMSearch, laypage, supModule, usefulFields } = this.state |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | let tooltip = null |
| | | let rules = [] |
| | | |
| | | if (menu.permFuncField && menu.permFuncField.length > 0) { |
| | | tooltip = '开头可用字符:' + menu.permFuncField.join(', ') |
| | | let str = '^(' + menu.permFuncField.join('|') + ')' |
| | | if (usefulFields.length > 0) { |
| | | tooltip = '开头可用字符:' + usefulFields.join(', ') |
| | | let str = '^(' + usefulFields.join('|') + ')' |
| | | let _patten = new RegExp(str + formRule.func.innerPattern + '$', 'g') |
| | | |
| | | rules.push({ |
| | |
| | | * 3、设置编辑参数项-formlist |
| | | */ |
| | | handleForm = (_card) => { |
| | | const { componentConfig, menu } = this.props |
| | | const { componentConfig } = this.props |
| | | let card = fromJS(_card).toJS() |
| | | |
| | | const { config } = this.state |
| | |
| | | card.linkSubField = card.linkSubField.filter(item => fields.includes(item)) |
| | | } |
| | | |
| | | let roleList = [] |
| | | if (menu.sysRoles && menu.sysRoles.length > 0) { |
| | | roleList = menu.sysRoles.map(role => { |
| | | return { |
| | | uuid: role.uuid, |
| | | field: role.value, |
| | | label: role.text |
| | | } |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | visible: true, |
| | | card: card, |
| | | formlist: getModalForm(card, _inputfields, _linkableFields, _linksupFields, !!this.props.editTab, roleList) |
| | | formlist: getModalForm(card, _inputfields, _linkableFields, _linksupFields, !!this.props.editTab) |
| | | }) |
| | | } |
| | | |
| | |
| | | { type: 'menu', url: Mainsearch, component: 'search', subtype: 'mainsearch', title: '搜索条件', width: 24, forbid: ['billPrint'] }, |
| | | { type: 'menu', url: card1, component: 'card', subtype: 'datacard', title: '数据卡', config: `[{"uuid":"160135809128212dm7i29fim9ksto9od","setting":{"width":6},"style":{"paddingTop":"15px","marginTop":"4px","paddingRight":"15px","marginRight":"8px","marginLeft":"8px","backgroundColor":"rgba(255, 255, 255, 1)","borderColor":"#e8e8e8","paddingLeft":"15px","marginBottom":"4px","borderWidth":"1px","paddingBottom":"10px"},"backStyle":{},"elements":[{"datatype":"static","width":12,"marks":null,"height":1,"value":"关单","style":{},"prefix":"","postfix":"","format":"","eleType":"text","uuid":"160231860159931untbea62sgokunc5s"},{"datatype":"static","width":12,"marks":null,"style":{"color":"rgba(250, 219, 20, 1)","textAlign":"right"},"btnstyle":{},"eleType":"icon","icon":"question-circle","field":"","uuid":"1602318768361nv8ql4t47sgcsn88b0u"},{"datatype":"static","width":24,"marks":null,"height":1,"innerHeight":36,"value":"100","style":{"fontSize":"24px","fontWeight":"500","color":"rgba(0, 0, 0, 1)"},"prefix":"","btnstyle":{},"postfix":"","format":"","eleType":"text","uuid":"1602318817884v70gtgb65ubnm8mbcvv"},{"color":"#1890ff","width":24,"marks":null,"maxValue":100,"style":{"color":"rgba(250, 140, 22, 1)","paddingTop":"20px","paddingBottom":"10px"},"btnstyle":{},"eleType":"slider","field":"int1","uuid":"16023188871233rkktuvpp1h077igrsu"},{"eleType":"splitline","width":24,"color":"#e8e8e8","uuid":"1602320017038n31bk9o831ggug0tu0b","marks":null,"style":{"marginTop":"10px","marginBottom":"10px"},"btnstyle":{}},{"datatype":"static","width":12,"marks":null,"height":1,"value":"100","style":{"marginTop":"6px"},"prefix":"关单","btnstyle":{},"postfix":"","format":"","eleType":"text","uuid":"1602320061243drd7lf3agvn04kgr175"}],"backElements":[]}]` }, |
| | | { type: 'menu', url: card2, component: 'card', subtype: 'propcard', title: '属性卡', config: `[{"uuid":"1603681387259qaqf1127f72esmtchge","setting":{"width":6,"type":"simple"},"style":{"paddingTop":"15px","marginTop":"8px","paddingRight":"15px","marginRight":"8px","marginLeft":"8px","borderColor":"#e8e8e8","paddingLeft":"15px","marginBottom":"8px","borderWidth":"1px","paddingBottom":"15px"},"backStyle":{},"elements":[{"datatype":"static","width":12,"marks":null,"height":1,"value":"超时工单","style":{"color":"rgba(67, 67, 67, 0.51)"},"prefix":"","postfix":"","format":"","eleType":"text","uuid":"1603681402945qnkgm7q8cng65evn5ev"},{"eleType":"icon","datatype":"static","width":12,"icon":"question-circle","tooltip":"超时工单","uuid":"1603681473384i2crkbtofg4pu76k06a","marks":null,"style":{"textAlign":"right","color":"rgba(250, 219, 20, 1)"}},{"datatype":"static","width":24,"marks":null,"height":1,"innerHeight":36,"value":"100","style":{"fontSize":"24px","color":"rgba(0, 0, 0, 1)"},"prefix":"","postfix":"","format":"","eleType":"number","uuid":"1603681539870d704ufqf98kc6t7537t"},{"color":"rgba(250, 219, 20, 1)","datatype":"static","width":24,"marks":null,"maxValue":100,"value":50,"style":{"paddingTop":"10px","paddingBottom":"10px"},"eleType":"slider","uuid":"1603683067556mvupau0odvrtv45u7o8"},{"eleType":"splitline","width":24,"color":"#e8e8e8","uuid":"1603683117981t9k55k8an430fuppmci","marks":null,"style":{"paddingTop":"5px","paddingBottom":"5px"}},{"datatype":"static","width":12,"marks":null,"height":1,"value":"100","style":{"color":"rgba(0, 0, 0, 0.65)","marginTop":"10px"},"prefix":"超时工单 ","postfix":"","format":"","eleType":"text","uuid":"1603683136553uvsmkfohkft9idbfkhu"}],"backElements":[]}]` }, |
| | | { type: 'menu', url: NormalTable, component: 'table', subtype: 'normaltable', title: '常用表', width: 24 }, |
| | | { type: 'menu', url: TableCard, component: 'table', subtype: 'tablecard', title: '表格', width: 12 }, |
| | | { type: 'menu', url: NormalTable, component: 'table', subtype: 'normaltable', title: '表格', width: 12 }, |
| | | { type: 'menu', url: line, component: 'line', subtype: 'line', title: '折线图' }, |
| | | { type: 'menu', url: line1, component: 'line', subtype: 'line1', title: '阶梯折线图' }, |
| | | { type: 'menu', url: bar, component: 'bar', subtype: 'bar', title: '柱状图' }, |
| | |
| | | this.setState({ |
| | | visible: true, |
| | | card: card, |
| | | formlist: getSearchForm(card, this.props.menu.sysRoles, linkableFields) |
| | | formlist: getSearchForm(card, linkableFields) |
| | | }) |
| | | } |
| | | |
| | |
| | | // 初始化按钮权限 |
| | | export const INIT_ACTIONPERMISSION = 'INIT_ACTIONPERMISSION' |
| | | |
| | | // 初始化角色列表及创建存储过程可用字段 |
| | | export const INIT_PERMISSION = 'INIT_PERMISSION' |
| | | |
| | | // 初始化菜单权限 |
| | | export const INIT_MENUPERMISSION = 'INIT_MENUPERMISSION' |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | // 初始化角色列表及创建存储过程可用字段 |
| | | export const initPermission = (sysRoles, permFuncField) => { |
| | | return { |
| | | type: user.INIT_PERMISSION, |
| | | sysRoles: sysRoles, |
| | | permFuncField: permFuncField |
| | | } |
| | | } |
| | | |
| | | // 初始化菜单权限 |
| | | export const initMenuPermission = (permMenus) => { |
| | | return { |
| | |
| | | permRoles: [], // 用户角色列表 |
| | | permAction: {}, // 用户按钮权限 |
| | | permMenus: {}, // 用户三级菜单权限 |
| | | permFuncField: [], // 系统模块 |
| | | sysRoles: [], // 系统角色列表 |
| | | dataManager: false, // 数据管理员 |
| | | memberLevel: _level, // 会员等级 |
| | | customMenu: null // 编辑中的菜单(自定义页面) |
| | |
| | | ...state, |
| | | permAction: action.permAction |
| | | } |
| | | case Type.INIT_PERMISSION: |
| | | // 初始化角色列表及创建存储过程可用字段 |
| | | return { |
| | | ...state, |
| | | sysRoles: action.sysRoles, |
| | | permFuncField: action.permFuncField |
| | | } |
| | | case Type.INIT_MENUPERMISSION: |
| | | // 初始化三级菜单权限 |
| | | return { |
| | |
| | | editState: false, |
| | | editLevel: null, |
| | | permAction: {}, |
| | | permFuncField: [], |
| | | sysRoles: [], |
| | | permMenus: {}, |
| | | customMenu: null |
| | | } |
| | |
| | | originConfig: null, // 原配置 |
| | | tabviews: [], // 所有标签页 |
| | | activeKey: '0', // 默认展开基本信息 |
| | | pasteContent: null, // 粘贴内容 |
| | | openEdition: '', // 编辑版本标记,防止多人操作 |
| | | mockdata: [], // 测试数据 |
| | | } |
| | |
| | | config: res.config |
| | | }) |
| | | } else if (res.type === 'paste') { |
| | | this.setState({ |
| | | pasteContent: res.content |
| | | }, () => { |
| | | this.setState({ |
| | | pasteContent: null |
| | | }) |
| | | }) |
| | | let config = fromJS(this.state.config).toJS() |
| | | if (res.content.copyType === 'search') { |
| | | config.search.push(res.content) |
| | | } |
| | | |
| | | this.setState({config}) |
| | | } |
| | | } |
| | | |
| | |
| | | config={config} |
| | | MenuID={menu.MenuID} |
| | | tableFields={this.state.tableFields} |
| | | permFuncField={this.props.permFuncField} |
| | | updateConfig={this.updateconfig} |
| | | /> |
| | | <SearchComponent |
| | | menu={{MenuID: menu.MenuID, MenuName: config.MenuName}} |
| | | config={config} |
| | | pasteContent={this.state.pasteContent} |
| | | sysRoles={this.props.sysRoles} |
| | | updatesearch={this.updatesearch} |
| | | /> |
| | | <div className="calendar-wrap"> |
| | |
| | | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | sysRoles: state.sysRoles, |
| | | permFuncField: state.permFuncField, |
| | | memberLevel: state.memberLevel |
| | | } |
| | | } |
| | |
| | | thawButtons: [], // 已选择要解冻的按钮 |
| | | activeKey: '0', // 默认展开基本信息 |
| | | chartview: null, // 当前视图 |
| | | pasteContent: null, // 粘贴配置信息 |
| | | openEdition: '' // 编辑版本标记,防止多人操作 |
| | | } |
| | | |
| | |
| | | MenuNo: config.MenuNo, |
| | | ParentId: config.ParentId, |
| | | fstMenuId: config.fstMenuId, |
| | | supMenuList: submenu ? submenu.options : [] |
| | | supMenuList: submenu ? submenu.children : [] |
| | | } |
| | | |
| | | // 菜单信息验证通过后,跳转子配置页面 |
| | |
| | | * @description 编辑功能完成更新,包括解冻按钮、粘贴、替换等 |
| | | */ |
| | | editConfig = (res) => { |
| | | |
| | | |
| | | if (res.type === 'thaw') { |
| | | this.setState({ |
| | | thawButtons: res.thawButtons, |
| | | config: res.config |
| | | }) |
| | | } else if (res.type === 'paste') { |
| | | this.setState({ |
| | | pasteContent: res.content |
| | | }, () => { |
| | | this.setState({ |
| | | pasteContent: null |
| | | }) |
| | | }) |
| | | } else if (res.type === 'replace') { |
| | | let config = fromJS(this.state.config).toJS() |
| | | |
| | | if (res.repType === 'field') { |
| | | let origin = res.origin.toLowerCase() |
| | | let value = res.value |
| | | |
| | | config.search = config.search.map(item => { |
| | | if (item.field && item.field.toLowerCase() === origin) { |
| | | item.field = value |
| | | } else if (item.datefield && item.datefield.toLowerCase() === origin) { |
| | | item.datefield = value |
| | | if (res.content.copyType === 'search') { |
| | | config.search.push(res.content) |
| | | } else if (res.content.copyType === 'action') { |
| | | config.action.push(res.content) |
| | | } else if (res.content.copyType === 'columns' && res.content.columns && res.content.columns.length > 0) { |
| | | config.columns = config.columns.filter(col => !col.origin) |
| | | config.columns = [...config.columns, ...res.content.columns] |
| | | } |
| | | return item |
| | | }) |
| | | config.columns = config.columns.map(item => { |
| | | if (item.field && item.field.toLowerCase() === origin) { |
| | | item.field = value |
| | | } else if (item.nameField && item.nameField.toLowerCase() === origin) { |
| | | item.nameField = value |
| | | } |
| | | return item |
| | | }) |
| | | } |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | | message: '替换成功。', |
| | | duration: 2 |
| | | }) |
| | | this.setState({ config }) |
| | | } |
| | | } |
| | |
| | | <SettingComponent |
| | | config={config} |
| | | MenuID={this.props.menu.MenuID} |
| | | permFuncField={this.props.permFuncField} |
| | | updatesetting={this.updateconfig} |
| | | /> |
| | | <SearchComponent |
| | | menu={{MenuID: this.props.menu.MenuID, MenuName: config.MenuName}} |
| | | config={config} |
| | | pasteContent={this.state.pasteContent} |
| | | sysRoles={this.props.sysRoles} |
| | | updatesearch={this.updatesearch} |
| | | /> |
| | | <div className="chart-view" style={{position: 'relative'}}> |
| | | {/* 视图组 权限 会员等级20+ */} |
| | | {this.props.memberLevel >= 20 ? <ChartGroupComponent |
| | | config={config} |
| | | sysRoles={this.props.sysRoles} |
| | | updatechartgroup={this.updatechartgroup} |
| | | /> : null} |
| | | {config.charts.map(item => { |
| | |
| | | menu={{ MenuID: this.props.menu.MenuID, MenuName: config.MenuName, MenuNo: config.MenuNo, fstMenuList: this.props.menu.fstMenuList }} |
| | | config={config} |
| | | tabs={this.state.tabviews} |
| | | pasteContent={this.state.pasteContent} |
| | | usefulFields={this.props.permFuncField} |
| | | setSubConfig={(_btn) => this.setSubConfig(_btn, 'button')} |
| | | updateaction={this.updateaction} |
| | | /> |
| | | <ColumnComponent |
| | | config={config} |
| | | menu={this.props.menu} |
| | | sysRoles={this.props.sysRoles} |
| | | pasteContent={this.state.pasteContent} |
| | | updatecolumn={this.updateconfig} |
| | | /> |
| | | </Col> |
| | |
| | | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | sysRoles: state.sysRoles, |
| | | permFuncField: state.permFuncField, |
| | | memberLevel: state.memberLevel |
| | | } |
| | | } |
| | |
| | | UNSAFE_componentWillMount () { |
| | | const { menu } = this.props |
| | | |
| | | let supList = [] |
| | | if (menu.supMenuList && menu.supMenuList.length > 0) { |
| | | supList = menu.supMenuList |
| | | } else if (menu.fstMenuList && menu.FstId) { |
| | | let _menu = menu.fstMenuList.filter(cell => cell.MenuID === menu.FstId)[0] |
| | | supList = _menu ? _menu.children : [] |
| | | } |
| | | |
| | | this.setState({ |
| | | menulist: menu.fstMenuList, |
| | | submenulist: supList |
| | | menulist: menu.fstMenuList || [], |
| | | submenulist: menu.supMenuList || [] |
| | | }) |
| | | } |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | let roleList = [] |
| | | if (this.props.sysRoles && this.props.sysRoles.length > 0) { |
| | | roleList = this.props.sysRoles.map(role => { |
| | | return { |
| | | uuid: role.uuid, |
| | | field: role.value, |
| | | label: role.text |
| | | } |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | modaltype: 'search', |
| | | card: card, |
| | | formlist: getModalForm(card, _inputfields, _linkableFields, _linksupFields, false, roleList).map(item => { |
| | | formlist: getModalForm(card, _inputfields, _linkableFields, _linksupFields, false).map(item => { |
| | | if (item.key === 'type') { |
| | | item.options = item.options.filter(option => !['switch', 'checkbox', 'radio', 'checkcard', 'hint'].includes(option.value)) |
| | | } |
| | |
| | | } |
| | | |
| | | handleAction = (card) => { |
| | | let ableField = this.props.permFuncField.join(', ') |
| | | let usefulFields = sessionStorage.getItem('permFuncField') |
| | | if (usefulFields) { |
| | | try { |
| | | usefulFields = JSON.parse(usefulFields) |
| | | } catch { |
| | | usefulFields = [] |
| | | } |
| | | } else { |
| | | usefulFields = [] |
| | | } |
| | | |
| | | let ableField = usefulFields.join(', ') |
| | | let functip = <div> |
| | | <p style={{marginBottom: '5px'}}>{this.state.dict['model.tooltip.func.innerface'].replace('@ableField', ableField)}</p> |
| | | <p>{this.state.dict['model.tooltip.func.outface']}</p> |
| | |
| | | this.setState({ |
| | | modaltype: 'actionEdit', |
| | | card: card, |
| | | formlist: getActionForm(card, functip, this.state.config, this.props.permFuncField) |
| | | formlist: getActionForm(card, functip, this.state.config, usefulFields) |
| | | }) |
| | | } |
| | | |
| | |
| | | menu={this.props.menu} |
| | | config={this.state.config} |
| | | inputSubmit={this.settingSave} |
| | | usefulFields={this.props.permFuncField} |
| | | wrappedComponentRef={(inst) => this.settingRef = inst} |
| | | /> |
| | | </Modal> |
| | |
| | | } |
| | | } |
| | | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | sysRoles: state.sysRoles, |
| | | permFuncField: state.permFuncField |
| | | } |
| | | const mapStateToProps = () => { |
| | | return {} |
| | | } |
| | | |
| | | const mapDispatchToProps = () => { |
| | |
| | | dict: PropTypes.object, // 字典项 |
| | | menu: PropTypes.object, |
| | | config: PropTypes.object, |
| | | usefulFields: PropTypes.array, |
| | | inputSubmit: PropTypes.any // 回车提交事件 |
| | | } |
| | | |
| | | state = { |
| | | interType: (this.props.config.setting && this.props.config.setting.interType) || 'inner', |
| | | columns: null, |
| | | usefulFields: [], |
| | | interReadonly: false, |
| | | } |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | let usefulFields = sessionStorage.getItem('permFuncField') |
| | | if (usefulFields) { |
| | | try { |
| | | usefulFields = JSON.parse(usefulFields) |
| | | } catch { |
| | | usefulFields = [] |
| | | } |
| | | } else { |
| | | usefulFields = [] |
| | | } |
| | | |
| | | this.setState({ |
| | | columns: _columns, |
| | | setting: _setting, |
| | | interType: _setting.interType || 'inner', |
| | | interReadonly: _setting.sysInterface === 'true', |
| | | datatype: _setting.datatype || 'maintable' |
| | | datatype: _setting.datatype || 'maintable', |
| | | usefulFields |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { dict, usefulFields, menu } = this.props |
| | | const { dict, menu } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { interType, setting, datatype } = this.state |
| | | const { interType, setting, datatype, usefulFields } = this.state |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | card.linkSubField = card.linkSubField.filter(item => fields.includes(item)) |
| | | } |
| | | |
| | | let roleList = [] |
| | | if (this.props.sysRoles && this.props.sysRoles.length > 0) { |
| | | roleList = this.props.sysRoles.map(role => { |
| | | return { |
| | | uuid: role.uuid, |
| | | field: role.value, |
| | | label: role.text |
| | | } |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | visible: true, |
| | | card: card, |
| | | formlist: getModalForm(card, _inputfields, _linkableFields, _linksupFields, !!this.props.editTab, roleList) |
| | | formlist: getModalForm(card, _inputfields, _linkableFields, _linksupFields, !!this.props.editTab) |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | sysRoles: state.sysRoles |
| | | } |
| | | const mapStateToProps = () => { |
| | | return {} |
| | | } |
| | | |
| | | const mapDispatchToProps = () => { |
| | |
| | | type: PropTypes.string, // 菜单类型,主表或子表 |
| | | menu: PropTypes.object, // 菜单信息(菜单id,菜单参数,菜单名称) |
| | | config: PropTypes.object, // 菜单配置信息 |
| | | pasteContent: PropTypes.object, // 粘贴配置信息 |
| | | usefulFields: PropTypes.array, // 自定义函数可用字段 |
| | | tabs: PropTypes.array, // 所有标签 |
| | | setSubConfig: PropTypes.func, // 设置子配置信息 |
| | | updateaction: PropTypes.func // 菜单配置更新 |
| | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { actionlist } = this.state |
| | | |
| | | if (nextProps.pasteContent && nextProps.pasteContent.copyType === 'action') { |
| | | this.setState({actionlist: [...actionlist, nextProps.pasteContent]}) |
| | | this.handleAction(nextProps.pasteContent) |
| | | } else if (!is(fromJS(nextProps.config.action), fromJS(this.props.config.action)) && !is(fromJS(nextProps.config.action), fromJS(actionlist))) { |
| | | if (!is(fromJS(nextProps.config.action), fromJS(this.props.config.action)) && !is(fromJS(nextProps.config.action), fromJS(actionlist))) { |
| | | let len = nextProps.config.action.length |
| | | let item = nextProps.config.action[len - 1] |
| | | if (item.copyType && item.focus) { |
| | | this.handleAction(item) |
| | | } |
| | | this.setState({actionlist: fromJS(nextProps.config.action).toJS()}) |
| | | } |
| | | } |
| | |
| | | */ |
| | | handleAction = (card) => { |
| | | const { menu } = this.props |
| | | let ableField = this.props.usefulFields.join(', ') |
| | | |
| | | let usefulFields = sessionStorage.getItem('permFuncField') |
| | | if (usefulFields) { |
| | | try { |
| | | usefulFields = JSON.parse(usefulFields) |
| | | } catch { |
| | | usefulFields = [] |
| | | } |
| | | } else { |
| | | usefulFields = [] |
| | | } |
| | | |
| | | let ableField = usefulFields.join(', ') |
| | | let functip = <div> |
| | | <p style={{marginBottom: '5px'}}>{this.state.dict['model.tooltip.func.innerface'].replace('@ableField', ableField)}</p> |
| | | <p>{this.state.dict['model.tooltip.func.outface']}</p> |
| | |
| | | this.setState({ |
| | | visible: true, |
| | | card: card, |
| | | formlist: getActionForm(card, functip, this.props.config, this.props.usefulFields, this.props.type, menulist, this.state.printTemps) |
| | | formlist: getActionForm(card, functip, this.props.config, usefulFields, this.props.type, menulist, this.state.printTemps) |
| | | }) |
| | | } |
| | | |
| | |
| | | * @description 取消保存,如果元素为新添元素,则从序列中删除 |
| | | */ |
| | | editModalCancel = () => { |
| | | const { card } = this.state |
| | | const { config } = this.props |
| | | const { card, actionlist } = this.state |
| | | |
| | | if (card.focus) { |
| | | let actionlist = fromJS(this.state.actionlist).toJS() |
| | | |
| | | actionlist = actionlist.filter(item => item.uuid !== card.uuid) |
| | | let _actionlist = actionlist.filter(item => item.uuid !== card.uuid) |
| | | |
| | | this.setState({ |
| | | card: null, |
| | | actionlist: actionlist, |
| | | actionlist: _actionlist, |
| | | visible: false |
| | | }) |
| | | this.props.updateaction({...config, action: _actionlist}) |
| | | } else { |
| | | this.setState({ |
| | | card: null, |
| | |
| | | class ChartGroupComponent extends Component { |
| | | static propTpyes = { |
| | | config: PropTypes.object, // 菜单配置信息 |
| | | sysRoles: PropTypes.array, // 角色列表,黑名单使用 |
| | | updatechartgroup: PropTypes.func // 图表更新 |
| | | } |
| | | |
| | |
| | | this.setState({ |
| | | card: item, |
| | | modaltype: _type, |
| | | formlist: getChartViewForm(item, this.props.sysRoles, _columns, actions, extraActions) |
| | | formlist: getChartViewForm(item, _columns, actions, extraActions) |
| | | }) |
| | | } |
| | | |
| | |
| | | static propTpyes = { |
| | | menu: PropTypes.object, // 三级菜单信息 |
| | | config: PropTypes.object, // 配置信息 |
| | | pasteContent: PropTypes.object, // 粘贴配置信息 |
| | | sysRoles: PropTypes.array, // 角色列表,权限分配 |
| | | updatecolumn: PropTypes.func // 更新 |
| | | } |
| | | |
| | |
| | | const { config } = this.props |
| | | const { columnlist } = this.state |
| | | |
| | | if ( |
| | | nextProps.pasteContent && |
| | | nextProps.pasteContent.columns && |
| | | nextProps.pasteContent.copyType === 'columns' && |
| | | nextProps.pasteContent.columns.length > 0 |
| | | ) { |
| | | if (columnlist.filter(col => !col.origin).length === 0) { |
| | | this.setState({columnlist: nextProps.pasteContent.columns}, () => { |
| | | this.props.updatecolumn({...config, columns: nextProps.pasteContent.columns}) |
| | | }) |
| | | } |
| | | } else if (!is(fromJS(nextProps.config.columns), fromJS(config.columns)) && !is(fromJS(nextProps.config.columns), fromJS(columnlist))) { |
| | | if (!is(fromJS(nextProps.config.columns), fromJS(config.columns)) && !is(fromJS(nextProps.config.columns), fromJS(columnlist))) { |
| | | this.setState({columnlist: fromJS(nextProps.config.columns).toJS()}) |
| | | } |
| | | } |
| | |
| | | this.setState({ |
| | | modaltype: 'columns', |
| | | card: card, |
| | | formlist: getColumnForm(card, this.props.sysRoles, menulist) |
| | | formlist: getColumnForm(card, menulist) |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | |
| | | |
| | | class SearchComponent extends Component { |
| | | static propTpyes = { |
| | | menu: PropTypes.object, // 当前菜单信息 |
| | | config: PropTypes.object, // 配置信息 |
| | | pasteContent: PropTypes.object, // 粘贴配置信息 |
| | | sysRoles: PropTypes.array, // 角色列表,黑名单 |
| | | updatesearch: PropTypes.func // 更新 |
| | | } |
| | | |
| | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { searchlist } = this.state |
| | | |
| | | if (nextProps.pasteContent && nextProps.pasteContent.copyType === 'search') { |
| | | this.setState({searchlist: [...searchlist, nextProps.pasteContent]}) |
| | | this.handleSearch(nextProps.pasteContent) |
| | | } else if (!is(fromJS(nextProps.config.search), fromJS(this.props.config.search)) && !is(fromJS(nextProps.config.search), fromJS(searchlist))) { |
| | | if (!is(fromJS(nextProps.config.search), fromJS(this.props.config.search)) && !is(fromJS(nextProps.config.search), fromJS(searchlist))) { |
| | | let len = nextProps.config.search.length |
| | | let item = nextProps.config.search[len - 1] |
| | | if (item.copyType && item.focus) { |
| | | this.handleSearch(item) |
| | | } |
| | | this.setState({searchlist: fromJS(nextProps.config.search).toJS()}) |
| | | } |
| | | } |
| | |
| | | this.setState({ |
| | | visible: true, |
| | | card: card, |
| | | formlist: getSearchForm(card, this.props.sysRoles, linkableFields) |
| | | formlist: getSearchForm(card, linkableFields) |
| | | }) |
| | | } |
| | | |
| | |
| | | * @description 取消保存,如果元素为新添元素,则从序列中删除 |
| | | */ |
| | | editModalCancel = () => { |
| | | const { card } = this.state |
| | | const { config } = this.props |
| | | const { card, searchlist } = this.state |
| | | |
| | | if (card.focus) { |
| | | let searchlist = fromJS(this.state.searchlist).toJS() |
| | | |
| | | searchlist = searchlist.filter(item => item.uuid !== card.uuid) |
| | | let _searchlist = searchlist.filter(item => item.uuid !== card.uuid) |
| | | |
| | | this.setState({ |
| | | card: null, |
| | | searchlist: searchlist, |
| | | searchlist: _searchlist, |
| | | visible: false |
| | | }) |
| | | this.props.updatesearch({...config, search: _searchlist}) |
| | | } else { |
| | | this.setState({ |
| | | card: null, |
| | |
| | | config: PropTypes.any, |
| | | MenuID: PropTypes.string, |
| | | tableFields: PropTypes.any, |
| | | permFuncField: PropTypes.any, |
| | | updateConfig: PropTypes.func |
| | | } |
| | | |
| | |
| | | dict={dict} |
| | | config={config} |
| | | tableFields={this.props.tableFields} |
| | | permFuncField={this.props.permFuncField} |
| | | menuId={this.props.config.uuid} |
| | | searches={config.search} |
| | | wrappedComponentRef={(inst) => this.verifyRef = inst} |
| | |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | | tableFields: PropTypes.any, // 数据源信息 |
| | | permFuncField: PropTypes.any, // 数据源信息 |
| | | config: PropTypes.object, // 数据源信息 |
| | | menuId: PropTypes.string, // 菜单Id |
| | | searches: PropTypes.array, // 搜索条件 |
| | |
| | | <SettingForm |
| | | menuId={this.props.menuId} |
| | | dict={this.props.dict} |
| | | permFuncField={this.props.permFuncField} |
| | | columns={columns} |
| | | setting={setting} |
| | | scripts={scripts} |
| | |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | | menuId: PropTypes.string, // 菜单Id |
| | | permFuncField: PropTypes.any, // 菜单Id |
| | | setting: PropTypes.object, // 数据源配置 |
| | | columns: PropTypes.array, // 列设置 |
| | | scripts: PropTypes.array, // 自定义脚本 |
| | |
| | | |
| | | state = { |
| | | interType: this.props.setting.interType || 'system', |
| | | usefulFields: [] |
| | | } |
| | | |
| | | UNSAFE_componentWillMount() { |
| | | let usefulFields = sessionStorage.getItem('permFuncField') |
| | | if (usefulFields) { |
| | | try { |
| | | usefulFields = JSON.parse(usefulFields) |
| | | } catch { |
| | | usefulFields = [] |
| | | } |
| | | } else { |
| | | usefulFields = [] |
| | | } |
| | | |
| | | this.setState({ |
| | | usefulFields |
| | | }) |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { setting, permFuncField } = this.props |
| | | const { setting } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { interType } = this.state |
| | | const { interType, usefulFields } = this.state |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | let tooltip = null |
| | | let rules = [] |
| | | |
| | | if (permFuncField && permFuncField.length > 0) { |
| | | tooltip = '开头可用字符:' + permFuncField.join(', ') |
| | | let str = '^(' + permFuncField.join('|') + ')' |
| | | if (usefulFields.length > 0) { |
| | | tooltip = '开头可用字符:' + usefulFields.join(', ') |
| | | let str = '^(' + usefulFields.join('|') + ')' |
| | | let _patten = new RegExp(str + formRule.func.innerPattern + '$', 'g') |
| | | |
| | | rules.push({ |
| | |
| | | mainsearch: PropTypes.any, // 主表的搜索条件,当子表设置接收主表条件时有效 |
| | | MenuID: PropTypes.string, // 菜单ID |
| | | config: PropTypes.object, // 菜单配置信息 |
| | | permFuncField: PropTypes.array, // 存储过程可用开头字段 |
| | | updatesetting: PropTypes.func |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { config, permFuncField } = this.props |
| | | const { config } = this.props |
| | | const { dict, visible, search, menu } = this.state |
| | | |
| | | return ( |
| | |
| | | menu={menu} |
| | | config={config} |
| | | search={search} |
| | | permFuncField={permFuncField} |
| | | wrappedComponentRef={(inst) => this.settingRef = inst} |
| | | /> |
| | | </Modal> |
| | |
| | | type: PropTypes.string, // 菜单类型,main或subtable |
| | | dict: PropTypes.object, // 字典项 |
| | | menu: PropTypes.object, // 菜单信息 |
| | | permFuncField: PropTypes.any, // 存储过程可用开始字符 |
| | | setting: PropTypes.object, // 数据源配置 |
| | | columns: PropTypes.array, // 列设置 |
| | | scripts: PropTypes.array, // 自定义脚本 |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { setting, permFuncField } = this.props |
| | | const { setting } = this.props |
| | | |
| | | let usefulFields = sessionStorage.getItem('permFuncField') |
| | | if (usefulFields) { |
| | | try { |
| | | usefulFields = JSON.parse(usefulFields) |
| | | } catch { |
| | | usefulFields = [] |
| | | } |
| | | } else { |
| | | usefulFields = [] |
| | | } |
| | | |
| | | let tooltip = null |
| | | let rules = [] |
| | | |
| | | if (permFuncField && permFuncField.length > 0) { |
| | | tooltip = '开头可用字符:' + permFuncField.join(', ') |
| | | let str = '^(' + permFuncField.join('|') + ')' |
| | | if (usefulFields.length > 0) { |
| | | tooltip = '开头可用字符:' + usefulFields.join(', ') |
| | | let str = '^(' + usefulFields.join('|') + ')' |
| | | let _patten = new RegExp(str + formRule.func.innerPattern + '$', 'g') |
| | | |
| | | rules.push({ |
| | |
| | | dict: PropTypes.object, // 字典项 |
| | | menu: PropTypes.object, // 菜单信息 |
| | | config: PropTypes.object, // 页面配置信息 |
| | | permFuncField: PropTypes.array, // 自定义函数可用字段 |
| | | search: PropTypes.array // 搜索条件 |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { config, menu, dict, permFuncField } = this.props |
| | | const { config, menu, dict } = this.props |
| | | const { loading, activeKey, setting, defaultSql, columns, scripts } = this.state |
| | | |
| | | return ( |
| | |
| | | columns={columns} |
| | | setting={setting} |
| | | scripts={scripts} |
| | | permFuncField={permFuncField} |
| | | wrappedComponentRef={(inst) => this.settingForm = inst} |
| | | /> |
| | | </TabPane> |
| | |
| | | static propTpyes = { |
| | | MenuID: PropTypes.string, // 菜单ID |
| | | config: PropTypes.object, // 菜单配置信息 |
| | | permFuncField: PropTypes.array, // 存储过程可用开头字段 |
| | | updatesetting: PropTypes.func |
| | | } |
| | | |
| | |
| | | config={config} |
| | | menu={this.state.menu} |
| | | inputSubmit={this.settingSave} |
| | | permFuncField={this.props.permFuncField} |
| | | wrappedComponentRef={(inst) => this.settingRef = inst} |
| | | /> |
| | | </Modal> |
| | |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | | menu: PropTypes.object, // 菜单信息 |
| | | permFuncField: PropTypes.any, // 存储过程可用开始字符 |
| | | setting: PropTypes.object, // 数据源配置 |
| | | inputSubmit: PropTypes.func // 触发提交 |
| | | } |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { setting, permFuncField } = this.props |
| | | const { setting } = this.props |
| | | |
| | | let usefulFields = sessionStorage.getItem('permFuncField') |
| | | let tooltip = null |
| | | let rules = [] |
| | | |
| | | if (permFuncField && permFuncField.length > 0) { |
| | | tooltip = '开头可用字符:' + permFuncField.join(', ') |
| | | let str = '^(' + permFuncField.join('|') + ')' |
| | | if (usefulFields) { |
| | | try { |
| | | usefulFields = JSON.parse(usefulFields) |
| | | } catch { |
| | | usefulFields = [] |
| | | } |
| | | } else { |
| | | usefulFields = [] |
| | | } |
| | | |
| | | if (usefulFields.length > 0) { |
| | | tooltip = '开头可用字符:' + usefulFields.join(', ') |
| | | let str = '^(' + usefulFields.join('|') + ')' |
| | | let _patten = new RegExp(str + formRule.func.innerPattern + '$', 'g') |
| | | |
| | | rules.push({ |
| | |
| | | dict: PropTypes.object, // 字典项 |
| | | menu: PropTypes.object, // 菜单信息 |
| | | config: PropTypes.object, // 页面配置信息 |
| | | permFuncField: PropTypes.array, // 存储过程可用字段 |
| | | inputSubmit: PropTypes.any // 回车提交事件 |
| | | } |
| | | |
| | |
| | | menu={menu} |
| | | dict={this.props.dict} |
| | | setting={setting} |
| | | permFuncField={this.props.permFuncField} |
| | | inputSubmit={this.props.inputSubmit} |
| | | wrappedComponentRef={(inst) => this.settingForm = inst} |
| | | /> |
| | |
| | | thawButtons: [], // 已选择要解冻的按钮 |
| | | activeKey: '0', // 默认展开基本信息 |
| | | chartview: null, // 当前视图 |
| | | pasteContent: null, // 粘贴内容 |
| | | openEdition: '' // 编辑版本标记,防止多人操作 |
| | | } |
| | | |
| | |
| | | config: res.config |
| | | }) |
| | | } else if (res.type === 'paste') { |
| | | this.setState({ |
| | | pasteContent: res.content |
| | | }, () => { |
| | | this.setState({ |
| | | pasteContent: null |
| | | }) |
| | | }) |
| | | let config = fromJS(this.state.config).toJS() |
| | | if (res.content.copyType === 'search') { |
| | | config.search.push(res.content) |
| | | } else if (res.content.copyType === 'action') { |
| | | config.action.push(res.content) |
| | | } else if (res.content.copyType === 'columns' && res.content.columns && res.content.columns.length > 0) { |
| | | config.columns = config.columns.filter(col => !col.origin) |
| | | config.columns = [...config.columns, ...res.content.columns] |
| | | } |
| | | |
| | | this.setState({config}) |
| | | } |
| | | } |
| | | |
| | |
| | | config={config} |
| | | mainsearch={!this.props.editSubTab && this.props.editTab.mainsearch ? this.props.editTab.mainsearch : ''} |
| | | MenuID={config.uuid} |
| | | permFuncField={this.props.permFuncField} |
| | | updatesetting={this.updateconfig} |
| | | /> |
| | | <SearchComponent |
| | | menu={{MenuID: config.uuid, MenuName: config.tabName}} |
| | | config={config} |
| | | pasteContent={this.state.pasteContent} |
| | | sysRoles={this.props.sysRoles} |
| | | updatesearch={this.updatesearch} |
| | | /> |
| | | <div className="chart-view" style={{position: 'relative'}}> |
| | | {/* 视图组 权限 会员等级20+ */} |
| | | {this.props.memberLevel >= 20 ? <ChartGroupComponent |
| | | config={config} |
| | | sysRoles={this.props.sysRoles} |
| | | updatechartgroup={this.updatechartgroup} |
| | | /> : null} |
| | | {config.charts.map(item => { |
| | |
| | | menu={{MenuID: config.uuid, MenuName: config.tabName, MenuNo: config.tabNo, fstMenuList: this.props.menu.fstMenuList}} |
| | | config={config} |
| | | tabs={this.state.tabviews} |
| | | pasteContent={this.state.pasteContent} |
| | | usefulFields={this.props.permFuncField} |
| | | setSubConfig={this.setSubConfig} |
| | | updateaction={this.updateaction} |
| | | /> |
| | | <ColumnComponent |
| | | config={config} |
| | | menu={this.props.menu} |
| | | sysRoles={this.props.sysRoles} |
| | | pasteContent={this.state.pasteContent} |
| | | updatecolumn={this.updateconfig} |
| | | /> |
| | | </Col> |
| | |
| | | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | sysRoles: state.sysRoles, |
| | | permFuncField: state.permFuncField, |
| | | memberLevel: state.memberLevel |
| | | } |
| | | } |
| | |
| | | delTabs: [], // 删除标签列表 |
| | | tabviews: [], // 所有标签页 |
| | | activeKey: '0', // 默认展开基本信息 |
| | | pasteContent: null, // 粘贴配置信息 |
| | | openEdition: '' // 编辑版本标记,防止多人操作 |
| | | } |
| | | |
| | |
| | | <TreeSettingComponent |
| | | config={config} |
| | | MenuID={this.props.menu.MenuID} |
| | | permFuncField={this.props.permFuncField} |
| | | updatesetting={this.updateconfig} |
| | | /> |
| | | <Card |
| | |
| | | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | sysRoles: state.sysRoles, |
| | | permFuncField: state.permFuncField, |
| | | memberLevel: state.memberLevel |
| | | } |
| | | } |
| | |
| | | res.type = 'date' |
| | | } |
| | | } |
| | | res.copyType = 'search' |
| | | |
| | | this.setState({ |
| | | pasteVisible: false |
| | |
| | | res.type = 'date' |
| | | } |
| | | } |
| | | res.copyType = 'form' |
| | | |
| | | if (_config.groups.length > 0) { |
| | | _config.groups.forEach(group => { |
| | |
| | | /** |
| | | * @description 获取搜索条件表单配置信息 |
| | | * @param {object} card // 搜索条件对象 |
| | | * @param {Array} roleList // 角色列表 |
| | | * @param {Array} linkableFields // 可关联字段 |
| | | */ |
| | | export function getSearchForm (card, roleList, linkableFields) { |
| | | export function getSearchForm (card, linkableFields) { |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | if (roleList) { |
| | | try { |
| | | roleList = JSON.parse(roleList) |
| | | } catch { |
| | | roleList = [] |
| | | } |
| | | } else { |
| | | roleList = [] |
| | | } |
| | | |
| | | return [ |
| | | { |
| | | type: 'text', |
| | |
| | | * @param {*} card 编辑按钮 |
| | | * @param {*} functip 生成存储过程提示 |
| | | * @param {*} config 页面配置 |
| | | * @param {*} permFuncField 存储过程可用的开始字段 |
| | | * @param {*} usefulFields 存储过程可用的开始字段 |
| | | * @param {*} type 按钮类型,用于区分可选的打开方式 |
| | | */ |
| | | export function getActionForm (card, functip, config, permFuncField, type, menulist = [], printTemps = []) { |
| | | export function getActionForm (card, functip, config, usefulFields, type, menulist = [], printTemps = []) { |
| | | let opentypes = [ |
| | | { |
| | | value: 'pop', |
| | |
| | | label: Formdict['header.form.innerFunc'], |
| | | initVal: card.innerFunc || '', |
| | | tooltip: functip, |
| | | fields: permFuncField, |
| | | fields: usefulFields, |
| | | tooltipClass: 'middle', |
| | | required: card.intertype === 'inner', |
| | | readonly: false |
| | |
| | | /** |
| | | * @description 获取显示列表单配置信息 |
| | | * @param {object} card // 搜索条件对象 |
| | | * @param {Array} roleList // 角色列表-黑名单 |
| | | * @param {Array} menulist // 菜单列表-用于字段透视 |
| | | */ |
| | | export function getColumnForm (card, roleList = [], menulist = []) { |
| | | export function getColumnForm (card, menulist = []) { |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | if (roleList) { |
| | | try { |
| | | roleList = JSON.parse(roleList) |
| | | } catch { |
| | | roleList = [] |
| | | } |
| | | } else { |
| | | roleList = [] |
| | | } |
| | | |
| | | return [ |
| | | { |
| | | type: 'text', |
| | |
| | | /** |
| | | * @description 获取图表视图外部配置表单 |
| | | * @param {object} card // 搜索条件对象 |
| | | * @param {Array} roleList // 角色列表-黑名单 |
| | | * @param {Array} columns // 显示列 |
| | | * @param {Array} actions // 按钮组excel |
| | | * @param {Array} extraActions // 常规按钮 |
| | | */ |
| | | export function getChartViewForm (card, roleList = [], _columns, actions, extraActions) { |
| | | export function getChartViewForm (card, _columns, actions, extraActions) { |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | if (roleList) { |
| | | try { |
| | | roleList = JSON.parse(roleList) |
| | | } catch { |
| | | roleList = [] |
| | | } |
| | | } else { |
| | | roleList = [] |
| | | } |
| | | |
| | | let _charts = [{ |
| | | value: 'line', |
| | | text: '折线图' |
| | |
| | | * @param {*} linkableFields // 可关联表单 |
| | | * @param {*} linksupFields // 上级表单 |
| | | * @param {*} subtable // 是否为子表表单 |
| | | * @param {*} roleList // 角色列表-黑名单 |
| | | */ |
| | | export function getModalForm (card, inputfields, linkableFields, linksupFields, subtable = false, roleList = []) { |
| | | export function getModalForm (card, inputfields, linkableFields, linksupFields, subtable = false) { |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | if (roleList) { |
| | | try { |
| | | roleList = JSON.parse(roleList) |
| | | roleList = roleList.map(role => { |
| | | return { |
| | | uuid: role.uuid, |
| | | field: role.value, |
| | | label: role.text |
| | | } |
| | | }) |
| | | } catch { |
| | | roleList = [] |
| | | } |
| | | } else { |
| | | roleList = [] |
| | | } |
| | | |
| | | let _openType = [] |
| | | let _fieldlength = 50 |
| | | |
| | |
| | | import antdEnUS from 'antd/es/locale/en_US' |
| | | import antdZhCN from 'antd/es/locale/zh_CN' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import { modifyCustomMenu, initPermission } from '@/store/action' |
| | | import { modifyCustomMenu } from '@/store/action' |
| | | |
| | | import './index.scss' |
| | | |
| | |
| | | closeView = () => { |
| | | const { oriConfig, config } = this.state |
| | | |
| | | if (!config) { |
| | | window.close() |
| | | return |
| | | } |
| | | |
| | | let _config = fromJS(config).toJS() |
| | | delete _config.fstMenuList |
| | | delete _config.permFuncField |
| | | delete _config.sysRoles |
| | | delete _config.tableFields |
| | | |
| | | if (!is(fromJS(oriConfig), fromJS(_config))) { |
| | |
| | | |
| | | let _config = fromJS(config).toJS() |
| | | delete _config.fstMenuList |
| | | delete _config.permFuncField |
| | | delete _config.sysRoles |
| | | delete _config.tableFields |
| | | |
| | | let param = { |
| | |
| | | _permFuncField = _permFuncField.sort() |
| | | } |
| | | |
| | | let config = {...this.state.config, sysRoles: _sysRoles, permFuncField: _permFuncField} |
| | | |
| | | this.setState({config}) |
| | | this.props.modifyCustomMenu(config) |
| | | sessionStorage.setItem('sysRoles', JSON.stringify(_sysRoles)) |
| | | sessionStorage.setItem('permFuncField', JSON.stringify(_permFuncField)) |
| | | } |
| | | }) |
| | | } |
| | |
| | | |
| | | const mapDispatchToProps = (dispatch) => { |
| | | return { |
| | | modifyCustomMenu: (customMenu) => dispatch(modifyCustomMenu(customMenu)), |
| | | initPermission: (sysRoles, permFuncField) => dispatch(initPermission(sysRoles, permFuncField)) |
| | | modifyCustomMenu: (customMenu) => dispatch(modifyCustomMenu(customMenu)) |
| | | } |
| | | } |
| | | |