<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: "select",
                            label: "应用名称"
                        },
                        {
                            name: "userCode",
                            type: "text",
                            label: "用户唯一标识",
                            fuzzy: true
                        },
                        {
                            name: "deviceCode",
                            type: "text",
                            label: "设备Id",
                            fuzzy: true
                        },
                        // {
                        //     name: "eventTopic",
                        //     type: "text",
                        //     label: "记录埋点的事件主题",
                        //     fuzzy: true
                        // },
                        // {
                        //     name: "eventTopicName",
                        //     type: "text",
                        //     label: "记录埋点中文名称",
                        //     fuzzy: true
                        // },

                      {
                        name: "createTimeStart",
                        type: "date",
                        label: "开始时间"
                      },
                      {
                        name: "createTimeEnd",
                        type: "date",
                        label: "结束时间"
                      }
                    ],
                    columns: [

                        {type: "index",label: "序号",width: 50},

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

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


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

                        {label: "设备ID", prop: "deviceCode"},

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

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

                      {label: "事件内容", prop: "msg"},

                        {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>
