Преглед изворни кода

解决选择学习资料第一次进入没有查询的问题

zhulu пре 2 година
родитељ
комит
1bf665aa73

+ 3 - 3
src/components/K-FileUpload/index.vue

@@ -22,9 +22,8 @@
       <!-- <el-button size="mini" type="primary">{{ btnName }}</el-button> -->
       <!-- 上传提示 -->
       <div class="el-upload__tip" slot="tip" v-if="showTip">
-        请上传
-        <template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b></template>
-        <template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b></template>
+        文件<template v-if="fileSize">大小不超过<b style="color: #f56c6c">{{ fileSize }}MB</b></template>
+        <template v-if="fileType"> 格式为<b style="color: #f56c6c">{{ fileType.join("/") }}</b></template>
         的文件
       </div>
     </el-upload>
@@ -118,6 +117,7 @@ export default {
             return item;
           });
           this.fileValueList=[...this.fileList];
+          this.$emit("input", this.listToTagObj(this.fileValueList));
         } else {
           this.fileList = [];
           this.fileValueList=[];

+ 1 - 1
src/components/layoutContainer/index.vue

@@ -67,7 +67,7 @@ export default {
 
   display: flex;
   .leftBar {
-    min-width: 250px;
+    min-width: 300px;
     // overflow: scroll;
   }
   .rightBar {

+ 3 - 1
src/components/table/gx.search.table.vue

@@ -198,7 +198,9 @@ export default {
   },
   created() {},
   mounted() {
-    if (this.list && !this.manual) {
+    //console.log("gx mounted",this.list,this.manual)
+    // this.list &&
+    if ( !this.manual) {
       this.load(this.searchData)
     }
   },

+ 15 - 4
src/views/core/edu/plan/dialog.select.file.vue

@@ -13,8 +13,7 @@
         ref="st"
         url="/core/materials/fileList"
         method="post"
-        :search-data="search"
-        :manual="true"
+        :search-data="search"        
         :pageable="true"
         :select="true"
         :select-default="selectList"
@@ -45,7 +44,7 @@
           >
           <template slot-scope="scope">
             <template v-if="scope.row.fileList">
-              <el-tag size="mini" type="success" v-for="(item, index) in scope.row.fileList"
+              <el-tag style="cursor: pointer;margin-right: 5px;" size="mini" type="success" effect="plain" @click="downLoadFile(JSON.parse(item).url)" v-for="(item, index) in scope.row.fileList"
                       :key="index">
                 {{ JSON.parse(item).name }}
               </el-tag>
@@ -118,9 +117,21 @@ export default {
         title: null,
         fileName: null,
         orgId:this.$store.getters.orgId,
-        t:new Date(),
+        // t:new Date(),
       };
     },
+    downLoadFile(url)
+    {
+        if(process.env.VUE_APP_BASE_API!=='/')
+        {
+          url=process.env.VUE_APP_BASE_API+url;
+        }        
+        const a = document.createElement("a");
+        a.setAttribute("download", name);
+        a.setAttribute("target", "_blank");
+        a.setAttribute("href", url);
+        a.click();
+    }
   },
   mounted() {
 

+ 5 - 2
src/views/core/edu/plan/index.vue

@@ -594,10 +594,13 @@ export default {
     },
     fileSelected(list) {
       if (!list) return;
+      let tempArry=[];
       list.forEach(x => {
-        this.form.fileList = this.form.fileList.concat(x.fileList);
+        tempArry=tempArry.concat(x.fileList);
       })
-
+      console.log("fileSelected",tempArry);
+      //this.form.fileList=this.form.fileList.concat(tempArry);
+      this.formFileListDefualtValue =this.form.fileList.concat(tempArry);
     },
   }
 };

+ 17 - 16
src/views/core/edu/task/dialog.info.vue

@@ -218,24 +218,25 @@ export default {
             xhr.send();
         },
        saveAs(blob, filename) {
-            // if (window.navigator.msSaveOrOpenBlob) {
-            //     navigator.msSaveBlob(blob, filename);
-            // } else {
-               // var link = document.createElement("a");
-                //var body = document.querySelector("body");
+             console.log("saveAs",blob,filename)
+            if (window.navigator.msSaveOrOpenBlob) {
+                navigator.msSaveBlob(blob, filename);
+            } else {
+               var link = document.createElement("a");
+                var body = document.querySelector("body");
 
-                // link.href = window.URL.createObjectURL(blob);
-                // link.download = filename;
-                //
-                // // fix Firefox
-                // link.style.display = "none";
-                // body.appendChild(link);
-                //
-                // link.click();
-                // body.removeChild(link);
+                link.href = window.URL.createObjectURL(blob);
+                link.download = filename;
+                
+                // fix Firefox
+                link.style.display = "none";
+                body.appendChild(link);
+                
+                link.click();
+                body.removeChild(link);
 
-               // window.URL.revokeObjectURL(link.href);
-         //   }
+               window.URL.revokeObjectURL(link.href);
+           }
         },
         // 事件
         //apimark//

+ 2 - 2
src/views/core/edu/task/index.vue

@@ -291,7 +291,7 @@ export default {
       if(row.status>0) return false;
       if(!row.taskRoleList)   return false;
       let isOver =this.isNotOverOrUnStart(row);
-      console.log("isNotOverOrUnStart",isOver);
+      // console.log("isNotOverOrUnStart",isOver);
       row.taskRoleList.forEach((taskRole) => {
         this.$store.getters.roleList.forEach((role) => {
           if (taskRole.roleId == role.roleId) {
@@ -308,7 +308,7 @@ export default {
       const endDate = dayjs(row.endDate).startOf('day'); // 转换结束时间为 Moment.js 对象,并将时分秒部分设置为00时00分00秒
       // 判断开始时间和结束时间是否是同一天
       const isSameDay = startDate.isSame(endDate, 'day');
-      console.log("isOverOrUnStart",currentTime,startDate,endDate);
+      // console.log("isOverOrUnStart",currentTime,startDate,endDate);
       // 如果是同一天,则判断当前时间是否在开始时间和结束时间之间(包括开始和结束时间)
       // if (isSameDay) {
       //   return dayjs(currentTime).isBetween(startDate, endDate, null, '[]');