diff --git a/src/components/04_flow-management/FormFlow.vue b/src/components/04_flow-management/FormFlow.vue index 1d9d1d71..b23c4ac7 100644 --- a/src/components/04_flow-management/FormFlow.vue +++ b/src/components/04_flow-management/FormFlow.vue @@ -5,19 +5,9 @@ import { moveItemUp, moveItemDown, deleteItem } from 'src/stores/utils'; import ToggleButton from 'src/components/button/ToggleButton.vue'; import { DeleteButton } from '../button'; +import { WorkflowTemplatePayload } from 'src/stores/workflow-template/types'; -type WorkFlow = { - name: string; - step: FlowStep[]; -}; - -type FlowStep = { - responsiblePersonId: string[]; - value: string[]; - name: string; -}; - -const flowData = defineModel('flowData', { +const flowData = defineModel('flowData', { required: true, default: { name: '', @@ -78,13 +68,15 @@ defineEmits<{ outlined dense class="col" + id="input-flow-template-name" v-model="flowData.name" + hide-bottom-space :label="$t(`general.name`, { msg: $t('flow.step') })" + :rules="[(val: string) => !!val || $t('form.error.required')]" >
+ hide-bottom-space + :rules="[(val: string) => !!val || $t('form.error.required')]" + />
- + {{ $t('general.no', { msg: $t('flow.responsiblePerson') }) }} + diff --git a/src/pages/04_flow-managment/MainPage.vue b/src/pages/04_flow-managment/MainPage.vue index c90d3b8c..37b29bba 100644 --- a/src/pages/04_flow-managment/MainPage.vue +++ b/src/pages/04_flow-managment/MainPage.vue @@ -5,6 +5,7 @@ import StatCardComponent from 'src/components/StatCardComponent.vue'; import CreateButton from 'src/components/AddButton.vue'; import PaginationComponent from 'src/components/PaginationComponent.vue'; import FlowDialog from '../04_product-service/FlowDialog.vue'; +import { WorkflowTemplatePayload } from 'src/stores/workflow-template/types'; const pageState = reactive({ hideStat: false, @@ -16,6 +17,11 @@ const pageState = reactive({ addModal: false, }); +const formFlowData = ref({ + name: '', + step: [], +}); + const statusFilter = ref<'all' | 'statusACTIVE' | 'statusINACTIVE'>('all'); function triggerAddDialog() { @@ -259,5 +265,5 @@ function triggerAddDialog() {
- + diff --git a/src/pages/04_product-service/FlowDialog.vue b/src/pages/04_product-service/FlowDialog.vue index 0592ac7f..9a38d489 100644 --- a/src/pages/04_product-service/FlowDialog.vue +++ b/src/pages/04_product-service/FlowDialog.vue @@ -2,21 +2,11 @@ import DialogForm from 'src/components/DialogForm.vue'; import SideMenu from 'src/components/SideMenu.vue'; import FormFlow from 'src/components/04_flow-management/FormFlow.vue'; -import { ref } from 'vue'; - -type WorkFlow = { - name: string; - step: FlowStep[]; -}; - -type FlowStep = { - responsiblePersonId: string[]; - value: string[]; - name: string; -}; +import { WorkflowTemplatePayload } from 'src/stores/workflow-template/types'; +import { nextTick } from 'vue'; const model = defineModel({ required: true, default: false }); -const flowData = defineModel('flowStep', { +const flowData = defineModel('flowData', { required: true, default: { name: '', @@ -24,11 +14,6 @@ const flowData = defineModel('flowStep', { }, }); -const mockFlowData = ref({ - name: '', - step: [], -}); - withDefaults( defineProps<{ readonly?: boolean; @@ -36,18 +21,17 @@ withDefaults( { readonly: false }, ); -function addStep() { - mockFlowData.value.step.push({ +async function addStep() { + flowData.value.step.push({ responsiblePersonId: [''], value: [''], name: '', }); + await nextTick(); const scrollTarget = document.getElementById( - `input-flow-step-name-${mockFlowData.value.step.length - 1}`, + `input-flow-step-name-${flowData.value.step.length - 1}`, ); - console.log(`input-flow-step-name-${mockFlowData.value.step.length - 1}`); - console.log(scrollTarget); if (scrollTarget) scrollTarget.scrollIntoView({ behavior: 'instant', inline: 'center' }); } @@ -106,14 +90,14 @@ function addStep() {
- +