<template>
    我是查询结果组件
    {{ resultData }}
    <pro-form label-width="120px" tabsProps="2">
        <pro-form-grid style="width: 700px" colNum="2">
            <SobSelectComponent v-model:accLvl="sobNo" :formItemProps="{ label: '账套', prop: 'levelKey' }">
            </SobSelectComponent>
            <AccLvlComponent :sobNo="sobNo" :addEndFlag="addEndFlag" v-model:accLvl="accLvl"
                :formItemProps="{ label: '科目级别', prop: 'levelKey' }">
            </AccLvlComponent>
            <pro-form-item>
                <pro-button id="queryBtn" @click="search" :icon="h(SearchOutlined)">查询</pro-button>
            </pro-form-item>
        </pro-form-grid>
    </pro-form>
    <div>sobNo: {{ sobNo }}</div>
    <div>addEndFlag: {{ addEndFlag }}</div>
    <div>accLvl: {{ accLvl }}</div>

</template>
<script setup>
import { ref, watch, h, computed, onMounted, nextTick, reactive, onBeforeUnmount, provide, defineExpose } from 'vue';
import { SearchOutlined, RedoOutlined, PlusOutlined, EditOutlined } from "@ant-design/icons-vue";

import AccLvlComponent from './AccLvlComponent.vue';
import SobSelectComponent from './SobSelectComponent.vue';

const sobNo = ref('');
const addEndFlag = ref('');
const accLvl = ref('');

function search () {
    if (sobNo.value === '') {
        sobNo.value = '10';
    } else if (sobNo.value === '10') {
        sobNo.value = '11';
    } else {
        sobNo.value = '10';
    }
}

function changSobNo (value) {
    console.log('wyq-3.接收到sobNo的值', value);
}

const resultData = ref('');
defineExpose({ getResultData });
function getResultData (queryData) {
    // 这里是获取查询结果数据的逻辑
    console.log('wyq-4.接收到查询组件传来的数据开始展示结果', queryData);
    resultData.value = queryData;
}
</script>
<style scoped></style>
