| | |
| | | const MenuForm = asyncComponent(() => import('@/menu/menuform')) |
| | | const SourceWrap = asyncComponent(() => import('@/menu/modelsource')) |
| | | const MenuShell = asyncComponent(() => import('@/menu/menushell')) |
| | | // const Controller = asyncComponent(() => import('@/mob/controller')) |
| | | // const DataSource = asyncComponent(() => import('@/mob/datasource')) |
| | | const TableComponent = asyncComponent(() => import('@/templates/sharecomponent/tablecomponent')) |
| | | |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount() { |
| | | |
| | | this.getMenuParam() |
| | | // this.testFunc() |
| | | } |
| | |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | } |
| | | |
| | | reloadTab = () => { |
| | | |
| | | } |
| | | |
| | | closeView = () => { |
| | |
| | | config: fromJS(config).toJS(), |
| | | openEdition: result.open_edition || '', |
| | | }) |
| | | |
| | | this.getRoleFields() |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | getRoleFields = () => { |
| | | Api.getSystemConfig({func: 'sPC_Get_Roles_sModular'}).then(res => { |
| | | if (res.status) { |
| | | let _permFuncField = [] |
| | | let _sysRoles = [] |
| | | |
| | | if (res.Roles && res.Roles.length > 0) { |
| | | _sysRoles = res.Roles.map(role => { |
| | | return { |
| | | uuid: Utils.getuuid(), |
| | | value: role.RoleID, |
| | | text: role.RoleName |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (res.sModular && res.sModular.length > 0) { |
| | | res.sModular.forEach(field => { |
| | | if (field.ModularNo) { |
| | | _permFuncField.push(field.ModularNo) |
| | | } |
| | | }) |
| | | _permFuncField = _permFuncField.sort() |
| | | } |
| | | |
| | | this.setState({ |
| | | config: {...this.state.config, sysRoles: _sysRoles, permFuncField: _permFuncField} |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | initMenuList = (list) => { |
| | | this.setState({ |
| | | config: {...this.state.config, fstMenuList: list} |
| | | }) |
| | | } |
| | | |
| | |
| | | updatetable = (config, fields) => { |
| | | const { tableFields } = this.state |
| | | |
| | | config.tableFields = fields ? fields : tableFields |
| | | |
| | | this.setState({ |
| | | config: config, |
| | | tableFields: fields ? fields : tableFields |
| | |
| | | parentId={this.props.match.params.ParentId} |
| | | MenuName={this.props.match.params.MenuName} |
| | | MenuNo={this.props.match.params.MenuNo} |
| | | initMenuList={this.initMenuList} |
| | | updateConfig={this.updateConfig} |
| | | /> |
| | | {/* 表名添加 */} |
| | | {config ? <TableComponent config={config} updatetable={this.updateConfig}/> : null} |
| | | {config ? <TableComponent config={config} updatetable={this.updatetable}/> : null} |
| | | </Panel> |
| | | {/* 组件添加 */} |
| | | <Panel header={dict['mob.component']} key="component"> |
| | | <SourceWrap /> |
| | | </Panel> |
| | | {/* <Panel header={dict['mob.style']} key="style"> |
| | | <Controller /> |
| | | </Panel> */} |
| | | </Collapse> |
| | | </div> |
| | | <div className="menu-view"> |
| | | <Card title={ |
| | | <div> |
| | | {config && config.MenuName} |
| | | <Icon type="redo" style={{marginLeft: '10px'}} title="刷新标签列表" onClick={() => this.reloadTab(true)} /> |
| | | <Icon type="redo" style={{marginLeft: '10px'}} title="刷新标签列表" onClick={() => this.reloadTab()} /> |
| | | </div> |
| | | } bordered={false} extra={ |
| | | <div> |
| | |
| | | <Button type="primary" onClick={this.submitConfig} loading={this.state.menuloading}>{dict['mob.save']}</Button> |
| | | </div> |
| | | } style={{ width: '100%' }}> |
| | | {config ? <MenuShell config={config} handleList={this.updateConfig} /> : null} |
| | | {config ? <MenuShell config={config} handleList={this.updateConfig} deleteCard={this.deleteCard} /> : null} |
| | | </Card> |
| | | </div> |
| | | </div> |