index.vue 3.05 KB
Newer Older
wangdanlei's avatar
wangdanlei committed
1 2 3 4 5 6 7
/**
* @Description: 文件上传监控管理页面
* @author wx
* @date 2021/11/4
*/
<template>
  <div class="file-upload-mangement page-wrap">
wangdanlei's avatar
wangdanlei committed
8 9 10 11 12 13 14 15 16 17 18 19 20 21
    <dee-tab ref="deetab" class="dee-tab" :tabs="tabs">
      <div slot="1" class="dee-tab-item">
        <file-upload-mangement :search-items="searchItemsOne" style="height:100%" :refresh-status="refreshStatusPending" @changeRefreshStatus="changeRefreshStatusPending" />
      </div>
      <div slot="2" class="dee-tab-item">
        <dee-search-server
          v-model="searchForm"
          class="mpb0"
          :form-data="searchFormData"
          @search="submitFun"
        />
        <file-upload-mangement ref="fileUploadMangement" :search-items="searchItemsTwo" style="height:calc(100% - 50px)" :refresh-status="refreshStatusComplete" @changeRefreshStatus="changeRefreshStatusComplete" />
      </div>
    </dee-tab>
wangdanlei's avatar
wangdanlei committed
22 23 24
  </div>
</template>
<script>
wangdanlei's avatar
wangdanlei committed
25

wangdanlei's avatar
wangdanlei committed
26 27 28 29 30
export default {
  components: { },
  props: {},
  data() {
    return {
wangdanlei's avatar
wangdanlei committed
31 32 33
      tabs: [
        { id: '1', name: '进行中' },
        { id: '2', name: '已完成' }
wangdanlei's avatar
wangdanlei committed
34
      ],
wangdanlei's avatar
wangdanlei committed
35 36 37 38 39 40
      searchForm: {},
      fileStatusOptions: [],
      searchItemsOne: [{ fieldName: 'uploadStatus', operator: 'NEQ', value: 'success' }],
      searchItemsTwo: [{ fieldName: 'uploadStatus', operator: 'EQ', value: 'success' }],
      refreshStatusPending: localStorage.getItem('refreshStatusPending') || true,
      refreshStatusComplete: sessionStorage.getItem('refreshStatusComplete') || true
wangdanlei's avatar
wangdanlei committed
41 42 43
    }
  },
  computed: {
wangdanlei's avatar
wangdanlei committed
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
    searchFormData() {
      return [{
        key: 'originalFileName',
        title: '文件名称',
        component: {
          name: 'el-input',
          clearable: true
        }
      }
      // {
      //   key: 'uploadStatus',
      //   title: '状态',
      //   component: {
      //     name: 'el-select',
      //     options: this.fileStatusOptions,
      //     clearable: true
      //   }
      // }
      ]
    }
wangdanlei's avatar
wangdanlei committed
64 65 66 67
  },
  watch: {
  },
  created() {
wangdanlei's avatar
wangdanlei committed
68
    this.getFileStatus()
wangdanlei's avatar
wangdanlei committed
69 70 71 72
  },
  mounted() {
  },
  methods: {
wangdanlei's avatar
wangdanlei committed
73 74 75
    changeRefreshStatusPending() {
      this.refreshStatusPending = !this.refreshStatusPending
      localStorage.setItem('refreshStatusPending', this.refreshStatusPending)
wangdanlei's avatar
wangdanlei committed
76
    },
wangdanlei's avatar
wangdanlei committed
77 78 79
    changeRefreshStatusComplete() {
      this.refreshStatusComplete = !this.refreshStatusComplete
      localStorage.setItem('refreshStatusComplete', this.refreshStatusComplete)
wangdanlei's avatar
wangdanlei committed
80
    },
wangdanlei's avatar
wangdanlei committed
81 82
    async getFileStatus() {
      this.fileStatusOptions = this.$store.state.dictionaries && this.$store.state.dictionaries.FileStatus ? this.$store.state.dictionaries.FileStatus.default : await this.$utils.getDicListByCode('FileStatus')
wangdanlei's avatar
wangdanlei committed
83
    },
wangdanlei's avatar
wangdanlei committed
84 85
    submitFun() {
      this.$refs.fileUploadMangement.submitFun(this.searchForm, true)
wangdanlei's avatar
wangdanlei committed
86 87 88 89 90 91
    }
  }
}
</script>
<style lang="scss">
.file-upload-mangement{
wangdanlei's avatar
wangdanlei committed
92 93 94 95 96 97 98 99 100 101 102 103 104 105
      height: calc(100% - 6px);
  margin:4px;
  margin-top:0px;
  border: 1px solid #d8d8d8;
  .dee-panel{
    height: 100% !important;
    .el-tabs{
      .el-tabs__content{
        height: 100% !important;
        .dee-tab-item{
          margin-top:10px;
          height: 100%;
        }
      }
wangdanlei's avatar
wangdanlei committed
106 107 108 109 110
    }
  }
}
</style>