mirror of
https://github.com/PlayEdu/backend
synced 2025-07-22 06:02:18 +08:00
删除弹窗垂直居中
This commit is contained in:
parent
82a0b47a56
commit
b7560b76b2
@ -401,6 +401,11 @@ textarea.ant-input {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ant-modal-confirm-btns > .ant-btn-default:hover {
|
||||||
|
color: #ff4d4f !important;
|
||||||
|
border-color: #ff4d4f;
|
||||||
|
}
|
||||||
|
|
||||||
.form-column {
|
.form-column {
|
||||||
width: 1px;
|
width: 1px;
|
||||||
height: 14px;
|
height: 14px;
|
||||||
|
@ -147,6 +147,7 @@ export const CoursePage = () => {
|
|||||||
title: "操作确认",
|
title: "操作确认",
|
||||||
icon: <ExclamationCircleFilled />,
|
icon: <ExclamationCircleFilled />,
|
||||||
content: "确认删除此课程?",
|
content: "确认删除此课程?",
|
||||||
|
centered: true,
|
||||||
okText: "确认",
|
okText: "确认",
|
||||||
okType: "danger",
|
okType: "danger",
|
||||||
cancelText: "取消",
|
cancelText: "取消",
|
||||||
|
@ -140,6 +140,7 @@ export const DepartmentPage: React.FC = () => {
|
|||||||
title: "操作确认",
|
title: "操作确认",
|
||||||
icon: <ExclamationCircleFilled />,
|
icon: <ExclamationCircleFilled />,
|
||||||
content: "确认删除此部门?",
|
content: "确认删除此部门?",
|
||||||
|
centered: true,
|
||||||
okText: "确认",
|
okText: "确认",
|
||||||
okType: "danger",
|
okType: "danger",
|
||||||
cancelText: "取消",
|
cancelText: "取消",
|
||||||
|
@ -1,23 +1,13 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import {
|
import { Typography, Input, Modal, Button, Space, Table, message } from "antd";
|
||||||
Row,
|
|
||||||
Col,
|
|
||||||
Typography,
|
|
||||||
Input,
|
|
||||||
Select,
|
|
||||||
Button,
|
|
||||||
Space,
|
|
||||||
Table,
|
|
||||||
Popconfirm,
|
|
||||||
message,
|
|
||||||
} from "antd";
|
|
||||||
import type { ColumnsType } from "antd/es/table";
|
import type { ColumnsType } from "antd/es/table";
|
||||||
import styles from "./index.module.less";
|
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 { user } from "../../api/index";
|
||||||
import { dateFormat } from "../../utils/index";
|
import { dateFormat } from "../../utils/index";
|
||||||
import { Link, useNavigate } from "react-router-dom";
|
import { Link, useNavigate } from "react-router-dom";
|
||||||
import { TreeDepartment, PerButton } from "../../compenents";
|
import { TreeDepartment, PerButton } from "../../compenents";
|
||||||
|
const { confirm } = Modal;
|
||||||
|
|
||||||
interface DataType {
|
interface DataType {
|
||||||
id: React.Key;
|
id: React.Key;
|
||||||
@ -44,6 +34,7 @@ export const MemberPage: React.FC = () => {
|
|||||||
const [email, setEmail] = useState<string>("");
|
const [email, setEmail] = useState<string>("");
|
||||||
const [id_card, setIdCard] = useState<string>("");
|
const [id_card, setIdCard] = useState<string>("");
|
||||||
const [dep_ids, setDepIds] = useState<any>([]);
|
const [dep_ids, setDepIds] = useState<any>([]);
|
||||||
|
const [selLabel, setLabel] = useState<string>("全部部门");
|
||||||
|
|
||||||
const columns: ColumnsType<DataType> = [
|
const columns: ColumnsType<DataType> = [
|
||||||
{
|
{
|
||||||
@ -79,7 +70,7 @@ export const MemberPage: React.FC = () => {
|
|||||||
key: "action",
|
key: "action",
|
||||||
fixed: "right",
|
fixed: "right",
|
||||||
width: 160,
|
width: 160,
|
||||||
render: (_, record) => (
|
render: (_, record: any) => (
|
||||||
<Space size="small">
|
<Space size="small">
|
||||||
<PerButton
|
<PerButton
|
||||||
type="link"
|
type="link"
|
||||||
@ -91,23 +82,15 @@ export const MemberPage: React.FC = () => {
|
|||||||
disabled={null}
|
disabled={null}
|
||||||
/>
|
/>
|
||||||
<div className="form-column"></div>
|
<div className="form-column"></div>
|
||||||
<Popconfirm
|
|
||||||
title="警告"
|
|
||||||
description="即将删除此账号,确认操作?"
|
|
||||||
onConfirm={() => delUser(record.id)}
|
|
||||||
okText="确定"
|
|
||||||
cancelText="取消"
|
|
||||||
>
|
|
||||||
<PerButton
|
<PerButton
|
||||||
type="link"
|
type="link"
|
||||||
text="删除"
|
text="删除"
|
||||||
class="b-link c-red"
|
class="b-link c-red"
|
||||||
icon={null}
|
icon={null}
|
||||||
p="user-destroy"
|
p="user-destroy"
|
||||||
onClick={() => null}
|
onClick={() => delUser(record.id)}
|
||||||
disabled={null}
|
disabled={null}
|
||||||
/>
|
/>
|
||||||
</Popconfirm>
|
|
||||||
</Space>
|
</Space>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
@ -169,28 +152,71 @@ export const MemberPage: React.FC = () => {
|
|||||||
setSize(pageSize);
|
setSize(pageSize);
|
||||||
};
|
};
|
||||||
|
|
||||||
const delUser = (id: any) => {
|
const delUser = (id: number) => {
|
||||||
|
if (id === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
confirm({
|
||||||
|
title: "操作确认",
|
||||||
|
icon: <ExclamationCircleFilled />,
|
||||||
|
content: "确认删除此视频?",
|
||||||
|
centered: true,
|
||||||
|
okText: "确认",
|
||||||
|
okType: "danger",
|
||||||
|
cancelText: "取消",
|
||||||
|
onOk() {
|
||||||
user.destroyUser(id).then((res: any) => {
|
user.destroyUser(id).then((res: any) => {
|
||||||
message.success("操作成功");
|
message.success("操作成功");
|
||||||
setRefresh(!refresh);
|
setRefresh(!refresh);
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
onCancel() {
|
||||||
|
console.log("Cancel");
|
||||||
|
},
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const hasSelected = selectedRowKeys.length > 0;
|
const hasSelected = selectedRowKeys.length > 0;
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Row>
|
<div className="tree-main-body">
|
||||||
<Col span={4}>
|
<div className="left-box">
|
||||||
<div className="playedu-main-body" style={{ marginLeft: -24 }}>
|
|
||||||
<TreeDepartment
|
<TreeDepartment
|
||||||
text={"部门"}
|
text={"部门"}
|
||||||
onUpdate={(keys: any) => setDepIds(keys)}
|
onUpdate={(keys: any, title: any) => {
|
||||||
|
setDepIds(keys);
|
||||||
|
setLabel(title);
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Col>
|
<div className="right-box">
|
||||||
<Col span={20}>
|
<div className="playedu-main-title float-left mb-24">{selLabel}</div>
|
||||||
<div className="playedu-main-top mb-24">
|
<div className="float-left j-b-flex mb-24">
|
||||||
<div className="float-left d-flex">
|
<div className="d-flex">
|
||||||
|
<Link style={{ textDecoration: "none" }} to={`/member/create`}>
|
||||||
|
<PerButton
|
||||||
|
type="primary"
|
||||||
|
text="新建"
|
||||||
|
class="mr-16"
|
||||||
|
icon={<PlusOutlined />}
|
||||||
|
p="user-store"
|
||||||
|
onClick={() => null}
|
||||||
|
disabled={null}
|
||||||
|
/>
|
||||||
|
</Link>
|
||||||
|
<Link style={{ textDecoration: "none" }} to={`/member/import`}>
|
||||||
|
<PerButton
|
||||||
|
type="primary"
|
||||||
|
text="学员批量导入"
|
||||||
|
class="mr-16"
|
||||||
|
icon={null}
|
||||||
|
p="user-store"
|
||||||
|
onClick={() => null}
|
||||||
|
disabled={null}
|
||||||
|
/>
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
<div className="d-flex">
|
||||||
<div className="d-flex mr-24">
|
<div className="d-flex mr-24">
|
||||||
<Typography.Text>昵称:</Typography.Text>
|
<Typography.Text>昵称:</Typography.Text>
|
||||||
<Input
|
<Input
|
||||||
@ -240,43 +266,6 @@ export const MemberPage: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="playedu-main-body only">
|
|
||||||
<div className="float-left j-b-flex mb-24">
|
|
||||||
<div className="d-flex">
|
|
||||||
<Link style={{ textDecoration: "none" }} to={`/member/create`}>
|
|
||||||
<PerButton
|
|
||||||
type="primary"
|
|
||||||
text="新建"
|
|
||||||
class="mr-16"
|
|
||||||
icon={<PlusOutlined />}
|
|
||||||
p="user-store"
|
|
||||||
onClick={() => null}
|
|
||||||
disabled={null}
|
|
||||||
/>
|
|
||||||
</Link>
|
|
||||||
<Link style={{ textDecoration: "none" }} to={`/member/import`}>
|
|
||||||
<PerButton
|
|
||||||
type="primary"
|
|
||||||
text="学员批量导入"
|
|
||||||
class="mr-16"
|
|
||||||
icon={null}
|
|
||||||
p="user-store"
|
|
||||||
onClick={() => null}
|
|
||||||
disabled={null}
|
|
||||||
/>
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
<div className="d-flex">
|
|
||||||
<Button
|
|
||||||
type="link"
|
|
||||||
icon={<ReloadOutlined />}
|
|
||||||
style={{ color: "#333333" }}
|
|
||||||
onClick={() => {
|
|
||||||
setRefresh(!refresh);
|
|
||||||
}}
|
|
||||||
></Button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="float-left">
|
<div className="float-left">
|
||||||
<Table
|
<Table
|
||||||
rowSelection={rowSelection}
|
rowSelection={rowSelection}
|
||||||
@ -288,8 +277,7 @@ export const MemberPage: React.FC = () => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Col>
|
</div>
|
||||||
</Row>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -51,6 +51,7 @@ export const ResourceImagesPage = () => {
|
|||||||
title: "操作确认",
|
title: "操作确认",
|
||||||
icon: <ExclamationCircleFilled />,
|
icon: <ExclamationCircleFilled />,
|
||||||
content: "确认删除选中图片?",
|
content: "确认删除选中图片?",
|
||||||
|
centered: true,
|
||||||
okText: "确认",
|
okText: "确认",
|
||||||
okType: "danger",
|
okType: "danger",
|
||||||
cancelText: "取消",
|
cancelText: "取消",
|
||||||
|
@ -143,6 +143,7 @@ export const ResourceCategoryPage: React.FC = () => {
|
|||||||
title: "操作确认",
|
title: "操作确认",
|
||||||
icon: <ExclamationCircleFilled />,
|
icon: <ExclamationCircleFilled />,
|
||||||
content: "确认删除此分类?",
|
content: "确认删除此分类?",
|
||||||
|
centered: true,
|
||||||
okText: "确认",
|
okText: "确认",
|
||||||
okType: "danger",
|
okType: "danger",
|
||||||
cancelText: "取消",
|
cancelText: "取消",
|
||||||
|
@ -101,6 +101,7 @@ export const ResourceVideosPage = () => {
|
|||||||
title: "操作确认",
|
title: "操作确认",
|
||||||
icon: <ExclamationCircleFilled />,
|
icon: <ExclamationCircleFilled />,
|
||||||
content: "确认删除此视频?",
|
content: "确认删除此视频?",
|
||||||
|
centered: true,
|
||||||
okText: "确认",
|
okText: "确认",
|
||||||
okType: "danger",
|
okType: "danger",
|
||||||
cancelText: "取消",
|
cancelText: "取消",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user