Commit a0a492ca authored by XieZhiXiong's avatar XieZhiXiong

refactor

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