<template>
  <div class="titleBox">
    <PageTitle title="网上会议室" />
  </div>
  <!-- 搜索 -->
  <div ref="searchBox">
    <Search :searchArr="searchConfiger" @submit="onSearch" :key="pageData.keyCount" />
  </div>
  <!-- 表格 -->
  <div class="tabBox">
    <div class="flexcb">
      <div class="btns">
        <el-button type="primary">新增</el-button>
        <el-button type="danger">删除</el-button>
      </div>
      <Search :searchArr="searchArrMeet" @submit="onSearch" :key="pageData.keyCount + 1" class="search" />
    </div>

    <div class="list noScollLine">
      <div class="list-item" v-for="(item, index) in pageData.tableData" :key="`tableData${index}`" @onmouseover="">
        <div class="top">
          <div class="title ellipsis">{{ item.title }}</div>
          <div class="info h20 ellipsis">会商内容：{{ item.hynr }}</div>
          <div class="info h20 ellipsis">关联线索：{{ item.lxxs }}</div>
          <div class="info h20 ellipsis">涉及人员：{{ item.sjry }}</div>
          <div class="info h20 ellipsis">会商处置意见：xxxxxxx线索</div>
        </div>

        <div class="mid">
          <div class="left">
            <div class="title ellipsis">参会人员：{{ item.chry }}</div>
            <div class="desc">
              <div class="info ellipsis" v-for="(el, i) in item.cqcs" :key="i">{{ i + 1 }}.{{ el }}</div>
              <!-- <div class="info ellipsis">2.应抓捕赵某，王某XXXXXXXXX王某XXXXXXXXXXXXXXXX等人</div> -->
            </div>
          </div>
          <div class="right">
            <el-button type="primary" size="small">加入会议</el-button>
            <el-button type="primary" size="small">反馈情况</el-button>
            <el-button type="primary" size="small">处置下发</el-button>
          </div>
        </div>

        <div class="bottom">
          <el-link type="primary"><el-icon><ChatDotSquare /></el-icon>评论</el-link>
          <el-link type="primary"><el-icon><VideoPlay /></el-icon>会议回放</el-link>
          <el-link type="primary"><el-icon><Edit /></el-icon>详情</el-link>
          <el-link type="danger"><el-icon><Delete /></el-icon>删除</el-link>
        </div>
      </div>
    </div>

    <Pages
      @changeNo="changeNo"
      @changeSize="changeSize"
      :tableHeight="pageData.tableHeight"
      :pageConfiger="{
        ...pageData.pageConfiger,
        total: pageData.total
      }"
    ></Pages>
  </div>
  <!-- 详情 -->
  <DetailForm ref="detailDiloag" />
</template>

<script setup>
  import PageTitle from "@/components/aboutTable/PageTitle.vue";
  import Pages from "@/components/aboutTable/Pages.vue";
  import Search from "@/components/aboutTable/Search.vue";
  import DetailForm from "./components/detailForm.vue";
  import { qcckGet, qcckPost, qcckDelete } from "@/api/qcckApi.js";
  import { reactive, ref, onMounted, getCurrentInstance } from "vue";
  const { proxy } = getCurrentInstance();
  const detailDiloag = ref();
  const searchBox = ref(); //搜索框

  const searchConfiger = ref([
    {
      label: "会议主题",
      prop: "businessNo",
      placeholder: "请输入会议主题",
      showType: "input"
    },
    {
      label: "关联线索",
      prop: "goodsName",
      placeholder: "请选择关联线索",
      showType: "select"
    },
    {
      label: "涉及人员",
      prop: "businessNo",
      placeholder: "请输入涉及人员",
      showType: "input"
    },
    {
      label: "会议内容",
      prop: "businessNo",
      placeholder: "请输入会议内容",
      showType: "input"
    }
  ]);
  const searchArrMeet = ref([
    {
      label: "",
      prop: "title",
      placeholder: "请输入关键字",
      showType: "input"
    }
  ]);

  const queryFrom = ref({});
  const pageData = reactive({
    tableData: [
      {
        title: "林芝市XX地区发生的重大案件处理",
        hynr: "XX王某XXXXXXXXXXXXX王某XXXXXXXXXXXXXXXXXXXXXXX",
        lxxs: "XX王某XXXXXXXXXXXXX王某XXXXXXXXXXXXXXXXXXXXXXX",
        sjry: "王某、赵某、.....",
        chry: "王某、赵某、赵某赵某赵某.....",
        cqcs: ["应抓捕XXXXXXXXXXcccccccccc", "应抓捕XXXXXXXXXXcccccccccc"]
      },
      {
        title: "林芝市XX地区发生的重大案件处理",
        hynr: "XX王某XXXXXXXXXXXXX王某XXXXXXXXXXXXXXXXXXXXXXX",
        lxxs: "XX王某XXXXXXXXXXXXX王某XXXXXXXXXXXXXXXXXXXXXXX",
        sjry: "王某、赵某、.....",
        chry: "王某、赵某、赵某赵某赵某.....",
        cqcs: ["应抓捕XXXXXXXXXXcccccccccc", "应抓捕XXXXXXXXXXcccccccccc"]
      },
      {
        title: "林芝市XX地区发生的重大案件处理",
        hynr: "XX王某XXXXXXXXXXXXX王某XXXXXXXXXXXXXXXXXXXXXXX",
        lxxs: "XX王某XXXXXXXXXXXXX王某XXXXXXXXXXXXXXXXXXXXXXX",
        sjry: "王某、赵某、.....",
        chry: "王某、赵某、赵某赵某赵某.....",
        cqcs: ["应抓捕XXXXXXXXXXcccccccccc", "应抓捕XXXXXXXXXXcccccccccc"]
      },
      {
        title: "林芝市XX地区发生的重大案件处理",
        hynr: "XX王某XXXXXXXXXXXXX王某XXXXXXXXXXXXXXXXXXXXXXX",
        lxxs: "XX王某XXXXXXXXXXXXX王某XXXXXXXXXXXXXXXXXXXXXXX",
        sjry: "王某、赵某、.....",
        chry: "王某、赵某、赵某赵某赵某.....",
        cqcs: ["应抓捕XXXXXXXXXXcccccccccc", "应抓捕XXXXXXXXXXcccccccccc"]
      },
      {
        title: "林芝市XX地区发生的重大案件处理",
        hynr: "XX王某XXXXXXXXXXXXX王某XXXXXXXXXXXXXXXXXXXXXXX",
        lxxs: "XX王某XXXXXXXXXXXXX王某XXXXXXXXXXXXXXXXXXXXXXX",
        sjry: "王某、赵某、.....",
        chry: "王某、赵某、赵某赵某赵某.....",
        cqcs: ["应抓捕XXXXXXXXXXcccccccccc", "应抓捕XXXXXXXXXXcccccccccc"]
      },
      {
        title: "林芝市XX地区发生的重大案件处理",
        hynr: "XX王某XXXXXXXXXXXXX王某XXXXXXXXXXXXXXXXXXXXXXX",
        lxxs: "XX王某XXXXXXXXXXXXX王某XXXXXXXXXXXXXXXXXXXXXXX",
        sjry: "王某、赵某、.....",
        chry: "王某、赵某、赵某赵某赵某.....",
        cqcs: ["应抓捕XXXXXXXXXXcccccccccc", "应抓捕XXXXXXXXXXcccccccccc"]
      },
      {
        title: "林芝市XX地区发生的重大案件处理",
        hynr: "XX王某XXXXXXXXXXXXX王某XXXXXXXXXXXXXXXXXXXXXXX",
        lxxs: "XX王某XXXXXXXXXXXXX王某XXXXXXXXXXXXXXXXXXXXXXX",
        sjry: "王某、赵某、.....",
        chry: "王某、赵某、赵某赵某赵某.....",
        cqcs: ["应抓捕XXXXXXXXXXcccccccccc", "应抓捕XXXXXXXXXXcccccccccc"]
      },
      {
        title: "林芝市XX地区发生的重大案件处理",
        hynr: "XX王某XXXXXXXXXXXXX王某XXXXXXXXXXXXXXXXXXXXXXX",
        lxxs: "XX王某XXXXXXXXXXXXX王某XXXXXXXXXXXXXXXXXXXXXXX",
        sjry: "王某、赵某、.....",
        chry: "王某、赵某、赵某赵某赵某.....",
        cqcs: ["应抓捕XXXXXXXXXXcccccccccc", "应抓捕XXXXXXXXXXcccccccccc"]
      },
      {
        title: "林芝市XX地区发生的重大案件处理",
        hynr: "XX王某XXXXXXXXXXXXX王某XXXXXXXXXXXXXXXXXXXXXXX",
        lxxs: "XX王某XXXXXXXXXXXXX王某XXXXXXXXXXXXXXXXXXXXXXX",
        sjry: "王某、赵某、.....",
        chry: "王某、赵某、赵某赵某赵某.....",
        cqcs: ["应抓捕XXXXXXXXXXcccccccccc", "应抓捕XXXXXXXXXXcccccccccc"]
      },
      {
        title: "林芝市XX地区发生的重大案件处理",
        hynr: "XX王某XXXXXXXXXXXXX王某XXXXXXXXXXXXXXXXXXXXXXX",
        lxxs: "XX王某XXXXXXXXXXXXX王某XXXXXXXXXXXXXXXXXXXXXXX",
        sjry: "王某、赵某、.....",
        chry: "王某、赵某、赵某赵某赵某.....",
        cqcs: ["应抓捕XXXXXXXXXXcccccccccc", "应抓捕XXXXXXXXXXcccccccccc"]
      }
    ],
    keyCount: 0,
    tableConfiger: {
      rowHieght: 61,
      showSelectType: "null",
      loading: false
    },
    total: 0,
    pageConfiger: {
      pageSize: 20,
      pageCurrent: 1
    },
    controlsWidth: 120
  });

  onMounted(() => {
    getList();
    tabHeightFn();
  });

  // 搜索
  const onSearch = val => {
    queryFrom.value = { ...val };
    pageData.pageConfiger.pageCurrent = 1;
    getList();
  };

  const changeNo = val => {
    pageData.pageConfiger.pageNum = val;
    getList();
  };
  const changeSize = val => {
    pageData.pageConfiger.pageSize = val;
    getList();
  };

  // 获取列表
  const getList = val => {
    // pageData.tableConfiger.loading = true;
    let data = { ...pageData.pageConfiger, ...queryFrom.value };
    // let url = '/mosty-lzcj/tbDwMbkf/queryList';
    // qcckPost(data,url).then(res=>{
    //   pageData.tableData = res.records || [];
    //   pageData.total = res.total;
    //   pageData.tableConfiger.loading = false;
    // }).catch(()=>{ pageData.tableConfiger.loading = false; })
  };

  // 详情
  const addEdit = (type, row) => {
    // detailDiloag.value.init(type, row);
  };

  // 表格高度计算
  const tabHeightFn = () => {
    pageData.tableHeight = window.innerHeight - searchBox.value.offsetHeight - 250;
    window.onresize = function () {
      tabHeightFn();
    };
  };
</script>

<style lang="scss" scoped>
  .el-loading-mask {
    background: rgba(0, 0, 0, 0.5) !important;
  }
  .tabBox {
    .pageSearch {
      margin-bottom: 0 !important;
      .box {
        align-items: center !important;
      }
    }
    :deep(.pageSearch .box .item) {
      margin-bottom: 0 !important;
    }
  }
  .btns {
    padding: 10px 20px;
  }
  .list {
    height: calc(100% - 62px);

    gap: 10px;
    margin: 0 15px;
    overflow: auto;
    .list-item {
      display: inline-block;
      border: 1px solid #ccc;
      height: 254px;
      width: 380px;
      box-sizing: border-box;
      border-radius: 5px;
      padding: 10px;
      margin: 10px 5px;
      &:hover {
        border-color: rgb(124, 195, 253);
        background-color: rgba(190, 233, 255, 0.582);
      }
      &:hover .mid {
        border-color: rgb(124, 195, 253);
      }
      &:hover .desc {
        background-color: rgb(190, 233, 255);
      }
      .title {
        color: black;
        font-size: 14px;
        font-weight: 700;
        margin-bottom: 5px;
      }
      .info {
        color: #a5a1a1;
        font-size: 12px;

        line-height: 1.5;
      }
      .desc {
        margin-top: 5px;
        background-color: rgb(242, 242, 242);
        width: 260px;
        height: calc(100% - 25px);
        padding: 10px;
      }
      .mid {
        border: 1px dashed rgb(124, 195, 253);
        border-left: 0;
        border-right: 0;
        padding: 10px 0;
        display: flex;
        justify-content: space-between;

        .right {
          width: 80px;
          .el-button + .el-button {
            margin-left: 0;
            margin-top: 5px;
          }
        }
      }
      .bottom {
        display: flex;
        justify-content: flex-end;
        :deep(.el-link--inner) {
          display: flex;
          align-items: center;
          gap: 2px;
        }
      }
    }
  }
</style>
