Browse Source

删除 getAppTypeList, 使用 getEnvList 同时获取 env 和 appType

reghao 3 tháng trước cách đây
mục cha
commit
98e8f841ba

+ 0 - 4
src/api/devops.js

@@ -54,10 +54,6 @@ export function getEnvList() {
   return get(devopsApi.getEnvList)
 }
 
-export function getAppTypeList() {
-  return get(devopsApi.getAppTypeList)
-}
-
 export function getBuildDir() {
   return get(devopsApi.getBuildDir)
 }

+ 6 - 14
src/views/devops/app/AppConfig.vue

@@ -458,7 +458,6 @@ import {
   getAppConfig,
   getAppConfigList,
   getAppDeployConfigList,
-  getAppTypeList,
   getBuildConfig,
   getDeployMachineList,
   getEnvList,
@@ -473,7 +472,7 @@ export default {
       appTypeList: [],
       queryInfo: {
         env: 'test',
-        appType: 'java',
+        appType: '',
         pn: 1
       },
       // 屏幕宽度, 为了控制分页条的大小
@@ -557,24 +556,17 @@ export default {
     document.title = '应用配置列表'
     getEnvList().then(resp => {
       if (resp.code === 0) {
-        this.envList = resp.data
-      } else {
-        this.$message.error(resp.msg)
-      }
-    }).catch(error => {
-      this.$message.error(error.message)
-    })
-    getAppTypeList().then(resp => {
-      if (resp.code === 0) {
-        this.appTypeList = resp.data
+        this.queryInfo.env = resp.data.userEnv
+        this.queryInfo.appType = resp.data.userAppType
+        this.envList = resp.data.envList
+        this.appTypeList = resp.data.appTypeList
+        this.getData()
       } else {
         this.$message.error(resp.msg)
       }
     }).catch(error => {
       this.$message.error(error.message)
     })
-
-    this.getData()
   },
   methods: {
     handleCurrentChange(pageNumber) {

+ 6 - 13
src/views/devops/app/AppStat.vue

@@ -181,7 +181,7 @@ export default {
       appTypeList: [],
       queryInfo: {
         env: 'test',
-        appType: 'java',
+        appType: '',
         pn: 1
       },
       // 屏幕宽度, 为了控制分页条的大小
@@ -222,24 +222,17 @@ export default {
     document.title = '运行状态'
     getEnvList().then(resp => {
       if (resp.code === 0) {
-        this.envList = resp.data
+        this.queryInfo.env = resp.data.userEnv
+        this.queryInfo.appType = resp.data.userAppType
+        this.envList = resp.data.envList
+        this.appTypeList = resp.data.appTypeList
+        this.getData()
       } else {
         this.$message.error(resp.msg)
       }
     }).catch(error => {
       this.$message.error(error.message)
     })
-    getAppTypeList().then(resp => {
-      if (resp.code === 0) {
-        this.appTypeList = resp.data
-      } else {
-        this.$message.error(resp.msg)
-      }
-    }).catch(error => {
-      this.$message.error(error.message)
-    })
-
-    this.getData()
   },
   methods: {
     handleCurrentChange(pageNumber) {

+ 7 - 14
src/views/devops/app/BuildDeploy.vue

@@ -197,7 +197,7 @@
 </template>
 
 <script>
-import { getAppTypeList, getBuildDeployList, getEnvList } from '@/api/devops'
+import { getBuildDeployList, getEnvList } from '@/api/devops'
 
 export default {
   name: 'BuildDeploy',
@@ -207,7 +207,7 @@ export default {
       appTypeList: [],
       queryInfo: {
         env: 'test',
-        appType: 'java',
+        appType: '',
         pn: 1
       },
       // 屏幕宽度, 为了控制分页条的大小
@@ -241,24 +241,17 @@ export default {
     document.title = '构建部署'
     getEnvList().then(resp => {
       if (resp.code === 0) {
-        this.envList = resp.data
+        this.queryInfo.env = resp.data.userEnv
+        this.queryInfo.appType = resp.data.userAppType
+        this.envList = resp.data.envList
+        this.appTypeList = resp.data.appTypeList
+        this.getData()
       } else {
         this.$message.error(resp.msg)
       }
     }).catch(error => {
       this.$message.error(error.message)
     })
-    getAppTypeList().then(resp => {
-      if (resp.code === 0) {
-        this.appTypeList = resp.data
-      } else {
-        this.$message.error(resp.msg)
-      }
-    }).catch(error => {
-      this.$message.error(error.message)
-    })
-
-    this.getData()
   },
   methods: {
     handleCurrentChange(pageNumber) {

+ 2 - 1
src/views/devops/machine/MachineHost.vue

@@ -222,7 +222,8 @@ export default {
     document.title = '机器列表'
     getEnvList().then(resp => {
       if (resp.code === 0) {
-        this.envList = resp.data
+        this.queryInfo.env = resp.data.userEnv
+        this.envList = resp.data.envList
         this.getData()
       } else {
         this.$message.error(resp.msg)