浏览代码

Merge branch 'master' of http://121.40.40.223:3000/zizhong.wang/Lexus-media

suxinf 4 年之前
父节点
当前提交
0f59c5cab3
共有 4 个文件被更改,包括 133 次插入46 次删除
  1. 1 1
      src/App.vue
  2. 92 8
      src/views/data/InforList.vue
  3. 31 31
      src/views/data/UploadLink.vue
  4. 9 6
      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: ''
     }
   },

+ 92 - 8
src/views/data/InforList.vue

@@ -38,7 +38,7 @@
           </select>
           <span>排序</span>
           <select name="" id="timeSort" v-model="timeSortVal">
-            <option value="">时间降序</option>
+            <option value="dec">时间降序</option>
             <option value="asc">时间升序</option>
           </select>
         </div>
@@ -100,11 +100,6 @@
     </div>
     <div v-else>
       <Detail></Detail>
-      <!-- <Detail
-        :detailData="tableData"
-        :nowIndex="nowIndex"
-        :fileData="tableFileData"
-      ></Detail> -->
     </div>
   </div>
 </template>
@@ -131,7 +126,7 @@ export default {
     return {
       nowIndex: 0,
       searchName: "",
-      timeSortVal: "",
+      timeSortVal: "dec",
       reportSortVal: "",
       downloadSortVal: "",
       //initialPage: true,
@@ -315,6 +310,32 @@ export default {
           if (res.data.code === 200) {
             this.tableData = res.data.data;
             this.sum = res.data.count;
+            //修改素材时间显示格式
+            let len = this.tableData.length;
+            for (let i = 0; i < len; i++) {
+              let newValue = "";
+              let temp = this.tableData[i].filePulishTime;
+              if (this.tableData[0].filePulishTime.length >= 7) {
+                newValue = temp.slice(0, 4) + "/" + temp.slice(5, 7); //+ "/" + temp.slice(8,10)
+                this.$set(this.tableData[i], "filePulishTime", newValue);
+              }
+            }
+            //修改上传时间显示格式
+            for (let i = 0; i < len; i++) {
+              let newValue = "";
+              let temp = this.tableData[i].fileUploadDate;
+              if (this.tableData[0].fileUploadDate.length >= 10) {
+                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 +357,32 @@ export default {
           console.log(res);
           if (res.data.code === 200) {
             this.tableData = res.data.data;
+            //修改素材时间显示格式
+            let len = this.tableData.length;
+            for (let i = 0; i < len; i++) {
+              let newValue = "";
+              let temp = this.tableData[i].filePulishTime;
+              if (this.tableData[0].filePulishTime.length >= 7) {
+                newValue = temp.slice(0, 4) + "/" + temp.slice(5, 7); //+ "/" + temp.slice(8,10)
+                this.$set(this.tableData[i], "filePulishTime", newValue);
+              }
+            }
+            //修改上传时间显示格式
+            for (let i = 0; i < len; i++) {
+              let newValue = "";
+              let temp = this.tableData[i].fileUploadDate;
+              if (this.tableData[0].fileUploadDate.length >= 10) {
+                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 +402,32 @@ export default {
           if (res.data.code === 200) {
             this.tableData = res.data.data;
             this.sum = res.data.count;
+            //修改素材时间显示格式
+            let len = this.tableData.length;
+            for (let i = 0; i < len; i++) {
+              let newValue = "";
+              let temp = this.tableData[i].filePulishTime;
+              if (this.tableData[0].filePulishTime.length >= 7) {
+                newValue = temp.slice(0, 4) + "/" + temp.slice(5, 7); //+ "/" + temp.slice(8,10)
+                this.$set(this.tableData[i], "filePulishTime", newValue);
+              }
+            }
+            //修改上传时间显示格式
+            for (let i = 0; i < len; i++) {
+              let newValue = "";
+              let temp = this.tableData[i].fileUploadDate;
+              if (this.tableData[0].fileUploadDate.length >= 10) {
+                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,13 +440,24 @@ export default {
       let searchName = this.searchName;
       let data = {
         informationName: searchName,
+        Page: 1,
+        Rows: this.pageSize,
+        agentId: this.userId,
+        //搜索条件重置
+        asc: false,
+        report: "",
+        download: "",
       };
+      //搜索条件重置
+      this.timeSortVal = "dec";
+      this.reportSortVal = "";
+      this.downloadSortVal = "";
       this.newGetDataList(data);
     },
 
     searchByCondition: function () {
       console.log("insearchByCondition", this.searchName);
-      let asc = this.timeSortVal === "asc" ? false : true;
+      let asc = this.timeSortVal === "dec" ? false : true;
       let report = "";
       if (this.reportSortVal === "already") {
         report = this.reportSortVal === "already" ? true : false;

+ 31 - 31
src/views/data/UploadLink.vue

@@ -180,7 +180,7 @@ export default {
       selectedPlatformId: "",
       nowIndex: 0,
       /* modal */
-      feedbackTimeLimit: 6,
+      feedbackTimeLimit: 0,
       showModal: false,
       showModal2: false,
       showModal3: false,
@@ -218,20 +218,6 @@ export default {
         },*/
       ],
       flag: true,
-      operation: [
-        {
-          name: "编辑",
-          function: () => {
-            this.EditForm();
-          },
-        },
-        {
-          name: "删除",
-          function: () => {
-            this.showDetail();
-          },
-        },
-      ],
       modalData: {}, //17:44
       emptyData: {
         accountId: "",
@@ -257,6 +243,7 @@ export default {
       dictList: [],
       onlineUrl: "http://8.136.230.133:8080",
       firmsDataCount: null,
+      userId: 254,
     };
   },
   computed: {
@@ -266,12 +253,6 @@ export default {
     },
   },
   methods: {
-    EditForm: () => {
-      alert("编辑");
-    },
-    showDetail: () => {
-      alert("展示详情");
-    },
     /*toggleModal:点击编辑后弹窗; toggleModal2:点击删除后弹窗; toggleModal3:点击导入后弹窗;  */
     toggleModal: function (i) {
       this.showModal = !this.showModal;
@@ -387,7 +368,23 @@ 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);
+            let len = this.tableData.length;
+            for (let i = 0; i < len; i++) {
+              let newValue = "";
+              let temp = this.tableData[i].publishDate;
+              if (this.tableData[i].publishDate.length >= 10) {
+                newValue =
+                  temp.slice(0, 4) +
+                  "/" +
+                  temp.slice(5, 7) +
+                  "/" +
+                  temp.slice(8, 10);
+                this.$set(this.tableData[i], "publishDate", newValue);
+              }
+            }
             console.log(this.tableData);
           }
         })
@@ -466,10 +463,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;
       }
     },
@@ -542,10 +539,9 @@ export default {
         data: {
           //publishPlatformId: val,
           //publishMonth: d,
-          //id: val,
-          //month: d,
           publishMonth: d,
           publishPlatformId: val,
+          //agentId: this.userId,
         },
       })
         .then((res) => {
@@ -557,13 +553,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);
           }
@@ -685,6 +677,14 @@ export default {
     },
   },
   mounted() {
+    let localUserId = localStorage.getItem("userId");
+    if (localUserId) {
+      console.log("经销商ID", localUserId);
+      this.userId = localUserId;
+    } else {
+      console.log("经销商ID 254");
+      this.userId = 254;
+    }
     this.getPlatform();
   },
   created() {

+ 9 - 6
src/views/data/components/InfoListItemDetail.vue

@@ -95,9 +95,9 @@ export default {
 
       detailData: [
         {
-          accountScope: '',
+          accountScope: "",
           agentId: "",
-          asc: '',
+          asc: "",
           download: "",
           downloadCount: null,
           fileDiscription: "",
@@ -223,22 +223,18 @@ export default {
   align-items: center;
 }
 .firstColumn span:nth-child(1) {
-  /*  width: 80px; */
   display: block;
   margin-right: 16px;
 }
 .secondColumn span:nth-child(1) {
-  /*   width: 80px; */
   display: block;
   margin-left: 40px;
   margin-right: 16px;
 }
 .detail span:nth-child(1) {
-  /* width: 80px; */
   margin-right: 16px;
 }
 .filesStyle span:nth-child(1) {
-  /* width: 80px; */
   margin-right: 16px;
 }
 .filesStyle {
@@ -247,5 +243,12 @@ export default {
 
 .filesName p {
   color: #4b8ec7;
+  margin: 4px;
+}
+.filesName {
+  height: 50px;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
 }
 </style>