更新新增key根据白名单状态设置状态

This commit is contained in:
姜棚 2022-01-24 17:48:29 +08:00
parent 5795992c2a
commit 7497c203f1
8 changed files with 37 additions and 30 deletions

View File

@ -1381,7 +1381,7 @@ export default class acclist extends React.Component{
</Drawer> </Drawer>
<Drawer <Drawer
className="draw" className="draw"
width={"80%"} width={"86%"}
title={"新建商品"} title={"新建商品"}
footer={ footer={
<div style={{ textAlign: 'center' }}> <div style={{ textAlign: 'center' }}>

View File

@ -303,7 +303,7 @@ export default class commoditylist extends React.Component{
</TabPage> </TabPage>
<Drawer <Drawer
className="draw" className="draw"
width={"60%"} width={"86%"}
maskClosable = {false} maskClosable = {false}
title={"新建商品"} title={"新建商品"}
footer={ footer={

View File

@ -166,7 +166,7 @@ componentDidMount() {
show_url:req.show_url[0], show_url:req.show_url[0],
describe_url: defaultPic , describe_url: defaultPic ,
map_product_name:req.map_product_name, map_product_name:req.map_product_name,
detail_url:req.detail_url detail_url:req.detail_url[0]
} }
let sel_item = this.state.productOption.find((o)=>{ let sel_item = this.state.productOption.find((o)=>{
@ -253,8 +253,6 @@ componentDidMount() {
this.setState({cur_product:e}) this.setState({cur_product:e})
let cur_product = this.state.products.find((item)=>{return item.id == e.key}) let cur_product = this.state.products.find((item)=>{return item.id == e.key})
let picItem = window.goods.find((item)=>{return item.id == cur_product.product_category_id}) let picItem = window.goods.find((item)=>{return item.id == cur_product.product_category_id})
console.log(cur_product)
console.log(picItem)
let model2 = { let model2 = {
id:cur_product.id, id:cur_product.id,
type:cur_product.type, type:cur_product.type,
@ -429,6 +427,14 @@ componentDidMount() {
{ {
let path = "" let path = ""
let formdata= new FormData(); let formdata= new FormData();
if(files[i].file.size > 1024 * 1024 * 2)
{
Notify.error(`图片大小不能超过2M`);
console.log(77777)
return;
}
formdata.append("file",files[i].file) formdata.append("file",files[i].file)
formdata.append("path","common_image") formdata.append("path","common_image")
@ -626,9 +632,10 @@ componentDidMount() {
this.state.loadshow? <FormItem id="show_url" prop="show_url" labelname="商品Logo"> this.state.loadshow? <FormItem id="show_url" prop="show_url" labelname="商品Logo">
<ImageUpload <ImageUpload
className="zent-image-upload-demo" className="zent-image-upload-demo"
maxSize={5 * 1024 * 1024} maxSize={2 * 1024 * 1024}
tips="建议尺寸 30*30图片不超过 20KB" tips="图片不超过 2M"
maxAmount={1} maxAmount={1}
onChange={(e)=>{this.onUploadChange(e)}} onChange={(e)=>{this.onUploadChange(e)}}
onUpload={this.onUpload} onUpload={this.onUpload}
fileList={this.state.model.show_url ? [{'src':this.state.model.show_url}] : null} fileList={this.state.model.show_url ? [{'src':this.state.model.show_url}] : null}
@ -638,11 +645,11 @@ componentDidMount() {
{ {
this.state.loadshow? <FormItem prop="describe_url" labelname="商品图" id="describe_url" required={false}> this.state.loadshow? <FormItem prop="describe_url" labelname="商品图" id="describe_url" >
<ImageUpload <ImageUpload
className="zent-image-upload-demo" className="zent-image-upload-demo"
maxSize={5 * 1024 * 1024} maxSize={2 * 1024 * 1024}
tips="建议尺寸 30*30图片不超过 20KB" tips="图片不超过 2M"
maxAmount={9} maxAmount={9}
sortable sortable
defaultFileList={this.state.model.describe_url } defaultFileList={this.state.model.describe_url }
@ -654,8 +661,8 @@ componentDidMount() {
this.state.loadshow? <FormItem prop="detail_url" labelname="商品详情" id="detail_url" required={false}> this.state.loadshow? <FormItem prop="detail_url" labelname="商品详情" id="detail_url" required={false}>
<ImageUpload <ImageUpload
className="zent-image-upload-demo" className="zent-image-upload-demo"
maxSize={5 * 1024 * 1024} maxSize={2 * 1024 * 1024}
tips="建议尺寸 30*30图片不超过 20KB" tips="图片不超过 2M"
maxAmount={1} maxAmount={1}
fileList={this.state.model.detail_url ? [{'src':this.state.model.detail_url}] : null} fileList={this.state.model.detail_url ? [{'src':this.state.model.detail_url}] : null}
onChange={(e)=>{this.onUploadChange2(e)}} onChange={(e)=>{this.onUploadChange2(e)}}

View File

@ -987,7 +987,7 @@ export default class exchangedit extends React.Component{
</div> </div>
<Drawer <Drawer
className="draw" className="draw"
width={"80%"} width={"86%"}
title={this.state.product_title} title={this.state.product_title}
footer={ footer={
<div style={{ textAlign: 'center' }}> <div style={{ textAlign: 'center' }}>

View File

@ -527,19 +527,19 @@ export default class adduserinfo extends React.Component{
<FormItem id="show_url" prop="show_url" labelname="商品Logo"> <FormItem id="show_url" prop="show_url" labelname="商品Logo">
<ImageUpload <ImageUpload
className="zent-image-upload-demo" className="zent-image-upload-demo"
maxSize={5 * 1024 * 1024} maxSize={2 * 1024 * 1024}
tips="建议尺寸 30*30图片不超过 20KB" tips="图片不超过 2M"
maxAmount={1} maxAmount={1}
onChange={(e)=>{this.onUploadChange(e)}} onChange={(e)=>{this.onUploadChange(e)}}
fileList={this.state.model.show_url ? [{'src':this.state.model.show_url}] : null} fileList={this.state.model.show_url ? [{'src':this.state.model.show_url}] : null}
value={this.state.model.show_url} value={this.state.model.show_url}
/> />
</FormItem> </FormItem>
<FormItem prop="describe_url" labelname="商品图" id="describe_url" required={false}> <FormItem prop="describe_url" labelname="商品图" id="describe_url" >
<ImageUpload <ImageUpload
className="zent-image-upload-demo" className="zent-image-upload-demo"
maxSize={5 * 1024 * 1024} maxSize={2 * 1024 * 1024}
tips="建议尺寸 30*30图片不超过 20KB" tips="图片不超过 2M"
maxAmount={9} maxAmount={9}
sortable sortable
defaultFileList={this.state.model.describe_url } defaultFileList={this.state.model.describe_url }
@ -553,7 +553,7 @@ export default class adduserinfo extends React.Component{
<ImageUpload <ImageUpload
className="zent-image-upload-demo" className="zent-image-upload-demo"
maxSize={5 * 1024 * 1024} maxSize={5 * 1024 * 1024}
tips="建议尺寸 30*30图片不超过 20KB" tips="图片不超过 2M"
maxAmount={1} maxAmount={1}
fileList={this.state.model.detail_url ? [{'src':this.state.model.detail_url}] : null} fileList={this.state.model.detail_url ? [{'src':this.state.model.detail_url}] : null}
onUpload={this.onUpload} onUpload={this.onUpload}

View File

@ -1381,7 +1381,7 @@ export default class acclist extends React.Component{
<Drawer <Drawer
className="draw" className="draw"
width={"80%"} width={"86%"}
title={this.state.product_title} title={this.state.product_title}
footer={ footer={
<div style={{ textAlign: 'center' }}> <div style={{ textAlign: 'center' }}>

View File

@ -306,19 +306,19 @@ export default class adduserinfo extends React.Component{
<FormItem id="show_url" prop="show_url" labelname="商品Logo"> <FormItem id="show_url" prop="show_url" labelname="商品Logo">
<ImageUpload <ImageUpload
className="zent-image-upload-demo" className="zent-image-upload-demo"
maxSize={5 * 1024 * 1024} maxSize={2 * 1024 * 1024}
tips="建议尺寸 30*30图片不超过 20KB" tips="图片不超过 2M"
maxAmount={1} maxAmount={1}
onChange={(e)=>{this.onUploadChange(e)}} onChange={(e)=>{this.onUploadChange(e)}}
onUpload={this.onUpload} onUpload={this.onUpload}
value={this.state.model.show_url} value={this.state.model.show_url}
/> />
</FormItem> </FormItem>
<FormItem prop="describe_url" labelname="商品图" id="describe_url" required={false} > <FormItem prop="describe_url" labelname="商品图" id="describe_url" >
<ImageUpload <ImageUpload
className="zent-image-upload-demo" className="zent-image-upload-demo"
maxSize={5 * 1024* 1024} maxSize={2 * 1024* 1024}
tips="建议尺寸 30*30图片不超过 20KB" tips="图片不超过 2M"
maxAmount={1} maxAmount={1}
onChange={(e)=>{this.onUploadChange1(e)}} onChange={(e)=>{this.onUploadChange1(e)}}
onUpload={this.onUpload} onUpload={this.onUpload}

View File

@ -592,12 +592,12 @@ export default class adduserinfo extends React.Component{
<FormItem prop="describe_url" labelname="商品图" id="describe_url" required={false} > <FormItem prop="describe_url" labelname="商品图" id="describe_url" >
<ImageUpload <ImageUpload
className="zent-image-upload-demo" className="zent-image-upload-demo"
maxSize={5 * 1024 * 1024} maxSize={2 * 1024 * 1024}
tips="建议尺寸 30*30图片不超过 20KB" tips="图片不超过 2M"
maxAmount={9} maxAmount={9}
onChange={(e)=>{this.onUploadChange3(e)}} onChange={(e)=>{this.onUploadChange3(e)}}
sortable sortable
@ -611,8 +611,8 @@ export default class adduserinfo extends React.Component{
<FormItem prop="detail_url" labelname="商品详情" id="detail_url" required={false}> <FormItem prop="detail_url" labelname="商品详情" id="detail_url" required={false}>
<ImageUpload <ImageUpload
className="zent-image-upload-demo" className="zent-image-upload-demo"
maxSize={5 * 1024 * 1024} maxSize={2 * 1024 * 1024}
tips="建议尺寸 30*30图片不超过 20KB" tips="图片不超过 2M"
maxAmount={1} maxAmount={1}
fileList={this.state.model.detail_url ? [{'src':this.state.model.detail_url}] : null} fileList={this.state.model.detail_url ? [{'src':this.state.model.detail_url}] : null}
onUpload={this.onUpload} onUpload={this.onUpload}