<template>
  <div class="from-table">
    <a-row>
      <a-col :span="24">
        <div class="tb-title">
          <span>基本信息</span>
        </div>
      </a-col>
    </a-row>
    <a-row>
      <a-col :span="4" class="bg-gray">
        项目名称
      </a-col>
      <a-col :span="8">
        {{value.projName}}
      </a-col>
      <a-col :span="4" class="bg-gray">
        项目编号
      </a-col>
      <a-col :span="8">
        {{value.projNo}}
      </a-col>
    </a-row>
    <a-row>
      <a-col :span="4" class="bg-gray">
        申报人
      </a-col>
      <a-col :span="8">
        {{value.appPersonName}}
      </a-col>
      <a-col :span="4" class="bg-gray">
        申报单位
      </a-col>
      <a-col :span="8">
        {{value.appUnitName}}
      </a-col>
    </a-row>
    <a-row>
      <a-col :span="4" class="bg-gray">
        项目起止时间
      </a-col>
      <a-col :span="20">
        {{value.startDate+'--'+value.endDate}}
      </a-col>
    </a-row>
    <a-row>
      <a-col :span="4" class="bg-gray">
        <div class="special-middle">研究工作进展情况</div>
      </a-col>
      <a-col :span="20" class="more-row">
        <div class="special-middle">{{value.workProgress}}</div>
      </a-col>
    </a-row>

    <a-row>
      <a-col :span="24">
        <div class="tb-title">
          <span>现已取得的阶段性成果</span>
        </div>
      </a-col>
    </a-row>
    <a-row>
      <a-col :span="4" class="bg-gray">
        成果名称
      </a-col>
      <a-col :span="20" class="flex-layout results-layout">
        <div v-for="(item, index) in value.results" :key="index">
          {{item.resultName}}
        </div>
      </a-col>
    </a-row>
    <a-row>
      <a-col :span="4" class="bg-gray">
        数量
      </a-col>
      <a-col :span="20" class="flex-layout results-layout">
        <div v-for="(item, index) in value.results" :key="index">
          {{item.resultCount}}
        </div>
      </a-col>
    </a-row>
    <a-row>
      <a-col :span="4" class="bg-gray">
        备注
      </a-col>
      <a-col :span="20" class="flex-layout results-layout">
        <div v-for="(item, index) in value.results" :key="index">
          {{item.remark}}
        </div>
      </a-col>
    </a-row>
    <a-row>
      <a-col :span="4" class="bg-gray">
        <div class="special-middle">其他（请做说明）</div>
      </a-col>
      <a-col :span="20" class="more-row">
        <div class="special-middle">
          {{value.otherResults}}
        </div>
      </a-col>
    </a-row>

    <a-row>
      <a-col :span="24">
        <div class="tb-title">
          <span>经费</span>
        </div>
      </a-col>
    </a-row>
    <a-row>
      <a-col :span="4" class="bg-gray">
        <div class="required">项目批准经费</div>
      </a-col>
      <a-col :span="8">
        {{value.applyMoney}}
      </a-col>
      <a-col :span="4" class="bg-gray">
        <div class="required">已使用经费</div>
      </a-col>
      <a-col :span="8">
        {{value.usingMoney}}
      </a-col>
    </a-row>
    <a-row>
      <a-col :span="4" class="bg-gray">
        <div class="required">现结余经费</div>
      </a-col>
      <a-col :span="20">
        {{value.surplusMoney}}
      </a-col>
    </a-row>
    <a-row>
      <a-col :span="4" class="bg-gray">
        <div class="required special-middle">经费具体使用情况说明</div>
      </a-col>
      <a-col :span="20" class="more-row">
        <div class="special-middle">{{value.moneyInstructions}}</div>
      </a-col>
    </a-row>
    <a-row>
      <a-col :span="24">
        <div class="tb-title">
          <span>审核记录</span>
        </div>
      </a-col>
    </a-row>
    <a-row>
      <a-col :span="24">
        <audit-list v-model="value.auditList" />
      </a-col>
    </a-row>
  </div>
</template>

<script>
import AuditList from '@/views/audit/components/auditInfo'
export default {
  components: {
    AuditList
  },
  name: "CheckInfo",
  data () {
    return {
      checkInfo: {
        id: '',
        projId: '',
        checkYear: null,
        // 工作进展
        workProgress: '',
        // 其他（请做说明）
        otherResults: '',
        // 项目批准经费
        applyMoney: 0,
        // 已使用运费
        usingMoney: 0,
        // 现结余经费
        surplusMoney: 0,
        // 经费具体使用情况说明
        moneyInstructions: '',
        checkState: null,
        projName: '',
        projNo: '',
        appPersonName: '',
        appUnitName: '',
        startDate: '',
        endDate: '',
        // 成果
        results: []
      },
    };
  },
  props: {
    value: {
      type: Object,
      default: () => {
        return [...this.checkInfo]
      }
    }
  },
  created () {
    this.load();
  },
  mounted () {
    this.tinymceSet()
  },
  methods: {
    load () {
    },
    tinymceSet () {
      tinymce.remove('#tinymce_dom')
      tinymce.init({
        selector: '#tinymce_dom',
        language: 'zh_CN',
        content_style: "img {max-width:100%;}",
        height: 800,
        inline: true,
        readonly: true,
      })
    },
  }
}
</script>

<style lang="less" scoped>
.from-table {
  border-right: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
  .ant-col {
    padding: 0 16px;
    line-height: 40px;
    min-height: 40px;
    border-left: 1px solid #f0f0f0;
    border-top: 1px solid #f0f0f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .bg-gray {
    background-color: #f8fafc;
  }
  .more-row {
    white-space: pre-wrap;
    line-height: 2;
  }
  .flex-layout {
    display: flex;
  }
  // 内容垂直居中
  .special-middle {
    position: relative;
    top: 50%;
    transform: translateY(-50%);
  }
  // 成果列表处理
  .results-layout {
    padding: 0;
    > div {
      flex: 1;
      border-right: 1px solid #f0f0f0;
      padding-left: 16px;
      &:last-child {
        border-right: 0;
      }
    }
  }
}

.tb-title {
  color: #0079fe;
  display: flex;
  text-align: center;
  height: 40px;
  &::after {
    content: "";
    flex-grow: 1;
    border-top: 1px dashed #d9d9d9;
    transform: translateY(50%);
    margin-left: 10px;
  }
}
</style>
