Commit 6255d67c authored by LeeJiancong's avatar LeeJiancong
parents 4f36f26e bcd90b9f
{"userRegister":{"useType":{"memberType":[{"id":1,"typeName":"企业会员"},{"id":3,"typeName":"渠道企业会员"},{"id":4,"typeName":"渠道个人会员"},{"id":2,"typeName":"个人会员"}],"businessType":[{"id":1,"typeName":"采购"},{"id":39,"typeName":"供货"},{"id":40,"typeName":"供货商消费者"},{"id":41,"typeName":"供货商消费者渠道会员"}]}},"web":{"shopInfo":[]},"global":{"siteId":502,"siteUrl":"http://localhost:4396","logo":"https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/4db4e7c5424c471c968ab540bce027f31597319423082.png","countryList":[{"name":"简体中文-ZH","key":"zh-CN","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/china.png"},{"name":"English-EN","key":"en-US","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/us.png"},{"name":"日本語-JP","key":"jp","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/japen.png"},{"name":"한국어-KO","key":"ko","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/koren.png"}]}} {"userRegister":{"useType":{"memberType":[{"id":1,"typeName":"企业会员"},{"id":3,"typeName":"渠道企业会员"},{"id":4,"typeName":"渠道个人会员"},{"id":2,"typeName":"个人会员"}],"businessType":[{"id":1,"typeName":"采购"},{"id":39,"typeName":"供货"},{"id":40,"typeName":"供货商消费者"},{"id":41,"typeName":"供货商消费者渠道会员"}]}},"web":{"shopInfo":[]},"global":{"siteId":602,"siteUrl":"http://localhost:4396","logo":"https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/4db4e7c5424c471c968ab540bce027f31597319423082.png","countryList":[{"name":"简体中文-ZH","key":"zh-CN","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/china.png"},{"name":"English-EN","key":"en-US","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/us.png"},{"name":"日本語-JP","key":"jp","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/japen.png"},{"name":"한국어-KO","key":"ko","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/koren.png"}]}}
...@@ -15,30 +15,13 @@ const { Option } = Select ...@@ -15,30 +15,13 @@ const { Option } = Select
const CustomInputSearch = props => { const CustomInputSearch = props => {
console.log(props); console.log(props);
// const [state, setState] = useFieldState({
// filterSearch: false,
// });
const justifyAlign = props.props['x-component-props'].align || 'flex-end'; const justifyAlign = props.props['x-component-props'].align || 'flex-end';
// const changeFilterVisible = () => {
// if (state.filterSearch) {
// props.form.reset({
// // 清除FILTER_PARAMS下所有字段
// selector: `*.${FORM_FILTER_PATH}.*`,
// });
// }
// setState({
// filterSearch: !state.filterSearch,
// });
// };
const [brandData, setBrandData] = useState<any>([]) const [brandData, setBrandData] = useState<any>([])
const [brandValue, setBrandValue] = useState(undefined) const [brandValue, setBrandValue] = useState(undefined)
const handleBrandSearch = (value: any) => { // end value const handleBrandSearch = (value: any) => { // end value
console.log(value, 'handleBrandSearch') console.log(value, '搜索值')
if (value) { if (value) {
PublicApi.getProductSelectGetSelectBrand({ name: value }).then(res => { PublicApi.getProductSelectGetSelectBrand({ name: value }).then(res => {
if (res.code === 1000) if (res.code === 1000)
...@@ -49,33 +32,18 @@ const CustomInputSearch = props => { ...@@ -49,33 +32,18 @@ const CustomInputSearch = props => {
} }
} }
// 只能在组件中获取对应的值
return ( return (
<Space size={20} style={{ justifyContent: justifyAlign, width: '100%' }}> <Space size={20} style={{ justifyContent: justifyAlign, width: '100%' }}>
<Select <Select
showSearch={true} // value={brandValue}
showArrow={true}
placeholder="品牌"
value={brandValue}
defaultActiveFirstOption={false}
filterOption={false}
onSearch={value => handleBrandSearch(value)} onSearch={value => handleBrandSearch(value)}
onChange={v => props.mutators.change(v)} onChange={v => props.mutators.change(v)}
notFoundContent={null}
style={{ width: '174px', lineHeight: '32px' }}
{...props.props['x-component-props']} {...props.props['x-component-props']}
> >
{brandData.map(d => <Option value={d.id} key={d.id}>{d.name}</Option>)} {brandData.map(d => <Option value={d.id} key={d.id}>{d.name}</Option>)}
</Select> </Select>
{/* <Input.Search
value={props.value || ''}
onChange={e => props.mutators.change(e.target.value)}
onSearch={(_, e) => {
e.preventDefault();
props.form.submit();
}}
{...props.props['x-component-props']}
/> */}
</Space> </Space>
); );
}; };
......
...@@ -18,3 +18,5 @@ export const Environment_Status = { ...@@ -18,3 +18,5 @@ export const Environment_Status = {
3: "APP" 3: "APP"
} }
// 1是阿里云oss服务器, 2是本地文件服务器
export const UPLOAD_TYPE = isDev ? 2 : 1
\ No newline at end of file
export interface MemberType {
id: number;
typeName: string;
}
export interface BusinessType {
id: number;
typeName: string;
}
export interface UseType {
memberType: MemberType[];
businessType: BusinessType[];
}
export interface UserRegister {
useType: UseType;
}
export interface ShopInfo {
id: number;
name: string;
type: number;
environment: number;
logoUrl: string;
describe: string;
state: number;
url: string;
}
export interface Web {
shopInfo: ShopInfo[];
}
export interface CountryList {
name: string;
key: string;
icon: string;
}
export interface Global {
siteId: number;
siteUrl: string;
logo: string;
countryList: CountryList[];
}
export interface RootObject {
userRegister: UserRegister;
web: Web;
global: Global;
}
\ No newline at end of file
...@@ -211,7 +211,7 @@ const CategoryAttributes: React.FC<{}> = () => { ...@@ -211,7 +211,7 @@ const CategoryAttributes: React.FC<{}> = () => {
let _txt: string = '' let _txt: string = ''
if (text === 2) { if (text === 2) {
_txt = '多选' _txt = '多选'
} else if (text === 2) { } else if (text === 1) {
_txt = '单选' _txt = '单选'
} else if (text === 3) { } else if (text === 3) {
_txt = '输入' _txt = '输入'
......
...@@ -6,6 +6,7 @@ import { Player } from 'video-react'; ...@@ -6,6 +6,7 @@ import { Player } from 'video-react';
import styles from '../index.less' import styles from '../index.less'
import { PlusOutlined, DeleteOutlined } from '@ant-design/icons' import { PlusOutlined, DeleteOutlined } from '@ant-design/icons'
// import { PublicApi } from '@/services/api' // import { PublicApi } from '@/services/api'
import { UPLOAD_TYPE } from '@/constants'
export interface Iprops { export interface Iprops {
...@@ -37,7 +38,7 @@ const ProductDescFormOne: React.FC<Iprops> = (props) => { ...@@ -37,7 +38,7 @@ const ProductDescFormOne: React.FC<Iprops> = (props) => {
name: 'file', name: 'file',
action: '/api/file/file/upload', action: '/api/file/file/upload',
showUploadList: false, showUploadList: false,
data: { fileType: 2 }, data: { fileType: UPLOAD_TYPE },
onChange(info) { onChange(info) {
if (info.file.status !== 'uploading') { if (info.file.status !== 'uploading') {
console.log(info.file, info.fileList, 'image files'); console.log(info.file, info.fileList, 'image files');
...@@ -72,7 +73,7 @@ const ProductDescFormOne: React.FC<Iprops> = (props) => { ...@@ -72,7 +73,7 @@ const ProductDescFormOne: React.FC<Iprops> = (props) => {
name: 'file', name: 'file',
action: '/api/file/file/upload', action: '/api/file/file/upload',
showUploadList: false, showUploadList: false,
data: { fileType: 2 }, data: { fileType: UPLOAD_TYPE },
onChange(info) { onChange(info) {
if (info.file.status !== 'uploading') { if (info.file.status !== 'uploading') {
console.log(info.file, info.fileList, 'video files'); console.log(info.file, info.fileList, 'video files');
......
...@@ -5,6 +5,7 @@ import { PlusOutlined } from '@ant-design/icons' ...@@ -5,6 +5,7 @@ import { PlusOutlined } from '@ant-design/icons'
import CustomTabs, { ItemPane } from '@/components/CustomTabs' import CustomTabs, { ItemPane } from '@/components/CustomTabs'
import styles from './index.less' import styles from './index.less'
import { UploadFile, UploadChangeParam } from 'antd/lib/upload/interface'; import { UploadFile, UploadChangeParam } from 'antd/lib/upload/interface';
import { UPLOAD_TYPE } from '@/constants'
import { inject, observer } from 'mobx-react' import { inject, observer } from 'mobx-react'
// import { IProductModule } from '@/module/productModule' // import { IProductModule } from '@/module/productModule'
...@@ -206,7 +207,7 @@ const ProductImageForm: React.FC<Iprops> = (props) => { ...@@ -206,7 +207,7 @@ const ProductImageForm: React.FC<Iprops> = (props) => {
beforeUpload={beforeUpload} beforeUpload={beforeUpload}
onPreview={handlePreview} onPreview={handlePreview}
onChange={(files)=>handleChange(files, index)} onChange={(files)=>handleChange(files, index)}
data={{fileType: 2}} data={{fileType: UPLOAD_TYPE}}
> >
{item.commodityPic.length >= 6 ? null : uploadButton} {item.commodityPic.length >= 6 ? null : uploadButton}
</Upload> </Upload>
...@@ -234,7 +235,7 @@ const ProductImageForm: React.FC<Iprops> = (props) => { ...@@ -234,7 +235,7 @@ const ProductImageForm: React.FC<Iprops> = (props) => {
beforeUpload={beforeUpload} beforeUpload={beforeUpload}
onPreview={handlePreview} onPreview={handlePreview}
onChange={(files)=>handleChange(files, -1)} onChange={(files)=>handleChange(files, -1)}
data={{fileType: 2}} data={{fileType: UPLOAD_TYPE}}
> >
{commonImageList.length >= 6 ? null : uploadButton} {commonImageList.length >= 6 ? null : uploadButton}
</Upload> </Upload>
......
import React, { useState, useEffect, useRef, ReactNode } from 'react' import React, { useState, useEffect, useRef, ReactNode } from 'react'
import { history } from 'umi' import { history } from 'umi'
import { Button, Form, Card, Modal, Select } from 'antd' import { Button, Form, Card, Modal, Select, Row, Col, Dropdown, Input, Menu, Space } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout' import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { import {
PlusOutlined, PlusOutlined,
EyeOutlined, EyeOutlined,
DownOutlined,
CaretUpOutlined,
CaretDownOutlined,
DeleteOutlined,
VerticalAlignTopOutlined,
VerticalAlignBottomOutlined
} from '@ant-design/icons' } from '@ant-design/icons'
import { StandardTable } from 'god' import { StandardTable } from 'god'
import { ColumnType } from 'antd/lib/table/interface' import { ColumnType } from 'antd/lib/table/interface'
import { IFormFilter, IButtonFilter } from 'god/dist/src/standard-table/TableController'; import { IFormFilter, IButtonFilter } from 'god/dist/src/standard-table/TableController';
import NiceForm from '@/components/NiceForm'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import { createFormActions, FormEffectHooks } from '@formily/antd'
import { channelSchema } from './schema/channelSchema'
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect'
// 定义选择的行数据的类型 // 定义选择的行数据的类型
interface Item { interface Item {
key: string; id: string;
role: string; role: string;
specification: string; specification: string;
type: string; type: string;
...@@ -25,7 +37,7 @@ interface Item { ...@@ -25,7 +37,7 @@ interface Item {
const data = [ const data = [
{ {
key: '1', id: '1',
role: '百达翡丽', role: '百达翡丽',
type: '小羊皮', type: '小羊皮',
brand: 'YSL', brand: 'YSL',
...@@ -37,7 +49,7 @@ const data = [ ...@@ -37,7 +49,7 @@ const data = [
status: '0' status: '0'
}, },
{ {
key: '2', id: '2',
role: '万宝卡', role: '万宝卡',
type: '小瓜皮', type: '小瓜皮',
brand: 'MAC', brand: 'MAC',
...@@ -49,7 +61,7 @@ const data = [ ...@@ -49,7 +61,7 @@ const data = [
status: '1' status: '1'
}, },
{ {
key: '3', id: '3',
role: '小宝SOD蜜', role: '小宝SOD蜜',
type: '洗护一体', type: '洗护一体',
brand: 'AOC', brand: 'AOC',
...@@ -65,7 +77,7 @@ const data = [ ...@@ -65,7 +77,7 @@ const data = [
// 模拟请求 // 模拟请求
const fetchData = (params:any) => { const fetchData = (params:any) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const queryResult = data.find(v => v.key === params.keywords) const queryResult = data.find(v => v.id === params.keywords)
setTimeout(() => { setTimeout(() => {
resolve({ resolve({
code: 200, code: 200,
...@@ -76,8 +88,10 @@ const fetchData = (params:any) => { ...@@ -76,8 +88,10 @@ const fetchData = (params:any) => {
}) })
} }
const formActions = createFormActions();
const DirectChannel: React.FC<{}> = () => { const DirectChannel: React.FC<{}> = () => {
const ref = useRef({}) const ref = useRef<any>({})
const [selectRow, setSelectRow] = useState<Item[]>([]) // 模态框选择的行数据 const [selectRow, setSelectRow] = useState<Item[]>([]) // 模态框选择的行数据
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([]) const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
const [deleteBatchModal, setDeleteBatchModal] = useState(false) const [deleteBatchModal, setDeleteBatchModal] = useState(false)
...@@ -87,9 +101,9 @@ const DirectChannel: React.FC<{}> = () => { ...@@ -87,9 +101,9 @@ const DirectChannel: React.FC<{}> = () => {
const columns: ColumnType<any>[] = [ const columns: ColumnType<any>[] = [
{ {
title: 'ID', title: 'ID',
dataIndex: 'key', dataIndex: 'id',
align: 'center', align: 'center',
key: 'key', key: 'id',
}, },
{ {
title: '商品名称', title: '商品名称',
...@@ -174,103 +188,26 @@ const DirectChannel: React.FC<{}> = () => { ...@@ -174,103 +188,26 @@ const DirectChannel: React.FC<{}> = () => {
} }
]; ];
const search: IFormFilter[] = [ const handleBatchUp = () => {
{
type: 'Input',
value: 'keywords',
col: 4,
placeHolder: '商品ID'
},
{
type: 'Input',
value: 'name',
col: 4,
placeHolder: '商品名称'
},
{
type: 'Input',
value: 'brand',
col: 4,
placeHolder: '商品品牌'
},
{
type: 'Input',
value: 'type',
col: 4,
placeHolder: '商品品类'
},
{
type: 'RangePicker', // ... 此处应为数值型范围输入控件
value: 'price',
col: 4,
placeHolder: '商品价格'
},
{
type: 'Select',
value: 'status',
col: 4,
placeHolder: '商品状态',
statusList: [{
type: 'Select',
label:'还不错',
value:'1'
},{
type: 'Select',
label:'还可以',
value:'2'
}]
},
]
const searchBarActions: IButtonFilter[] = [
{
text: '查询',
handler: () => {
console.log('查询')
}
},
{
text: '重置',
handler: () => {
console.log('重置')
}
},
{
type: 'primary',
text: '新建',
icon: <PlusOutlined />,
handler: ()=>{
history.push('/commodity/products/addDirectChannel')
}
},
{
text: '批量删除',
handler: () => {
setDeleteBatchModal(true)
console.log('删除')
}
},
{
text: '批量上架',
handler: () => {
console.log('批量上架') console.log('批量上架')
setUpDownModal(true) setUpDownModal(true)
setIsUp(1) setIsUp(1)
} }
},
{ const handleBatchDown = () => {
text: '批量下架',
handler: () => {
console.log('批量下架') console.log('批量下架')
setUpDownModal(true) setUpDownModal(true)
setIsUp(0) setIsUp(0)
} }
},
] const handleBatchDelete = () => {
setDeleteBatchModal(true)
console.log('删除')
}
const handleSee = (record:any) => { const handleSee = (record:any) => {
console.log('see') console.log('see')
history.push(`/commodity/products/viewDirectChannel?id=${record.key}`) history.push(`/memberCenter/commodityAbility/commodity/products/viewDirectChannel?id=${record.key}`)
} }
const confirm = () => { const confirm = () => {
...@@ -310,14 +247,56 @@ const DirectChannel: React.FC<{}> = () => { ...@@ -310,14 +247,56 @@ const DirectChannel: React.FC<{}> = () => {
setUpDownModal(true) setUpDownModal(true)
} }
const handleUp = () => { const handleUpDown = () => {
console.log('ok上下架')
} }
const handleCancelUp = () => { const handleCancelUpDown = () => {
console.log('不ok上下架')
setUpDownModal(false) setUpDownModal(false)
} }
const handleMenuClick = (param) => { // param: 1.批量删除 2.批量上架 3.批量下架
console.log(param,'Click Menu')
if(param.key === '1'){
handleBatchDelete()
}else if(param.key === '2'){
handleBatchUp()
}else if(param.key === '3'){
handleBatchDown()
}
}
const menuMore = (
<Menu onClick={(param) => handleMenuClick(param)}>
<Menu.Item key="2" icon={<VerticalAlignTopOutlined />}>
批量上架
</Menu.Item>
<Menu.Item key="3" icon={<VerticalAlignBottomOutlined />}>
批量下架
</Menu.Item>
<Menu.Item key="1" icon={<DeleteOutlined />}>
批量删除
</Menu.Item>
</Menu>
)
const controllerBtns = (
<Space>
<Button
type='primary'
onClick={() => history.push('/memberCenter/commodityAbility/commodity/products/addDirectChannel')}
>
<PlusOutlined />新建
</Button>
<Dropdown overlay={menuMore} trigger={['click']}>
<Button>
更多 <DownOutlined />
</Button>
</Dropdown>
</Space>
);
return ( return (
<PageHeaderWrapper> <PageHeaderWrapper>
<Card> <Card>
...@@ -326,8 +305,32 @@ const DirectChannel: React.FC<{}> = () => { ...@@ -326,8 +305,32 @@ const DirectChannel: React.FC<{}> = () => {
currentRef={ref} currentRef={ref}
rowSelection={rowSelection} rowSelection={rowSelection}
fetchTableData={(params:any) => fetchData(params)} fetchTableData={(params:any) => fetchData(params)}
formFilters={search} tableProps={{ rowKey: "id" }}
buttonFilters={searchBarActions} controlRender={
<NiceForm
actions={formActions}
onSubmit={values =>ref.current.reload(values)}
expressionScope={{
controllerBtns,
}}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'name',
FORM_FILTER_PATH,
)
FormEffectHooks.onFieldInputChange$('brandId').subscribe(state => {
console.log(state, 'state')
})
// useAsyncInitSelect(
// ['memberType', 'roleId', 'level', 'source'],
// fetchSearchItems,
// );
}}
schema={channelSchema}
/>
}
/> />
</Card> </Card>
<Modal <Modal
...@@ -350,8 +353,8 @@ const DirectChannel: React.FC<{}> = () => { ...@@ -350,8 +353,8 @@ const DirectChannel: React.FC<{}> = () => {
<Modal <Modal
title={isUp?'批量上架':'批量下架'} title={isUp?'批量上架':'批量下架'}
visible={upDownModal} visible={upDownModal}
onOk={handleUp} onOk={handleUpDown}
onCancel={handleCancelUp} onCancel={handleCancelUpDown}
> >
<h1>批量上下架</h1> <h1>批量上下架</h1>
</Modal> </Modal>
......
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
export const channelSchema: ISchema = {
type: 'object',
properties: {
mageLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
topLayout: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
},
properties: {
ctl: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{controllerBtns}}',
},
},
name: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '商品名称',
},
},
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
},
colStyle: {
marginLeft: 20,
},
},
properties: {
id: {
type: 'string',
'x-component-props': {
placeholder: '商品ID'
},
},
brandId: {
type: 'string',
'x-component': 'CustomInputSearch',
'x-component-props': {
placeholder: '商品品牌',
showSearch: true,
showArrow: true,
defaultActiveFirstOption: false,
filterOption: false,
notFoundContent: null,
style: { width: '174px', lineHeight: '32px' },
value: null,
},
},
customerCategoryId: {
type: 'string',
enum: [],
'x-component-props': {
placeholder: '商品品类',
},
},
status: {
type: 'string',
enum: [],
'x-component-props': {
placeholder: '商品状态'
},
},
price: {
type: 'string',
'x-component-props': {
placeholder: '商品价格'
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
\ No newline at end of file
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const'; import { FORM_FILTER_PATH } from '@/formSchema/const';
import { UPLOAD_TYPE } from '@/constants'
export const importSchema: ISchema = { export const importSchema: ISchema = {
type: 'object', type: 'object',
...@@ -137,7 +138,7 @@ const getCompnentValue = (elements: any) => { ...@@ -137,7 +138,7 @@ const getCompnentValue = (elements: any) => {
: { : {
listType: 'card', listType: 'card',
action: '/api/file/file/upload', action: '/api/file/file/upload',
data: { fileType: 2 }, data: { fileType: UPLOAD_TYPE },
fileList: [], fileList: [],
onChange: file => console.log(file), onChange: file => console.log(file),
}; };
......
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const'; import { FORM_FILTER_PATH } from '@/formSchema/const';
import { UPLOAD_TYPE } from '@/constants'
export const maintianSchema: ISchema = { export const maintianSchema: ISchema = {
type: 'object', type: 'object',
...@@ -130,7 +131,7 @@ const getCompnentValue = (elements: any) => { ...@@ -130,7 +131,7 @@ const getCompnentValue = (elements: any) => {
: { : {
listType: 'card', listType: 'card',
action: '/api/file/file/upload', action: '/api/file/file/upload',
data: { fileType: 2 }, data: { fileType: UPLOAD_TYPE },
fileList: [], fileList: [],
onChange: file => console.log(file), onChange: file => console.log(file),
}; };
......
...@@ -14,6 +14,7 @@ import { ...@@ -14,6 +14,7 @@ import {
import { UploadFile, UploadChangeParam } from 'antd/lib/upload/interface'; import { UploadFile, UploadChangeParam } from 'antd/lib/upload/interface';
import ReutrnEle from '@/components/ReturnEle' import ReutrnEle from '@/components/ReturnEle'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { UPLOAD_TYPE } from '@/constants'
const { Step } = Steps; const { Step } = Steps;
...@@ -248,7 +249,7 @@ const AddBrand: React.FC<{}> = () => { ...@@ -248,7 +249,7 @@ const AddBrand: React.FC<{}> = () => {
action="/api/file/file/upload" action="/api/file/file/upload"
beforeUpload={beforeLogoUpload} beforeUpload={beforeLogoUpload}
onChange={handleUploadLogoChange} onChange={handleUploadLogoChange}
data={{fileType:2}} data={{ fileType: UPLOAD_TYPE }}
> >
{logoUrl ? <img src={logoUrl} alt="avatar" style={{ width: '100%' }} /> : uploadLogoButton} {logoUrl ? <img src={logoUrl} alt="avatar" style={{ width: '100%' }} /> : uploadLogoButton}
</Upload> </Upload>
...@@ -274,7 +275,7 @@ const AddBrand: React.FC<{}> = () => { ...@@ -274,7 +275,7 @@ const AddBrand: React.FC<{}> = () => {
fileList={fileList} fileList={fileList}
beforeUpload={beforeUpload} beforeUpload={beforeUpload}
onChange={handleChange} onChange={handleChange}
data={{fileType:2}} data={{ fileType: UPLOAD_TYPE }}
showUploadList={{ showPreviewIcon: false }} showUploadList={{ showPreviewIcon: false }}
> >
{fileList.length >= 20 ? null : uploadButton} {fileList.length >= 20 ? null : uploadButton}
......
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