|
@@ -1,5 +1,5 @@
|
|
|
import React, { useEffect, useState } from 'react';
|
|
|
-import { Space, Table, Button, Input, Select, DatePicker, Tabs, message } from 'antd';
|
|
|
+import { Space, Table, Button, Input, Select, DatePicker, Tabs, message, Typography } from 'antd';
|
|
|
import type { TableProps } from 'antd';
|
|
|
import dayjs, { Dayjs } from 'dayjs';
|
|
|
import styles from './index.module.css';
|
|
@@ -8,7 +8,7 @@ const { RangePicker } = DatePicker;
|
|
|
import { useAccountOptions } from '@src/views/publishContent/weGZH/hooks/useAccountOptions';
|
|
|
import { useGzhPlanList, GzhPlanType } from '@src/views/publishContent/weGZH/hooks/useGzhPlanList';
|
|
|
import http from '@src/http';
|
|
|
-import { saveGzhPlanApi } from '@src/http/api';
|
|
|
+import { deleteGzhPlanApi, saveGzhPlanApi } from '@src/http/api';
|
|
|
import PunlishPlanDetailModal from './components/PunlishPlanDetailModal';
|
|
|
|
|
|
const TableHeight = window.innerHeight - 380;
|
|
@@ -36,7 +36,7 @@ const WeGZHContent: React.FC = () => {
|
|
|
title: '公众号名称',
|
|
|
dataIndex: 'accountName',
|
|
|
key: 'accountName',
|
|
|
- width: 200,
|
|
|
+ width: 160,
|
|
|
},
|
|
|
{
|
|
|
title: '场景',
|
|
@@ -51,7 +51,7 @@ const WeGZHContent: React.FC = () => {
|
|
|
title: '视频数量',
|
|
|
dataIndex: 'videoCount',
|
|
|
key: 'videoCount',
|
|
|
- width: 120,
|
|
|
+ width: 100,
|
|
|
},
|
|
|
{
|
|
|
title: '视频标题',
|
|
@@ -60,7 +60,7 @@ const WeGZHContent: React.FC = () => {
|
|
|
ellipsis: true,
|
|
|
render: (_, record) => {
|
|
|
return record.videoList.map(video => {
|
|
|
- return <div className="text-gray-600 text-sm truncate" key={video.videoId}>{video.customTitle || video.title}</div>
|
|
|
+ return <Typography.Paragraph ellipsis={true} key={video.videoId}>{video.customTitle || video.title}</Typography.Paragraph>
|
|
|
})
|
|
|
}
|
|
|
},
|
|
@@ -85,16 +85,34 @@ const WeGZHContent: React.FC = () => {
|
|
|
{
|
|
|
title: '操作',
|
|
|
key: 'action',
|
|
|
- width: 200,
|
|
|
+ fixed: 'right',
|
|
|
render: (_, record) => (
|
|
|
<Space size="middle">
|
|
|
<Button type="link" onClick={() => editPlan(record)}>编辑</Button>
|
|
|
<Button type="link" onClick={() => editPlanDetail(record)}>详情</Button>
|
|
|
+ <Button type="link" onClick={() => deletePlan(record)}>删除</Button>
|
|
|
</Space>
|
|
|
),
|
|
|
},
|
|
|
];
|
|
|
|
|
|
+ const deletePlan = async (record: GzhPlanType) => {
|
|
|
+ const res = await http.post(deleteGzhPlanApi, {
|
|
|
+ id: record.id,
|
|
|
+ }).catch(err => {
|
|
|
+ message.error(err?.msg || '删除失败');
|
|
|
+ })
|
|
|
+ if (res?.code === 0) {
|
|
|
+ message.success('删除成功');
|
|
|
+ getGzhPlanList({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ message.error(res?.msg || '删除失败');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
const editPlan = (record: GzhPlanType) => {
|
|
|
setEditPlanData(record);
|
|
|
setActionType('edit');
|
|
@@ -179,6 +197,7 @@ const WeGZHContent: React.FC = () => {
|
|
|
style={{ width: 200 }}
|
|
|
value={videoTitle}
|
|
|
allowClear
|
|
|
+ onPressEnter={handleSearch}
|
|
|
onChange={e => setVideoTitle(e.target.value)}
|
|
|
/>
|
|
|
</div>
|