瀏覽代碼

补充全选功能,支持查询部门数据

yejian 2 年之前
父節點
當前提交
9cdfff4b97

+ 9 - 7
src/views/Ranking/FusionNumberManuscript.vue

@@ -10,7 +10,7 @@
         <el-button
           v-for="(cur, ind) in tabs.btns"
           :key="ind"
-          :class="cur == btnFocus ? 'btnFocus' : ''"
+          :class="btnFocus.includes(cur) ? 'btnFocus' : ''"
           @click="handleClick(cur)"
           >{{ cur }}</el-button
         >
@@ -36,8 +36,7 @@ export default {
   name: "fusionNumberManuscript",
   data() {
     return {
-      activeName: 1,
-      btnFocus: "",
+      btnFocus: [],
       tabs: {
         name: "融合号稿件传播量排行榜",
         btns: [],
@@ -52,7 +51,11 @@ export default {
   },
   methods: {
     handleClick(e) {
-      this.btnFocus = e;
+      if(this.btnFocus.includes(e) && this.btnFocus.length!==1){
+        this.btnFocus = this.btnFocus.filter((v)=>{return v!==e});
+      }else if(!this.btnFocus.includes(e)){
+        this.btnFocus.push(e);
+      }
       this.setTableData();
     },
     setTableData() {
@@ -60,7 +63,7 @@ export default {
       this.tableData = [];
       this.curPage = 0;
       this.load = ElLoading.default.service();
-      getRongheArticlePv({ type: this.btnFocus })
+      getRongheArticlePv({ types: this.btnFocus })
         .then((res) => {
           that.total = res.length;
           that.tableData = res;
@@ -75,8 +78,7 @@ export default {
       const that = this;
       getAccountType()
         .then((res) => {
-          const [item] = res;
-          that.btnFocus = item;
+          that.btnFocus = res;
           that.tabs.btns = res;
           that.setTableData();
         })

+ 9 - 7
src/views/Ranking/FusionVermicelli.vue

@@ -10,7 +10,7 @@
         <el-button
           v-for="(cur,ind) in tabs.btns"
           :key="ind"
-          :class="cur == btnFocus ? 'btnFocus' : ''"
+          :class="btnFocus.includes(cur) ? 'btnFocus' : ''"
           @click="handleClick(cur)"
           >{{ cur }}</el-button
         >
@@ -39,8 +39,7 @@ export default {
   name: "FusionVermicelli",
   data() {
     return {
-      activeName: 1,
-      btnFocus: "",
+      btnFocus: [],
       tabs: {
         name: "融合号粉丝量排行榜",
         btns: [],
@@ -54,14 +53,18 @@ export default {
   },
   methods: {
     handleClick(e) {
-      this.btnFocus = e;
+      if(this.btnFocus.includes(e) && this.btnFocus.length!==1){
+        this.btnFocus = this.btnFocus.filter((v)=>{return v!==e});
+      }else if(!this.btnFocus.includes(e)){
+        this.btnFocus.push(e);
+      }
       this.setTableData();
     },
     setTableData() {
       const that = this;
       this.tableData = [];
       this.load = ElLoading.default.service();
-      getFansCnt({ type: this.btnFocus })
+      getFansCnt({ types: this.btnFocus })
         .then((res) => {
           that.tableData = res;
           that.load.close();
@@ -75,8 +78,7 @@ export default {
       const that = this;
       getAccountType()
         .then((res) => {
-          const [item] = res;
-          that.btnFocus = item;
+          that.btnFocus = res;
           that.tabs.btns = res;
           that.setTableData();
 

+ 1 - 1
src/views/Ranking/ManuscriptDissemination.vue

@@ -80,7 +80,7 @@ export default {
           },
           {
             label: "部门内部人员榜",
-            value: 3,
+            value: "depart",
           },
         ],
       },

+ 1 - 1
src/views/Ranking/ManuscriptIssued.vue

@@ -80,7 +80,7 @@ export default {
           },
           {
             label: "部门内部人员榜",
-            value: 3,
+            value: "depart",
           },
         ],
       },

+ 10 - 8
src/views/Ranking/ManuscriptQuantity.vue

@@ -10,7 +10,7 @@
         <el-button
           v-for="(cur, ind) in tabs.btns"
           :key="ind"
-          :class="cur == btnFocus ? 'btnFocus' : ''"
+          :class="btnFocus.includes(cur) ? 'btnFocus' : ''"
           @click="handleClick(cur)"
           >{{ cur }}</el-button
         >
@@ -19,7 +19,7 @@
     <div class="card-rank">
       <div>
         <el-table :data="tableData" header-row-class-name="card-tabs-header">
-          <el-table-column align="center" prop="Title" label="关键词" />
+          <el-table-column align="center" prop="AccountName" label="关键词" />
           <el-table-column align="center" prop="cnt" label="稿件数量" />
         </el-table>
       </div>
@@ -36,8 +36,7 @@ export default {
   name: "ManuscriptQuantity",
   data() {
     return {
-      activeName: 1,
-      btnFocus: "",
+      btnFocus: [],
       tabs: {
         name: "融合号稿件数量排行榜",
         btns: [],
@@ -51,7 +50,11 @@ export default {
   },
   methods: {
     handleClick(e) {
-      this.btnFocus = e;
+      if(this.btnFocus.includes(e) && this.btnFocus.length!==1){
+        this.btnFocus = this.btnFocus.filter((v)=>{return v!==e});
+      }else if(!this.btnFocus.includes(e)){
+        this.btnFocus.push(e);
+      }
       this.setTableData();
     },
     setTableData() {
@@ -59,7 +62,7 @@ export default {
       this.tableData = [];
       this.curPage = 0;
       this.load = ElLoading.default.service();
-      getRongheArticleCnt({ type: this.btnFocus })
+      getRongheArticleCnt({ types: this.btnFocus })
         .then((res) => {
           that.total = res.length;
           that.tableData = res;
@@ -74,8 +77,7 @@ export default {
       const that = this;
       getAccountType()
         .then((res) => {
-          const [item] = res;
-          that.btnFocus = item;
+          that.btnFocus = res;
           that.tabs.btns = res;
           that.setTableData();
         })

+ 1 - 1
src/views/Ranking/MaterialContribution.vue

@@ -80,7 +80,7 @@ export default {
           },
           {
             label: "部门内部人员榜",
-            value: 3,
+            value: "depart",
           },
         ],
       },