Commit f84acd9e authored by lxd's avatar lxd

feat:组件升级

parents 727b378a 8fd22fe6
...@@ -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,
}, },
...@@ -191,33 +193,33 @@ export default { ...@@ -191,33 +193,33 @@ 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') || context.resourcePath.includes('ant.design.pro.less') ||
context.resourcePath.includes('ant.design.pro.less') || context.resourcePath.includes('global.less')
context.resourcePath.includes('global.less') ) {
) { return localName;
return localName; }
}
const match = context.resourcePath.match(/src(.*)/); const match = context.resourcePath.match(/src(.*)/);
if (match && match[1]) { if (match && match[1]) {
const antdProPath = match[1].replace('.less', ''); const antdProPath = match[1].replace('.less', '');
const arr = slash(antdProPath) const arr = slash(antdProPath)
.split('/') .split('/')
.map(a => a.replace(/([A-Z])/g, '-$1')) .map(a => a.replace(/([A-Z])/g, '-$1'))
.map(a => a.toLowerCase()); .map(a => a.toLowerCase());
return `antd-pro${arr.join('-')}-${localName}`.replace(/--/g, '-'); return `antd-pro${arr.join('-')}-${localName}`.replace(/--/g, '-');
} }
return localName; return localName;
},
}, },
}, },
chainWebpack: webpackPlugin, chainWebpack: webpackPlugin,
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
"experimentalDecorators": true, "experimentalDecorators": true,
"baseUrl": ".", "baseUrl": ".",
"paths": { "paths": {
"@/*": ["./src/*"] "@/*": ["./src/*"],
"@@/*": ["./src/.uim/*"]
} }
} }
} }
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -49,11 +49,14 @@ ...@@ -49,11 +49,14 @@
], ],
"dependencies": { "dependencies": {
"@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": "^3.26.20", "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",
...@@ -63,18 +66,14 @@ ...@@ -63,18 +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",
"rc-tree-select": "^5.1.4",
"react": "^16.8.6", "react": "^16.8.6",
"react-copy-to-clipboard": "^5.0.1", "react-copy-to-clipboard": "^5.0.1",
"react-dom": "^16.8.6", "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"
}, },
...@@ -90,6 +89,10 @@ ...@@ -90,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",
...@@ -109,10 +112,7 @@ ...@@ -109,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"
......
import { Icon, Popover, Typography } from 'antd'; import { DownloadOutlined } from '@ant-design/icons';
import { Popover, Typography } from 'antd';
import React, { useRef } from 'react'; import React, { useRef } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { isAntDesignPro } from '@/utils/utils'; import { isAntDesignPro } from '@/utils/utils';
...@@ -63,7 +64,7 @@ export default connect(({ routing }) => ({ ...@@ -63,7 +64,7 @@ export default connect(({ routing }) => ({
getPopupContainer={dom => (divDom.current ? divDom.current : dom)} getPopupContainer={dom => (divDom.current ? divDom.current : dom)}
> >
<div className={styles['copy-block']} ref={divDom}> <div className={styles['copy-block']} ref={divDom}>
<Icon type="download" /> <DownloadOutlined />
</div> </div>
</Popover> </Popover>
); );
......
import { Avatar, Icon, Menu, Spin } from 'antd'; import { LogoutOutlined, SettingOutlined, UserOutlined } from '@ant-design/icons';
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';
...@@ -21,7 +22,7 @@ class AvatarDropdown extends React.Component { ...@@ -21,7 +22,7 @@ class AvatarDropdown extends React.Component {
return; return;
} }
router.push(`/account/${key}`); history.push(`/account/${key}`);
}; };
render() { render() {
...@@ -36,20 +37,20 @@ class AvatarDropdown extends React.Component { ...@@ -36,20 +37,20 @@ class AvatarDropdown extends React.Component {
<Menu className={styles.menu} selectedKeys={[]} onClick={this.onMenuClick}> <Menu className={styles.menu} selectedKeys={[]} onClick={this.onMenuClick}>
{menu && ( {menu && (
<Menu.Item key="center"> <Menu.Item key="center">
<Icon type="user" /> <UserOutlined />
个人中心 个人中心
</Menu.Item> </Menu.Item>
)} )}
{menu && ( {menu && (
<Menu.Item key="settings"> <Menu.Item key="settings">
<Icon type="setting" /> <SettingOutlined />
个人设置 个人设置
</Menu.Item> </Menu.Item>
)} )}
{menu && <Menu.Divider />} {menu && <Menu.Divider />}
<Menu.Item key="logout"> <Menu.Item key="logout">
<Icon type="logout" /> <LogoutOutlined />
退出登录 退出登录
</Menu.Item> </Menu.Item>
</Menu> </Menu>
...@@ -57,7 +58,10 @@ class AvatarDropdown extends React.Component { ...@@ -57,7 +58,10 @@ class AvatarDropdown extends React.Component {
return currentUser && currentUser.name ? ( return currentUser && currentUser.name ? (
<HeaderDropdown overlay={menuHeaderDropdown}> <HeaderDropdown overlay={menuHeaderDropdown}>
<span className={`${styles.action} ${styles.account}`}> <span className={`${styles.action} ${styles.account}`}>
<Avatar icon="user" style={{ backgroundColor: '#388bd8', marginRight: '10px' }} /> <Avatar
icon={<UserOutlined />}
style={{ backgroundColor: '#388bd8', marginRight: '10px' }}
/>
<span className={styles.name}>{currentUser.name}</span> <span className={styles.name}>{currentUser.name}</span>
</span> </span>
</HeaderDropdown> </HeaderDropdown>
......
import { Icon, Tooltip } from 'antd'; import { Tooltip } from 'antd';
import React from 'react'; import React from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import Avatar from './AvatarDropdown'; import Avatar from './AvatarDropdown';
......
import { AutoComplete, Icon, Input } from 'antd'; import { SearchOutlined } from '@ant-design/icons';
import { AutoComplete, Input } from 'antd';
import React, { Component } from 'react'; import React, { Component } from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import debounce from 'lodash/debounce'; import debounce from 'lodash/debounce';
...@@ -112,7 +113,7 @@ export default class HeaderSearch extends Component { ...@@ -112,7 +113,7 @@ export default class HeaderSearch extends Component {
} }
}} }}
> >
<Icon type="search" key="Icon" /> <SearchOutlined key="Icon" />
<AutoComplete <AutoComplete
key="AutoComplete" key="AutoComplete"
{...restProps} {...restProps}
......
import { Badge, Icon, Spin, Tabs } from 'antd'; import { BellOutlined } from '@ant-design/icons';
import { Badge, Spin, Tabs } from 'antd';
import React, { Component } from 'react'; import React, { Component } from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import NoticeList from './NoticeList'; import NoticeList from './NoticeList';
...@@ -116,7 +117,7 @@ export default class NoticeIcon extends Component { ...@@ -116,7 +117,7 @@ export default class NoticeIcon extends Component {
const { visible } = this.state; const { visible } = this.state;
const noticeButtonClass = classNames(className, styles.noticeButton); const noticeButtonClass = classNames(className, styles.noticeButton);
const notificationBox = this.getNotificationBox(); const notificationBox = this.getNotificationBox();
const NoticeBellIcon = bell || <Icon type="bell" className={styles.icon} />; const NoticeBellIcon = bell || <BellOutlined className={styles.icon} />;
const trigger = ( const trigger = (
<span <span
className={classNames(noticeButtonClass, { className={classNames(noticeButtonClass, {
......
...@@ -6,9 +6,10 @@ ...@@ -6,9 +6,10 @@
/* 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 { Result, Button, Layout, Menu, Icon } from 'antd'; import { Icon as LegacyIcon } from '@ant-design/compatible';
import { Result, Button, Layout, Menu } from 'antd';
import Authorized from '@/utils/Authorized'; import Authorized from '@/utils/Authorized';
import RightContent from '@/components/GlobalHeader/RightContent'; import RightContent from '@/components/GlobalHeader/RightContent';
import { getAuthorityFromRouter } from '@/utils/utils'; import { getAuthorityFromRouter } from '@/utils/utils';
...@@ -76,7 +77,6 @@ const BasicLayout = props => { ...@@ -76,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 ? (
...@@ -84,7 +84,7 @@ const BasicLayout = props => { ...@@ -84,7 +84,7 @@ const BasicLayout = props => {
key={v.path} key={v.path}
title={ title={
<span> <span>
<Icon type={v.icon} /> <LegacyIcon type={v.icon} />
<span>{v.name}</span> <span>{v.name}</span>
</span> </span>
} }
...@@ -94,7 +94,7 @@ const BasicLayout = props => { ...@@ -94,7 +94,7 @@ const BasicLayout = props => {
) : ( ) : (
<Menu.Item key={v.path}> <Menu.Item key={v.path}>
<Link to={v.path}> <Link to={v.path}>
<Icon type={v.icon} /> <LegacyIcon type={v.icon} />
<span className="nav-text">{v.name}</span> <span className="nav-text">{v.name}</span>
</Link> </Link>
</Menu.Item> </Menu.Item>
...@@ -130,13 +130,18 @@ const BasicLayout = props => { ...@@ -130,13 +130,18 @@ const BasicLayout = props => {
} }
return <Link to={menuItemProps.path}>{defaultDom}</Link>; return <Link to={menuItemProps.path}>{defaultDom}</Link>;
}} }}
breadcrumbRender={(routers = []) => [ // eslint-disable-next-line consistent-return
{ breadcrumbRender={(routers = []) => {
path: '/', if (routers.length) {
breadcrumbName: '首页', return [
}, {
...routers, path: '/',
]} breadcrumbName: '首页',
},
...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 React from 'react'; import React from 'react';
import { Modal, Form, Input, Cascader, notification, InputNumber } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Modal, Input, Cascader, notification, InputNumber } from 'antd';
import { shopAudit } from '../services'; import { shopAudit } from '../services';
const FormItem = Form.Item; const FormItem = Form.Item;
......
import React from 'react'; import React from 'react';
import { Modal, Form, Input, notification } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Modal, Input, notification } from 'antd';
import { shopCheck } from '../services'; import { shopCheck } from '../services';
const FormItem = Form.Item; const FormItem = Form.Item;
......
import { Button, Form, Input, Select, notification, Upload, Cascader, InputNumber } from 'antd'; import { Form, 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';
...@@ -10,13 +10,15 @@ const { Option } = Select; ...@@ -10,13 +10,15 @@ 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();
} }
...@@ -24,8 +26,17 @@ class goodsManage extends Component { ...@@ -24,8 +26,17 @@ class goodsManage extends Component {
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();
}; };
...@@ -38,14 +49,10 @@ class goodsManage extends Component { ...@@ -38,14 +49,10 @@ class goodsManage extends Component {
}; };
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) {
...@@ -74,66 +81,53 @@ class goodsManage extends Component { ...@@ -74,66 +81,53 @@ 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} showSearch
showSearch 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="请选择审核状态" allowClear
allowClear filterOption={filterOption}
filterOption={filterOption} >
> {stateList?.map(item => (
{stateList?.map(item => ( <Option key={item.value} value={item.value}>
<Option key={item.value} value={item.value}> {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}>
...@@ -175,4 +169,4 @@ class goodsManage extends Component { ...@@ -175,4 +169,4 @@ class goodsManage extends Component {
} }
} }
export default Form.create()(goodsManage); export default goodsManage;
import { Form, Modal, Input, Select, Cascader, Tag, notification } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Modal, Input, Select, Cascader, Tag, notification } from 'antd';
import { da } from 'date-fns/locale'; import { da } from 'date-fns/locale';
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { getTemplate } from '../service'; import { getTemplate } from '../service';
......
import { Modal, InputNumber, notification, Form, Input, Radio } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Modal, InputNumber, notification, Input, Radio } from 'antd';
import React from 'react'; import React from 'react';
import { updateStock } from '../service'; import { updateStock } from '../service';
......
...@@ -8,12 +8,14 @@ const { Option } = Select; ...@@ -8,12 +8,14 @@ const { Option } = Select;
const FormItem = Form.Item; const FormItem = Form.Item;
class goodsManage extends Component { class goodsManage extends Component {
formRef = React.createRef();
componentDidMount() { componentDidMount() {
this.props.onRef(this); this.props.onRef(this);
} }
setFiled = flag => { setFiled = flag => {
const { form } = this.props; const form = this.formRef.current;
if (flag === 'firstKeys') { if (flag === 'firstKeys') {
form.setFieldsValue({ firstSpecValue: '' }); form.setFieldsValue({ firstSpecValue: '' });
return; return;
...@@ -22,7 +24,8 @@ class goodsManage extends Component { ...@@ -22,7 +24,8 @@ class goodsManage extends Component {
}; };
batchSetting = () => { batchSetting = () => {
const { form, editData, isEdit } = this.props; const { editData, isEdit } = this.props;
const form = this.formRef.current;
const data = form.getFieldsValue(); const data = form.getFieldsValue();
if (!data.firstSpecValue && !data.secondSpecValue) { if (!data.firstSpecValue && !data.secondSpecValue) {
editData.forEach(item => { editData.forEach(item => {
...@@ -83,50 +86,41 @@ class goodsManage extends Component { ...@@ -83,50 +86,41 @@ class goodsManage extends Component {
isEdit, isEdit,
isService, isService,
} = this.props; } = this.props;
const { getFieldDecorator } = this.props.form;
return ( return (
<Form layout="inline" onSubmit={this.handleSubmit}> <Form layout="inline" ref={this.formRef}>
<FormItem> <FormItem name="firstSpecValue">
{getFieldDecorator('firstSpecValue', {})( <Select allowClear style={{ width: 120 }} placeholder={firstSpesName}>
<Select allowClear style={{ width: 120 }} placeholder={firstSpesName}> {firstSpes.length > 0 &&
{firstSpes.length > 0 && firstSpes.map(
firstSpes.map( item =>
item => item &&
item && typeof item === 'string' && (
typeof item === 'string' && ( <Option key={item} value={item}>
<Option key={item} value={item}> {item}
{item} </Option>
</Option> ),
), )}
)} </Select>
</Select>,
)}
</FormItem> </FormItem>
<FormItem> <FormItem name="secondSpecValue">
{getFieldDecorator('secondSpecValue', {})( <Select allowClear style={{ width: 120 }} placeholder={secondSpesName}>
<Select allowClear style={{ width: 120 }} placeholder={secondSpesName}> {secondSpecs.length &&
{secondSpecs.length && secondSpecs.map(
secondSpecs.map( item =>
item => item &&
item && typeof item === 'string' && (
typeof item === 'string' && ( <Option key={item} value={item}>
<Option key={item} value={item}> {item}
{item} </Option>
</Option> ),
), )}
)} </Select>
</Select>,
)}
</FormItem> </FormItem>
<FormItem> <FormItem name="supplyPrice">
{getFieldDecorator('supplyPrice', {})( <Input placeholder="供货价" style={{ width: 100 }} />
<Input placeholder="供货价" style={{ width: 100 }} />,
)}
</FormItem> </FormItem>
<FormItem> <FormItem name="marketPrice">
{getFieldDecorator('marketPrice', {})( <Input placeholder="市场价" style={{ width: 100 }} />
<Input placeholder="市场价" style={{ width: 100 }} />,
)}
</FormItem> </FormItem>
{/* <FormItem> {/* <FormItem>
{getFieldDecorator('salePrice', {})( {getFieldDecorator('salePrice', {})(
...@@ -134,41 +128,35 @@ class goodsManage extends Component { ...@@ -134,41 +128,35 @@ class goodsManage extends Component {
)} )}
</FormItem> */} </FormItem> */}
{productType === 1 && ( {productType === 1 && (
<FormItem> <FormItem name="weight">
{getFieldDecorator('weight', {})( <InputNumber
<InputNumber precision={3}
precision={3} max={999999.999}
max={999999.999} // eslint-disable-next-line radix
// eslint-disable-next-line radix placeholder="重量"
placeholder="重量" style={{ width: 130 }}
style={{ width: 130 }} />
/>,
)}
</FormItem> </FormItem>
)} )}
<FormItem> <FormItem name="productStock">
{getFieldDecorator('productStock', {})( <InputNumber
precision={0}
step={1}
// eslint-disable-next-line radix
formatter={val => parseInt(val, '10') || ''}
placeholder="库存"
style={{ width: 100 }}
/>
</FormItem>
{productType === 1 && (
<FormItem name="productStockWarning">
<InputNumber <InputNumber
placeholder="库存预警"
maxLength={5}
min={0}
precision={0} precision={0}
step={1}
// eslint-disable-next-line radix
formatter={val => parseInt(val, '10') || ''}
placeholder="库存"
style={{ width: 100 }} style={{ width: 100 }}
/>, />
)}
</FormItem>
{productType === 1 && (
<FormItem>
{getFieldDecorator('productStockWarning', {})(
<InputNumber
placeholder="库存预警"
maxLength={5}
min={0}
precision={0}
style={{ width: 100 }}
/>,
)}
</FormItem> </FormItem>
)} )}
<FormItem> <FormItem>
...@@ -181,4 +169,4 @@ class goodsManage extends Component { ...@@ -181,4 +169,4 @@ class goodsManage extends Component {
} }
} }
export default Form.create()(goodsManage); export default goodsManage;
/* eslint-disable no-param-reassign */ /* eslint-disable no-param-reassign */
import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { MinusCircleOutlined, PlusOutlined, RestOutlined } from '@ant-design/icons';
import { import {
Modal, Modal,
Table, Table,
Button, Button,
Form,
Select, Select,
Input, Input,
Icon,
Row, Row,
Col, Col,
Checkbox, Checkbox,
...@@ -402,7 +404,7 @@ class goodsManage extends Component { ...@@ -402,7 +404,7 @@ class goodsManage extends Component {
initCascader: null, initCascader: null,
}); });
this.props.form.resetFields(); this.props.form.resetFields();
this.BatchSetting.props.form.resetFields(); console.log(this.BatchSetting);
return; return;
} }
this.onCancel(); this.onCancel();
...@@ -428,7 +430,7 @@ class goodsManage extends Component { ...@@ -428,7 +430,7 @@ class goodsManage extends Component {
productType: 1, productType: 1,
}, },
() => { () => {
this.BatchSetting.props.form.resetFields(); this.BatchSetting.formRef.current.resetFields();
this.props.form.resetFields(); this.props.form.resetFields();
this.props.onCancel(); this.props.onCancel();
}, },
...@@ -448,7 +450,7 @@ class goodsManage extends Component { ...@@ -448,7 +450,7 @@ class goodsManage extends Component {
productType: event.target.value, productType: event.target.value,
}); });
this.props.form.resetFields(); this.props.form.resetFields();
this.BatchSetting.props.form.resetFields(); this.BatchSetting.formRef.current.resetFields();
}; };
validateToInputName = (rule, value, callback) => { validateToInputName = (rule, value, callback) => {
...@@ -580,7 +582,7 @@ class goodsManage extends Component { ...@@ -580,7 +582,7 @@ class goodsManage extends Component {
}, },
], ],
})( })(
<SuperSelect <Select
allowClear allowClear
showSearch showSearch
style={{ width: 280 }} style={{ width: 280 }}
...@@ -594,7 +596,7 @@ class goodsManage extends Component { ...@@ -594,7 +596,7 @@ class goodsManage extends Component {
{item.name} {item.name}
</Option> </Option>
))} ))}
</SuperSelect>, </Select>,
)} )}
</FormItem> </FormItem>
</Col> </Col>
...@@ -683,7 +685,7 @@ class goodsManage extends Component { ...@@ -683,7 +685,7 @@ class goodsManage extends Component {
> >
{this.state.specList.length && {this.state.specList.length &&
this.state.specList.map(item => ( this.state.specList.map(item => (
<Option key={item.specId} value={item.specId}> <Option value={item.specId} key={item.specId}>
{item.specName} {item.specName}
</Option> </Option>
))} ))}
...@@ -724,9 +726,8 @@ class goodsManage extends Component { ...@@ -724,9 +726,8 @@ class goodsManage extends Component {
/>, />,
)} )}
{firstKeys.length > 0 ? ( {firstKeys.length > 0 ? (
<Icon <MinusCircleOutlined
className="dynamic-delete-button" className="dynamic-delete-button"
type="minus-circle-o"
onClick={() => this.remove('firstKeys', k)} onClick={() => this.remove('firstKeys', k)}
/> />
) : null} ) : null}
...@@ -739,7 +740,7 @@ class goodsManage extends Component { ...@@ -739,7 +740,7 @@ class goodsManage extends Component {
onClick={() => this.add('firstKeys')} onClick={() => this.add('firstKeys')}
style={{ textAlign: 'center' }} style={{ textAlign: 'center' }}
> >
<Icon type="plus" /> <PlusOutlined />
</Button> </Button>
</FormItem> </FormItem>
</Row> </Row>
...@@ -788,9 +789,8 @@ class goodsManage extends Component { ...@@ -788,9 +789,8 @@ class goodsManage extends Component {
validateTrigger: ['onChange', 'onBlur'], validateTrigger: ['onChange', 'onBlur'],
})(<Input key={k} style={{ width: '60%', marginRight: 8 }} />)} })(<Input key={k} style={{ width: '60%', marginRight: 8 }} />)}
{secondKeys.length > 0 ? ( {secondKeys.length > 0 ? (
<Icon <MinusCircleOutlined
className="dynamic-delete-button" className="dynamic-delete-button"
type="minus-circle-o"
onClick={() => this.remove('secondKeys', k)} onClick={() => this.remove('secondKeys', k)}
/> />
) : null} ) : null}
...@@ -803,7 +803,7 @@ class goodsManage extends Component { ...@@ -803,7 +803,7 @@ class goodsManage extends Component {
style={{ textAlign: 'center' }} style={{ textAlign: 'center' }}
disabled={isJDGoods} disabled={isJDGoods}
> >
<Icon type="plus" /> <PlusOutlined />
</Button> </Button>
</FormItem> </FormItem>
</Row> </Row>
...@@ -836,7 +836,7 @@ class goodsManage extends Component { ...@@ -836,7 +836,7 @@ class goodsManage extends Component {
<Row> <Row>
<Table <Table
bordered bordered
rowKey="id" rowKey={r => r.thirdSkuNo}
pagination={false} pagination={false}
scroll={{ y: 300, x: 1200 }} scroll={{ y: 300, x: 1200 }}
dataSource={this.state.editData} dataSource={this.state.editData}
...@@ -862,8 +862,7 @@ class goodsManage extends Component { ...@@ -862,8 +862,7 @@ class goodsManage extends Component {
size="small" size="small"
onClick={this.deleteImg} onClick={this.deleteImg}
style={{ marginTop: '10px' }} style={{ marginTop: '10px' }}
icon="rest" icon={<RestOutlined />}
disabled={isService}
> >
图片批量删除 图片批量删除
</Button> </Button>
......
import { Form, Input, Modal } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Input, Modal } from 'antd';
import React, { Component } from 'react'; import React, { Component } from 'react';
const { TextArea } = Input; const { TextArea } = Input;
......
import { Card, Form, Pagination, Table, notification, Drawer, Spin } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Card, Pagination, Table, notification, Drawer, Spin } from 'antd';
import React, { Component } from 'react'; import React, { Component } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { connect } from 'dva'; import { connect } from 'dva';
......
...@@ -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;
} }
} }
} }
......
import React from 'react'; import React from 'react';
import { Modal, Row, Col, Input, Form, Select, notification } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Modal, Row, Col, Input, Select, notification } from 'antd';
import { audit } from '../appeal/services'; import { audit } from '../appeal/services';
const { TextArea } = Input; const { TextArea } = Input;
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Modal, Form, Select, Input, notification } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Modal, Select, Input, notification } from 'antd';
import _ from 'lodash'; import _ from 'lodash';
import { addrQuery, update } from './services'; import { addrQuery, update } from './services';
......
...@@ -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={() => [
......
...@@ -103,7 +103,7 @@ export default () => { ...@@ -103,7 +103,7 @@ export default () => {
key="passaudit" key="passaudit"
columns={columns} columns={columns}
request={params => query(params, 2)} request={params => query(params, 2)}
rowKey="skuId" rowKey={r => r.orderId}
pagination={{ pagination={{
pagesSize: 20, pagesSize: 20,
}} }}
......
import React from 'react'; import React from 'react';
import { Modal, Form, Input, Cascader, notification } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Modal, Input, Cascader, notification } from 'antd';
import { shopAudit } from '../service'; import { shopAudit } from '../service';
const FormItem = Form.Item; const FormItem = Form.Item;
......
...@@ -23,7 +23,13 @@ export default props => { ...@@ -23,7 +23,13 @@ export default props => {
]; ];
return ( return (
<Modal title="订单详情" visible={visible} onCancel={handleCancel} footer={null} width={800}> <Modal title="订单详情" visible={visible} onCancel={handleCancel} footer={null} width={800}>
<Table dataSource={dataSource} columns={columns} key="skuName" pagination={false} bordered /> <Table
dataSource={dataSource}
columns={columns}
key={r => r.orderId}
pagination={false}
bordered
/>
</Modal> </Modal>
); );
}; };
import React from 'react'; import React from 'react';
import { Modal, Form, Input, notification } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Modal, Input, notification } from 'antd';
import { shopCheck } from '../service'; import { shopCheck } from '../service';
const FormItem = Form.Item; const FormItem = Form.Item;
......
import { Upload, Icon, Modal, notification } from 'antd'; import { DeleteOutlined, EyeOutlined, PlusOutlined } from '@ant-design/icons';
import { Upload, Modal, notification } from 'antd';
import React from 'react'; import React from 'react';
import { ReactSortable } from 'react-sortablejs'; import { ReactSortable } from 'react-sortablejs';
import lodash from 'lodash'; import lodash from 'lodash';
...@@ -152,7 +153,7 @@ class PicturesWall extends React.Component { ...@@ -152,7 +153,7 @@ class PicturesWall extends React.Component {
const { previewVisible, previewImage, fileList } = this.state; const { previewVisible, previewImage, fileList } = this.state;
const uploadButton = ( const uploadButton = (
<div> <div>
<Icon type="plus" /> <PlusOutlined />
<div className="ant-upload-text">上传图片</div> <div className="ant-upload-text">上传图片</div>
</div> </div>
); );
...@@ -213,18 +214,14 @@ class PicturesWall extends React.Component { ...@@ -213,18 +214,14 @@ class PicturesWall extends React.Component {
</div> </div>
{this.state.activeImgIndex === index && ( {this.state.activeImgIndex === index && (
<div className={styles.mask}> <div className={styles.mask}>
<Icon <EyeOutlined
type="eye"
className={styles.maskIcon} className={styles.maskIcon}
onClick={() => this.handlePreview(item)} onClick={() => this.handlePreview(item)}
/> />
{!isDisabled && ( <DeleteOutlined
<Icon className={styles.maskIcon}
type="delete" onClick={() => this.onRemoveImg(item)}
className={styles.maskIcon} />
onClick={() => this.onRemoveImg(item)}
/>
)}
</div> </div>
)} )}
</div> </div>
......
import { Upload, Icon, Modal, message } from 'antd'; import { PlusOutlined } from '@ant-design/icons';
import { Upload, Modal, message } from 'antd';
import React from 'react'; import React from 'react';
import config from '../../../config/env.config'; import config from '../../../config/env.config';
import { qiniuToken } from '@/services/qiniu'; import { qiniuToken } from '@/services/qiniu';
...@@ -88,7 +89,7 @@ class PicturesWall extends React.Component { ...@@ -88,7 +89,7 @@ class PicturesWall extends React.Component {
const { previewVisible, previewImage, fileList } = this.state; const { previewVisible, previewImage, fileList } = this.state;
const uploadButton = ( const uploadButton = (
<div> <div>
<Icon type="plus" /> <PlusOutlined />
<div className="ant-upload-text">上传图片</div> <div className="ant-upload-text">上传图片</div>
</div> </div>
); );
......
import { Form, Modal, Input, Select, Cascader, Tag, notification } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Modal, Input, Select, Cascader, Tag, notification } from 'antd';
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import RcTreeSelect from 'rc-tree-select';
import { el } from 'date-fns/locale'; import { el } from 'date-fns/locale';
import { areaList, getAddTemplate, forbiddenAddress } from '../services'; import { areaList, getAddTemplate, forbiddenAddress } from '../services';
...@@ -9,13 +10,12 @@ const { Option } = Select; ...@@ -9,13 +10,12 @@ const { Option } = Select;
const AddAreaModal = props => { const AddAreaModal = props => {
const { const {
visible, visible,
form: { getFieldDecorator, validateFields, resetFields }, form: { getFieldDecorator, validateFields, resetFields, setFieldsValue },
templateData, templateData,
} = props; } = props;
const [addList, setAddList] = useState([]); const [addList, setAddList] = useState([]);
const [selectedList, setSelectedList] = useState([]); const [selectedList, setSelectedList] = useState([]);
const [selected, setSelect] = useState([]); const [selected, setSelect] = useState([]);
const a = [];
const formItemLayout = { const formItemLayout = {
labelCol: { labelCol: {
span: 6, span: 6,
...@@ -59,14 +59,13 @@ const AddAreaModal = props => { ...@@ -59,14 +59,13 @@ const AddAreaModal = props => {
value: itemData.addrId, value: itemData.addrId,
addressId: itemData.addrId, addressId: itemData.addrId,
addressLevel: itemData.addrLevel, addressLevel: itemData.addrLevel,
// isLeaf: itemData.addrLevel === 4,
isLeaf: false, isLeaf: false,
}), }),
); );
targetOption.children = newData; targetOption.children = newData;
targetOption.loading = false;
setAddList([...addList]);
} }
targetOption.loading = false;
setAddList([...addList]);
}; };
// 限制区域删除 // 限制区域删除
const preventDefault = val => { const preventDefault = val => {
...@@ -119,45 +118,30 @@ const AddAreaModal = props => { ...@@ -119,45 +118,30 @@ const AddAreaModal = props => {
}); });
}; };
// 判断是否重复 // 判断是否重复
const getChilds = (data, { addressId }) => { const getChilds = select => {
let flag = true; const reslutData = selectedList.filter(
const arr = []; item =>
function judgeChildren(dat) { !select.addressName.includes(item.addressName) &&
// eslint-disable-next-line no-plusplus !item.addressName.includes(select.addressName),
for (let i = 0; i < dat.length; i++) { );
const item = dat[i]; reslutData.push(select);
if (!flag) { return reslutData;
return;
}
if (+item.addressId === +addressId) {
flag = false;
}
// if (item.children && item.children.length) {
// judgeChildren(item.children);
// }
}
}
judgeChildren(data);
return flag;
}; };
const onPopupVisibleChange = labels => { const onPopupVisibleChange = labels => {
if (!labels && selected?.length) { if (!labels && selected?.length) {
const select = selected.slice(-1)[0]; const select = selected.slice(-1)[0];
const arr = selected.map(x => x.label); const arr = selected.map(x => x.label);
select.addressName = arr.join('/'); select.addressName = arr.join('/');
const staust = getChilds(selectedList, select); const reslutData = getChilds(select);
if (staust) { // 用中文字符排序
selectedList.push(select); const resultArray = reslutData.sort((param1, param2) =>
// 用中文字符排序 param1.addressName.localeCompare(param2.addressName, 'zh'),
const resultArray = selectedList.sort((param1, param2) => );
param1.addressName.localeCompare(param2.addressName, 'zh'), setSelectedList([...resultArray]);
); setSelect([]);
setSelectedList([...resultArray]);
setSelect([]);
}
} }
}; };
useEffect(() => { useEffect(() => {
getAreaList(); getAreaList();
if (props.templateData) { if (props.templateData) {
...@@ -189,9 +173,8 @@ const AddAreaModal = props => { ...@@ -189,9 +173,8 @@ const AddAreaModal = props => {
loadData={loadData} loadData={loadData}
onChange={(val, label) => onChange(val, label)} onChange={(val, label) => onChange(val, label)}
allowClear={false} allowClear={false}
// expandTrigger="hover"
changeOnSelect changeOnSelect
onPopupVisibleChange={onPopupVisibleChange} onDropdownVisibleChange={onPopupVisibleChange}
/>, />,
)} )}
{selectedList?.map((selItem, selIndex) => ( {selectedList?.map((selItem, selIndex) => (
......
...@@ -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: '批次号',
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Modal, Form, Select, Input, Icon, Card, notification } from 'antd'; import { MinusCircleOutlined, PlusCircleOutlined } from '@ant-design/icons';
import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Modal, Select, Input, Card, notification } from 'antd';
import style from '../index.less'; import style from '../index.less';
import { updateExpress } from '../service'; import { updateExpress } from '../service';
...@@ -160,8 +163,8 @@ const LogisticsForm = props => { ...@@ -160,8 +163,8 @@ const LogisticsForm = props => {
</Card> </Card>
))} ))}
<div className={style.logistics}> <div className={style.logistics}>
<Icon className={style.logisticsIcon} onClick={addForm} type="plus-circle" /> <PlusCircleOutlined className={style.logisticsIcon} onClick={addForm} />
<Icon className={style.logisticsIcon} onClick={rmForm} type="minus-circle" /> <MinusCircleOutlined className={style.logisticsIcon} onClick={rmForm} />
</div> </div>
</Form> </Form>
</Modal> </Modal>
......
import React from 'react'; import React from 'react';
import { Modal, Form, Select, Input, notification } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Modal, Select, Input, notification } from 'antd';
import { updateStatus } from '../services'; import { updateStatus } from '../services';
const FormItem = Form.Item; const FormItem = Form.Item;
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Modal, Form, Select, Input, notification } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Modal, Select, Input, notification } from 'antd';
import _ from 'lodash'; import _ from 'lodash';
import { update } from './services'; import { update } from './services';
import { addrQuery } from '../afterSaleAddress/services'; import { addrQuery } from '../afterSaleAddress/services';
......
...@@ -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';
...@@ -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>
), ),
...@@ -149,7 +151,7 @@ const TableList = () => { ...@@ -149,7 +151,7 @@ const TableList = () => {
columns={columns} columns={columns}
params={{ shopId }} params={{ shopId }}
request={res => query(res)} request={res => query(res)}
rowKey="id" rowKey={r => r.batchNo}
bordered bordered
scroll={{ x: 1500 }} scroll={{ x: 1500 }}
search={{ search={{
......
...@@ -150,8 +150,9 @@ export default () => { ...@@ -150,8 +150,9 @@ export default () => {
}, },
{ {
title: '操作', title: '操作',
valueType: 'option', dataIndex: 'action',
width: 280, hideInSearch: true,
width: 200,
fixed: 'right', fixed: 'right',
render: (_, r) => tableRenderBtn(r), render: (_, r) => tableRenderBtn(r),
}, },
...@@ -165,7 +166,7 @@ export default () => { ...@@ -165,7 +166,7 @@ export default () => {
className={style.table} className={style.table}
request={query} request={query}
search={{ collapsed: false }} search={{ collapsed: false }}
rowKey="id" rowKey={r => r.settlementNo}
pagination={{ pagination={{
defaultCurrent: 1, defaultCurrent: 1,
}} }}
......
import React, { useRef, useState, useEffect } from 'react'; import React, { useRef, useState, useEffect } from 'react';
import { Modal, Button, Tabs, Upload, notification, Icon } from 'antd'; import { UploadOutlined } from '@ant-design/icons';
import { Modal, Button, Tabs, Upload, notification } from 'antd';
import styles from '../style.less'; import styles from '../style.less';
import { uploadFile, uploadPic } from '../service'; import { uploadFile, uploadPic } from '../service';
import UploadC from '../../components/upload'; import UploadC from '../../components/upload';
...@@ -87,7 +88,7 @@ export default props => { ...@@ -87,7 +88,7 @@ export default props => {
</a> </a>
<Dragger {...uploadProps} className={styles.clearfloat}> <Dragger {...uploadProps} className={styles.clearfloat}>
<p> <p>
<Icon type="upload" /> <UploadOutlined />
</p> </p>
<p>点击上传附件</p> <p>点击上传附件</p>
</Dragger> </Dragger>
......
import { Button, Col, Form, Input, Row } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Button, Col, Input, Row } from 'antd';
import React, { Component } from 'react'; import React, { Component } from 'react';
import omit from 'omit.js'; import omit from 'omit.js';
import ItemMap from './map'; import ItemMap from './map';
......
import { Button, Form } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Button } from 'antd';
import React from 'react'; import React from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import styles from './index.less'; import styles from './index.less';
......
import { Form, Tabs } from 'antd'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Tabs } from 'antd';
import React, { Component } from 'react'; import React, { Component } from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import LoginContext from './LoginContext'; import LoginContext from './LoginContext';
......
import { Icon } from 'antd'; import { LockOutlined, MailOutlined, MobileOutlined, UserOutlined } from '@ant-design/icons';
import React from 'react'; import React from 'react';
import styles from './index.less'; import styles from './index.less';
...@@ -7,7 +7,7 @@ export default { ...@@ -7,7 +7,7 @@ export default {
props: { props: {
size: 'large', size: 'large',
id: 'userName', id: 'userName',
prefix: <Icon type="user" className={styles.prefixIcon} />, prefix: <UserOutlined className={styles.prefixIcon} />,
placeholder: 'admin', placeholder: 'admin',
}, },
rules: [ rules: [
...@@ -20,7 +20,7 @@ export default { ...@@ -20,7 +20,7 @@ export default {
Password: { Password: {
props: { props: {
size: 'large', size: 'large',
prefix: <Icon type="lock" className={styles.prefixIcon} />, prefix: <LockOutlined className={styles.prefixIcon} />,
type: 'password', type: 'password',
id: 'password', id: 'password',
placeholder: '888888', placeholder: '888888',
...@@ -35,7 +35,7 @@ export default { ...@@ -35,7 +35,7 @@ export default {
Mobile: { Mobile: {
props: { props: {
size: 'large', size: 'large',
prefix: <Icon type="mobile" className={styles.prefixIcon} />, prefix: <MobileOutlined className={styles.prefixIcon} />,
placeholder: 'mobile number', placeholder: 'mobile number',
}, },
rules: [ rules: [
...@@ -52,7 +52,7 @@ export default { ...@@ -52,7 +52,7 @@ export default {
Captcha: { Captcha: {
props: { props: {
size: 'large', size: 'large',
prefix: <Icon type="mail" className={styles.prefixIcon} />, prefix: <MailOutlined className={styles.prefixIcon} />,
placeholder: 'captcha', placeholder: 'captcha',
}, },
rules: [ rules: [
......
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