Browse Source

应用监控下拉框修改

Rgx 1 year ago
parent
commit
11f550fdb0
1 changed files with 37 additions and 10 deletions
  1. 37 10
      src/views/modules/monitor/components/applications.vue

+ 37 - 10
src/views/modules/monitor/components/applications.vue

@@ -19,14 +19,14 @@
         <el-select
           clearable
           label="应用类型"
-          v-model="dataForm.applicationType"
+          v-model="dataForm.deployDeviceId"
           @change="getDataListByType(dataForm.applicationType)"
         >
           <el-option
-            v-for="data in applicationTypeOptions"
-            :key="data"
-            :label="data"
-            :value="data"
+            v-for="data in deployDevices"
+            :key="data.edgenodesId"
+            :label="data.edgenodesName"
+            :value="data.edgenodesId"
           ></el-option>
         </el-select>
       </el-form-item>
@@ -81,6 +81,14 @@
         label="应用状态"
       >
       </el-table-column>
+
+      <el-table-column
+        prop="deployDeviceName"
+        header-align="center"
+        align="center"
+        label="部署设备"
+      >
+      </el-table-column>
       <!-- <el-table-column
         prop="parentProjectName"
         header-align="center"
@@ -182,8 +190,11 @@ export default {
       applicationViewVisible: false,
       filterVal: "",
       applicationTypeOptions: [
-        
+
       ],
+      deployDevices:[
+
+      ]
     };
   },
   components: {
@@ -198,24 +209,40 @@ export default {
     // 获取数据列表
     getDataList() {
       this.dataListLoading = true;
-      this.$http({
+      /* this.$http({
         url: this.$http.adornUrl("/category/select"),
         method: "get",
       }).then(({ data }) => {
         this.applicationTypeOptions = this.unique(data.list);
-      });
+      }); */
+      // 获取所有边缘结点
+      this.$http({
+        url: this.$http.adornUrl('/generator/edgenodes/list'),
+        method: 'get',
+        params: this.$http.adornParams({
+
+        })
+      }).then(({data}) => {
+        this.deployDevices=data.page.list;
+        var center={edgenodesId:0,edgenodesName:"中心云"};
+        this.deployDevices.push(center);
+      })
       this.$http({
         url: this.$http.adornUrl("/generator/applications/list"),
         method: "get",
         params: this.$http.adornParams({
           page: this.pageIndex,
           limit: this.pageSize,
-          applicationType: this.dataForm.applicationType,
+          deployDeviceId: this.dataForm.deployDeviceId,
           applicationName: this.dataForm.applicationName,
         }),
       }).then(({ data }) => {
         if (data && data.code === 0) {
-          this.dataList = data.page.list;
+          this.dataList = data.page.list.map((element) => {
+            element["state"] = 0;
+            element["loadingText"] = "启动";
+            return element;
+          });
           this.totalPage = data.page.totalCount;
         } else {
           this.dataList = [];