| | |
| | | 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' |
| | |
| | | UNSAFE_componentWillMount() { |
| | | document.body.className = '' |
| | | let param = JSON.parse(window.decodeURIComponent(window.atob(this.props.match.params.param))) |
| | | |
| | | if (param.lang) { |
| | | sessionStorage.setItem('lang', param.lang) |
| | | } |
| | | |
| | | this.setState({app: param}, () => { |
| | | this.getTreeList() |
| | |
| | | ParentID: 'mk_app', |
| | | TypeCharOne: app.kei_no, |
| | | typename: app.typename, |
| | | lang: app.lang |
| | | lang: app.lang, |
| | | TYPE: 30 |
| | | }).then(res => { |
| | | if (res.status) { |
| | | this.setState({ |
| | |
| | | let _param = { |
| | | func: 's_kei_link_keyids_addupt', |
| | | BID: app.ID, |
| | | exec_type: 'y', |
| | | exec_type: 'x', |
| | | LText: '' |
| | | } |
| | | |
| | |
| | | if (appViewList.length !== _appViewList.length) { |
| | | _param.LText = _appViewList.map(item => `select '${item.keys_id}','${item.keys_type}','${item.kei_no}','${item.appkey}','${item.bid}','${sessionStorage.getItem('CloudUserID')}','${item.remark}'`) |
| | | _param.LText = _param.LText.join(' union all ') |
| | | _param.LText = Utils.formatOptions(_param.LText) |
| | | _param.LText = Utils.formatOptions(_param.LText, 'x') |
| | | |
| | | _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | _param.secretkey = Utils.encrypt('', _param.timestamp) |
| | |
| | | |
| | | 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> |
| | | ) |
| | | } |