Commit c79a1ccbc5603dd649e680ed50f888ee72067f5e
1 parent
1f2d6ee0
删除
Showing
3 changed files
with
17 additions
and
20 deletions
src/components/Common/CommonHooks/useCommonBase.js
| @@ -2722,6 +2722,7 @@ const useCommonBase = props => { | @@ -2722,6 +2722,7 @@ const useCommonBase = props => { | ||
| 2722 | onSuccess, | 2722 | onSuccess, |
| 2723 | nextProps | 2723 | nextProps |
| 2724 | } = params; | 2724 | } = params; |
| 2725 | + debugger | ||
| 2725 | const { sControlName = "", sInstruct } = config; | 2726 | const { sControlName = "", sInstruct } = config; |
| 2726 | const sControlLowerName = sControlName.toLowerCase(); | 2727 | const sControlLowerName = sControlName.toLowerCase(); |
| 2727 | 2728 | ||
| @@ -3283,16 +3284,9 @@ const useCommonBase = props => { | @@ -3283,16 +3284,9 @@ const useCommonBase = props => { | ||
| 3283 | } | 3284 | } |
| 3284 | }; | 3285 | }; |
| 3285 | const handleDel = (obj) => { | 3286 | const handleDel = (obj) => { |
| 3286 | - const props = { ...this.props, ...this.state }; | ||
| 3287 | - const onOkDel = handleOkDel; | ||
| 3288 | - confirm({ | ||
| 3289 | - title: obj.title, | ||
| 3290 | - onOk() { | ||
| 3291 | - onOkDel(props); | ||
| 3292 | - }, | ||
| 3293 | - onCancel() { | ||
| 3294 | - }, | ||
| 3295 | - }); | 3287 | + const props = { ...obj, ...state }; |
| 3288 | + props.onCancel() | ||
| 3289 | + // handleOkDel(props); | ||
| 3296 | }; | 3290 | }; |
| 3297 | /* 确定要删除 */ | 3291 | /* 确定要删除 */ |
| 3298 | const handleOkDel = async (props) => { | 3292 | const handleOkDel = async (props) => { |
| @@ -3346,18 +3340,22 @@ const useCommonBase = props => { | @@ -3346,18 +3340,22 @@ const useCommonBase = props => { | ||
| 3346 | const { data } = await commonServices.postValueService(token, value, url); | 3340 | const { data } = await commonServices.postValueService(token, value, url); |
| 3347 | if (data.code === 1) { | 3341 | if (data.code === 1) { |
| 3348 | /* 数据删除成功 */ | 3342 | /* 数据删除成功 */ |
| 3349 | - if (this.props.app.currentPane.refresh !== undefined) { | ||
| 3350 | - this.props.app.currentPane.refresh(); | ||
| 3351 | - } | 3343 | + |
| 3352 | if (sModelsType !== 'commonOeeBill') { | 3344 | if (sModelsType !== 'commonOeeBill') { |
| 3353 | - this.handleDelDataSuccess(props); | 3345 | + handleDelDataSuccess(props); |
| 3354 | } else { | 3346 | } else { |
| 3355 | - message.info('删除成功!'); | 3347 | + message.success("删除成功!"); |
| 3356 | } | 3348 | } |
| 3349 | + props.onCancel() | ||
| 3357 | } else { /* 失败 */ | 3350 | } else { /* 失败 */ |
| 3358 | - this.props.getServiceError(data); | 3351 | + props.getServiceError(data); |
| 3359 | } | 3352 | } |
| 3360 | }; | 3353 | }; |
| 3354 | + /* 数据删除成功跳转到新路由即pane */ | ||
| 3355 | + const handleDelDataSuccess = (props) => { | ||
| 3356 | + | ||
| 3357 | + }; | ||
| 3358 | + | ||
| 3361 | const returnProps = { | 3359 | const returnProps = { |
| 3362 | ...props, | 3360 | ...props, |
| 3363 | ...state, | 3361 | ...state, |
| @@ -3390,7 +3388,7 @@ const useCommonBase = props => { | @@ -3390,7 +3388,7 @@ const useCommonBase = props => { | ||
| 3390 | awaitPromiseReturn: awaitPromiseReturn, | 3388 | awaitPromiseReturn: awaitPromiseReturn, |
| 3391 | onSelectCommonPopup: handleSelectCommonPopup, | 3389 | onSelectCommonPopup: handleSelectCommonPopup, |
| 3392 | onDropDownBlur: handleTableBlur, | 3390 | onDropDownBlur: handleTableBlur, |
| 3393 | - onDel: handleDel | 3391 | + onDel: handleDel // 删除 |
| 3394 | }; | 3392 | }; |
| 3395 | 3393 | ||
| 3396 | // 切换页面时,加载角标数据 | 3394 | // 切换页面时,加载角标数据 |
src/components/Common/CommonTable/index.js
| @@ -4845,7 +4845,6 @@ class CommonTableRc extends React.Component { | @@ -4845,7 +4845,6 @@ class CommonTableRc extends React.Component { | ||
| 4845 | loading={bLoading} | 4845 | loading={bLoading} |
| 4846 | onClick={e => { | 4846 | onClick={e => { |
| 4847 | e.stopPropagation(); /* 阻止父级穿透 */ | 4847 | e.stopPropagation(); /* 阻止父级穿透 */ |
| 4848 | - | ||
| 4849 | const onTempTableBtnClick = nextProps => { | 4848 | const onTempTableBtnClick = nextProps => { |
| 4850 | props.onTableBtnClick && | 4849 | props.onTableBtnClick && |
| 4851 | props.onTableBtnClick({ | 4850 | props.onTableBtnClick({ |
| @@ -4868,6 +4867,7 @@ class CommonTableRc extends React.Component { | @@ -4868,6 +4867,7 @@ class CommonTableRc extends React.Component { | ||
| 4868 | [`${props.name}SelectedRowKeys`]: [rowKeyId] | 4867 | [`${props.name}SelectedRowKeys`]: [rowKeyId] |
| 4869 | }, | 4868 | }, |
| 4870 | nextProps => { | 4869 | nextProps => { |
| 4870 | + | ||
| 4871 | onTempTableBtnClick(nextProps); | 4871 | onTempTableBtnClick(nextProps); |
| 4872 | } | 4872 | } |
| 4873 | ); | 4873 | ); |
src/mes/common/commonOperationBarComponent/MesToolbar.js
| @@ -25,8 +25,7 @@ const ToolbarFun = (props) => { | @@ -25,8 +25,7 @@ const ToolbarFun = (props) => { | ||
| 25 | } else if (btnName === 'btncancel') { | 25 | } else if (btnName === 'btncancel') { |
| 26 | props.onCancel() | 26 | props.onCancel() |
| 27 | } else if (btnName === 'btndel') { | 27 | } else if (btnName === 'btndel') { |
| 28 | - console.log(props,'jijijji'); | ||
| 29 | - | 28 | + props.onDel(props) |
| 30 | } | 29 | } |
| 31 | 30 | ||
| 32 | 31 |