<template>
    <div>
        <Card
            :padding="0"
            dis-hover
            :bordered="false"
            style="background: #fafcff; padding: 14px 16px 14px 16px"
        >
            <div ref="toolbar" style="padding-bottom: 14px">
                <BillListPanelQueryBar
                    ref="BillListPanelQueryBarVM"
                    :config="myConfig.queryConfig"
                    :dictData="dictData"
                    :moduleMethod="moduleMethod"
                    @conditionAction="conditionAction"
                    @doAction="doAction"
                ></BillListPanelQueryBar>
            </div>
            <Card
                class="billquerygrid"
                :padding="0"
                :bordered="false"
                dis-hover
            >
                <Dropdown
                    trigger="custom"
                    :visible="colsetFlag"
                    style="
                        position: absolute;
                        z-index: 99;
                        right: 15px;
                        top: 1px;
                        padding: 7.5px;
                        background-color: #f5f7fa;
                    "
                    placement="bottom-end"
                    :transfer="transferFlag"
                    @on-clickoutside="closeColset"
                >
                    <Tooltip placement="top">
                        <template #content>
                            <div>
                                <span style="font-size: 12px"> 表头设计 </span>
                            </div>
                        </template>
                        <p style="cursor: pointer" @click.stop="openColSet">
                            <Icon
                                custom="iconfont icon-custom-colset"
                                style="margin-top: 4px"
                                size="16"
                                color="#515a6e"
                            />
                        </p>
                    </Tooltip>
                    <template #list>
                        <DropdownMenu>
                            <GridColSet
                                ref="gridcol"
                                :config="myConfig.gridConfig"
                                @doAction="doAction"
                            />
                        </DropdownMenu>
                    </template>
                </Dropdown>
                <BillListPanelTable
                    v-if="reset"
                    ref="grid"
                    :config="changeGridConfig"
                    :dictData="dictData"
                    @dbclick="dbclick"
                >
                    <!-- 组件原始slot透传 -->
                    <template v-for="(_, name) in $slots" #[name]="slotData">
                        <slot :name="name" v-bind="slotData || {}"></slot>
                    </template>
                    <!-- ============================ -->
                </BillListPanelTable>
            </Card>
        </Card>
    </div>
</template>
<script>
import billquerygrid from "../billquerygrid.vue";
import BillListPanelTable from "./BillListPanelTable.vue";
// import BillListPanelQueryBar from "./BillListPanelQueryBar.vue";
import BillListPanelQueryBar from "../RewriteListdetails/BillListPanelV3QueryBar.vue";

export default {
    name: "BillListPanel",
    extends: billquerygrid,
    components: { BillListPanelTable, BillListPanelQueryBar },
    data() {
        return {
            billListPanelSearchParams: {},
        };
    },
    computed: {},
    methods: {
        clearSearchParams() {
            this.$refs.BillListPanelQueryBarVM.clearSearchParams();
        },
        /**
         * 列表覆写点
         * para 原始查询条件
         * flag 是否是刷新
         */
        refurbish(para, flag = "base") {
            if (!para) {
                para = {};
                if (flag === "backData") {
                    para = this.billListPanelSearchParams;
                }
            }
            this.billListPanelSearchParams = para;
            this.$refs.grid.clearSearchBeforeSearchParam();
            this.$refs.grid.setSearchBeforeSearchParam(para);
            this.$refs.grid.refurbish();
        },
    },
    mounted() {
        // console.log("我继承覆写了1111");
    },
    created() {
        if (this.myConfig.gridConfig.searchFormList) {
            this.myConfig.queryConfig.searchFormList = this.$Method.copy(
                this.myConfig.gridConfig.searchFormList
            );
        }
    },
};
</script>

<style lang="scss" scoped></style>
