修改删除方式
This commit is contained in:
@@ -83,20 +83,16 @@ export async function updateMembers(data) {
|
||||
* @param id 用户id
|
||||
*/
|
||||
export async function removeMembers(id) {
|
||||
const res = await request.delete('/sylive/members/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
return removeMembersBatch([id]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除用户
|
||||
* @param data 用户id集合
|
||||
* @param ids 用户id集合
|
||||
*/
|
||||
export async function removeMembersBatch(data) {
|
||||
export async function removeMembersBatch(ids) {
|
||||
const res = await request.delete('/sylive/members/batch', {
|
||||
data
|
||||
data: { ids }
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
|
||||
@@ -53,24 +53,20 @@ export async function updateDictionaryData(data) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除字典数据
|
||||
* @param id 字典数据id
|
||||
* 删除字典项
|
||||
* @param id 字典项id
|
||||
*/
|
||||
export async function removeDictionaryData(id) {
|
||||
const res = await request.delete('/system/dictionaryData/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
return removeDictionaryDataBatch([id]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除字典数据
|
||||
* @param data 字典数据id集合
|
||||
* 删除字典项
|
||||
* @param ids 字典项id集合
|
||||
*/
|
||||
export async function removeDictionaryDataBatch(data) {
|
||||
export async function removeDictionaryDataBatch(ids) {
|
||||
const res = await request.delete('/system/dictionaryData/batch', {
|
||||
data
|
||||
data: { ids }
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
|
||||
@@ -43,7 +43,17 @@ export async function updateDictionary(data) {
|
||||
* @param id 字典id
|
||||
*/
|
||||
export async function removeDictionary(id) {
|
||||
const res = await request.delete('/system/dictionary/' + id);
|
||||
return removeDictionaryBatch([id]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除菜单
|
||||
* @param ids 菜单id集合
|
||||
*/
|
||||
export async function removeDictionaryBatch(ids) {
|
||||
const res = await request.delete('/system/dictionary/batch', {
|
||||
data: { ids }
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,17 @@ export async function updateMenu(data) {
|
||||
* @param id 菜单id
|
||||
*/
|
||||
export async function removeMenu(id) {
|
||||
const res = await request.delete('/system/menu/' + id);
|
||||
return removeMenus([id]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除菜单
|
||||
* @param ids 菜单id集合
|
||||
*/
|
||||
export async function removeMenus(ids) {
|
||||
const res = await request.delete('/system/menu/batch', {
|
||||
data: { ids }
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
|
||||
@@ -57,20 +57,16 @@ export async function updateRole(data) {
|
||||
* @param id 角色id
|
||||
*/
|
||||
export async function removeRole(id) {
|
||||
const res = await request.delete('/system/role/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
return removeRoles([id]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除角色
|
||||
* @param ids 角色id集合
|
||||
*/
|
||||
export async function removeRoles(data) {
|
||||
export async function removeRoles(ids) {
|
||||
const res = await request.delete('/system/role/batch', {
|
||||
data
|
||||
data: { ids }
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
@@ -83,7 +79,9 @@ export async function removeRoles(data) {
|
||||
* @param roleId 角色id
|
||||
*/
|
||||
export async function listRoleMenus(roleId) {
|
||||
const res = await request.get('/system/roleMenu/' + roleId);
|
||||
const res = await request.get('/system/roleMenu', {
|
||||
params: { roleId }
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
@@ -93,10 +91,10 @@ export async function listRoleMenus(roleId) {
|
||||
/**
|
||||
* 修改角色菜单
|
||||
* @param roleId 角色id
|
||||
* @param data 菜单id集合
|
||||
* @param menuIds 菜单id集合
|
||||
*/
|
||||
export async function updateRoleMenus(roleId, data) {
|
||||
const res = await request.put('/system/roleMenu/' + roleId, data);
|
||||
export async function updateRoleMenus(roleId, menuIds) {
|
||||
const res = await request.put('/system/roleMenu', { roleId, menuIds });
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
|
||||
@@ -112,6 +112,12 @@
|
||||
organizationList: [],
|
||||
// 表格列配置
|
||||
columns: [
|
||||
{
|
||||
columnKey: 'selection',
|
||||
type: 'selection',
|
||||
width: 45,
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'userId',
|
||||
label: 'ID',
|
||||
@@ -145,7 +151,7 @@
|
||||
prop: 'organizationName',
|
||||
label: '机构',
|
||||
showOverflowTooltip: true,
|
||||
minWidth: 120
|
||||
minWidth: 130
|
||||
},
|
||||
{
|
||||
prop: 'roleName',
|
||||
@@ -159,7 +165,7 @@
|
||||
label: '创建时间',
|
||||
sortable: 'custom',
|
||||
showOverflowTooltip: true,
|
||||
minWidth: 120,
|
||||
minWidth: 100,
|
||||
formatter: (_row, _column, cellValue) => {
|
||||
return this.$util.toDateString(cellValue);
|
||||
}
|
||||
@@ -176,7 +182,7 @@
|
||||
{
|
||||
columnKey: 'action',
|
||||
label: '操作',
|
||||
width: 260,
|
||||
width: 250,
|
||||
align: 'center',
|
||||
resizable: false,
|
||||
slot: 'action',
|
||||
|
||||
Reference in New Issue
Block a user