<template>
  <Card v-bind="$attrs" :bodyStyle="{ 'padding': 0, 'overflow': 'hidden', }">
    <!-- <template #extra v-if="title !== '更多内容'">
      <a-button type="link" size="small" @click="more">更多</a-button>
    </template> -->
    <template #title>
      <div class="title">
        <span class="title-hd">{{ props.title }}</span>
        <span class="title-hd title-move" @click="more">更多</span>
      </div>
    </template>
      <VScroll :itemHeight="41" :items="dynamicInfoItems" :height="700">
        <template #default="{ item }">
          <a-row @click="toPage(item.wrdkid)" class="listBox">
            <a-col :span="2" class="listItem">
              <span class="listRadio"></span>
            </a-col>
            <a-col :span="9" class="listItem listBody" :title="item.wrdkmc">{{ item.wrdkmc }}</a-col>
            <a-col :span="4" class="listItem" :title="item.scjdmc">{{ item.scjdmc }}</a-col>
            <a-col :span="3" class="listItem" :title="item.tbjdmc">{{ item.tbjdmc }}</a-col>
            <a-col :span="6" class="listItem listTime" :title="item.createTsamp">{{ item.createTsamp ? item.createTsamp :
              '暂无时间'
            }}</a-col>
          </a-row>
        </template>
      </VScroll>
  </Card>
</template>
<script lang="ts" setup>
import { defineProps, defineEmits, ref } from 'vue';
import { Card } from 'ant-design-vue';
import { VScroll } from '/@/components/VirtualScroll/index';
import { useRouter } from 'vue-router';
import titleBg from '/@/assets/images/title_bg.png';

let router = useRouter();

const emit = defineEmits(['moreClck'])
const props = defineProps({
  title: {
    type: String,
    default: ''
  },
  urls: {
    type: String,
    default: ''
  },
  dynamicInfoItems: {
    type: Object,
    default: () => { }
  },
})
function more() {
  emit('moreClck', props.urls)
}
function toPage(val) {
  // 增加传参id 跳转评审页面打开新窗口
  // const url = router.resolve({
  //   path: `/directory/mlzk/land/modules/Plans`,
  //   query:{
  //     id:val,
  //     scjdbm:'S2'
  //   }
  // })
  // window.open(url.href, '_blank')
}
</script>
<style lang="less" scoped>
/deep/.ant-card-head {
  padding: 0;
}

/deep/ .ant-card-head-title {
  padding: 0
}

.title {
  width: 100%;
  height: 60px;
  background: rgba(255, 255, 255, .5);
  background: url('/@/assets/images/title_bg.png') no-repeat;

  .title-hd {
    position: absolute;
    left: 30px;
    top: 15px;
    font-size: 18px;
    font-weight: bold;
    color: #FFFFFF;
  }

  .title-move {
    margin-left: 80%;
    color: #0f91ed;
    cursor: pointer;
  }
}

.listBox:nth-child(2) {
  background: rgba(232, 232, 232, .27);
}

.listBox:hover {
  background: rgba(232, 232, 232, .27);
}

.listItem {
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: #272727;
  cursor: pointer;
  padding: 10px 0;
}

.listRadio {
  display: inline-block;
  background-color: #1CA4FF;
  border-radius: 50%;
  width: 8px;
  height: 8px;
}

.listBody {
  text-align: left;
}

.listTime {
  color: #999999;
}
</style>
