Commit da4c606a authored by luoxiaodong's avatar luoxiaodong

提交页面备注

parent df7492db
...@@ -50,13 +50,15 @@ const plugins = [ ...@@ -50,13 +50,15 @@ const plugins = [
]; ];
export default { export default {
plugins, antd: {},
block: { dva: {
// 国内用户可以使用码云 hmr: true,
// defaultGitUrl: 'https://gitee.com/ant-design/pro-blocks',
defaultGitUrl: 'https://github.com/ant-design/pro-blocks',
}, },
hash: true, hash: true,
locale: {
default: 'zh-CN', //开启国际化配置,就必须要创建locales/zh-CN.ts 文件
baseNavigator: true,
},
targets: { targets: {
ie: 11, ie: 11,
}, },
...@@ -185,12 +187,11 @@ export default { ...@@ -185,12 +187,11 @@ export default {
ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION || '', // preview.pro.ant.design only do not use in your production ; preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。 ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION || '', // preview.pro.ant.design only do not use in your production ; preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。
}, },
ignoreMomentLocale: true, ignoreMomentLocale: true,
lessLoaderOptions: { lessLoader: {
javascriptEnabled: true, javascriptEnabled: true,
}, },
disableRedirectHoist: true, cssLoader: {
cssLoaderOptions: { modules: {
modules: true,
getLocalIdent: (context, _, localName) => { getLocalIdent: (context, _, localName) => {
if ( if (
context.resourcePath.includes('node_modules') || context.resourcePath.includes('node_modules') ||
...@@ -214,6 +215,7 @@ export default { ...@@ -214,6 +215,7 @@ export default {
return localName; return localName;
}, },
}, },
},
chainWebpack: webpackPlugin, chainWebpack: webpackPlugin,
/* /*
proxy: { proxy: {
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
"experimentalDecorators": true, "experimentalDecorators": true,
"baseUrl": ".", "baseUrl": ".",
"paths": { "paths": {
"@/*": ["./src/*"] "@/*": ["./src/*"],
"@@/*": ["./src/.uim/*"]
} }
} }
} }
This diff is collapsed.
...@@ -48,14 +48,15 @@ ...@@ -48,14 +48,15 @@
"not ie <= 10" "not ie <= 10"
], ],
"dependencies": { "dependencies": {
"@ant-design/compatible": "^1.0.0",
"@ant-design/icons": "^4.6.4",
"@ant-design/colors": "^3.1.0", "@ant-design/colors": "^3.1.0",
"@ant-design/pro-layout": "^4.10.0", "@ant-design/compatible": "^1.1.0",
"@ant-design/icons": "^4.7.0",
"@ant-design/pro-layout": "^4.11.4",
"@ant-design/pro-table": "^1.0.31", "@ant-design/pro-table": "^1.0.31",
"@antv/data-set": "^0.10.2", "@antv/data-set": "^0.10.2",
"antd": "^4.0.0", "antd": "^4.19.3",
"antd-virtual-select": "^1.1.2", "antd-virtual-select": "^1.1.2",
"babel-eslint": "^10.1.0",
"classnames": "^2.2.6", "classnames": "^2.2.6",
"date-fns": "^2.16.1", "date-fns": "^2.16.1",
"dva": "^2.4.1", "dva": "^2.4.1",
...@@ -65,17 +66,14 @@ ...@@ -65,17 +66,14 @@
"omit.js": "^1.0.2", "omit.js": "^1.0.2",
"path-to-regexp": "^3.1.0", "path-to-regexp": "^3.1.0",
"qs": "^6.9.0", "qs": "^6.9.0",
"react": "^16.9.0", "react": "^16.8.6",
"react-copy-to-clipboard": "^5.0.1", "react-copy-to-clipboard": "^5.0.1",
"react-dom": "^16.9.0", "react-dom": "^16.8.6",
"react-helmet": "^5.2.1", "react-helmet": "^5.2.1",
"react-sortablejs": "^6.0.0", "react-sortablejs": "^6.0.0",
"redux": "^4.0.1",
"slash2": "^2.0.0", "slash2": "^2.0.0",
"sortablejs": "^1.13.0", "sortablejs": "^1.13.0",
"umi": "^2.13.0", "umi": "^3.0.0",
"umi-plugin-pro-block": "^1.3.4",
"umi-plugin-react": "^1.10.1",
"umi-request": "^1.2.7", "umi-request": "^1.2.7",
"webpack-theme-color-replacer": "^1.2.15" "webpack-theme-color-replacer": "^1.2.15"
}, },
...@@ -91,6 +89,10 @@ ...@@ -91,6 +89,10 @@
"@types/react-dom": "^16.8.4", "@types/react-dom": "^16.8.4",
"@types/react-helmet": "^5.0.13", "@types/react-helmet": "^5.0.13",
"@umijs/fabric": "^1.2.0", "@umijs/fabric": "^1.2.0",
"@umijs/plugin-blocks": "^2.0.5",
"@umijs/preset-ant-design-pro": "^1.0.1",
"@umijs/preset-react": "^1.3.0",
"@umijs/preset-ui": "^2.0.9",
"chalk": "^2.4.2", "chalk": "^2.4.2",
"check-prettier": "^1.0.3", "check-prettier": "^1.0.3",
"cross-env": "^6.0.0", "cross-env": "^6.0.0",
...@@ -110,10 +112,7 @@ ...@@ -110,10 +112,7 @@
"node-fetch": "^2.6.0", "node-fetch": "^2.6.0",
"prettier": "^1.17.1", "prettier": "^1.17.1",
"pro-download": "1.0.1", "pro-download": "1.0.1",
"stylelint": "^10.1.0", "stylelint": "^10.1.0"
"umi-plugin-ga": "^1.1.3",
"umi-plugin-pro": "^1.0.2",
"umi-types": "^0.5.0"
}, },
"engines": { "engines": {
"node": ">=10.0.0" "node": ">=10.0.0"
......
...@@ -2,7 +2,7 @@ import { LogoutOutlined, SettingOutlined, UserOutlined } from '@ant-design/icons ...@@ -2,7 +2,7 @@ import { LogoutOutlined, SettingOutlined, UserOutlined } from '@ant-design/icons
import { Avatar, Menu, Spin } from 'antd'; import { Avatar, Menu, Spin } from 'antd';
import React from 'react'; import React from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import router from 'umi/router'; import { history } from 'umi';
import HeaderDropdown from '../HeaderDropdown'; import HeaderDropdown from '../HeaderDropdown';
import styles from './index.less'; import styles from './index.less';
...@@ -22,7 +22,7 @@ class AvatarDropdown extends React.Component { ...@@ -22,7 +22,7 @@ class AvatarDropdown extends React.Component {
return; return;
} }
router.push(`/account/${key}`); history.push(`/account/${key}`);
}; };
render() { render() {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
/* eslint-disable no-underscore-dangle, no-confusing-arrow */ /* eslint-disable no-underscore-dangle, no-confusing-arrow */
import ProLayout from '@ant-design/pro-layout'; import ProLayout from '@ant-design/pro-layout';
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import Link from 'umi/link'; import { Link } from 'umi';
import { connect } from 'dva'; import { connect } from 'dva';
import { Icon as LegacyIcon } from '@ant-design/compatible'; import { Icon as LegacyIcon } from '@ant-design/compatible';
import { Result, Button, Layout, Menu } from 'antd'; import { Result, Button, Layout, Menu } from 'antd';
...@@ -77,7 +77,6 @@ const BasicLayout = props => { ...@@ -77,7 +77,6 @@ const BasicLayout = props => {
}; // get children authority }; // get children authority
const authorized = getAuthorityFromRouter(props.route.routes, location.pathname || '/'); const authorized = getAuthorityFromRouter(props.route.routes, location.pathname || '/');
const _menu = param => const _menu = param =>
param.map(v => param.map(v =>
v.children && v.children.length ? ( v.children && v.children.length ? (
...@@ -131,13 +130,17 @@ const BasicLayout = props => { ...@@ -131,13 +130,17 @@ const BasicLayout = props => {
} }
return <Link to={menuItemProps.path}>{defaultDom}</Link>; return <Link to={menuItemProps.path}>{defaultDom}</Link>;
}} }}
breadcrumbRender={(routers = []) => [ breadcrumbRender={(routers = []) => {
if (routers.length) {
return [
{ {
path: '/', path: '/',
breadcrumbName: '首页', breadcrumbName: '首页',
}, },
...routers, ...routers,
]} ];
}
}}
itemRender={(route, params, routes, paths) => { itemRender={(route, params, routes, paths) => {
const first = routes.indexOf(route) === 0; const first = routes.indexOf(route) === 0;
return first ? ( return first ? (
......
import { queryCurrent, query as queryUsers, homeInfo } from '@/services/user'; import { queryCurrent, queryUsers, homeInfo } from '@/services/user';
import localStorage from '@/utils/localStorage'; import localStorage from '@/utils/localStorage';
const UserModel = { const UserModel = {
......
import { Button, Result } from 'antd'; import { Button, Result } from 'antd';
import React from 'react'; import React from 'react';
import router from 'umi/router'; // 这里应该使用 antd 的 404 result 组件, import { history } from 'umi'; // 这里应该使用 antd 的 404 result 组件,
// 但是还没发布,先来个简单的。 // 但是还没发布,先来个简单的。
const NoFoundPage = () => ( const NoFoundPage = () => (
...@@ -9,7 +9,7 @@ const NoFoundPage = () => ( ...@@ -9,7 +9,7 @@ const NoFoundPage = () => (
title="404" title="404"
subTitle="Sorry, the page you visited does not exist." subTitle="Sorry, the page you visited does not exist."
extra={ extra={
<Button type="primary" onClick={() => router.push('/')}> <Button type="primary" onClick={() => history.push('/')}>
Back Home Back Home
</Button> </Button>
} }
......
...@@ -155,7 +155,7 @@ export default () => { ...@@ -155,7 +155,7 @@ export default () => {
<ProTable <ProTable
columns={columns} columns={columns}
request={params => searchList(params, 2)} request={params => searchList(params, 2)}
rowKey="serviceNo" rowKey={r => r.serviceNo}
pagination={{ pagination={{
pagesSize: 20, pagesSize: 20,
}} }}
......
...@@ -102,7 +102,7 @@ export default () => { ...@@ -102,7 +102,7 @@ export default () => {
<ProTable <ProTable
columns={columns} columns={columns}
request={params => searchList(params, 1)} request={params => searchList(params, 1)}
rowKey="serviceNo" rowKey={r => r.serviceNo}
pagination={{ pagination={{
pagesSize: 20, pagesSize: 20,
}} }}
......
import { Form } from '@ant-design/compatible'; // import { Form } from '@ant-design/compatible';
// import '@ant-design/compatible/assets/index.css';
import { Form, Button, Input, Select, notification, Upload, Cascader, InputNumber } from 'antd';
import '@ant-design/compatible/assets/index.css'; import '@ant-design/compatible/assets/index.css';
import { Button, Input, Select, notification, Upload, Cascader, InputNumber } from 'antd';
import React, { Component } from 'react'; import React, { Component } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import styles from '../style.less'; import styles from '../style.less';
...@@ -13,38 +14,41 @@ const { Option } = Select; ...@@ -13,38 +14,41 @@ const { Option } = Select;
goodsManage, goodsManage,
})) }))
class goodsManage extends Component { class goodsManage extends Component {
formRef = React.createRef();
componentDidMount() { componentDidMount() {
this.props.onRef(this); this.props.onRef(this);
this.handleSearch(); this.handleSearch();
} }
getFieldsValue() { getFieldsValue() {
const { form } = this.props; const form = this.formRef.current;
return form.getFieldsValue(); return form.getFieldsValue();
} }
handleSearch = () => { handleSearch = () => {
this.props.handleSearch(1); this.props.handleSearch(1);
}; };
valueMin = value => {
const { getFieldValue, setFieldsValue } = this.formRef.current;
const minVal = getFieldValue('supplyPriceMin');
if (minVal && minVal > value) {
setFieldsValue({ supplyPriceMax: minVal });
}
};
onReset = () => { onReset = () => {
this.props.form.resetFields(); const form = this.formRef.current;
form.resetFields();
this.props.onReset(); this.props.onReset();
}; };
addSpu = () => { addSpu = () => {
this.props.addSpu(); this.props.addSpu();
}; };
render() { render() {
const { const { treeData } = this.props;
form: { getFieldDecorator, getFieldValue },
treeData,
} = this.props;
const selectW = { width: 250 }; const selectW = { width: 250 };
const iptNumWidth = { width: 118 }; const iptNumWidth = { width: 118 };
const that = this; const that = this;
// const uploadProps = { // const uploadProps = {
// name: 'file', // name: 'file',
// async customRequest(info) { // async customRequest(info) {
...@@ -73,19 +77,19 @@ class goodsManage extends Component { ...@@ -73,19 +77,19 @@ class goodsManage extends Component {
const filterOption = (input, op) => op.props.children.includes(input); const filterOption = (input, op) => op.props.children.includes(input);
return ( return (
<Form name="horizontal_login" layout="inline" className={styles.searchForm}> <Form
<FormItem label="SKU编码"> ref={this.formRef}
{getFieldDecorator('skuId', {})( name="horizontal_login"
<Input placeholder="请输入SKU编码" allowClear style={selectW} />, layout="inline"
)} className={styles.searchForm}
>
<FormItem label="SKU编码" name="skuId">
<Input placeholder="请输入SKU编码" allowClear style={selectW} />
</FormItem> </FormItem>
<FormItem label="商品名称"> <FormItem label="商品名称" name="skuName">
{getFieldDecorator('skuName', {})( <Input placeholder="请输入商品名称" allowClear style={selectW} />
<Input placeholder="请输入商品名称" allowClear style={selectW} />,
)}
</FormItem> </FormItem>
<FormItem label="类目"> <FormItem label="类目" name="productCategoryId">
{getFieldDecorator('productCategoryId', {})(
<Cascader <Cascader
placeholder="请选择类目" placeholder="请选择类目"
style={selectW} style={selectW}
...@@ -93,11 +97,9 @@ class goodsManage extends Component { ...@@ -93,11 +97,9 @@ class goodsManage extends Component {
changeOnSelect changeOnSelect
fieldNames={{ label: 'name', value: 'id', children: 'children' }} fieldNames={{ label: 'name', value: 'id', children: 'children' }}
options={treeData} options={treeData}
/>, />
)}
</FormItem> </FormItem>
<FormItem label="审核状态"> <FormItem label="审核状态" name="state">
{getFieldDecorator('state', {})(
<Select <Select
style={selectW} style={selectW}
placeholder="请选择审核状态" placeholder="请选择审核状态"
...@@ -109,30 +111,19 @@ class goodsManage extends Component { ...@@ -109,30 +111,19 @@ class goodsManage extends Component {
{item.label} {item.label}
</Option> </Option>
))} ))}
</Select>, </Select>
)}
</FormItem> </FormItem>
<FormItem label="供货价区间"> <FormItem label="供货价区间">
<FormItem className={styles.iptNumRight}> <FormItem name="supplyPriceMin" className={styles.iptNumRight} noStyle>
{getFieldDecorator('supplyPriceMin', {})( <InputNumber placeholder="请输入" style={iptNumWidth} />
<InputNumber placeholder="请输入" style={iptNumWidth} />,
)}
</FormItem> </FormItem>
<span>--</span> <span>--</span>
<FormItem className={styles.iptNumRight}> <FormItem name="supplyPriceMax" className={styles.iptNumRight} noStyle>
{getFieldDecorator('supplyPriceMax', {})( <InputNumber style={iptNumWidth} placeholder="请输入" onChange={this.valueMin} />
<InputNumber
style={iptNumWidth}
placeholder="请输入"
min={getFieldValue('supplyPriceMin')}
/>,
)}
</FormItem> </FormItem>
</FormItem> </FormItem>
<FormItem label="第三方SKU编码"> <FormItem name="thirdSkuNo" label="第三方SKU编码">
{getFieldDecorator('thirdSkuNo', {})( <Input placeholder="请输入第三方SKU编码" allowClear style={selectW} />
<Input placeholder="请输入第三方SKU编码" allowClear style={selectW} />,
)}
</FormItem> </FormItem>
<FormItem className={styles.queryBtn}> <FormItem className={styles.queryBtn}>
<Button onClick={() => this.handleSearch()} type="primary" className={styles.button}> <Button onClick={() => this.handleSearch()} type="primary" className={styles.button}>
...@@ -168,4 +159,4 @@ class goodsManage extends Component { ...@@ -168,4 +159,4 @@ class goodsManage extends Component {
} }
} }
export default Form.create()(goodsManage); export default goodsManage;
...@@ -329,6 +329,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods ...@@ -329,6 +329,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods
]; ];
if (productType === 1) { if (productType === 1) {
// 如果是实体商品添加重量 // 如果是实体商品添加重量
console.log(arr);
arr.splice(2, 0, { arr.splice(2, 0, {
title: '重量(kg)', title: '重量(kg)',
align: 'center', align: 'center',
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
.searchForm { .searchForm {
:global { :global {
.ant-form-item-label { .ant-form-item-label {
width: 120px; line-height: 40px;
} }
} }
} }
......
...@@ -63,7 +63,9 @@ const TableList = () => { ...@@ -63,7 +63,9 @@ const TableList = () => {
renderFormItem: () => ( renderFormItem: () => (
<Select onChange={changeSupplier} value={shopId} allowClear> <Select onChange={changeSupplier} value={shopId} allowClear>
{supplierList.map(item => ( {supplierList.map(item => (
<Option value={item.id}>{item.name}</Option> <Option value={item.id} key={item.id}>
{item.name}
</Option>
))} ))}
</Select> </Select>
), ),
...@@ -167,7 +169,7 @@ const TableList = () => { ...@@ -167,7 +169,7 @@ const TableList = () => {
columns={columns} columns={columns}
params={{ shopId }} params={{ shopId }}
request={res => query(res)} request={res => query(res)}
rowKey="id" rowKey={r => r.shopId}
bordered bordered
scroll={{ x: 1500 }} scroll={{ x: 1500 }}
toolBarRender={() => [ toolBarRender={() => [
......
...@@ -9,8 +9,8 @@ import { ...@@ -9,8 +9,8 @@ import {
downUploadeOrder, downUploadeOrder,
} from '../pendingDeliveryOrder/service'; } from '../pendingDeliveryOrder/service';
const TableList = () => { const TableList = ref => {
const actionRef = useRef(); const actionRef = useRef(null);
const columns = [ const columns = [
{ {
title: '批次号', title: '批次号',
......
...@@ -2,7 +2,7 @@ import { Button, Select } from 'antd'; ...@@ -2,7 +2,7 @@ import { Button, Select } from 'antd';
import React, { useRef, useEffect, useState } from 'react'; import React, { useRef, useEffect, useState } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import ProTable from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table';
import Link from 'umi/link'; import { Link } from 'umi';
import styles from './index.less'; import styles from './index.less';
import { query, supplier, downDetail } from './services'; import { query, supplier, downDetail } from './services';
......
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