Newer
Older
KaiFengPC / src / views / document / dataArchive / archDetali / index.vue
@zhangdeliang zhangdeliang on 23 May 3 KB 初始化项目
<template>
  <div class="arch">
    <div class="top">
      <el-form ref="ruleForm" inline :model="form">
        <el-form-item label="文件名称:" prop="fileName">
          <el-input v-model="form.fileName" placeholder="请输入文件名称" />
        </el-form-item>
        <el-form-item label="文件标签:" prop="fileTag">
          <el-select v-model="form.fileTag" placeholder="请选择文件标签" clearable multiple collapse-tags>
            <el-option v-for="dict in document_tag" :key="dict.value" :label="dict.label" :value="dict.value" />
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="Search" @click="search"> 查询</el-button>
          <el-button icon="Refresh" @click="resetQuery">重置</el-button>
        </el-form-item>
      </el-form>
    </div>
    <el-table ref="multipleTableRef" :data="tableData" v-loading="loading" stripe :max-height="600">
      <el-table-column type="index" width="55" label="序号" />
      <el-table-column label="文件名称" prop="fileName" show-overflow-tooltip width="200" />
      <el-table-column label="所属项目" prop="projectName" show-overflow-tooltip />
      <el-table-column label="创建时间" prop="createTime" show-overflow-tooltip />
      <el-table-column label="文件标签" prop="fileTagNames" show-overflow-tooltip />
      <el-table-column label="电子档名称" prop="sysFileList" show-overflow-tooltip>
        <template #default="{ row }">
          <span>{{ row?.sysFileList?.[0]?.name || '-' }}</span>
        </template>
      </el-table-column>
      <el-table-column label="电子档大小" prop="sysFileList" show-overflow-tooltip>
        <template #default="{ row }">
          <span>{{ handleFileSize(row?.sysFileList?.[0].size) || '-' }}</span>
        </template>
      </el-table-column>
      <el-table-column label="电子档格式" prop="sysFileList" show-overflow-tooltip>
        <template #default="{ row }">
          <span>{{ row?.sysFileList?.[0]?.extension || '-' }}</span>
        </template>
      </el-table-column>
    </el-table>
    <pagination :total="total" v-model:page="pageNum" v-model:limit="pageSize" @pagination="getTableList" />
  </div>
</template>

<script setup>
import { reactive, ref, onMounted, computed, shallowRef } from 'vue';
import { usePagination } from '@/hooks';
import { handleFileSize } from '@/utils';
import { getDocumentArchiveListPage } from '@/api/document/dataArchive/archDetali';
const { proxy } = getCurrentInstance();
const { document_tag } = proxy.useDict('document_tag');
const form = reactive({
  fileName: '',
  fileTag: [],
});

const params = computed(() => {
  const fileTag = form.fileTag.join();
  return {
    ...form,
    fileTag,
  };
});

const { pageNum, pageSize, tableData, total, loading, getTableList } = usePagination(getDocumentArchiveListPage, params);

const search = () => {
  pageNum.value = 1;
  getTableList();
};

const resetQuery = () => {
  proxy.$refs.ruleForm.resetFields();
  search();
};

onMounted(() => {
  getTableList();
});
</script>

<style lang="scss" scoped>
.arch {
  padding: 20px;
  height: 90vh;
  overflow-y: hidden;
  .top {
    margin-bottom: 15px;
  }
}

:deep(.dialog) {
  .el-dialog__body {
    padding-bottom: 20px !important;
  }
  .el-dialog__footer {
    padding-top: 0 !important;
  }
}
</style>