Просмотр исходного кода

分页添加筛选, 路由样式修改, 接口调整,添加新参数

liuYb лет назад: 4
Родитель
Сommit
59ed5b9b69

+ 54 - 11
src/components/Modal.vue

@@ -101,21 +101,21 @@
         <div class="bodyRow">
           <div class="contentCol1">
             <span>阅读量</span>
-            <input type="number" placeholder="" v-model="mediaTitle" />
+            <input type="number" placeholder="" v-model="readCount" />
           </div>
           <div class="contentCol2">
             <span>点赞</span>
-            <input type="number" placeholder="" v-model="mediaTitle" />
+            <input type="number" placeholder="" v-model="goodCount" />
           </div>
         </div>
         <div class="bodyRow">
           <div class="contentCol1">
             <span>评论</span>
-            <input type="number" placeholder="" v-model="mediaTitle" />
+            <input type="number" placeholder="" v-model="bbsCount" />
           </div>
           <div class="contentCol2">
             <span>在看/转发</span>
-            <input type="number" placeholder="" v-model="mediaTitle" />
+            <input type="number" placeholder="" v-model="lookingCount" />
           </div>
         </div>
         <div class="bodyRow longInput">
@@ -189,12 +189,17 @@ export default {
       ziliaoTime: "",
       contentName1: "",
       contentName2: "",
+
+      readCount: "",
+      goodCount: "",
+      bbsCount: "",
+      lookingCount: "",
     };
   },
   methods: {
     closeSelf() {
       this.$emit("closeme");
-      console.log(this.LinkData);
+      //  console.log(this.LinkData);
     },
 
     edit: function () {
@@ -233,8 +238,6 @@ export default {
           releaseTime: this.ziliaoTime,
           carService: this.carS,
           carType: this.carT,
-          //releasePlate: this.selectedPlatform,
-          //releaseMedia: this.releaseP,
           //发布板块
           releasePlate: this.releaseP,
           //发布平台
@@ -245,6 +248,11 @@ export default {
           contentClass: this.contentName2,
           articleTitle: this.mediaTitle,
           articleLink: this.mediaUrl,
+
+          readCount: this.readCount,
+          goodCount: this.goodCount,
+          bbsCount: this.bbsCount,
+          lookingCount: this.lookingCount,
         },
       };
 
@@ -289,7 +297,7 @@ export default {
       let config = {
         url: "/dealerFeedback",
         data: {
-         // id: "", //主键值
+          // id: "", //主键值
           month: d,
           dealerId: "254",
           dataId: this.ziliaoId,
@@ -309,6 +317,11 @@ export default {
           contentClass: this.contentName2,
           articleTitle: this.mediaTitle,
           articleLink: this.mediaUrl,
+
+          readCount: this.readCount,
+          goodCount: this.goodCount,
+          bbsCount: this.bbsCount,
+          lookingCount: this.lookingCount,
         },
       };
       this.$emit("update", config);
@@ -371,6 +384,7 @@ export default {
       obj = this.carSeries.find(function (item) {
         return item.typeName === nameCarS;
       });
+      console.log(this.carSeries, obj);
       this.carTypeId = obj.id;
 
       this.$http({
@@ -476,7 +490,7 @@ export default {
       this.carS = this.LinkData.carTypeName;
 
       this.carT = this.LinkData.carPlatformName;
-      let time = this.LinkData.publishDate;
+      let time = this.LinkData.publishDate; //发布时间
       if (time.length > 4) {
         let y = time.slice(0, 4);
         let m = time.slice(5, 7);
@@ -492,16 +506,45 @@ export default {
 
       this.contentName1 = this.LinkData.mediaTypeName;
       this.contentName2 = this.LinkData.contentTypeName;
+
+      this.readCount = this.LinkData.readCount;
+      this.goodCount = this.LinkData.goodCount;
+      this.bbsCount = this.LinkData.bbsCount;
+      this.lookingCount = this.LinkData.lookingCount;
     },
     testUrl: function () {
       var regex = /^http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?$/;
       let flag = regex.test(this.mediaUrl);
-      console.log(flag, regex);
+      // console.log(flag, regex);
       if (flag) {
-        this.edit();
+        if (flag
+         /*  this.ziliaoName &&
+          this.ziliaoTime &&
+          this.carS &&
+          this.carT &&
+          this.releaseP &&
+          this.selectedPlatform &&
+          this.contentName1 &&
+          this.contentName2 &&
+          this.mediaTitle &&
+          this.mediaUrl &&
+          this.readCount &&
+          this.goodCount &&
+          this.bbsCount &&
+          this.lookingCount */
+        ) {
+          this.edit();
+        } else {
+          alert("请将信息补充完整!");
+        }
       } else {
         alert("链接输入有误!\n示例:https://www.baidu.com");
       }
+      /*  
+this.ziliaoName && this.ziliaoTime &&this.carS &&this.carT&&
+this.releaseP&& this.selectedPlatform&& this.contentName1&&
+this.contentName2&& this.mediaTitle&& this.mediaUrl&&
+this.readCount&&this.goodCount&&  this.bbsCount&& this.lookingCount */
     },
   },
   mounted() {

+ 6 - 4
src/components/RouterBanner.vue

@@ -65,13 +65,12 @@
             v-if="list.isShow === 'all' || list.isShow === isManufacturer"
             :to="list.path"
             tag="li"
-          >
-            <p
+          
               @click="getNavTitle(routerObj.title, list.title)"
               :class="{ blueColor: list.path === routerPath }"
             >
               - {{ list.title }}
-            </p>
+            
           </router-link>
         </div>
       </div>
@@ -250,8 +249,11 @@ export default {
   }
 }
 // 选中变色
-.blueColor {
+/* .blueColor {
   color: #0056a0;
+} */
+.router-link-active{
+    color: #0056a0;
 }
 .selectStyle {
   background-color: rgb(0, 86, 160);

+ 1 - 1
src/router/index.js

@@ -52,7 +52,7 @@ const routes = [{
         path: '/uploadLink',
         component: UploadLink,
         children: [{
-            path: 'sonUploadLink',
+            path: '/uploadLink/sonUploadLink',
             component: sonUploadLink,
         }]
     },

+ 91 - 13
src/views/data/InforList.vue

@@ -30,11 +30,11 @@
             <option value="already">已下载</option>
             <option value="notyet">未下载</option>
           </select>
-          <span>是否反馈</span>
+          <span>是否完成</span>
           <select name="" id="isReturn" v-model="reportSortVal">
             <option value="">不限</option>
-            <option value="already">已反馈</option>
-            <option value="notyet">未反馈</option>
+            <option value="already">已完成</option>
+            <option value="notyet">待办</option>
           </select>
           <span>排序</span>
           <select name="" id="timeSort" v-model="timeSortVal">
@@ -70,8 +70,14 @@
                 <td>{{ obj.accountScope == 1 ? "共通" : "部分" }}</td>
                 <td>{{ obj.fileUploadDate || "2021/01/10 12:12" }}</td>
                 <td>{{ obj.download > 0 ? "已下载" : "未下载" }}</td>
-                <td @click="waitToReport(obj.report)" :class="{reportStyle: obj.report == 0 ? true : false}">
-                  {{ obj.report == 1 ? "已完成" : "待办" }}
+                <td>
+                  <span
+                    @click="waitToReport(obj.report, index)"
+                    :class="showItemOperation" class="reportStyle"
+                    >待办</span
+                  >
+                  <!--  :class="{ reportStyle: obj.report == 0 ? true : false }" -->
+                  <span :class="!showItemOperation">已完成</span>
                 </td>
 
                 <td v-if="operation" :style="trStyle" class="operationStyle">
@@ -197,6 +203,7 @@ export default {
       },
       onlineUrl: "http://8.136.230.133:8080",
       userId: 254,
+      endDate: "",
     };
   },
   computed: {
@@ -207,10 +214,35 @@ export default {
     isShowDetail() {
       return this.$route.query && this.$route.query.tag ? true : false;
     },
+    showItemOperation: function () {
+      let nowDate = this.CurentTime();
+
+      if (!this.endDate) {
+        console.log(nowDate);
+        return { showItemOperationStyle: true };
+      } else {
+        console.log(this.endDate);
+        if (nowDate < this.endDate) {
+          return { showItemOperationStyle: false };
+        } else {
+          return { showItemOperationStyle: true };
+        }
+      }
+    },
   },
   methods: {
-    feedback: () => {
-      alert("反馈");
+    CurentTime: function () {
+      var now = new Date();
+      var year = now.getFullYear(); //年
+      var month = now.getMonth() + 1; //月
+      var day = now.getDate(); //日
+      var clock = year + "/";
+
+      if (month < 10) clock += "0";
+      clock += month + "/";
+      if (day < 10) clock += "0";
+      clock += day;
+      return clock;
     },
     download: function () {
       alert("下载");
@@ -218,7 +250,24 @@ export default {
     // 获取某一页面的数据,展示在表格
     changePage: function (page) {
       this.currentPage = page;
-      this.getDataListPage(this.currentPage);
+      // this.getDataListPage(this.currentPage);
+
+      //携带搜索条件
+      let data = {
+        asc: this.changePage == "dec" ? false : true,
+        report: "",
+        download: "",
+        Page: this.currentPage,
+        Rows: this.pageSize,
+        agentId: this.userId,
+      };
+      if (this.reportSortVal) {
+        data.report = this.reportSortVal === "already" ? true : false;
+      }
+      if (this.downloadSortVal) {
+        data.download = this.downloadSortVal === "already" ? true : false;
+      }
+      this.newGetDataList(data);
     },
     // 点击上一页,下一页,首页,尾页
     jumpPage: function (item) {
@@ -237,7 +286,23 @@ export default {
           break;
       }
       console.log(this.currentPage);
-      this.getDataListPage(this.currentPage);
+      // this.getDataListPage(this.currentPage);
+      //携带搜索条件
+      let data = {
+        asc: this.changePage == "dec" ? false : true,
+        report: "",
+        download: "",
+        Page: this.currentPage,
+        Rows: this.pageSize,
+        agentId: this.userId,
+      };
+      if (this.reportSortVal) {
+        data.report = this.reportSortVal === "already" ? true : false;
+      }
+      if (this.downloadSortVal) {
+        data.download = this.downloadSortVal === "already" ? true : false;
+      }
+      this.newGetDataList(data);
     },
     //下载文件
     downloadPost: function (config, obj) {
@@ -309,7 +374,10 @@ export default {
             for (let i = 0; i < len; i++) {
               let newValue = "";
               let temp = this.tableData[i].filePulishTime;
-              if (this.tableData[0].filePulishTime.length!=null&&this.tableData[0].filePulishTime.length >= 7) {
+              if (
+                this.tableData[0].filePulishTime.length != null &&
+                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);
               }
@@ -356,7 +424,10 @@ export default {
             for (let i = 0; i < len; i++) {
               let newValue = "";
               let temp = this.tableData[i].filePulishTime;
-              if (this.tableData[0].filePulishTime.length!=null&&this.tableData[0].filePulishTime.length >= 7) {
+              if (
+                this.tableData[0].filePulishTime.length != null &&
+                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);
               }
@@ -401,7 +472,10 @@ export default {
             for (let i = 0; i < len; i++) {
               let newValue = "";
               let temp = this.tableData[i].filePulishTime;
-              if (this.tableData[0].filePulishTime.length!=null&&this.tableData[0].filePulishTime.length >= 7) {
+              if (
+                this.tableData[0].filePulishTime.length != null &&
+                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);
               }
@@ -475,7 +549,8 @@ export default {
       this.newGetDataList(data);
     },
     //待办跳转
-    waitToReport: function (flag) {
+    waitToReport: function (flag, i) {
+      this.endDate = this.tableData[i].endDate;
       if (flag) {
         console.log("待办跳转");
         this.$router.replace({ path: "/uploadLink/sonuploadLink" });
@@ -589,4 +664,7 @@ export default {
 .reportStyle {
   text-decoration: underline;
 }
+.showItemOperationStyle {
+  display: none;
+}
 </style>

+ 98 - 37
src/views/data/UploadLink.vue

@@ -67,7 +67,9 @@
               <!-- 内容分类 内容分类2 -->
               <td>{{ obj.carPlatformName }}</td>
               <!-- 车型 -->
-              <td>{{ obj.informationName }}</td>
+              <td :class="{ weiFanKui: !obj.id }">
+                {{ obj.id ? "已反馈" : "未反馈" }}
+              </td>
               <!-- 反馈状态  未定-->
               <td>{{ obj.endDate }}</td>
               <!-- 反馈截止日期 -->
@@ -79,7 +81,9 @@
               <!-- 链接 -->
 
               <td class="operationStyle" style="cursor: pointer">
-                <span @click="toggleModal(index)">编辑</span>
+                <span @click="toggleModal(index)" :class="showItemOperation"
+                  >编辑</span
+                >
                 <span @click="viewHistoryRecord(index)">查看</span>
                 <!--  <span @click="toggleModal2(index)">删除</span> -->
                 <!-- 弹窗: 确定删除? -->
@@ -106,9 +110,9 @@
         :releaseMedia="releaseMedia"
       ></Modal>
 
-      <div class="timeLimitStyle">
+      <!--    <div class="timeLimitStyle">
         <span>仅可对上传时间为{{ feedbackTimeLimit }}个月内的资料进行反馈</span>
-      </div>
+      </div> -->
 
       <div class="pageBottom">
         <div class="fileOperation">
@@ -142,7 +146,6 @@
           :totalPage="totalPage"
           @change_page="changePage"
           @jump_page="jumpPage"
-          class="tablePageStyle"
         ></TablePage>
       </div>
 
@@ -282,8 +285,9 @@ export default {
       file: "",
       dictList: [],
       onlineUrl: "http://8.136.230.133:8080",
-      firmsDataCount: null,
       userId: 254,
+      //截止日期
+      endTime: "",
     };
   },
   computed: {
@@ -291,12 +295,56 @@ export default {
     totalPage() {
       return Math.ceil(this.sum / this.pageSize);
     },
+
+    showItemOperation: function () {
+      let myDate = new Date();
+      myDate.getTime();
+      let R= "2021-04-15T10:52:13.480";
+      R = R.replace("T", " ").slice(0,-4);
+      console.log(R)
+      let startDateTime = new Date(R.replace(RegExp("-", "g"), "/")).getTime();
+      let time=new Date(R);
+      console.log(startDateTime)
+      console.log(time);
+      //
+      console.log(myDate.getTime());
+
+      let nowDate = this.CurentTime();
+
+      if (!this.endTime) {
+        console.log(nowDate);
+        return { showItemOperationStyle: true };
+      } else {
+        console.log(this.endTime);
+        if (nowDate < this.endTime) {
+          return { showItemOperationStyle: false };
+        } else {
+          return { showItemOperationStyle: true };
+        }
+      }
+    },
   },
   methods: {
+    CurentTime: function () {
+      var now = new Date();
+      var year = now.getFullYear(); //年
+      var month = now.getMonth() + 1; //月
+      var day = now.getDate(); //日
+      var clock = year + "/";
+
+      if (month < 10) clock += "0";
+      clock += month + "/";
+      if (day < 10) clock += "0";
+      clock += day;
+      return clock;
+    },
     /*toggleModal:点击编辑后弹窗; toggleModal2:点击删除后弹窗; toggleModal3:点击导入后弹窗;  */
     toggleModal: function (i) {
       this.showModal = !this.showModal;
       this.modalData = this.tableData[i];
+
+      //截止日期判断
+      this.endTime = this.tableData[i].endTime;
     },
     closeme: function () {
       this.showModal = !this.showModal;
@@ -350,7 +398,14 @@ export default {
     /* 表格翻页 */
     changePage: function (page) {
       this.currentPage = page;
-      console.log(page);
+      //console.log(page);
+      //分页取数据
+      let config = {
+        Page: this.currentPage,
+        Rows: this.pageSize,
+        agentId: this.userId,
+      };
+      this.getDataList(config);
     },
     // 点击上一页,下一页,首页,尾页
     jumpPage: function (item) {
@@ -369,38 +424,34 @@ export default {
           break;
       }
       console.log(this.currentPage);
+      //分页取数据
+      let config = {
+        Page: this.currentPage,
+        Rows: this.pageSize,
+        agentId: this.userId,
+      };
+      this.getDataList(config);
     },
     //获取资料列表
     getDataList: function (config) {
-      let date = new Date();
-      let m = date.getMonth() + 1;
-      let y = date.getFullYear();
-      let d = y + "/" + m;
-      console.log(config, d);
+      console.log(config);
       this.$http({
         url: "/firmsLinkUpload",
         method: "post",
         data: {
-          // month: d,
-          // publishPlatformId: config,
+          Page: config.Page,
+          Rows: config.Rows,
+          agentId: this.userId,
         },
       })
         .then((res) => {
           if (res.data.code === 200) {
-            //this.tableData = [];
             let data = res.data.data;
-            this.firmsDataCount = data.length;
-            /* for (
-              let i = 0, j = 0;
-              i < this.tableData.length && j < data.length;
-              i++, j++
-            ) {
-              this.$set(this.tableData, i, data[j]);
-            } */
+            console.log(data);
+            this.sum = res.data.count;
             for (let i = 0, j = 0; j < data.length; i++, j++) {
               this.$set(this.tableData, i, data[j]);
             }
-               console.log(this.tableData);
             //修改素材时间显示格式
             let len = this.tableData.length;
             for (let i = 0; i < len; i++) {
@@ -465,8 +516,9 @@ export default {
         fileDes.push(item.name);
       });
       console.log(fileDes);
-      let remainCount = this.publishCount - this.firmsDataCount;
-      console.log(remainCount, this.publishCount, this.firmsDataCount);
+      //导入文件与限制文件导入数量
+      let remainCount = this.publishCount - this.sum;
+      console.log(remainCount, this.publishCount, this.sum);
       if (remainCount >= this.file.length) {
         this.submitRequest();
       } else if (remainCount < this.file.length) {
@@ -524,7 +576,7 @@ export default {
       this.selectedPlatformId = obj.id;
 
       //获取可发布数量
-    //  this.getReleaseQuantity(obj.id);
+      //  this.getReleaseQuantity(obj.id);
 
       //获取发布版块
       this.chooseReleasePlate(obj.id);
@@ -650,11 +702,11 @@ export default {
     },
     viewHistoryRecord: function () {
       this.$router.replace({
-        path: "/UploadLink/sonUploadLink",
+        path: "uploadLink/sonUploadLink",
       });
     },
     isFather: function () {
-      console.log("isfffffff", this.$route.path.length);
+      // console.log("isfffffff", this.$route.path.length);
       return this.$route.path.length > 11 ? false : true;
     },
   },
@@ -667,17 +719,23 @@ export default {
       console.log("经销商ID 254");
       this.userId = 254;
     }
-   // this.getPlatform();
-   this.getDataList();
+    // this.getPlatform();
+    //分页取数据
+    let config = {
+      Page: this.currentPage,
+      Rows: this.pageSize,
+      agentId: this.userId,
+    };
+    this.getDataList(config);
   },
   created() {
-    this.selectSysDataDictList()
+    /*   this.selectSysDataDictList()
       .then(() => {
         this.getDateList();
       })
       .catch((err) => {
         console.log(err);
-      });
+      }); */
     //this.getPlatform();
   },
 };
@@ -908,10 +966,7 @@ export default {
   font-size: 16px;
   font-family: Arial;
 }
-/* .tablePageStyle{
-  position: relative;
-  left: 266px;
-} */
+
 .pageBottom {
   display: flex;
   justify-content: space-between;
@@ -923,4 +978,10 @@ export default {
   align-items: center;
   margin-bottom: 6px;
 }
+.weiFanKui {
+  color: red;
+}
+.showItemOperationStyle {
+  display: none;
+}
 </style>

+ 39 - 5
src/views/data/UploadLink/sonUploadLink.vue

@@ -69,8 +69,8 @@
             <!-- 链接 -->
 
             <td class="operationStyle" style="cursor: pointer">
-              <span @click="toggleModal(index)">编辑</span>
-              <span @click="toggleModal2(index)">删除</span>
+              <span @click="toggleModal(index)" :class="showItemOperation">编辑</span>
+              <span @click="toggleModal2(index)" :class="showItemOperation">删除</span>
               <!-- 弹窗: 确定删除? -->
               <deleteModal
                 v-if="showModal2"
@@ -202,7 +202,7 @@ export default {
           projectTypeName: "东区1",
           contentTypeName: "雷克萨斯ES",
           mediaTitle: "ES雷克萨斯",
-          mediaUrl: "S雷克萨斯",
+          mediaUrl: "",
         },
       ],
       flag: true,
@@ -240,8 +240,40 @@ export default {
     totalPage() {
       return Math.ceil(this.sum / this.pageSize);
     },
+    //是否隐藏编辑按钮 时间判断
+    showItemOperation: function () {
+/*       let myDate = new Date();
+      myDate.getTime();
+console.log(myDate) */
+      let nowDate = this.CurentTime();
+     /*  2021-04-09T10:47:08.176 */
+      if (!this.endTime) {
+        console.log(nowDate);
+        return { showItemOperationStyle: true };
+      } else {
+        console.log(this.endTime);
+        if (nowDate < this.endTime) {
+          return { showItemOperationStyle: false };
+        }else{
+          return { showItemOperationStyle: true };
+        }
+      }
+    },
   },
   methods: {
+    CurentTime: function () {
+      var now = new Date();
+      var year = now.getFullYear(); //年
+      var month = now.getMonth() + 1; //月
+      var day = now.getDate(); //日
+      var clock = year + "/";
+
+      if (month < 10) clock += "0";
+      clock += month + "/";
+      if (day < 10) clock += "0";
+      clock += day;
+      return clock;
+    },
     /*toggleModal:点击编辑后弹窗; toggleModal2:点击删除后弹窗; toggleModal3:点击导入后弹窗;  */
     toggleModal: function (i) {
       this.showModal = !this.showModal;
@@ -634,8 +666,6 @@ export default {
 }
 .addButton {
   color: white;
-}
-.addButton button{
   width: 80px;
   border-radius: 4px;
 }
@@ -644,4 +674,8 @@ export default {
   justify-content: space-between;
   align-items: center;
 }
+
+.showItemOperationStyle {
+  display: none;
+}
 </style>