| | |
| | | import { buildProTableDataSource, sendRequest, showDelConfirm } from '@/utils/antdUtils'; |
| | | import { buildProTableDataSource, sendRequest, showDelConfirm1 } from '@/utils/antdUtils'; |
| | | import { PageContainer, ProTable } from '@ant-design/pro-components'; |
| | | import { Button, Space } from 'antd'; |
| | | import { useRef, useState } from 'react'; |
| | | import { useAccess, Access } from 'umi'; |
| | | import AddAndEdit from './components/addAndEdit'; |
| | | import { addAndEdit, del, getList } from './service'; |
| | | import { add,Edit, del, getList } from './service'; |
| | | const Account = () => { |
| | | const actionRef = useRef(); |
| | | const addViewRef = useRef(); |
| | |
| | | const columns = [ |
| | | { |
| | | title: '问题类型名称', |
| | | dataIndex: 'categoryName', |
| | | dataIndex: 'name', |
| | | }, |
| | | { |
| | | title: '操作', |
| | |
| | | <Button |
| | | type="link" |
| | | onClick={() => { |
| | | showDelConfirm(async () => { |
| | | showDelConfirm1(async () => { |
| | | let status = await sendRequest(del, record.id); |
| | | if (status) { |
| | | actionRef.current.reload(); |
| | |
| | | visible={modalVisible} |
| | | onCancel={() => handleModalVisible(false)} |
| | | onSave={async (fileds) => { |
| | | const success = await sendRequest(addAndEdit, fileds); |
| | | const success = await sendRequest(add, fileds); |
| | | if (success) { |
| | | handleModalVisible(false); |
| | | actionRef.current.reload(); |
| | | } |
| | | }} |
| | | onUpdate={async (fileds) => { |
| | | const success = await sendRequest(addAndEdit, fileds); |
| | | const success = await sendRequest(Edit, fileds); |
| | | if (success) { |
| | | handleModalVisible(false); |
| | | actionRef.current.reload(); |