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 | 2722 | onSuccess, |
| 2723 | 2723 | nextProps |
| 2724 | 2724 | } = params; |
| 2725 | + debugger | |
| 2725 | 2726 | const { sControlName = "", sInstruct } = config; |
| 2726 | 2727 | const sControlLowerName = sControlName.toLowerCase(); |
| 2727 | 2728 | |
| ... | ... | @@ -3283,16 +3284,9 @@ const useCommonBase = props => { |
| 3283 | 3284 | } |
| 3284 | 3285 | }; |
| 3285 | 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 | 3292 | const handleOkDel = async (props) => { |
| ... | ... | @@ -3346,18 +3340,22 @@ const useCommonBase = props => { |
| 3346 | 3340 | const { data } = await commonServices.postValueService(token, value, url); |
| 3347 | 3341 | if (data.code === 1) { |
| 3348 | 3342 | /* 数据删除成功 */ |
| 3349 | - if (this.props.app.currentPane.refresh !== undefined) { | |
| 3350 | - this.props.app.currentPane.refresh(); | |
| 3351 | - } | |
| 3343 | + | |
| 3352 | 3344 | if (sModelsType !== 'commonOeeBill') { |
| 3353 | - this.handleDelDataSuccess(props); | |
| 3345 | + handleDelDataSuccess(props); | |
| 3354 | 3346 | } else { |
| 3355 | - message.info('删除成功!'); | |
| 3347 | + message.success("删除成功!"); | |
| 3356 | 3348 | } |
| 3349 | + props.onCancel() | |
| 3357 | 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 | 3359 | const returnProps = { |
| 3362 | 3360 | ...props, |
| 3363 | 3361 | ...state, |
| ... | ... | @@ -3390,7 +3388,7 @@ const useCommonBase = props => { |
| 3390 | 3388 | awaitPromiseReturn: awaitPromiseReturn, |
| 3391 | 3389 | onSelectCommonPopup: handleSelectCommonPopup, |
| 3392 | 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 | 4845 | loading={bLoading} |
| 4846 | 4846 | onClick={e => { |
| 4847 | 4847 | e.stopPropagation(); /* 阻止父级穿透 */ |
| 4848 | - | |
| 4849 | 4848 | const onTempTableBtnClick = nextProps => { |
| 4850 | 4849 | props.onTableBtnClick && |
| 4851 | 4850 | props.onTableBtnClick({ |
| ... | ... | @@ -4868,6 +4867,7 @@ class CommonTableRc extends React.Component { |
| 4868 | 4867 | [`${props.name}SelectedRowKeys`]: [rowKeyId] |
| 4869 | 4868 | }, |
| 4870 | 4869 | nextProps => { |
| 4870 | + | |
| 4871 | 4871 | onTempTableBtnClick(nextProps); |
| 4872 | 4872 | } |
| 4873 | 4873 | ); | ... | ... |
src/mes/common/commonOperationBarComponent/MesToolbar.js