| | |
| | | import { PageContainer, ProTable } from '@ant-design/pro-components'; |
| | | import { buildProTableDataSource, sendRequest, showDelConfirm } from '@/utils/antdUtils'; |
| | | import { Button, message, Space } from 'antd'; |
| | | import { Button, message, Space, Select } from 'antd'; |
| | | import { useRef, useState } from 'react'; |
| | | import { Access, history, useAccess } from 'umi'; |
| | | import { getList, updateStatus, deleteBanner } from './service' |
| | | import { getList, setStatus } from './service' |
| | | const Banner = () => { |
| | | |
| | | const actionRef = useRef(); |
| | |
| | | const columns = [ |
| | | { |
| | | title: '诉求标题', |
| | | dataIndex: 'bannerName' |
| | | dataIndex: 'title' |
| | | }, |
| | | { |
| | | title: '承办者', |
| | | dataIndex: 'bannerName1' |
| | | dataIndex: 'undertakerUser' |
| | | }, |
| | | { |
| | | title: '联系方式', |
| | | dataIndex: 'bannerName' |
| | | dataIndex: 'phone' |
| | | }, |
| | | { |
| | | title: '所在单位', |
| | | dataIndex: 'bannerName' |
| | | dataIndex: 'department', |
| | | renderFormItem: (_, { type, defaultRender, ...rest }, form) => { |
| | | return ( |
| | | <Select |
| | | key="searchSelect" |
| | | allowClear |
| | | placeholder="请选择" |
| | | filterOption={false} |
| | | options={[{ label: '市级', value: '1' }, { label: '区县', value: '2' }, { label: '街道', value: '3' }, { label: '社区', value: '4' }, { label: '党员', value: '5' }]} |
| | | > |
| | | </Select > |
| | | ) |
| | | }, |
| | | render: (_, record) => { |
| | | return record.department |
| | | } |
| | | }, |
| | | { |
| | | title: '所属职位', |
| | | dataIndex: 'bannerName' |
| | | dataIndex: 'position', |
| | | renderFormItem: (_, { type, defaultRender, ...rest }, form) => { |
| | | return ( |
| | | <Select |
| | | key="searchSelect" |
| | | allowClear |
| | | placeholder="请选择" |
| | | filterOption={false} |
| | | options={[{ label: '市级', value: '1' }, { label: '区县', value: '2' }, { label: '街道', value: '3' }, { label: '社区', value: '4' }, { label: '党员', value: '5' }]} |
| | | > |
| | | </Select > |
| | | ) |
| | | }, |
| | | render: (_, record) => { |
| | | return record.position |
| | | } |
| | | }, |
| | | { |
| | | title: '诉求应处理时间', |
| | | dataIndex: 'bannerName', |
| | | dataIndex: 'responseTime', |
| | | hideInSearch: true, |
| | | }, |
| | | { |
| | | title: '提示类型', |
| | | dataIndex: 'bannerName', |
| | | dataIndex: 'promptType', |
| | | hideInSearch: true, |
| | | valueEnum: { |
| | | '1': { text: '临期提醒' }, |
| | | '2': { text: '超时提醒' }, |
| | | } |
| | | }, |
| | | |
| | | { |
| | | title: '状态', |
| | | dataIndex: 'listingStatus', |
| | | dataIndex: 'readStatus', |
| | | hideInSearch: true, |
| | | valueEnum: { |
| | | '上架中': { text: '已读' }, |
| | | '已下架': { text: '未读' }, |
| | | '1': { text: '已读' }, |
| | | '0': { text: '未读' }, |
| | | } |
| | | }, |
| | | { |
| | |
| | | type="link" |
| | | onClick={() => { |
| | | showDelConfirm(async () => { |
| | | let status = await sendRequest(deleteBanner, record.id) |
| | | let status = await sendRequest(setStatus, record.id) |
| | | if (status) { |
| | | actionRef.current.reload(); |
| | | } |
| | | }, '确认标记已读所选信息吗?'); |
| | | }, '确认将所选信息标记为已读吗?'); |
| | | }} |
| | | > |
| | | 标记已读 |