zhangyanpeng
2020-01-21 c676e48cfcfae16cf276e75af57d0c79344bbcdc
src/views/Overview.vue
@@ -18,7 +18,23 @@
         <div class="z_shadow" style="float: left; margin: 10px; margin-top: 0px; width: 46%; height: 43%; border: 1px solid #e4eef9;"></div>
         <div class="z_shadow" style="float: left; margin: 10px; margin-top: 0px; width: 46%; height: 43%; border: 1px solid #e4eef9;"></div>
         <div class="z_shadow" style="float: left; margin: 10px; width: 46%; height: 43%; border: 1px solid #e4eef9;"></div>
         <div class="z_shadow" style="float: left; margin: 10px; width: 46%; height: 43%; border: 1px solid #e4eef9;"></div>
         <div class="z_shadow" style="float: left; margin: 10px; padding: 10px; box-sizing: border-box; width: 46%; height: 43%; border: 1px solid #e4eef9;">
            <h3 style="margin: 0px;">文档库</h3>
            <div class="files_div">
               <div style="width: 0px; height: 0px;">
                 <iframe ref="frame_export" style="width: 0px; height: 0px;"></iframe>
               </div>
               <div v-if="fileLevel > 0">
                  <el-button  type="text" size="mini" @click="upFile_click">上一级</el-button>
               </div>
               <div v-for="(file, k) in fileList" :key="k" @click="file_click(file)" class="file_div">
                  <i v-if="file.type==='isfiles'" class="el-icon-folder"></i>
                  <i v-else-if="file.type==='isfile'" class="el-icon-tickets"></i>
                  <span>{{file.name}}</span>
               </div>
            </div>
         </div>
      </div>
      <div class="z_shadow" style="float: right; margin-right: 1%; width: 28%; height: 70vh; border: 1px solid #e4eef9;"></div>
      
@@ -59,10 +75,45 @@
            ],
            value: '',
            dialog_1: false,
            fileLevel: 0,
            fileList: [],
         }
      },
      mounted() {
         let fileList1 = [
               {name: "文件名称1", type: "isfile", path: ""},
               {name: "文件名称2", type: "isfile", path: ""},
               {name: "文件夹名称", type: "isfiles", path: ""},
            ];
         this.fileList = fileList1;
      },
      methods: {
         file_click(file) {
            if (file.type == 'isfiles') {
               let fileList2 = [
                  {name: "子文件名称1", type: "isfile", path: ""},
                  {name: "子文件名称2", type: "isfile", path: ""},
                  {name: "子文件夹名称", type: "isfiles", path: ""},
               ];
               this.fileList = fileList2;
               this.fileLevel ++;
            }
            else {
               //下载
               this.$refs.frame_export.src = "";
            }
         },
         upFile_click() {
            this.fileLevel --;
            let fileList2 = [
               {name: "文件名称1", type: "isfile", path: ""},
               {name: "文件名称2", type: "isfile", path: ""},
               {name: "文件夹名称", type: "isfiles", path: ""},
            ];
            this.fileList = fileList2;
         },
         addProject() {
            this.dialog_1 = true;
            
@@ -83,4 +134,18 @@
      text-align: left;
      background-color: #dee0e2;
   }
   .files_div{
      height: 90%;
      overflow: auto;
   }
   .file_div {
      width: 30%;
      height: 20px;
      float: left;
   }
   .file_div :hover {
      cursor: pointer;
      font-weight: bold;
   }
</style>