Merge pull request 'feat(system): 角色管理表格行增加编辑入口(名称、备注可改,角色标识锁定)' (#2) from weicw-dshsa/tuanwei-admin:agent/role-edit-button-ba5a05896d2c into master
Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
:width="460"
|
||||
:visible="visible"
|
||||
:confirm-loading="loading"
|
||||
:title="isUpdate ? '修改角色' : '添加角色'"
|
||||
:title="isUpdate ? '编辑角色' : '添加角色'"
|
||||
:body-style="{ paddingBottom: '8px' }"
|
||||
@update:visible="updateVisible"
|
||||
@ok="save"
|
||||
@@ -26,10 +26,17 @@
|
||||
v-model:value="form.roleName"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="角色标识" name="roleCode">
|
||||
<a-form-item
|
||||
label="角色标识"
|
||||
name="roleCode"
|
||||
:extra="
|
||||
isUpdate ? '角色标识参与审批流程判断,创建后不可修改' : undefined
|
||||
"
|
||||
>
|
||||
<a-input
|
||||
allow-clear
|
||||
:maxlength="180"
|
||||
:disabled="isUpdate"
|
||||
placeholder="请输入角色标识"
|
||||
v-model:value="form.roleCode"
|
||||
/>
|
||||
@@ -119,7 +126,15 @@
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
const saveOrUpdate = isUpdate.value ? updateRole : addRole;
|
||||
saveOrUpdate(form)
|
||||
// 角色标识参与审批流程判断,修改时只提交可编辑的字段
|
||||
const data: Role = isUpdate.value
|
||||
? {
|
||||
roleId: form.roleId,
|
||||
roleName: form.roleName,
|
||||
comments: form.comments
|
||||
}
|
||||
: { ...form };
|
||||
saveOrUpdate(data)
|
||||
.then((msg) => {
|
||||
loading.value = false;
|
||||
message.success(msg);
|
||||
|
||||
@@ -37,13 +37,11 @@
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<template v-if="canEdit(record)">
|
||||
<a @click="openEdit(record)">修改</a>
|
||||
<a-divider type="vertical" />
|
||||
</template>
|
||||
<a @click="openAuth(record)">分配权限</a>
|
||||
<a @click="openEdit(record)">编辑</a>
|
||||
<a-divider type="vertical" />
|
||||
<template v-if="canEdit(record)">
|
||||
<a @click="openAuth(record)">分配权限</a>
|
||||
<template v-if="canRemove(record)">
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm
|
||||
placement="topRight"
|
||||
title="确定要删除此角色吗?"
|
||||
@@ -132,7 +130,7 @@ const columns = ref<ColumnItem[]>([
|
||||
}
|
||||
]);
|
||||
|
||||
const canEdit = (record: Role) => {
|
||||
const canRemove = (record: Role) => {
|
||||
// return ['student'].includes(record?.roleCode)
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user