diff --git a/src/components/headerBox/dialog/headerDialog.vue b/src/components/headerBox/dialog/headerDialog.vue index a3898b0..7ba3e4b 100644 --- a/src/components/headerBox/dialog/headerDialog.vue +++ b/src/components/headerBox/dialog/headerDialog.vue @@ -10,88 +10,186 @@ +.pagination-class { + margin-top: 20px; +} + diff --git a/src/components/headerBox/header2.vue b/src/components/headerBox/header2.vue index 4750404..616495b 100644 --- a/src/components/headerBox/header2.vue +++ b/src/components/headerBox/header2.vue @@ -100,7 +100,7 @@ import useNowTime from "@/hook/nowTime"; import { ClickOutside as vClickOutside } from "element-plus"; import { useRoute, useRouter } from "vue-router"; import { devListType } from "@/type/InPlantProducts"; -import { getAlarmListData } from "@/http/index"; +import { getAlarmListData,getAlarmListHistoryData } from "@/http/index"; import { onMounted, onUnmounted, @@ -132,7 +132,7 @@ let popoverliDom = ref(); let Abnormalpopovervisible = ref(false); let AbnormalpopovervisibleCtrl = ref(false); //解决点击历史报警数据弹窗外部关闭再打开问题 //dialog -let dialogdata = reactive([]); +let dialogdata = ref([]); let dialogTableVisible = ref(false); let dialogLoading = ref(true); let dialogtotal=ref(0) @@ -224,7 +224,7 @@ function langJudge() { } function showDialog() { if (dialogTableVisible.value == false) { - dialogdata.length = 0; + getDialogdatafun({ type: AbnormalType.type, pageSize: 10, @@ -235,12 +235,13 @@ function showDialog() { dialogTableVisible.value = true; } async function getDialogdatafun(config) { + // dialogdata.length = 0; dialogLoading.value = true; - let result: any = await getAlarmListData(config); + let result: any = await getAlarmListHistoryData(config); if (result.code == 200) { dialogtotal.value=result.total - dialogdata.push(...result.rows) + dialogdata.value=result.rows dialogLoading.value = false; }else{ setTimeout(() => { @@ -249,6 +250,7 @@ async function getDialogdatafun(config) { } }, 0); } + console.log(dialogdata); } diff --git a/src/http/index.ts b/src/http/index.ts index 11590ad..1a18726 100644 --- a/src/http/index.ts +++ b/src/http/index.ts @@ -1,5 +1,5 @@ /* - * @FilePath: \wwwd:\code\screenFront\src\http\index.ts + * @FilePath: \code\gitscreenFront\src\http\index.ts * @Author: 王路平 * @文件版本: V1.0.0 * @Date: 2023-03-14 11:14:41 @@ -12,4 +12,8 @@ import {get,post} from "@/utils/http" //报警数据 export function getAlarmListData(data:any){ return get('/alarm/getAlarmList',data) +} +//报警历史数据查询 +export function getAlarmListHistoryData(data:any){ + return get('/alarm/getAlarmListHistory',data) } \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index 17be6fe..91ddfbc 100644 --- a/src/main.ts +++ b/src/main.ts @@ -12,6 +12,8 @@ import App from './App.vue' import ElementPlus from 'element-plus' import 'element-plus/dist/index.css' import 'element-plus/theme-chalk/dark/css-vars.css' +import 'dayjs/locale/zh-cn' +import zhCn from 'element-plus/dist/locale/zh-cn.mjs' // import echarts from '@/utils/echarts.js' import echarts from '@/utils/echarts' import {createPinia} from 'pinia' @@ -26,4 +28,4 @@ const store = createPinia() app.config.globalProperties.$echarts = echarts;//vue3的挂载方式 app.use(store) app.use(i18n) -app.use(router).use(ElementPlus).use(dataV).mount('#app') \ No newline at end of file +app.use(router).use(ElementPlus, {locale: zhCn,}).use(dataV).mount('#app') \ No newline at end of file diff --git a/src/utils/time.ts b/src/utils/time.ts index 42824d4..698b05a 100644 --- a/src/utils/time.ts +++ b/src/utils/time.ts @@ -1,5 +1,5 @@ /* - * @FilePath: \daping\src\utils\time.ts + * @FilePath: \code\gitscreenFront\src\utils\time.ts * @Author: 王路平 * @文件版本: V1.0.0 * @Date: 2023-02-07 13:43:31 @@ -9,10 +9,10 @@ */ import { getStoredLanguage } from "../utils/languageStorage"; -export function gettime(data = null) { +export function gettime(data = null,type = 1) { var time if (data) { - time = new Date(data); + data instanceof Date? time=data : time = new Date(data); } else { time = new Date(); } @@ -38,7 +38,14 @@ export function gettime(data = null) { if (minutes < 10) minutes = "0" + minutes; if (seconds < 10) seconds = "0" + seconds; - return year + "-" + month + "-" + dates + " " + hours + ':' + minutes + ':' + seconds + ' ' + arr[day]; + if(type==1){ + return year + "-" + month + "-" + dates + " " + hours + ':' + minutes + ':' + seconds + ' ' + arr[day]; + }else if (type == 2){ + return year + "-" + month + "-" + dates + " " + hours + ':' + minutes + ':' + seconds; + }else{ + return year + "-" + month + "-" + dates + " " + hours + ':' + minutes + ':' + seconds + ' ' + arr[day]; + } + } export function clacendTime(endtime, nowtime) { let newDate = Math.abs(endtime - nowtime) @@ -47,4 +54,4 @@ export function clacendTime(endtime, nowtime) { var m = Math.floor(newDate / 1000 / 60 % 60) var s = Math.floor(newDate / 1000 % 60) return day + '天' + h + '时' + m + '分' + s + '秒' -} \ No newline at end of file +}