Commit a0a492ca authored by XieZhiXiong's avatar XieZhiXiong

refactor

parent c836d775
/* /*
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2020-12-18 10:42:26 * @Date: 2020-12-18 10:42:26
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-18 15:38:02 * @LastEditTime: 2020-12-23 14:50:54
* @Description: 退货查询相关路由 * @Description: 退货查询相关路由
*/ */
const returnManageRoute = { const returnManageRoute = {
path: '/returnManage', path: '/returnManage',
name: 'returnManage', name: 'returnManage',
icon: 'SmileOutlined', icon: 'SmileOutlined',
routes: [ routes: [
// 换货申请单查询 // 退货申请单查询
{ {
path: '/returnManage/query', path: '/returnManage/query',
name: 'query', name: 'query',
component: '@/pages/returnManage/query/index', component: '@/pages/returnManage/query/index',
}, },
// 换货申请单详情 // 退货申请单详情
{ {
path: '/returnManage/query/detail', path: '/returnManage/query/detail',
name: 'queryDetail', name: 'queryDetail',
component: '@/pages/returnManage/query/detail', component: '@/pages/returnManage/query/detail',
hideInMenu: true, hideInMenu: true,
hidePageHeader: true, hidePageHeader: true,
}, },
// 待退款 // 待退款
{ {
path: '/returnManage/returnPrReturn', path: '/returnManage/returnPrReturn',
name: 'returnPrReturn', name: 'returnPrReturn',
component: '@/pages/returnManage/returnPrReturn/index', component: '@/pages/returnManage/returnPrReturn/index',
}, },
// 待退款-详情 // 待退款-详情
{ {
path: '/returnManage/returnPrReturn/detail', path: '/returnManage/returnPrReturn/detail',
name: 'returnPrReturnDetail', name: 'returnPrReturnDetail',
component: '@/pages/returnManage/returnPrReturn/detail', component: '@/pages/returnManage/returnPrReturn/detail',
hideInMenu: true, hideInMenu: true,
hidePageHeader: true, hidePageHeader: true,
}, },
// 待退款-审核 // 待退款-审核
{ {
path: '/returnManage/returnPrReturn/verify', path: '/returnManage/returnPrReturn/verify',
name: 'prReturnVerify', name: 'prReturnVerify',
component: '@/pages/returnManage/returnPrReturn/verify', component: '@/pages/returnManage/returnPrReturn/verify',
hideInMenu: true, hideInMenu: true,
hidePageHeader: true, hidePageHeader: true,
}, },
], ],
}; };
export default returnManageRoute; export default returnManageRoute;
\ No newline at end of file
// 这里的env只有对本地起效, 线上构建不用 // 这里的env只有对本地起效, 线上构建不用
const path = require('path') const path = require('path')
module.exports = { module.exports = {
scm: { scm: {
SITE_ID: '1', SITE_ID: '1',
BACK_GATEWAY: 'http://lingxi-scm.wg.shushangyun.com', BACK_GATEWAY: 'http://lingxi-scm.wg.shushangyun.com',
USE_ROUTE_CONFIG: false, USE_ROUTE_CONFIG: false,
SOCKET_URL: 'ws://lingxi-scm.wg.shushangyun.com', SOCKET_URL: 'ws://lingxi-scm.wg.shushangyun.com',
ssh: JSON.stringify({ ssh: JSON.stringify({
user: "www", user: "www",
// Password optional, prompted if none given // Password optional, prompted if none given
password: "!@#project_$%^231(1)wwwuser3", password: "!@#project_$%^231(1)wwwuser3",
host: "119.23.219.65", host: "119.23.219.65",
port: 8122, port: 8122,
localRoot: path.resolve('./dist/'), localRoot: path.resolve('./dist/'),
remoteRoot: "/usr/local/nginx/html/lingxi/yanshi/api/scm/admin/dist/", remoteRoot: "/usr/local/nginx/html/lingxi/yanshi/api/scm/admin/dist/",
// include: ["*", "**/*"], // this would upload everything except dot files // include: ["*", "**/*"], // this would upload everything except dot files
include: ["*"], include: ["*"],
// e.g. exclude sourcemaps, and ALL files in node_modules (including dot files) // e.g. exclude sourcemaps, and ALL files in node_modules (including dot files)
// exclude: ["dist/**/*.map", "node_modules/**", "node_modules/**/.*", ".git/**"], // exclude: ["dist/**/*.map", "node_modules/**", "node_modules/**/.*", ".git/**"],
// delete ALL existing files at destination before uploading, if true // delete ALL existing files at destination before uploading, if true
deleteRemote: true, deleteRemote: true,
// Passive mode is forced (EPSV command is not sent) // Passive mode is forced (EPSV command is not sent)
forcePasv: true forcePasv: true
}) })
}, },
10: { 10: {
SITE_ID: '1', SITE_ID: '1',
BACK_GATEWAY: 'http://10.0.0.10:8100', BACK_GATEWAY: 'http://10.0.0.10:8100',
USE_ROUTE_CONFIG: true, USE_ROUTE_CONFIG: true,
SOCKET_URL: 'ws://10.0.0.10:8100', SOCKET_URL: 'ws://10.0.0.10:8100',
ssh: JSON.stringify({ ssh: JSON.stringify({
user: "root", user: "root",
// Password optional, prompted if none given // Password optional, prompted if none given
password: "123456", password: "123456",
host: "10.0.0.10", host: "10.0.0.10",
port: 22, port: 22,
localRoot: path.resolve('./dist/'), localRoot: path.resolve('./dist/'),
remoteRoot: "/home/www/lingxi/lingxi-business-system/dist/", remoteRoot: "/home/www/lingxi/lingxi-business-system/dist/",
// include: ["*", "**/*"], // this would upload everything except dot files // include: ["*", "**/*"], // this would upload everything except dot files
include: ["*"], include: ["*"],
// e.g. exclude sourcemaps, and ALL files in node_modules (including dot files) // e.g. exclude sourcemaps, and ALL files in node_modules (including dot files)
// exclude: ["dist/**/*.map", "node_modules/**", "node_modules/**/.*", ".git/**"], // exclude: ["dist/**/*.map", "node_modules/**", "node_modules/**/.*", ".git/**"],
// delete ALL existing files at destination before uploading, if true // delete ALL existing files at destination before uploading, if true
deleteRemote: true, deleteRemote: true,
// Passive mode is forced (EPSV command is not sent) // Passive mode is forced (EPSV command is not sent)
forcePasv: true forcePasv: true
}) })
}, },
25: { 25: {
SITE_ID: '1', SITE_ID: '1',
BACK_GATEWAY: 'http://10.0.0.25:8100', BACK_GATEWAY: 'http://10.0.0.25:8100',
USE_ROUTE_CONFIG: true, USE_ROUTE_CONFIG: true,
SOCKET_URL: 'ws://10.0.0.25:8100', SOCKET_URL: 'ws://10.0.0.25:8100',
ssh: JSON.stringify({ ssh: JSON.stringify({
user: "root", user: "root",
// Password optional, prompted if none given // Password optional, prompted if none given
password: "123456", password: "123456",
host: "10.0.0.25", host: "10.0.0.25",
port: 22, port: 22,
localRoot: path.resolve('./dist/'), localRoot: path.resolve('./dist/'),
remoteRoot: "/data/.jenkins/workspace/lingxi-business-system/dist/", remoteRoot: "/data/.jenkins/workspace/lingxi-business-system/dist/",
// include: ["*", "**/*"], // this would upload everything except dot files // include: ["*", "**/*"], // this would upload everything except dot files
include: ["*"], include: ["*"],
// e.g. exclude sourcemaps, and ALL files in node_modules (including dot files) // e.g. exclude sourcemaps, and ALL files in node_modules (including dot files)
// exclude: ["dist/**/*.map", "node_modules/**", "node_modules/**/.*", ".git/**"], // exclude: ["dist/**/*.map", "node_modules/**", "node_modules/**/.*", ".git/**"],
// delete ALL existing files at destination before uploading, if true // delete ALL existing files at destination before uploading, if true
deleteRemote: true, deleteRemote: true,
// Passive mode is forced (EPSV command is not sent) // Passive mode is forced (EPSV command is not sent)
forcePasv: true forcePasv: true
}) })
} }
} }
{ {
"name": "lingxi-business-system", "name": "lingxi-business-system",
"version": "1.0.4", "version": "1.0.4",
"private": true, "private": true,
"scripts": { "scripts": {
"upload:scm": "cross-env local=scm taskName=upload yarn scripts:build", "upload:scm": "cross-env local=scm taskName=upload yarn scripts:build",
"upload:10": "cross-env local=10 taskName=upload yarn scripts:build", "upload:10": "cross-env local=10 taskName=upload yarn scripts:build",
"upload:25": "cross-env local=25 taskName=upload yarn scripts:build", "upload:25": "cross-env local=25 taskName=upload yarn scripts:build",
"api": "god-ytt", "api": "god-ytt",
"start:analyze": "ANALYZE=1 umi dev", "start:analyze": "ANALYZE=1 umi dev",
"scripts:build": "node scripts/run", "scripts:build": "node scripts/run",
"scripts:build-yxc": "node scripts/run http://yxc-web-demo.shushangyun.com/api", "scripts:build-yxc": "node scripts/run http://yxc-web-demo.shushangyun.com/api",
"start": "yarn api && yarn scripts:build && umi dev", "start": "yarn api && yarn scripts:build && umi dev",
"start:dev": "umi dev", "start:dev": "umi dev",
"build": "yarn api && yarn scripts:build && yarn build:clean", "build": "yarn api && yarn scripts:build && yarn build:clean",
"build:yxc": "yarn api && yarn scripts:build-yxc && umi build", "build:yxc": "yarn api && yarn scripts:build-yxc && umi build",
"build:dev": "pm2 start scripts/devServer.js", "build:dev": "pm2 start scripts/devServer.js",
"build:analyze": "ANALYZE=1 umi build", "build:analyze": "ANALYZE=1 umi build",
"build:clean": "umi build", "build:clean": "umi build",
"build:scm": "cross-env SITE_ID=1 BACK_GATEWAY=http://lingxi-scm.wg.shushangyun.com SOCKET_URL=ws://lingxi-scm.wg.shushangyun.com yarn build", "build:scm": "cross-env SITE_ID=1 BACK_GATEWAY=http://lingxi-scm.wg.shushangyun.com SOCKET_URL=ws://lingxi-scm.wg.shushangyun.com yarn build",
"build:10": "cross-env SITE_ID=1 BACK_GATEWAY=http://10.0.0.10:8100 SOCKET_URL=ws://10.0.0.10:9400 yarn build", "build:10": "cross-env SITE_ID=1 BACK_GATEWAY=http://10.0.0.10:8100 SOCKET_URL=ws://10.0.0.10:9400 yarn build",
"build:25": "cross-env SITE_ID=352 BACK_GATEWAY=http://10.0.0.25:8100 SOCKET_URL=ws://10.0.0.25:9400 yarn build", "build:25": "cross-env SITE_ID=352 BACK_GATEWAY=http://10.0.0.25:8100 SOCKET_URL=ws://10.0.0.25:9400 yarn build",
"postinstall": "umi generate tmp", "postinstall": "umi generate tmp",
"prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'", "prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
"test": "umi-test", "test": "umi-test",
"test:coverage": "umi-test --coverage", "test:coverage": "umi-test --coverage",
"start:cross": "cross-env SITE_ID=352 SOCKET_URL=ws://10.0.0.25:9400 yarn start", "start:cross": "cross-env SITE_ID=352 SOCKET_URL=ws://10.0.0.25:9400 yarn start",
"start:cross-dev": "cross-env SITE_ID=352 SOCKET_URL=ws://10.0.0.25:9400 yarn start:dev", "start:cross-dev": "cross-env SITE_ID=352 SOCKET_URL=ws://10.0.0.25:9400 yarn start:dev",
"start:10": "cross-env SITE_ID=1 BACK_GATEWAY=http://10.0.0.10:8100 SOCKET_URL=ws://10.0.0.10:9400 yarn start", "start:10": "cross-env SITE_ID=1 BACK_GATEWAY=http://10.0.0.10:8100 SOCKET_URL=ws://10.0.0.10:9400 yarn start",
"start:scm": "cross-env BACK_GATEWAY=http://lingxi-scm.wg.shushangyun.com SOCKET_URL=ws://lingxi-scm.wg.shushangyun.com SITE_ID=1 yarn start" "start:scm": "cross-env BACK_GATEWAY=http://lingxi-scm.wg.shushangyun.com SOCKET_URL=ws://lingxi-scm.wg.shushangyun.com SITE_ID=1 yarn start"
}, },
"lint-staged": { "lint-staged": {
"*.{js,jsx,less,md,json}": [ "*.{js,jsx,less,md,json}": [
"prettier --write" "prettier --write"
], ],
"*.ts?(x)": [ "*.ts?(x)": [
"prettier --parser=typescript --write" "prettier --parser=typescript --write"
] ]
}, },
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@ant-design/icons": "^4.2.1", "@ant-design/icons": "^4.2.1",
"@ant-design/pro-layout": "^5.0.12", "@ant-design/pro-layout": "^5.0.12",
"@antv/data-set": "^0.11.5", "@antv/data-set": "^0.11.5",
"@formily/antd": "^1.2.11", "@formily/antd": "^1.2.11",
"@formily/antd-components": "^1.2.11", "@formily/antd-components": "^1.2.11",
"@types/crypto-js": "^4.0.1", "@types/crypto-js": "^4.0.1",
"@umijs/hooks": "^1.9.3", "@umijs/hooks": "^1.9.3",
"@umijs/preset-react": "1.x", "@umijs/preset-react": "1.x",
"@umijs/test": "^3.2.0", "@umijs/test": "^3.2.0",
"bizcharts": "^4.0.13", "bizcharts": "^4.0.13",
"braft-editor": "^2.3.9", "braft-editor": "^2.3.9",
"classnames": "^2.2.6", "classnames": "^2.2.6",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"crypto-js": "^4.0.0", "crypto-js": "^4.0.0",
"god": "^0.1.29", "god": "^0.1.29",
"lingxi-design": "^1.0.8", "lingxi-design": "^1.0.8",
"lingxi-design-ui": "^1.1.15", "lingxi-design-ui": "^1.1.15",
"lingxi-editor-core": "^1.0.6", "lingxi-editor-core": "^1.0.6",
"lingxi-web": "^1.0.6", "lingxi-web": "^1.0.6",
"lint-staged": "^10.0.7", "lint-staged": "^10.0.7",
"mobx": "^5.15.4", "mobx": "^5.15.4",
"mobx-react": "^6.2.2", "mobx-react": "^6.2.2",
"pinyin": "^2.9.1", "pinyin": "^2.9.1",
"prettier": "^1.19.1", "prettier": "^1.19.1",
"query-string": "^6.13.1", "query-string": "^6.13.1",
"react": "^16.12.0", "react": "^16.12.0",
"react-dom": "^16.12.0", "react-dom": "^16.12.0",
"styled-components": "^5.2.1", "styled-components": "^5.2.1",
"umi": "^3.2.0", "umi": "^3.2.0",
"yorkie": "^2.0.0" "yorkie": "^2.0.0"
}, },
"devDependencies": { "devDependencies": {
"axios": "^0.19.2", "axios": "^0.19.2",
"connect-history-api-fallback": "^1.6.0", "connect-history-api-fallback": "^1.6.0",
"cross-env": "^7.0.2", "cross-env": "^7.0.2",
"express": "^4.17.1", "express": "^4.17.1",
"god-upload-scp": "1.2.0", "god-upload-scp": "1.2.0",
"god-yapi2ts": "^1.9.0", "god-yapi2ts": "^1.9.0",
"gulp": "^4.0.2", "gulp": "^4.0.2",
"http-proxy-middleware": "^1.0.5", "http-proxy-middleware": "^1.0.5",
"json2ts": "^0.0.7", "json2ts": "^0.0.7",
"ora": "^4.0.4", "ora": "^4.0.4",
"typescript": "^3.9.7" "typescript": "^3.9.7"
} }
} }
/* /*
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2020-08-20 16:15:59 * @Date: 2020-08-20 16:15:59
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2020-09-10 14:07:35 * @LastEditTime: 2020-12-21 13:57:49
* @Description: 简单封装了分页事件的 Table * @Description: 简单封装了分页事件的 Table
*/ */
import React from 'react'; import React from 'react';
import { Table } from 'antd'; import { Table } from 'antd';
import classNames from 'classnames'; import classNames from 'classnames';
import { StandardTableProps } from './interface'; import { StandardTableProps } from './interface';
import styles from './index.less'; import styles from './index.less';
export default class NormalTable extends React.PureComponent<StandardTableProps> { export default class NormalTable extends React.PureComponent<StandardTableProps> {
state = { state = {
page: 1, page: 1,
size: 10, size: 10,
}; };
handlePaginationChange = (page: number, size: number) => { handlePaginationChange = (page: number, size: number) => {
const { pagination = {}, onPaginationChange } = this.props; const { pagination = {}, onPaginationChange } = this.props;
const { current, pageSize } = pagination; const { current, pageSize } = pagination;
// 内部自己维护 page、size, 单独控制当前页 或 当前页数 // 内部自己维护 page、size, 单独控制当前页 或 当前页数
if (!('current' in pagination)) { if (!('current' in pagination)) {
this.setState({ page: current }); this.setState({ page: current });
} }
if (!('pageSize' in pagination)) { if (!('pageSize' in pagination)) {
this.setState({ size: pageSize }); this.setState({ size: pageSize });
} }
if (onPaginationChange) { if (onPaginationChange) {
onPaginationChange(page, size); onPaginationChange(page, size);
} }
}; };
render() { render() {
const { page, size } = this.state; const { page, size } = this.state;
const { const {
columns, columns,
dataSource, dataSource,
rowKey = 'id', rowKey = 'id',
pagination = {}, pagination = {},
loading, loading,
className, className,
onPaginationChange, onPaginationChange,
...restProps ...restProps
} = this.props; } = this.props;
const newPagination: any = pagination ? { const newPagination: any = pagination ? {
current: page, current: page,
pageSize: size, pageSize: size,
showSizeChanger: true, showSizeChanger: true,
showQuickJumper: true, showQuickJumper: true,
onChange: this.handlePaginationChange, onChange: this.handlePaginationChange,
onShowSizeChange: this.handlePaginationChange, size: 'small',
size: 'small', showTotal: () => `共 ${pagination.total || 0} 条`,
showTotal: () => `共 ${pagination.total || 0} 条`, ...pagination,
...pagination, } : false;
} : false;
return (
return ( <div className={classNames(className)}>
<div className={classNames(className)}> <Table
<Table rowKey={rowKey}
rowKey={rowKey} columns={columns}
columns={columns} dataSource={dataSource}
dataSource={dataSource} loading={loading}
loading={loading} pagination={newPagination}
pagination={newPagination} {...restProps}
{...restProps} />
/> </div>
</div> )
) }
}
} }
\ No newline at end of file
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