浏览代码

链接上传

liuYb 4 年之前
父节点
当前提交
5e7e226309
共有 5 个文件被更改,包括 125 次插入57 次删除
  1. 1 1
      src/App.vue
  2. 83 20
      src/components/Modal.vue
  3. 1 1
      src/views/data/InforList.vue
  4. 38 34
      src/views/data/UploadLink.vue
  5. 2 1
      src/views/data/components/InfoListItemDetail.vue

+ 1 - 1
src/App.vue

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

+ 83 - 20
src/components/Modal.vue

@@ -19,7 +19,8 @@
           </select>
         </div>
         <div class="bodyRow timeWidth">
-          <span>发布时间</span><input type="date" placeholder="选择时间" />
+          <span>发布时间</span
+          ><input type="date" placeholder="选择时间" v-model="ziliaoTime" />
         </div>
         <div class="bodyRow">
           <div class="contentCol1">
@@ -36,7 +37,7 @@
           </div>
           <div class="contentCol2">
             <span>车型</span
-            ><select>
+            ><select v-model="carT">
               <option
                 v-for="(item, index) in carType"
                 :key="index"
@@ -54,11 +55,11 @@
           </div>
           <div class="contentCol2">
             <span>发布板块</span
-            ><select name="" id="">
+            ><select name="" id="" v-model="releaseP">
               <option
                 v-for="(item, index) in releasePlate"
                 :key="index"
-                :value="item.id"
+                :value="item.platformName"
               >
                 {{ item.platformName }}
               </option>
@@ -74,11 +75,11 @@
         <div class="bodyRow">
           <div class="contentCol1">
             <span>内容分类1</span
-            ><select name="" id="">
+            ><select name="" id="" v-model="contentName1" >
               <option
                 v-for="(item, index) in content1"
                 :key="index"
-                :value="item.id"
+                :value="item.dictName"
               >
                 {{ item.dictName }}
               </option>
@@ -86,11 +87,11 @@
           </div>
           <div class="contentCol2">
             <span>内容分类2</span
-            ><select name="" id="">
+            ><select name="" id="" v-model="contentName2">
               <option
                 v-for="(item, index) in content2"
                 :key="index"
-                :value="item.id"
+                :value="item.dictName"
               >
                 {{ item.dictName }}
               </option>
@@ -134,12 +135,12 @@ export default {
         return "";
       },
     },
-    sonPlatformId: {
+  /*   sonPlatformId: {
       type: String,
       default: () => {
         return "";
       },
-    },
+    }, */
     releasePlate: {
       type: Array,
       default: () => {
@@ -154,9 +155,11 @@ export default {
       carType: [],
       content1: [],
       content2: [],
-     // releasePlate: [],
+      // releasePlate: [],
 
       carS: "",
+      carT: "",
+      releaseP: "",
       ziliaoId: "",
       content1Id: "",
       content2Id: "",
@@ -169,26 +172,87 @@ export default {
       projectTypeName: "",
       publishDate: "",
       publishSourceName: "",
+
+      ziliaoName: "",
+      ziliaoTime: "",
+      contentName1: "",
+      contentName2: "",
     };
   },
   methods: {
     closeSelf() {
       this.$emit("closeme");
     },
+   /*  getAllFileInfo: function () {
+      let obj = {};
+      //获取资料名
+      obj = this.dataName.find(function (item) {
+        return item.id === this.ziliaoId;
+      });
+      this.ziliaoName = obj.informationName;
+      //获取车系
+      obj = this.carSeries.find(function (item) {
+        return item.id === this.ziliaoId;
+      });
+      this.carTypeName = obj.typeName;
+      //获取车型 this.carT
+      //获取平台 this.selectedPlatform,
+      let info = {
+        informationName: this.ziliaoName,
+        releaseTime: this.ziliaoTime,
+        carService: this.carTypeName,
+        carType: this.carT,
+        releasePlate: this.selectedPlatform,
+        releaseMedia: this.releaseP,
+        contentClass: "",
+        articleTitle: this.mediaTitle,
+        articleLink: this.mediaUrl,
+      };
+      console.log(info);
+    }, */
     //message: "没有找到经销商信息"// url: "/importDealerFeedback",
-    //message: "没有要导入的文件" accountId agentName agentId dlrName dlrCode dealerId dataId
+    //message: "没有要导入的文件"
     edit: function () {
+      let obj = {};
+      //获取资料名
+      let idVal = this.ziliaoId;
+      obj = this.dataName.find(function (item) {
+        return item.id === idVal;
+      });
+      this.ziliaoName = obj.informationName;
+      //获取车系名
+      let idCarS = this.carS;
+      obj = this.carSeries.find(function (item) {
+        return item.id === idCarS;
+      });
+      this.carTypeName = obj.typeName;
+      //获取车型名 this.carT
+      //获取平台名 this.selectedPlatform,
+
+      //当前月份
+      let date = new Date();
+      let m = date.getMonth() + 1;
+      let y = date.getFullYear();
+      let d = y + '/' + m;
       let config = {
         url: "/dealerFeedback",
         data: {
-          dealerId: "L0210_MM",
-          //id: '1377835162976477186',
-          dataId: "1377835162976477186",
-          Title: this.mediaTitle,
-          Url: this.mediaUrl,
+          month: d,
+          dealerId: "254",
+          dataId: this.ziliaoId,
+          informationName: this.ziliaoName,
+          releaseTime: this.ziliaoTime,
+          carService: this.carTypeName,
+          carType: this.carT,
+          releasePlate: this.selectedPlatform,
+          releaseMedia: this.releaseP,
+          draftGenre:  this.contentName1,
+          contentClass: this.contentName1,
+          articleTitle: this.mediaTitle,
+          articleLink: this.mediaUrl,
         },
       };
-      console.log("edit2:", config);
+    //  console.log("edit2:", config);
       this.$emit("update", config);
     },
     //资料名称列表
@@ -208,7 +272,7 @@ export default {
         });
     },
     //发布版块
-   /*  chooseReleasePlate: function () {
+    /*  chooseReleasePlate: function () {
       console.log(this.sonPlatformId)
       this.$http({
         url: "/base/publishPlatformManager/selectPublishPlatformList",
@@ -228,7 +292,6 @@ export default {
         });
     }, */
 
-
     //不分页查询车系车型信息
     chooseCarSeries: function () {
       this.$http({

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

@@ -150,7 +150,7 @@ export default {
               url: "/dealerDownload",
               data: {
                 informationId: obj.id,
-                agentId: obj.agentId,
+               // agentId: obj.agentId,
               },
             };
             this.downloadPost(config);

+ 38 - 34
src/views/data/UploadLink.vue

@@ -5,7 +5,7 @@
     <div class="contentHead">
       <span>上传平台</span>
       <select name="" id="" v-model="platformVal" @change="choosePlatform">
-        <option value="">请选择</option>
+        <!--  <option value="">请选择</option> -->
         <option
           v-for="(item, index) in platform"
           :key="index"
@@ -35,10 +35,10 @@
             :class="{ table_gray: index % 2 === 0 }"
           >
             <td v-if="flag">{{ index + 1 }}</td>
-            <td>{{ obj.informationId }}</td>
-            <!-- 资料名称 待定-->
             <td>{{ obj.publishDate }}</td>
             <!-- 发布日期 -->
+            <td>{{ obj.informationId }}</td>
+            <!-- 资料名称 待定-->
             <td>{{ obj.carTypeName }}</td>
             <!-- 车系 -->
             <td>{{ obj.carPlatformName }}</td>
@@ -74,10 +74,9 @@
     <Modal
       v-show="showModal"
       v-on:closeme="closeme"
-      :Linkdata="tableData"
+      :Linkdata="modalData"
       @update="editTitle"
       :selectedPlatform="selectedPlatform"
-      :sonPlatformId="platformId"
       :releasePlate="releasePlate"
     ></Modal>
 
@@ -172,7 +171,7 @@ export default {
       publishCount: "",
       platform: [],
       platformVal: "",
-      platformId: "",
+      
       releasePlate: [],
       selectedPlatform: "",
       nowIndex: 0,
@@ -202,17 +201,7 @@ export default {
         "操作",
       ],
       tableData: [
-        {
-          /* <!-- 资料名称 待定--> 
-      <!-- 发布日期 -->
-      <!-- 车系 --> 
-      <!-- 车型 -->
-      <!-- 发布版块 -->
-      <!-- 项目分类 -->
-      <!-- 内容分类 -->
-      <!-- 内容分类 -->
-      <!-- 稿件标题 -->
-      <!-- 链接 --> */
+        /*  {
           informationId: "2021/03/04",
           publishDate: "雷克萨斯ES上市",
           carTypeName: "雷克萨斯ES",
@@ -244,7 +233,7 @@ export default {
           contentTypeName: "",
           mediaTitle: "",
           mediaUrl: "",
-        },
+        }, */
       ],
       flag: true,
       operation: [
@@ -306,10 +295,9 @@ export default {
     closeme4: function () {
       this.showModal4 = !this.showModal4;
     },
-    /* 编辑内容,,传参 */
+    /* 编辑内容,,Modal传参 */
     editTitle: function (val) {
       console.log("editTitle文件:", val);
-      //this.Linkdata = new Array(val);
       this.$http({
         url: val.url,
         method: "post",
@@ -364,19 +352,27 @@ export default {
     },
     //获取资料列表
     getDataList: function (config) {
+      let date = new Date();
+      let m = date.getMonth() + 1;
+      let y = date.getFullYear();
+      let d = y + '/' + m;
       this.$http({
         url: "/firmsLinkUpload",
         method: "post",
         data: {
-          //id: config,
-          platformName: config,
+          month: d,
+          publishPlatformId: config,
         },
       })
         .then((res) => {
           if (res.data.code === 200) {
-            this.tableData = res.data.data;
+            this.tableData = [];
+            let data = res.data.data;
+            //this.tableData.push(data[0]);
+            Array.prototype.push.apply(this.tableData, data);
           }
           console.log("uploadLink this.tableData:", this.tableData);
+          console.log(res.data.data)
         })
         .catch((err) => {
           console.log(err);
@@ -477,29 +473,37 @@ export default {
       obj = this.platform.find(function (item) {
         return item.platformName === val;
       });
-      
-      this.selectedPlatform = this.platformVal;
-      this.getDataList(this.platformVal);
-      this.getReleaseQuantity(obj.id); //发布平台ID
-      this.platformId = obj.id;
-      console.log(obj);
-      console.log(this.platformId);
+      this.selectedPlatform = val;
+
+      //发布平台ID
+      this.getDataList(obj.id);
+
+      //获取可发布数量
+      this.getReleaseQuantity(obj.id);
+      //获取发布版块
       this.chooseReleasePlate(obj.id);
     },
     //获取可发布数量
     getReleaseQuantity: function (val) {
+      let date = new Date();
+      let m = date.getMonth() + 1;
+      let y = date.getFullYear();
+      let d = y + '/' + m;
       this.$http({
         url: "/base/mediaPublishManager/selectMediaPublishList",
         method: "post",
         data: {
           id: val,
+          month: d,
         },
       })
         .then((res) => {
           if (res.data.code === 200) {
-            this.publishCount = res.data.data;
+            this.publishCount = res.data.data[1].publishCount;
             let len = this.publishCount;
-            while (len) {
+            let l = this.tableData.length;
+            console.log("获取可发布数量", len, l);
+            while (len > l) {
               this.tableData.push([]);
               len--;
             }
@@ -515,11 +519,11 @@ export default {
         url: "/base/publishPlatformManager/selectPublishPlatformList",
         method: "post",
         data: {
-          parentId: val
+          parentId: val,
         },
       })
         .then((res) => {
-          console.log(res)
+          console.log(res);
           if (res.data.code === 200) {
             this.releasePlate = res.data.data;
           }

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

@@ -96,7 +96,8 @@ export default {
     // 下载附件
     downloadFile: function (index) {
       let config={
-        informationId: this.fileData[index].id
+        informationId: this.fileData[index].informationId,
+        fileId: this.fileData[index].id,
       }
       console.log("下载附件:", config);
       return new Promise((resolve, reject) => {