<template>
  <div>
    <div class="i-layout-page-header">
      <PageHeader :title="$route.meta.title" :content="$route.meta.description" hidden-breadcrumb />
    </div>
    <Card :bordered="false" dis-hover class="ivu-mt">
      <view-table ref="table" view-code="EntityView">
        <template slot="filterCommand">
          <Button size="small" type="primary" custom-icon="fa fa-save" @click="save">{{ $t('Front_Btn_Save') }}</Button>
        </template>
      </view-table>
    </Card>
  </div>
</template>
<script>
  import mixinPage from '../../mixins/page';
  import entityViewApi from '../../api/entityView';

  export default {
    name: 'system-entityView',
    mixins: [mixinPage],
    components: {},
    data() {
      return {};
    },
    computed: {},
    created() {},
    methods: {
      save() {
        this.confirm('Front_Msg_Sure_To_Save_View_Setting', async () => {
          await entityViewApi.save(this.$refs.table.data);
          this.success('Front_Msg_Success');
          this.$refs.table.loadData();
        });
      }
    }
  };
</script>
