<script setup lang="ts">
import RuleTemplate from '../../RuleTemplate.vue'

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

function onSubmit(form: any) {
  form.expected_user_total = form.user_total
  Object.assign(props.node.data, { rule: form, rule_params: {} })
}
</script>

<template>
  <RuleTemplate :node="node" :onSubmit="onSubmit">
    <template v-slot:default="{ model }">
      <el-form label-suffix="：">
        <el-form-item label="组件名称">{{ node.data.name }}</el-form-item>
        <el-form-item label="用户总数">{{ model.user_total }}</el-form-item>
        <el-form-item label="预计选取用户总数">{{ model.user_total }}</el-form-item>
      </el-form>
      <p>定时触发条件无需设置数据生成规则</p>
    </template>
  </RuleTemplate>
</template>
