<template>
  <sd-webflow ref="flow" :removed-tabs="['sdRelatedDoc']">
    <template v-slot:form="{ model }">
      <table>
        <tr>
          <!-- 项目名称 -->
          <sd-form-item-td name="projectName" />
          <!-- 单位名称 -->
          <sd-form-item-td name="secUnitName" />
        </tr>
        <tr class="bklabeloverflow">
          <!-- 并购项目完成并购、基建项目和合作开发项目完成竣工财务决算满1年及以上 -->
          <sd-form-item-td name="mergerProject" @change="changeModel(model)" />
          <!-- 投资额1000万元以上 -->
          <sd-form-item-td name="investmentAmount" @change="changeModel(model)" />
        </tr>

        <tr>
          <!-- 投资方式 -->
          <sd-form-item-td name="investmentMethod"> </sd-form-item-td>
          <!-- 产业类别 -->
          <sd-form-item-td name="industryCategory"> </sd-form-item-td>
        </tr>
        <tr>
          <!-- 装机容量(万千瓦) -->
          <sd-form-item-td name="installedCapacity">
            <a-input
              v-model="model.installedCapacity"
              :disabled="model.mergerProject === '0' || model.investmentAmount === '0'"
            />
          </sd-form-item-td>
          <!-- 总投资（万元） -->
          <sd-form-item-td name="totalInvestment">
            <a-input
              v-model="model.totalInvestment"
              :disabled="model.investmentAmount === '0' || model.mergerProject === '0'"
            />
          </sd-form-item-td>
        </tr>
        <tr class="bklabeloverflow">
          <!-- 完成竣工财务决算或并购时间 -->
          <sd-form-item-td name="mergerTime">
            <a-date-picker
              v-model="model.mergerTime"
              style="width:100%;"
              :disabled="model.mergerProject === '0' || model.investmentAmount === '0'"
            />
          </sd-form-item-td>
        </tr>
        <tr>
          <!-- 编辑人员 -->
          <sd-form-item-td name="creatorName" />
          <!-- 编辑日期 -->
          <sd-form-item-td name="creationTime" />
        </tr>
        <!-- 项目名称 -->
        <!-- <tr>
          <sd-form-item-td name="projectCode" />
        </tr> -->
      </table>
    </template>
  </sd-webflow>
</template>

<script>
import components from './_import-components/xm-project-post-evaluation-form-import'

export default {
  name: 'XmProjectPostEvaluationForm',
  metaInfo: {
    title: '后评价项目信息',
  },
  components,
  data() {
    return {}
  },
  methods: {
    changeModel(model) {
      const mergerProjectValue = model.mergerProject
      const investmentAmountValue = model.investmentAmount
      if (mergerProjectValue === '0' || investmentAmountValue === '0') {
        model.investmentMethod = undefined
        model.industryCategory = undefined
        model.installedCapacity = undefined
        model.totalInvestment = undefined
        model.mergerTime = undefined
      }
    },
  },
}
</script>

<style module lang="scss">
@use '@/common/design' as *;
$carousel-title: 64px;
.syslt > td {
  border-top: none !important;
}
.prebtn {
  top: 42px;
}
.preivewbox {
  width: 100%;
  height: 300px;
  overflow: hidden;
  text-align: center;
  :global(.previewimg) {
    height: 100%;
  }
  .slider-title {
    // position: relative;
    bottom: $carousel-title;
    display: inline-block;
    width: 100%;
    height: $carousel-title;
    padding: 0 100px 0 15px;
    overflow: hidden;
    font-size: $font-size-lg;
    line-height: $carousel-title;
    color: $white;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.7);
  }
}
:global(.prebtnatt) {
  top: 42px;
}
:global(.preivewboxatt) {
  width: 100%;
  height: 300px;
  overflow: hidden;
  text-align: center;
  :global(.previewimg) {
    height: 100%;
  }
  :global(.slider-titleatt) {
    // position: relative;
    bottom: $carousel-title;
    display: inline-block;
    width: 100%;
    height: $carousel-title;
    padding: 0 100px 0 15px;
    overflow: hidden;
    font-size: $font-size-lg;
    line-height: $carousel-title;
    color: $white;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.7);
  }
}
</style>
