瀏覽代碼

反馈页面编辑模态框修改

liuYb 4 年之前
父節點
當前提交
a7e300da3f
共有 3 個文件被更改,包括 122 次插入143 次删除
  1. 84 118
      src/components/Modal.vue
  2. 5 5
      src/views/data/UploadLink.vue
  3. 33 20
      src/views/data/UploadLink/sonUploadLink.vue

+ 84 - 118
src/components/Modal.vue

@@ -8,22 +8,13 @@
         <div class="bodyRow">
           <span>资料名称</span>
           <div>{{ ziliaoName }}</div>
-          <!--   <select v-model="ziliaoId">
-            <option
-              v-for="(item, index) in dataName"
-              :key="index"
-              :value="item.id"
-            >
-              {{ item.informationName }}
-            </option>
-          </select> -->
         </div>
         <div class="bodyRow timeWidth">
           <span>发布时间</span
           ><input type="date" placeholder="选择时间" v-model="ziliaoTime" />
         </div>
         <div class="bodyRow">
-          <div class="contentCol1">
+          <!--  <div class="contentCol1">
             <span>车系</span
             ><select v-model="carS" @change="chooseCarSeries">
               <option
@@ -34,9 +25,9 @@
                 {{ item.typeName }}
               </option>
             </select>
-          </div>
-          <div class="contentCol2">
-            <span>车型</span
+          </div> -->
+          <div class="contentCol1">
+            <span>涉及车型</span
             ><select v-model="carT">
               <option
                 v-for="(item, index) in carType"
@@ -51,13 +42,21 @@
         <div class="bodyRow">
           <div class="contentCol1">
             <span>发布渠道</span>
-            <div>{{ selectedPlatform }}</div>
+            <select name="" id="" v-model="releaseC" @change="chooseChannel">
+              <option
+                v-for="(item, index) in releaseChannel"
+                :key="index"
+                :value="item.platformName"
+              >
+                {{ item.platformName }}
+              </option>
+            </select>
           </div>
           <div class="contentCol2">
             <span>平台版块</span
             ><select name="" id="" v-model="releaseP">
               <option
-                v-for="(item, index) in releaseMedia"
+                v-for="(item, index) in releasePlate"
                 :key="index"
                 :value="item.platformName"
               >
@@ -66,12 +65,6 @@
             </select>
           </div>
         </div>
-        <!--      <div class="bodyRow">
-          <span>项目分类</span
-          ><select name="" id="">
-            <option value="">请选择</option>
-          </select>
-        </div> -->
         <div class="bodyRow">
           <div class="contentCol1">
             <span>稿件类别</span
@@ -115,7 +108,12 @@
           </div>
           <div class="contentCol2">
             <span>在看/转发</span>
-            <input type="number" placeholder="" min="0" v-model="lookingCount" />
+            <input
+              type="number"
+              placeholder=""
+              min="0"
+              v-model="lookingCount"
+            />
           </div>
         </div>
         <div class="bodyRow longInput">
@@ -148,17 +146,9 @@ export default {
         return {};
       },
     },
-    selectedPlatform: {
+    fileName: {
       type: String,
-      default: () => {
-        return "";
-      },
-    },
-    releaseMedia: {
-      type: Array,
-      default: () => {
-        return [];
-      },
+      default: '',
     },
   },
   data() {
@@ -172,6 +162,7 @@ export default {
       carS: "",
       carT: "",
       releaseP: "",
+      releaseC: "",
       ziliaoId: "",
       content1Id: "",
       content2Id: "",
@@ -194,6 +185,9 @@ export default {
       goodCount: "",
       bbsCount: "",
       lookingCount: "",
+
+      releaseChannel: [],
+      releasePlate: [],
     };
   },
   methods: {
@@ -204,7 +198,7 @@ export default {
     edit: function () {
       let obj = {};
       //获取资料名
-     /*  let idVal = this.ziliaoId;
+      /*  let idVal = this.ziliaoId;
       obj = this.dataName.find(function (item) {
         return item.id === idVal;
       });
@@ -217,8 +211,6 @@ export default {
       console.log("chexi ", obj);
       //carTypeId  表示车系 id
       this.carTypeId = obj.id;
-      //获取车型名 this.carT
-      //获取平台名 this.selectedPlatform,
 
       //当前月份
       let date = new Date();
@@ -237,10 +229,12 @@ export default {
           releaseTime: this.ziliaoTime,
           carService: this.carS,
           carType: this.carT,
+
+          //发布平台  渠道
+          releaseMedia: this.releaseC,
           //发布板块
           releasePlate: this.releaseP,
-          //发布平台
-          releaseMedia: this.selectedPlatform,
+
           draftGenre: this.contentName1,
 
           //内容分类2?
@@ -268,62 +262,6 @@ export default {
       this.$emit("update", config);
       this.$emit("closeme");
     },
-  /*   addInfo: function () {
-      let obj = {};
-      //获取资料名
-      let idVal = this.ziliaoId;
-      obj = this.dataName.find(function (item) {
-        return item.id === idVal;
-      });
-      this.ziliaoName = obj.informationName;
-      //获取车系 id
-      let nameCarS = this.carS;
-      obj = this.carSeries.find(function (item) {
-        return item.typeName === nameCarS;
-      });
-      console.log("chexi ", obj);
-      //carTypeId  表示车系 id
-      this.carTypeId = obj.id;
-      //获取车型名 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: {
-          id: "", //主键值
-          month: d,
-          dealerId: "254",
-          dataId: this.ziliaoId,
-          informationName: this.ziliaoName,
-          releaseTime: this.ziliaoTime,
-          carService: this.carS,
-          carType: this.carT,
-          //发布板块
-          releasePlate: this.releaseP,
-          //发布平台
-          releaseMedia: this.selectedPlatform,
-          
-          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,
-        },
-      };
-      this.$emit("update", config);
-      this.$emit("closeme");
-    }, */
     //资料名称列表
     chooseDataName: function () {
       this.$http({
@@ -352,9 +290,6 @@ export default {
           console.log(err);
         });
     },
-    //发布版块
-    /*  chooseReleasePlate: function () {}, */
-
     //不分页查询车系车型信息
     chooseCarSeries: function () {
       this.$http({
@@ -480,9 +415,9 @@ export default {
     },
 
     initialData: function () {
+      this.ziliaoName = this.fileName;
       this.ziliaoId = this.LinkData.informationId;
-/* console.log(this.LinkData)
-console.log(this.ziliaoId) */
+
       this.mediaTitle = this.LinkData.mediaTitle;
       this.mediaUrl = this.LinkData.mediaUrl;
       this.carS = this.LinkData.carTypeName;
@@ -496,9 +431,9 @@ console.log(this.ziliaoId) */
         let temp = y + "-" + m + "-" + d;
         this.ziliaoTime = temp;
       }
-      //console.log("console.log(this.forceUpdate);", typeof time, m, y);
 
-      //缺少对应列表值 已有资料名在数据中无法查询到
+      //publishPlatformName 发布渠道
+      this.releaseC = this.LinkData.publishPlatformName;
       //publishSourceName 发布板块
       this.releaseP = this.LinkData.publishSourceName;
 
@@ -515,22 +450,7 @@ console.log(this.ziliaoId) */
       let flag = regex.test(this.mediaUrl);
       // console.log(flag, regex);
       if (flag) {
-        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 */
-        ) {
+        if (flag) {
           this.edit();
         } else {
           alert("请将信息补充完整!");
@@ -540,17 +460,63 @@ console.log(this.ziliaoId) */
       }
       /*  
 this.ziliaoName && this.ziliaoTime &&this.carS &&this.carT&&
-this.releaseP&& this.selectedPlatform&& this.contentName1&&
+this.releaseP&& th&& this.contentName1&&
 this.contentName2&& this.mediaTitle&& this.mediaUrl&&
 this.readCount&&this.goodCount&&  this.bbsCount&& this.lookingCount */
     },
+
+    //下拉选择平台  渠道
+    chooseChannel: function () {
+      this.$http({
+        url: "/base/publishPlatformManager/selectPublishPlatformList",
+        method: "post",
+        data: {},
+      })
+        .then((res) => {
+          if (res.data.code === 200) {
+            this.releaseChannel = res.data.data;
+            let obj = {};
+            let val = this.releaseC;
+            obj = this.releaseChannel.find(function (item) {
+              return item.platformName === val;
+            });
+            console.log(this.releaseC, obj)
+            //传当前渠道 id,  获取发布版块列表
+            this.chooseReleasePlate(obj.id);
+          }
+        })
+        .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;
+            console.log("发布版块", this.releasePlate);
+          }
+        })
+        .catch((err) => {
+          console.log(err);
+        });
+    },
   },
   mounted() {
     this.chooseDataName();
     this.chooseCarSeries();
     this.firstContent1Classify();
     this.firstContent2Classify();
-    //this.chooseReleasePlate();
+
+this.chooseChannel();
 
     this.initialData();
   },

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

@@ -41,7 +41,7 @@
               <td>{{ obj.informationName }}</td>
               <!-- 资料名称 -->
 
-              <td>{{ obj.informationName }}</td>
+              <td>{{ obj.publishPlatformName }}</td>
               <!-- 发布渠道 未定-->
 
               <td>{{ obj.publishSourceName }}</td>
@@ -511,13 +511,13 @@ export default {
       });
       console.log(fileDes);
       //导入文件与限制文件导入数量
-      let remainCount = this.publishCount - this.sum;
+ /*      let remainCount = this.publishCount - this.sum;
       console.log(remainCount, this.publishCount, this.sum);
-      if (remainCount >= this.file.length) {
+      if (remainCount >= this.file.length) { */
         this.submitRequest();
-      } else if (remainCount < this.file.length) {
+     /*  } else if (remainCount < this.file.length) {
         this.showModal3 = !this.showModal3;
-      }
+      } */
     },
     // 导入接口
     submitRequest: function () {

+ 33 - 20
src/views/data/UploadLink/sonUploadLink.vue

@@ -31,7 +31,7 @@
             <td>{{ obj.informationName }}</td>
             <!-- 资料名称 -->
 
-            <td>{{ obj.informationName }}</td>
+            <td>{{ obj.publishPlatformName }}</td>
             <!-- 发布渠道 -->
 
             <td>{{ obj.publishSourceName }}</td>
@@ -86,9 +86,16 @@
       v-on:closeme="closeme"
       :LinkData="modalData"
       @update="editTitle"
-      :selectedPlatform="selectedPlatform"
       :releaseMedia="releaseMedia"
     ></Modal>
+    <!-- 弹窗: 新增内容   :LinkData="tableData[0]"-->
+    <Modal
+      v-if="showModalAdd"
+      v-on:closeme="closemeAdd"
+     
+      @update="editTitle"
+      :fileName="tableData[0].informationName"
+    ></Modal>
 
     <!-- 弹窗: 确定删除? -->
     <deleteModal
@@ -136,6 +143,7 @@ export default {
       /* modal */
       feedbackTimeLimit: 0,
       showModal: false,
+      showModalAdd: false,
       showModal2: false,
       showModal3: false,
       showModal4: false,
@@ -165,31 +173,31 @@ export default {
       ],
       tableData: [
         {
-          accountId: null,
+          accountId: "254",
           bbsCount: 0,
-          carPlatformName: null,
-          carTypeName: null,
-          contentTypeName: null,
-          dlrCode: null,
-          dlrName: null,
+          carPlatformName: "123",
+          carTypeName: "test",
+          contentTypeName: "test2222",
+          dlrCode: "L0M32",
+          dlrName: "苏州常隆锦宸",
           endDate: null,
           endTime: null,
           goodCount: 0,
-          id: "1384738850966597634",
-          informationId: null,
-          informationName: "1",
-          localArea: null,
+          id: "1382528052292362241",
+          informationId: "1381083607097311234",
+          informationName: "son固定数据",
+          localArea: "东区",
           lookingCount: 0,
-          mediaTitle: null,
-          mediaTypeName: null,
-          mediaUrl: null,
+          mediaTitle: "manufacturer",
+          mediaTypeName: "内容分类1",
+          mediaUrl: "https://www.ncbi.cn",
           projectTypeName: null,
-          publishDate: null,
-          publishPlatformName: null,
-          publishSourceName: null,
+          publishDate: "2021-04-15",
+          publishPlatformName: "4",
+          publishSourceName: "",
           queryParams: null,
           readCount: 0,
-          reportDate: null,
+          reportDate: "2021-04-15T10:55:48.452",
           startTime: null,
         },
       ],
@@ -249,6 +257,11 @@ export default {
     closeme: function () {
       this.showModal = !this.showModal;
     },
+
+    //新增弹窗关闭
+    closemeAdd: function () {
+      this.showModalAdd = !this.showModalAdd;
+    },
     //删除
     toggleModal2: function (i) {
       this.showModal2 = !this.showModal2;
@@ -353,7 +366,7 @@ export default {
     },
     //新增反馈
     addInfo: function () {
-      this.showModal = !this.showModal;
+      this.showModalAdd = !this.showModalAdd;
       //this.modalData = this.tableData[i];
     },
   },