<template>
  <div>
    <a-row>
      <a-col :span="24">
        <div class="tb-title">
          <span>单位科研项目及资金管理制度</span>
        </div>
      </a-col>
    </a-row>
    <a-row type="flex" class="row_center">
      <a-col :span="2" class="bg-gray">
        <div class="special-middle">
          <div>序号</div>
        </div>
      </a-col>
      <a-col :span="4" class="bg-gray">
        <div class="special-middle">
          <div >单位政策名称</div>
        </div>
      </a-col>
      <a-col :span="2" class="bg-gray">
        <div class="special-middle">
          <div >出台日期</div>
        </div>
      </a-col>
      <a-col :span="2" class="bg-gray">
        <div class="special-middle">
          <div >文号</div>
        </div>
      </a-col>
      <a-col :span="2" class="bg-gray">
        <div class="special-middle">
          <div >有效期</div>
        </div>
      </a-col>
      <a-col :span="4" class="bg-gray">
        <div class="special-middle">
          <div >主要内容</div>
        </div>
      </a-col>
      <a-col :span="8" class="bg-gray">
        <div class="special-middle">
          <div>附件</div>
        </div>
      </a-col>
    </a-row>
    <a-row v-for="(item, index) in dataList" :key="'managementRuleList'+index" type="flex" class="row_center">
      <a-col :span="2">
        <div class="special-middle">
          <div>
            {{ index + 1 }}
          </div>
        </div>
      </a-col>
      <a-col :span="4">
        <div class="special-middle">
          <div>
            {{ item.policyName }}
          </div>
        </div>
      </a-col>
      <a-col :span="2">
        <div class="special-middle">
          <div>
            {{ moment(item.releaseDate).format('YYYY-MM-DD') }}
          </div>
        </div>
      </a-col>
      <a-col :span="2">
        <div class="special-middle">
          <div>
            {{ item.documentNumber }}
          </div>
        </div>
      </a-col>
      <a-col :span="2">
        <div class="special-middle">
          <div>
            {{ moment(item.validityPeriod).format('YYYY-MM-DD') }}
          </div>
        </div>
      </a-col>
      <a-col :span="4">
        <div class="special-middle">
          <div>
            {{ item.mainContent }}
          </div>
        </div>
      </a-col>
      <a-col :span="8">
        <div class="special-middle">
          <div v-if="item.fileName" style="text-align: left;">
            <document-view :fileUrl="item.downloadUrl" :fileName="item.fileName" :imageArray="[item.downloadUrl]"></document-view>
          </div>
          <div v-else>无</div>
        </div>
      </a-col>
    </a-row>
  </div>
</template>

<script>

import documentView from '@/views/components/common/documentView'
import moment from 'moment'

export default {
  name: "managementRuleInfo",
  components: {
    documentView
  },
  props: {
    dataList: {
      type: Array,
      default: () => {
        return []
      }
    },
  },
  data () {
    return {

    };
  },
  created () {

  },
  computed: {

  },
  methods: {
    moment,
  },
};
</script>
<style scoped lang="less">
.file-description {
  display: block;
  width: 100%;
  line-height: 22px;
  padding: 3px 3px 3px 3px;
  color: red;
  white-space: normal;
  word-wrap: break-word;
  //   text-indent: 1em;
}
.inner_from {
  .ant-row-flex:last-child .ant-col {
    border-bottom: 0;
  }
  .ant-row-flex .ant-col:first-child {
    border-left: 0;
  }
  .ant-row-flex {
    border-right: 0;
  }
}
.special-middle {
  .font_s {
    margin: 0 6px;
  }
}
</style>
