按钮级别的新版本,多级别的组织架构
loulijun2021
2023-08-10 92d98d931ef4199c06fb220d2b85a5b5e5e7701c
src/views/basicSettings/roleList.vue
@@ -319,7 +319,7 @@
    // 获取菜单权限对应的按钮
    async getRolePermissionSearchRoleMenuButton(rolecode) {
      const { data: res } = await RolePermissionSearchRoleMenuButton({ rolecode, type: this.activeName })
      this.allButtonData = JSON.parse(res[0].jsondate)
      this.allButtonData = res.length > 0 ? JSON.parse(res[0].jsondate) : []
    },
    // 获取菜单权限
    async getRolePermissionSearchRoleMenu(rolecode) {
@@ -589,21 +589,35 @@
    // 角色名称删除
    roleDeleteClick(self, node, data) {
      // console.log(self, node, data)
      const D = {
        rolecode: data.code,
        rolename: data.name,
        type: this.activeName
      }
      RoleDeleteSava(D).then(res => {
        if (res.code === '200') {
          this.$notify.success('角色删除成功!')
      this.$confirm('是否确认删除?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        const D = {
          rolecode: data.code,
          rolename: data.name,
          type: this.activeName
        }
        this.getRolePermissionSearchRole()
        RoleDeleteSava(D).then(res => {
          if (res.code === '200') {
            this.$notify.success('角色删除成功!')
          }
          this.getRolePermissionSearchRole()
        })
      }).catch(() => {
        this.$notify.info('已取消删除')
      })
    },
    // 角色名称保存   采用防抖形式
    roleSave: throttle(function(val) {
      val.isEdit = false
      if (val.name.trim().length === 0) {
        this.getRolePermissionSearchRole()
        return this.$notify.info('无效保存!')
      }
      const data = {
        rolecode: val.code,
        rolename: val.name,