Crunchy
2025-03-17 0a26d58a3906b9e13946c7cb46fae51a0de98920
src/views/CNAS/systemManagement/documentControl/components/FileList.vue
@@ -1,29 +1,29 @@
<template>
  <!-- 文件清单 -->
  <div class="file-list" style="height: 100%;">
  <div>
    <div class="search">
      <div class="search_thing">
        <div class="search_label">文件名称:</div>
        <div class="search_input"><el-input size="small" placeholder="请输入" clearable v-model="queryParams.name"
            @keyup.enter.native="refreshTable()"></el-input></div>
      <div>
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
          <el-form-item label="文件名称" prop="name">
            <el-input size="small" placeholder="请输入" clearable v-model="queryParams.name"
                      @keyup.enter.native="refreshTable()"></el-input>
          </el-form-item>
          <el-form-item label="文件状态" prop="state">
            <el-select v-model="queryParams.state" size="small" @change="refreshTable()">
              <el-option :label="item.label" :value="item.value" v-for="(item, index) in fileState"
                         :key="index"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="refreshTable">查 询</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="refresh">重 置</el-button>
          </el-form-item>
        </el-form>
      </div>
      <div class="search_thing">
        <div class="search_label">文件状态:</div>
        <div class="search_input">
          <el-select v-model="queryParams.state" size="small" @change="refreshTable()">
            <el-option :label="item.label" :value="item.value" v-for="(item, index) in fileState"
              :key="index"></el-option>
          </el-select>
        </div>
      </div>
      <div class="search_thing" style="padding-left: 30px;">
        <el-button size="small" @click="refresh()">重 置</el-button>
        <el-button size="small" type="primary" @click="refreshTable()">查 询</el-button>
      </div>
      <div class="btns" style="padding-left: 30px;">
      <div>
        <el-upload :action="action" :multiple="false" accept='.xls,.xlsx' :headers="uploadHeader"
          :on-change="beforeUpload" :on-error="onError" ref='upload' :on-success="handleSuccessUp"
          :show-file-list="false">
                   :on-change="beforeUpload" :on-error="onError" ref='upload' :on-success="handleSuccessUp"
                   :show-file-list="false">
          <el-button size="small" type="primary" :loading="upLoading">导入</el-button></el-upload>
      </div>
    </div>
@@ -121,10 +121,18 @@
        {
          label: "类别", prop: "type", width: "120px", dataType: "tag",
          formatData: (params) => {
            return this.fileType.find((m) => m.value == params).label;
            if (this.fileType.find((m) => m.value == params)) {
              return this.fileType.find((m) => m.value == params).label;
            } else {
              return null
            }
          },
          formatType: (params) => {
            return this.fileType.find((m) => m.value == params).type;
            if (this.fileType.find((m) => m.value == params)) {
              return this.fileType.find((m) => m.value == params).type;
            } else {
              return null
            }
          },
        },
        {
@@ -137,10 +145,18 @@
        {
          label: "文件状态", prop: "state", dataType: "tag",
          formatData: (params) => {
            return this.fileState.find((m) => m.value == params).label;
            if (this.fileState.find((m) => m.value == params)) {
              return this.fileState.find((m) => m.value == params).label;
            } else {
              return null
            }
          },
          formatType: (params) => {
            return this.fileState.find((m) => m.value == params).type;
            if (this.fileState.find((m) => m.value == params)) {
              return this.fileState.find((m) => m.value == params).type;
            } else {
              return null
            }
          },
        },
        {
@@ -369,44 +385,9 @@
</script>
<style scoped>
.title {
  height: 60px;
  line-height: 60px;
}
.search {
  background-color: #fff;
  height: 40px;
  height: 46px;
  display: flex;
  align-items: center;
  position: relative;
}
.search_thing {
  width: 350px;
  display: flex;
  align-items: center;
}
.search_label {
  width: 110px;
  font-size: 14px;
  text-align: right;
}
.search_input {
  width: calc(100% - 110px);
}
.table {
  background-color: #fff;
  height: calc(100% - 60px - 80px);
  padding: 20px;
}
.btns {
  position: absolute;
  right: 20px;
  top: 5px;
  justify-content: space-between;
}
</style>