|
|
@@ -2,13 +2,15 @@ import React, { useMemo, useCallback } from 'react'
|
|
|
import styles from './index.module.scss'
|
|
|
import { useSelector } from 'react-redux'
|
|
|
import { RootState } from '@/store'
|
|
|
-import { E2_APIgetList } from '@/store/action/Eculture/E2story'
|
|
|
+import { E2_APIgetList, E2_APIdel } from '@/store/action/Eculture/E2story'
|
|
|
+import { MessageFu } from '@/utils/message'
|
|
|
import TableList from '@/pages/Zother/TableList'
|
|
|
import { baseFormData } from '@/pages/Zother/data'
|
|
|
import MyPopconfirm from '@/components/MyPopconfirm'
|
|
|
import { storyTableC } from '@/utils/tableData'
|
|
|
import { Button } from 'antd'
|
|
|
import history from '@/utils/history'
|
|
|
+import { useDispatch } from 'react-redux'
|
|
|
|
|
|
const E2topSearch = [
|
|
|
{
|
|
|
@@ -35,9 +37,25 @@ const dataExport = () => {
|
|
|
}
|
|
|
|
|
|
function D1register() {
|
|
|
+ const dispatch = useDispatch()
|
|
|
// 从仓库拿数据
|
|
|
const tableInfo = useSelector((state: RootState) => state.E2story.tableInfo)
|
|
|
|
|
|
+ const getListFu = useCallback(() => {
|
|
|
+ dispatch(E2_APIgetList(D1baseFormData))
|
|
|
+ }, [dispatch])
|
|
|
+
|
|
|
+ const delFu = useCallback(
|
|
|
+ async (id: string) => {
|
|
|
+ const res = await E2_APIdel(id)
|
|
|
+ if (res.code === 0) {
|
|
|
+ MessageFu.success('删除成功')
|
|
|
+ getListFu()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ [getListFu]
|
|
|
+ )
|
|
|
+
|
|
|
// 故事管理定制右侧内容
|
|
|
const storyTableListToprr = ({
|
|
|
clickSearch,
|
|
|
@@ -79,12 +97,12 @@ function D1register() {
|
|
|
<Button size='small' type='text' onClick={() => tableBtnFu(item.id, '2')}>
|
|
|
编辑
|
|
|
</Button>
|
|
|
- <MyPopconfirm txtK='删除' onConfirm={() => console.log('del')} />
|
|
|
+ <MyPopconfirm txtK='删除' onConfirm={() => delFu(item.id)} />
|
|
|
</>
|
|
|
)
|
|
|
}
|
|
|
]
|
|
|
- }, [tableBtnFu])
|
|
|
+ }, [delFu, tableBtnFu])
|
|
|
|
|
|
return (
|
|
|
<div className={styles.E2story}>
|