|
@@ -12,7 +12,6 @@ import { SettingOutlined } from '@ant-design/icons'
|
|
|
import { Button, message, Table } from 'antd'
|
|
|
import { ColumnsType } from 'antd/lib/table'
|
|
|
import React, { useEffect, useState } from 'react'
|
|
|
-import { useActivate } from 'react-activation'
|
|
|
import { Link } from 'react-router-dom'
|
|
|
import { apiCreateSafe, apiSafeList, apiSaveRule } from './api'
|
|
|
import AddModel from './modal'
|
|
@@ -55,9 +54,6 @@ const SafeList:React.FC<{}> =() => {
|
|
|
useEffect(() => {
|
|
|
initData()
|
|
|
}, [])
|
|
|
- useActivate(() => {
|
|
|
- initData()
|
|
|
- })
|
|
|
const columns:ColumnsType<iSafeList> = [
|
|
|
{
|
|
|
title: '序号',
|
|
@@ -71,7 +67,7 @@ const SafeList:React.FC<{}> =() => {
|
|
|
dataIndex: 'code',
|
|
|
// eslint-disable-next-line react/display-name
|
|
|
render: (text: string, record) => {
|
|
|
- return <Link to={{ pathname: "/console/safe/content/detail", state: { id: tenderStore.bidsectionId, saveId: record.id } }}>{text}</Link>
|
|
|
+ return <Link to={{ pathname: "/console/safe/content/detail/info", state: { saveId: record.id } }}>{text}</Link>
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -130,17 +126,20 @@ const SafeList:React.FC<{}> =() => {
|
|
|
}
|
|
|
])
|
|
|
const [ total, setTotal ] = useState<number>(0)
|
|
|
- const initData = async (pageNo: number = 1, pageSize: number = consts.PAGE_SIZE) => {
|
|
|
- const { code = -1, data = [], total = 0 } = await apiSafeList(tenderStore.bidsectionId, pageNo, pageSize)
|
|
|
- if (code === consts.RET_CODE.SUCCESS) {
|
|
|
- setList(data)
|
|
|
- setTotal(total)
|
|
|
- }
|
|
|
+ const initData = (pageNo: number = 1, pageSize: number = consts.PAGE_SIZE) => {
|
|
|
+ apiSafeList(tenderStore.bid, pageNo, pageSize).then(({ code = -1, data = [], total = 0 }) => {
|
|
|
+ if (code === consts.RET_CODE.SUCCESS) {
|
|
|
+ setList(data)
|
|
|
+ setTotal(total)
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
const onRuleCreate = async (ruleValue: any) => {
|
|
|
setRuleModal({ ...ruleModal, loading: true })
|
|
|
- const { code = -1 } = await apiSaveRule({ bidsectionId: tenderStore.bidsectionId, type: 'safe_rule', rule: ruleValue })
|
|
|
+ const { code = -1 } = await apiSaveRule({ bidsectionId: tenderStore.bid, type: 'safe_rule', rule: ruleValue })
|
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
|
message.success("规则更改成功!")
|
|
|
initData()
|