king
2020-08-26 e4da07b71dddb3b01b58ecaf21ae5b7052e98b7d
src/views/menudesign/index.jsx
@@ -22,6 +22,7 @@
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'))
@@ -39,6 +40,7 @@
  }
  UNSAFE_componentWillMount() {
    this.getMenuParam()
    // this.testFunc()
  }
@@ -50,6 +52,10 @@
    this.setState = () => {
      return
    }
  }
  reloadTab = () => {
  }
  closeView = () => {
@@ -155,6 +161,8 @@
          config: fromJS(config).toJS(),
          openEdition: result.open_edition || '',
        })
        this.getRoleFields()
      } else {
        notification.warning({
          top: 92,
@@ -162,6 +170,44 @@
          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}
    })
  }
@@ -212,6 +258,8 @@
  updatetable = (config, fields) => {
    const { tableFields } = this.state
    config.tableFields = fields ? fields : tableFields
    this.setState({
      config: config,
      tableFields: fields ? fields : tableFields
@@ -240,22 +288,26 @@
                    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>
@@ -263,7 +315,7 @@
                  <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>