<script setup>
import { inject, defineProps, watch, ref } from "vue";

const props = defineProps({
  SaveCheckAuth: Object,
  NoticeData: Object,
  onChange: Function,
});

const columns = [
  {
    title: "選擇",
    key: "SaveCheckAuth",
    width: 150,
  },
  {
    title: "通知項目",
    key: "system_key",
  },
];

</script>

<template>
  <Table :columns="columns" :dataSource="props.NoticeData" :withStyle="false">
    <template #bodyCell="{ record, column }">
      <template v-if="column.key === 'SaveCheckAuth'">
        <Checkbox :checked="props.SaveCheckAuth.includes(record.system_value)" name="notices"
          :value="record.system_value" :onChange="onChange" />
      </template>
      <template v-else>
        <pre>{{ record[column.key] }}</pre>
      </template>
    </template>
  </Table>
</template>

<style lang="scss" scoped></style>
