Portal/rsconcept/frontend/src/dialogs/DlgCreateOperation/TabSynthesisOperation.tsx

67 lines
1.8 KiB
TypeScript
Raw Normal View History

2025-01-28 23:23:03 +03:00
import PickMultiOperation from '@/components/select/PickMultiOperation';
2024-07-21 15:17:36 +03:00
import FlexColumn from '@/components/ui/FlexColumn';
import Label from '@/components/ui/Label';
import TextArea from '@/components/ui/TextArea';
import TextInput from '@/components/ui/TextInput';
2024-07-26 21:08:31 +03:00
import { IOperationSchema, OperationID } from '@/models/oss';
2024-07-21 15:17:36 +03:00
interface TabSynthesisOperationProps {
oss: IOperationSchema;
alias: string;
onChangeAlias: (newValue: string) => void;
2024-07-21 15:17:36 +03:00
title: string;
onChangeTitle: (newValue: string) => void;
2024-07-21 15:17:36 +03:00
comment: string;
onChangeComment: (newValue: string) => void;
2024-07-26 17:30:37 +03:00
inputs: OperationID[];
2024-07-21 15:17:36 +03:00
setInputs: React.Dispatch<React.SetStateAction<OperationID[]>>;
}
function TabSynthesisOperation({
oss,
alias,
onChangeAlias,
2024-07-21 15:17:36 +03:00
title,
onChangeTitle,
2024-07-21 15:17:36 +03:00
comment,
onChangeComment,
2024-07-26 17:30:37 +03:00
inputs,
2024-07-21 15:17:36 +03:00
setInputs
}: TabSynthesisOperationProps) {
return (
2024-12-12 13:17:24 +03:00
<div className='cc-fade-in cc-column'>
2024-07-21 15:17:36 +03:00
<TextInput
id='operation_title'
label='Полное название'
value={title}
onChange={event => onChangeTitle(event.target.value)}
2024-07-21 15:17:36 +03:00
/>
<div className='flex gap-6'>
<TextInput
id='operation_alias'
label='Сокращение'
2024-08-22 23:23:26 +03:00
className='w-[16rem]'
2024-07-21 15:17:36 +03:00
value={alias}
onChange={event => onChangeAlias(event.target.value)}
2024-07-21 15:17:36 +03:00
/>
<TextArea
id='operation_comment'
label='Описание'
noResize
rows={3}
value={comment}
onChange={event => onChangeComment(event.target.value)}
2024-07-21 15:17:36 +03:00
/>
</div>
2024-07-26 21:08:31 +03:00
<FlexColumn>
<Label text={`Выбор аргументов: [ ${inputs.length} ]`} />
<PickMultiOperation items={oss.items} selected={inputs} setSelected={setInputs} rows={6} />
</FlexColumn>
2024-12-12 13:17:24 +03:00
</div>
2024-07-21 15:17:36 +03:00
);
}
export default TabSynthesisOperation;