From f4cca0629cb3b7ceeeb1aa07a403a303835be4b3 Mon Sep 17 00:00:00 2001
From: heyujie <516346543@qq.com>
Date: 星期四, 23 六月 2022 15:59:53 +0800
Subject: [PATCH] search by name

---
 src/pages/ai/index/App.vue       |   20 ++++++----
 src/pages/ai/index/detail.vue    |    9 +---
 vue.config.js                    |   16 ++++----
 src/pages/ai/FileUpload/file.vue |    2 -
 src/api/app.ts                   |   16 +++-----
 5 files changed, 29 insertions(+), 34 deletions(-)

diff --git a/src/api/app.ts b/src/api/app.ts
index 0fa4bd0..bb7d321 100644
--- a/src/api/app.ts
+++ b/src/api/app.ts
@@ -9,10 +9,11 @@
 };
 
 //鑾峰彇搴旂敤涓績鍟嗗煄寰呮縺娲荤畻娉曞垪琛�
-export const getUnActivedSdk = () => {
+export const getUnActivedSdk = (query: any) => {
   return request({
     url: "/data/api-v/sdk/buyList",
-    method: "get"
+    method: "get",
+    params: query
   });
 };
 
@@ -23,12 +24,6 @@
     method: "get",
   })
 }
-
-//鑾峰彇鍟嗗煄鎵�鏈夊簲鐢�(宸叉縺娲�)
-// export const findAllApp = () => request({
-//   url: '/data/api-v/app/findAllApp',
-//   method: 'get'
-// });
 
 export const getAppDetail = (query:any) => request({
   url: '/data/api-v/app/detail',
@@ -49,9 +44,10 @@
   data
 });
 //鑾峰彇鍟嗗煄寰呮縺娲荤殑搴旂敤
-export const getUnActivedApp = ()=> request({
+export const getUnActivedApp = (query:any)=> request({
   url:'/data/api-v/app/buyList',
-  method: 'get'
+  method: 'get',
+  params: query
 });
 //婵�娲诲晢鍩庡簲鐢�
 export const actApp = (appId:String,code:String) => request({
diff --git a/src/pages/ai/FileUpload/file.vue b/src/pages/ai/FileUpload/file.vue
index fca3993..ddd30c8 100644
--- a/src/pages/ai/FileUpload/file.vue
+++ b/src/pages/ai/FileUpload/file.vue
@@ -258,14 +258,12 @@
       this.error = false;
       this.isComplete = true;
       this.isUploading = false;
-      console.log("rootFile, file, message", rootFile, file, message);
     },
     _fileComplete() {
       this._fileSuccess();
     },
     _fileError(rootFile, file, message) {
       this._fileProgress();
-      console.log("rootFile, file, message", rootFile, file, message);
       this.processResponse(message);
       this.error = true;
       this.isComplete = false;
diff --git a/src/pages/ai/index/App.vue b/src/pages/ai/index/App.vue
index 1483645..f6b37d5 100644
--- a/src/pages/ai/index/App.vue
+++ b/src/pages/ai/index/App.vue
@@ -26,7 +26,7 @@
                 <span class="icon iconfont all-scene">&#xe703;</span>
                 <el-input
                   placeholder="鎼滅储"
-                  v-model="input3"
+                  v-model="inputText" @change="searchAll"
                   class="input-with-select"
                 >
                   <i class="el-icon-search" slot="prepend"></i>
@@ -500,7 +500,7 @@
       isSDKDialog: true,
       actType: "",
       actId: "",
-      input3: "",
+      inputText: "",
       tempList: [],
       select: "",
       activedSdkOrApp: {
@@ -553,6 +553,12 @@
     this.autoRefresh = false;
   },
   methods: {
+    searchAll(){
+      this.getAllApps()
+      this.getAllSdk()
+      this.getUnActivedList(1);
+      this.getUnActivedAppList();
+    },
     goback() {
       this.inDetail = false;
     },
@@ -709,7 +715,7 @@
       let iArry = [];
       let sArry = [];
       let nArry = [];
-      let rsp = await getApps();
+      let rsp = await getApps({appName:this.inputText});
       if (rsp && rsp.success) {
         // 閬嶅巻app鐨勮繃绋嬮噸缃�
         this.appUpgreading = false;
@@ -773,7 +779,7 @@
       };
     },
     getUnActivedList(v) {
-      getUnActivedSdk().then((res) => {
+      getUnActivedSdk({sdkName:this.inputText}).then((res) => {
         if (res.code == 200) {
           this.unActivedSDKList = res.data;
           const len = this.unActivedSDKList.length;
@@ -796,7 +802,7 @@
       });
     },
     getUnActivedAppList() {
-      getUnActivedApp().then((res) => {
+      getUnActivedApp({appName:this.inputText}).then((res) => {
         if (res.code == 200) {
           this.unActivedAppList = res.data;
           this.pickTab();
@@ -824,7 +830,6 @@
             }
           })
           .catch((e) => {
-            console.log(e);
           });
       } else if (this.activeTab == "app") {
         //婵�娲诲簲鐢�
@@ -842,7 +847,6 @@
             }
           })
           .catch((e) => {
-            console.log(e);
           });
       }
     },
@@ -888,7 +892,7 @@
       let installedList = [];
       let unInstalledList = [];
       let hasNewVersionList = [];
-      let res = await findAllSdk();
+      let res = await findAllSdk({sdkName:this.inputText});
       if (res && res.success) {
         this.sdkUpgreading = false;
 
diff --git a/src/pages/ai/index/detail.vue b/src/pages/ai/index/detail.vue
index 9e80e23..3739998 100644
--- a/src/pages/ai/index/detail.vue
+++ b/src/pages/ai/index/detail.vue
@@ -322,9 +322,9 @@
   },
   mounted() {
     this.getDetail();
-    this.autoRefreshAppAndSdkState();
-    this.getUnActivedList();
-    this.getUnActivedAppList();
+    // this.autoRefreshAppAndSdkState();
+    // this.getUnActivedList();
+    // this.getUnActivedAppList();
     this.showBackBtn();
     this.addBackListener();
   },
@@ -337,8 +337,6 @@
       getAppDetail({ id: id || this.detailProductID })
         .then((res) => {
           if (res.success) {
-            console.log("----------");
-            console.log(res);
             this.productDetail = res.data.detail;
             this.otherProducts = res.data.randoms;
 
@@ -549,7 +547,6 @@
             .then((res) => {
               if (res && res.success) {
                 app.unloadLoading = false;
-                // _this.getAllApps();
                 this.$emit("flushApp");
                 window.parent.postMessage(
                   {
diff --git a/vue.config.js b/vue.config.js
index 5c9f162..103c24f 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -116,14 +116,14 @@
         // ws: true,
         changeOrigin: true,
       },
-      "/data/api-v/app/findAllApp": {
-        // target: '/',
-        target: "http://localhost:8080/",
-        changeOrigin: true,
-        pathRewrite: {
-          "^/data/api-v/app/findAllApp": "apps.json",
-        },
-      },
+      // "/data/api-v/app/findAllApp": {
+      //   // target: '/',
+      //   target: "http://localhost:8080/",
+      //   changeOrigin: true,
+      //   pathRewrite: {
+      //     "^/data/api-v/app/findAllApp": "apps.json",
+      //   },
+      // },
       "/api-c": {
         target: serverUrl,
         changeOrigin: true,

--
Gitblit v1.8.0