liuYb пре 4 година
родитељ
комит
7fe6eeac66

+ 39 - 43
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,
@@ -316,21 +311,20 @@ export default {
             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;
+            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);
               }
             }
             //修改上传时间显示格式
-            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;
+            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) +
                   "/" +
@@ -363,22 +357,21 @@ 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;
+            //修改素材时间显示格式
+            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);
               }
             }
             //修改上传时间显示格式
-            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;
+            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) +
                   "/" +
@@ -409,22 +402,21 @@ 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;
+            //修改素材时间显示格式
+            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);
               }
             }
             //修改上传时间显示格式
-            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;
+            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) +
                   "/" +
@@ -451,17 +443,21 @@ export default {
         Page: 1,
         Rows: this.pageSize,
         agentId: this.userId,
-        //搜索重置条件
+        //搜索条件重置
         asc: false,
-        report: '',
-        download: '',
+        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;

+ 25 - 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,18 +368,24 @@ export default {
             ) {
               this.$set(this.tableData, i, data[j]);
             }
+            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)
+            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)
+            console.log(this.tableData);
           }
         })
         .catch((err) => {
@@ -552,10 +539,9 @@ export default {
         data: {
           //publishPlatformId: val,
           //publishMonth: d,
-          //id: val,
-          //month: d,
           publishMonth: d,
           publishPlatformId: val,
+          //agentId: this.userId,
         },
       })
         .then((res) => {
@@ -691,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() {

+ 8 - 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 {
@@ -249,4 +245,10 @@ export default {
   color: #4b8ec7;
   margin: 4px;
 }
+.filesName {
+  height: 50px;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
 </style>