|
@@ -321,6 +321,36 @@ const handleSortChange = ({ column, prop, order }) =>{
|
|
|
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();
|
|
|
}
|
|
|
|
|
|
const timeSpaceList= [
|
|
@@ -455,14 +485,20 @@ const changeTime =(time)=>{
|
|
|
pageable.value.end_time = endTime/1000
|
|
|
}else {
|
|
|
//18点
|
|
|
- const startTimeStamp = timeStamp + 18 * 60 * 60 * 1000 + 60 * 1000;// 添加18小时和1分钟(18*60*60秒+60秒)
|
|
|
+ // 前一天的18:01:00
|
|
|
+ const previousDay = new Date(time);
|
|
|
+ previousDay.setDate(previousDay.getDate() - 1); // 设置为前一天
|
|
|
+ previousDay.setHours(18, 1, 0, 0); // 设置时间为18:01:00
|
|
|
+ const startTimeStamp = previousDay.getTime(); // 获取前一天18:01:00的时间戳
|
|
|
+
|
|
|
+ // 当天的18:00:00
|
|
|
const nextDay = new Date(time);
|
|
|
- nextDay.setDate(nextDay.getDate() + 1); // 设置为第二天
|
|
|
nextDay.setHours(18, 0, 0, 0); // 设置时间为18:00:00
|
|
|
- const endTimeStamp = nextDay.getTime(); // 获取第二天18:00:00的时间戳
|
|
|
- console.log(startTimeStamp)
|
|
|
- pageable.value.begin_time = startTimeStamp/1000
|
|
|
- pageable.value.end_time = endTimeStamp/1000
|
|
|
+ const endTimeStamp = nextDay.getTime(); // 获取当天18:00:00的时间戳
|
|
|
+
|
|
|
+ console.log(startTimeStamp);
|
|
|
+ pageable.value.begin_time = startTimeStamp / 1000;
|
|
|
+ pageable.value.end_time = endTimeStamp / 1000;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -692,7 +728,7 @@ const updateColumns = () => {
|
|
|
const column = [
|
|
|
{ prop: "as_name", label: "站名", width: 100 },
|
|
|
{ prop: "as_code", label: "站号", width: 100 },
|
|
|
- { prop: "data_time_i", label: "观测时间", width: 170 }
|
|
|
+ { prop: "data_time_i", label: "观测时间", width: 170,sortable: true }
|
|
|
];
|
|
|
|
|
|
const newColumns = customizeColumns.value.map(item => ({
|