添加redis缓存刷新

This commit is contained in:
2025-11-12 14:50:21 +08:00
parent 6a1a7eb218
commit 5180dfaf60
4 changed files with 91 additions and 65 deletions

View File

@@ -90,6 +90,15 @@ export function msgHandle(data: object) {
data,
});
}
//刷新redis缓存
export function refreshRedis() {
return service({
url: "/accept/refreshIdCache",
method: "get",
});
}
// 地图统计数量
export function mapCount(data: object) {
return service({

View File

@@ -967,7 +967,7 @@ const initialResponsibilityList = () => {
// 根据实际字段进行拼接,示例:
const content = `${item.lineName || ""}进行${
item.dataTimes || ""
}次谐波电压溯源,溯源对象:${item.userDataName || ""}`.trim();
}次谐波电压溯源,溯源对象:${item.userDataName || "系统测点"}`.trim();
return {
...item,
content: content,

View File

@@ -422,7 +422,13 @@
align="center"
label="责任对象"
show-overflow-tooltip
/>
>
<template #default="scope">
<span>{{
scope.row.userDataName==null? '系统测点':scope.row.userDataName
}}</span>
</template>
</el-table-column>
<el-table-column
prop="updateTime"
align="center"

View File

@@ -1,8 +1,8 @@
<template>
<div id="index" ref="appRef">
<div
class="bg"
:class="
class="bg"
:class="
store.state.screenNotic == 1
? pushFlag
? bottomTextRef?.urgentList.length > 0
@@ -23,34 +23,34 @@
>
</div>
<dv-decoration-10 class="dv-dec-10" :color="color[1]" />
<dv-decoration-10 class="dv-dec-10" :color="color[1]"/>
<div class="d-flex jc-center">
<dv-decoration-8 class="dv-dec-8" :color="color[2]" />
<dv-decoration-8 class="dv-dec-8" :color="color[2]"/>
<div class="title">
<span class="title-text">{{ title }}</span>
</div>
<dv-decoration-8
class="dv-dec-8"
:reverse="true"
:color="color[2]"
class="dv-dec-8"
:reverse="true"
:color="color[2]"
/>
</div>
<dv-decoration-10 class="dv-dec-10-s" :color="color[1]" />
<dv-decoration-10 class="dv-dec-10-s" :color="color[1]"/>
</div>
<div class="d-flex secondLine">
<div class="react-right mr-1">
<span class="text fw-b" style="display: flex">
<datePicker
ref="datePickerRef"
@timeChangeInfo="timeChangeInfo"
ref="datePickerRef"
@timeChangeInfo="timeChangeInfo"
/>
</span>
</div>
<el-dropdown placement="bottom">
<el-icon :size="22" :color="color[1][0]" class="mt-0.5 mt5">
<Menu />
<Menu/>
</el-icon>
<template #dropdown>
<el-dropdown-menu>
@@ -58,18 +58,21 @@
<!-- <el-dropdown-item @click="handleClick('2')"
>模拟短信发送</el-dropdown-item
> -->
<el-dropdown-item @click="handleClick('3')"
>系统配置</el-dropdown-item
>
<el-dropdown-item @click="handleClick('4')"
>报表导出</el-dropdown-item
>
<el-dropdown-item @click="handleClick('5')"
>台账导出</el-dropdown-item
>
<el-dropdown-item @click="handleClick('1')"
>已发送短信查询</el-dropdown-item
>
<el-dropdown-item @click="handleClick('3')">
系统配置
</el-dropdown-item>
<el-dropdown-item @click="handleClick('4')">
报表导出
</el-dropdown-item>
<el-dropdown-item @click="handleClick('5')">
台账导出
</el-dropdown-item>
<el-dropdown-item @click="handleClick('1')">
短信管理
</el-dropdown-item>
<el-dropdown-item @click="handleClick('6')">
缓存刷新
</el-dropdown-item>
</el-dropdown-menu>
</template>
@@ -80,33 +83,33 @@
<!-- 第三行数据 -->
<div class="content-box">
<dv-border-box-13 :color="color[0]">
<eventStatistics ref="eventStatisticsRef" />
<eventStatistics ref="eventStatisticsRef"/>
</dv-border-box-13>
<dv-border-box-10 :color="color[0]">
<Map ref="mapRef" />
<Map ref="mapRef"/>
<!-- <center-left /> -->
</dv-border-box-10>
<dv-border-box-13 :color="color[0]">
<alarm ref="alarmRef" />
<alarm ref="alarmRef"/>
<!-- 紧急告警 -->
<div
class="icon"
v-if="!(bottomTextRef?.urgentList.length == 0)"
:color="color[0][1]"
:class="
class="icon"
v-if="!(bottomTextRef?.urgentList.length == 0)"
:color="color[0][1]"
:class="
bottomTextRef?.urgentList.length > 0
? 'animate-flash-red'
: ''
"
@click="drawerClick"
@click="drawerClick"
>
<!-- <WarnTriangleFilled /> -->
<span
class="iconfont icon-gaojing"
:style="{
class="iconfont icon-gaojing"
:style="{
color:
bottomTextRef?.urgentList.length > 0
? '#ff0000'
@@ -114,12 +117,12 @@
}"
></span>
<span
class="count"
v-if="bottomTextRef?.urgentList.length > 0"
>{{
class="count"
v-if="bottomTextRef?.urgentList.length > 0"
>{{
bottomTextRef?.urgentList.length > 99
? "99+"
: bottomTextRef?.urgentList.length
? "99+"
: bottomTextRef?.urgentList.length
}}</span
>
</div>
@@ -129,18 +132,18 @@
<!-- 第四行数据 -->
<div class="bototm-box">
<dv-border-box-13 :color="color[0]">
<endpointStatistics ref="endpointStatisticsRef" />
<endpointStatistics ref="endpointStatisticsRef"/>
<!-- <bottom-left /> -->
</dv-border-box-13>
<dv-border-box-13 :color="color[0]">
<informationTable
ref="informationTableRef"
@handleCurrentChange="handleCurrentChange"
ref="informationTableRef"
@handleCurrentChange="handleCurrentChange"
/>
</dv-border-box-13>
<dv-border-box-13 :color="color[0]">
<sendTrends ref="sendTrendsRef" />
<sendTrends ref="sendTrendsRef"/>
</dv-border-box-13>
</div>
<!-- 底部 -->
@@ -148,22 +151,22 @@
</div>
</div>
<bottomText
ref="bottomTextRef"
@handleCurrentChange="handleCurrentChange"
ref="bottomTextRef"
@handleCurrentChange="handleCurrentChange"
/>
<!-- 已发短信查询 -->
<smsQueries
ref="smsQueriesRef"
v-if="smsQueriesFlag"
@close="smsQueriesFlag = false"
ref="smsQueriesRef"
v-if="smsQueriesFlag"
@close="smsQueriesFlag = false"
/>
<!-- 系统配置 -->
<Config ref="ConfigRef" @flushed="inquire" />
<Config ref="ConfigRef" @flushed="inquire"/>
<!-- 报表导出 -->
<ReportForms ref="reportForms" />
<ReportForms ref="reportForms"/>
</div>
</template>
@@ -179,11 +182,11 @@ import {
watch,
} from "vue";
import { formatTime, getDateRange, stopSpeak } from "@/utils/index"; //引入封装好的
import {formatTime, getDateRange, stopSpeak} from "@/utils/index"; //引入封装好的
import useDraw from "@/utils/useDraw"; // 引入封装好的屏幕适配方法
import { WEEK, title, subtitle, moduleInfo, color } from "@/constant/index"; //引入封装的标题日期
import {WEEK, title, subtitle, moduleInfo, color} from "@/constant/index"; //引入封装的标题日期
import datePicker from "@/components/datePicker/index.vue";
import { Menu, BellFilled, WarnTriangleFilled } from "@element-plus/icons-vue";
import {Menu, BellFilled, WarnTriangleFilled} from "@element-plus/icons-vue";
//页面组件
import eventStatistics from "./components/eventStatistics.vue"; //统计事件
import endpointStatistics from "./components/endpointStatistics.vue"; //终端在线统计
@@ -194,10 +197,12 @@ import Map from "./components/bdMap.vue"; //地图
import smsQueries from "./components/smsQueries.vue"; // //短信查询
import bottomText from "./components/bottomText.vue"; //边框组件
import socketClient from "@/utils/webSocketClient";
import { useStore } from "vuex";
import {useStore} from "vuex";
import Config from "./components/config.vue";
import ReportForms from "./components/reportForms.vue";
import { exportLineData } from "@/api/statistics/index";
import {exportLineData,refreshRedis} from "@/api/statistics/index";
import {ElMessage} from "element-plus";
const store = useStore();
const smsQueriesRef = ref(); // 短信查询组件引用
const endpointStatisticsRef = ref(); // 终端在线统计组件引用
@@ -226,7 +231,7 @@ const timeInfo: any = reactive({
const timeType = ref(3);
const reportForms = ref();
// 适配处理
const { appRef, calcRate, windowDraw, unWindowDraw } = useDraw();
const {appRef, calcRate, windowDraw, unWindowDraw} = useDraw();
// 连接webSocket客户端
const init = () => {
if (!dataSocket.socketServe) {
@@ -317,6 +322,12 @@ const handleClick = (type: string) => {
document.body.removeChild(link);
});
}
if (type === "6") {
refreshRedis().then((res: any) => {
ElMessage.success("刷新缓存成功");
});
}
}, 100);
};
@@ -347,13 +358,13 @@ const inquire = async () => {
};
watch(
store.state,
(val) => {
timeChangeInfo();
},
{
deep: true,
}
store.state,
(val) => {
timeChangeInfo();
},
{
deep: true,
}
);
</script>