<template>
    <BasicDrawer placement="right" @register="registerDrawer" v-bind="$attrs" :title="pageTitle" width="100%"  @close="closeThisDrawer"> 
    <PageWrapper  contentFullHeight="true" contentClass="flex" style="height:100%;">
        <div style="background-color: #ececec; padding: 20px;height:100%;">
            <a-row :gutter="[16,16]">
            <a-col :span="14">
                <a-row :gutter="[16,16]">
                    <a-col :span="24">
                        <a-card title="指标详情" :bordered="true">
                            <template #extra>
                                <a-dropdown>
                                    <a class="ant-dropdown-link" @click.prevent>
                                        <MoreOutlined/>
                                    </a>
                                    <template #overlay>
                                    <a-menu>
                                        <a-menu-item>
                                        <a href="javascript:;">刷新</a>
                                        </a-menu-item>
                                    </a-menu>
                                    </template>
                                </a-dropdown>
                            </template>
                            <a-list item-layout="horizontal">
                                    <a-list-item>
                                        <a-list-item-meta>
                                        <template #title>
                                            指标编号
                                        </template>
                                        </a-list-item-meta>
                                    </a-list-item>
                                    <a-list-item>
                                        <a-list-item-meta>
                                        <template #title>
                                            指标名称
                                        </template>
                                        </a-list-item-meta>
                                    </a-list-item>
                                    <a-list-item>
                                        <a-list-item-meta>
                                        <template #title>
                                            指标说明
                                        </template>
                                        </a-list-item-meta>
                                    </a-list-item>
         
                            </a-list>
                        </a-card>
                    </a-col>
                   
                </a-row>
            </a-col>
            <a-col :span="10">
                <a-row :gutter="[16,16]">
                     <a-col :span="24">
                        <a-card title="获取到的信息" :bordered="false">
                            <template #extra><a-button type="link" @click="saveMetric()">保存</a-button></template>
                            

                        </a-card>
                    </a-col>
                </a-row>
                <a-row :gutter="[16,16]">
                     <a-col :span="24">
                        <a-card title="响应信息" :bordered="false">
                            <div style="max-height:200px; overflow-y: auto; ">
                               <p v-for="msg in saveMsgList" :key="msg"></p>
                            </div>
                        </a-card>
                    </a-col>
                </a-row>
            </a-col>
            </a-row>
        </div>
    </PageWrapper>    
    </BasicDrawer>
  </template>
  <script lang="ts" setup>
    import {ref} from 'vue';
    import {defHttp} from '/@/utils/http/axios';
    import axios from 'axios';
    import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
    import { MoreOutlined} from '@ant-design/icons-vue';
    import {testRemote} from '../WbCompanyInfo.api';

    import moment from 'moment';

    const pageTitle = ref("调查报告")

   
  
    const [registerDrawer,{closeDrawer,setDrawerProps}] = useDrawerInner(async (data) => {
     
    });
   

    async function autoCall() {

        testRemote()

       let data = new URLSearchParams()
       data.append("Filters.AppraisalSearch","60510")
      
       let url = "https://www.cmmiinstitute.com/pars?StateId=033eec20-8497-4ff0-bf7b-c48fdcd3d67d&PageNumber=1&Handler=ApplyFilters"

    //    axios.get(url).then(res => {
    //         console.log("111111111111");
    //         console.log(res);
    //         console.log("2222222222222");
           
    //         //console.log(res.data);
    //         // 将用户token保存到session中
    //         // localStorage.setItem('token', 'res.data.data.body.token');
    //         // _this.$router.push({ path: '/' });
    //     }).catch(error => {
    // alert(JSON.stringify(error))
    //         console.log(error);
    //     });

    //    axios({
    //         method: 'POST',
    //         url: url,
    //         data: data,
    //         headers:{
    //             'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
    //             'Referer':'https://www.cmmiinstitute.com/pars?StateId=033eec20-8497-4ff0-bf7b-c48fdcd3d67d&PageNumber=1&Handler=ApplyFilters',
    //             'Content-Type': 'application/x-www-form-urlencoded',
    //         }
    //     }).then(res => {
    //         console.log(res.data);
    //         // 将用户token保存到session中
    //         // localStorage.setItem('token', 'res.data.data.body.token');
    //         // _this.$router.push({ path: '/' });
    //     }).catch(error => {
    
    //         console.log(error);
    //     });


        // let res = axios.post(url, data ,{
        //     headers: {
        //     'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
        //     'Referer':'https://www.cmmiinstitute.com/pars?StateId=033eec20-8497-4ff0-bf7b-c48fdcd3d67d&PageNumber=1&Handler=ApplyFilters',
        //     'Content-Type': 'application/x-www-form-urlencoded',
        // //     }
        // });
    };


    function closeThisDrawer() {
        closeDrawer();
    }


  </script>

<style scope>
.underline-input {
  border-left:none;
  border-top:none;
  border-right:none;
  width: 100%;
}
</style>