diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 28457079d5a0c7d09d07af3f94f1dedef6a4aae5..9c4c97e1ad91a23e84b499ffdae0eac65a9cb579 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -7,11 +7,6 @@ name: ant design pro
trigger:
- master
-resources:
- repositories:
- - repository: self
- fetchDepth: 1
-
jobs:
- job: lintAndBuild
@@ -19,11 +14,15 @@ jobs:
vmImage: 'Ubuntu-16.04'
steps:
+ - checkout: self
+ clean: false
- script: yarn install
displayName: install
- script: npm run lint
displayName: lint
- script: npm run build
+ env:
+ PROGRESS: none
displayName: build
- job: test
@@ -38,6 +37,8 @@ jobs:
- script: yarn install
displayName: install
- script: npm run test:all
+ env:
+ PROGRESS: none
displayName: test
- job: Windows
@@ -52,6 +53,8 @@ jobs:
- script: npm run lint
displayName: lint
- script: npm run build
+ env:
+ PROGRESS: none
displayName: build
- job: MacOS
@@ -65,5 +68,7 @@ jobs:
displayName: install
- script: npm run lint
displayName: lint
- - script: npm run build
+ - script: npm run
+ env:
+ PROGRESS: none
displayName: build
diff --git a/config/router.config.js b/config/router.config.js
index 656027d2371af19355c63eb2e989c8cefe306ffe..733d90138c97215a22f07e262cfffefb85382f64 100644
--- a/config/router.config.js
+++ b/config/router.config.js
@@ -147,6 +147,12 @@ export default [
name: 'basic',
component: './Profile/BasicProfile',
},
+ {
+ path: '/profile/basic/:id',
+ name: 'basic',
+ hideInMenu: true,
+ component: './Profile/BasicProfile',
+ },
{
path: '/profile/advanced',
name: 'advanced',
diff --git a/mock/profile.js b/mock/profile.js
index 03aecc56c01c33f8bd76a7131831e5754b4905b3..228d686f3800126e33d911fb1c48184871293803 100644
--- a/mock/profile.js
+++ b/mock/profile.js
@@ -1,3 +1,5 @@
+import mockjs from 'mockjs';
+
const basicGoods = [
{
id: '1234561',
@@ -140,19 +142,36 @@ const advancedOperation3 = [
memo: '-',
},
];
-
-const getProfileBasicData = {
- basicGoods,
- basicProgress,
-};
-
const getProfileAdvancedData = {
advancedOperation1,
advancedOperation2,
advancedOperation3,
};
+const { Random } = mockjs;
+
export default {
'GET /api/profile/advanced': getProfileAdvancedData,
- 'GET /api/profile/basic': getProfileBasicData,
+ 'GET /api/profile/basic': (req, res) => {
+ const { id } = req.query;
+ const application = {
+ id,
+ status: '已取货',
+ orderNo: Random.id(),
+ childOrderNo: Random.id(),
+ };
+ const userInfo = {
+ name: Random.cname(),
+ tel: '18100000000',
+ delivery: '菜鸟物流',
+ addr: '浙江省杭州市西湖区万塘路18号',
+ remark: '备注',
+ };
+ res.json({
+ userInfo,
+ application,
+ basicGoods,
+ basicProgress,
+ });
+ },
};
diff --git a/src/pages/List/TableList.js b/src/pages/List/TableList.js
index 131d61aaa53af56f84b707d8cc78417843720307..1230c5099ebb51389b5675e01177e061a4744d87 100644
--- a/src/pages/List/TableList.js
+++ b/src/pages/List/TableList.js
@@ -1,6 +1,7 @@
import React, { PureComponent, Fragment } from 'react';
import { connect } from 'dva';
import moment from 'moment';
+import router from 'umi/router';
import {
Row,
Col,
@@ -292,6 +293,7 @@ class TableList extends PureComponent {
{
title: '规则名称',
dataIndex: 'name',
+ render: text => this.previewItem(text)}>{text},
},
{
title: '描述',
@@ -381,6 +383,10 @@ class TableList extends PureComponent {
});
};
+ previewItem = id => {
+ router.push(`/profile/basic/${id}`);
+ };
+
handleFormReset = () => {
const { form, dispatch } = this.props;
form.resetFields();
diff --git a/src/pages/Profile/BasicProfile.js b/src/pages/Profile/BasicProfile.js
index bd0b7c99fa54d7dff75efe62f87a06b9c440d626..c339dba103dc1ef2323a4afe24663d8977474a4c 100644
--- a/src/pages/Profile/BasicProfile.js
+++ b/src/pages/Profile/BasicProfile.js
@@ -47,15 +47,18 @@ const progressColumns = [
}))
class BasicProfile extends Component {
componentDidMount() {
- const { dispatch } = this.props;
+ const { dispatch, match } = this.props;
+ const { params } = match;
+
dispatch({
type: 'profile/fetchBasic',
+ payload: params.id || '1000000000',
});
}
render() {
- const { profile, loading } = this.props;
- const { basicGoods, basicProgress } = profile;
+ const { profile = {}, loading } = this.props;
+ const { basicGoods = [], basicProgress = [], userInfo = {}, application = {} } = profile;
let goodsData = [];
if (basicGoods.length) {
let num = 0;
@@ -142,21 +145,21 @@ class BasicProfile extends Component {
},
];
return (
-
+
- 1000000000
- 已取货
- 1234123421
- 3214321432
+ {application.id}
+ {application.status}
+ {application.orderNo}
+ {application.childOrderNo}
- 付小小
- 18100000000
- 菜鸟仓储
- 浙江省杭州市西湖区万塘路18号
- 无
+ {userInfo.name}
+ {userInfo.tel}
+ {userInfo.delivery}
+ {userInfo.addr}
+ {userInfo.remark}
退货商品
diff --git a/src/pages/Profile/models/profile.js b/src/pages/Profile/models/profile.js
index de651b8afde813a230777c8af4d78dfecbfd86d7..3b9a290c56b6f7d03a93325cab129d3a00aae2a9 100644
--- a/src/pages/Profile/models/profile.js
+++ b/src/pages/Profile/models/profile.js
@@ -11,8 +11,8 @@ export default {
},
effects: {
- *fetchBasic(_, { call, put }) {
- const response = yield call(queryBasicProfile);
+ *fetchBasic({ payload }, { call, put }) {
+ const response = yield call(queryBasicProfile, payload);
yield put({
type: 'show',
payload: response,
diff --git a/src/services/api.js b/src/services/api.js
index f79cefffb2981a3879608e66eb0a27cea1dd9f58..6e789bcc9a14ca47fa08c711aec60742e4bd2353 100644
--- a/src/services/api.js
+++ b/src/services/api.js
@@ -58,8 +58,8 @@ export async function queryTags() {
return request('/api/tags');
}
-export async function queryBasicProfile() {
- return request('/api/profile/basic');
+export async function queryBasicProfile(id) {
+ return request(`/api/profile/basic?id=${id}`);
}
export async function queryAdvancedProfile() {