Skip to content

Commit

Permalink
fix: confirm确认框
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxd-yu committed Dec 8, 2021
1 parent 973e3aa commit 2e0de6e
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 27 deletions.
18 changes: 9 additions & 9 deletions yu-react/src/pages/log/EndpointLog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,16 @@ const LogEndpointTable: React.FC<LogEndpointData> = () => {
closable={false}
>
<ProDescriptions column={1} bordered>
<ProDescriptions.Item label="url">
<ProDescriptions.Item label="请求地址">
{logEndpointCurrentRow?.url}
</ProDescriptions.Item>
<ProDescriptions.Item label="httpStatus">
<ProDescriptions.Item label="响应状态">
{logEndpointCurrentRow?.httpStatus}
</ProDescriptions.Item>
<ProDescriptions.Item label="createTime">
<ProDescriptions.Item label="请求时间">
{logEndpointCurrentRow?.createTime}
</ProDescriptions.Item>
<ProDescriptions.Item label="time">
<ProDescriptions.Item label="请求耗时(ms)">
{logEndpointCurrentRow?.time}
</ProDescriptions.Item>
<ProDescriptions.Item label="用户名">
Expand All @@ -118,19 +118,19 @@ const LogEndpointTable: React.FC<LogEndpointData> = () => {
<ProDescriptions.Item label="IP">
{logEndpointCurrentRow?.ip}
</ProDescriptions.Item>
<ProDescriptions.Item label="method">
<ProDescriptions.Item label="请求方法">
{logEndpointCurrentRow?.method}
</ProDescriptions.Item>
<ProDescriptions.Item label="pattern">
<ProDescriptions.Item label="端点路径">
{logEndpointCurrentRow?.pattern}
</ProDescriptions.Item>
<ProDescriptions.Item label="handler">
<ProDescriptions.Item label="处理器">
{logEndpointCurrentRow?.handler}
</ProDescriptions.Item>
<ProDescriptions.Item label="JSON 代码块" valueType="jsonCode">
<ProDescriptions.Item label="请求体" valueType="jsonCode">
{logEndpointCurrentRow?.request}
</ProDescriptions.Item>
<ProDescriptions.Item label="JSON 代码块" valueType="jsonCode">
<ProDescriptions.Item label="响应体" valueType="jsonCode">
{logEndpointCurrentRow?.response}
</ProDescriptions.Item>
</ProDescriptions>
Expand Down
2 changes: 1 addition & 1 deletion yu-react/src/pages/system/Dept/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const DeptPage: React.FC = () => {
>
添加下级
</a>,
<Popconfirm key="popconfirm" title={`确认删除该记录吗?`} okText="是" cancelText="否"
<Popconfirm key="deleteConfirm" title={`确认删除该记录吗?`} okText="是" cancelText="否"
onConfirm={async () => {
await YuCrud.handleDelete(deleteDept, record.id);
if (deptActionRef.current) {
Expand Down
28 changes: 17 additions & 11 deletions yu-react/src/pages/system/Dict/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PlusOutlined } from '@ant-design/icons';
import { Button, Drawer } from 'antd';
import { Button, Drawer, Popconfirm } from 'antd';
import type { FormInstance } from 'antd';
import React, { useState, useRef } from 'react';
import { PageContainer } from '@ant-design/pro-layout';
Expand Down Expand Up @@ -79,15 +79,18 @@ const TableList: React.FC = () => {
>
字典配置
</a>,
<a key="subscribeAlert"
onClick={async () => {
<Popconfirm key="popconfirm" title={`确认删除该记录吗?`} okText="是" cancelText="否"
onConfirm={async () => {
await YuCrud.handleDelete(deleteDict, record.id)
if (actionRef.current) {
actionRef.current.reload();
}
}}>
删除
</a>,
}}
>
<a key="delete" href="#">
删除
</a>
</Popconfirm>
],
},
];
Expand Down Expand Up @@ -121,15 +124,18 @@ const TableList: React.FC = () => {
>
编辑
</a>,
<a key="deleteDictItem"
onClick={async () => {
<Popconfirm key="popconfirm" title={`确认删除该记录吗?`} okText="是" cancelText="否"
onConfirm={async () => {
await YuCrud.handleDelete(deleteDictItem, record.id);
if (itemActionRef.current) {
itemActionRef.current.reload();
}
}}>
删除
</a>,
}}
>
<a key="delete" href="#">
删除
</a>
</Popconfirm>
],
},
]
Expand Down
15 changes: 9 additions & 6 deletions yu-react/src/pages/system/Role/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FolderOutlined, PlusOutlined, ProfileOutlined, SecurityScanOutlined } from '@ant-design/icons';
import { Button, Tree } from 'antd';
import { Button, Popconfirm, Tree } from 'antd';
import type { FormInstance } from 'antd';
import React, { useState, useRef, useEffect } from 'react';
import { PageContainer } from '@ant-design/pro-layout';
Expand Down Expand Up @@ -116,15 +116,18 @@ const RoleTable: React.FC = () => {
>
权限分配
</a>,
<a key="subscribeAlert"
onClick={async () => {
<Popconfirm key="deleteConfirm" title={`确认删除该记录吗?`} okText="是" cancelText="否"
onConfirm={async () => {
await YuCrud.handleDelete(deleteRole, record.id)
if (actionRef.current) {
actionRef.current.reload();
}
}}>
删除
</a>,
}}
>
<a key="delete" href="#">
删除
</a>
</Popconfirm>
],
},
];
Expand Down

0 comments on commit 2e0de6e

Please sign in to comment.