<!-- 开始节点配置 -->
<template>
  <div class="end-event">
    <a-form ref="formRef" :model="node" labelAlign="left" :disabled="data.componentDisabled" :label-col="labelCol" :wrapper-col="wrapperCol">
      <a-form-item label="节点标识">
        <a-input v-model:value="node.id" placeholder="请输入" readonly />
      </a-form-item>
    </a-form>
  </div>
</template>

<script lang="ts" setup>
  import { reactive, ref, onMounted, nextTick, unref, h, watch, defineProps } from 'vue';
  import { flowStore } from '@/store/modules/flow';
  const flowWfDataStore = flowStore();
  const node = ref({})
  const props = defineProps({
    element: Object,
    pageType:String
  })
  watch(
    () => props.element,
    (newVal, oldVal) => {
      if(newVal.type == "bpmn:EndEvent"){
        const currentNode = flowWfDataStore.getWfDataNode(newVal.id)
        if (currentNode) {
          node.value = currentNode
        } else {
          node.value = newVal
        }
      }
    }
  )
  const labelCol = { span: 7 };
  const wrapperCol = { span: 17 };
  const data=reactive({
    componentDisabled: props.pageType == 'detail' ? true : false
  })
  function getForm() {
    return node
  }
  defineExpose({
    getForm
  })
</script>

<style>
</style>