import React from 'react'; import { Modal, Button } from 'antd'; import './index.less'; import Page from '@src/containers/Page'; import Block from '@src/components/Block'; import FilterLayout from '@src/layouts/FilterLayout'; import ActionLayout from '@src/layouts/ActionLayout'; import TableLayout from '@src/layouts/TableLayout'; import { getMap, formatDate } from '@src/services/Tools'; import { asyncSMessage, asyncDelConfirm } from '@src/services/AsyncTools'; import { FeedbackStatus, FeedbackModule } from '../../../../Constant'; import { User } from '../../../stores/user'; const FeedbackStatusMap = getMap(FeedbackStatus, 'value', 'label'); const FeedbackModuleMap = getMap(FeedbackModule, 'value', 'label'); export default class extends Page { init() { this.actionList = [{ key: 'handle', type: 'danger', name: '批量处理', needSelect: 1, }, { key: 'ignore', type: 'danger', name: '批量忽略', needSelect: 1, }]; this.filterForm = [{ key: 'module', type: 'select', allowClear: true, name: '类型', select: FeedbackModule, placeholder: '请选择', }, { key: 'status', type: 'select', allowClear: true, name: '处理状态', number: true, select: FeedbackStatus, }, { key: 'title', type: 'input', name: '材料名称', allowClear: true, placeholder: '输入名称搜索', }]; this.columns = [ { title: '类型', dataIndex: 'module', render: (text) => { return FeedbackModuleMap[text]; }, }, { title: '提交时间', dataIndex: 'createTime', render: (text) => { return text ? formatDate(text) : '-'; }, }, { title: '提交人', dataIndex: 'user.nickname', }, { title: '材料名称', dataIndex: 'title', }, { title: '处理状态', dataIndex: 'status', render: (text) => { return FeedbackStatusMap[text] || text; }, }, { title: '操作', dataIndex: 'handler', render: (text, record) => { return
{( { this.detailAction(record); }}>查看 )}
; }, }, ]; } initData() { User.listFeedbackError(this.state.search).then(result => { result.list = result.list.map(row => { row.position = row.position.split(','); return row; }); this.setTableData(result.list, result.total); }); } detailAction(row) { this.setState({ detail: row }); } handleDetail() { const { detail } = this.state; asyncDelConfirm('处理确认', '是否处理选中记录?', () => { return User.editFeedbackError({ id: detail.id, status: 1 }).then(() => { asyncSMessage('操作成功!'); this.setState({ detail: null }); this.refresh(); }); }); } ignoreDetail() { const { detail } = this.state; asyncDelConfirm('忽略确认', '是否忽略选中记录?', () => { return User.editFeedbackError({ id: detail.id, status: 2 }).then(() => { asyncSMessage('操作成功!'); this.setState({ detail: null }); this.refresh(); }); }); } handleAction() { const { selectedKeys } = this.state; asyncDelConfirm('处理确认', '是否处理选中记录?', () => { return Promise.all(selectedKeys.map(row => User.editFeedbackError({ id: row, status: 1 }))).then(() => { asyncSMessage('操作成功!'); this.refresh(); }); }); } ignoreAction() { const { selectedKeys } = this.state; asyncDelConfirm('忽略确认', '是否忽略选中记录?', () => { return Promise.all(selectedKeys.map(row => User.editFeedbackError({ id: row, status: 2 }))).then(() => { asyncSMessage('操作成功!'); this.refresh(); }); }); } renderView() { return { this.search(data); }} /> this.onAction(key)} /> this.tableChange(pagination, filters, sorter)} onSelect={(keys, rows) => this.tableSelect(keys, rows)} selectedKeys={this.state.selectedKeys} /> {this.state.detail && { this.setState({ detail: null }); }}>

类型:{FeedbackModuleMap[this.state.detail.module]}

材料名称:{this.state.detail.title}

{this.state.detail.position.length > 1 &&

错误位置:{this.state.detail.position[0]}页,{this.state.detail.position[1]}行

}

错误内容:{this.state.detail.originContent}

应修改为:{this.state.detail.content}

{!this.state.detail.status &&

}
}
; } }