ЦИТК-1006 - Доработка диалога добавления/исправления
This commit is contained in:
parent
44654e135e
commit
6cc5bc5767
@ -29,8 +29,8 @@ const P8P_DIALOG_WIDTH = {
|
||||
|
||||
//Стили
|
||||
const STYLES = {
|
||||
SCROLL: { overflow: "auto", ...APP_STYLES.SCROLL },
|
||||
SCROLL_HIDE: { overflow: "hidden", display: "flex", flexDirection: "column" }
|
||||
SCROLL: display =>
|
||||
display === true ? { overflow: "auto", ...APP_STYLES.SCROLL } : { overflow: "hidden", display: "flex", flexDirection: "column" }
|
||||
};
|
||||
|
||||
//-----------------------
|
||||
@ -52,12 +52,12 @@ const P8PDialog = ({
|
||||
fullWidth,
|
||||
inputs,
|
||||
children,
|
||||
okDisabled = false,
|
||||
scrollContent = true,
|
||||
onOk,
|
||||
onCancel,
|
||||
onClose,
|
||||
onInputChange,
|
||||
okDisabled = false,
|
||||
scrollContent = true
|
||||
onInputChange
|
||||
}) => {
|
||||
//Состояние элементов ввода диалога
|
||||
const [inputsState, setInputsState] = useState([]);
|
||||
@ -94,7 +94,7 @@ const P8PDialog = ({
|
||||
return (
|
||||
<Dialog onClose={handleClose} open {...{ ...(width ? { maxWidth: width } : {}), ...(fullWidth === true ? { fullWidth: true } : {}) }}>
|
||||
<DialogTitle>{title}</DialogTitle>
|
||||
<DialogContent sx={scrollContent ? STYLES.SCROLL : STYLES.SCROLL_HIDE}>
|
||||
<DialogContent sx={STYLES.SCROLL(scrollContent)}>
|
||||
{inputsState.map((input, i) => (
|
||||
<P8PInput key={i} {...input} formValues={formValues} onChange={handleInputChange} />
|
||||
))}
|
||||
@ -121,12 +121,12 @@ P8PDialog.propTypes = {
|
||||
fullWidth: PropTypes.bool,
|
||||
inputs: PropTypes.arrayOf(PropTypes.shape(P8P_INPUT)),
|
||||
children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)]),
|
||||
okDisabled: PropTypes.bool,
|
||||
scrollContent: PropTypes.bool,
|
||||
onOk: PropTypes.func,
|
||||
onCancel: PropTypes.func,
|
||||
onClose: PropTypes.func,
|
||||
onInputChange: PropTypes.func,
|
||||
okDisabled: PropTypes.bool,
|
||||
scrollContent: PropTypes.bool
|
||||
onInputChange: PropTypes.func
|
||||
};
|
||||
|
||||
//----------------
|
||||
|
||||
@ -139,7 +139,7 @@ const TaskDialog = ({ taskRn, taskType, editable, onTasksReload, onClose }) => {
|
||||
<>
|
||||
{!task.init && docProps.loaded && (
|
||||
<P8PDialog
|
||||
title={task.nRn ? `Исправление события${task.nClosed ? " (событые аннулировано)" : ""}` : "Добавление события"}
|
||||
title={task.nRn ? `Исправление события${task.nClosed ? " [аннулировано]" : ""}` : "Добавление события"}
|
||||
fullWidth={true}
|
||||
onOk={() => (taskRn ? handleUpdateEvent(onClose).then(onTasksReload) : handleInsertTask(onClose).then(onTasksReload))}
|
||||
onClose={onClose ? onClose : null}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user