suxinf %!s(int64=4) %!d(string=hai) anos
pai
achega
375dd008c0

+ 2 - 7
src/views/parameter/Grouping.vue

@@ -31,9 +31,7 @@
       </div>
     </div>
     <div v-else>
-      <GroupMember 
-        :groupId='groupId'
-      />
+      <GroupMember />
     </div>
   </div>
 </template>
@@ -60,7 +58,6 @@ export default {
       // 表格配置
       tableData: [],
       modalFlag: false, // 控制模态框展示
-      groupId: ''
     };
   },
   computed: {
@@ -103,7 +100,6 @@ export default {
     },
     // 模态框保存,
     submit: function (groupName) {
-      console.log("小组保存", groupName);
       this.addGroupInfo(groupName).then(() => {
         this.selectGroupList();
       });
@@ -128,8 +124,7 @@ export default {
     // 点击小组成员
     groupMember: function (index) {
       // 页面变化
-      this.$router.push({ query: { tag: "group_member" } });
-      this.groupId = this.tableData[index]['id'];
+      this.$router.push({ query: { tag: "group_member", id: this.tableData[index]['id'] } });
     },
     // 新增小组 接口
     addGroupInfo: function (groupName) {

+ 56 - 57
src/views/parameter/LinkUpload.vue

@@ -8,7 +8,7 @@
             <option
               v-for="(item, index) in optionList"
               :key="index"
-              :data-index='index'
+              :data-index="index"
             >
               {{ item.platformName }}
             </option>
@@ -24,12 +24,13 @@
           :pageSize="sum"
         ></Table>
       </div>
-      <div class="page">
+      <div class="page" v-if="sum !==0">
         <Tablepage
           :totalPage="totalPage"
           :currentPage="currentPage"
           @change_page="changePage"
           @jump_page="jumpPage"
+          :sum='sum'
         ></Tablepage>
         <Count :sum="sum"></Count>
       </div>
@@ -38,7 +39,7 @@
           :modalFlag="modalFlag"
           @submit="submit"
           @hide_modal="showModal"
-          :selectedplateForm='selectedplateForm'
+          :selectedplateForm="selectedplateForm"
         ></Modal>
       </div>
     </div>
@@ -60,20 +61,14 @@ export default {
   },
   data() {
     return {
-      sum: 86, // 一共有多少条数据
+      sum: 0, // 一共有多少条数据
       pageSize: 20, // 每页展示的数据
       currentPage: 1,
       tableData: [],
-      getDate: [
-        { time: "2021/03", plate: "汽车之家", num: 5, str: "222" },
-        { time: "2021/03", plate: "汽车之家", num: 5, str: "111" },
-        { time: "2021/03", plate: "汽车之家", num: 5, str: "333" },
-      ],
-      functionData: [],
       modalFlag: false, // 控制模态框展示
       optionList: [],
-      selectedForm: '',
-      selectedplateForm: {}
+      selectedForm: "",
+      selectedplateForm: {},
     };
   },
   computed: {
@@ -111,47 +106,40 @@ export default {
       }
       console.log(this.currentPage);
     },
-    // 获取数据
-    getData: function () {
-      this.tableData = [];
-      this.functionData = [];
-      this.getDate.forEach((element) => {
-        this.tableData.push({
-          time: element.time,
-          plate: element.plate,
-          num: element.num,
-        });
-        this.functionData.push({
-          str: element.str,
-        });
-      });
-    },
     // 展示、隐藏模态框
     showModal: function () {
       this.modalFlag = !this.modalFlag;
     },
     // 点击编辑
     edit(index, newName) {
-      console.log(this.functionData[index].str, newName);
+      console.log(index, newName);
     },
     // 点击删除
     deleteData(index) {
-      console.log("删除", this.functionData[index].str);
+      console.log("删除", index);
     },
     // 模态框保存
     submit: function (time, num, obj) {
-      let addTime = time.replace('-','/');
+      let addTime = time.replace("-", "/");
       this.addMediaPublishInfo(+num, addTime, obj.platformName, obj.id);
       this.modalFlag = false;
     },
     // slectPlatForm
     slectPlatForm: function (e) {
       // console.log(1111, this.selectedForm);
-      let index = e.target.options.selectedIndex
+      let index = e.target.options.selectedIndex;
       this.selectedplateForm = this.optionList[index];
+      let id = this.optionList[0]['id'];
+      let req = { id };
+      this.selectMediaPublishList(req);
     },
     // 新增 接口
-    addMediaPublishInfo: function (publishCount, publishMonth, publishPlatformName, publishPlatformId) {
+    addMediaPublishInfo: function (
+      publishCount,
+      publishMonth,
+      publishPlatformName,
+      publishPlatformId
+    ) {
       return new Promise((resolve, reject) => {
         this.$http({
           method: "post",
@@ -160,7 +148,7 @@ export default {
             publishCount,
             publishMonth,
             publishPlatformName,
-            publishPlatformId
+            publishPlatformId,
           },
         })
           .then((res) => {
@@ -179,17 +167,19 @@ export default {
       });
     },
     // 获取列表 接口
-    selectMediaPublishList: function () {
+    selectMediaPublishList: function (data) {
       this.$http({
         method: "post",
         url: "/base/mediaPublishManager/selectMediaPublishList",
-        data: {},
+        data,
       })
         .then((res) => {
+          this.tableData = [];
           if (res.data && res.data.code === 200) {
-            console.log(res);
-            // this.tableData = res.data.data;
+            console.log(res, 2222);
             this.sum = res.data.count;
+            this.tableData.push(res.data.data[0]); // 有八条是null,会报错,暂时取第一条
+            console.log(this.tableData);
           } else {
             console.log(res);
           }
@@ -254,32 +244,41 @@ export default {
     },
     // 获取平台列表 接口
     selectPublishPlatformPage: function () {
-      this.$http({
-        method: "post",
-        url: "/base/publishPlatformManager/selectPublishPlatformPage",
-        data: {},
-      })
-        .then((res) => {
-          if (res.data && res.data.code === 200) {
-            console.log(res);
-            this.optionList = res.data.data;
-            this.selectedForm = this.optionList[0]['platformName'];
-            this.selectedplateForm = this.optionList[0];
-          } else {
-            console.log(res);
-          }
+      return new Promise((resolve, reject) => {
+        this.$http({
+          method: "post",
+          url: "/base/publishPlatformManager/selectPublishPlatformPage",
+          data: {},
         })
-        .catch((err) => {
-          console.log(err);
-        });
+          .then((res) => {
+            if (res.data && res.data.code === 200) {
+              console.log(res, 111);
+              this.optionList = res.data.data;
+              this.selectedForm = this.optionList[0]["platformName"];
+              this.selectedplateForm = this.optionList[0];
+              resolve();
+            } else {
+              console.log(res);
+              reject();
+            }
+          })
+          .catch((err) => {
+            console.log(err);
+            reject();
+          });
+      });
     },
   },
   mounted() {
-    this.getData();
   },
   created() {
-    this.selectMediaPublishList();
-    this.selectPublishPlatformPage();
+    this.selectPublishPlatformPage().then(() => {
+      let id = this.optionList[0]['id'];
+      let req = { id };
+      this.selectMediaPublishList(req);
+    }).catch((err) =>{
+      console.log(err)
+    })
   },
 };
 </script>

+ 4 - 40
src/views/parameter/components/Grouping/GroupMember.vue

@@ -39,12 +39,6 @@ import Table from './GroupMemberTable';
 import Modal from "./GroupMemberModal";
 
 export default {
-  props: {
-    groupId: {
-      type: String,
-      default: ''
-    }
-  },
   components: {
     Count,
     Table,
@@ -57,20 +51,14 @@ export default {
       pageSize: 20, // 每页展示的数据
       currentPage: 1,
       tableData: [],
-      getDate: [{member: '北京博睿', str: '123'},{member: '北京广通', str: '124'},{member: 'ES4', str: '125'},],
-      functionData: [],
       modalFlag: false, // 控制模态框展示
+      groupId: this.$route.query.id 
     }
   },
   computed:{
     // 表格总页数
     totalPage() {
       return Math.ceil(this.sum/this.pageSize);
-    },
-    // 获取路由参数
-    queryTag() {
-      console.log (111, this.$route.query);
-      return (this.$route.query && this.$route.query.tag) ? 0 : 1
     }
   },
   methods: {
@@ -97,46 +85,23 @@ export default {
       }
       console.log(this.currentPage);
     },
-    // 获取数据
-    getData: function() {
-      this.tableData = [];
-      this.functionData = [];
-      this.getDate.forEach( (element) => {
-        this.tableData.push(
-          {
-            member: element.member
-          }
-        );
-        this.functionData.push(
-          {
-            str: element.str
-          }
-        )
-      });
-    },
     // 展示、隐藏模态框
     showModal: function() {
       this.modalFlag = !this.modalFlag;
     },
     // 点击编辑
     edit (index, newName) {
-      console.log(this.functionData[index].str, newName);
+      console.log(index, newName);
     },
     // 点击删除
     deleteData (index) {
-      console.log('删除', this.functionData[index].str)
+      console.log('删除', index);
     },
     // 新增车型模态框 保存
     submit: function(list1, list2) {
         console.log('保存', list1, list2);
         this.modalFlag = false;
     },
-    // 点击小组成员
-    groupMember: function (index) {
-      // 页面变化
-      this.$router.push({ query: { tag: "group_menber" } });
-      this.groupId = this.tableData[index]['id'];
-    },
     // 获取列表 接口
     selectAgentInfoPage: function (groupId) {
       this.$http({
@@ -187,8 +152,7 @@ export default {
     },
   },
   mounted() {
-    this.getData();
-    console.log(this.groupId);
+    this.selectAgentInfoPage(this.groupId);
   }
 }
 </script>

+ 1 - 1
src/views/parameter/components/Grouping/GroupMemberTable.vue

@@ -14,7 +14,7 @@
           :class="{ table_gray: index % 2 === 0 }"
         >
           <td style="width: 50%">
-            <p>{{ obj.member }}</p>
+            <p>{{ obj.dlrName }}</p>
           </td>
           <td style="width: 50%" class="operation">
             <span @click="showModal(index)">删除</span>

+ 3 - 4
src/views/parameter/components/Grouping/GroupingTable.vue

@@ -19,7 +19,6 @@
               type="text"
               v-model="newName"
               v-else
-              :placeholder="obj.groupName"
             />
           </td>
           <td style="width: 50%" class="operation">
@@ -54,7 +53,7 @@ export default {
     //  表格一页共有多少数据
     pageSize: {
       type: Number,
-      default: 2,
+      default: 20,
     },
   },
   components: {
@@ -78,8 +77,8 @@ export default {
     // 确认编辑
     submitEdit: function (i) {
       if (!this.newName) {
-        alert("姓名不能为空");
-      } else if (this.newName === this.tableData[i].group) {
+        alert("分组名称不能为空");
+      } else if (this.newName === this.tableData[i].groupName) {
         this.newName = ""; // 没有改
       } else {
         this.$emit("edit", i, this.newName);

+ 9 - 11
src/views/parameter/components/LinkUpload/Table.vue

@@ -15,15 +15,14 @@
           :key="index"
           :class="{ table_gray: index % 2 === 0 }"
         >
-          <td>{{obj.time}}</td>
-          <td>{{obj.plate}}</td>
+          <td>{{obj.createDate || ''}}</td>
+          <td>{{obj.publishPlatformName || ''}}</td>
           <td style="width: 20%">
-            <p v-if="!editFlag[index]">{{ obj.num }}</p>
+            <p v-if="!editFlag[index]">{{ obj.publishCount || '' }}</p>
             <input
               type="text"
               v-model="newName"
               v-else
-              :placeholder="obj.num"
             />
           </td>
           <td style="width: 25%" class="operation">
@@ -79,10 +78,9 @@ export default {
     },
     // 确认编辑
     submitEdit: function (i) {
-
-      if (!this.newName || typeof(this.newName) !== 'number') {
+      if (!this.newName || typeof this.newName !== "number") {
         alert("空值或者不是数字");
-      } else if (this.newName === this.tableData[i].num) {
+      } else if (this.newName === this.tableData[i].publishCount) {
         this.newName = ""; // 没有改
       } else {
         this.$emit("edit", i, this.newName);
@@ -109,10 +107,10 @@ export default {
       let arr = new Array(this.pageSize).fill(false);
       this.editFlag = arr;
     },
-    mounted() {
-      this.getEditArr();
-    },
   },
+  created() {
+    this.getEditArr();
+  }
 };
 </script>
 
@@ -152,6 +150,6 @@ export default {
   }
 }
 .table_gray {
-    background: #f5f5f5
+  background: #f5f5f5;
 }
 </style>