소스 검색

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

# Conflicts:
#	src/App.vue
306132416@qq.com 4 년 전
부모
커밋
18d188890e

+ 33 - 14
src/components/Modal.vue

@@ -148,7 +148,7 @@ export default {
     },
     fileName: {
       type: String,
-      default: '',
+      default: "",
     },
   },
   data() {
@@ -188,6 +188,7 @@ export default {
 
       releaseChannel: [],
       releasePlate: [],
+      userId: '',
     };
   },
   methods: {
@@ -210,21 +211,22 @@ export default {
       });
       console.log("chexi ", obj);
       //carTypeId  表示车系 id
-      this.carTypeId = obj.id;
+      // this.carTypeId = obj.id;
 
       //当前月份
       let date = new Date();
       let m = date.getMonth() + 1;
       let y = date.getFullYear();
       let d = y + "/" + m;
-
+console.log(this.ziliaoId)
       let config = {
         url: "",
         data: {
           id: "", //主键值
           month: d,
-          dealerId: "254",
+          dealerId: this.userId,
           dataId: this.ziliaoId,
+          //dataId: "1386025423408103425",
           informationName: this.ziliaoName,
           releaseTime: this.ziliaoTime,
           carService: this.carS,
@@ -257,6 +259,7 @@ export default {
       } else {
         //新增
         config.url = "/dealerFeedback";
+        console.log("新增", 222);
       }
 
       this.$emit("update", config);
@@ -298,8 +301,9 @@ export default {
         data: {},
       })
         .then((res) => {
+          console.log(res, 2222222222222222);
           if (res.data.code === 200) {
-            this.carSeries = res.data.data;
+            this.carType = res.data.data;
             this.chooseCarType();
           }
         })
@@ -415,8 +419,12 @@ export default {
     },
 
     initialData: function () {
+      console.log(this.fileName, this.$route.query.informationName);
       this.ziliaoName = this.fileName;
-      this.ziliaoId = this.LinkData.informationId;
+      if(this.LinkData.informationId) this.ziliaoId = this.LinkData.informationId;
+      else{
+        this.ziliaoId =  this.$route.query.informationId;
+      }
 
       this.mediaTitle = this.LinkData.mediaTitle;
       this.mediaUrl = this.LinkData.mediaUrl;
@@ -424,12 +432,14 @@ export default {
 
       this.carT = this.LinkData.carPlatformName;
       let time = this.LinkData.publishDate; //发布时间
-      if (time.length > 4) {
-        let y = time.slice(0, 4);
-        let m = time.slice(5, 7);
-        let d = time.slice(8, 10);
-        let temp = y + "-" + m + "-" + d;
-        this.ziliaoTime = temp;
+      if (time != null) {
+        if (time.length > 4) {
+          let y = time.slice(0, 4);
+          let m = time.slice(5, 7);
+          let d = time.slice(8, 10);
+          let temp = y + "-" + m + "-" + d;
+          this.ziliaoTime = temp;
+        }
       }
 
       //publishPlatformName 发布渠道
@@ -480,7 +490,7 @@ this.readCount&&this.goodCount&&  this.bbsCount&& this.lookingCount */
             obj = this.releaseChannel.find(function (item) {
               return item.platformName === val;
             });
-            console.log(this.releaseC, obj)
+            console.log(this.releaseC, obj);
             //传当前渠道 id,  获取发布版块列表
             this.chooseReleasePlate(obj.id);
           }
@@ -511,12 +521,21 @@ this.readCount&&this.goodCount&&  this.bbsCount&& this.lookingCount */
     },
   },
   mounted() {
+    let localUserId = localStorage.getItem("userId");
+    if (localUserId) {
+      console.log("经销商ID", localUserId);
+      this.userId = localUserId;
+    } else {
+      console.log("经销商ID '-");
+      this.userId = "";
+    }
+
     this.chooseDataName();
     this.chooseCarSeries();
     this.firstContent1Classify();
     this.firstContent2Classify();
 
-this.chooseChannel();
+    this.chooseChannel();
 
     this.initialData();
   },

+ 1 - 1
src/components/TablePage.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="table_page">
+  <div class="table_page" v-show="totalPage > 0">
     <div class="fisrtPage" @click="jumpPage(1)" v-show="currentPage > 1">
       首页
     </div>

+ 40 - 31
src/views/data/InforList.vue

@@ -15,13 +15,6 @@
         </div>
         <button @click="searchByName()">搜索</button>
       </div>
-      <!--    <div class="searchBox">
-        <div class="search_inside">
-          <span><img src="" alt="" /></span>
-          <input type="text" name="" id="" placeholder="请输入要搜索的资料名" />
-          <button>搜索</button>
-        </div>
-      </div> -->
       <div class="sortBox">
         <div class="sort_inside">
           <span>是否下载</span>
@@ -86,7 +79,7 @@
                   > -->
                   <!--  :class="{ reportStyle: obj.report == 0 ? true : false }" -->
                   <!-- <span :class="!showItemOperation">已完成</span> -->
-                  <span
+                  <!-- <span
                     @click="waitToReport(obj, index)"
                     :class="{
                       showItemOperationStyle: obj.report == 1 ? true : false,
@@ -99,7 +92,9 @@
                       showItemOperationStyle: obj.report == 0 ? true : false,
                     }"
                     >已完成</span
-                  >
+                  > -->
+                  <span v-if="!obj.endDate || (obj.endDate && obj.download == 1 && obj.report == 1)">已完成</span>
+                  <span v-else @click="waitToReport(obj, index)" :class="{noDownLoad: obj.download == '0'}">待办</span>
                 </td>
 
                 <td v-if="operation" :style="trStyle" class="operationStyle">
@@ -198,21 +193,11 @@ export default {
         },
       ],
       // 表格配置
-      sum: 10, // 一共有多少条数据
+      sum: 0, // 一共有多少条数据
       pageSize: 20, // 每页展示的数据
       discolor: false, // flase是隔行变色
       currentPage: 1,
-      tableData: [
-        {
-          informationName: "北京博瑞",
-          filePulishTime: "2021/02",
-          accountScope: "传播类型1",
-          fileUploadDate: "",
-          download: "已下载",
-          report: "0",
-          asc: "false",
-        },
-      ],
+      tableData: [],
       tableFileData: [],
       tableHeadStyle: {
         background: "#848484",
@@ -225,7 +210,7 @@ export default {
         overflow: "hidden",
       },
       onlineUrl: env_url, //'http://8.140.188.129:8080'线上 //http://8.136.230.133:8080 //测试
-      userId: localStorage.getItem("userId"),
+      userId: localStorage.getItem("userId") || '',
       endDate: "",
       localReport: "",
     };
@@ -406,6 +391,7 @@ export default {
         },
       })
         .then((res) => {
+          console.log(res, 'aaaaaaaaaaaaaaa')
           if (res.data.code === 200) {
             this.tableData = res.data.data;
             this.sum = res.data.count;
@@ -417,7 +403,6 @@ export default {
     },
     //条件筛选 获取新的资料列表
     newGetDataList: function (config) {
-      console.log("new Getdata1", config);
       this.$http({
         url: "/firmsUploadListByAgent",
         method: "post",
@@ -502,16 +487,36 @@ export default {
       }
     },
     //待办跳转
-    waitToReport: function (obj, i) {
-      this.endDate = this.tableData[i].endDate;
-      this.localReport = this.tableData[i].report;
-      console.log(obj.report == 0, obj.download == 0);
-      console.log(obj);
-      if (obj.report == 0 && obj.download != 0) {
-        console.log("待办跳转");
+    // waitToReport: function (obj, i) {
+    //   this.endDate = this.tableData[i].endDate;
+    //   this.localReport = this.tableData[i].report;
+    //   console.log(obj.report == 0, obj.download == 0);
+    //   console.log(obj);
+    //   if (obj.report == 0 && obj.download != 0) {
+    //     console.log("待办跳转");
+    //     this.$router.push({
+    //       path: "/uploadLink/sonUploadLink",
+    //       query: { informationName: obj.informationName, id: obj.id },
+    //     });
+    //   }
+    // },
+    waitToReport: function(obj) {
+      let data = new Date();
+      let year = data.getFullYear();
+      let month = data.getMonth() + 1;
+      let day = data.getDate();
+      if (month < 10) {
+        month = "0" + month;
+      } else {
+        month = month + "";
+      }
+      let endDate = obj.endDate.replace(RegExp("-", "g"), "");
+      let localDate = year + month + day;
+      let dateFlag = (+endDate) - (+localDate)
+      if (obj.report == 0 && obj.download != 0 && dateFlag >= 0) {
         this.$router.push({
           path: "/uploadLink/sonUploadLink",
-          query: { informationName: obj.informationName, id: obj.id },
+          query: { informationName: obj.informationName, informationId: obj.id },
         });
       }
     },
@@ -630,4 +635,8 @@ export default {
 .showItemOperationStyle {
   display: none;
 }
+.noDownLoad{
+  color: rgb(173, 162, 162);
+  cursor: text!important;
+}
 </style>

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

@@ -36,7 +36,7 @@
             >
               <td v-if="flag">{{ index + 1 }}</td>
 
-              <td>{{ obj.publishDate }}</td>
+              <td>{{ (obj.publishDate || '').replace(RegExp('-', 'g'), '/') }}</td>
               <!-- 发布日期 -->
               <td>{{ obj.informationName }}</td>
               <!-- 资料名称 -->
@@ -71,7 +71,7 @@
                 {{ obj.id ? "已反馈" : "未反馈" }}
               </td>
               <!-- 反馈状态  未定-->
-              <td>{{ obj.endDate }}</td>
+              <td>{{ (obj.endDate || '').replace(RegExp('-', 'g'), '/') }}</td>
               <!-- 反馈截止日期 -->
               <td>{{ obj.mediaTitle }}</td>
               <!-- 稿件标题 -->
@@ -84,7 +84,7 @@
                 <!-- <span @click="toggleModal(index)" :class="showItemOperation"
                   >编辑</span
                 > -->
-                <span @click="toggleModal(index)">编辑</span>
+                <span @click="toggleModal(index)" v-if="+((obj.endDate || '').replace(RegExp('-', 'g'), '')) - nowDate >= 0">编辑</span>
                 <span @click="viewHistoryRecord(obj, index)">查看</span>
                 <!-- <span @click="toggleModal2(index)">删除</span> -->
               </td>
@@ -100,6 +100,7 @@
         @update="editTitle"
         :selectedPlatform="selectedPlatform"
         :releaseMedia="releaseMedia"
+        :userId='userId'
       ></Modal>
 
       <!-- 弹窗: 确定删除? -->
@@ -198,7 +199,7 @@
 </template>
 
 <script>
-import Modal from "../../components/Modal";
+import Modal from "./components/UploadLinkEditModal";
 import TablePage from "../../components/TablePage";
 import deleteModal from "../data/components/UploadLinkModalDelete";
 import { env_url } from "../../config/env";
@@ -232,7 +233,7 @@ export default {
       showModal3: false,
       showModal4: false,
       // 表格配置
-      sum: 20, // 一共有多少条数据
+      sum: 0, // 一共有多少条数据
       pageSize: 20, // 每页展示的数据
       discolor: false, // false是隔行变色
       currentPage: 1,
@@ -256,17 +257,6 @@ export default {
         "操作",
       ],
       tableData: [
-        {
-          informationId: "2021/03/04",
-          publishDate: "雷克萨斯ES上市",
-          carTypeName: "雷克萨斯ES",
-          carPlatformName: "ES雷克萨斯",
-          publishSourceName: "S雷克萨斯",
-          projectTypeName: "东区1",
-          contentTypeName: "雷克萨斯ES",
-          mediaTitle: "ES雷克萨斯",
-          mediaUrl: "S雷克萨斯",
-        },
       ],
       flag: true,
       modalData: {}, //17:44
@@ -294,9 +284,10 @@ export default {
       file: "",
       dictList: [],
       onlineUrl: env_url, //'http://8.140.188.129:8080'线上 //http://8.136.230.133:8080 //测试
-      userId: 254,
+      userId: '',
       //截止日期
       endTime: "",
+      nowDate: 0
     };
   },
   computed: {
@@ -321,6 +312,19 @@ export default {
     },
   },
   methods: {
+    getNowDate: function() {
+      let data = new Date();
+      let year = data.getFullYear();
+      let month = data.getMonth() + 1;
+      let day = data.getDate();
+      if (month < 10) {
+        month = "0" + month;
+      } else {
+        month = month + "";
+      }
+      this.nowDate = +(year + month + day);
+      console.log(this.nowDate);
+    },
     /*toggleModal:点击编辑后弹窗; toggleModal2:点击删除后弹窗; toggleModal3:点击导入后弹窗;  */
     toggleModal: function (i) {
       this.showModal = !this.showModal;
@@ -427,7 +431,6 @@ export default {
     },
     //获取资料列表
     getDataList: function (config) {
-      console.log(config);
       this.$http({
         url: "/firmsLinkUpload",
         method: "post",
@@ -438,6 +441,7 @@ export default {
         },
       })
         .then((res) => {
+          console.log(res, 3333333333)
           if (res.data.code === 200) {
             let data = res.data.data;
             console.log(data);
@@ -447,7 +451,7 @@ export default {
               this.$set(this.tableData, i, data[j]);
             }
             //修改素材时间显示格式
-            let len = this.tableData.length;
+           /*  let len = this.tableData.length;
             for (let i = 0; i < len; i++) {
               let newValue = "";
               let temp = this.tableData[i].publishDate;
@@ -465,7 +469,7 @@ export default {
               } else {
                 this.$set(this.tableData[i], "publishDate", newValue);
               }
-            }
+            } */
             //console.log(this.tableData);
           }
         })
@@ -523,6 +527,7 @@ export default {
     submitRequest: function () {
       let paramData = new FormData();
       this.file.forEach((item) => {
+        console.log(item, 'item');
         paramData.append("file", item);
       });
       this.$http
@@ -531,7 +536,7 @@ export default {
           if (res.data && res.data.code === 200) {
             console.log("上传成功!");
           } else {
-            alert("res.data || res.data.code !== 200");
+            alert(res.data.message);
             console.log(res);
           }
         })
@@ -551,7 +556,7 @@ export default {
           if (res.data.code === 200) {
             this.platform = res.data.data;
             this.platformVal = this.platform[0].platformName;
-            this.choosePlatform();
+           // this.choosePlatform();
           }
         })
         .catch((err) => {
@@ -697,7 +702,7 @@ export default {
     viewHistoryRecord: function (obj, index) {
       this.$router.push({
         path: "uploadLink/sonUploadLink",
-        query: { informationName: obj.informationName, id: obj.id, i: index },
+        query: { informationName: obj.informationName, informationId: obj.informationId, i: index },
       });
     },
     isFather: function () {
@@ -706,13 +711,14 @@ export default {
     },
   },
   mounted() {
+    this.getNowDate();
     let localUserId = localStorage.getItem("userId");
     if (localUserId) {
       console.log("经销商ID", localUserId);
       this.userId = localUserId;
     } else {
-      console.log("经销商ID 254");
-      this.userId = 254;
+      console.log("经销商ID '-");
+      this.userId = '';
     }
     // this.getPlatform();
     //分页取数据

+ 80 - 89
src/views/data/UploadLink/sonUploadLink.vue

@@ -26,7 +26,7 @@
           >
             <td v-if="flag">{{ index + 1 }}</td>
 
-            <td>{{ obj.publishDate }}</td>
+            <td>{{ (obj.publishDate || '').replace(RegExp('-', 'g'), '/') }}</td>
             <!-- 发布日期 -->
             <td>{{ obj.informationName }}</td>
             <!-- 资料名称 -->
@@ -61,7 +61,7 @@
               {{ obj.id ? "已反馈" : "未反馈" }}
             </td>
             <!-- 反馈状态  未定-->
-            <td>{{ obj.endDate }}</td>
+            <td>{{ (obj.endDate || '').replace(RegExp('-', 'g'), '/') }}</td>
             <!-- 反馈截止日期 -->
             <td>{{ obj.mediaTitle }}</td>
             <!-- 稿件标题 -->
@@ -70,7 +70,7 @@
             </td>
             <!-- 链接 -->
 
-            <td class="operationStyle" style="cursor: pointer">
+            <td class="operationStyle" style="cursor: pointer" v-if="+((obj.endDate || '').replace(RegExp('-', 'g'), '')) - nowDate >= 0">
               <span @click="toggleModal(index)">编辑</span>
               <!-- :class="showItemOperation" -->
               <span @click="toggleModal2(index)">删除</span>
@@ -92,9 +92,8 @@
     <Modal
       v-if="showModalAdd"
       v-on:closeme="closemeAdd"
-     
       @update="editTitle"
-      :fileName="tableData[0].informationName"
+      :fileName='sfileName'
     ></Modal>
 
     <!-- 弹窗: 确定删除? -->
@@ -133,6 +132,7 @@ export default {
   },
   data() {
     return {
+      sfileName: this.$route.query.informationName,
       publishCount: "",
       platform: [],
       platformVal: "",
@@ -148,7 +148,7 @@ export default {
       showModal3: false,
       showModal4: false,
       // 表格配置
-      sum: 20, // 一共有多少条数据
+      sum: 0, // 一共有多少条数据
       pageSize: 20, // 每页展示的数据
       discolor: false, // false是隔行变色
       currentPage: 1,
@@ -171,66 +171,17 @@ export default {
         "链接",
         "操作",
       ],
-      tableData: [
-        {
-          accountId: "254",
-          bbsCount: 0,
-          carPlatformName: "123",
-          carTypeName: "test",
-          contentTypeName: "test2222",
-          dlrCode: "L0M32",
-          dlrName: "苏州常隆锦宸",
-          endDate: null,
-          endTime: null,
-          goodCount: 0,
-          id: "1382528052292362241",
-          informationId: "1381083607097311234",
-          informationName: "son固定数据",
-          localArea: "东区",
-          lookingCount: 0,
-          mediaTitle: "manufacturer",
-          mediaTypeName: "内容分类1",
-          mediaUrl: "https://www.ncbi.cn",
-          projectTypeName: null,
-          publishDate: "2021-04-15",
-          publishPlatformName: "4",
-          publishSourceName: "",
-          queryParams: null,
-          readCount: 0,
-          reportDate: "2021-04-15T10:55:48.452",
-          startTime: null,
-        },
-      ],
+      tableData: [],
       flag: true,
       modalData: {}, //17:44
-      emptyData: {
-        accountId: "",
-        carPlatformName: "",
-        carTypeName: "",
-        mediaTypeName: "",
-        contentTypeName: "",
-        endTime: null,
-        id: "",
-        informationId: "",
-        informationName: "",
-        localArea: "",
-        mediaTitle: null,
-        //mediaTypeName: "",
-        mediaUrl: "",
-        projectTypeName: "",
-        publishDate: "",
-        publishPlatformName: "",
-        publishSourceName: "",
-        queryParams: null,
-        startTime: null,
-      },
       file: "",
       dictList: [],
       onlineUrl: env_url, //'http://8.140.188.129:8080'线上 //http://8.136.230.133:8080 //测试
-
-      userId: 254,
+      accountId: '',
       informationName: this.$route.query.informationName || "",
-      ziliaoId: this.$route.query.informationId || "",
+      ziliaoId: this.$route.query.id || "",
+
+      nowDate: '',//反馈截止时间
     };
   },
   computed: {
@@ -249,6 +200,19 @@ export default {
     },
   },
   methods: {
+    getNowDate: function() {
+      let data = new Date();
+      let year = data.getFullYear();
+      let month = data.getMonth() + 1;
+      let day = data.getDate();
+      if (month < 10) {
+        month = "0" + month;
+      } else {
+        month = month + "";
+      }
+      this.nowDate = +(year + month + day);
+      console.log(this.nowDate);
+    },
     /*toggleModal:点击编辑后弹窗; toggleModal2:点击删除后弹窗; toggleModal3:点击导入后弹窗;  */
     toggleModal: function (i) {
       this.showModal = !this.showModal;
@@ -281,7 +245,8 @@ export default {
         .then((res) => {
           console.log(res);
           //更新数据
-          this.choosePlatform();
+          //this.choosePlatform();
+          this.newGetDataList();
         })
         .catch((err) => {
           console.log(err);
@@ -293,7 +258,8 @@ export default {
       this.showModal2 = !this.showModal2;
       //更新数据
 
-      this.choosePlatform();
+      //this.choosePlatform();
+      this.newGetDataList();
     },
     /* 表格翻页 */
     changePage: function (page) {
@@ -319,45 +285,57 @@ export default {
       console.log(this.currentPage);
     },
     //获取资料列表
-    getDataList: function (config) {
-      let date = new Date();
-      let m = date.getMonth() + 1;
-      let y = date.getFullYear();
-      let d = y + "/" + m;
+    getDataList: function () {
+      // let date = new Date();
+      // let m = date.getMonth() + 1;
+      // let y = date.getFullYear();
+      // let d = y + "/" + m;
       this.$http({
         url: "/firmsLinkUpload",
         method: "post",
         data: {
-          month: d,
-          publishPlatformId: config,
+          accountId: this.accountId,
+          informationId: this.$route.query.informationId,
+          page: this.currentPage,
+          rows: this.pageSize,
         },
       })
         .then((res) => {
+          console.log(res);
           if (res.data.code === 200) {
             let data = res.data.data;
-            console.log(data);
+            console.log(data, 2222);
             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[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);
-              }
+          }
+        })
+        .catch((err) => {
+          console.log(err);
+        });
+    },
+    newGetDataList: function () {
+      this.$http({
+        url: "/firmsLinkUpload",
+        method: "post",
+        data: {
+          accountId: this.accountId,
+          informationId: this.$route.query.informationId,
+          page: this.currentPage,
+          rows: this.pageSize
+        },
+      })
+        .then((res) => {
+          console.log(res);
+          if (res.data.code === 200) {
+            this.tableData = [];
+            let data = res.data.data;
+            console.log(data, 333333333333333);
+            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);
           }
         })
         .catch((err) => {
@@ -370,8 +348,21 @@ export default {
       //this.modalData = this.tableData[i];
     },
   },
-  mounted() {},
-  created() {},
+  mounted() {
+    let userId = localStorage.getItem("userId");
+    console.log(userId);
+    if (userId) {
+      this.accountId = userId;
+      this.getDataList();
+    } else {
+      this.accountId = "";
+      this.getDataList();
+    }
+    this.getNowDate();
+  },
+  created() {
+    
+  },
 };
 </script>
 

+ 1 - 1
src/views/data/UploadLinks.vue

@@ -148,7 +148,7 @@ export default {
         data: data,
       })
         .then((res) => {
-          console.log(res.data.data);
+          console.log(res.data, 111111);
           this.tableData = res.data.data;
           this.sum = res.data.count;
         })

+ 495 - 0
src/views/data/components/UploadLinkEditModal.vue

@@ -0,0 +1,495 @@
+<template>
+  <div class="modal-backdrop">
+    <div class="modal">
+      <div class="modal-header">
+        <span>编辑</span>
+      </div>
+      <div class="modal-body">
+        <div class="bodyRow">
+          <span>资料名称</span>
+          <div>{{ ziliaoName }}</div>
+        </div>
+        <div class="bodyRow timeWidth">
+          <span>发布时间</span
+          ><input type="date" placeholder="选择时间" v-model="ziliaoTime" />
+        </div>
+        <div class="bodyRow">
+          <div class="contentCol1">
+            <span>涉及车型</span
+            ><select v-model="carTypeValue">
+              <option
+                v-for="(item, index) in carType"
+                :key="index"
+                :value="item.typeName"
+              >
+                {{ item.typeName || "123" }}
+              </option>
+            </select>
+          </div>
+        </div>
+        <div class="bodyRow">
+          <div class="contentCol1">
+            <span>发布渠道</span>
+            <select
+              name=""
+              id=""
+              v-model="releaseC"
+              @change="chooseChannel($event)"
+            >
+              <option v-for="(item, index) in releaseChannel" :key="index">
+                <!-- :value="item.platformName" -->
+                {{ item.platformName || "11" }}
+              </option>
+            </select>
+          </div>
+          <div class="contentCol2">
+            <span>平台版块</span
+            ><select name="" id="" v-model="releaseP">
+              <option v-for="(item, index) in releasePlate" :key="index">
+                <!-- :value="item.platformName" -->
+                {{ item.platformName || "22" }}
+              </option>
+            </select>
+          </div>
+        </div>
+        <div class="bodyRow">
+          <div class="contentCol1">
+            <span>稿件类别</span
+            ><select name="" id="" v-model="contentName1">
+              <option v-for="(item, index) in content1" :key="index">
+                <!-- :value="item.dictName" -->
+                {{ item.dictName }}
+              </option>
+            </select>
+          </div>
+          <div class="contentCol2">
+            <span>内容分类</span
+            ><select name="" id="" v-model="contentName2">
+              <option v-for="(item, index) in content2" :key="index">
+                <!-- :value="item.dictName" -->
+                {{ item.dictName }}
+              </option>
+            </select>
+          </div>
+        </div>
+        <div class="bodyRow">
+          <div class="contentCol1">
+            <span>阅读量</span>
+            <input type="number" placeholder="" min="0" v-model="readCount" />
+          </div>
+          <div class="contentCol2">
+            <span>点赞</span>
+            <input type="number" placeholder="" min="0" v-model="goodCount" />
+          </div>
+        </div>
+        <div class="bodyRow">
+          <div class="contentCol1">
+            <span>评论</span>
+            <input type="number" placeholder="" min="0" v-model="bbsCount" />
+          </div>
+          <div class="contentCol2">
+            <span>在看/转发</span>
+            <input
+              type="number"
+              placeholder=""
+              min="0"
+              v-model="lookingCount"
+            />
+          </div>
+        </div>
+        <div class="bodyRow longInput">
+          <span>标题</span>
+          <input type="text" placeholder="文章标题" v-model="mediaTitle" />
+        </div>
+        <div class="bodyRow longInput">
+          <span>链接</span>
+          <input type="text" placeholder="文章发布地址" v-model="mediaUrl" />
+        </div>
+      </div>
+      <div class="modal-footer">
+        <!-- <button type="button" class="btn-confirm" @click="confirm">确认</button> -->
+        <button type="button" class="btn-confirm" @click="testUrl()">
+          确认
+        </button>
+        <button type="button" class="btn-close" @click="closeSelf">取消</button>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "Modal",
+  props: {
+    LinkData: {
+      type: Object,
+      default: () => {
+        return {};
+      },
+    },
+    userId: {
+      type: String,
+      default: "",
+    },
+  },
+  data() {
+    return {
+      ziliaoName: this.LinkData.informationName,
+      ziliaoId: "",
+      ziliaoTime: "",
+      carTypeValue: "1",
+      carType: [],
+      releaseC: this.LinkData.publishPlatformName, //'发布渠道',
+      releaseChannel: [], // 发布渠道列表
+      releaseP: this.LinkData.publishSourceName, //'平台版块',
+      releasePlate: [], // 平台版块
+      contentName1: this.LinkData.mediaTypeName, //"稿件类别",
+      content1: [],
+      contentName2: this.LinkData.contentTypeName, //'内容分类',
+      content2: [],
+      readCount: 0,
+      goodCount: 1,
+      bbsCount: 1,
+      lookingCount: 2,
+      mediaTitle: this.LinkData.mediaTitle || "", //'文章标题',
+      mediaUrl: this.LinkData.mediaUrl || "",
+      dictList: [],
+      initParentId: ''
+    };
+  },
+  methods: {
+    // 改变发布渠道
+    chooseChannel: function (e) {
+      let index = e.target.options.selectedIndex;
+      let req = {
+        parentId: this.releaseChannel[index].id,
+      };
+      this.channelType(req);
+    },
+    // 确认
+    testUrl: function () {
+      var regex = /^http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?$/;
+      let flag = regex.test(this.mediaUrl);
+      if (flag) {
+        this.edit();
+      } else {
+        alert("链接输入有误!\n示例:https://www.baidu.com");
+      }
+    },
+    // 取消
+    closeSelf: function () {
+      this.$emit("closeme");
+    },
+    edit() {
+      //当前月份
+      let date = new Date();
+      let m = date.getMonth() + 1;
+      let y = date.getFullYear();
+      let d = y + "/" + m;
+      let config = {
+        url: "",
+        data: {
+          id: "",
+          month: d,
+          dealerId: this.userId,
+          dataId: this.ziliaoId,
+          informationName: this.ziliaoName,
+          //   releaseTime: this.ziliaoTime,
+          releaseTime: this.ziliaoTime,
+          carType: this.carTypeValue,
+
+          //发布平台  渠道
+          releaseMedia: this.releaseC,
+          //发布板块
+          releasePlate: this.releaseP,
+
+          draftGenre: this.contentName1,
+
+          //内容分类2?
+          contentClass: this.contentName2,
+          articleTitle: this.mediaTitle,
+          articleLink: this.mediaUrl,
+
+          readCount: this.readCount,
+          goodCount: this.goodCount,
+          bbsCount: this.bbsCount,
+          lookingCount: this.lookingCount,
+          //   informationId: "1386025423408103425"
+        },
+      };
+      if (this.LinkData.id) {
+        config.url = "/updateDealerFeedback";
+        config.data.id = this.LinkData.id;
+      } else {
+        //新增
+        config.url = "/dealerFeedback";
+      }
+      this.$emit("update", config);
+      this.closeSelf();
+    },
+    initialData: function () {
+      this.ziliaoName = this.LinkData.informationName;
+      this.carTypeValue = this.LinkData.carPlatformName;
+      this.ziliaoId = this.LinkData.informationId;
+      let time = this.LinkData.publishDate; //发布时间
+      if (time.length > 4) {
+        let y = time.slice(0, 4);
+        let m = time.slice(5, 7);
+        let d = time.slice(8, 10);
+        let temp = y + "-" + m + "-" + d;
+        this.ziliaoTime = temp;
+      }
+      this.readCount = this.LinkData.readCount;
+      this.goodCount = this.LinkData.goodCount;
+      this.bbsCount = this.LinkData.bbsCount;
+      this.lookingCount = this.LinkData.lookingCount;
+    },
+    getCarType: function () {
+      this.$http({
+        method: "post",
+        url: "/base/carTypeManager/selectCarTypePage",
+        data: {},
+      })
+        .then((res) => {
+          if (res.data && res.data.code === 200) {
+            this.carType = res.data.data;
+            console.log(this.carType, 22);
+          } else {
+            console.log(res);
+          }
+        })
+        .catch((err) => {
+          console.log(err);
+        });
+    },
+    channelType: function (data) {
+      return new Promise((resolve, reject) => {
+        this.$http({
+          url: "/base/publishPlatformManager/selectPublishPlatformPage",
+          method: "post",
+          data,
+        })
+          .then((res) => {
+            this.releasePlate = [];
+            if (res.data.code === 200) {
+              if (!data) {
+                let initPlat = this.LinkData.publishPlatformName;
+                this.releaseChannel = res.data.data;
+                this.releaseChannel.forEach((item) => {
+                  if (item.platformName === initPlat) {
+                      this.initParentId = item.id;
+                  }
+                });
+              } else {
+                this.releasePlate = res.data.data;
+              }
+            }
+            resolve();
+          })
+          .catch((err) => {
+            console.log(err);
+            reject()
+          });
+      });
+    },
+    // 获取内容分类、媒体平台、常用参数接口的标识,再调接口时需要用到
+    selectSysDataDictList: function () {
+      return new Promise((resolve, reject) => {
+        this.$http({
+          method: "post",
+          url: "/sys/dataDict/selectSysDataDictList",
+          data: {},
+        })
+          .then((res) => {
+            if (res.data && res.data.code === 200) {
+              this.dictList = res.data.data;
+              resolve();
+            } else {
+              console.log(res);
+              reject();
+            }
+          })
+          .catch((err) => {
+            console.log(err);
+            reject();
+          });
+      });
+    },
+    getContent1: function () {
+      this.$http({
+        method: "post",
+        url: "/sys/dataDict/selectSysDataDictPage",
+        data: {
+          dictCode: this.dictList[1]["dictCode"],
+          parentId: this.dictList[1]["id"],
+        },
+      })
+        .then((res) => {
+          if (res.data && res.data.code === 200) {
+            this.content1 = res.data.data;
+          } else {
+            console.log(res);
+          }
+        })
+        .catch((err) => {
+          console.log(err);
+        });
+    },
+    getContent2: function () {
+      this.$http({
+        method: "post",
+        url: "/sys/dataDict/selectSysDataDictPage",
+        data: {
+          dictCode: this.dictList[2]["dictCode"],
+          parentId: this.dictList[2]["id"],
+        },
+      })
+        .then((res) => {
+          if (res.data && res.data.code === 200) {
+            this.content2 = res.data.data;
+          } else {
+            console.log(res);
+          }
+        })
+        .catch((err) => {
+          console.log(err);
+        });
+    },
+  },
+  mounted() {
+    this.initialData();
+    this.getCarType();
+    this.channelType().then(() => {
+      let req = {
+        parentId: this.initParentId,
+      };
+      this.channelType(req)
+    });
+    this.selectSysDataDictList().then(() => {
+      this.getContent1();
+      this.getContent2();
+    });
+  },
+};
+</script>
+
+<style>
+.modal-backdrop {
+  position: fixed;
+  top: 0;
+  right: 0;
+  bottom: 0;
+  left: 0;
+  background-color: #7d9191;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+.modal {
+  background-color: #eeeeee;
+  box-shadow: 2px 2px 20px 1px;
+  overflow-x: auto;
+  display: flex;
+  flex-direction: column;
+  border-radius: 0px;
+  width: 1030px;
+}
+.modal-header {
+  border-bottom: 1px solid #eee;
+  color: #313131;
+  justify-content: space-between;
+  padding: 15px;
+  display: flex;
+  border-bottom: 1px solid #e3e3e3;
+}
+.modal-header span {
+  font-size: 16px;
+  font-weight: bold;
+}
+.modal-footer {
+  border-top: 1px solid #eee;
+  justify-content: center;
+  padding: 15px;
+  display: flex;
+}
+.modal-footer button {
+  width: 90px;
+  margin-left: 0px;
+}
+.modal-footer button:nth-child(1) {
+  margin-right: 80px;
+}
+.modal-body {
+  position: relative;
+  padding: 20px 120px 20px 180px;
+}
+.modal-body span,
+select,
+input,
+div {
+  font-size: 14px;
+}
+
+.btn-close,
+.btn-confirm {
+  border-radius: 8px;
+  margin-left: 16px;
+  width: 56px;
+  height: 36px;
+  border: none;
+  cursor: pointer;
+}
+.btn-close {
+  color: #313131;
+  background-color: gray;
+}
+.btn-confirm {
+  color: #fff;
+  background-color: #0056a0;
+}
+.bodyRow {
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+  padding: 4px;
+}
+.bodyRow span {
+  width: 80px;
+  margin: 10px;
+}
+.bodyRow select {
+  width: 120px;
+}
+.bodyRow input {
+  width: 112px;
+}
+.longInput input {
+  width: 476px;
+}
+.bodyRow select,
+input {
+  padding: 2px;
+}
+.contentCol1 {
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+}
+.contentCol1 span {
+  width: 80px;
+  margin: 10px;
+}
+.contentCol1 div {
+  width: 120px;
+}
+.contentCol2 {
+  display: flex;
+  justify-content: flex-end;
+  align-items: center;
+  width: 363px;
+}
+.timeWidth input {
+  width: 150px;
+}
+</style>
+