king
2021-09-14 051eb785a36ec3b6cd3b4305fdb65f6940415e9b
src/views/rolemanage/index.jsx
@@ -48,7 +48,8 @@
    targetKeys: [],
    trees: null,
    expandedKeys: [],
    searchkey: ''
    searchkey: '',
    appViewList: []
  }
  oriTrees = null
@@ -59,6 +60,7 @@
    this.setState({app: param}, () => {
      this.getTreeList()
      this.getMenuList()
      this.getAppViewList()
    })
  }
@@ -69,6 +71,25 @@
    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) => {
@@ -318,7 +339,7 @@
  }
  deleteMenu = (record) => {
    const { app } = this.state
    const { app, appViewList } = this.state
    const _this = this
    let param = {
@@ -333,6 +354,26 @@
      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() {
@@ -345,6 +386,20 @@
                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,