<template>
    <div class="page">
        <LayoutTable :data="tableData" notAdd notDel :config="tableConfig">
                    </LayoutTable>


        <drawer-show ref="drawerform" @ok="getData" />
    </div>
</template>

<script>
    /** 表单弹出框模式需引入 */

    import drawerShow from "./drawershow";
    import table from "@/assets/mixins/table";
    export default {
        name: "BizLogList",
        components: {
            drawerShow
},
        mixins: [table],
        created() {
        },
        methods: {
            /** 重写新增方法 */
            toAdd(row) {
                this.$refs.drawerform.add(row);
            },
            /** 重写编辑方法 */
            toEdit(row) {
                this.$refs.drawerform.edit(row);
            },
            /** 重写查看方法 */
            toView(row) {
                this.$refs.drawerform.view(row);
            },

        },
        data() {
            return {
                config: {
                    search: [
                        {
                            name: "traceID",
                            type: "text",
                            label: "追踪Id",
                            fuzzy: true
                        },
                        {
                            name: "appName",
                            type: "text",
                            label: "应用名称",
                            fuzzy: true
                        },
                        {
                            name: "userCode",
                            type: "text",
                            label: "用户唯一标识",
                            fuzzy: true
                        },
                        {
                            name: "deviceCode",
                            type: "text",
                            label: "设备唯一标识",
                            fuzzy: true
                        },
                        {
                            name: "eventTopic",
                            type: "text",
                            label: "记录埋点的事件主题",
                            fuzzy: true
                        },
                        {
                            name: "eventTopicName",
                            type: "text",
                            label: "记录埋点中文名称",
                            fuzzy: true
                        },
                        {
                            name: "logTime",
                            type: "date",
                            label: "日志产生时间",
                            fuzzy: true
                        },
                    ],
                    columns: [
                 
                        {type: "index",label: "序号",width: 50},

                        {label: "TraceID", prop: "traceID"},

                        {label: "应用名称", prop: "appName"},

                        {label: "用户标识", prop: "userCode"},

                        {label: "设备标识", prop: "deviceCode"},

                        {label: "事件主题", prop: "eventTopic"},

                        {label: "主题名称", prop: "eventTopicName"},

                        {label: "日志时间", prop: "logTime", formatter: this.formatterDate},
                        {
                            label: "操作",
                            width: 120,
                            formatter: row => {
                                return (
                                    <table-buttons noAdd noDel noEdit row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
                            );
                            }
                        }
                    ]
                }
            };
        }
    };
</script>