From 495b1836c9a69ff42abdf06f44aa80fc3bedfc41 Mon Sep 17 00:00:00 2001 From: yunkexin <760754045@qq.com> Date: Thu, 9 May 2024 14:59:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=85=E5=8A=9E=E5=8C=BA=E5=9F=9F=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=89=A5=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/Home.js | 70 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 63 insertions(+), 7 deletions(-) diff --git a/src/routes/Home.js b/src/routes/Home.js index 8daa7f1..a8daee9 100644 --- a/src/routes/Home.js +++ b/src/routes/Home.js @@ -177,6 +177,7 @@ class Home extends React.Component { timeNow: "上午好", workData: [], workTotal: "", + workTotalData:[], tableKey: "1", formVisible: false, noticeTitle: "", @@ -471,7 +472,7 @@ class Home extends React.Component { } }; workClick = (e) => { - this.showEditModal( + this.showTableEditModal( e.SOURCE_DATA_ID, e.SOURCE_FORMCODE, e.ID, @@ -497,6 +498,44 @@ class Home extends React.Component { return "已办"; } } + showTableEditModal= (dataId, formCode, TaskID, title, taskCode) => { + // this.props.dispatch({ + // type: "app/getDataByPost", + // url: "BI/BIController/getVersion", + // onComplete: (ret) => { + // if (ret > config.version) { + // window.localStorage.clear(); + // message.success("清除成功,即将重新加载页面", 2, () => { + // setTimeout(() => window.location.reload(true), 500); + // }); + // } + // }, + // }); + const newtmpData = { + data: { + id: dataId, + TaskID: TaskID, + onCancel: this.handleTableCancel, + taskCode: taskCode, + tableKey: this.state.tableKey, + homeReload: true, + }, + formCode: formCode, + }; + this.setState( + { + noticeTitle: title, + taskCode: taskCode, + tmpData: newtmpData, + currActivatedMenu: "", + }, + () => { + this.setState({ + formVisible: true, + }); + } + ); + }; showEditModal = (dataId, formCode, TaskID, title, taskCode) => { // this.props.dispatch({ // type: "app/getDataByPost", @@ -550,6 +589,11 @@ class Home extends React.Component { this.getBaseData(1, this.state.overDataKey); this.clearData(); }; + handleTableCancel= () => { + // 退出弹窗 + this.getBaseData(1, this.state.tableKey,5); + this.clearData(); + }; closeModal = () => { this.setState({ formVisible: false, @@ -594,10 +638,22 @@ class Home extends React.Component { onlyData: false, onComplete: (ret) => { if (ret && ret.IsSuccessful && ret.Data.newData) { - this.setState({ - workData: ret.Data.newData, - workTotal: ret.Data, - }); + if(limit == 5) { + this.setState({ + workData: ret.Data.newData, + // workTotal: ret.Data, + }); + }else{ + this.setState({ + // workData: ret.Data.newData, + workTotal: ret.Data, + workTotalData:ret.Data.newData, + }); + } + // this.setState({ + // workData: ret.Data.newData, + // workTotal: ret.Data, + // }); } }, }); @@ -1480,7 +1536,7 @@ class Home extends React.Component {