Browse Source

代码提交

cxs 4 months ago
parent
commit
41b9fb809a

+ 11 - 0
src/api/interface/index.ts

@@ -92,4 +92,15 @@ export namespace User {
     name: string;
     children?: ResDepartment[];
   }
+
+  export interface Platform {
+    as_code:string;
+    as_name:string;
+    pagesize:string;
+    currentpage:string;
+  }
+
+}
+
+export class Platform {
 }

+ 12 - 0
src/api/modules/allData.ts

@@ -0,0 +1,12 @@
+import {ResultData} from "@/api/interface/index";
+import { PORT1 } from "@/api/config/servicePort";
+import http from "@/api";
+
+
+/**
+ * @name 实时监测报警模块
+ */
+// 获取自动站基本信息
+export const getPlatformList = (params: {}) => {
+  return http.post<ResultData<any>>(PORT1 + `/queryasinfo`, params);
+};

+ 3 - 2
src/layouts/components/Header/components/Avatar.vue

@@ -56,11 +56,12 @@ const logout = () => {
     cancelButtonText: "取消",
     type: "warning"
   }).then(async () => {
-    // 1.执行退出登录接口
-    await logoutApi();
+    // // 1.执行退出登录接口
+    // await logoutApi();
 
     // 2.清除 Token
     userStore.setToken("");
+    userStore.setAsInfo([]);
 
     // 3.重定向到登陆页
     router.replace(LOGIN_URL);

+ 30 - 3
src/views/alarm/allData/index.vue

@@ -7,8 +7,12 @@
           <el-form :model="queryParams" label-width="auto" :inline="true">
             <el-form-item label="自动站:">
               <el-select v-model="queryParams.name"   filterable placeholder="请搜索自动站" remote reserve-keyword clearable  style="width: 200px">
-                <el-option label="站1" value="1" />
-                <el-option label="站2" value="2" />
+                <el-option
+                  v-for="item in platformList"
+                  :key="item.as_code"
+                  :label="item.as_code +' '+item.as_name"
+                  :value="item.as_code"
+                />
                 <template #prefix>
                   <el-icon class="el-input__icon"><search /></el-icon>
                 </template>
@@ -92,9 +96,11 @@
 
 <script setup lang="ts" name="useProTable">
 import Pagination from "@/components/ProTable/components/Pagination.vue";
-import { ref, reactive } from "vue";
+import {ref, reactive, onMounted} from "vue";
 import { ColumnProps } from "@/components/ProTable/interface";
 import {ElTable} from "element-plus";
+import {getPlatformList} from "@/api/modules/allData";
+import { Platform } from "@/api/interface";
 const tableRef = ref<InstanceType<typeof ElTable>>();
 const dialog = reactive<any>({
   visible: false,
@@ -441,4 +447,25 @@ const columns = reactive<ColumnProps[]>([
   { prop: "h", label: "相对湿度(%)" ,sortable: true},
   { prop: "i", label: "漏点温度(℃)",sortable: true }
 ]);
+
+
+
+
+// 查询自动站列表
+const queryas = ref<Platform>({
+  pagesize: 20,
+  currentpage: 1
+})
+
+const platformList =ref<any>([])
+
+const getPlatforms = async () => {
+  const { data } = await getPlatformList(queryas.value);
+  platformList.value = data
+};
+
+onMounted(() => {
+  getPlatforms()
+})
+
 </script>