<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="CustomPage"
                @create="$refs.form.open()"
                @edit="({row, index})=>$refs.form.open(row)">
                <template slot-scope="{ row }"
                    slot="command">
                    <Button size="small"
                        title="页面组件"
                        type="info"
                        custom-icon="fa fa-window-maximize"
                        @click="$refs.componentTable.open({customPageID: row.id})"></Button>
                    <Button size="small"
                        title="页面控件"
                        type="info"
                        custom-icon="fa fa-clone"
                        @click="$refs.controlTable.open({customPageID: row.id})"></Button>
                </template>
            </view-table>
        </Card>
        <modal-form ref="form"
            view-code="CustomPageEdit"
            @on-after-save="$refs.table.loadData()" />
        <modal-table ref="componentTable"
            view-code="CustomPageComponent"
            @create="(param)=>$refs.componentForm.openDefault(param)"
            @edit="({row, index})=>$refs.componentForm.open(row)">
            <template slot-scope="{ row }"
                slot="command">
                <Button size="small"
                    title="页面控件"
                    type="info"
                    custom-icon="fa fa-clone"
                    @click="$refs.controlTable.open({customPageID: row.customPageID, customPageComponentID: row.id})"></Button>
            </template>
        </modal-table>
        <modal-form ref="componentForm"
            view-code="CustomPageComponentEdit"
            @on-after-save="$refs.componentTable.loadData()" />
        <modal-table ref="controlTable"
            view-code="CustomPageControl"
            @create="(param)=>$refs.controlForm.openDefault(param)"
            @edit="({row, index})=>$refs.controlForm.open(row)" />
        <modal-form ref="controlForm"
            view-code="CustomPageControlEdit"
            @on-after-save="$refs.controlTable.loadData()" />
    </div>
</template>
<script>
    import { mixinPage } from '/src/index.js';

    export default {
        name: 'system-page',
        mixins: [mixinPage],
        components: {},
        data() {
            return {};
        },
        computed: {},
        created() {},
        methods: {}
    };
</script>
