<script setup lang="ts">
defineProps<{ data: any }>()

const triggerType: any = {
  '0': '单次触发',
  '1': '重复触发',
  '2': '立即触发'
}

const dateType: any = {
  '0': '天',
  '1': '周',
  '2': '月'
}
</script>

<template>
  <div class="answer">
    <el-form-item label="触发类型" style="margin-bottom: 0">
      {{ triggerType[data.trigger_type] }}
    </el-form-item>
    <el-form-item label="触发时间" v-if="data.trigger_type !== '2'">
      <template v-if="data.trigger_type === '0'">
        {{ data.trigger_time }}
      </template>
      <template v-if="data.trigger_type === '1'">
        每 {{ data.repeat_trigger.num }}
        {{ dateType[data.repeat_trigger.date_unit] }}
        的 {{ data.repeat_trigger.time }} 触发
      </template>
    </el-form-item>
  </div>
</template>
<style>
.answer {
  margin-left: 30px;
}
</style>
