<template>
    <div class="table-demo">
        <bs-table v-bind="tableOptions">
            <template #searchRight>
            </template>
        </bs-table>

        <add-or-edit-drawer ref="addOrEditDrawerRef" />
    </div>
</template>

<script setup>
    import BsTable, { useBsTable } from '/@/components/BsUi/Table/index.js';
    import { onMounted, ref } from 'vue';
    import { pick } from 'lodash';
    import AddOrEditDrawer from '/@/views/table-demo/components/AddOrEditDrawer.vue';
    import { clientManageApi } from '/@/api/market-manage/index.js';

    const addOrEditDrawerRef = ref(null);

    const {
        tableOptions,
        setTablePropsValue: setValue,
        getTablePropsValue: getValue,
    } = useBsTable({
        tableOptions: {
            gridOptions: {
                loading: false,
                columns: [
                    {
                        field: 'id',
                        title: '状态',
                    },
                    {
                        field: 'name',
                        title: '流水号',
                    },
                    {
                        field: 'name1',
                        title: '项目名称',
                    },
                    {
                        field: 'name2',
                        title: '项目ID',
                    },
                    {
                        field: 'name',
                        title: '项目地址',
                    },
                    {
                        field: 'name',
                        title: '预计合同金额(万)',
                    },
                    {
                        field: 'name',
                        title: '项目类型',
                    },
                    {
                        field: 'name',
                        title: '产品类型',
                    },
                    {
                        field: 'name',
                        title: '预计开标日期',
                    },
                    {
                        field: 'name',
                        title: '操作人',
                    },
                    {
                        field: 'name',
                        title: '操作时间',
                    },
                    {
                        field: 'action',
                        title: '操作',
                    },
                ],
            },
            searchConfig: {
                enabled: true,
                fieldSpan: 4,
                fields: [
                    {
                        field: 'name',
                        label: '',
                        component: 'a-input',
                        componentProps: {
                            placeholder: '请输入项目名称',
                        },
                    },
                ],
            },
            // pagerConfig: {
            //   enabled: true,
            //   pageSize: 10,
            //   pageNum: 1,
            //   total: 100,
            //   onChange: () => {
            //     fetchTableData();
            //   },
            // },
        },
    });

    const openEditDrawer = () => {
        addOrEditDrawerRef.value.showDrawer();
    };
</script>

<style scoped lang="scss">
    .table-demo {}
</style>