<template>
  <el-dialog
    :title="$t2('文件详情','components.fileLibrary.fileDetail')"
    :append-to-body="true"
    :modal-append-to-body="falseValue"
    :close-on-click-modal="falseValue"
    :visible.sync="showDialog"
    :modal="falseValue"
    custom-class="dialog-style list-dialog huishou"
    width="700px"
    height="400px"
    @close="dialogClose"
    v-el-drag-dialog
    v-el-dialog-center
  >
    <div id="containt">
      <div class="detail-wrap">
        <el-form ref="editForm" :model="attachmentDTO">
          <div class="d-header clearfix">
            <div class="fl">
              <i class="el-icon-info"/>
              {{ $t2('文件详情', 'components.fileLibrary.fileDetail') }}
            </div>
            <div class="fr">
            </div>
          </div>
          <baseTabs>
            <baseTabPane :label="$t2('基本信息','system.label.baseInfo')">
              <template #default>
                <table class="table-detail">
                  <tbody>
                  <tr>
                    <th>
                      {{ $t2('文件名称', 'components.fileLibrary.fileName') }}
                    </th>
                    <td colspan="3">
                      {{ attachmentDTO.fileName }}
                    </td>
                  </tr>
                  <tr>
                    <th>
                      文件地址
                    </th>
                    <td colspan="3">
                      {{ attachmentDTO.treePathName }}
                    </td>
                  </tr>
                  <tr>
                    <th>
                      {{ $t2('类型', 'components.fileLibrary.type') }}
                    </th>
                    <td>
                      {{
                        attachmentDTO.dirs ? $t2('文件夹', 'components.fileLibrary.folder') : $t2(filePrefix + '文件', 'components.fileLibrary.fileCategory', {type: filePrefix})
                      }}
                    </td>
                    <th v-if="!attachmentDTO.dirs">{{ $t2('文件大小', 'components.fileLibrary.fileSize') }}</th>
                    <td v-if="!attachmentDTO.dirs">{{ formatFileSize(attachmentDTO.fileSize) }}</td>
                  </tr>
                  <tr>
                    <th>{{ $t2('删除人', 'components.fileLibrary.deleteBy') }}</th>
                    <td>{{ attachmentDTO.createBy }}</td>
                    <th>{{ $t2('删除时间', 'components.fileLibrary.deleteDate') }}</th>
                    <td>{{ attachmentDTO.createDate }}</td>
                  </tr>
                  </tbody>
                </table>
              </template>
            </baseTabPane>
            <baseTabPane :label="$t2('文件属性','components.fileLibrary.fileAttribute')"
                         v-if="!this.attachmentDTO.dirs">
              <template #button>
              </template>
              <template #default>
                <vxe-grid
                  ref="table-m1"
                  height="224px"
                  class="vxe-tableNo"
                  :data="fileAttachAttributeDTOs"
                  v-bind="vxeOption"
                  @resizable-change="$vxeTableUtil.onColumnWitchChange"
                  @custom="$vxeTableUtil.customHandle"
                >
                </vxe-grid>
              </template>
            </baseTabPane>
          </baseTabs>
        </el-form>
      </div>
    </div>
  </el-dialog>
</template>

<script>
import mixins from './mixins/recycleBinPropertiesDialogMixins';

export default {
  mixins: [mixins]
};
</script>
