Browse Source

feat: 删除增加确定弹窗

jihuaqiang 1 week ago
parent
commit
6d25a9acba

+ 6 - 4
src/views/cooperationAccount/gzh/index.tsx

@@ -1,4 +1,4 @@
-import { Button, Table, Image, Modal, message, Select } from "antd";
+import { Button, Table, Image, Modal, message, Select, Popconfirm } from "antd";
 import type { TableProps } from 'antd';
 import { useState, useEffect, useRef } from "react";
 import { InfoCircleFilled, CheckCircleFilled } from "@ant-design/icons";
@@ -365,9 +365,11 @@ const Gzh: React.FC = () => {
     {
       key: 'action',
       render: (_, record) => (
-        <>
-          <Button type="link" onClick={() => modifyAccount(record)}>编辑</Button>
-          <Button type="link" danger onClick={() => deleteAccount(record)}>删除</Button>
+				<>
+					<Button type="link" onClick={() => modifyAccount(record)}>编辑</Button>
+					<Popconfirm title="确定删除该公众号吗?" okText="确定" cancelText="取消" onConfirm={() => deleteAccount(record)}>
+						<Button type="link">删除</Button>
+					</Popconfirm>
         </>
       ),
     }

+ 4 - 2
src/views/publishContent/weCom/index.tsx

@@ -1,5 +1,5 @@
 import React, { useEffect, useState } from 'react';
-import { Space, Table, Button, Input, Select, Tabs, message, Spin } from 'antd';
+import { Space, Table, Button, Input, Select, Tabs, message, Spin, Popconfirm } from 'antd';
 import type { TableProps } from 'antd';
 import styles from './index.module.css';
 import { WeComPlan, WeComPlanListResponse, WeComPlanType, WeVideoItem } from './type';
@@ -98,7 +98,9 @@ const WeGZHContent: React.FC = () => {
 					<Button type="link" onClick={() => showQrCodeModal(record.pageUrl)}>二维码</Button>
 					<Button type="link" onClick={() => copyToClipboard(record.pageUrl)}>复制链接</Button>
 					<Button type="link" onClick={() => showDetailModal(record)}>详情</Button>
-					<Button type="link" onClick={() => deletePlan(record)}>删除</Button>
+					<Popconfirm title="确定删除该内容吗?" okText="确定" cancelText="取消" onConfirm={() => deletePlan(record)}>
+						<Button type="link">删除</Button>
+					</Popconfirm>
 				</Space>
 			),
 		},

+ 5 - 2
src/views/publishContent/weGZH/index.tsx

@@ -1,5 +1,5 @@
 import React, { useEffect, useState } from 'react';
-import { Space, Table, Button, Input, Select, DatePicker, Tabs, message, Typography, Spin } from 'antd';
+import { Space, Table, Button, Input, Select, DatePicker, Tabs, message, Typography, Spin, Popconfirm } from 'antd';
 import type { TableProps } from 'antd';
 import dayjs, { Dayjs } from 'dayjs';
 import styles from './index.module.css';
@@ -102,7 +102,10 @@ const WeGZHContent: React.FC = () => {
 				<Space size="middle">
 					<Button type="link" onClick={() => editPlan(record)}>编辑</Button>
 					<Button type="link" onClick={() => editPlanDetail(record)}>详情</Button>
-					<Button type="link" onClick={() => deletePlan(record)}>删除</Button>
+					<Popconfirm title="确定删除该计划吗?" okText="确定" cancelText="取消" onConfirm={() => deletePlan(record)}>
+						<Button type="link">删除</Button>
+					</Popconfirm>
+					
 				</Space>
 			),
 		},