<template>
  <toolbar-container :fields="fields" v-on="$listeners" />
</template>

<script>
import TYPE from '@/const/type';

export default {
  name: 'InfoManagementToolbar',

  data() {
    return {
      fields: [
        {
          type: 'text',
          name: 'title',
          label: '标题'
        },
        {
          type: 'dateArray',
          name: 'date',
          label: '发布时间',
          apiName: ['startTime', 'endTime']
        },
        {
          type: 'select',
          name: 'status',
          label: '显示/隐藏',
          options: TYPE,
          format: val => (val !== null && val !== '' ? !!val : null),
          defaultValue: 1
        }
      ]
    };
  }
};
</script>

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