Commit 174d58ba authored by XieZhiXiong's avatar XieZhiXiong

chore: 修改跳转内页url前缀从RouteProps中获取

parent 3c287215
import React, { useEffect, useState } from 'react';
import { Tabs, Row, Col, Button } from 'antd';
import { getIntl, history } from 'umi';
import { getIntl, history, IRouteComponentProps } from 'umi';
import { observer, inject } from 'mobx-react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { getMemberCommentConsumerCountTradeHistoryPage, getMemberCommentConsumerCountTradeSummary, getMemberCommentConsumerReceiveTradeHistoryPage, getMemberCommentConsumerSendTradeHistoryPage } from '@/services/MemberV2Api';
......@@ -16,6 +16,7 @@ import styles from './index.less';
const { TabPane } = Tabs;
const intl = getIntl();
interface ReceivedSearch {
/**
* 评价星级(1-5)
......@@ -46,13 +47,15 @@ interface EstimateSumItems {
sum?: number,
};
interface AnalysisProps {
interface AnalysisProps extends IRouteComponentProps {
EvaluationStore?: IEvaluationModule;
};
const Analysis: React.FC<AnalysisProps> = ({
EvaluationStore,
match,
}) => {
const url = match.path.split('/').slice(0, -1).join('/');
const [evaluateSum, setEvaluateSum] = useState([]);
const [evaluatePie, setEvaluatePie] = useState([]);
......@@ -301,15 +304,15 @@ const Analysis: React.FC<AnalysisProps> = ({
}, []);
const handleJumpReceived = record => {
history.push(`/memberCenter/tranactionAbility/purchaserEvaluation/received/detail?id=${record.id}`);
history.push(`${url}/received/detail?id=${record.id}`);
};
const handleEditSent = record => {
history.push(`/memberCenter/tranactionAbility/purchaserEvaluation/sent/edit?id=${record.id}`);
history.push(`${url}/sent/edit?id=${record.id}`);
};
const handleJumpSent = record => {
history.push(`/memberCenter/tranactionAbility/purchaserEvaluation/sent/detail?id=${record.id}`);
history.push(`${url}/sent/detail?id=${record.id}`);
};
return (
......
import React, { useState, useRef } from 'react';
import { Card, Badge, Button } from 'antd';
import { getIntl, Link } from 'umi';
import { getIntl, Link, IRouteComponentProps } from 'umi';
import StandardTable from '@/components/StandardTable';
import { ColumnType } from 'antd/lib/table/interface';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
......@@ -15,10 +15,14 @@ import NiceForm from '@/components/NiceForm';
import StatusTag from '@/components/StatusTag';
import { listSearchSchema } from './schema';
import styles from './index.less';
const intl = getIntl();
const formActions = createFormActions();
const Unevaluated: React.FC = () => {
interface IProps extends IRouteComponentProps {}
const Unevaluated: React.FC<IProps> = (props) => {
const { match } = props;
const ref = useRef<any>({});
......@@ -29,7 +33,7 @@ const Unevaluated: React.FC = () => {
align: 'center',
render: (text, record) => (
<EyePreview
url={`/memberCenter/tranactionAbility/purchaserEvaluation/unevaluated/order?id=${record.id}`}
url={`${match.path}/order?id=${record.id}`}
>
{text}
</EyePreview>
......@@ -83,7 +87,7 @@ const Unevaluated: React.FC = () => {
align: 'center',
render: (text, record) => (
<>
<Link to={`/memberCenter/tranactionAbility/purchaserEvaluation/unevaluated/evaluate?id=${record.id}`}>
<Link to={`${match.path}/evaluate?id=${record.id}`}>
{!record.completeCommentStatus && (
<Button
type="link"
......
import React, { useEffect, useState, useRef } from 'react';
import { Tabs, Row, Col } from 'antd';
import { getIntl, history } from 'umi';
import { getIntl, history, IRouteComponentProps } from 'umi';
import { observer, inject } from 'mobx-react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { getMemberCommentSupplyCountTradeSummary, getMemberCommentSupplyCountTradeHistoryPage, getMemberCommentSupplyReceiveTradeHistoryPage, getMemberCommentSupplySendTradeHistoryPage, postMemberCommentSupplyReceiveTradeHistoryReply } from '@/services/MemberV2Api';
......@@ -48,13 +48,15 @@ interface EstimateSumItems {
sum?: number,
};
interface AnalysisProps {
interface AnalysisProps extends IRouteComponentProps {
EvaluationStore?: IEvaluationModule;
};
const Analysis: React.FC<AnalysisProps> = ({
EvaluationStore,
match,
}) => {
const url = match.path.split('/').slice(0, -1).join('/');
const [evaluateSum, setEvaluateSum] = useState([]);
const [evaluatePie, setEvaluatePie] = useState([]);
......@@ -323,15 +325,15 @@ const Analysis: React.FC<AnalysisProps> = ({
}, []);
const handleJumpReceived = record => {
history.push(`/memberCenter/tranactionAbility/supplierEvaluation/received/detail?id=${record.id}`);
history.push(`${url}/received/detail?id=${record.id}`);
};
const handleEditSent = record => {
history.push(`/memberCenter/tranactionAbility/supplierEvaluation/sent/edit?id=${record.id}`);
history.push(`${url}/sent/edit?id=${record.id}`);
};
const handleJumpSent = record => {
history.push(`/memberCenter/tranactionAbility/supplierEvaluation/sent/detail?id=${record.id}`);
history.push(`${url}/sent/detail?id=${record.id}`);
};
const handleVisibleExplainModal = (flag?: boolean) => {
......
import React, { useState, useRef } from 'react';
import { Card, Badge, Button } from 'antd';
import { getIntl, Link } from 'umi';
import { getIntl, IRouteComponentProps, Link } from 'umi';
import StandardTable from '@/components/StandardTable';
import { ColumnType } from 'antd/lib/table/interface';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
......@@ -18,7 +18,11 @@ import styles from './index.less';
const formActions = createFormActions();
const intl = getIntl();
const Unevaluated: React.FC = () => {
interface IProps extends IRouteComponentProps {}
const Unevaluated: React.FC<IProps> = (props) => {
const { match } = props;
const ref = useRef<any>({});
......@@ -29,7 +33,7 @@ const Unevaluated: React.FC = () => {
align: 'center',
render: (text, record) => (
<EyePreview
url={`/memberCenter/tranactionAbility/supplierEvaluation/unevaluated/order?id=${record.id}`}
url={`${match.path}/order?id=${record.id}`}
>
{text}
</EyePreview>
......@@ -83,7 +87,7 @@ const Unevaluated: React.FC = () => {
align: 'center',
render: (text, record) => (
<>
<Link to={`/memberCenter/tranactionAbility/supplierEvaluation/unevaluated/evaluate?id=${record.id}`}>
<Link to={`${match.path}/evaluate?id=${record.id}`}>
{!record.completeCommentStatus && (
<Button
type="link"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment