<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>
    </el-form-item>
  </ConfigTemplate>
</template>
