<template>
  <a-card :bordered="false" v-show="visible" class="card" :title="modalTitle">
    <a-row :gutter="48" slot="extra">
      <a-col :md="48" :sm="48">
        <span class="table-page-search-submitButtons" style="float: right">
          <a-button style="margin-left: 8px" type="default" @click="handleCancel()">返回</a-button>
        </span>
      </a-col>
    </a-row>
    <detail-list title="" :col="2">
      <detail-list-item term="表单代号">{{ model.code }}</detail-list-item>
      <detail-list-item term="表单名称">{{ model.name }}</detail-list-item>
      <detail-list-item term="是否复杂表单">{{ BaseTool.Object.getField(typeMap,model.type) }}</detail-list-item>
      <detail-list-item term="表单主题">{{ model.theme }}</detail-list-item>
      <detail-list-item term="表单设计数据">{{ model.designData }}</detail-list-item>
      <detail-list-item term="表单js代码">{{ model.jsCode }}</detail-list-item>
      <detail-list-item term="创建时间">{{ model.createTime }}</detail-list-item>
      <detail-list-item term="更新时间">{{ model.updateTime }}</detail-list-item>
    </detail-list>
  </a-card>
</template>

<script>
import DetailList from '@/components/tools/DetailList'
const DetailListItem = DetailList.Item

export default {
  name: 'DesignFormDetail',
  components: {
    DetailList,
    DetailListItem
  },
  data () {
    return {
      confirmLoading: false,
      mdl: {},
      modalTitle: null,
      visible: false,
      typeMap: {},
      // 下拉框map
      model: {
        'code': null,
        'name': null,
        'type': null,
        'theme': null,
        'designData': null,
        'jsCode': null,
        'createTime': null,
        'updateTime': null
      }
    }
  },
  created () {
    // 下拉框map
    this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
  },
  methods: {
    base (record) {
      this.visible = true
      this.modalTitle = '详情'
      this.model = record
    },
    handleCancel () {
      this.visible = false
      this.confirmLoading = false
    }
  }
}
</script>
