From b8e70e52661216f5e35728c426700847fea4882c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Sun, 28 Nov 2021 20:44:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.css | 11 +++++++++++ src/pages/plan/add/edit.js | 5 ++--- src/pages/plan/add/step2.js | 31 +++++++++++++++++-------------- src/pages/plan/list/list.js | 33 +++++++++++++++++++++++++++++++-- src/pages/plan/list/list.less | 2 +- 5 files changed, 62 insertions(+), 20 deletions(-) diff --git a/src/App.css b/src/App.css index dffe6588..93aeeb86 100644 --- a/src/App.css +++ b/src/App.css @@ -179,4 +179,15 @@ resize: none; .zent-btn-primary.zent-btn-disabled.zent-btn { background-color: #B8BCC2 !important; +} + +.modal{ + width: 100%; + height: 100%; + position: fixed; + left: 0; + top: 0; + background-color: rgba(0,0,0,0.5); + z-index: 9999; + } \ No newline at end of file diff --git a/src/pages/plan/add/edit.js b/src/pages/plan/add/edit.js index 9f65561b..626f4cd9 100644 --- a/src/pages/plan/add/edit.js +++ b/src/pages/plan/add/edit.js @@ -247,15 +247,14 @@ export default class add extends React.Component{ }) } - onEditInfo(){ + async onEditInfo(){ let plan_id = sessionStorage.getItem("plan_id") - if(this.refs.step1.submit(plan_id)) + if( await this.refs.step1.submit(plan_id)) { setTimeout(()=>{ this.props.history.push('/home/plan-list/'); },1500) } - console.log("编辑和") } render(){ return( diff --git a/src/pages/plan/add/step2.js b/src/pages/plan/add/step2.js index 66240105..99462fd8 100644 --- a/src/pages/plan/add/step2.js +++ b/src/pages/plan/add/step2.js @@ -49,7 +49,8 @@ export default class acclist extends React.Component{ rankoptions:[], tempdata:[], distdata:[], - oldData:null + oldData:null, + uploading:false, } } @@ -228,6 +229,15 @@ export default class acclist extends React.Component{ } + if(this.state.uploading ) + { + + Notify.error("还有图片上传中,不可提交") + return + } + + + this.setState({drawerVisible:false}) let rank = _.map(this.state.rank,(item)=>{ @@ -328,8 +338,10 @@ export default class acclist extends React.Component{ onUpload = (file, report,rowdata) => { + return new Promise((resolve, reject) => { let count = 0; + this.setState({uploading:true}) const update = () => { if (count < 100) { count += 10; @@ -343,6 +355,7 @@ export default class acclist extends React.Component{ uploadImg(formdata).then((res)=>{ handelResponse(res,(req,msg)=>{ console.log("文件上传成功") + this.setState({uploading:false}) console.log(rowdata) if (req.path) { @@ -393,11 +406,7 @@ export default class acclist extends React.Component{ if(file.length > 0 && file[0].status == "success") { - - let rowIndex =this.state.tempdata.findIndex((o)=>{return o.product_id == row.product_id}) - - - + let rowIndex =this.state.tempdata.findIndex((o)=>{return o.product_id == row.product_id}) this.state.tempdata[rowIndex].describe_url =file[0].src; this.setState({tempdata:this.state.tempdata}) @@ -406,13 +415,10 @@ export default class acclist extends React.Component{ onUploadChange2(file,row){ if(file.length > 0 && file[0].status == "success") { - - - let rowIndex =this.state.tempdata.findIndex((o)=>{return o.product_id == row.product_id}) - + let rowIndex =this.state.tempdata.findIndex((o)=>{return o.product_id == row.product_id}) + this.state.tempdata[rowIndex].describe_url =file[0].src; this.setState({tempdata:this.state.tempdata}) - } } @@ -500,9 +506,6 @@ export default class acclist extends React.Component{ batch_name:[ { type: "required", message: "请输入key批次名称"}, ] - - - } diff --git a/src/pages/plan/list/list.js b/src/pages/plan/list/list.js index 972ac181..e2f7a469 100644 --- a/src/pages/plan/list/list.js +++ b/src/pages/plan/list/list.js @@ -617,6 +617,9 @@ export default class acclist extends React.Component{ ]; return(
@@ -691,15 +694,23 @@ export default class acclist extends React.Component{
{this.onEdit(e,rowData)} } >编辑