Sfoglia il codice sorgente

链接上传各接口

liuYb 4 anni fa
parent
commit
0be9d00981
3 ha cambiato i file con 194 aggiunte e 31 eliminazioni
  1. 1 1
      src/App.vue
  2. 127 24
      src/components/Modal.vue
  3. 66 6
      src/views/data/UploadLink.vue

+ 1 - 1
src/App.vue

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

+ 127 - 24
src/components/Modal.vue

@@ -8,11 +8,11 @@
       <div class="modal-body">
         <div class="bodyRow">
           <span>资料名称</span>
-          <select>
+          <select v-model="ziliaoId">
             <option
               v-for="(item, index) in dataName"
               :key="index"
-              :value="item.informationName"
+              :value="item.id"
             >
               {{ item.informationName }}
             </option>
@@ -24,11 +24,11 @@
         <div class="bodyRow">
           <div class="contentCol1">
             <span>车系</span
-            ><select name="" id="">
+            ><select v-model="carS" @change="chooseCarSeries">
               <option
                 v-for="(item, index) in carSeries"
                 :key="index"
-                :value="item.typeName"
+                :value="item.id"
               >
                 {{ item.typeName }}
               </option>
@@ -36,9 +36,9 @@
           </div>
           <div class="contentCol2">
             <span>车型</span
-            ><select name="" id="">
+            ><select>
               <option
-                v-for="(item, index) in carSeries"
+                v-for="(item, index) in carType"
                 :key="index"
                 :value="item.typeName"
               >
@@ -50,12 +50,18 @@
         <div class="bodyRow">
           <div class="contentCol1">
             <span>发布平台</span>
-            <div>{{selectedPlatform}}</div>
+            <div>{{ selectedPlatform }}</div>
           </div>
           <div class="contentCol2">
             <span>发布板块</span
             ><select name="" id="">
-              <option value="">请选择</option>
+              <option
+                v-for="(item, index) in releasePlate"
+                :key="index"
+                :value="item.id"
+              >
+                {{ item.platformName }}
+              </option>
             </select>
           </div>
         </div>
@@ -74,7 +80,7 @@
                 :key="index"
                 :value="item.id"
               >
-                {{ item.platformName }}
+                {{ item.dictName }}
               </option>
             </select>
           </div>
@@ -86,7 +92,7 @@
                 :key="index"
                 :value="item.id"
               >
-                {{ item.platformName }}
+                {{ item.dictName }}
               </option>
             </select>
           </div>
@@ -128,6 +134,18 @@ export default {
         return "";
       },
     },
+    sonPlatformId: {
+      type: String,
+      default: () => {
+        return "";
+      },
+    },
+    releasePlate: {
+      type: Array,
+      default: () => {
+        return [];
+      },
+    },
   },
   data() {
     return {
@@ -136,6 +154,12 @@ export default {
       carType: [],
       content1: [],
       content2: [],
+     // releasePlate: [],
+
+      carS: "",
+      ziliaoId: "",
+      content1Id: "",
+      content2Id: "",
 
       carTypeName: "",
       contentTypeName: "",
@@ -151,13 +175,13 @@ export default {
     closeSelf() {
       this.$emit("closeme");
     },
-    //message: "没有找到经销商信息"// url: "/importDealerFeedback", 
+    //message: "没有找到经销商信息"// url: "/importDealerFeedback",
     //message: "没有要导入的文件" accountId agentName agentId dlrName dlrCode dealerId dataId
     edit: function () {
       let config = {
-        url: "/dealerFeedback", 
+        url: "/dealerFeedback",
         data: {
-          dealerId: 'L0210_MM',
+          dealerId: "L0210_MM",
           //id: '1377835162976477186',
           dataId: "1377835162976477186",
           Title: this.mediaTitle,
@@ -183,8 +207,30 @@ export default {
           console.log(err);
         });
     },
+    //发布版块
+   /*  chooseReleasePlate: function () {
+      console.log(this.sonPlatformId)
+      this.$http({
+        url: "/base/publishPlatformManager/selectPublishPlatformList",
+        method: "post",
+        data: {
+          parentId: this.sonPlatformId
+        },
+      })
+        .then((res) => {
+          console.log(res)
+          if (res.data.code === 200) {
+            this.releasePlate = res.data.data;
+          }
+        })
+        .catch((err) => {
+          console.log(err);
+        });
+    }, */
+
+
     //不分页查询车系车型信息
-    chooseCarSeriesAndType: function () {
+    chooseCarSeries: function () {
       this.$http({
         url: "/base/carTypeManager/selectCarTypeList",
         method: "post",
@@ -193,7 +239,24 @@ export default {
         .then((res) => {
           if (res.data.code === 200) {
             this.carSeries = res.data.data;
-            console.log("chooseCarSeriesAndType1", this.carSeries);
+            this.chooseCarType();
+          }
+        })
+        .catch((err) => {
+          console.log(err);
+        });
+    },
+    chooseCarType: function () {
+      this.$http({
+        url: "/base/carTypeManager/selectCarTypeList",
+        method: "post",
+        data: {
+          parentId: this.carS || -1,
+        },
+      })
+        .then((res) => {
+          if (res.data.code === 200) {
+            this.carType = res.data.data;
           }
         })
         .catch((err) => {
@@ -201,9 +264,10 @@ export default {
         });
     },
     //不分页查询发布平台信息 内容分类1
-    contentClassify: function () {
+    //初次调用获得 content ID 用作 parentID
+    firstContent1Classify: function () {
       this.$http({
-        url: "/base/publishPlatformManager/selectPublishPlatformList",
+        url: "/sys/dataDict/selectSysDataDictList",
         method: "post",
         data: {
           dictCode: "content1",
@@ -211,18 +275,37 @@ export default {
       })
         .then((res) => {
           if (res.data.code === 200) {
+            this.content1Id = res.data.data[0].id;
+            this.secondContent1Classify();
+          }
+          console.log("contentClassify1", res.data.data[0].id);
+        })
+        .catch((err) => {
+          console.log(err);
+        });
+    },
+    secondContent1Classify: function () {
+      this.$http({
+        url: "/sys/dataDict/selectSysDataDictList",
+        method: "post",
+        data: {
+          parentId: this.content1Id,
+        },
+      })
+        .then((res) => {
+          if (res.data.code === 200) {
             this.content1 = res.data.data;
           }
-          console.log("contentClassify1", res);
+          console.log("second contentClassify1", res.data.data);
         })
         .catch((err) => {
           console.log(err);
         });
     },
     //不分页查询发布平台信息 内容分类2
-    contentClassify2: function () {
+    firstContent2Classify: function () {
       this.$http({
-        url: "/base/publishPlatformManager/selectPublishPlatformList",
+        url: "/sys/dataDict/selectSysDataDictList",
         method: "post",
         data: {
           dictCode: "content2",
@@ -230,9 +313,28 @@ export default {
       })
         .then((res) => {
           if (res.data.code === 200) {
+            this.content2Id = res.data.data[0].id;
+            this.secondContent2Classify();
+          }
+          console.log("contentClassify2", res.data.data[0].id);
+        })
+        .catch((err) => {
+          console.log(err);
+        });
+    },
+    secondContent2Classify: function () {
+      this.$http({
+        url: "/sys/dataDict/selectSysDataDictList",
+        method: "post",
+        data: {
+          parentId: this.content2Id,
+        },
+      })
+        .then((res) => {
+          if (res.data.code === 200) {
             this.content2 = res.data.data;
           }
-          console.log("contentClassify2", res);
+          console.log("second contentClassify2", res.data.data);
         })
         .catch((err) => {
           console.log(err);
@@ -241,9 +343,10 @@ export default {
   },
   mounted() {
     this.chooseDataName();
-    this.chooseCarSeriesAndType();
-    this.contentClassify();
-    this.contentClassify2();
+    this.chooseCarSeries();
+    this.firstContent1Classify();
+    this.firstContent2Classify();
+    //this.chooseReleasePlate();
   },
 };
 </script>

+ 66 - 6
src/views/data/UploadLink.vue

@@ -6,7 +6,11 @@
       <span>上传平台</span>
       <select name="" id="" v-model="platformVal" @change="choosePlatform">
         <option value="">请选择</option>
-        <option v-for="(item, index) in platform" :key="index" :value="item.platformName">
+        <option
+          v-for="(item, index) in platform"
+          :key="index"
+          :value="item.platformName"
+        >
           {{ item.platformName }}
         </option>
       </select>
@@ -73,6 +77,8 @@
       :Linkdata="tableData"
       @update="editTitle"
       :selectedPlatform="selectedPlatform"
+      :sonPlatformId="platformId"
+      :releasePlate="releasePlate"
     ></Modal>
 
     <div class="timeLimitStyle">
@@ -163,8 +169,11 @@ export default {
   },
   data() {
     return {
+      publishCount: "",
       platform: [],
       platformVal: "",
+      platformId: "",
+      releasePlate: [],
       selectedPlatform: "",
       nowIndex: 0,
       /* modal */
@@ -459,15 +468,66 @@ export default {
         .catch((err) => {
           console.log(err);
         });
-        
     },
     //下拉选择平台
     choosePlatform: function () {
-      console.log(this.platformVal)
+      let obj = {};
+      //所选平台名称
+      let val = this.platformVal;
+      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.chooseReleasePlate(obj.id);
+    },
+    //获取可发布数量
+    getReleaseQuantity: function (val) {
+      this.$http({
+        url: "/base/mediaPublishManager/selectMediaPublishList",
+        method: "post",
+        data: {
+          id: val,
+        },
+      })
+        .then((res) => {
+          if (res.data.code === 200) {
+            this.publishCount = res.data.data;
+            let len = this.publishCount;
+            while (len) {
+              this.tableData.push([]);
+              len--;
+            }
+          }
+        })
+        .catch((err) => {
+          console.log(err);
+        });
+    },
+    //发布版块
+    chooseReleasePlate: function (val) {
+      this.$http({
+        url: "/base/publishPlatformManager/selectPublishPlatformList",
+        method: "post",
+        data: {
+          parentId: val
+        },
+      })
+        .then((res) => {
+          console.log(res)
+          if (res.data.code === 200) {
+            this.releasePlate = res.data.data;
+          }
+        })
+        .catch((err) => {
+          console.log(err);
+        });
     },
-    
   },
   mounted() {
     this.getPlatform();
@@ -505,7 +565,7 @@ export default {
     }
   }
 }
-.table_gray td{
+.table_gray td {
   background-color: #eeeeee;
 }
 .tableBox table {
@@ -536,7 +596,7 @@ export default {
   padding: 7px 5px;
 }
 .tableHeadStyle2 {
- // background: #848484;
+  // background: #848484;
   height: 30px;
   color: #fff;
   display: flex;