<template>
  <div class="table-settings">
    <RedoSetting v-if="getSetting.redo" />
    <ColumnSetting v-if="getSetting.form" />
  </div>
</template>
<script lang="ts" setup>
import type { TableSetting } from '@/types/table'
import { PropType, computed } from 'vue'
import RedoSetting from './redoSetting.vue'
import ColumnSetting from "./columnSetting.vue"

defineOptions({
  name: 'ZtTableSetting'
})

//todo 自定义列和列表全屏 后面在做
const props = defineProps({
  setting: {
    type: Object as PropType<TableSetting>,
    default: () => ({})
  }
})

const getSetting = computed<TableSetting>(() => {
  return Object.assign(
    {
      redo: true,
      form: false,
      setting: true,
      fullScreen: false
    },
    props.setting
  ) as TableSetting
})
</script>
<style lang="scss">
.table-settings {
  display: flex;
  align-items: center;
  & > * {
    margin-right: 12px;
  }

  .zt-icon{
    cursor: pointer;
  }
}
</style>
