<template>
    <pro-table ref="proTable" :search-col="5" :columns="columns" :singleSelect=singleSelect :queryRule="queryRule"
        :showExportBut="false" :showImportBut="false" :row-key=rowKey max-height="630px">
    </pro-table>
</template>

<script setup>
import ProTable from '@/components/ProTable/index.vue';
import { getUserOptionList, list } from '@/api/userLogSearch.js';
import { reactive } from 'vue';
import moment from 'moment';
const rowKey = "trace_no"// 主键
const singleSelect = undefined // 不显示选择列
const columns = reactive([
    // {
    //     prop: 'sob_no',
    //     label: "账套",
    //     isShow: false,
    //     search: {
    //         order: 1,
    //         el: 'select-tree',
    //         key: "sob",
    //         defaultValue: ["10"],
    //         props: {
    //             searchName: "sob",
    //             type: "sob_tree",
    //         }
    //     }
    // },
    {
        prop: 'trace_no',
        label: "流水号",
        'min-width': "180",
        align: "center",
    },
    {
        prop: 'key',
        label: "用户编号",
        'min-width': "180",
        align: "center",
        search: {
            order: 1,
            el: 'input',
        }
    },
    {
        prop: 'name',
        label: "用户类型",
        'min-width': "180",
        align: "center",
    },
    {
        prop: 'role',
        label: "用户岗位",
        'min-width': "180",
        align: "center",
    },
    {
        prop: 'dept',
        label: "所属岗位机构",
        'min-width': "180",
        align: "center",
    },
    {
        prop: 'opttype',
        label: "操作类型",
        'min-width': "180",
        align: "center",
    },
    {
        prop: 'createdate',
        label: "创建日期",
        'min-width': "180",
        align: "center",
        search: {
            order: 2,
            el: 'date-picker',
            key: 'create_date',
        }

    },
    {
        prop: 'createtime',
        label: "创建时间",
        'min-width': "180",
        align: "center",
    },
])
const queryRule = async (params) => {
    params.create_date = params.create_date ? moment(params.create_date?.$d ? params.create_date.$d : params.create_date).format("YYYYMMDD") : "";
    const resp = await getUserOptionList(params)
    // const search = {
    //     page: 1,
    //     pageSize: 10,
    //     "sob": params.sob[0],
    //     "sts": "1",
    //     "stdd_no": "2"
    // }
    // await list(search)
    return resp;
}
</script>
