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

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

const role = inject('role') as string

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

const { groupList } = useGroup()
</script>

<template>
  <ConfigTemplate :model="form" :node="node">
    <el-form-item>
      <el-select style="width: 100%" v-model="form.group_id" placeholder="请选择需要监控的群组">
        <el-option :key="item.id" v-for="item in groupList" :value="item.id" :label="item.name"></el-option>
      </el-select>
      <span style="font-size: 12px; text-align: right; color: #ccc"> 您选择的群组中，新加入的用户将会触发该旅程 </span>
    </el-form-item>
  </ConfigTemplate>
</template>
