const template = `
<template>
<!-- ${e.title} -->
    <div class="${e.code}">
        <Filter @search="updateColumn" />
        <a-table :columns="columns"
                class="srcollYTable"
                :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }"
                :pagination="false"
                :expandedRowKeys="expandedRowKeys"
                :customRow="Rowclick"
                rowKey="key"
                :data-source="tableList">
        </a-table>
        <ControlModal :selectedRow="selectedRow"
            @refresh="getData" />
        <component :is="componentId"></component>
    </div>
</template>
<script lang="ts">
import { defineComponent, initData, getTableColumns, getTableEvent, contextMenu, BtnList, _getBtnList, queryTableList } from '@/common/export/table';

export default defineComponent({
    name: '${e.code}',
    components: { Filter, contextMenu, BtnList, ControlModal },
    setup() {
        // 表头数据
        const { columns, registerColumn, updateColumn } = getTableColumns();
        // 表格操作按钮列表
        const [firstBtn] = _getBtnList('platinum_pick_query_tab', true).value;
        const btnList = ref<BtnListType[]>([]);
        const event: TableEventCB = {
            contextmenuCB: (record: QhjTradeGoodsPickup) => {
                btnList.value = handleTableList(firstBtn, record);
            },
        };
        // 表格事件
        const { expandedRowKeys, selectedRow, Rowclick, btnClick } = getTableEvent<QhjTradeGoodsPickup>(event);

        // 表格列表数据
        const { loading, tableList, queryTable } = queryTableList<QhjTradeGoodsPickup>();

        function getData() {
            // 获取列表数据
            queryTable(queryTradeGoodsPickup).then((res) => {
                tableList.value = res.map((el) => {
                    return { ...el, key: String(el.takeorderid) };
                });
            });
        }

        // 1:备货中  完成备货
        // 2:待取货(自提) 确认取货
        // 4:待收货(邮寄) 上传物流信息、确认收货
        initData(() => {
            // 获取列表数据
            getData();
            // 注册表头信息 过滤
            registerColumn('table_pcweb_qhj_pickup_query', ['reqtime', 'pickupgoodsname', 'takeorderstatus', 'goodsname']);
        });

        return {
            btnList,
            columns,
            getData,
            updateColumn,
            expandedRowKeys,
            selectedRow,
            Rowclick,
            firstBtn,
            loading,
            tableList,
            queryTable,
            btnClick,
            getPickUpStateName,
            getTakeStateName,
            handleTableList,
        };
    },
});

</script >
`;
