对接登录

This commit is contained in:
1147680382@qq.com
2025-05-20 17:58:31 +08:00
parent 4bd7c4de67
commit cd90af7c05
4 changed files with 47 additions and 11 deletions
+29 -6
View File
@@ -9,7 +9,11 @@
<el-button type="primary" @click="handleAdd">添加组别</el-button>
</div>
</template>
<el-table :data="groupList" style="width: 100%" @row-click="handleGroupSelect">
<el-table
:data="groupList"
style="width: 100%"
@row-click="handleGroupSelect"
>
<el-table-column prop="groupId" label="组别ID" width="180" />
<el-table-column prop="groupName" label="组别名称" />
<el-table-column prop="createTime" label="创建时间">
@@ -22,7 +26,10 @@
<el-button type="primary" link @click.stop="handleEdit(scope.row)"
>编辑</el-button
>
<el-button type="danger" link @click.stop="handleDelete(scope.row)"
<el-button
type="danger"
link
@click.stop="handleDelete(scope.row)"
>删除</el-button
>
</template>
@@ -67,7 +74,10 @@
</el-table-column>
<el-table-column label="操作" width="100">
<template #default="scope">
<el-button type="danger" link @click="handleRemoveUser(scope.row)"
<el-button
type="danger"
link
@click="handleRemoveUser(scope.row)"
>移除</el-button
>
</template>
@@ -97,7 +107,10 @@
<el-option label="综合部" :value="2" />
<el-option label="财务部" :value="3" />
</el-select>
<el-button type="primary" link @click="handleAddUser(scope.row)"
<el-button
type="primary"
link
@click="handleAddUser(scope.row)"
>添加</el-button
>
</template>
@@ -118,7 +131,10 @@
>
<el-form :model="groupForm" label-width="80px">
<el-form-item label="组别名称" required>
<el-input v-model="groupForm.groupName" placeholder="请输入组别名称" />
<el-input
v-model="groupForm.groupName"
placeholder="请输入组别名称"
/>
</el-form-item>
</el-form>
<template #footer>
@@ -167,6 +183,9 @@ const fetchGroupList = async () => {
const res = await getGroupList();
if (res.errcode === 0) {
groupList.value = res.result;
if (groupList.value && groupList.value.length) {
handleGroupSelect(groupList.value[0]);
}
}
} catch (error) {
ElMessage.error("获取组别列表失败");
@@ -229,7 +248,11 @@ const handleAddUser = async (user) => {
// 修改成员角色
const handleRoleChange = async (user, role) => {
try {
const res = await updateGroupUserRole(currentGroup.value.groupId, user.userid, role);
const res = await updateGroupUserRole(
currentGroup.value.groupId,
user.userid,
role
);
if (res.errcode === 0) {
ElMessage.success("修改成功");
}