Browse Source

修改cocoFlow根据id查询

11wqe1 1 tháng trước cách đây
mục cha
commit
c7aa8c02c1
1 tập tin đã thay đổi với 42 bổ sung40 xóa
  1. 42 40
      src/components/topPage.vue

+ 42 - 40
src/components/topPage.vue

@@ -306,43 +306,41 @@ import { myMixin } from "@/mixins/mixin.js"
             // 获取cocoFlow2应用
             getData(){
 
-                if (this.fromL.admin.cocoFlow2 && this.fromL.admin.cocoFlow2.length > 0) {
-                    this.CocoFlowList = this.fromL.admin.cocoFlow2
-                }
-                // let cocoFlowCopy = []
-                // if (this.fromL.admin.cocoFlow2 && this.fromL.admin.cocoFlow2.length) {
-                //     cocoFlowCopy = this.fromL.admin.cocoFlow2.map(item => item.id);
-                // }else{
-                //     return
+                // if (this.fromL.admin.cocoFlow2 && this.fromL.admin.cocoFlow2.length > 0) {
+                //     this.CocoFlowList = this.fromL.admin.cocoFlow2
                 // }
+                let cocoFlowCopy = []
+                if (this.fromL.admin.cocoFlow2 && this.fromL.admin.cocoFlow2.length) {
+                    cocoFlowCopy = this.fromL.admin.cocoFlow2.map(item => item.id);
+                }else{
+                    return
+                }
+                    // let appList=[
+                    //     "4aed8607-19e1-11f0-a66a-005056924926",
+                    //     "337f9d06-1eb6-11f0-a66a-005056924926",
+                    //     "52b4aae8-088d-11f0-b508-005056924926",
+                    //     "5c95f692-1460-11f0-bad1-005056924926"
+                    // ]
 
+                    let params = [
+                        {
+                            functionName: API_CONFIG.ajax_AdminApp.functionName,
+                            con: cocoFlowCopy.join(','), 
+                        },
+                    ];
+                
+                this.$ajax
+                    .post(API_CONFIG.baseUrl, params)
+                    .then((res) => {
+                        let _data = res.data[0];
 
-                //     // let appList=[
-                //     //     "4aed8607-19e1-11f0-a66a-005056924926",
-                //     //     "337f9d06-1eb6-11f0-a66a-005056924926",
-                //     //     "52b4aae8-088d-11f0-b508-005056924926",
-                //     //     "5c95f692-1460-11f0-bad1-005056924926"
-                //     // ]
+                        this.CocoFlowList = cocoFlowCopy.map(id => _data.find(item => item.id === id));
 
-                //     let params = [
-                //         {
-                //             functionName: API_CONFIG.ajax_AdminApp.functionName,
-                //             con: cocoFlowCopy.join(','), 
-                //         },
-                //     ];
-                
-                // this.$ajax
-                //     .post(API_CONFIG.baseUrl, params)
-                //     .then((res) => {
-                //         let _data = res.data[0];
-
-                //         this.CocoFlowList = cocoFlowCopy.map(id => _data.find(item => item.id === id));
-
-                //     })
-                //     .catch((err) => {
-                //         console.log(err);
-                //         this.$message.error("获取工具数据失败");
-                //     });
+                    })
+                    .catch((err) => {
+                        console.log(err);
+                        this.$message.error("获取工具数据失败");
+                    });
             },
             // 筛选可用平台工具,判断是否管理员可见,去除已删除工具
             siftCoco(){
@@ -373,11 +371,14 @@ import { myMixin } from "@/mixins/mixin.js"
             getAdmincocoFlow(){
                 // 筛选可用平台工具,判断是否管理员可见,去除已删除工具
                 this.siftCoco()
+                let appList= []
 
                 if (this.fromL.admin.cocoFlow.length > 0) {
-                    this.admincocoFlow = JSON.parse(JSON.stringify(this.fromL.admin.cocoFlow))
+                    appList = this.fromL.admin.cocoFlow.map(item => item.id);
+
+                    // this.admincocoFlow = JSON.parse(JSON.stringify(this.fromL.admin.cocoFlow))
                 } else {
-                    let appList= [
+                    appList= [
                         "d1edef14-ef6f-11ef-b508-005056924926",
                         "701615ab-ffe8-11ef-b508-005056924926",
                         "a8781a86-00d8-11f0-b508-005056924926",
@@ -387,8 +388,8 @@ import { myMixin } from "@/mixins/mixin.js"
                         "0d3d87bd-00b6-11f0-b508-005056924926",
                         "2d05a12a-f0e7-11ef-b508-005056924926",
                     ]
-
-                    let params = [
+                }
+                 let params = [
                         {
                             functionName: API_CONFIG.ajax_AdminApp.functionName,
                             con: appList.join(',') 
@@ -398,6 +399,8 @@ import { myMixin } from "@/mixins/mixin.js"
                     this.$ajax
                         .post(API_CONFIG.baseUrl, params)
                         .then((res) => {
+                            console.log('res',res);
+                            
                             let _data = res.data[0]
                             this.admincocoFlow = appList.map(id => _data.find(item => item.id === id));
                         })
@@ -405,7 +408,6 @@ import { myMixin } from "@/mixins/mixin.js"
                             console.log(err);
                             this.$message.error("获取工具数据失败");
                         });
-                }
             },
 
             // 打开平台应用
@@ -696,7 +698,7 @@ import { myMixin } from "@/mixins/mixin.js"
     font-weight: 600;
     margin: 0 0 5px;
     margin-bottom: 4px;
-    -webkit-line-clamp: 2;
+    -webkit-line-clamp: 1;
     display: -webkit-box;
     -webkit-box-orient: vertical;
     overflow: hidden;
@@ -705,7 +707,7 @@ import { myMixin } from "@/mixins/mixin.js"
 .TabListBri{
     color: rgba(0,0,0,.6);
     font-size: 14px;
-    -webkit-line-clamp: 1;
+    -webkit-line-clamp: 2;
     display: -webkit-box;
     -webkit-box-orient: vertical;
     overflow: hidden;