<script setup>
import { ref, watch } from "vue"

import { customInterence } from "@/api/api.js";

const props = defineProps({
  accumulativeFrequencyDlg: {
    type: Boolean,
    default: false,
  },
  accumulativeFrequencyItem: {
    type: Object,
    default: {},
  },
})
const emits=defineEmits(['update:accumulativeFrequencyDlg','update:accumulativeFrequencyItem'])

const tableData=ref([])

watch(()=>props.accumulativeFrequencyDlg,(newval)=>{
  if (newval) {
    roadShowList();
  }
})

const closeDia=()=>{
  emits("update:accumulativeFrequencyDlg", false);
  emits("update:accumulativeFrequencyItem", {});
}
const roadShowList=async()=>{
  const res = await customInterence.roadShowList({
    CompanyId: props.accumulativeFrequencyItem.CompanyId,
  });
  if (res.Ret === 200) {
    tableData.value = res.Data || [];
  }
}

</script>

<template>
  <div class="container-accumulativeFrequency">
    <el-dialog :model-value="props.accumulativeFrequencyDlg" :close-on-click-modal="false" :modal-append-to-body="false" @close="closeDia" width="800px" v-dialogDrag center>
      <template #header>
        <div style="display: flex; align-items: center">
          <span style="font-size: 16px">{{ props.accumulativeFrequencyItem.CompanyName }}-路演详情</span>
        </div>
      </template>
      <div>累计路演次数：{{ props.accumulativeFrequencyItem.RoadShowTotal }}</div>
      <div>
        <el-table :data="tableData" height="350" style="width: 100%; margin: 20px 0 30px" border>
          <el-table-column prop="RoadShowTime" label="路演日期" align="center"> </el-table-column>
          <el-table-column prop="RoadshowType" label="路演形式" align="center"> </el-table-column>
          <el-table-column prop="RoadshowPlatform" label="路演平台" align="center"> </el-table-column>
          <el-table-column prop="Researchers" label="研究员" align="center"> </el-table-column>
          <el-table-column prop="SysUserRealName" label="对接销售" align="center"> </el-table-column>
        </el-table>
      </div>
    </el-dialog>
  </div>
</template>
<style scoped lang="less"></style>
