<script lang="ts" setup>
/**
 * @Name: freq-setting.vue
 * @Description: 自动化-广告活动-频率设置
 * @Author: Cheney
 */

import { ref } from 'vue';
import { WeekMap } from './enum';

interface Props {
  rule: AutoRule;
  disabled?: boolean;
}

const props = defineProps<Props>();

// 初始化 rule.weekdays 为全选的状态
props.rule.weekdays = [0, 1, 2, 3, 4, 5, 6];

</script>

<template>
  <div class="asj-h3">
    <span class="custom-title-icon"></span>
    频率设置
  </div>
  <el-checkbox-group v-model="rule.weekdays" :disabled="disabled">
    <el-checkbox v-for="i in [1, 2, 3, 4, 5, 6, 0]" :label="i" :key="i">{{ WeekMap[i] }}</el-checkbox>
  </el-checkbox-group>
</template>

<style scoped>
.custom-title-icon {
  padding-right: 10px;
}

.custom-title-icon:before {
  content: '';
  width: 4px;
  height: 15px;
  background: #3569d6;
  position: absolute;
  transform: translateY(25%);
}
</style>
