<template>
    <div>
        <Card
            :padding="0"
            dis-hover
            :bordered="false"
            style="background: #FAFCFF; padding: 14px 16px 14px 16px"
        >
            <div ref="toolbar" style="padding-bottom: 14px">
                <!-- 列表覆写开始 -->
                <BillListPanelV3QueryBar
                    :config="myConfig.queryConfig"
                    :dictData="dictData"
                    :moduleMethod="moduleMethod"
                    @conditionAction="conditionAction"
                    @doAction="doAction"
                />
                <!-- 列表覆写结束 -->
            </div>
            <Card
                class="billquerygrid"
                :padding="0"
                :bordered="true"
                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>
                <SimpleViewGrid
                    v-if="reset"
                    ref="grid"
                    :config="changeGridConfig"
                    :dictData="dictData"
                    @dbclick="dbclick"
                />
            </Card>
        </Card>
    </div>
</template>

<script>
import billquerygrid from "../billquerygrid.vue";
import BillListPanelV3QueryBar from "./BillListPanelV3QueryBar.vue";
export default {
    name: "BillListPanelV2",
    extends: billquerygrid,
    components: { BillListPanelV3QueryBar },
    data() {
        return {
            billListPanelSearchParams: {},
        };
    },
    computed: {},
    methods: {
        /**
         * 列表覆写点
         * 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() {},
    created() {
        if (this.myConfig.gridConfig.searchFormList) {
            this.myConfig.queryConfig.searchFormList = this.$Method.copy(
                this.myConfig.gridConfig.searchFormList
            );
        }
    },
};
</script>

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