Unverified Commit 33886c4a authored by gaoyan's avatar gaoyan Committed by GitHub

Modify userlist page,add userType column (#2038)

* fix BusException logic error if BusException.msg is empty, use I18n message * modify user list page, add usertype column, and disable passwordChange model
parent baa8cbd8
...@@ -65,6 +65,7 @@ export default { ...@@ -65,6 +65,7 @@ export default {
'user.username': 'User Name', 'user.username': 'User Name',
'user.jobnumber': 'Job Number', 'user.jobnumber': 'Job Number',
'user.phone': 'Phone Number', 'user.phone': 'Phone Number',
'user.type': 'User Type',
'user.nickname': 'Nick Name', 'user.nickname': 'Nick Name',
'user.create': 'Create User', 'user.create': 'Create User',
'user.update': 'Modify User', 'user.update': 'Modify User',
......
...@@ -62,6 +62,7 @@ export default { ...@@ -62,6 +62,7 @@ export default {
'user.username': '用户名', 'user.username': '用户名',
'user.jobnumber': '工号', 'user.jobnumber': '工号',
'user.phone': '手机号', 'user.phone': '手机号',
'user.type': '注册类型',
'user.nickname': '昵称', 'user.nickname': '昵称',
'user.create': '添加用户', 'user.create': '添加用户',
'user.update': '修改用户', 'user.update': '修改用户',
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
import React, {useEffect, useRef, useState} from "react"; import React, {useRef, useState} from "react";
import {LockTwoTone} from "@ant-design/icons"; import {LockTwoTone} from "@ant-design/icons";
import ProTable, {ActionType, ProColumns} from "@ant-design/pro-table"; import ProTable, {ActionType, ProColumns} from "@ant-design/pro-table";
import {Button} from "antd"; import {Button} from "antd";
...@@ -41,6 +41,7 @@ import {CreateBtn} from "@/components/CallBackButton/CreateBtn"; ...@@ -41,6 +41,7 @@ import {CreateBtn} from "@/components/CallBackButton/CreateBtn";
import PasswordModal from "@/pages/AuthCenter/User/components/PasswordModal"; import PasswordModal from "@/pages/AuthCenter/User/components/PasswordModal";
import RoleModalTransfer from "../RoleModalTransfer"; import RoleModalTransfer from "../RoleModalTransfer";
import UserModalForm from "@/pages/AuthCenter/User/components/UserModalForm"; import UserModalForm from "@/pages/AuthCenter/User/components/UserModalForm";
import {USER_TYPE_ENUM, UserType} from "@/pages/AuthCenter/User/components/constants";
const UserProTable = () => { const UserProTable = () => {
...@@ -172,6 +173,11 @@ const UserProTable = () => { ...@@ -172,6 +173,11 @@ const UserProTable = () => {
dataIndex: "mobile", dataIndex: "mobile",
hideInSearch: true, hideInSearch: true,
}, },
{
title: l("user.type"),
dataIndex: "userType",
valueEnum: USER_TYPE_ENUM()
},
{ {
title: l("global.table.isEnable"), title: l("global.table.isEnable"),
dataIndex: "enabled", dataIndex: "enabled",
...@@ -207,6 +213,8 @@ const UserProTable = () => { ...@@ -207,6 +213,8 @@ const UserProTable = () => {
<EditBtn key={`${record.id}_edit`} onClick={() => handleEditVisible(record)}/>, <EditBtn key={`${record.id}_edit`} onClick={() => handleEditVisible(record)}/>,
<AssignBtn key={`${record.id}_delete`} onClick={() => handleAssignRole(record)} <AssignBtn key={`${record.id}_delete`} onClick={() => handleAssignRole(record)}
title={l('user.assignRole')}/>, title={l('user.assignRole')}/>,
<>
{record.userType == UserType.LOCAL &&
<Button <Button
className={"options-button"} className={"options-button"}
key={`${record.id}_change`} key={`${record.id}_change`}
...@@ -215,7 +223,9 @@ const UserProTable = () => { ...@@ -215,7 +223,9 @@ const UserProTable = () => {
onClick={() => { onClick={() => {
handleChangePassword(record); handleChangePassword(record);
}} }}
/>, />
}
</>,
<> <>
{(access.canAdmin && record.username !== "admin") && {(access.canAdmin && record.username !== "admin") &&
<PopconfirmDeleteBtn key={`${record.id}_delete`} onClick={() => handleDeleteUser(record)} <PopconfirmDeleteBtn key={`${record.id}_delete`} onClick={() => handleDeleteUser(record)}
......
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export const UserType = {LOCAL:0, LDAP:1}
export const USER_TYPE_ENUM = () => {
return {0: "LOCAL", 1: "LDAP"}
}
...@@ -24,6 +24,7 @@ declare namespace UserBaseInfo { ...@@ -24,6 +24,7 @@ declare namespace UserBaseInfo {
password?: string; password?: string;
avatar?: string; avatar?: string;
worknum?: string; worknum?: string;
userType?: number;
mobile?: string; mobile?: string;
enabled: boolean; enabled: boolean;
isDelete: boolean; isDelete: boolean;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment