| | |
| | | import React, {Component} from 'react' |
| | | import { fromJS } from 'immutable' |
| | | import { Spin, notification, Button, Table, Modal, ConfigProvider, Tree, Input, Empty } from 'antd' |
| | | import { Spin, notification, Button, Table, Modal, Tree, Input, Empty } from 'antd' |
| | | import moment from 'moment' |
| | | import md5 from 'md5' |
| | | import zhCN from 'antd/es/locale/zh_CN' |
| | | import { ApiOutlined } from '@ant-design/icons' |
| | | |
| | | import Api from '@/api' |
| | |
| | | |
| | | return ( |
| | | <div className="mk-role-manage"> |
| | | <ConfigProvider locale={zhCN}> |
| | | <Header app={app} /> |
| | | {loading ? |
| | | <div className="loading-mask"> |
| | | <Spin size="large" /> |
| | | </div> : null |
| | | } |
| | | <div className="view-wrap"> |
| | | <div className="left-view"> |
| | | <div className="app-table"> |
| | | <div className="app-action"> |
| | | <Button className="mk-green" onClick={this.triggerThaw}>解冻菜单</Button> |
| | | <Search placeholder="综合搜索" onSearch={value => this.setState({ searchkey: value })} enterButton /> |
| | | </div> |
| | | <Table |
| | | rowKey="MenuID" |
| | | columns={columns} |
| | | dataSource={_menulist} |
| | | pagination={false} |
| | | onChange={this.changeTable} |
| | | /> |
| | | </div> |
| | | </div> |
| | | <div className="right-view"> |
| | | <Header app={app} /> |
| | | {loading ? |
| | | <div className="loading-mask"> |
| | | <Spin size="large" /> |
| | | </div> : null |
| | | } |
| | | <div className="view-wrap"> |
| | | <div className="left-view"> |
| | | <div className="app-table"> |
| | | <div className="app-action"> |
| | | <Button className="mk-primary" onClick={this.initTree}>重置</Button> |
| | | {/* <Button className="mk-purple" onClick={this.syncTree}>同步</Button> */} |
| | | <Button className="mk-green save" onClick={this.saveTree}>保存</Button> |
| | | <Button className="mk-green" onClick={this.triggerThaw}>解冻菜单</Button> |
| | | <Search placeholder="综合搜索" onSearch={value => this.setState({ searchkey: value })} enterButton /> |
| | | </div> |
| | | {trees && trees.length ? <Tree |
| | | className="draggable-tree" |
| | | defaultExpandedKeys={this.state.expandedKeys} |
| | | // showLine |
| | | draggable |
| | | blockNode |
| | | onDrop={this.onDrop} |
| | | > |
| | | {this.renderNode(trees)} |
| | | </Tree> : <div className="empty"> |
| | | <Empty /> |
| | | </div>} |
| | | <Table |
| | | rowKey="MenuID" |
| | | columns={columns} |
| | | dataSource={_menulist} |
| | | pagination={false} |
| | | onChange={this.changeTable} |
| | | /> |
| | | </div> |
| | | </div> |
| | | <Modal |
| | | title="解除冻结" |
| | | visible={this.state.visible} |
| | | width={600} |
| | | onOk={this.thawSubmit} |
| | | confirmLoading={this.state.confirmLoading} |
| | | onCancel={() => this.setState({visible: false, targetKeys: []})} |
| | | destroyOnClose |
| | | > |
| | | <TransferForm onChange={(vals) => this.setState({targetKeys: vals})} menulist={this.state.thawmenulist}/> |
| | | </Modal> |
| | | </ConfigProvider> |
| | | <div className="right-view"> |
| | | <div className="app-action"> |
| | | <Button className="mk-primary" onClick={this.initTree}>重置</Button> |
| | | {/* <Button className="mk-purple" onClick={this.syncTree}>同步</Button> */} |
| | | <Button className="mk-green save" onClick={this.saveTree}>保存</Button> |
| | | </div> |
| | | {trees && trees.length ? <Tree |
| | | className="draggable-tree" |
| | | defaultExpandedKeys={this.state.expandedKeys} |
| | | // showLine |
| | | draggable |
| | | blockNode |
| | | onDrop={this.onDrop} |
| | | > |
| | | {this.renderNode(trees)} |
| | | </Tree> : <div className="empty"> |
| | | <Empty /> |
| | | </div>} |
| | | </div> |
| | | </div> |
| | | <Modal |
| | | title="解除冻结" |
| | | visible={this.state.visible} |
| | | width={600} |
| | | onOk={this.thawSubmit} |
| | | confirmLoading={this.state.confirmLoading} |
| | | onCancel={() => this.setState({visible: false, targetKeys: []})} |
| | | destroyOnClose |
| | | > |
| | | <TransferForm onChange={(vals) => this.setState({targetKeys: vals})} menulist={this.state.thawmenulist}/> |
| | | </Modal> |
| | | </div> |
| | | ) |
| | | } |