cxs преди 4 седмици
родител
ревизия
f5979c9119

+ 38 - 37
src/views/alarm/allData/index.vue

@@ -212,44 +212,39 @@ const dialog = reactive<any>({
 const cancel = () => {
   dialog.visible = false;
 }
+const handleSortChange = ({ column, prop, order }) => {
+  console.log('column:', column);
+  console.log('prop:', prop);
+  console.log('order:', order);
+
+  // Reset sorting if order is null
+  if (order === null) {
+    pageable.value.time_order = 0;
+    pageable.value.data_order = [];
+    getList();
+    return;
+  }
 
-const handleSortChange = ({ column, prop, order }) =>{
-  // 在这里发送请求到服务器端进行远程排序
-  // ORDER_DESC,desc排序0
-  // ORDER_ASC, //asc排序1
-  console.log('column:', column)
-  console.log('prop:', prop)
-  console.log('order:', order)
-
- if (order === null||order === 'descending') {
-    if (prop === 'data_time_i') {
-      pageable.value.time_order = 0; // 降序
-    }
-    if (pageable.value.data_items && pageable.value.data_items.length > 0) {
-      pageable.value.data_items.forEach(item => {
-        if (item.data_id === prop) {
-          item.data_order = 0; // 降序
-        } else {
-          item.data_order = 0; // 确保其他项为0
-        }
-      });
-    }
-  }else if (order === 'ascending') {
-   if (prop === 'data_time_i') {
-     pageable.value.time_order = 1; // 升序
-   }
-   if (pageable.value.data_items && pageable.value.data_items.length > 0) {
-     pageable.value.data_items.forEach(item => {
-       if (item.data_id === prop) {
-         item.data_order = 1; // 升序
-       } else {
-         item.data_order = 0; // 确保其他项为0
-       }
-     });
-   }
- }
-  getList();
-}
+  // Handle time sorting
+  if (prop === 'data_time_i') {
+    pageable.value.time_order = order === 'descending' ? 0 : 1;
+    pageable.value.data_order = [];
+    getList();
+    return;
+  }
+
+  // Default time order to 0
+  pageable.value.time_order = 0;
+  pageable.value.data_order = [];
+
+  // Find the item with the matching data_id and update its order
+  const item = pageable.value.data_items.find(item => item.data_id === prop);
+  if (item) {
+    item.data_order = order === 'descending' ? 0 : 1;
+    pageable.value.data_order = [item];
+    getList();
+  }
+};
 
 
 const pageable = ref<any>({
@@ -257,6 +252,7 @@ const pageable = ref<any>({
   time_order: 0,
   as_code_list:undefined,
   data_items:[],
+  data_order:[],
   pageNum: 1,
   pageSize: 20,
   total: 0
@@ -273,6 +269,11 @@ const handleQuery = () => {
 const resetQuery = () => {
   pageable.value.pageNum = 1;
   pageable.value.as_code_list = undefined
+  pageable.value.time_order =0
+  pageable.value.data_order =[]
+  pageable.value.pageSize =20
+  pageable.value.total = 0
+  tableRef.value!.clearSort()
   getList();
 };
 

+ 15 - 45
src/views/alarm/allWeather/index.vue

@@ -75,6 +75,7 @@ import {ref, reactive, onMounted, onActivated, onDeactivated} from "vue";
 import { ColumnProps } from "@/components/ProTable/interface";
 import { getPlatformList, getTacRecordList} from "@/api/modules/allData";
 import {Platform} from "@/api/interface";
+import {ElTable} from "element-plus";
 const pageable = ref<any>({
   as_code_list: [],
   tact_state_on: true,
@@ -83,7 +84,7 @@ const pageable = ref<any>({
   pageSize: 20,
   total: 1
 });
-
+const tableRef = ref<InstanceType<typeof ElTable>>();
 const as_code_list = ref('')
 
 const changeCodeList =(value)=>{
@@ -164,36 +165,11 @@ function findLabelByValue(noticeTypeList, value) {
   return item ? item.label : null;
 }
 
-const handleSortChange = ({ column, prop, order }) =>{
-  // 在这里发送请求到服务器端进行远程排序
-  console.log('column:', column)
-  console.log('prop:', prop)
-  console.log('order:', order)
-
-
-  if (order === null||order === 'descending') {
-    if (pageable.value.data_items && pageable.value.data_items.length > 0) {
-      pageable.value.data_items.forEach(item => {
-        if (item.data_id === prop) {
-          item.data_order = 0; // 降序
-        } else {
-          item.data_order = 0; // 确保其他项为0
-        }
-      });
-    }
-  }else if (order === 'ascending') {
-    if (pageable.value.data_items && pageable.value.data_items.length > 0) {
-      pageable.value.data_items.forEach(item => {
-        if (item.data_id === prop) {
-          item.data_order = 1; // 升序
-        } else {
-          item.data_order = 0; // 确保其他项为0
-        }
-      });
-    }
-  }
-  getList();
-}
+const handleSortChange = ({ column, prop, order }) => {
+  console.log('column:', column);
+  console.log('prop:', prop);
+  console.log('order:', order);
+};
 
 
 // 查询功能
@@ -204,20 +180,14 @@ const handleQuery = () => {
 
 //清空查询
 const resetQuery = () => {
+
+  as_code_list.value = '';
   pageable.value.pageNum = 1;
-  pageable.value = {
-    as_code_list: [],
-    tact_state_on: true,
-    tact_data_on: false,
-    tact_data: 0,
-    begin_time: undefined,
-    end_time: undefined,
-
-    pageNum: 1,
-    pageSize: 20,
-    total: 1
-  }
+  pageable.value.as_code_list= []
+  pageable.value.pageSize =20
+  pageable.value.total = 0
   timeBegin.value = undefined
+  getList()
 };
 
 /**
@@ -250,8 +220,8 @@ const columns = reactive<ColumnProps[]>([
   { prop: "tact_state", label: "策略状态" },
   { prop: "tact_type", label: "告警类型" },
   { prop: "data_value", label: "观测值" },
-  { prop: "alarm_on_time_i", label: "告警时间",width:150,sortable: true },
-  { prop: "alarm_off_time_i", label: "消警时间",width:150,sortable: true},
+  { prop: "alarm_on_time_i", label: "告警时间",width:150},
+  { prop: "alarm_off_time_i", label: "消警时间",width:150},
   { prop: "notice_type", label: "通知方式" },
   { prop: "remark", label: "告警说明",width:400 }
 ]);

+ 12 - 1
src/views/alarm/singleDevice/index.vue

@@ -22,7 +22,7 @@
             </template>
           </el-select>
         </div>
-        <div class="container-item container__label">名称:{{processTableFrom.as_name?processTableFrom.as_name:'--'}}</div>
+        <div class="container-item container__label">名称:{{selectedItem.as_name?selectedItem.as_name:'--'}}</div>
         <div class="container-item container__label">观测时间:{{processTableFrom.data_time?processTableFrom.data_time:'--'}}</div>
         <div class="container-item container__label">自动站状态:
 <!--          <el-tag type="danger" size="default" hit>离线</el-tag>-->
@@ -176,6 +176,9 @@ const processTableFrom = ref({});
 const certData = ref([]);
 
 const findRemainingDays = (inputSeType) => {
+  if(!certData.value){
+    return '--'
+  }
   const selectedCert = certData.value.find(cert => cert.se_type === parseInt(inputSeType));
   if (selectedCert) {
     // 将 cal_date_i 转换为毫秒
@@ -422,6 +425,14 @@ const queryas = ref<Platform>({
 const getPlatforms = async () => {
   const { data } = await getPlatformList(queryas.value);
   platformList.value = data.list
+  if (platformList.value .length > 0) {
+    selectedItem.value= platformList.value[0]
+    as_code_list.value = platformList.value[0].as_code;
+    pageable.value.as_code_list = [as_code_list.value]
+    querCert.value.asCode = as_code_list.value
+    await getList()
+    await getCertList()
+  }
 };
 
 

+ 25 - 15
src/views/query/deviceHealth/index.vue

@@ -577,21 +577,31 @@ const handleQuery = () => {
 
 //重置功能
 const resetQuery = () => {
-  pageable.value = {
-    time_space:60,
-    begin_time: undefined,
-    end_time: undefined,
-    data_type: false,
-    time_order: 1,
-    as_code_list:[],
-    state_list: [
-      "STATE_PART",
-      "STATE_SENSOR",
-      "STATE_ARTIFICIAL"
-    ],
-    pageNum: 1,
-    pageSize: 24
-  }
+
+  isStand.value = true
+  as_code_list.value = undefined;
+  hot.value = true;
+  points.value = true;
+  singleTime.value=undefined;
+  multiTime.value = undefined;
+
+
+  pageable.value.time_order = 1
+  pageable.value.time_space =60
+  pageable.value.begin_time =undefined
+  pageable.value.end_time = undefined
+  pageable.value.data_type = false
+  pageable.value.as_code_list =[]
+  pageable.value.state_list =[
+    "STATE_PART",
+    "STATE_SENSOR",
+    "STATE_ARTIFICIAL"
+  ]
+
+  pageable.value.pageNum = 1
+  pageable.value.pageSize =24
+  pageable.value.total =0
+
   processTableData.value = []
   getList();
 };

+ 12 - 43
src/views/query/hazardousWeather/index.vue

@@ -199,35 +199,11 @@ function findLabelByValue(noticeTypeList, value) {
   return item ? item.label : null;
 }
 
-const handleSortChange = ({ column, prop, order }) =>{
-  // 在这里发送请求到服务器端进行远程排序
-  console.log('column:', column)
-  console.log('prop:', prop)
-  console.log('order:', order)
-
-  if (order === null||order === 'descending') {
-    if (pageable.value.data_items && pageable.value.data_items.length > 0) {
-      pageable.value.data_items.forEach(item => {
-        if (item.data_id === prop) {
-          item.data_order = 0; // 降序
-        } else {
-          item.data_order = 0; // 确保其他项为0
-        }
-      });
-    }
-  }else if (order === 'ascending') {
-    if (pageable.value.data_items && pageable.value.data_items.length > 0) {
-      pageable.value.data_items.forEach(item => {
-        if (item.data_id === prop) {
-          item.data_order = 1; // 升序
-        } else {
-          item.data_order = 0; // 确保其他项为0
-        }
-      });
-    }
-  }
-  getList();
-}
+const handleSortChange = ({ column, prop, order }) => {
+  console.log('column:', column);
+  console.log('prop:', prop);
+  console.log('order:', order);
+};
 
 
 // 查询功能
@@ -239,19 +215,12 @@ const handleQuery = () => {
 //清空查询
 const resetQuery = () => {
   pageable.value.pageNum = 1;
-  pageable.value = {
-    as_code_list: [],
-    tact_state_on: false,
-    tact_data_on: false,
-    tact_data: 0,
-    begin_time: undefined,
-    end_time: undefined,
-
-    pageNum: 1,
-    pageSize: 20,
-    total: 1
-  }
+  pageable.value.as_code_list = []
+  pageable.value.begin_time=undefined
+  pageable.value.end_time=undefined
+  as_code_list.value = ''
   timeBegin.value = undefined
+  getList()
 };
 
 /**
@@ -284,8 +253,8 @@ const columns = reactive<ColumnProps[]>([
   { prop: "tact_state", label: "策略状态" },
   { prop: "tact_type", label: "告警类型" },
   { prop: "data_value", label: "观测值" },
-  { prop: "alarm_on_time_i", label: "告警时间",width:150,sortable: true },
-  { prop: "alarm_off_time_i", label: "消警时间",width:150,sortable: true},
+  { prop: "alarm_on_time_i", label: "告警时间",width:150},
+  { prop: "alarm_off_time_i", label: "消警时间",width:150},
   { prop: "notice_type", label: "通知方式" },
   { prop: "remark", label: "告警说明",width:400 }
 ]);

+ 46 - 45
src/views/query/queryObservationData/index.vue

@@ -316,42 +316,40 @@ const cancel = () => {
   dialog.visible = false;
 }
 
-const handleSortChange = ({ column, prop, order }) =>{
-  // 在这里发送请求到服务器端进行远程排序
-  console.log('column:', column)
-  console.log('prop:', prop)
-  console.log('order:', order)
+const handleSortChange = ({ column, prop, order }) => {
+  console.log('column:', column);
+  console.log('prop:', prop);
+  console.log('order:', order);
+
+  // Reset sorting if order is null
+  if (order === null) {
+    pageable.value.time_order = 0;
+    pageable.value.data_order = [];
+    getList();
+    return;
+  }
 
+  // Handle time sorting
+  if (prop === 'data_time_i') {
+    pageable.value.time_order = order === 'descending' ? 0 : 1;
+    pageable.value.data_order = [];
+    getList();
+    return;
+  }
 
-  if (order === null||order === 'descending') {
-    if (prop === 'data_time_i') {
-      pageable.value.time_order = 0; // 降序
-    }
-    if (pageable.value.data_items && pageable.value.data_items.length > 0) {
-      pageable.value.data_items.forEach(item => {
-        if (item.data_id === prop) {
-          item.data_order = 0; // 降序
-        } else {
-          item.data_order = 0; // 确保其他项为0
-        }
-      });
-    }
-  }else if (order === 'ascending') {
-    if (prop === 'data_time_i') {
-      pageable.value.time_order = 1; // 升序
-    }
-    if (pageable.value.data_items && pageable.value.data_items.length > 0) {
-      pageable.value.data_items.forEach(item => {
-        if (item.data_id === prop) {
-          item.data_order = 1; // 升序
-        } else {
-          item.data_order = 0; // 确保其他项为0
-        }
-      });
-    }
+  // Default time order to 0
+  pageable.value.time_order = 0;
+  pageable.value.data_order = [];
+
+  // Find the item with the matching data_id and update its order
+  const item = pageable.value.data_items.find(item => item.data_id === prop);
+  if (item) {
+    item.data_order = order === 'descending' ? 0 : 1;
+    pageable.value.data_order = [item];
+    getList();
   }
-  getList();
-}
+};
+
 
 const timeSpaceList= [
   {
@@ -542,19 +540,22 @@ const handleQuery = () => {
 
 //重置功能
 const resetQuery = () => {
-  pageable.value = {
-    data_type: false,
-    time_order: 0,
-    time_space:60,
-    begin_time:undefined,
-    end_time: undefined,
-    as_code_list:[],
-    data_items:[],
-    pageNum: 1,
-    pageSize: 20,
-    total: 0
-  }
+  isStand.value = true
+  as_code_list.value = undefined;
+  hot.value = true;
+  points.value = true;
+  singleTime.value=undefined;
+  multiTime.value = undefined;
+  pageable.value.time_order = 0
+  pageable.value.time_space =60
+  pageable.value.begin_time =undefined
+  pageable.value.end_time = undefined
+  pageable.value.as_code_list =[]
+  pageable.value.pageNum = 1
+  pageable.value.pageSize =20
+  pageable.value.total =0
   pageable.value.data_items = [...customizeColumns.value];
+  processTableData.value = []
   getList();
 };
 

+ 12 - 2
src/views/system/role/index.vue

@@ -241,8 +241,18 @@ const handleCurrentChange = (val: number) => {
 
 const processTableData = ref([
   {
-    id: "681913747276782417",
-    a: "观察员",
+    id: "1",
+    a: "管理员",
+  },
+  {
+    id: "2",
+    a: "观测员",
+  }, {
+    id: "3",
+    a: "预报员",
+  }, {
+    id: "4",
+    a: "装备管理人员",
   }
 ]);