<script setup lang="ts">
import ConfigTemplate from '../../ConfigTemplate.vue'
import { useMetaEvent } from '../../../composables/useAllData'

const props = defineProps<{ node: any }>()

const role = inject('role') as string

const form = reactive({
  event_id: ''
})
watchEffect(() => {
  Object.assign(form, props.node.data[role])
})

const { metaEventList } = useMetaEvent()
</script>

<template>
  <ConfigTemplate :model="form" :node="node">
    <el-form-item>
      <el-select v-model="form.event_id" placeholder="请选择触发事件">
        <el-option v-for="item in metaEventList" :key="item.id" :value="item.id" :label="item.name"></el-option>
      </el-select>
    </el-form-item>
  </ConfigTemplate>
</template>
