wujingjing
2024-12-19 fc78f132a8bcd60c7f9c289f3cf54e4bd98c6c50
src/utils/util.ts
@@ -1,4 +1,4 @@
import { ElMessage, ElMessageBox } from 'element-plus';
import { ElMessage, ElMessageBox, ElMessageBoxOptions } from 'element-plus';
import JSONbig from 'json-bigint';
import { storeToRefs } from 'pinia';
@@ -470,7 +470,7 @@
   const startDate = new Date();
   startDate.setTime(startDate.getTime() - 3600 * 1000 * 24 * dates);
   startDate.setHours(0, 0, 0, 0);
   endDate.setHours(23,59,59,59)
   endDate.setHours(23, 59, 59, 59);
   return [startDate, endDate];
};
@@ -745,3 +745,18 @@
   }
   return decodedData;
}
export const elConfirm = (
   message,
   options: ElMessageBoxOptions = {
      confirmButtonText: '确定',
      cancelButtonText: '取消',
      type: 'warning',
   }
) => {
   return new Promise((resolve, reject) => {
      ElMessageBox.confirm(message, '提示', options)
         .then(() => resolve(true))
         .catch(() => reject(false));
   });
};