diff --git a/src/index.less b/src/index.less index f9a134f..234b9d9 100644 --- a/src/index.less +++ b/src/index.less @@ -401,6 +401,11 @@ textarea.ant-input { } } +.ant-modal-confirm-btns > .ant-btn-default:hover { + color: #ff4d4f !important; + border-color: #ff4d4f; +} + .form-column { width: 1px; height: 14px; diff --git a/src/pages/course/index.tsx b/src/pages/course/index.tsx index 69768e7..f454e8d 100644 --- a/src/pages/course/index.tsx +++ b/src/pages/course/index.tsx @@ -147,6 +147,7 @@ export const CoursePage = () => { title: "操作确认", icon: , content: "确认删除此课程?", + centered: true, okText: "确认", okType: "danger", cancelText: "取消", diff --git a/src/pages/department/index.tsx b/src/pages/department/index.tsx index dc3ea5f..432b599 100644 --- a/src/pages/department/index.tsx +++ b/src/pages/department/index.tsx @@ -140,6 +140,7 @@ export const DepartmentPage: React.FC = () => { title: "操作确认", icon: , content: "确认删除此部门?", + centered: true, okText: "确认", okType: "danger", cancelText: "取消", diff --git a/src/pages/member/index.tsx b/src/pages/member/index.tsx index 7d719ef..7df61f8 100644 --- a/src/pages/member/index.tsx +++ b/src/pages/member/index.tsx @@ -1,23 +1,13 @@ import React, { useState, useEffect } from "react"; -import { - Row, - Col, - Typography, - Input, - Select, - Button, - Space, - Table, - Popconfirm, - message, -} from "antd"; +import { Typography, Input, Modal, Button, Space, Table, message } from "antd"; import type { ColumnsType } from "antd/es/table"; import styles from "./index.module.less"; -import { PlusOutlined, ReloadOutlined } from "@ant-design/icons"; +import { PlusOutlined, ExclamationCircleFilled } from "@ant-design/icons"; import { user } from "../../api/index"; import { dateFormat } from "../../utils/index"; import { Link, useNavigate } from "react-router-dom"; import { TreeDepartment, PerButton } from "../../compenents"; +const { confirm } = Modal; interface DataType { id: React.Key; @@ -44,6 +34,7 @@ export const MemberPage: React.FC = () => { const [email, setEmail] = useState(""); const [id_card, setIdCard] = useState(""); const [dep_ids, setDepIds] = useState([]); + const [selLabel, setLabel] = useState("全部部门"); const columns: ColumnsType = [ { @@ -79,7 +70,7 @@ export const MemberPage: React.FC = () => { key: "action", fixed: "right", width: 160, - render: (_, record) => ( + render: (_, record: any) => ( { disabled={null} />
- delUser(record.id)} - okText="确定" - cancelText="取消" - > - null} - disabled={null} - /> - + delUser(record.id)} + disabled={null} + />
), }, @@ -169,28 +152,71 @@ export const MemberPage: React.FC = () => { setSize(pageSize); }; - const delUser = (id: any) => { - user.destroyUser(id).then((res: any) => { - message.success("操作成功"); - setRefresh(!refresh); + const delUser = (id: number) => { + if (id === 0) { + return; + } + confirm({ + title: "操作确认", + icon: , + content: "确认删除此视频?", + centered: true, + okText: "确认", + okType: "danger", + cancelText: "取消", + onOk() { + user.destroyUser(id).then((res: any) => { + message.success("操作成功"); + setRefresh(!refresh); + }); + }, + onCancel() { + console.log("Cancel"); + }, }); }; const hasSelected = selectedRowKeys.length > 0; return ( <> - - -
- setDepIds(keys)} - /> -
- - -
-
+
+
+ { + setDepIds(keys); + setLabel(title); + }} + /> +
+
+
{selLabel}
+
+
+ + } + p="user-store" + onClick={() => null} + disabled={null} + /> + + + null} + disabled={null} + /> + +
+
昵称: {
-
-
-
- - } - p="user-store" - onClick={() => null} - disabled={null} - /> - - - null} - disabled={null} - /> - -
-
- -
-
-
- record.id} - /> - +
+
record.id} + /> - - + + ); }; diff --git a/src/pages/resource/images/index.tsx b/src/pages/resource/images/index.tsx index fdd47d4..6efcdc1 100644 --- a/src/pages/resource/images/index.tsx +++ b/src/pages/resource/images/index.tsx @@ -51,6 +51,7 @@ export const ResourceImagesPage = () => { title: "操作确认", icon: , content: "确认删除选中图片?", + centered: true, okText: "确认", okType: "danger", cancelText: "取消", diff --git a/src/pages/resource/resource-category/index.tsx b/src/pages/resource/resource-category/index.tsx index 08f29b3..b962815 100644 --- a/src/pages/resource/resource-category/index.tsx +++ b/src/pages/resource/resource-category/index.tsx @@ -143,6 +143,7 @@ export const ResourceCategoryPage: React.FC = () => { title: "操作确认", icon: , content: "确认删除此分类?", + centered: true, okText: "确认", okType: "danger", cancelText: "取消", diff --git a/src/pages/resource/videos/index.tsx b/src/pages/resource/videos/index.tsx index 9eabaca..c4cc525 100644 --- a/src/pages/resource/videos/index.tsx +++ b/src/pages/resource/videos/index.tsx @@ -101,6 +101,7 @@ export const ResourceVideosPage = () => { title: "操作确认", icon: , content: "确认删除此视频?", + centered: true, okText: "确认", okType: "danger", cancelText: "取消",