| </head> | </head> | ||||
| <body> | <body> | ||||
| <div id="root"></div> | <div id="root"></div> | ||||
| <script src="/umi.26ca4902.js"></script> | |||||
| <script src="/umi.1071646d.js"></script> | |||||
| </body> | </body> | ||||
| </html> | </html> |
| ProFormSelect, | ProFormSelect, | ||||
| ProForm, | ProForm, | ||||
| FormControlRender, | FormControlRender, | ||||
| ProFormDependency, | |||||
| ProFormDatePicker, | |||||
| ProFormDigit | ProFormDigit | ||||
| } from '@ant-design/pro-components'; | } from '@ant-design/pro-components'; | ||||
| import { ConfigProvider, Flex, Space, Modal, message, Image, Row, Col, Switch, Form, Typography } from 'antd'; | import { ConfigProvider, Flex, Space, Modal, message, Image, Row, Col, Switch, Form, Typography } from 'antd'; | ||||
| theme={{ | theme={{ | ||||
| token: { | token: { | ||||
| colorPrimary: '#4FBE70', | colorPrimary: '#4FBE70', | ||||
| } | |||||
| } , components: { | |||||
| Segmented: { | |||||
| itemSelectedBg: '#19be6e', | |||||
| itemSelectedColor: '#ffffff' | |||||
| }, | |||||
| }, | |||||
| }} | }} | ||||
| > | > | ||||
| <Modal | <Modal | ||||
| ad_description: '', | ad_description: '', | ||||
| target_url: '', | target_url: '', | ||||
| show_order: 0, | show_order: 0, | ||||
| valid_date: '', | |||||
| valid_date: null, | |||||
| hide_ad: 0, | hide_ad: 0, | ||||
| company_id: null, | company_id: null, | ||||
| } | } | ||||
| min={1} | min={1} | ||||
| rules={[{ required: true, message: '请输入此广告展示顺序,请输入优先级的数字' }]} | rules={[{ required: true, message: '请输入此广告展示顺序,请输入优先级的数字' }]} | ||||
| /> | /> | ||||
| <ProFormDatePicker | |||||
| name="valid_date" | |||||
| label="有效时间" | |||||
| fieldProps={{ | |||||
| format: 'YYYY-MM-DD' | |||||
| }} | |||||
| rules={[{ required: true, message: '请选择有效时间' }]} | |||||
| /> | |||||
| <ProFormSegmented | <ProFormSegmented | ||||
| name="hide_ad" | name="hide_ad" | ||||
| label="是否隐藏广告" | label="是否隐藏广告" |
| import { | import { | ||||
| ProTable, TableDropdown,ProFormSelect | ProTable, TableDropdown,ProFormSelect | ||||
| } from '@ant-design/pro-components'; | } 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'; | import { Imageprefix } from '@/constants'; | ||||
| const selectfieldNames = { label: 'name', value: 'id', children: 'childs' }; | const selectfieldNames = { label: 'name', value: 'id', children: 'childs' }; | ||||
| setId(record.id) | setId(record.id) | ||||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | dispatch({ type: 'openModel/getOpenModal', payload: true }) | ||||
| }}>编辑</Button>, | }}>编辑</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> | |||||
| ], | ], | ||||
| }, | }, | ||||
| ]} | ]} |
| import { | import { | ||||
| ProTable, TableDropdown | ProTable, TableDropdown | ||||
| } from '@ant-design/pro-components'; | } 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'; | import { Imageprefix } from '@/constants'; | ||||
| const PagesMainInformationSectionTable: React.FC = ({ dispatch, openModel, getId }: any) => { | const PagesMainInformationSectionTable: React.FC = ({ dispatch, openModel, getId }: any) => { | ||||
| setId(record) | setId(record) | ||||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | dispatch({ type: 'openModel/getOpenModal', payload: true }) | ||||
| }}>添加下级栏目</Button>, | }}>添加下级栏目</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> | |||||
| ], | ], | ||||
| }, | }, | ||||
| ]} | ]} | ||||
| sort: 'id', | sort: 'id', | ||||
| sortby: 'desc', | sortby: 'desc', | ||||
| keyword: params.name, | keyword: params.name, | ||||
| }).then(res => { | }).then(res => { | ||||
| setList(res.data.sections) | setList(res.data.sections) | ||||
| setTotal(res.data.total) | setTotal(res.data.total) |