@@ -8,6 +8,6 @@ | |||
</head> | |||
<body> | |||
<div id="root"></div> | |||
<script src="/umi.26ca4902.js"></script> | |||
<script src="/umi.1071646d.js"></script> | |||
</body> | |||
</html> |
@@ -8,7 +8,7 @@ import { | |||
ProFormSelect, | |||
ProForm, | |||
FormControlRender, | |||
ProFormDependency, | |||
ProFormDatePicker, | |||
ProFormDigit | |||
} from '@ant-design/pro-components'; | |||
import { ConfigProvider, Flex, Space, Modal, message, Image, Row, Col, Switch, Form, Typography } from 'antd'; | |||
@@ -41,7 +41,12 @@ const PagesMainAdvertisementPutinCreate: React.FC = ({ dispatch, dictModel, open | |||
theme={{ | |||
token: { | |||
colorPrimary: '#4FBE70', | |||
} | |||
} , components: { | |||
Segmented: { | |||
itemSelectedBg: '#19be6e', | |||
itemSelectedColor: '#ffffff' | |||
}, | |||
}, | |||
}} | |||
> | |||
<Modal | |||
@@ -72,7 +77,7 @@ const PagesMainAdvertisementPutinCreate: React.FC = ({ dispatch, dictModel, open | |||
ad_description: '', | |||
target_url: '', | |||
show_order: 0, | |||
valid_date: '', | |||
valid_date: null, | |||
hide_ad: 0, | |||
company_id: null, | |||
} | |||
@@ -159,7 +164,14 @@ const PagesMainAdvertisementPutinCreate: React.FC = ({ dispatch, dictModel, open | |||
min={1} | |||
rules={[{ required: true, message: '请输入此广告展示顺序,请输入优先级的数字' }]} | |||
/> | |||
<ProFormDatePicker | |||
name="valid_date" | |||
label="有效时间" | |||
fieldProps={{ | |||
format: 'YYYY-MM-DD' | |||
}} | |||
rules={[{ required: true, message: '请选择有效时间' }]} | |||
/> | |||
<ProFormSegmented | |||
name="hide_ad" | |||
label="是否隐藏广告" |
@@ -4,8 +4,8 @@ import type { ActionType, ProFormInstance } from '@ant-design/pro-components'; | |||
import { | |||
ProTable, TableDropdown,ProFormSelect | |||
} from '@ant-design/pro-components'; | |||
import { Button, Image, ConfigProvider, Select , Tag} from 'antd'; | |||
import { listArticle, listSection} from '@/apis/api'; | |||
import { Button, Image, ConfigProvider, Popconfirm, message , Tag} from 'antd'; | |||
import { listArticle, listSection, delArticle} from '@/apis/api'; | |||
import { Imageprefix } from '@/constants'; | |||
const selectfieldNames = { label: 'name', value: 'id', children: 'childs' }; | |||
@@ -131,9 +131,23 @@ const PagesMainInformationArticleTable: React.FC = ({ dispatch, openModel, getId | |||
setId(record.id) | |||
dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
}}>编辑</Button>, | |||
<Button key='2' type='link' onClick={() => { | |||
}}>删除</Button> | |||
<Popconfirm | |||
title="是否删除" | |||
onConfirm={(e) => { | |||
delArticle({ id: record.id }).then(res => { | |||
message.success('删除成功') | |||
actionRef.current.reload(); | |||
}) | |||
}} | |||
okText="删除" | |||
cancelText="取消" | |||
> | |||
<a | |||
key="delete" | |||
> | |||
删除 | |||
</a> | |||
</Popconfirm> | |||
], | |||
}, | |||
]} |
@@ -4,8 +4,8 @@ import type { ActionType, ProFormInstance } from '@ant-design/pro-components'; | |||
import { | |||
ProTable, TableDropdown | |||
} from '@ant-design/pro-components'; | |||
import { Button, Image, ConfigProvider, Select } from 'antd'; | |||
import { listSection} from '@/apis/api'; | |||
import { Button, Image, ConfigProvider, Popconfirm, message } from 'antd'; | |||
import { listSection, delSection } from '@/apis/api'; | |||
import { Imageprefix } from '@/constants'; | |||
const PagesMainInformationSectionTable: React.FC = ({ dispatch, openModel, getId }: any) => { | |||
@@ -82,9 +82,23 @@ const PagesMainInformationSectionTable: React.FC = ({ dispatch, openModel, getId | |||
setId(record) | |||
dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
}}>添加下级栏目</Button>, | |||
<Button key='2' type='link' onClick={() => { | |||
}}>删除</Button>, | |||
<Popconfirm | |||
title="是否删除" | |||
onConfirm={(e) => { | |||
delSection({ id: record.id }).then(res => { | |||
message.success('删除成功') | |||
actionRef.current.reload(); | |||
}) | |||
}} | |||
okText="删除" | |||
cancelText="取消" | |||
> | |||
<a | |||
key="delete" | |||
> | |||
删除 | |||
</a> | |||
</Popconfirm> | |||
], | |||
}, | |||
]} | |||
@@ -111,7 +125,7 @@ const PagesMainInformationSectionTable: React.FC = ({ dispatch, openModel, getId | |||
sort: 'id', | |||
sortby: 'desc', | |||
keyword: params.name, | |||
}).then(res => { | |||
setList(res.data.sections) | |||
setTotal(res.data.total) |