Commit bbe7b26d97b322f48fdd8e0cf4739e15102a87e0
1 parent
2aeda4f5
commonbill新增修改保存复制控制;
Showing
1 changed file
with
18 additions
and
5 deletions
src/components/Common/CommonTable/index.js
| ... | ... | @@ -12179,11 +12179,15 @@ const useGetTableBtnOprSetting = props => { |
| 12179 | 12179 | if (btnType === "add") { |
| 12180 | 12180 | resultTemp.mesAdd = params => { |
| 12181 | 12181 | const { sDefault: str } = btnTableAddConfig; |
| 12182 | - const disabled = props.getBtnDisabled({ | |
| 12182 | + let disabled = props.getBtnDisabled({ | |
| 12183 | 12183 | str, |
| 12184 | 12184 | defaultValue: false, |
| 12185 | 12185 | record: {} |
| 12186 | 12186 | }); |
| 12187 | + | |
| 12188 | + if (props.parentProps.bMesBill && !str) { | |
| 12189 | + disabled = !props.enabled; | |
| 12190 | + } | |
| 12187 | 12191 | |
| 12188 | 12192 | return ( |
| 12189 | 12193 | <Button |
| ... | ... | @@ -12208,11 +12212,14 @@ const useGetTableBtnOprSetting = props => { |
| 12208 | 12212 | resultTemp.mesDel = params => { |
| 12209 | 12213 | const { record } = params; |
| 12210 | 12214 | const { sDefault: str } = btnTableDelConfig; |
| 12211 | - const disabled = props.getBtnDisabled({ | |
| 12215 | + let disabled = props.getBtnDisabled({ | |
| 12212 | 12216 | str, |
| 12213 | 12217 | defaultValue: false, |
| 12214 | 12218 | record |
| 12215 | 12219 | }); |
| 12220 | + if (props.parentProps.bMesBill && !str) { | |
| 12221 | + disabled = !props.enabled; | |
| 12222 | + } | |
| 12216 | 12223 | return ( |
| 12217 | 12224 | <Button |
| 12218 | 12225 | disabled={disabled} |
| ... | ... | @@ -12226,10 +12233,15 @@ const useGetTableBtnOprSetting = props => { |
| 12226 | 12233 | ); |
| 12227 | 12234 | }; |
| 12228 | 12235 | } else if (btnType === "copy") { |
| 12229 | - resultTemp.mesCopy = params => ( | |
| 12230 | - <Button | |
| 12236 | + resultTemp.mesCopy = params => { | |
| 12237 | + let disabled = false; | |
| 12238 | + if (props.parentProps.bMesBill) { | |
| 12239 | + disabled = !props.enabled; | |
| 12240 | + } | |
| 12241 | + return <Button | |
| 12231 | 12242 | className={styles.mesCopy} |
| 12232 | 12243 | icon={<CopyOutlined />} |
| 12244 | + disabled={disabled} | |
| 12233 | 12245 | onClick={e => { |
| 12234 | 12246 | e.stopPropagation(); |
| 12235 | 12247 | props.onMesTableLineCopy && |
| ... | ... | @@ -12239,7 +12251,8 @@ const useGetTableBtnOprSetting = props => { |
| 12239 | 12251 | }); |
| 12240 | 12252 | }} |
| 12241 | 12253 | /> |
| 12242 | - ); | |
| 12254 | + } | |
| 12255 | + ; | |
| 12243 | 12256 | } else if (btnType === "save") { |
| 12244 | 12257 | resultTemp.mesSave = () => ( |
| 12245 | 12258 | <Button | ... | ... |