소스 검색

日期格式

liuYb 4 년 전
부모
커밋
43a105026a
4개의 변경된 파일105개의 추가작업 그리고 10개의 파일을 삭제
  1. 1 1
      src/App.vue
  2. 88 0
      src/views/data/InforList.vue
  3. 15 9
      src/views/data/UploadLink.vue
  4. 1 0
      src/views/data/components/InfoListItemDetail.vue

+ 1 - 1
src/App.vue

@@ -38,7 +38,7 @@ export default {
     return {
       navTitle1: ' > 数据管理',
       navTitle2: '',
-      isManufacturer: 'manufacturer', // distributor 经销商 manufacturer 厂商
+      isManufacturer: 'distributor', // distributor 经销商 manufacturer 厂商
       userAccount: ''
     }
   },

+ 88 - 0
src/views/data/InforList.vue

@@ -315,6 +315,33 @@ export default {
           if (res.data.code === 200) {
             this.tableData = res.data.data;
             this.sum = res.data.count;
+            //修改素材时间显示格式
+            if (this.tableData[0].filePulishTime.length >= 7) {
+              let len = this.tableData.length;
+              for (let i = 0; i < len; i++) {
+                let newValue = "";
+                let temp = this.tableData[i].filePulishTime;
+                newValue = temp.slice(0, 4) + "/" + temp.slice(5, 7); //+ "/" + temp.slice(8,10)
+                this.$set(this.tableData[i], "filePulishTime", newValue);
+              }
+            }
+            //修改上传时间显示格式
+            if (this.tableData[0].fileUploadDate.length >= 10) {
+              let len = this.tableData.length;
+              for (let i = 0; i < len; i++) {
+                let newValue = "";
+                let temp = this.tableData[i].fileUploadDate;
+                newValue =
+                  temp.slice(0, 4) +
+                  "/" +
+                  temp.slice(5, 7) +
+                  "/" +
+                  temp.slice(8, 10) +
+                  " " +
+                  temp.slice(11, 19);
+                this.$set(this.tableData[i], "fileUploadDate", newValue);
+              }
+            }
           }
         })
         .catch((err) => {
@@ -336,6 +363,33 @@ export default {
           console.log(res);
           if (res.data.code === 200) {
             this.tableData = res.data.data;
+              //修改素材时间显示格式
+            if (this.tableData[0].filePulishTime.length >= 7) {
+              let len = this.tableData.length;
+              for (let i = 0; i < len; i++) {
+                let newValue = "";
+                let temp = this.tableData[i].filePulishTime;
+                newValue = temp.slice(0, 4) + "/" + temp.slice(5, 7); //+ "/" + temp.slice(8,10)
+                this.$set(this.tableData[i], "filePulishTime", newValue);
+              }
+            }
+            //修改上传时间显示格式
+            if (this.tableData[0].fileUploadDate.length >= 10) {
+              let len = this.tableData.length;
+              for (let i = 0; i < len; i++) {
+                let newValue = "";
+                let temp = this.tableData[i].fileUploadDate;
+                newValue =
+                  temp.slice(0, 4) +
+                  "/" +
+                  temp.slice(5, 7) +
+                  "/" +
+                  temp.slice(8, 10) +
+                  " " +
+                  temp.slice(11, 19);
+                this.$set(this.tableData[i], "fileUploadDate", newValue);
+              }
+            }
           }
         })
         .catch((err) => {
@@ -355,6 +409,33 @@ export default {
           if (res.data.code === 200) {
             this.tableData = res.data.data;
             this.sum = res.data.count;
+              //修改素材时间显示格式
+            if (this.tableData[0].filePulishTime.length >= 7) {
+              let len = this.tableData.length;
+              for (let i = 0; i < len; i++) {
+                let newValue = "";
+                let temp = this.tableData[i].filePulishTime;
+                newValue = temp.slice(0, 4) + "/" + temp.slice(5, 7); //+ "/" + temp.slice(8,10)
+                this.$set(this.tableData[i], "filePulishTime", newValue);
+              }
+            }
+            //修改上传时间显示格式
+            if (this.tableData[0].fileUploadDate.length >= 10) {
+              let len = this.tableData.length;
+              for (let i = 0; i < len; i++) {
+                let newValue = "";
+                let temp = this.tableData[i].fileUploadDate;
+                newValue =
+                  temp.slice(0, 4) +
+                  "/" +
+                  temp.slice(5, 7) +
+                  "/" +
+                  temp.slice(8, 10) +
+                  " " +
+                  temp.slice(11, 19);
+                this.$set(this.tableData[i], "fileUploadDate", newValue);
+              }
+            }
           }
         })
         .catch((err) => {
@@ -367,6 +448,13 @@ export default {
       let searchName = this.searchName;
       let data = {
         informationName: searchName,
+        Page: 1,
+        Rows: this.pageSize,
+        agentId: this.userId,
+        //搜索重置条件
+        asc: false,
+        report: '',
+        download: '',
       };
       this.newGetDataList(data);
     },

+ 15 - 9
src/views/data/UploadLink.vue

@@ -387,8 +387,18 @@ export default {
             ) {
               this.$set(this.tableData, i, data[j]);
             }
-            console.log(data.length, this.tableData.length);
-            console.log(this.tableData);
+            //修改素材时间显示格式
+            console.log(this.tableData[0].publishDate)
+            if (this.tableData[0].publishDate.length >= 10) {
+              let len = this.tableData.length;
+              for (let i = 0; i < len; i++) {
+                let newValue = "";
+                let temp = this.tableData[i].publishDate;
+                newValue = temp.slice(0, 4) + "/" + temp.slice(5, 7)+ "/" + temp.slice(8,10)
+                this.$set(this.tableData[i], "publishDate", newValue);
+              }
+            }
+            console.log(this.tableData)
           }
         })
         .catch((err) => {
@@ -466,10 +476,10 @@ export default {
       });
       console.log(fileDes);
       let remainCount = this.publishCount - this.firmsDataCount;
-      console.log(remainCount,this.publishCount, this.firmsDataCount)
-      if (remainCount >= this.file.length){
+      console.log(remainCount, this.publishCount, this.firmsDataCount);
+      if (remainCount >= this.file.length) {
         this.submitRequest();
-      }else if (remainCount < this.file.length){
+      } else if (remainCount < this.file.length) {
         this.showModal3 = !this.showModal3;
       }
     },
@@ -557,13 +567,9 @@ export default {
             console.log("获取可发布数量", len, l);
             this.tableData = [];
             while (len > 0) {
-              //this.tableData.push([]);
-              //Array.prototype.push.apply(this.tableData, [this.emptyData]);
               this.tableData.push(this.emptyData);
               len--;
             }
-            console.log(this.tableData);
-            console.log(this.tableData.length);
             //更新列表数据
             this.getDataList(this.selectedPlatformId);
           }

+ 1 - 0
src/views/data/components/InfoListItemDetail.vue

@@ -247,5 +247,6 @@ export default {
 
 .filesName p {
   color: #4b8ec7;
+  margin: 4px;
 }
 </style>