7abe2c4a by xiaomiao

api文件调整

1 parent b0724f10
import request from "@/utils/request";
import SERVER from "./config";
import { getParams } from './util'
import {
api,
getAction,
postAction,
deleteAction,
putAction
} from './manageApi'
/** 角色管理开始 */
// 获取角色列表 categoryId
// 获取角色列表 by categoryId
export const getRolesById = categoryId => {
const conditionGroup = {
conditions: [
......@@ -22,65 +19,11 @@ export const getRolesById = categoryId => {
],
queryRelation: 'AND'
}
const params = getParams(conditionGroup);
return getAction(api.roles, params)
}
// 人员列表
export const getUserRoles = (id) => {
return getAction(`${api.userRoles}/${id}/users`)
}
// 更新人员
export const updateUser = (id, data) => {
return putAction(`${api.userRoles}/${id}/users`, data)
}
// 根据条件获取用户
export const getUserList = (params) => {
return getAction(api.users, params)
}
// 导出用户列表
export const exportUserList = (params) => {
return getAction(api.users + '/export', params)
}
// 更新用户状态
export const updateStatus = (id, status) => {
return putAction(`${api.users}/${id}/${status}/status`)
}
// 更新用户解锁状态
export const updateLock = (id) => {
return putAction(`${api.users}/${id}/lock`)
}
// 重置用户密码
// export const resetPassword = id => {
// return putAction(`${api.users}/${id}/reset-password`)
// }
// 重置用户密码
export const resetPassword = (ids) => {
return putAction(`${api.users}/reset-passwords?ids=${ids}`)
}
// 删除人员
export const delUser = (id, data) => {
return deleteAction(`${api.userRoles}/${id}/users`, data)
}
// 获取父级菜单
export const getParentMenuListAction = (id) => {
let conditionGroup = {}
if (id && id !== '') {
conditionGroup = {
conditions: [
{
property: 'productId',
value: id,
operator: 'EQ'
}
],
queryRelation: 'AND'
}
}
const params = getParams(conditionGroup)
return getAction(api.menus, params)
return getAction(api.roles, params)
}
/** 角色管理结束 */
/** 授权管理开始 */
// 获取权限列表
export const getAuthorityListAction = (productId, subsystemCode) => {
const conditionGroup = {
......@@ -101,6 +44,7 @@ export const getAuthorityListAction = (productId, subsystemCode) => {
const params = getParams(conditionGroup)
return getAction(api.resourceCategory, params)
}
/**
* 获取角色的权限 id operationCodes resourceCategoryCode
* id 授权id
......@@ -121,6 +65,25 @@ export const getRoleAuthorityList = (
export const roleAuthority = (id, permissionDtos) => {
return putAction(`${api.rolePermissions}/${id}`, permissionDtos)
}
export const updateUserPassword = (data) => {
return putAction(`${api.users}/update-password`, data)
// 获取父级菜单
export const getParentMenuListAction = (id) => {
let conditionGroup = {}
if (id && id !== '') {
conditionGroup = {
conditions: [
{
property: 'productId',
value: id,
operator: 'EQ'
}
],
queryRelation: 'AND'
}
}
const params = getParams(conditionGroup)
return getAction(api.menus, params)
}
......
import {
api,
getAction,
deleteAction,
putAction
} from './manageApi'
export const updateUserPassword = (data) => {
return putAction(`${api.users}/update-password`, data)
}
// 根据条件获取用户
export const getUserList = (params) => {
return getAction(api.users, params)
}
// 重置用户密码
// export const resetPassword = id => {
// return putAction(`${api.users}/${id}/reset-password`)
// }
// 重置用户密码
export const resetPassword = (ids) => {
return putAction(`${api.users}/reset-passwords?ids=${ids}`)
}
// 人员列表
export const getUserRoles = (id) => {
return getAction(`${api.userRoles}/${id}/users`)
}
// 更新人员
export const updateUser = (id, data) => {
return putAction(`${api.userRoles}/${id}/users`, data)
}
......@@ -15,14 +15,14 @@ const mutations = {
};
const actions = {
getUserInfo({ commit }) {
getUserInfo ({ commit }) {
return new Promise(async (resolve) => {
let { result: res } = await getUserInfo();
commit("SET_USERINFO", res);
resolve(true);
});
},
resetState({ commit }) {
resetState ({ commit }) {
commit("RESET_USER");
},
};
......
......@@ -83,6 +83,9 @@
}
},
mounted () {
if (this.userInfo) {
this.getUserInfo(this.userInfo.id)
}
this.sexList = [
{
"name": "男",
......
......@@ -15,8 +15,8 @@
</div>
<div class="from-clues-content">
<div class="contentbox">
<base-set v-show="isshow" :user-info="userData" />
<password-edit v-show="!isshow" :user-info="userData" />
<base-set v-show="isshow" :userInfo="userData" />
<password-edit v-show="!isshow" :userInfo="userData" />
</div>
</div>
</div>
......@@ -33,20 +33,17 @@
data () {
return {
isshow: true,
userData: null
};
},
computed: {
departmentid () {
userData () {
return this.$store.state.user.userInfo;
},
},
watch: {},
created () { },
mounted () {
if (this.departmentid) {
this.userData = this.departmentid
}
},
methods: {
......
......@@ -37,7 +37,7 @@
</template>
<script>
import { updateUserPassword } from "@/api/quanxianmanagement";
import { updateUserPassword } from "@/api/personnelManage";
export default {
props: {
userInfo: {
......
......@@ -91,7 +91,7 @@
<script>
import Dialog from "@/components/Dialog/";
import { getParentMenuListAction } from '@/api/quanxianmanagement'
import { getParentMenuListAction } from '@/api/authorityManage'
import JsonEditor from '@/components/JsonEditors'
import IconList from '@/components/IconList'
import { validateCode } from '@/utils/validate';
......
......@@ -37,15 +37,9 @@
findParents,
removeTreeListItem,
} from "@/utils/operation";
import { getRolesById, getUserRoles, getAuthorityListAction } from "@/api/quanxianmanagement";
import { getRolesById, getAuthorityListAction } from "@/api/authorityManage";
import { getUserRoles } from "@/api/personnelManage";
import data from "./data";
// import {
// getOrganizationAuthorityList,
// getDepartmentAuthorityList,
// getRoleAuthorityList,
// getUserAuthorityList,
// getAuthorityListAction
// } from '@/api/authorityManage'
import sjsbTask from "@/api/sjsbTask.js";
import { api, getAction, deleteAction } from "@/api/manageApi";
import tableMixin from "@/mixins/tableMixin.js";
......
......@@ -45,7 +45,8 @@
<script>
import { api } from "@/api/manageApi";
import { updateUser, getRoleAuthorityList, roleAuthority } from "@/api/quanxianmanagement";
import { getRoleAuthorityList, roleAuthority } from "@/api/authorityManage";
import { updateUser } from "@/api/personnelManage";
export default {
name: "",
data () {
......
......@@ -42,7 +42,7 @@
import {
resetPassword,
getUserList,
} from "@/api/quanxianmanagement";
} from "@/api/personnelManage";
import { api, deleteAction } from '@/api/manageApi'
import data from "./data";
import { deleteDomStr } from '@/utils/proDomStr'
......