fix: 角色管理调整

This commit is contained in:
TsMask
2023-09-05 17:11:45 +08:00
parent 1ab5c4f3c6
commit 520d1ffcf9
4 changed files with 51 additions and 61 deletions

View File

@@ -90,22 +90,22 @@ let tableState: TabeStateType = reactive({
let tableColumns: ColumnsType = [
{
title: '用户编号',
dataIndex: 'userId',
dataIndex: 'id',
align: 'center',
},
{
title: '登录账号',
dataIndex: 'userName',
dataIndex: 'accountId',
align: 'center',
},
{
title: '用户昵称',
dataIndex: 'nickName',
title: '用户',
dataIndex: 'name',
align: 'center',
},
{
title: '手机号码',
dataIndex: 'phonenumber',
dataIndex: 'phone',
align: 'center',
},
{
@@ -124,13 +124,13 @@ let tableColumns: ColumnsType = [
dataIndex: 'createTime',
align: 'center',
customRender(opt) {
if (+opt.value <= 0) return '';
return parseDateToStr(+opt.value);
if (!opt.value) return '';
return parseDateToStr(opt.value);
},
},
{
title: '操作',
key: 'userId',
key: 'id',
align: 'center',
},
];
@@ -215,7 +215,7 @@ function fnModalOk(userIds: string[] | number[]) {
roleId: roleId,
}).then(res => {
hide();
if (res.code === 200) {
if (res.code === 1) {
modalState.visibleBySelectUser = false;
message.success({
content: `授权用户添加成功`,
@@ -247,7 +247,7 @@ function fnRecordDelete(userId: string | number) {
authUserChecked({ checked: false, userIds: userId, roleId: roleId }).then(
res => {
hide();
if (res.code === 200) {
if (res.code === 1) {
message.success({
content: `取消授权成功`,
duration: 3,
@@ -280,7 +280,7 @@ function fnGetList() {
if (tableState.loading) return;
tableState.loading = true;
authUserAllocatedList(toRaw(queryParams)).then(res => {
if (res.code === 200 && Array.isArray(res.rows)) {
if (res.code === 1 && Array.isArray(res.rows)) {
// 取消勾选
if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = [];
@@ -333,7 +333,7 @@ onMounted(() => {
></a-input>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :xs="24">
<!-- <a-col :lg="6" :md="12" :xs="24">
<a-form-item label="手机号码" name="phonenumber">
<a-input
v-model:value="queryParams.phonenumber"
@@ -342,7 +342,7 @@ onMounted(() => {
placeholder="请输入手机号码"
></a-input>
</a-form-item>
</a-col>
</a-col> -->
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="用户状态" name="status">
<a-select
@@ -452,7 +452,7 @@ onMounted(() => {
<!-- 表格列表 -->
<a-table
class="table"
row-key="userId"
row-key="id"
:columns="tableColumns"
:loading="tableState.loading"
:data-source="tableState.data"
@@ -469,13 +469,13 @@ onMounted(() => {
<template v-if="column.key === 'status'">
<DictTag :options="dict.sysNormalDisable" :value="record.status" />
</template>
<template v-if="column.key === 'userId'">
<template v-if="column.key === 'id'">
<a-space :size="8" align="center">
<a-tooltip>
<template #title>取消授权</template>
<a-button
type="link"
@click.prevent="fnRecordDelete(record.userId)"
@click.prevent="fnRecordDelete(record.id)"
v-perms:has="['system:role:remove']"
>
<template #icon><UserDeleteOutlined /></template>