新增角色
This commit is contained in:
		
							parent
							
								
									9aa1425cfe
								
							
						
					
					
						commit
						f29085ce45
					
				@ -47,3 +47,14 @@ export function getRoleDetail(id) {
 | 
			
		||||
    url: `/sys/role/${id}`
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/** *
 | 
			
		||||
 * 新增角色
 | 
			
		||||
 * ***/
 | 
			
		||||
export function addRole(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/sys/role',
 | 
			
		||||
    data,
 | 
			
		||||
    method: 'post'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -19,7 +19,7 @@
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { updateRole, getRoleDetail } from '@/api/setting'
 | 
			
		||||
import { updateRole, getRoleDetail, addRole } from '@/api/setting'
 | 
			
		||||
export default {
 | 
			
		||||
  components: {},
 | 
			
		||||
  props: {
 | 
			
		||||
@ -65,8 +65,7 @@ export default {
 | 
			
		||||
          await updateRole(this.roleForm)
 | 
			
		||||
        } else {
 | 
			
		||||
          // 新增场景
 | 
			
		||||
          // 接口要求拼接一个pid
 | 
			
		||||
          // await addDepartments({ ...this.formData, pid: this.treeNode.id })
 | 
			
		||||
          await addRole(this.roleForm)
 | 
			
		||||
        }
 | 
			
		||||
        // 更新数据
 | 
			
		||||
        this.$emit('editRoleOK')
 | 
			
		||||
 | 
			
		||||
@ -11,6 +11,7 @@
 | 
			
		||||
                icon="el-icon-plus"
 | 
			
		||||
                size="small"
 | 
			
		||||
                type="primary"
 | 
			
		||||
                @click="showDialog = true"
 | 
			
		||||
              >新增角色</el-button>
 | 
			
		||||
            </el-row>
 | 
			
		||||
            <!-- 表格 -->
 | 
			
		||||
@ -87,7 +88,6 @@ export default {
 | 
			
		||||
      },
 | 
			
		||||
      // 编辑弹窗
 | 
			
		||||
      showDialog: false
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  computed: {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user