king
2024-09-10 4d6b9f8a2d7b316633e43b489eae9ada949c07b5
src/views/rolemanage/index.jsx
@@ -3,7 +3,7 @@
import { Spin, notification, Button, Table, Modal, Tree, Input, Empty } from 'antd'
import moment from 'moment'
import md5 from 'md5'
import { ApiOutlined } from '@ant-design/icons'
import { ApiOutlined, SoundOutlined } from '@ant-design/icons'
import Api from '@/api'
import Utils from '@/utils/utils.js'
@@ -26,10 +26,10 @@
    columns: [
      {
        title: '菜单名称', dataIndex: 'MenuName', key: 'MenuName', align: 'center', render: (text, record) => {
          if (record.extra) {
          if (record.extra || this.state.appKeys.includes(record.MenuID)) {
            return <span style={{color: '#1890ff'}}>{text}</span>
          } else if (record.interfaces === 'true') {
            return <span><ApiOutlined style={{color: 'orange', marginRight: '5px'}} title="菜单中使用了外部接口" />{text}</span>
          } else if (record.interfaces === 'true' || record.msg === 'true') {
            return <span>{record.interfaces === 'true' ? <ApiOutlined style={{color: 'orange', marginRight: '5px'}} title="菜单中使用了外部接口" /> : null}{record.msg === 'true' ? <SoundOutlined style={{color: 'orange', marginRight: '5px'}} title="菜单中发送了消息" /> : null}{text}</span>
          }
          return text
        }
@@ -74,7 +74,8 @@
    trees: null,
    expandedKeys: [],
    searchkey: '',
    appViewList: []
    appViewList: [],
    appKeys: []
  }
  oriTrees = null
@@ -118,7 +119,9 @@
        })
        return
      }
      this.setState({appViewList: result.data || []})
      let data = result.data || []
      this.setState({appViewList: data, appKeys: data.map(item => item.keys_id)})
    })
  }
@@ -154,6 +157,7 @@
              let pageParam = JSON.parse(window.decodeURIComponent(window.atob(item.menus_rolelist)))
              item.nodes = pageParam
              item.interfaces = pageParam.interfaces || 'false'
              item.msg = pageParam.msg || 'false'
              
              if (pageParam.type) {
                item.type = pageParam.type
@@ -406,7 +410,7 @@
  deleteMenu = (record) => {
    const { app, appViewList } = this.state
    const _this = this
    const that = this
    let param = {
      func: 'sPC_MainMenu_Del',
@@ -447,7 +451,7 @@
                message: '操作成功!',
                duration: 3
              })
              _this.getMenuList(true)
              that.getMenuList(true)
              if (_param) {
                Api.getCloudConfig(_param).then(res => {
@@ -458,7 +462,7 @@
                      duration: 5
                    })
                  } else {
                    _this.setState({appViewList: _appViewList})
                    that.setState({appViewList: _appViewList})
                  }
                })
              }
@@ -679,12 +683,12 @@
  }
  initTree = () => {
    const _this = this
    const that = this
    confirm({
      content: '权限树会重新生成,确定执行吗?',
      onOk() {
        return new Promise(resolve => {
          _this.getMenuList(true, resolve)
          that.getMenuList(true, resolve)
        })
      },
      onCancel() {}
@@ -692,13 +696,13 @@
  }
  syncTree = () => {
    const _this = this
    const that = this
    confirm({
      content: '同步会根据菜单删除或新增节点,确定执行吗?',
      onOk() {
        return new Promise(resolve => {
          _this.syncMenutree(resolve)
          that.syncMenutree(resolve)
        })
      },
      onCancel() {}
@@ -707,7 +711,7 @@
  saveTree = () => {
    // const { trees } = this.state
    const _this = this
    const that = this
    // if (!trees || trees.length === 0) {
    //   notification.warning({
@@ -722,7 +726,7 @@
      content: '确定执行吗?',
      onOk() {
        return new Promise(resolve => {
          _this.execSave(resolve)
          that.execSave(resolve)
        })
      },
      onCancel() {}