| | |
| | | render: (text, record) => ( |
| | | <div> |
| | | <Button type="link" onClick={() => this.deleteMenu(record)} style={{color: '#ff4d4f'}}>删除</Button> |
| | | <Button type="link" onClick={() => this.jumpApp(record)} style={{color: '#1890ff', marginLeft: '5px'}}>编辑</Button> |
| | | </div> |
| | | ), |
| | | }, |
| | |
| | | targetKeys: [], |
| | | trees: null, |
| | | expandedKeys: [], |
| | | searchkey: '' |
| | | searchkey: '', |
| | | appViewList: [] |
| | | } |
| | | |
| | | oriTrees = null |
| | |
| | | this.setState({app: param}, () => { |
| | | this.getTreeList() |
| | | this.getMenuList() |
| | | this.getAppViewList() |
| | | }) |
| | | } |
| | | |
| | |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | } |
| | | |
| | | getAppViewList = () => { |
| | | const { app } = this.state |
| | | |
| | | Api.getSystemConfig({ |
| | | func: 's_get_keyids', |
| | | bid: app.ID |
| | | }).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | this.setState({appViewList: result.data || []}) |
| | | }) |
| | | } |
| | | |
| | | getMenuList = (reset) => { |
| | |
| | | try { |
| | | let pageParam = JSON.parse(window.decodeURIComponent(window.atob(item.menus_rolelist))) |
| | | item.nodes = pageParam |
| | | if (pageParam.type === 'navbar') { |
| | | if (pageParam.login) { |
| | | item.nodes = '' |
| | | } else if (pageParam.type === 'navbar') { |
| | | item.type = 'navbar' |
| | | } |
| | | } catch { |
| | | } catch (e) { |
| | | item.nodes = '' |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | deleteMenu = (record) => { |
| | | const { app } = this.state |
| | | const { app, appViewList } = this.state |
| | | const _this = this |
| | | |
| | | let param = { |
| | |
| | | param.MenuID = param.MenuID + ',' + record.nodes.popviews.join(',') |
| | | } |
| | | |
| | | let _param = { |
| | | func: 's_kei_link_keyids_addupt', |
| | | BID: app.ID, |
| | | exec_type: 'y', |
| | | LText: '' |
| | | } |
| | | |
| | | let _appViewList = appViewList.filter(item => item.keys_id !== record.MenuID) |
| | | |
| | | 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.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | _param.secretkey = Utils.encrypt('', _param.timestamp) |
| | | } else { |
| | | _param = null |
| | | } |
| | | |
| | | confirm({ |
| | | content: '确定删除该菜单吗?', |
| | | onOk() { |
| | |
| | | duration: 3 |
| | | }) |
| | | _this.getMenuList(true) |
| | | |
| | | if (_param) { |
| | | Api.getCloudConfig(_param).then(res => { |
| | | if (!res.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 5 |
| | | }) |
| | | } else { |
| | | _this.setState({appViewList: _appViewList}) |
| | | } |
| | | }) |
| | | } |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | try { |
| | | let pageParam = JSON.parse(window.decodeURIComponent(window.atob(item.menus_rolelist))) |
| | | item.nodes = pageParam |
| | | if (pageParam.type === 'navbar') { |
| | | if (pageParam.login) { |
| | | item.nodes = '' |
| | | } else if (pageParam.type === 'navbar') { |
| | | item.type = 'navbar' |
| | | } |
| | | } catch { |
| | | } catch (e) { |
| | | item.nodes = '' |
| | | } |
| | | } |
| | |
| | | this.setState({ visible: true, targetKeys: [] }) |
| | | } |
| | | |
| | | jumpApp = (item) => { |
| | | const { app } = this.state |
| | | |
| | | let route = 'mobdesign' |
| | | if (app.typename === 'pc') { |
| | | route = 'pcdesign' |
| | | } |
| | | |
| | | window.open(window.location.href.replace(/#.+/ig, `#/${route}/${window.btoa(window.encodeURIComponent(JSON.stringify({...app, MenuID: item.MenuID, type: 'app'})))}`)) |
| | | } |
| | | |
| | | render () { |
| | | const { app, loading, columns, menulist, trees, searchkey } = this.state |
| | | let _menulist = menulist |
| | |
| | | </div> |
| | | <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-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 |