import { fieldModelAPI } from '@/api/main';

export default {
  data() {
    return {
      dynamicsColumns: [],
      relevance: 't_main_category'
    };
  },
  async created() {
    await this.getFieldColumns();
  },
  methods: {
    async getFieldColumns() {
      let fieldColumns = await fieldModelAPI({ relevance: this.relevance });
      this.dynamicsColumns = fieldColumns.map((item) => {
        return {
          minWidth: 120,
          prop: item.prop,
          label: item.label,
          slot: item.prop,
          align: 'center'
        };
      });
    }
  }
};
