<template>
  <GenericManager
    :uri="resource_uri"
    object_name="内容页"
    :visible_fields="['title']"
    :editable_fields="['title', 'is_platform_knowledge_base']"
    :actions="actions"
    no_details=1
    show_search=1
    />
</template>

<script>
export default {
  name: 'Articles',
  props: [],
  components: {
  },
  data: function () {
    return {
      resource_uri: "/api/v1/article/",
      actions: [
        {
          handler: this.handle_preview_page,
          name: '预览',
        },
        {
          handler: this.handle_edit_page,
          name: '设计',
          is_write: true,
        },
      ],
    };
  },
  computed: {
  },
  methods: {
    handle_preview_page: function(item) {
      window.open('/pages/article/' + item.id, '_blank');
    },
    handle_edit_page: function(item) {
      this.$router.push({ name: 'ArticleEdit', params: { id: item.id }});
    },
  },
  mounted() {
  },
}
</script>

<style scoped>
</style>

