Browse Source

修改计划报告下载

plg 3 months ago
parent
commit
692ce70bb9
1 changed files with 47 additions and 21 deletions
  1. 47 21
      src/views/manage/channelManagement/channelManagement.vue

+ 47 - 21
src/views/manage/channelManagement/channelManagement.vue

@@ -287,7 +287,9 @@
           <p style="text-align: center; margin-bottom: 20px; font-weight: 700">
             报告下载
           </p>
-          <div style="text-align: left;margin-left:10%;color:#333333">选择下载范围</div>
+          <div style="text-align: left; margin-left: 10%; color: #333333">
+            选择下载范围
+          </div>
           <el-form
             :inline="true"
             class="demo-form-inline form-plan"
@@ -297,7 +299,7 @@
               flex-direction: row;
               align-items: center;
               justify-content: space-between;
-              padding:0 10%;
+              padding: 0 10%;
             "
           >
             <el-form-item label="">
@@ -321,7 +323,7 @@
               </el-select>
             </el-form-item>
             <el-form-item label="" v-show="dimensionality == '2'">
-              <el-select multiple     v-model="orgName" placeholder="请选择班级">
+              <el-select multiple v-model="orgName" placeholder="请选择班级">
                 <el-option
                   v-for="item in orgList"
                   :key="item.id"
@@ -330,18 +332,16 @@
                 ></el-option>
               </el-select>
             </el-form-item>
-            <el-form-item label=""  v-show="dimensionality == '0'"> 
+            <el-form-item label="" v-show="dimensionality == '0'">
               <el-button
-              type="success"
-              style="border-radius: 20px"
-              v-show="dimensionality == '0'"
-              @click="downloadFun"
-            >
-              全院下载
-            </el-button>
+                type="success"
+                style="border-radius: 20px"
+                v-show="dimensionality == '0'"
+                @click="downloadFun"
+              >
+                全院下载
+              </el-button>
             </el-form-item>
-
-    
           </el-form>
           <div style="display: flex; width: 100%; justify-content: center">
             <!-- <el-button
@@ -378,15 +378,23 @@
             </el-button>
           </div>
         </div>
-        <div style="margin-left: 10%;color:#333333;margin-bottom:20px" >待下载列表</div>
+        <div style="margin-left: 10%; color: #333333; margin-bottom: 20px">
+          待下载列表
+        </div>
         <el-table
           :data="downList"
           style="width: 80%; margin-left: 10%"
           max-height="250"
-           :header-cell-style="{ background: '#F8F8F8', color: '#606266' }"
-         
+          :header-cell-style="{ background: '#F8F8F8', color: '#606266' }"
         >
           <el-table-column type="index" align="center" label="序号"> </el-table-column>
+          <el-table-column
+            prop="filePath"
+            :formatter="fileNameFormatter"
+            align="center"
+            label="报告名称"
+          >
+          </el-table-column>
           <el-table-column prop="createTime" align="center" label="生成时间">
           </el-table-column>
 
@@ -441,7 +449,13 @@
             <p style="margin-bottom: 40px; margin-top: 20px">确定离开吗?</p>
             <div class="dig_button">
               <el-button type="info" round @click="cancleFun()">取消</el-button>
-              <el-button type="success" round @click="verifyVisible = false ;resetVisible=false"
+              <el-button
+                type="success"
+                round
+                @click="
+                  verifyVisible = false;
+                  resetVisible = false;
+                "
                 >确定</el-button
               >
             </div>
@@ -575,6 +589,13 @@ export default {
     this.searchTarget();
   },
   methods: {
+    fileNameFormatter(val) {
+      let nameTmp = val.filePath;
+      //开始截取字符串
+      let lastIndex = nameTmp.lastIndexOf("/");
+      // console.log(nameTmp.slice(lastIndex+1, 0));
+      return nameTmp.slice(lastIndex + 1, nameTmp.length);
+    },
     closeResetFun() {
       //关闭
       // this.resetVisible = false;
@@ -758,10 +779,10 @@ export default {
       a.setAttribute("href", basePath + `/plan/download?recordId=${val.id}`);
       a.click();
       //开始调用刷新按钮
-      clearInterval(this.timeFlag);
-      this.timeFlag = setInterval(() => {
-        this.getPlanFileList();
-      }, 1000);
+      // clearInterval(this.timeFlag);
+      // this.timeFlag = setInterval(() => {
+      //   this.getPlanFileList();
+      // }, 3000);
     },
     //组织架构选择--
     getOrgList() {
@@ -793,7 +814,12 @@ export default {
       this.getOrgList();
       this.queryCourt();
       this.queryGrade();
+      clearInterval(this.timeFlag);
+
       this.getPlanFileList();
+      this.timeFlag = setInterval(() => {
+        this.getPlanFileList();
+      }, 3000);
       //调用接口
       //查询下载计划的列表
     },