<template>
    <ele-page flex-table>
        <ele-card flex-table>
            <div class="common-section mb-4">
                <div class="common-title mb-4">未加入回收书单全局参数设置</div>
                <not-add-recycle-booklist :settings="settings" />
            </div>
            <div class="common-section mb-4">
                <div class="common-title mb-4">已加入回收书单全局参数设置</div>
                <has-add-recycle-booklist :settings="settings" />
            </div>
        </ele-card>
    </ele-page>
</template>

<script setup>
    import { getCurrentInstance, ref } from 'vue';
    import notAddRecycleBooklist from '@/views/recycle/globalParameter/components/not-add-recycle-booklist.vue';
    import hasAddRecycleBooklist from '@/views/recycle/globalParameter/components/has-add-recycle-booklist.vue';
    import { ElMessage } from 'element-plus';

    let { proxy } = getCurrentInstance();

    //获取当前设置
    const settings = ref({});
    function getSettings() {
        proxy.$http.get('/recycle/manage/overall/get').then((res) => {
            if (res.data.code === 200) {
                settings.value = res.data.data;
            } else {
                ElMessage.error(res.data.msg);
            }
        });
    }

    getSettings();
</script>
