import request from '@/utils/request'

// export function list(queryParams) {
//   return request({
//     //url: '/youlai-admin.admin/v1/users',
//     url:'/user-boot/user/getUserList',
//     method: 'get',
//     params: queryParams
//   })
// }
export function list(data) {
    return request({
        url: '/user-boot/user/list',
        method: 'post',
        data: data
    })
}
export function exportUser(data) {
    return request({
        url: '/user-boot/user/exportUser',
        method: 'post',
        data: data
    })
}
export function exportUserExcel(data) {
    return request({
        url: '/user-boot/user/exportUserExcel?filePath=' + data,
        method: 'get',
        responseType: 'blob'
    })
}
export function getById(data) {
    return request({
        //url: '/youlai-admin.admin/v1/users',
        url: `/user-boot/user/getUserByUserIndex`,
        method: 'get',
        params: data
    })
}
export function deleteById(data) {
    return request({
        url: `/user-boot/user/deleteUser`,
        method: 'delete',
        params: data
    })
}
export function dept() {
    return request({
        //url: '/youlai-admin.admin/v1/users',
        url: `/user-boot/depts/getAllDepts`,
        method: 'get'
    })
}
export function detptree() {
    return request({
        url: '/user-boot/dept/deptTree',
        method: 'post'
    })
}

export function relolist() {
    return request({
        url: '/user-boot/role/getAllRoles',
        method: 'get'
    })
}
export function add(data) {
    return request({
        url: '/user-boot/user/add',
        method: 'post',
        data: data
    })
}
export function edit(data) {
    return request({
        url: '/user-boot/user/update',
        method: 'put',
        data: data
    })
}
export function update(id, data) {
    return request({
        // url: '/youlai-admin.admin/v1/users/' + id,
        method: 'put',
        data: data
    })
}

export function passwordConfirm(password) {
    return request({
        url: '/user-boot/user/passwordConfirm?password=' + password,
        method: 'get'
        //params: password
    })
}
export function updatePassword(data) {
    return request({
        url: '/user-boot/user/updatePassword',
        method: 'put',
        params: data
    })
}

export function deluser(data) {
    return request({
        url: '/user-boot/user/delete',
        method: 'delete',
        params: data
    })
}
export function listsh(data) {
    return request({
        url: '/user-boot/user/checkUserList',
        method: 'post',
        data: data
    })
}

export function checkUser(data) {
    return request({
        //url: '/youlai-admin.admin/v1/users',
        url: '/user-boot/user/check',
        method: 'put',
        data: data
    })
}
export function rolelist(data) {
    return request({
        url: '/user-boot/role/list',
        method: 'post',
        data: data
    })
}
export function addOverview(data) {
    return request({
        url: '/user-boot/homePage/add',
        method: 'post',
        data: data
    })
}
export function homepage() {
    return request({
        url: '/user-boot/homePage/getHomePages',
        method: 'get'
    })
}
export function componentlist() {
    return request({
        // url:'/user-boot/component/getComponents',
        url: '/user-boot/component/userComponentTree',
        method: 'get'
    })
}
export function componentlists() {
    return request({
        url: '/user-boot/component/componentTree',
        method: 'get'
    })
}
export function homepath(path) {
    return request({
        url: '/user-boot/homePage/getUsedHomePage',
        method: 'get',
        params: { path: path }
    })
}
export function gethomepage(data) {
    return request({
        url: '/user-boot/homePage/getHomePageById',
        method: 'get',
        params: data
    })
}
export function updatehomepage(homePageBO) {
    return request({
        url: '/user-boot/homePage/update',
        method: 'put',
        data: homePageBO
    })
}
export function detehomepage(data) {
    return request({
        url: '/user-boot/homePage/delete',
        method: 'delete',
        params: data
    })
}
export function updatedcomponent(data) {
    return request({
        url: '/user-boot/roleComponent/assignComponentsByRoleIndex',
        method: 'post',
        data: data
    })
}
export function getComponent(data) {
    return request({
        url: '/user-boot/roleComponent/selectRoleComponent?idList=' + data,
        method: 'post'
    })
}
export function addTheme(data) {
    return request({
        url: '/system-boot/theme/addTheme',
        method: 'post',
        data: data
    })
}
export function getAllThemes() {
    return request({
        url: '/system-boot/theme/getAllThemes',
        method: 'get'
        //data:data
    })
}
export function deleteTheme(id) {
    return request({
        url: '/system-boot/theme/deleteTheme?id=' + id,
        method: 'delete'
        // data:id
    })
}
export function activateTheme(id) {
    return request({
        url: '/system-boot/theme/activateTheme?id=' + id,
        method: 'put'
        // data:id
    })
}
export function updateTheme(data) {
    return request({
        url: '/system-boot/theme/updateTheme',
        method: 'put',
        data: data
    })
}
export function componentAdd(data) {
    return request({
        url: '/user-boot/component/add',
        method: 'post',
        data: data
    })
}
export function componentEdit(data) {
    return request({
        url: '/user-boot/component/update',
        method: 'put',
        data: data
    })
}
export function componentDel(data) {
    return request({
        url: '/user-boot/component/delete',
        method: 'delete',
        params: data
    })
}
export function selecRoleDetail(data) {
    return request({
        url: '/user-boot/role/selectRoleDetail',
        method: 'post',
        params: data
    })
}
export function activateUser(data) {
    return request({
        url: '/user-boot/user/activateUser',
        method: 'put',
        params: data
    })
}
// 密码规则修改
export function ruleUpdate(data) {
    return request({
        url: '/user-boot/password/ruleUpdate',
        method: 'post',
        data
    })
}
// 获取密码规则
export function getRule(data) {
    return request({
        url: '/user-boot/password/getRule',
        method: 'post',
        data
    })
}
// 解锁超级管理员
export function unlockRoot(data) {
    return request({
        url: '/user-boot/password/unlockRoot',
        method: 'post',
        data
    })
}
