Compare commits
13 Commits
859d890434
...
2026-06
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
295cfc6ec1 | ||
|
|
37eef06a3b | ||
|
|
5c766684f9 | ||
| 5180dfaf60 | |||
|
|
6a1a7eb218 | ||
|
|
80ed66a2b0 | ||
|
|
7d86bbb6c2 | ||
|
|
2631f43623 | ||
|
|
b396686b61 | ||
|
|
1a0a42c5a5 | ||
|
|
980d5a22b3 | ||
|
|
0ffc0cd01e | ||
|
|
079263ed38 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -11,6 +11,8 @@ node_modules
|
||||
dist
|
||||
|
||||
offline
|
||||
# tiles
|
||||
# tiles1
|
||||
dist-ssr
|
||||
*.local
|
||||
# Editor directories and files
|
||||
|
||||
@@ -45,7 +45,8 @@ export function eventTrend(data: object) {
|
||||
// 获取历史暂降事件趋势
|
||||
export function noDealEventList(data: object) {
|
||||
return service({
|
||||
url: "/largescreen/noDealEventList",
|
||||
// url: "/largescreen/noDealEventList",
|
||||
url: "/largescreen/noDealEventListMessage",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
@@ -53,7 +54,8 @@ export function noDealEventList(data: object) {
|
||||
// 处理暂降事件
|
||||
export function lookEvent(data: object) {
|
||||
return service({
|
||||
url: "/largescreen/lookEvent",
|
||||
// url: "/largescreen/lookEvent",
|
||||
url: "/largescreen/lookMessage",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
@@ -90,6 +92,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({
|
||||
@@ -201,6 +212,23 @@ export function eventPage(data: object) {
|
||||
data,
|
||||
});
|
||||
}
|
||||
// 获取短信模版
|
||||
export function messageGenerate(data: object) {
|
||||
return service({
|
||||
// url: "/accept/messageGenerate",
|
||||
url: "/accept/messageGenerateByIds",
|
||||
method: "post",
|
||||
params: data,
|
||||
});
|
||||
}
|
||||
// 发送短信
|
||||
export function messageSend(data: object) {
|
||||
return service({
|
||||
url: "/accept/messageSend",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
// 导出暂降事件列表
|
||||
export function eventPageExport(data: object) {
|
||||
return service({
|
||||
@@ -303,3 +331,12 @@ export function exportLineData() {
|
||||
responseType: "blob",
|
||||
});
|
||||
}
|
||||
|
||||
// 无锡地图查询
|
||||
export function stationMap(data: object) {
|
||||
return service({
|
||||
url: "/scale/stationMap",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
BIN
src/assets/bdz.png
Normal file
BIN
src/assets/bdz.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
@@ -1,101 +1,101 @@
|
||||
:deep(.el-dialog__body) {
|
||||
color: #fff !important;
|
||||
padding: 10px;
|
||||
}
|
||||
:deep(.el-dialog__body) {
|
||||
color: #fff !important;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
:deep(.el-form-item__label) {
|
||||
color: #fff !important;
|
||||
}
|
||||
:deep(.el-dialog__header) {
|
||||
padding: 10px;
|
||||
background-color: #21232b;
|
||||
border-bottom: 1px solid #fff;
|
||||
}
|
||||
:deep(.el-dialog__footer) {
|
||||
padding: 0 10px 10px !important;
|
||||
}
|
||||
:deep(.el-form-item__label) {
|
||||
color: #fff !important;
|
||||
}
|
||||
:deep(.el-dialog__header) {
|
||||
padding: 10px;
|
||||
background-color: #21232b;
|
||||
border-bottom: 1px solid #fff;
|
||||
}
|
||||
:deep(.el-dialog__footer) {
|
||||
padding: 0 10px 10px !important;
|
||||
}
|
||||
|
||||
:deep(.el-descriptions__label.el-descriptions__cell) {
|
||||
background: #0a73ff40 !important;
|
||||
color: #fff !important;
|
||||
font-weight: bold;
|
||||
}
|
||||
:deep(.el-descriptions) {
|
||||
--el-descriptions-table-border: 1px solid #0a73ff;
|
||||
.el-descriptions__content.el-descriptions__cell.is-bordered-content {
|
||||
color: #fff;
|
||||
}
|
||||
.el-descriptions__body {
|
||||
background-color: #00000050;
|
||||
}
|
||||
}
|
||||
:deep(.tableBox) {
|
||||
padding: 10px;
|
||||
.el-table {
|
||||
--el-table-border-color: #0a73ff;
|
||||
--el-table-row-hover-bg-color: #0a73ff20;
|
||||
--el-table-header-bg-color: #0a73ff40;
|
||||
--el-table-bg-color: #ffffff00;
|
||||
text-align: center;
|
||||
// th {
|
||||
// background-color: #0a73ff;
|
||||
// color: #fff;
|
||||
// }
|
||||
tr {
|
||||
background-color: #00000050 !important;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
:deep(
|
||||
.el-table--striped
|
||||
.el-table__body
|
||||
tr.el-table__row--striped
|
||||
td.el-table__cell
|
||||
) {
|
||||
background: #5aa1ff29;
|
||||
}
|
||||
.titles {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
margin-left: 20px;
|
||||
|
||||
div {
|
||||
background-color: #0a73ff70;
|
||||
color: #ccc;
|
||||
cursor: pointer;
|
||||
&:nth-child(1) {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
.titleClick {
|
||||
background-color: #0a73ff;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
:deep(.el-dialog) {
|
||||
--el-dialog-bg-color: #343849c7 !important;
|
||||
padding: 0px;
|
||||
--el-dialog-margin-top: 8vh;
|
||||
.el-dialog__title,
|
||||
.el-dialog__close {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
:deep(.el-drawer) {
|
||||
--el-drawer-bg-color: #343849c7;
|
||||
:deep(.el-descriptions__label.el-descriptions__cell) {
|
||||
background: #0a73ff40 !important;
|
||||
color: #fff !important;
|
||||
font-weight: bold;
|
||||
}
|
||||
:deep(.el-descriptions) {
|
||||
--el-descriptions-table-border: 1px solid #0a73ff;
|
||||
.el-descriptions__content.el-descriptions__cell.is-bordered-content {
|
||||
color: #fff;
|
||||
.el-drawer__header {
|
||||
// background-color: #21232b;
|
||||
background-color: #9f1700;
|
||||
}
|
||||
}
|
||||
:deep(.el-pagination) {
|
||||
.el-pagination__total,
|
||||
.el-pagination__goto,
|
||||
.el-pagination__classifier {
|
||||
.el-descriptions__body {
|
||||
background-color: #00000050;
|
||||
}
|
||||
}
|
||||
:deep(.tableBox) {
|
||||
padding: 10px;
|
||||
.el-table {
|
||||
--el-table-border-color: #0a73ff;
|
||||
--el-table-row-hover-bg-color: #0a73ff20;
|
||||
--el-table-header-bg-color: #0a73ff40;
|
||||
--el-table-bg-color: #ffffff00;
|
||||
text-align: center;
|
||||
// th {
|
||||
// background-color: #0a73ff;
|
||||
// color: #fff;
|
||||
// }
|
||||
tr {
|
||||
background-color: #00000050 !important;
|
||||
color: #fff;
|
||||
}
|
||||
// --el-text-color-regular: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
:deep(
|
||||
.el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell
|
||||
) {
|
||||
background: #5aa1ff29 ;
|
||||
}
|
||||
.titles {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
margin-left: 20px;
|
||||
|
||||
div {
|
||||
background-color: #0a73ff70;
|
||||
color: #ccc;
|
||||
cursor: pointer;
|
||||
&:nth-child(1) {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
.titleClick {
|
||||
background-color: #0a73ff;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
:deep(.el-dialog) {
|
||||
--el-dialog-bg-color: #343849c7 !important;
|
||||
padding: 0px;
|
||||
--el-dialog-margin-top: 8vh;
|
||||
.el-dialog__title,
|
||||
.el-dialog__close {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
:deep(.el-drawer) {
|
||||
--el-drawer-bg-color: #343849c7;
|
||||
color: #fff;
|
||||
.el-drawer__header {
|
||||
// background-color: #21232b;
|
||||
background-color: #9f1700;
|
||||
}
|
||||
}
|
||||
:deep(.el-pagination) {
|
||||
.el-pagination__total,
|
||||
.el-pagination__goto,
|
||||
.el-pagination__classifier {
|
||||
color: #fff;
|
||||
}
|
||||
// --el-text-color-regular: #fff;
|
||||
}
|
||||
:deep(.el-table__body tr.current-row > td.el-table__cell) {
|
||||
background-color: #456a91de !important;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div style="width: 540px">
|
||||
<div :style="{ width: showTime ? '640px' : '540px' }">
|
||||
<el-select
|
||||
v-model="interval"
|
||||
style="min-width: 70px; width: 70px; margin-right: 10px"
|
||||
@@ -17,16 +17,17 @@
|
||||
<el-date-picker
|
||||
v-model="timeValue"
|
||||
size="small"
|
||||
type="daterange"
|
||||
:type="showTime ? 'datetimerange' : 'daterange'"
|
||||
:disabled="disabledPicker"
|
||||
:disabled-date="isFutureDate"
|
||||
style="width: 190px; margin-right: 10px"
|
||||
:style="{ width: showTime ? '305px' : '200px', marginRight: '10px' }"
|
||||
unlink-panels
|
||||
:clearable="false"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
value-format="YYYY-MM-DD"
|
||||
:start-placeholder="showTime ? '开始时间' : '开始日期'"
|
||||
:end-placeholder="showTime ? '结束时间' : '结束日期'"
|
||||
:value-format="showTime ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD'"
|
||||
:default-time="showTime ? defaultTimeRange : undefined"
|
||||
:shortcuts="shortcuts"
|
||||
/>
|
||||
<el-button
|
||||
@@ -58,14 +59,42 @@ const emit = defineEmits(["timeChangeInfo"]);
|
||||
interface Props {
|
||||
nextFlag?: boolean;
|
||||
theCurrentTime?: boolean;
|
||||
setWatch?: boolean;
|
||||
showTime?: boolean;
|
||||
defaultInterval?: number;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
nextFlag: false,
|
||||
theCurrentTime: true,
|
||||
setWatch: true,
|
||||
showTime: false,
|
||||
defaultInterval: 3,
|
||||
});
|
||||
|
||||
const interval = ref(3);
|
||||
const START_TIME_SUFFIX = " 00:00:00";
|
||||
const END_TIME_SUFFIX = " 23:59:59";
|
||||
const defaultTimeRange = [
|
||||
new Date(2000, 0, 1, 0, 0, 0),
|
||||
new Date(2000, 0, 1, 23, 59, 59),
|
||||
];
|
||||
|
||||
const getDatePart = (val: string) => (val || "").substring(0, 10);
|
||||
|
||||
const formatRangeValue = (start: string, end: string): [string, string] => {
|
||||
const startDate = getDatePart(start);
|
||||
const endDate = getDatePart(end);
|
||||
if (!props.showTime) {
|
||||
return [startDate, endDate];
|
||||
}
|
||||
return [`${startDate}${START_TIME_SUFFIX}`, `${endDate}${END_TIME_SUFFIX}`];
|
||||
};
|
||||
|
||||
const setRangeValue = (start: string, end: string) => {
|
||||
timeValue.value = formatRangeValue(start, end);
|
||||
};
|
||||
|
||||
const interval = ref(props.defaultInterval);
|
||||
const timeFlag = ref(1);
|
||||
const count = ref(0);
|
||||
const disabledPicker = ref(true);
|
||||
@@ -112,7 +141,8 @@ const isFutureDate = (time: any) => {
|
||||
return time && time > Date.now();
|
||||
};
|
||||
onMounted(() => {
|
||||
timeChange(3);
|
||||
interval.value = props.defaultInterval;
|
||||
timeChange(props.defaultInterval);
|
||||
});
|
||||
// 选择时间范围
|
||||
const timeChange = (e: number) => {
|
||||
@@ -122,13 +152,13 @@ const timeChange = (e: number) => {
|
||||
if (e == 1) {
|
||||
disabledPicker.value = true;
|
||||
|
||||
timeValue.value = [setTime(1), setTime()];
|
||||
setRangeValue(setTime(1), setTime());
|
||||
} else if (e == 2) {
|
||||
disabledPicker.value = true;
|
||||
timeValue.value = [setTime(2), setTime()];
|
||||
setRangeValue(setTime(2), setTime());
|
||||
} else if (e == 3) {
|
||||
disabledPicker.value = true;
|
||||
timeValue.value = [setTime(3), setTime()];
|
||||
setRangeValue(setTime(3), setTime());
|
||||
} else if (e == 4) {
|
||||
let year = parseInt(setTime().substring(0, 4));
|
||||
let month = parseInt(setTime().substring(5, 7));
|
||||
@@ -138,12 +168,12 @@ const timeChange = (e: number) => {
|
||||
var dayOfWeek = start.getDay() == 0 ? 7 : start.getDay() - 1; // 如果为周日,则置为7天
|
||||
|
||||
disabledPicker.value = true;
|
||||
timeValue.value = [setTime(0, dayOfWeek), setTime(0, -6 + dayOfWeek)];
|
||||
setRangeValue(setTime(0, dayOfWeek), setTime(0, -6 + dayOfWeek));
|
||||
} else if (e == 5) {
|
||||
disabledPicker.value = false;
|
||||
backDisabled.value = true;
|
||||
preDisabled.value = props.nextFlag ? false : true;
|
||||
timeValue.value = [setTime(), setTime()];
|
||||
setRangeValue(setTime(), setTime());
|
||||
}
|
||||
if (e == 1 || e == 2) {
|
||||
timeFlag.value = 0;
|
||||
@@ -160,8 +190,8 @@ const nowTime = () => {
|
||||
// 上一个
|
||||
const preClick = () => {
|
||||
preDisabled.value = false;
|
||||
let startTime = timeValue.value[0];
|
||||
let endTime = timeValue.value[1];
|
||||
let startTime = getDatePart(timeValue.value[0]);
|
||||
let endTime = getDatePart(timeValue.value[1]);
|
||||
let year = parseInt(startTime.substring(0, 4));
|
||||
let month = parseInt(startTime.substring(5, 7));
|
||||
let date = parseInt(startTime.substring(8, 10));
|
||||
@@ -213,7 +243,7 @@ const preClick = () => {
|
||||
startTime = year + "-01-01";
|
||||
endTime = year + "-12-31";
|
||||
}
|
||||
timeValue.value = [startTime, endTime];
|
||||
setRangeValue(startTime, endTime);
|
||||
|
||||
// 判断向后键的状态
|
||||
// var temp = NowgetEndTime()
|
||||
@@ -222,8 +252,8 @@ const preClick = () => {
|
||||
//下一个
|
||||
const next = () => {
|
||||
//向后
|
||||
let startTime = timeValue.value[0];
|
||||
let endTime = timeValue.value[1];
|
||||
let startTime = getDatePart(timeValue.value[0]);
|
||||
let endTime = getDatePart(timeValue.value[1]);
|
||||
let year = parseInt(startTime.substring(0, 4));
|
||||
let month = parseInt(startTime.substring(5, 7));
|
||||
let date = parseInt(startTime.substring(8, 10));
|
||||
@@ -442,7 +472,7 @@ const next = () => {
|
||||
}
|
||||
if (!props.nextFlag) {
|
||||
if (
|
||||
new Date(endTime + " 00:00:00").getTime() >=
|
||||
new Date(getDatePart(endTime) + " 00:00:00").getTime() >=
|
||||
new Date(
|
||||
(window as any).XEUtils.toDateString(new Date(), "yyyy-MM-dd ") +
|
||||
" 00:00:00"
|
||||
@@ -452,7 +482,7 @@ const next = () => {
|
||||
}
|
||||
}
|
||||
|
||||
timeValue.value = [startTime, endTime];
|
||||
setRangeValue(startTime, endTime);
|
||||
};
|
||||
|
||||
const setTime = (flag = 0, e = 0) => {
|
||||
@@ -538,6 +568,16 @@ const setTheDate = (value: any) => {
|
||||
timeChange(value);
|
||||
};
|
||||
|
||||
const applyCustomRange = (start: string, end: string) => {
|
||||
interval.value = 5;
|
||||
disabledPicker.value = false;
|
||||
backDisabled.value = true;
|
||||
preDisabled.value = props.nextFlag ? false : true;
|
||||
count.value = 0;
|
||||
timeFlag.value = 1;
|
||||
setRangeValue(start, end);
|
||||
};
|
||||
|
||||
// 获取时间范围的同比
|
||||
function getYearOnYear(startDate: string, endDate: string): [string, string] {
|
||||
const startYearAgo = new Date(startDate);
|
||||
@@ -573,8 +613,10 @@ function formatDate(date: Date): string {
|
||||
}
|
||||
|
||||
watch(timeValue, async (newVal) => {
|
||||
await store.dispatch("setTimeType", { type: interval, value: newVal });
|
||||
await emit("timeChangeInfo");
|
||||
if (props.setWatch) {
|
||||
await store.dispatch("setTimeType", { type: interval, value: newVal });
|
||||
await emit("timeChangeInfo");
|
||||
}
|
||||
});
|
||||
|
||||
defineExpose({
|
||||
@@ -583,9 +625,13 @@ defineExpose({
|
||||
timeFlag,
|
||||
setTimeOptions,
|
||||
setTheDate,
|
||||
applyCustomRange,
|
||||
getYearOnYear,
|
||||
getMonthOnMonth,
|
||||
timeChange,
|
||||
setRangeValue,
|
||||
formatRangeValue,
|
||||
getDatePart,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -58,7 +58,6 @@ export default createStore({
|
||||
state.count++;
|
||||
},
|
||||
[Mutations.SET_STATE](state: State, data: any) {
|
||||
console.log("🚀 ~ data:", data)
|
||||
state[data.key] = data.value;
|
||||
},
|
||||
[Mutations.SET_TOKEN](state: State, data: any) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import store from "@/store/index";
|
||||
|
||||
const service = axios.create({
|
||||
baseURL: "/api",
|
||||
timeout: 60 * 1000,
|
||||
timeout: 60 * 1000 * 3,
|
||||
headers: { "Content-Type": "application/json;charset=utf-8" },
|
||||
});
|
||||
|
||||
@@ -143,7 +143,7 @@ service.interceptors.response.use(
|
||||
});
|
||||
}
|
||||
} else {
|
||||
return Promise.reject(res.data);
|
||||
return Promise.reject(res.data||res.data.message);
|
||||
}
|
||||
},
|
||||
(error) => {
|
||||
|
||||
@@ -10,7 +10,7 @@ class HttpRequest {
|
||||
getInsideConfig() {
|
||||
const config = {
|
||||
baseURL: this.baseUrl, // 所有的请求地址前缀部分(没有后端请求不用写)
|
||||
timeout: 80000, // 请求超时时间(毫秒)
|
||||
timeout: 60 * 1000 * 3, // 请求超时时间(毫秒)
|
||||
};
|
||||
return config;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ export default class SocketService {
|
||||
setTimeout(() => {
|
||||
//"ws://10.156.193.182:18093/ws/screen" 北京
|
||||
//"ws://192.168.1.130:19001/ws/askRealTimeData/" 无锡
|
||||
const url = (mqttUrl || "ws://192.168.1.127:19001/ws/") + id;
|
||||
const url = (mqttUrl || "ws://192.168.2.130:18093/ws/") + id;
|
||||
// const url = (mqttUrl || "ws://192.168.1.63:18093/ws/screen") + id;
|
||||
console.log("🚀 ~ SocketService ~ connect ~ url:", url);
|
||||
this.ws = new WebSocket(url);
|
||||
@@ -126,7 +126,7 @@ export default class SocketService {
|
||||
const url = window.URL.createObjectURL(
|
||||
new Blob([
|
||||
"(function(e){setInterval(function(){this.postMessage(null)},30000)})()",
|
||||
])
|
||||
]),
|
||||
);
|
||||
this.workerBlobUrl = url;
|
||||
this.work = new Worker(url);
|
||||
@@ -175,7 +175,7 @@ export default class SocketService {
|
||||
// 回调函数的注册
|
||||
public registerCallBack(
|
||||
socketType: string,
|
||||
callBack: (message: MessageType) => void
|
||||
callBack: (message: MessageType) => void,
|
||||
): void {
|
||||
this.callBackMapping[socketType] = callBack;
|
||||
}
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
<div v-loading="loading" element-loading-background="#343849c7">
|
||||
<div class="iconBox">
|
||||
<div class="div">
|
||||
<img src="@/assets/jcd.png" alt="" />
|
||||
<img src="@/assets/bdz.png" alt="" />
|
||||
<span>变电站</span>
|
||||
</div>
|
||||
|
||||
<div class="div">
|
||||
<!-- <div class="div">
|
||||
<img src="@/assets/img/txzcwzj.png" alt="" />
|
||||
<span>监测点</span>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="bmSelect">
|
||||
<!-- <div class="bmSelect">
|
||||
<el-select
|
||||
v-model="value"
|
||||
@change="setIcon"
|
||||
@@ -28,7 +28,7 @@
|
||||
:value="item.stationName"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div>
|
||||
<baidu-map
|
||||
@@ -45,26 +45,26 @@
|
||||
:double-click-zoom="false"
|
||||
>
|
||||
<!-- 线-->
|
||||
<div v-if="zoom > 13">
|
||||
<!-- <div v-if="zoom > 13">
|
||||
<bm-polyline
|
||||
:path="path"
|
||||
v-for="(path, index) in polyline"
|
||||
:key="index"
|
||||
></bm-polyline>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- 变电站-->
|
||||
<template v-if="zoom > 13">
|
||||
<template>
|
||||
<bm-marker
|
||||
:position="path"
|
||||
v-for="path in siteList"
|
||||
:key="path.subId"
|
||||
:icon="path.icon"
|
||||
@click="markerClick(path)"
|
||||
@click="pointClick(path)"
|
||||
></bm-marker>
|
||||
</template>
|
||||
<!-- 点 -->
|
||||
<div maxZoom="12">
|
||||
<!-- <div maxZoom="12">
|
||||
<bm-marker
|
||||
:position="path"
|
||||
v-for="path in areaLineInfo"
|
||||
@@ -72,7 +72,7 @@
|
||||
:icon="path.icon"
|
||||
@click="pointClick(path)"
|
||||
></bm-marker>
|
||||
</div>
|
||||
</div> -->
|
||||
<bm-marker
|
||||
:position="infoWindowPoint"
|
||||
:icon="{ url: '1', size: { width: 0, height: 0 } }"
|
||||
@@ -89,7 +89,7 @@
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, nextTick, onMounted } from "vue";
|
||||
import { substationCount } from "@/api/statistics/index";
|
||||
import { stationMap } from "@/api/statistics/index";
|
||||
import { useStore } from "vuex";
|
||||
// import { BmlMarkerClusterer } from "vue-baidu-map-3x";
|
||||
const emit = defineEmits(["pointClick"]);
|
||||
@@ -129,7 +129,7 @@ const handler = async ({ BMap, map }: any) => {
|
||||
const markerClick = (e: any) => {
|
||||
zoom.value = 15;
|
||||
infoWindowPoint.value = e;
|
||||
infoWindowPoint.value.show = true;
|
||||
// infoWindowPoint.value.show = true;
|
||||
center.value.lng = 120.124367;
|
||||
center.value.lat = 31.555421;
|
||||
|
||||
@@ -150,87 +150,87 @@ const init = () => {
|
||||
polyline.value = [];
|
||||
dataList.value = [];
|
||||
areaLineInfo.value = [];
|
||||
// substationCount({
|
||||
// deptId: store.state.deptId,
|
||||
// type: store.state.timeType,
|
||||
// startTime: store.state.timeValue[0],
|
||||
// endTime: store.state.timeValue[1],
|
||||
// }).then((res: any) => {
|
||||
// dataList.value = res.data;
|
||||
dataList.value = [
|
||||
{
|
||||
stationId: 156,
|
||||
stationName: "110kV北京电视台变",
|
||||
gdName: "检修分公司",
|
||||
longitude: 120.33,
|
||||
latitude: 31.52,
|
||||
lineCount: 1,
|
||||
eventCount: 1,
|
||||
lineEventDetails: [
|
||||
{
|
||||
gdName: "检修分公司",
|
||||
pictureId: "5debb8bd0ce26527675eedffd74a3198",
|
||||
pictureName: "无锡线上",
|
||||
},
|
||||
{
|
||||
gdName: "检修分公司",
|
||||
pictureId: "35b1301833e3fdfc872b1a27a17c7245",
|
||||
pictureName: "无锡修改1011--工程部",
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
stationMap({
|
||||
deptId: store.state.deptId,
|
||||
type: store.state.timeType,
|
||||
startTime: store.state.timeValue[0],
|
||||
endTime: store.state.timeValue[1],
|
||||
}).then((res: any) => {
|
||||
dataList.value = res.data;
|
||||
// dataList.value = [
|
||||
// {
|
||||
// stationId: 156,
|
||||
// stationName: "110kV北京电视台变",
|
||||
// gdName: "检修分公司",
|
||||
// longitude: 120.33,
|
||||
// latitude: 31.52,
|
||||
// lineCount: 1,
|
||||
// eventCount: 1,
|
||||
// lineEventDetails: [
|
||||
// // {
|
||||
// // gdName: "检修分公司",
|
||||
// // pictureId: "5debb8bd0ce26527675eedffd74a3198",
|
||||
// // pictureName: "无锡线上",
|
||||
// // },
|
||||
// {
|
||||
// gdName: "检修分公司",
|
||||
// pictureId: "35b1301833e3fdfc872b1a27a17c7245",
|
||||
// pictureName: "无锡修改1011--工程部",
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// ];
|
||||
let data = dataList.value;
|
||||
let r = 0.0035;
|
||||
let list = data.filter((item: any) => item.latitude != 0);
|
||||
let list = data.filter((item: any) => item.lat != 0);
|
||||
list.forEach((item: any) => {
|
||||
// 变电站图标
|
||||
item.icon = {
|
||||
url: new URL("@/assets/jcd.png", import.meta.url).href,
|
||||
url: new URL("@/assets/bdz.png", import.meta.url).href,
|
||||
size: {
|
||||
width: 40,
|
||||
height: 40,
|
||||
},
|
||||
};
|
||||
if (
|
||||
item.lineEventDetails?.length > 10 &&
|
||||
item.lineEventDetails?.length < 100
|
||||
) {
|
||||
r = 0.0055;
|
||||
} else if (item.lineEventDetails.length >= 100) {
|
||||
r = 0.01055;
|
||||
}
|
||||
item.lng = item.longitude;
|
||||
item.lat = item.latitude;
|
||||
item.lineEventDetails.forEach((val: any, i: number) => {
|
||||
val.lng =
|
||||
item.longitude +
|
||||
r * Math.cos((2 * Math.PI * i) / item.lineEventDetails.length);
|
||||
val.lat =
|
||||
item.latitude +
|
||||
r * Math.sin((2 * Math.PI * i) / item.lineEventDetails.length);
|
||||
// 监测点图标
|
||||
val.icon = {
|
||||
url: new URL("@/assets/img/txzcwzj.png", import.meta.url).href,
|
||||
size: {
|
||||
width: 40,
|
||||
height: 40,
|
||||
},
|
||||
};
|
||||
// if (
|
||||
// item.lineEventDetails?.length > 10 &&
|
||||
// item.lineEventDetails?.length < 100
|
||||
// ) {
|
||||
// r = 0.0055;
|
||||
// } else if (item.lineEventDetails.length >= 100) {
|
||||
// r = 0.01055;
|
||||
// }
|
||||
// item.lng = item.longitude;
|
||||
// item.lat = item.latitude;
|
||||
// item.lineEventDetails.forEach((val: any, i: number) => {
|
||||
// val.lng =
|
||||
// item.longitude +
|
||||
// r * Math.cos((2 * Math.PI * i) / item.lineEventDetails.length);
|
||||
// val.lat =
|
||||
// item.latitude +
|
||||
// r * Math.sin((2 * Math.PI * i) / item.lineEventDetails.length);
|
||||
// // 监测点图标
|
||||
// val.icon = {
|
||||
// url: new URL("@/assets/img/txzcwzj.png", import.meta.url).href,
|
||||
// size: {
|
||||
// width: 40,
|
||||
// height: 40,
|
||||
// },
|
||||
// };
|
||||
|
||||
polyline.value.push([
|
||||
{
|
||||
lng: item.lng,
|
||||
lat: item.lat,
|
||||
},
|
||||
{
|
||||
lng: val.lng,
|
||||
lat: val.lat,
|
||||
},
|
||||
]);
|
||||
});
|
||||
// polyline.value.push([
|
||||
// {
|
||||
// lng: item.lng,
|
||||
// lat: item.lat,
|
||||
// },
|
||||
// {
|
||||
// lng: val.lng,
|
||||
// lat: val.lat,
|
||||
// },
|
||||
// ]);
|
||||
// });
|
||||
|
||||
areaLineInfo.value.push(...item.lineEventDetails);
|
||||
// areaLineInfo.value.push(...item.lineEventDetails);
|
||||
});
|
||||
|
||||
siteList.value = list;
|
||||
@@ -239,7 +239,7 @@ const init = () => {
|
||||
setTimeout(() => {
|
||||
loading.value = false;
|
||||
}, 0);
|
||||
// });
|
||||
});
|
||||
};
|
||||
const moveenFlag = ref(true);
|
||||
|
||||
@@ -267,12 +267,12 @@ const checkMapData = () => {
|
||||
if (!hasOfflineTiles) {
|
||||
console.warn("当前区域无离线地图数据,将返回默认位置");
|
||||
|
||||
// 使用正确的BMap.Point创建方式
|
||||
const point = new BMapInstance.value.Point(116.404367, 39.915421);
|
||||
// 使用正确的BMap.Point创建方式
|
||||
const point = new BMapInstance.value.Point(120.124367,31.555421);
|
||||
|
||||
// 平滑移动并设置合适缩放级别
|
||||
mapInstance.value.panTo(point);
|
||||
mapInstance.value.setZoom(12);
|
||||
mapInstance.value.setZoom(11);
|
||||
// zoom.value = 12;
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -344,6 +344,7 @@ onMounted(() => {
|
||||
|
||||
defineExpose({
|
||||
setIcon,
|
||||
init
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@@ -362,9 +363,9 @@ defineExpose({
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
left: 10px;
|
||||
z-index: 2000;
|
||||
z-index: 1;
|
||||
width: 110px;
|
||||
height: 70px;
|
||||
height: 40px;
|
||||
padding: 10px;
|
||||
background: #ffffff10 !important;
|
||||
border: 1px solid #ccc;
|
||||
|
||||
@@ -494,8 +494,8 @@ const generateFn = async () => {
|
||||
loading1.value = true;
|
||||
await getDynamicData({
|
||||
lineId: dotList.value.id,
|
||||
searchBeginTime: tabList.value[activeName.value].time[0],
|
||||
searchEndTime: tabList.value[activeName.value].time[1],
|
||||
searchBeginTime: time.value[0],
|
||||
searchEndTime: time.value[1],
|
||||
time: tabList.value[activeName.value].key,
|
||||
type: form.type,
|
||||
userDataId: form.loadDataId,
|
||||
|
||||
@@ -623,6 +623,7 @@ watch(flag, (newVal) => {
|
||||
setTimeout(() => {
|
||||
if (flag.value == 0) {
|
||||
initHasEventList();
|
||||
|
||||
// flag 变化后重新绑定事件
|
||||
bindRankingClickEvent();
|
||||
}
|
||||
@@ -635,6 +636,29 @@ watch(flag, (newVal) => {
|
||||
}
|
||||
}, 100);
|
||||
});
|
||||
watch(
|
||||
() => store.state.showMap,
|
||||
(newVal) => {
|
||||
if (newVal) {
|
||||
return;
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (flag.value == 0) {
|
||||
initHasEventList();
|
||||
|
||||
// flag 变化后重新绑定事件
|
||||
bindRankingClickEvent();
|
||||
}
|
||||
if (flag.value == 2) {
|
||||
renderChart2();
|
||||
initHasUpEventList();
|
||||
}
|
||||
if (flag.value == 1) {
|
||||
callHarmOneImageApi(getFirstTableData.value, getTimes.value);
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
);
|
||||
|
||||
// 暂降记录个数
|
||||
const initialData = () => {
|
||||
@@ -688,11 +712,9 @@ const initialAggregation = () => {
|
||||
tableData.splice(0, tableData.length);
|
||||
});
|
||||
};
|
||||
|
||||
const interval = ref(null);
|
||||
// 提取发送消息到iframe的公共方法
|
||||
const sendMessageToIframe = (type: string, payload: any) => {
|
||||
// console.log(123,store.state.iframeLoad);
|
||||
|
||||
// window.parent.postMessage(
|
||||
// {
|
||||
// type,
|
||||
@@ -701,6 +723,10 @@ const sendMessageToIframe = (type: string, payload: any) => {
|
||||
// "*"
|
||||
// );
|
||||
// 如果 iframe 已加载完成,直接发送消息
|
||||
if (store.state.showMap) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (store.state.iframeLoad) {
|
||||
window.parent.postMessage(
|
||||
{
|
||||
@@ -711,9 +737,13 @@ const sendMessageToIframe = (type: string, payload: any) => {
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (interval.value) {
|
||||
clearInterval(interval.value);
|
||||
interval.value = null;
|
||||
}
|
||||
|
||||
// 如果未加载完成,每 1 秒尝试发送一次
|
||||
const interval = setInterval(() => {
|
||||
interval.value = setInterval(() => {
|
||||
console.log("等待 iframe 加载,1 秒后重试...");
|
||||
if (store.state.iframeLoad) {
|
||||
// 加载完成后发送消息并清除定时器
|
||||
@@ -724,7 +754,7 @@ const sendMessageToIframe = (type: string, payload: any) => {
|
||||
},
|
||||
"*" // 建议替换为具体域名
|
||||
);
|
||||
clearInterval(interval);
|
||||
clearInterval(interval.value);
|
||||
}
|
||||
}, 1000);
|
||||
};
|
||||
@@ -937,7 +967,7 @@ const initialResponsibilityList = () => {
|
||||
// 根据实际字段进行拼接,示例:
|
||||
const content = `${item.lineName || ""}进行${
|
||||
item.dataTimes || ""
|
||||
}次谐波电压溯源,溯源对象:${item.userDataName || ""}`.trim();
|
||||
}次谐波电压溯源,溯源对象:${item.userDataName || "系统测点"}`.trim();
|
||||
return {
|
||||
...item,
|
||||
content: content,
|
||||
@@ -1267,7 +1297,7 @@ const handleChildClose = () => {
|
||||
const init = () => {
|
||||
initialData();
|
||||
initialAggregation();
|
||||
initHasEventList();
|
||||
// initHasEventList();
|
||||
initialResponsibilityList();
|
||||
// getInfoListAmplify();
|
||||
tableInfoAmplify();
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
v-model="form.userList"
|
||||
:data="dataTree"
|
||||
multiple
|
||||
|
||||
filterable
|
||||
show-checkbox
|
||||
ref="treeRef"
|
||||
@@ -46,6 +47,7 @@
|
||||
v-model="form.index"
|
||||
filterable
|
||||
multiple
|
||||
|
||||
:multiple-limit="5"
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
@@ -395,7 +397,7 @@ const submit = () => {
|
||||
showTabs.value = true;
|
||||
let list = JSON.parse(JSON.stringify(form.index)).sort((a, b) => a - b);
|
||||
tabList.value = [];
|
||||
|
||||
|
||||
list.forEach((item: any) => {
|
||||
tabList.value.push({
|
||||
label: item + "次谐波",
|
||||
@@ -553,11 +555,13 @@ const generateFn = async () => {
|
||||
return ElMessage.warning("请选择用采用户");
|
||||
}
|
||||
loading1.value = true;
|
||||
console.log("🚀 ~ generateFn ~ dotList.value:", dotList.value.id, tabList.value);
|
||||
|
||||
await getDynamicData({
|
||||
userDataId: "123",
|
||||
lineId: dotList.value.id,
|
||||
searchBeginTime: tabList.value[activeName.value].time[0],
|
||||
searchEndTime: tabList.value[activeName.value].time[1],
|
||||
searchBeginTime: time.value[0],
|
||||
searchEndTime: time.value[1],
|
||||
time: tabList.value[activeName.value].key,
|
||||
type: form.type,
|
||||
userList: form.userList,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<!-- 项目管理弹框 -->
|
||||
<el-dialog v-model="dialogVisible" title="项目管理" width="1600px">
|
||||
<el-dialog v-model="dialogVisible" title="项目管理" width="1600px" @close="handleDialogClose">
|
||||
<!-- <el-card class="transparent-card"> -->
|
||||
<div style="display: flex; justify-content: space-between">
|
||||
<div>
|
||||
@@ -65,22 +65,9 @@
|
||||
<Edit @click="editd(item)" />
|
||||
</el-icon>
|
||||
</el-tooltip>
|
||||
|
||||
<!-- <el-tooltip
|
||||
class="item"
|
||||
effect="dark"
|
||||
content="修改项目"
|
||||
placement="top"
|
||||
>
|
||||
<Edit
|
||||
style="margin-left: 5px; width: 16px"
|
||||
class="xiaoshou color"
|
||||
@click="editd(item)"
|
||||
/> </el-tooltip
|
||||
> -->
|
||||
</span>
|
||||
<div style="display: flex; justify-content: end">
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
v-if="item.active == 0"
|
||||
class="color"
|
||||
:icon="Compass"
|
||||
@@ -95,7 +82,7 @@
|
||||
style="padding: 3px 0; color: #82bd51"
|
||||
type="text"
|
||||
>已激活</el-button
|
||||
>
|
||||
> -->
|
||||
<el-button
|
||||
class="color"
|
||||
:icon="Share"
|
||||
@@ -145,7 +132,7 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 新增弹框 -->
|
||||
<el-dialog v-model="innerVisible" :title="dialogTitle" width="500px">
|
||||
<el-dialog v-model="innerVisible" :title="dialogTitle" width="500px" >
|
||||
<el-form
|
||||
ref="ruleFormRef"
|
||||
:model="ruleForm"
|
||||
@@ -163,17 +150,22 @@
|
||||
placeholder="请输入项目名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="工程项目" prop="projectIds">
|
||||
<el-form-item label="变电站名称">
|
||||
<el-select
|
||||
v-model="ruleForm.projectIds"
|
||||
v-model="ruleForm.substionIds"
|
||||
placeholder="请选择"
|
||||
:popper-append-to-body="false"
|
||||
popper-class="custom-select-dropdown"
|
||||
multiple
|
||||
:teleported="false"
|
||||
>
|
||||
<el-option label="Zone one111" value="shanghai" />
|
||||
<el-option label="Zone two" value="beijing" />
|
||||
<el-option
|
||||
v-for="item in dataList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
:disabled="item.bindFlag == true && !setDisabled?.includes(item.id)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="项目排序" prop="orderBy">
|
||||
<el-input v-model="ruleForm.orderBy" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
@@ -218,11 +210,15 @@ import {
|
||||
active,
|
||||
getActive,
|
||||
} from "@/api/manage_wx/index";
|
||||
import { stationMap } from "@/api/statistics/index";
|
||||
import { useStore } from "vuex";
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: "project-change", project: { id: string; name: string }): void;
|
||||
(e: "station-map-updated"): void;
|
||||
}>();
|
||||
|
||||
const store = useStore();
|
||||
const projectData = ref([]);
|
||||
|
||||
// 系统配置弹框
|
||||
@@ -240,6 +236,10 @@ const firstForm = ref({
|
||||
id: "",
|
||||
});
|
||||
|
||||
const dataList = ref([]); //变电站
|
||||
|
||||
const setDisabled = ref([]);
|
||||
|
||||
const params = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
@@ -251,6 +251,7 @@ interface RuleForm {
|
||||
projectIds: [];
|
||||
orderBy: string;
|
||||
remark: string;
|
||||
substionIds: [];
|
||||
}
|
||||
|
||||
const formSize = ref("default");
|
||||
@@ -260,17 +261,18 @@ const ruleForm = reactive<RuleForm>({
|
||||
projectIds: [],
|
||||
orderBy: "100",
|
||||
remark: "",
|
||||
substionIds: [],
|
||||
});
|
||||
|
||||
const rules = reactive<FormRules<RuleForm>>({
|
||||
name: [{ required: true, message: "请输入项目名称", trigger: "blur" }],
|
||||
projectIds: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
// projectIds: [
|
||||
// {
|
||||
// required: true,
|
||||
// message: "请选择",
|
||||
// trigger: "change",
|
||||
// },
|
||||
// ],
|
||||
orderBy: [
|
||||
{
|
||||
required: true,
|
||||
@@ -280,6 +282,21 @@ const rules = reactive<FormRules<RuleForm>>({
|
||||
],
|
||||
});
|
||||
|
||||
const handleDialogClose = () => {
|
||||
emit('station-map-updated');
|
||||
};
|
||||
|
||||
const init = () => {
|
||||
stationMap({
|
||||
deptId: store.state.deptId,
|
||||
type: store.state.timeType,
|
||||
startTime: store.state.timeValue[0],
|
||||
endTime: store.state.timeValue[1],
|
||||
}).then((res: any) => {
|
||||
dataList.value = res.data;
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
fetachData();
|
||||
});
|
||||
@@ -334,6 +351,8 @@ const onReset = () => {
|
||||
const onSubmitadd = () => {
|
||||
innerVisible.value = true;
|
||||
dialogTitle.value = "新增项目";
|
||||
init();
|
||||
setDisabled.value = [];
|
||||
// Object.assign(ruleForm, {}); 不生效
|
||||
Object.assign(ruleForm, {
|
||||
//生效,但是一个个赋值,麻烦
|
||||
@@ -342,6 +361,7 @@ const onSubmitadd = () => {
|
||||
orderBy: "100",
|
||||
projectIds: ["1dd1b076e104f15459ac401fc1b902c4"],
|
||||
remark: "",
|
||||
substionIds: [],
|
||||
});
|
||||
//Object.keys(ruleForm).forEach((key) => delete ruleForm[key]); //生效,但是有默认值的,一进去会直接报校验
|
||||
};
|
||||
@@ -352,6 +372,8 @@ const querdata = (e: any) => {};
|
||||
const editd = (row: any) => {
|
||||
innerVisible.value = true;
|
||||
dialogTitle.value = "修改项目";
|
||||
init();
|
||||
setDisabled.value = JSON.parse(JSON.stringify(row.substionIds));
|
||||
// Object.assign(ruleForm, row);
|
||||
Object.assign(ruleForm, {
|
||||
id: row.id,
|
||||
@@ -359,6 +381,7 @@ const editd = (row: any) => {
|
||||
orderBy: row.orderBy,
|
||||
projectIds: row.projectIds,
|
||||
remark: row.remark,
|
||||
substionIds: row.substionIds,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -371,6 +394,8 @@ const submitForm = async (formEl: FormInstance | undefined) => {
|
||||
} else {
|
||||
getEdit();
|
||||
}
|
||||
init();
|
||||
emit('station-map-updated');
|
||||
console.log("submit!");
|
||||
} else {
|
||||
console.log("error submit!", fields);
|
||||
@@ -410,6 +435,7 @@ const getEdit = async () => {
|
||||
|
||||
const resetForm = () => {
|
||||
innerVisible.value = false;
|
||||
emit('station-map-updated')
|
||||
};
|
||||
|
||||
const onTableSizeChange = (size: number) => {
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
width="100%"
|
||||
height="100%"
|
||||
@pointClick="pointClick"
|
||||
ref="bdMapRef"
|
||||
></bdMap>
|
||||
|
||||
<!-- 添加加载事件监听 -->
|
||||
@@ -16,9 +17,15 @@
|
||||
frameborder="0"
|
||||
scrolling="no"
|
||||
id="iframeLeft"
|
||||
:key="keyof"
|
||||
@load="onIframeLoad"
|
||||
></iframe>
|
||||
<el-button class="backButton" @click="backButton" size="small" :icon="Back"
|
||||
<el-button
|
||||
v-if="!store.state.showMap"
|
||||
class="backButton"
|
||||
@click="backButton"
|
||||
size="small"
|
||||
:icon="Back"
|
||||
>返回</el-button
|
||||
>
|
||||
</div>
|
||||
@@ -34,8 +41,10 @@ const props = defineProps<{
|
||||
project: { id: string; name: string } | null;
|
||||
}>();
|
||||
|
||||
const iframeSrc = ref("");
|
||||
const bdMapRef = ref(null)
|
||||
|
||||
const iframeSrc = ref("");
|
||||
const keyof = ref(0);
|
||||
// 监听 props 变化
|
||||
watch(
|
||||
() => props.project,
|
||||
@@ -56,7 +65,8 @@ watch(
|
||||
);
|
||||
// 点击监测点传入 接线图id
|
||||
const pointClick = (row: any) => {
|
||||
setUrl(row.pictureId, row.pictureName);
|
||||
setUrl(row.configId, row.configName);
|
||||
keyof.value += 1;
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
@@ -71,8 +81,8 @@ onMounted(() => {
|
||||
});
|
||||
const setUrl = (url: string, nam: string) => {
|
||||
iframeSrc.value =
|
||||
// window.location.origin +
|
||||
"http://192.168.1.179:4001" +
|
||||
window.location.origin +
|
||||
// "http://192.168.1.179:4001" +
|
||||
`/zutai/?id=${url}&&name=${encodeURIComponent(
|
||||
nam
|
||||
)}&&preview=true&&display=true&&graphicDisplay=wx#/preview`;
|
||||
@@ -133,9 +143,23 @@ const sendKeysToIframe = (keyList: string[]) => {
|
||||
};
|
||||
// 返回地图
|
||||
const backButton = () => {
|
||||
window.removeEventListener("message", handleMessage);
|
||||
store.dispatch("setStateKey", { key: "iframeLoad", value: false });
|
||||
store.dispatch("setStateKey", { key: "showMap", value: true });
|
||||
|
||||
// window.removeEventListener("message", handleMessage);
|
||||
};
|
||||
|
||||
// 监听 station-map-updated 事件并转发给 bdMap 组件
|
||||
const handleStationMapUpdated = () => {
|
||||
if (bdMapRef.value && typeof bdMapRef.value.init === 'function') {
|
||||
bdMapRef.value.init()
|
||||
}
|
||||
}
|
||||
|
||||
// 暴露方法给父组件调用
|
||||
defineExpose({
|
||||
handleStationMapUpdated
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.plan {
|
||||
|
||||
@@ -87,13 +87,14 @@
|
||||
<Management
|
||||
ref="createRef"
|
||||
@project-change="onProjectChange"
|
||||
@station-map-updated="handleStationMapUpdated"
|
||||
></Management>
|
||||
</div>
|
||||
<div class="body-box">
|
||||
<!-- 第三行数据 -->
|
||||
<div class="content-box">
|
||||
<dv-border-box-10 :color="color[0]" style="position: relative">
|
||||
<Plan :project="currentProject" />
|
||||
<Plan :project="currentProject" ref="planRef"/>
|
||||
<!-- 将 flag 值传递给 SecurityDetail 组件 -->
|
||||
<!-- showDetail从SecurityDetail 组件传过来 -->
|
||||
<SecurityDetail
|
||||
@@ -235,6 +236,8 @@ const onProjectChange = (project: { id: string; name: string }) => {
|
||||
currentProject.value = project;
|
||||
};
|
||||
|
||||
const planRef = ref() // 添加对 Plan 组件的引用
|
||||
|
||||
const smsQueriesRef = ref(); // 短信查询组件引用
|
||||
const smsConfigRef = ref(); // 短信查询组件引用
|
||||
const sendRef = ref(); // 短信查询组件引用
|
||||
@@ -380,6 +383,14 @@ const createRef = ref();
|
||||
const openDialog = () => {
|
||||
createRef.value.open();
|
||||
};
|
||||
|
||||
// 处理 Management 组件发出的 station-map-updated 事件
|
||||
const handleStationMapUpdated = () => {
|
||||
// 通过 Plan 组件转发给 bdMap
|
||||
if (planRef.value && typeof planRef.value.handleStationMapUpdated === 'function') {
|
||||
planRef.value.handleStationMapUpdated()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<div class="totalBox" style="background-color: #28a74570">
|
||||
<div class="textTop" @click="openalarmPopUpBox(0, data.importId)">
|
||||
<span>{{ data.importNum || 0 }}</span>
|
||||
<span style="font-size: 13px">半导体及精密加工企业<br />监测总数</span>
|
||||
<span style="font-size: 13px">半导体企业<br />监测总数</span>
|
||||
</div>
|
||||
<div
|
||||
class="textTop"
|
||||
@@ -27,7 +27,7 @@
|
||||
<div class="textTop" @click="openalarmPopUpBox(1, data.importId)">
|
||||
<span>{{ data.importDevNum || 0 }}</span>
|
||||
<span style="font-size: 13px"
|
||||
>半导体及精密加工企业<br />受影响户数</span
|
||||
>半导体企业<br />影响用户数</span
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
@@ -35,11 +35,11 @@
|
||||
@click="openalarmPopUpBox(1, data.otherImportId)"
|
||||
>
|
||||
<span>{{ data.otherImportDevNum || 0 }}</span>
|
||||
<span style="font-size: 13px">其他敏感用户<br />受影响户数</span>
|
||||
<span style="font-size: 13px">其他敏感用户<br />影响用户数</span>
|
||||
</div>
|
||||
<div class="textTop" @click="openalarmPopUpBox(1, data.otherId)">
|
||||
<span>{{ data.otherDevNum || 0 }}</span>
|
||||
<span style="font-size: 13px">非敏感用户<br />受影响户数</span>
|
||||
<span style="font-size: 13px">非敏感用户<br />影响用户数</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -89,9 +89,51 @@ const sensitivePopUpBoxRef = ref();
|
||||
|
||||
const alarmPopUpBoxRefEvent = ref();
|
||||
|
||||
function truncateLabel(name: string, maxLen: number) {
|
||||
if (name.length <= maxLen) return name;
|
||||
return name.substring(0, maxLen - 1) + "…";
|
||||
}
|
||||
|
||||
function formatLeafLabel(name: string, count: number, maxLen: number) {
|
||||
if (!count) return "";
|
||||
return `${truncateLabel(name, maxLen)}(${count})`;
|
||||
}
|
||||
|
||||
const INNER_MIN_RATIO = 0.2;
|
||||
const OUTER_MIN_RATIO = 0.03;
|
||||
|
||||
function getGroupTotal(item: any) {
|
||||
return item.children.reduce(
|
||||
(sum: number, c: any) => sum + (c.count || 0),
|
||||
0
|
||||
);
|
||||
}
|
||||
|
||||
function getGroupDisplayScales(innerList: any[]) {
|
||||
const totals = innerList.map(getGroupTotal);
|
||||
const sum = totals.reduce((a, b) => a + b, 0) || 1;
|
||||
const minVal = sum * INNER_MIN_RATIO;
|
||||
const displayTotals = totals.map((t) => Math.max(t, minVal));
|
||||
return totals.map((t, i) => (t > 0 ? displayTotals[i] / t : 1));
|
||||
}
|
||||
|
||||
function getOuterDisplayValues(children: any[], groupScale: number) {
|
||||
const scaledValues = children.map((c) => (c.count || 0) * groupScale);
|
||||
const groupSum = scaledValues.reduce((a, b) => a + b, 0) || 1;
|
||||
const minVal = groupSum * OUTER_MIN_RATIO;
|
||||
return scaledValues.map((v) => (v > 0 ? Math.max(v, minVal) : 0.001));
|
||||
}
|
||||
|
||||
const renderChart = (key: any) => {
|
||||
var myChart = proxy.$echarts.init(key);
|
||||
const color = ["#2E8B57", "#0a73ff", "#DAA520"];
|
||||
const chartColors = ["#2E8B57", "#0a73ff", "#DAA520"];
|
||||
const maxChildren = Math.max(
|
||||
...data.value.innerList.map((item: any) => item.children?.length || 0),
|
||||
0
|
||||
);
|
||||
const outerFontSize = maxChildren > 8 ? 9 : maxChildren > 5 ? 10 : 11;
|
||||
const outerLabelMaxLen = maxChildren > 8 ? 5 : maxChildren > 5 ? 6 : 8;
|
||||
const groupScales = getGroupDisplayScales(data.value.innerList || []);
|
||||
myChart.setOption({
|
||||
title: {
|
||||
text: "电压暂降用户分类统计(单位:次)",
|
||||
@@ -104,136 +146,85 @@ const renderChart = (key: any) => {
|
||||
},
|
||||
|
||||
tooltip: {
|
||||
formatter: (params) => {
|
||||
let str = params.marker + params.name;
|
||||
return str;
|
||||
formatter: (params: any) => {
|
||||
const label =
|
||||
params.data?.fullLabel ??
|
||||
(params.data?.count != null
|
||||
? `${params.name?.replace(/\n/g, "")}(${params.data.count})`
|
||||
: params.name?.replace(/\n/g, ""));
|
||||
if (!label) return "";
|
||||
return params.marker + label;
|
||||
},
|
||||
},
|
||||
// {
|
||||
// name: "半导体及\n精密加工",
|
||||
// itemStyle: {
|
||||
// color: "#2E8B57",
|
||||
// },
|
||||
// label: {
|
||||
// rotate: "radial",
|
||||
// color: "#ffffff",
|
||||
// fontSize: 10,
|
||||
// },
|
||||
// children: [
|
||||
// {
|
||||
// name: "半导体(8次)",
|
||||
// value: 10,
|
||||
// itemStyle: {
|
||||
// color: "#2E8B57",
|
||||
// },
|
||||
// label: {
|
||||
// position: "outside",
|
||||
// fontSize: 10,
|
||||
// color: "#ffffff",
|
||||
// },
|
||||
// labelLine: {
|
||||
// show: true,
|
||||
// length1: 10,
|
||||
// smooth: true,
|
||||
// length2: 10,
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// name: "半导体(12次)",
|
||||
// value: 10,
|
||||
// itemStyle: {
|
||||
// color: "#2E8B57",
|
||||
// },
|
||||
// label: {
|
||||
// position: "outside",
|
||||
// fontSize: 10,
|
||||
// color: "#ffffff",
|
||||
// },
|
||||
// labelLine: {
|
||||
// show: true,
|
||||
// length1: 10,
|
||||
// smooth: true,
|
||||
// length2: 10,
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
|
||||
series: [
|
||||
{
|
||||
type: "sunburst",
|
||||
nodeClick: false,
|
||||
data: data.value.innerList.map((item, i) => {
|
||||
labelLayout: (params: any) => ({
|
||||
hideOverlap: !!params.labelLinePoints?.length,
|
||||
}),
|
||||
data: data.value.innerList.map((item: any, i: number) => {
|
||||
return {
|
||||
name: insertNewLine(item.name),
|
||||
itemStyle: {
|
||||
color: color[i],
|
||||
color: chartColors[i],
|
||||
},
|
||||
parentId: item.children[0].parentId,
|
||||
parentId: item.children[0]?.parentId,
|
||||
label: {
|
||||
rotate: "radial",
|
||||
color: "#ffffff",
|
||||
fontSize: 11,
|
||||
fontSize: 10,
|
||||
lineHeight: 12,
|
||||
},
|
||||
children: item.children.map((k) => {
|
||||
return {
|
||||
name: k.name + `(${k.count})`,
|
||||
value: k.count,
|
||||
parentId: k.parentId,
|
||||
treeId: k.treeId,
|
||||
itemStyle: {
|
||||
color: color[i],
|
||||
},
|
||||
// label: {
|
||||
// position: "outside",
|
||||
// fontSize: 10,
|
||||
// distance: 20, // 调整标签与图形的距离
|
||||
// color: "#ffffff",
|
||||
// avoidLabelOverlap: true,
|
||||
// },
|
||||
// labelLine: {
|
||||
// show: true,
|
||||
// length: 10,
|
||||
// length2: 30,
|
||||
// },
|
||||
label: {
|
||||
position: "outside",
|
||||
distance: 20, // 增加距离避免重叠
|
||||
fontSize: 12,
|
||||
color: "#ffffff",
|
||||
avoidLabelOverlap: true, // 启用避让
|
||||
},
|
||||
labelLine: {
|
||||
show: true,
|
||||
smooth: true,
|
||||
minTurnAngle: 60,
|
||||
length: 10,
|
||||
length2: 10,
|
||||
},
|
||||
};
|
||||
}),
|
||||
children: (() => {
|
||||
const outerDisplayValues = getOuterDisplayValues(
|
||||
item.children,
|
||||
groupScales[i]
|
||||
);
|
||||
return item.children.map((k: any, j: number) => {
|
||||
const count = k.count ?? 0;
|
||||
const fullLabel = `${k.name}(${count})`;
|
||||
return {
|
||||
name: formatLeafLabel(k.name, count, outerLabelMaxLen),
|
||||
fullLabel,
|
||||
count,
|
||||
value: outerDisplayValues[j],
|
||||
parentId: k.parentId,
|
||||
treeId: k.treeId,
|
||||
itemStyle: {
|
||||
color: chartColors[i],
|
||||
},
|
||||
label: {
|
||||
show: count > 0,
|
||||
position: "outside",
|
||||
rotate: 0,
|
||||
distance: 20,
|
||||
fontSize: outerFontSize,
|
||||
color: "#ffffff",
|
||||
avoidLabelOverlap: true,
|
||||
minMargin: 4,
|
||||
formatter: (params: any) => {
|
||||
if (!params.data?.fullLabel) return "";
|
||||
return params.name;
|
||||
},
|
||||
},
|
||||
labelLine: {
|
||||
show: count > 0,
|
||||
smooth: true,
|
||||
minTurnAngle: 60,
|
||||
length: 10,
|
||||
length2: 10,
|
||||
},
|
||||
};
|
||||
});
|
||||
})(),
|
||||
};
|
||||
}),
|
||||
radius: [0, "60%"],
|
||||
center: ["50%", "55%"],
|
||||
itemStyle: {
|
||||
borderWidth: 2,
|
||||
normal: {
|
||||
label: {
|
||||
rotate: 0,
|
||||
fontSize: 13,
|
||||
lineHeight: 20,
|
||||
rich: {
|
||||
fontSize16: {
|
||||
fontSize: "16px",
|
||||
},
|
||||
fontSize12: {
|
||||
fontSize: "12px",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
levels: [
|
||||
{},
|
||||
@@ -253,7 +244,10 @@ const renderChart = (key: any) => {
|
||||
r0: "40%",
|
||||
r: "60%",
|
||||
label: {
|
||||
rotate: 0,
|
||||
align: "right",
|
||||
avoidLabelOverlap: true,
|
||||
minMargin: 4,
|
||||
},
|
||||
},
|
||||
],
|
||||
@@ -262,7 +256,6 @@ const renderChart = (key: any) => {
|
||||
],
|
||||
});
|
||||
myChart.on("click", function (params: any) {
|
||||
console.log("🚀 ~ renderChart ~ params:", params);
|
||||
alarmPopUpBoxRefEvent.value.open(
|
||||
params.data.parentId,
|
||||
params.data.treeId || ""
|
||||
@@ -447,7 +440,7 @@ const init = async () => {
|
||||
// customId: null,
|
||||
// name: "精密加工",
|
||||
// code: null,
|
||||
// count: 335,
|
||||
// count: 1,
|
||||
// eventList: null,
|
||||
// children: null,
|
||||
// },
|
||||
@@ -457,7 +450,7 @@ const init = async () => {
|
||||
// customId: null,
|
||||
// name: "半导体制造",
|
||||
// code: null,
|
||||
// count: 113,
|
||||
// count: 2,
|
||||
// eventList: null,
|
||||
// children: null,
|
||||
// },
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
v-for="(value, index) in infoWindowPoint.objName.split(
|
||||
';'
|
||||
)"
|
||||
style="white-space: nowrap"
|
||||
style="white-space: nowrap; font-size: 13px"
|
||||
>
|
||||
{{ value }}
|
||||
</div>
|
||||
@@ -198,8 +198,8 @@ const markerClick = (e: any) => {
|
||||
zoom.value = 15;
|
||||
infoWindowPoint.value = e;
|
||||
infoWindowPoint.value.show = true;
|
||||
center.value.lng = 116.404367;
|
||||
center.value.lat = 39.915421;
|
||||
center.value.lng = e.lng;
|
||||
center.value.lat = e.lat+ 0.01000001;;
|
||||
|
||||
setTimeout(() => {
|
||||
center.value.lng = e.lng;
|
||||
@@ -285,41 +285,41 @@ const init = () => {
|
||||
const moveenFlag = ref(true);
|
||||
|
||||
const checkMapData = () => {
|
||||
if (!mapInstance.value || !BMapInstance.value || !moveenFlag.value) return;
|
||||
// if (!mapInstance.value || !BMapInstance.value || !moveenFlag.value) return;
|
||||
|
||||
// 获取地图容器
|
||||
const container = mapInstance.value.getContainer();
|
||||
// // 获取地图容器
|
||||
// const container = mapInstance.value.getContainer();
|
||||
|
||||
setTimeout(() => {
|
||||
try {
|
||||
// 1. 获取所有图片瓦片
|
||||
const tiles = Array.from(container.querySelectorAll("img"));
|
||||
// setTimeout(() => {
|
||||
// try {
|
||||
// // 1. 获取所有图片瓦片
|
||||
// const tiles = Array.from(container.querySelectorAll("img"));
|
||||
|
||||
// 2. 检查是否有离线地图瓦片
|
||||
const hasOfflineTiles = tiles.some((tile: any) => {
|
||||
// 确保tile是有效的DOM元素
|
||||
if (!tile || !tile.src) return false;
|
||||
// // 2. 检查是否有离线地图瓦片
|
||||
// const hasOfflineTiles = tiles.some((tile: any) => {
|
||||
// // 确保tile是有效的DOM元素
|
||||
// if (!tile || !tile.src) return false;
|
||||
|
||||
// 检查是否是离线瓦片
|
||||
return tile.src.includes("/plugin/offline/tiles/");
|
||||
});
|
||||
// // 检查是否是离线瓦片
|
||||
// return tile.src.includes("/plugin/offline/tiles/");
|
||||
// });
|
||||
|
||||
// 3. 如果没有离线瓦片,回到默认位置
|
||||
if (!hasOfflineTiles) {
|
||||
console.warn("当前区域无离线地图数据,将返回默认位置");
|
||||
// // 3. 如果没有离线瓦片,回到默认位置
|
||||
// if (!hasOfflineTiles) {
|
||||
// console.warn("当前区域无离线地图数据,将返回默认位置");
|
||||
|
||||
// 使用正确的BMap.Point创建方式
|
||||
const point = new BMapInstance.value.Point(116.404367, 39.915421);
|
||||
// // 使用正确的BMap.Point创建方式
|
||||
// const point = new BMapInstance.value.Point(116.404367, 39.915421);
|
||||
|
||||
// 平滑移动并设置合适缩放级别
|
||||
mapInstance.value.panTo(point);
|
||||
mapInstance.value.setZoom(12);
|
||||
// zoom.value = 12;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("地图检测出错:", error);
|
||||
}
|
||||
}, 1000); // 适当缩短延迟时间
|
||||
// // 平滑移动并设置合适缩放级别
|
||||
// mapInstance.value.panTo(point);
|
||||
// mapInstance.value.setZoom(12);
|
||||
// // zoom.value = 12;
|
||||
// }
|
||||
// } catch (error) {/
|
||||
// console.error("地图检测出错:", error);
|
||||
// }
|
||||
// }, 1000); // 适当缩短延迟时间
|
||||
};
|
||||
|
||||
// 处理地图滚轮缩放,修正scale导致的坐标偏移
|
||||
|
||||
@@ -37,7 +37,8 @@
|
||||
<span class="iconfont icon-gaojing" :class="item.checked ? 'blue' : 'animate-flash-red'"></span>
|
||||
<div :style="{ color: item.checked ? '#0a73ff' : '#ff0000' }" style="font-weight: 650"
|
||||
@click="handleCurrentChange(item)">
|
||||
<div>{{ item.timeid }}.{{ item.ms }}</div>
|
||||
{{ item.messageContent }}
|
||||
<!-- <div>{{ item.timeid }}.{{ item.ms }}</div>
|
||||
<p class="mt5">
|
||||
{{ item.bdname }} {{ item.pointname }}发生{{
|
||||
filteWavetype(item.wavetype)
|
||||
@@ -50,7 +51,7 @@
|
||||
影响范围: </span><span style="flex: 1" :style="{ color: item.checked ? '#0a73ff' : '#ffc107' }">{{
|
||||
item.objName
|
||||
}}</span>
|
||||
</p>
|
||||
</p> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -82,6 +83,7 @@ const gradeValue: any = ref(0);
|
||||
const handleSelectionChange = (val: any) => {
|
||||
multipleSelection.value = val;
|
||||
};
|
||||
|
||||
const mp3Src: any = new URL(`@/assets/mp3/9578.mp3`, import.meta.url);
|
||||
const audioRef: any = ref(null);
|
||||
const updateData = (row: any) => {
|
||||
@@ -132,11 +134,12 @@ const speakBrowser = (item: any) => {
|
||||
audioRef.value.play(); //没有就播放
|
||||
// audioRef.value.pause() //暂停
|
||||
} else if (store.state.voiceType == 1) {
|
||||
speak(
|
||||
` ${item.timeid}${item.bdname}${item.pointname
|
||||
}发生${filteWavetype(item.wavetype)}事件,事件特征幅值${Math.floor(
|
||||
item.eventvalue * 100
|
||||
)}%,持续时间:${item.persisttime}秒`,
|
||||
speak(`${item.messageContent}`
|
||||
// ` ${item.timeid}${item.bdname}${item.pointname
|
||||
// }发生${filteWavetype(item.wavetype)}事件,事件特征幅值${Math.floor(
|
||||
// item.eventvalue * 100
|
||||
// )}%,持续时间:${item.persisttime}秒`
|
||||
,
|
||||
() => {
|
||||
// key.value += 1;
|
||||
}
|
||||
@@ -156,10 +159,10 @@ const totalProcessing = (number: number, id?: string) => {
|
||||
//紧急告警确认
|
||||
list = urgentList.value
|
||||
.filter((item: any) => item.checked == true)
|
||||
.map((item: any) => item.eventdetail_index);
|
||||
.map((item: any) => item.messageIds);
|
||||
} else if (number == 2) {
|
||||
//紧急告警全部确认
|
||||
list = urgentList.value.map((item: any) => item.eventdetail_index);
|
||||
list = urgentList.value.map((item: any) => item.messageIds);
|
||||
} else if (number == 3) {
|
||||
list = [id];
|
||||
}
|
||||
@@ -173,13 +176,14 @@ const totalProcessing = (number: number, id?: string) => {
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
lookEvent(list).then((res) => {
|
||||
lookEvent( [...new Set(list.flat())]).then((res) => {
|
||||
|
||||
list.forEach((id: any) => {
|
||||
urgentList.value = urgentList.value.filter(
|
||||
(item: any) => item.eventdetail_index != id
|
||||
(item: any) => item.messageIds != id
|
||||
);
|
||||
broadcast.value = broadcast.value.filter(
|
||||
(item: any) => item.eventdetail_index != id
|
||||
(item: any) => item.messageIds != id
|
||||
);
|
||||
});
|
||||
if (broadcast.value.length == 0) {
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="残余电压告警阈值">
|
||||
<el-input-number v-model="form.eventValue" :min="0" :max="0.9" :precision="1" :step="0.1"
|
||||
<el-input-number v-model="form.eventValue" :min="0" :max="1" :step="0.01"
|
||||
@change="(e) => (e == null ? (form.eventValue = 0.1) : null)" style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="持续时间告警阈值">
|
||||
|
||||
@@ -1,25 +1,56 @@
|
||||
<!--报表导出-->
|
||||
<template>
|
||||
<el-dialog :close-on-click-modal="false" draggable v-model="machineVisible" :title="title" width="500">
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
draggable
|
||||
v-model="machineVisible"
|
||||
:title="title"
|
||||
width="500"
|
||||
>
|
||||
<div>
|
||||
<div class="smsConfig">
|
||||
<el-form :model="form" inline label-width="auto" class=" ml30 mt10">
|
||||
<el-form :model="form" inline label-width="auto" class="ml30 mt10">
|
||||
<el-form-item label="时间">
|
||||
<el-date-picker v-model="timeValue" size="small" type="daterange" :disabled-date="isFutureDate"
|
||||
style="width: 250px; margin-right: 10px" unlink-panels :clearable="false" range-separator="至"
|
||||
start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYY-MM-DD HH:mm:ss" />
|
||||
<el-date-picker
|
||||
v-model="timeValue"
|
||||
size="small"
|
||||
type="datetimerange"
|
||||
:disabled-date="isFutureDate"
|
||||
style="width: 250px; margin-right: 10px"
|
||||
unlink-panels
|
||||
:clearable="false"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="部门集合">
|
||||
<el-select v-model="form.deptList" placeholder="请选择部门集合" style="width: 250px" size="small" multiple
|
||||
collapse-tags collapse-tags-tooltip>
|
||||
<el-select
|
||||
v-model="form.deptList"
|
||||
placeholder="请选择部门集合"
|
||||
style="width: 250px"
|
||||
size="small"
|
||||
multiple
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
>
|
||||
<template #header>
|
||||
<el-checkbox v-model="checkAll" :indeterminate="indeterminate" @change="handleCheckAll">
|
||||
<el-checkbox
|
||||
v-model="checkAll"
|
||||
:indeterminate="indeterminate"
|
||||
@change="handleCheckAll"
|
||||
>
|
||||
全部
|
||||
</el-checkbox>
|
||||
</template>
|
||||
<el-option v-for="item in deptLists" :key="item.deptsIndex" :label="item.deptsname"
|
||||
:value="item.deptsIndex" />
|
||||
<el-option
|
||||
v-for="item in deptLists"
|
||||
:key="item.deptsIndex"
|
||||
:label="item.deptsname"
|
||||
:value="item.deptsIndex"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -32,7 +63,14 @@
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button :icon="Close" @click="setUp" size="small">取消</el-button>
|
||||
<el-button type="primary" :icon="Check" @click="save" size="small">确定</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
:icon="Check"
|
||||
@click="save"
|
||||
size="small"
|
||||
:loading="loading"
|
||||
>确定</el-button
|
||||
>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -41,17 +79,18 @@ import { ref, watch, inject, onMounted } from "vue";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { Check, Close } from "@element-plus/icons-vue";
|
||||
import { getDept, exportForms } from "@/api/statistics/index";
|
||||
import type { CheckboxValueType } from 'element-plus'
|
||||
import type { CheckboxValueType } from "element-plus";
|
||||
import { useStore } from "vuex";
|
||||
const store = useStore();
|
||||
const machineVisible = ref(false);
|
||||
const title = ref("报表导出");
|
||||
const timeValue = ref([]);
|
||||
const deptLists = ref();
|
||||
const loading = ref(false);
|
||||
//form表单校验规则
|
||||
const emit = defineEmits(["flushed"]);
|
||||
const checkAll = ref(false)
|
||||
const indeterminate = ref(false)
|
||||
const checkAll = ref(false);
|
||||
const indeterminate = ref(false);
|
||||
const form = ref({
|
||||
searchBeginTime: "",
|
||||
searchEndTime: "",
|
||||
@@ -88,28 +127,28 @@ const init = () => {
|
||||
// }
|
||||
// })
|
||||
watch(
|
||||
() => form.value.deptList, // 使用函数返回值的形式
|
||||
() => form.value.deptList, // 使用函数返回值的形式
|
||||
(val) => {
|
||||
if (val.length == 0) {
|
||||
checkAll.value = false
|
||||
indeterminate.value = false
|
||||
checkAll.value = false;
|
||||
indeterminate.value = false;
|
||||
} else if (val.length == deptLists.value.length) {
|
||||
checkAll.value = true
|
||||
indeterminate.value = false
|
||||
checkAll.value = true;
|
||||
indeterminate.value = false;
|
||||
} else {
|
||||
indeterminate.value = true
|
||||
indeterminate.value = true;
|
||||
}
|
||||
},
|
||||
{ deep: true } // 添加深度监听选项
|
||||
)
|
||||
{ deep: true } // 添加深度监听选项
|
||||
);
|
||||
const handleCheckAll = (val: CheckboxValueType) => {
|
||||
indeterminate.value = false
|
||||
indeterminate.value = false;
|
||||
if (val) {
|
||||
form.value.deptList = deptLists.value.map((_) => _.deptsIndex)
|
||||
form.value.deptList = deptLists.value.map((_) => _.deptsIndex);
|
||||
} else {
|
||||
form.value.deptList = []
|
||||
form.value.deptList = [];
|
||||
}
|
||||
}
|
||||
};
|
||||
const save = () => {
|
||||
if (!timeValue.value[0]) {
|
||||
ElMessage.warning("请选择时间!");
|
||||
@@ -122,25 +161,29 @@ const save = () => {
|
||||
|
||||
(form.value.deptId = store.state.deptId),
|
||||
(form.value.searchBeginTime = timeValue.value[0]),
|
||||
(form.value.searchEndTime = timeValue.value[1]
|
||||
? timeValue.value[1].split(" ")[0] + " 23:59:59"
|
||||
: "");
|
||||
exportForms(form.value).then((res: any) => {
|
||||
let blob = new Blob([res], {
|
||||
type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8",
|
||||
(form.value.searchEndTime = timeValue.value[1]);
|
||||
|
||||
exportForms(form.value)
|
||||
.then((res: any) => {
|
||||
let blob = new Blob([res], {
|
||||
type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8",
|
||||
});
|
||||
|
||||
// createObjectURL(blob); //创建下载的链接
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
const link = document.createElement("a"); // 创建a标签
|
||||
link.href = url;
|
||||
link.download = "导出报表.docx"; // 设置下载的文件名
|
||||
document.body.appendChild(link);
|
||||
link.click(); //执行下载
|
||||
document.body.removeChild(link);
|
||||
|
||||
machineVisible.value = false;
|
||||
loading.value = false;
|
||||
})
|
||||
.catch((err) => {
|
||||
loading.value = false;
|
||||
});
|
||||
|
||||
// createObjectURL(blob); //创建下载的链接
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
const link = document.createElement("a"); // 创建a标签
|
||||
link.href = url;
|
||||
link.download = "导出报表.docx"; // 设置下载的文件名
|
||||
document.body.appendChild(link);
|
||||
link.click(); //执行下载
|
||||
document.body.removeChild(link);
|
||||
|
||||
machineVisible.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
const isFutureDate = (time: any) => {
|
||||
|
||||
583
src/views/VoltageSag_BJ/components/send.vue
Normal file
583
src/views/VoltageSag_BJ/components/send.vue
Normal file
@@ -0,0 +1,583 @@
|
||||
<template>
|
||||
<el-dialog :close-on-click-modal="false" draggable v-model="machineVisible" :title="title" width="1300px"
|
||||
:before-close="handleClose" @opened="handleDialogOpened">
|
||||
<el-form inline="true" class="formLeft">
|
||||
<el-form-item>
|
||||
<datePicker :setWatch="false" :showTime="true" ref="datePickerRef" :defaultInterval="5" style="width: 560px" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="关键字筛选" style="margin-right: 10px">
|
||||
<el-input clearable v-model="searchValue" size="small" placeholder="电站、测点、用户信息"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item style="margin-right: auto">
|
||||
<el-popover placement="bottom" :width="550" trigger="click">
|
||||
<template #reference>
|
||||
<el-button size="small" :icon="DArrowRight" type="primary">更多</el-button>
|
||||
</template>
|
||||
|
||||
<el-form label-width="auto">
|
||||
<el-form-item label="关键字筛选">
|
||||
<el-input clearable style="width: 150px" v-model="searchValue" size="small"
|
||||
placeholder="电站、测点、用户信息"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="运维单位">
|
||||
<el-select v-model="deptsIndex" placeholder="请选择运维单位" clearable size="small"
|
||||
:teleported="false" style="width: 150px">
|
||||
<el-option v-for="item in deptsList" :label="item.deptsname" :value="item.deptsIndex"
|
||||
:key="item.deptsIndex"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="触发类型">
|
||||
<el-select clearable size="small" :teleported="false" v-model="eventForm.eventtype"
|
||||
placeholder="请选择触发类型" style="width: 150px">
|
||||
<el-option v-for="item in eventTypeList" :label="item.label" :value="item.value"
|
||||
:key="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="过滤敏感用户">
|
||||
<el-select clearable size="small" :teleported="false" v-model="eventForm.fiterSensitiveUser"
|
||||
placeholder="请选择过滤敏感用户" style="width: 150px">
|
||||
<el-option label="是" value="1"></el-option>
|
||||
<el-option label="否" value="0"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="残余电压百分比">
|
||||
<el-input-number v-model="eventForm.eventValueMin" :min="0" style="width: 150px"
|
||||
size="small" :max="100" :precision="1" :step="1"
|
||||
@change="(e) => (e == null ? (eventForm.eventValueMin = 1) : null)"><template #suffix>
|
||||
<span>%</span>
|
||||
</template></el-input-number>
|
||||
<span> < 残余电压 < </span>
|
||||
<el-input-number v-model="eventForm.eventValueMax" :min="0" style="width: 150px"
|
||||
size="small" :max="100" :precision="1" :step="1"
|
||||
@change="(e) => (e == null ? (eventForm.eventValueMax = 1) : null)"><template
|
||||
#suffix>
|
||||
<span>%</span>
|
||||
</template></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="暂降持续事时间">
|
||||
<el-input-number v-model="eventForm.eventDurationMin" :min="0" style="width: 150px"
|
||||
size="small" :max="1000000" :precision="1" :step="1" @change="
|
||||
(e) => (e == null ? (eventForm.eventDurationMin = 1) : null)
|
||||
"><template #suffix>
|
||||
<span>ms</span>
|
||||
</template></el-input-number>
|
||||
<span> < 持续时间 < </span>
|
||||
<el-input-number v-model="eventForm.eventDurationMax" :min="0" style="width: 150px"
|
||||
size="small" :max="1000000" :precision="1" :step="1" @change="
|
||||
(e) => (e == null ? (eventForm.eventDurationMax = 1) : null)
|
||||
"><template #suffix>
|
||||
<span>ms</span>
|
||||
</template></el-input-number>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-popover>
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item style="margin-right: 0;">
|
||||
<el-button size="small" :icon="Search" type="primary" @click="inquire(true)">查询</el-button>
|
||||
<el-button size="small" type="warn" :icon="RefreshLeft" @click="clearInit()">重置</el-button>
|
||||
<el-button size="small" type="primary" :icon="Comment" @click="getMessage"
|
||||
:loading="templateLoading">生成短信</el-button>
|
||||
<el-button type="primary" :icon="Download" @click="exportTable" size="small" :loading="exportLoading">导出
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div class="tableBox" v-loading="loading" element-loading-background="#343849c7">
|
||||
<el-table ref="tableRef" :scrollbar-always-on="true" :data="tableData" height="280px" size="small" stripe
|
||||
row-key="eventdetail_index" highlight-current-row :header-cell-style="{ textAlign: 'center' }" border
|
||||
@row-click="handleRowClick" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" align="center" :selectable="selectable" reserve-selection
|
||||
width="55" />
|
||||
<el-table-column label="序号" align="center" width="60">
|
||||
<template #default="scope">
|
||||
{{ (pageNum - 1) * pageSize + scope.$index + 1 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="timeid" align="center" label="发生时间" width="160" sortable>
|
||||
<template #default="scope">
|
||||
{{ scope.row.timeid }}.{{ scope.row.ms }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="bdname" align="center" label="变电站" show-overflow-tooltip sortable />
|
||||
<el-table-column prop="busName" align="center" label="母线" show-overflow-tooltip />
|
||||
<el-table-column prop="pointname" align="center" label="监测点" show-overflow-tooltip />
|
||||
<el-table-column prop="objName" align="center" label="用户" show-overflow-tooltip>
|
||||
<template #default="scope">{{ scope.row.objName || "/" }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="wavetype" align="center" width="70" label="触发类型">
|
||||
<template #default="scope">
|
||||
{{ filteWavetype(scope.row.wavetype) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="eventvalue" align="center" label="残余电压" width="90" sortable>
|
||||
<template #default="scope">
|
||||
{{ Math.floor(scope.row.eventvalue * 10000) / 100 }}%
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="persisttime" align="center" label="持续时间" width="90" sortable>
|
||||
<template #default="scope">
|
||||
{{ Math.floor(scope.row.persisttime * 1000) / 1000 }}s
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="address" align="center" label="操作" width="80">
|
||||
<template #default="scope">
|
||||
<el-button size="small" type="primary" link @click.stop="trendCharts(scope.row)">
|
||||
波形
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination style="margin-top: 10px" :currentPage="pageNum" :page-size="pageSize"
|
||||
:page-sizes="[10, 20, 50, 100, 200]" background size="small"
|
||||
:layout="'sizes,total, ->, prev, pager, next, jumper'" :total="total" @size-change="onTableSizeChange"
|
||||
@current-change="onTableCurrentChange"></el-pagination>
|
||||
</div>
|
||||
<el-divider />
|
||||
<div class="sendBox">
|
||||
<div style="min-height: 37px;">
|
||||
<div class="mb10">发送用户</div>
|
||||
<div class="userGroups">
|
||||
<div v-for="group in pqsUserGroups" :key="group.deptName" class="userGroup">
|
||||
<span class="deptName">{{ group.deptName }}:</span>
|
||||
<el-checkbox-group v-model="selectedUserIds">
|
||||
<el-checkbox v-for="user in group.users" class="mb7" :key="user.userIndex" :label="user.userIndex"
|
||||
border size="small">
|
||||
{{ user.name }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="mb10">短信模板 </div>
|
||||
<el-input v-model="messageList.message" style="flex: 1;" :rows="5" type="textarea"
|
||||
:value="messageList && messageList.message" />
|
||||
</div>
|
||||
</div>
|
||||
<div class=" mt10" style="display: flex;justify-content: flex-end;">
|
||||
<el-button size="small" :icon="Message" type="primary" @click="sendMessage"
|
||||
:loading="sendLoading">发送</el-button>
|
||||
</div>
|
||||
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" draggable v-model="trendVisible" v-if="trendVisible" title="波形"
|
||||
width="70%">
|
||||
<waveForm ref="waveFormRef" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, nextTick, computed } from "vue";
|
||||
import { eventPage, regionDevCount, messageGenerate, messageSend } from "@/api/statistics/index";
|
||||
import {
|
||||
DArrowRight,
|
||||
Search,
|
||||
RefreshLeft,
|
||||
Download, Message, Comment
|
||||
} from "@element-plus/icons-vue";
|
||||
import * as XLSX from "xlsx";
|
||||
import waveForm from "@/components/BX/waveForm.vue";
|
||||
import datePicker from "@/components/datePicker/index.vue";
|
||||
import { useStore } from "vuex";
|
||||
import { ElMessage } from "element-plus";
|
||||
const store = useStore();
|
||||
const machineVisible = ref(false);
|
||||
const title = ref("暂降事件列表");
|
||||
const datePickerRef = ref();
|
||||
const pageNum = ref(1);
|
||||
const pageSize = ref(100);
|
||||
const loading = ref(false);
|
||||
const exportLoading = ref(false);
|
||||
const total = ref(0);
|
||||
const tableData = ref([]);
|
||||
const searchValue = ref("");
|
||||
const deptsIndex = ref(null);
|
||||
const deptsList = ref([]);
|
||||
const trendVisible = ref(false);
|
||||
const waveFormRef = ref();
|
||||
const tableRef = ref();
|
||||
const selectedRowIds = ref<string[]>([]);
|
||||
const selectedRows = ref<any[]>([]);
|
||||
const templateLoading = ref(false);
|
||||
const isAutoSelecting = ref(false);
|
||||
const messageList = ref<{
|
||||
message: string;
|
||||
eventId: string;
|
||||
pqsUsers: Record<string, any[]>;
|
||||
}>({
|
||||
message: "",
|
||||
eventId: "",
|
||||
pqsUsers: {},
|
||||
});
|
||||
const selectedUserIds = ref<string[]>([]);
|
||||
const selectable = (row: any) => !!row.eventdetail_index;
|
||||
const eventForm: any = reactive({
|
||||
eventValueMin: null,
|
||||
eventValueMax: null,
|
||||
eventDurationMin: null,
|
||||
eventDurationMax: null,
|
||||
eventtype: null,
|
||||
fiterSensitiveUser: '1',
|
||||
});
|
||||
const sendLoading = ref(false);
|
||||
const typeMap: Record<string, string> = {
|
||||
"0": "扰动",
|
||||
"1": "暂降",
|
||||
"2": "暂升",
|
||||
"3": "中断",
|
||||
"4": "其他",
|
||||
"5": "录波",
|
||||
};
|
||||
|
||||
const eventTypeList = computed(() => {
|
||||
const availableTypes = store.state.eventTypeList.map((type: number) =>
|
||||
String(type)
|
||||
);
|
||||
return availableTypes
|
||||
.filter((type) => Object.prototype.hasOwnProperty.call(typeMap, type))
|
||||
.map((type) => ({
|
||||
value: type,
|
||||
label: typeMap[type],
|
||||
}));
|
||||
});
|
||||
|
||||
const pqsUserGroups = computed(() => {
|
||||
const pqsUsers = messageList.value.pqsUsers;
|
||||
if (!pqsUsers || Array.isArray(pqsUsers)) return [];
|
||||
return Object.entries(pqsUsers).map(([deptName, users]) => ({
|
||||
deptName,
|
||||
users: users || [],
|
||||
}));
|
||||
});
|
||||
|
||||
const initSelectedUsers = (pqsUsers: Record<string, any[]>) => {
|
||||
const ids: string[] = [];
|
||||
Object.values(pqsUsers || {}).forEach((users) => {
|
||||
users.forEach((user) => {
|
||||
if (user.userIndex) ids.push(user.userIndex);
|
||||
});
|
||||
});
|
||||
selectedUserIds.value = ids;
|
||||
};
|
||||
|
||||
const getFilteredPqsUsers = () => {
|
||||
const result: Record<string, any[]> = {};
|
||||
const pqsUsers = messageList.value.pqsUsers;
|
||||
if (!pqsUsers || Array.isArray(pqsUsers)) return result;
|
||||
Object.entries(pqsUsers).forEach(([deptName, users]) => {
|
||||
const filtered = users.filter((user) => selectedUserIds.value.includes(user.userIndex));
|
||||
if (filtered.length > 0) {
|
||||
result[deptName] = filtered;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
};
|
||||
|
||||
const getTimeRange = () => {
|
||||
const picker = datePickerRef.value;
|
||||
const timeValue = picker?.timeValue || [];
|
||||
return {
|
||||
type: picker?.interval ?? 5,
|
||||
startDateTime: timeValue[0] || "",
|
||||
endTDateime: timeValue[1] || "",
|
||||
};
|
||||
};
|
||||
|
||||
const getQueryParams = (override: Record<string, any> = {}) => {
|
||||
const { type, startDateTime, endTDateime } = getTimeRange();
|
||||
return {
|
||||
deptId: deptsIndex.value || store.state.deptId,
|
||||
type,
|
||||
startDateTime,
|
||||
endTDateime,
|
||||
eventtype: null,
|
||||
pageNum: pageNum.value,
|
||||
pageSize: pageSize.value,
|
||||
searchValue: searchValue.value,
|
||||
...eventForm,
|
||||
eventValueMin:
|
||||
eventForm.eventValueMin == null ? null : eventForm.eventValueMin / 100,
|
||||
eventValueMax:
|
||||
eventForm.eventValueMax == null ? null : eventForm.eventValueMax / 100,
|
||||
...override,
|
||||
};
|
||||
};
|
||||
|
||||
const filteWavetype = (wavetype: string) => {
|
||||
return typeMap[String(wavetype)] ?? "";
|
||||
};
|
||||
|
||||
const clearSelection = () => {
|
||||
selectedRowIds.value = [];
|
||||
selectedRows.value = [];
|
||||
tableRef.value?.clearSelection();
|
||||
};
|
||||
|
||||
const handleSelectionChange = (rows: any[]) => {
|
||||
if (isAutoSelecting.value) return;
|
||||
selectedRows.value = rows;
|
||||
selectedRowIds.value = rows.map((row) => row.eventdetail_index);
|
||||
};
|
||||
|
||||
const handleRowClick = (row: any) => {
|
||||
if (!selectable(row)) return;
|
||||
tableRef.value?.toggleRowSelection(row);
|
||||
};
|
||||
|
||||
const selectAllAndGenerateMessage = async () => {
|
||||
await nextTick();
|
||||
if (total.value === 0) {
|
||||
clearSelection();
|
||||
return;
|
||||
}
|
||||
|
||||
let allRecords = tableData.value;
|
||||
if (total.value > tableData.value.length) {
|
||||
const allRes = await eventPage(getQueryParams({ pageNum: 1, pageSize: total.value }));
|
||||
allRecords = allRes.data.records || [];
|
||||
}
|
||||
|
||||
const selectableRecords = allRecords.filter(selectable);
|
||||
isAutoSelecting.value = true;
|
||||
try {
|
||||
selectedRows.value = selectableRecords;
|
||||
selectedRowIds.value = selectableRecords.map((row) => row.eventdetail_index);
|
||||
tableRef.value?.clearSelection();
|
||||
await nextTick();
|
||||
tableData.value.forEach((row: any) => {
|
||||
if (selectedRowIds.value.includes(row.eventdetail_index)) {
|
||||
tableRef.value?.toggleRowSelection(row, true);
|
||||
}
|
||||
});
|
||||
getMessage(true);
|
||||
} finally {
|
||||
isAutoSelecting.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const getMessage = (silent = false) => {
|
||||
if (selectedRowIds.value.length === 0) {
|
||||
if (!silent) {
|
||||
ElMessage.warning("请选择暂降事件!");
|
||||
}
|
||||
return;
|
||||
}
|
||||
templateLoading.value = true;
|
||||
messageGenerate({ eventIds: selectedRowIds.value.join(',') }).then((res: any) => {
|
||||
if (res.code == 'A0000') {
|
||||
messageList.value = res.data;
|
||||
initSelectedUsers(res.data.pqsUsers || {});
|
||||
} else {
|
||||
ElMessage.warning(res.message);
|
||||
messageList.value = {
|
||||
message: "",
|
||||
eventId: "",
|
||||
pqsUsers: {}
|
||||
};
|
||||
selectedUserIds.value = [];
|
||||
}
|
||||
}).finally(() => {
|
||||
templateLoading.value = false;
|
||||
});
|
||||
};
|
||||
const initDept = () => {
|
||||
const { type, startDateTime, endTDateime } = getTimeRange();
|
||||
regionDevCount({
|
||||
deptId: store.state.deptId,
|
||||
type,
|
||||
startDateTime,
|
||||
endTDateime,
|
||||
}).then((res: any) => {
|
||||
deptsList.value = res.data;
|
||||
});
|
||||
};
|
||||
|
||||
const resetQueryForm = () => {
|
||||
searchValue.value = "";
|
||||
deptsIndex.value = null;
|
||||
eventForm.eventValueMin = null;
|
||||
eventForm.eventValueMax = null;
|
||||
eventForm.eventDurationMin = null;
|
||||
eventForm.eventDurationMax = null;
|
||||
eventForm.eventtype = null;
|
||||
eventForm.fiterSensitiveUser = "1";
|
||||
pageNum.value = 1;
|
||||
pageSize.value = 100;
|
||||
clearSelection();
|
||||
datePickerRef.value?.setTheDate(5);
|
||||
};
|
||||
|
||||
const handleDialogOpened = () => {
|
||||
resetQueryForm();
|
||||
initDept();
|
||||
inquire(true);
|
||||
};
|
||||
|
||||
const inquire = (resetPage = false) => {
|
||||
messageList.value = {
|
||||
message: "",
|
||||
eventId: "",
|
||||
pqsUsers: {}
|
||||
};
|
||||
selectedUserIds.value = [];
|
||||
if (resetPage) {
|
||||
pageNum.value = 1;
|
||||
pageSize.value = 100;
|
||||
clearSelection();
|
||||
}
|
||||
loading.value = true;
|
||||
eventPage(getQueryParams()).then(async (res) => {
|
||||
total.value = res.data.total;
|
||||
tableData.value = res.data.records;
|
||||
loading.value = false;
|
||||
if (resetPage) {
|
||||
await selectAllAndGenerateMessage();
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
const clearInit = async () => {
|
||||
resetQueryForm();
|
||||
await inquire(true);
|
||||
};
|
||||
|
||||
const trendCharts = (row: any) => {
|
||||
trendVisible.value = true;
|
||||
setTimeout(() => {
|
||||
waveFormRef.value?.open(row);
|
||||
}, 500);
|
||||
};
|
||||
|
||||
const open = (text: string) => {
|
||||
title.value = text || "暂降事件列表";
|
||||
clearSelection();
|
||||
machineVisible.value = true;
|
||||
};
|
||||
|
||||
const sendMessage = () => {
|
||||
const filteredPqsUsers = getFilteredPqsUsers();
|
||||
const userCount = Object.values(filteredPqsUsers).reduce((sum, users) => sum + users.length, 0);
|
||||
if (userCount === 0) {
|
||||
ElMessage.warning("发送用户不能为空!");
|
||||
return;
|
||||
}
|
||||
if (!messageList.value.message?.trim()) {
|
||||
ElMessage.warning("请输入发送短信内容!");
|
||||
return;
|
||||
}
|
||||
|
||||
sendLoading.value = true;
|
||||
messageSend({
|
||||
...messageList.value,
|
||||
pqsUsers: filteredPqsUsers,
|
||||
})
|
||||
.then((res: any) => {
|
||||
if (res.code == 'A0000') {
|
||||
if (res.data.sendResult == 0) {
|
||||
ElMessage.warning("发送失败");
|
||||
} else {
|
||||
ElMessage.success("发送成功");
|
||||
|
||||
}
|
||||
} else {
|
||||
ElMessage.warning(res.message);
|
||||
}
|
||||
}).catch((error: any) => {
|
||||
ElMessage.warning("发送失败");
|
||||
})
|
||||
.finally(() => {
|
||||
sendLoading.value = false;
|
||||
});
|
||||
};
|
||||
const onTableSizeChange = (size: number) => {
|
||||
pageSize.value = size;
|
||||
inquire();
|
||||
};
|
||||
|
||||
const onTableCurrentChange = (page: number) => {
|
||||
pageNum.value = page;
|
||||
inquire();
|
||||
};
|
||||
|
||||
const exportTable = async () => {
|
||||
exportLoading.value = true;
|
||||
const columnExpor: any = [
|
||||
["发生时间", "变电站", "母线", "监测点", "用户", "触发类型", "残余电压", "持续时间"],
|
||||
];
|
||||
|
||||
try {
|
||||
const res = await eventPage(
|
||||
getQueryParams({ pageNum: 1, pageSize: total.value })
|
||||
);
|
||||
const data = res.data.records.map((item: any) => [
|
||||
`${item.timeid}.${item.ms}`,
|
||||
item.bdname,
|
||||
item.busName,
|
||||
item.pointname,
|
||||
item.objName || "/",
|
||||
filteWavetype(item.wavetype),
|
||||
`${Math.floor(item.eventvalue * 10000) / 100}%`,
|
||||
`${Math.floor(item.persisttime * 1000) / 1000}s`,
|
||||
]);
|
||||
const list = [...columnExpor, ...data];
|
||||
const worksheet = XLSX.utils.aoa_to_sheet(list);
|
||||
worksheet["!cols"] = list[0].map(() => ({ wch: 20 }));
|
||||
const workbook = XLSX.utils.book_new();
|
||||
XLSX.utils.book_append_sheet(workbook, worksheet, "暂降事件列表");
|
||||
XLSX.writeFile(workbook, "暂降事件列表.xlsx");
|
||||
} finally {
|
||||
exportLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const handleClose = () => {
|
||||
machineVisible.value = false;
|
||||
};
|
||||
|
||||
defineExpose({ open, selectedRows, selectedRowIds });
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@use "@/assets/scss/index.scss";
|
||||
|
||||
|
||||
|
||||
.formLeft {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.tableBox {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.sendBox {
|
||||
display: grid;
|
||||
grid-template-columns: 2fr 1.3fr;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.userGroups {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.userGroup {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 5px;
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
.deptName {
|
||||
flex-shrink: 0;
|
||||
margin-right: 8px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
@@ -15,7 +15,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref, onBeforeUnmount } from "vue";
|
||||
|
||||
import * as echarts from "echarts";
|
||||
import { color, deptId } from "@/constant/index";
|
||||
import { rightImportUser } from "@/api/statistics/index";
|
||||
import { useStore } from "vuex";
|
||||
@@ -34,7 +33,9 @@ const config: any = ref({
|
||||
],
|
||||
unit: "次",
|
||||
color: "#0a73ff",
|
||||
waitTime: 5000,
|
||||
rowNum: 7,
|
||||
carousel: "page",
|
||||
});
|
||||
const sendPopUpBoxRef = ref();
|
||||
const init = () => {
|
||||
|
||||
@@ -1,100 +1,49 @@
|
||||
<template>
|
||||
<!--短信查询-->
|
||||
<el-dialog :close-on-click-modal="false" draggable v-model="machineVisible" :title="title" width="1200px" :before-close="handleClose">
|
||||
<el-dialog :close-on-click-modal="false" draggable v-model="machineVisible" :title="title" width="1200px"
|
||||
:before-close="handleClose">
|
||||
<div class="formBox">
|
||||
<div class="formLeft">
|
||||
<datePicker ref="datePickerRef" />
|
||||
<span>发送结果: </span>
|
||||
<el-select
|
||||
size="small"
|
||||
v-model="state"
|
||||
placeholder="请选择"
|
||||
style="width: 100px"
|
||||
clearable
|
||||
>
|
||||
<datePicker :setWatch="false" ref="datePickerRef" style="width: 470px" />
|
||||
<span>关键字搜索: </span>
|
||||
<el-input size="small" v-model="searchValue" placeholder="请输入关键字" clearable style="width: 130px"></el-input>
|
||||
|
||||
<span class="ml20">发送结果: </span>
|
||||
<el-select size="small" v-model="state" placeholder="请选择" style="width: 100px" clearable>
|
||||
<el-option label="成功" value="1" />
|
||||
<el-option label="失败" value="0" />
|
||||
</el-select>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" :icon="Search" size="small" @click="inquire"
|
||||
>查询</el-button
|
||||
>
|
||||
<el-button
|
||||
type="primary"
|
||||
:icon="Download"
|
||||
@click="exportTable"
|
||||
size="small"
|
||||
>导出
|
||||
<el-button type="primary" :icon="Search" size="small" @click="inquire">查询</el-button>
|
||||
<el-button type="primary" :icon="Download" @click="exportTable" size="small">导出
|
||||
</el-button>
|
||||
<!-- <el-button type="primary" :icon="Delete" size="small">删除</el-button> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="tableBox">
|
||||
<el-table
|
||||
:scrollbar-always-on="true" :data="tableData"
|
||||
height="500px"
|
||||
size="small"
|
||||
stripe
|
||||
v-loading="loading"
|
||||
element-loading-background="#343849c7"
|
||||
:header-cell-style="{ textAlign: 'center' }"
|
||||
border
|
||||
>
|
||||
<el-table :scrollbar-always-on="true" :data="tableData" height="500px" size="small" stripe v-loading="loading"
|
||||
element-loading-background="#343849c7" :header-cell-style="{ textAlign: 'center' }" border>
|
||||
<!-- <el-table-column type="selection" align="center" width="45" /> -->
|
||||
<el-table-column label="序号" align="center" type="index" width="70" />
|
||||
<el-table-column
|
||||
prop="sendTime"
|
||||
align="center"
|
||||
label="时间"
|
||||
width="170"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="userName"
|
||||
align="center"
|
||||
label="接收人"
|
||||
width="100"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="phone"
|
||||
align="center"
|
||||
label="手机号"
|
||||
width="100"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="sendResult"
|
||||
align="center"
|
||||
label="发送结果"
|
||||
width="100"
|
||||
>
|
||||
<el-table-column prop="sendTime" align="center" label="时间" width="170" />
|
||||
<el-table-column prop="userName" align="center" label="接收人" width="100" />
|
||||
<el-table-column prop="phone" align="center" label="手机号" width="100" />
|
||||
<el-table-column prop="sendResult" align="center" label="发送结果" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag
|
||||
v-if="scope.row.sendResult === 1"
|
||||
size="small"
|
||||
type="success"
|
||||
effect="dark"
|
||||
>成功
|
||||
<el-tag v-if="scope.row.sendResult === 1" size="small" type="success" effect="dark">成功
|
||||
</el-tag>
|
||||
<el-tag v-else size="small" type="danger" effect="dark"
|
||||
>失败
|
||||
<el-tag v-else size="small" type="danger" effect="dark">失败
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="msgContent" label="发送内容" />
|
||||
</el-table>
|
||||
</div>
|
||||
<el-pagination
|
||||
style="margin-top: 10px"
|
||||
:currentPage="form.pageNum"
|
||||
:page-size="form.pageSize"
|
||||
:page-sizes="[10, 20, 50, 100, 200]"
|
||||
background
|
||||
size="small"
|
||||
:layout="'sizes,total, ->, prev, pager, next, jumper'"
|
||||
:total="total"
|
||||
@size-change="onTableSizeChange"
|
||||
@current-change="onTableCurrentChange"
|
||||
></el-pagination>
|
||||
<el-pagination style="margin-top: 10px" :currentPage="form.pageNum" :page-size="form.pageSize"
|
||||
:page-sizes="[10, 20, 50, 100, 200]" background size="small"
|
||||
:layout="'sizes,total, ->, prev, pager, next, jumper'" :total="total" @size-change="onTableSizeChange"
|
||||
@current-change="onTableCurrentChange"></el-pagination>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
@@ -104,7 +53,7 @@ import { ElMessage } from "element-plus";
|
||||
import datePicker from "@/components/datePicker/index.vue";
|
||||
import { Search, Download } from "@element-plus/icons-vue";
|
||||
import table2excel from "js-table2excel";
|
||||
const emit= defineEmits(["close"]);
|
||||
const emit = defineEmits(["close"]);
|
||||
const machineVisible = ref(false);
|
||||
const title = ref("已发送短信查询");
|
||||
const datePickerRef = ref();
|
||||
@@ -124,14 +73,15 @@ const inquire = () => {
|
||||
searchBeginTime: datePickerRef.value.timeValue[0],
|
||||
searchEndTime: datePickerRef.value.timeValue[1],
|
||||
sendResult: state.value,
|
||||
searchValue: searchValue.value,
|
||||
}).then((res) => {
|
||||
total.value = res.data.total;
|
||||
tableData.value = res.data.records;
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
const searchValue = ref("");
|
||||
const open = (text: string, data?: any) => {
|
||||
|
||||
machineVisible.value = true;
|
||||
nextTick(() => {
|
||||
inquire();
|
||||
@@ -183,6 +133,7 @@ const exportTable = () => {
|
||||
searchBeginTime: datePickerRef.value.timeValue[0],
|
||||
searchEndTime: datePickerRef.value.timeValue[1],
|
||||
sendResult: state.value,
|
||||
searchValue: searchValue.value,
|
||||
}).then((res) => {
|
||||
setTimeout(() => {
|
||||
table2excel(
|
||||
@@ -197,20 +148,23 @@ const exportTable = () => {
|
||||
};
|
||||
const handleClose = () => {
|
||||
emit("close", false);
|
||||
}
|
||||
};
|
||||
|
||||
defineExpose({ open });
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@use "@/assets/scss/index.scss";
|
||||
|
||||
.tableBox {
|
||||
padding: 0px !important;
|
||||
}
|
||||
|
||||
.formBox {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.formLeft {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
<template>
|
||||
<div id="index" ref="appRef">
|
||||
<div
|
||||
class="bg"
|
||||
:class="
|
||||
store.state.screenNotic == 1
|
||||
? pushFlag
|
||||
? bottomTextRef?.urgentList.length > 0
|
||||
? 'bg-red'
|
||||
: ''
|
||||
<div class="bg" :class="store.state.screenNotic == 1
|
||||
? pushFlag
|
||||
? bottomTextRef?.urgentList.length > 0
|
||||
? 'bg-red'
|
||||
: ''
|
||||
: ''
|
||||
"
|
||||
>
|
||||
: ''
|
||||
">
|
||||
<dv-loading v-if="loading">Loading...</dv-loading>
|
||||
|
||||
<div v-else class="host-body">
|
||||
@@ -19,8 +15,7 @@
|
||||
<div class="react-left">
|
||||
<span class="text fw-b">
|
||||
{{ timeInfo.dateYear }} {{ timeInfo.dateWeek }}
|
||||
{{ timeInfo.dateDay }}</span
|
||||
>
|
||||
{{ timeInfo.dateDay }}</span>
|
||||
</div>
|
||||
|
||||
<dv-decoration-10 class="dv-dec-10" :color="color[1]" />
|
||||
@@ -29,11 +24,7 @@
|
||||
<div class="title">
|
||||
<span class="title-text">{{ title }}</span>
|
||||
</div>
|
||||
<dv-decoration-8
|
||||
class="dv-dec-8"
|
||||
:reverse="true"
|
||||
:color="color[2]"
|
||||
/>
|
||||
<dv-decoration-8 class="dv-dec-8" :reverse="true" :color="color[2]" />
|
||||
</div>
|
||||
<dv-decoration-10 class="dv-dec-10-s" :color="color[1]" />
|
||||
</div>
|
||||
@@ -41,10 +32,7 @@
|
||||
<div class="d-flex secondLine">
|
||||
<div class="react-right mr-1">
|
||||
<span class="text fw-b" style="display: flex">
|
||||
<datePicker
|
||||
ref="datePickerRef"
|
||||
@timeChangeInfo="timeChangeInfo"
|
||||
/>
|
||||
<datePicker ref="datePickerRef" @timeChangeInfo="timeChangeInfo" />
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -54,22 +42,29 @@
|
||||
</el-icon>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<!-- <el-dropdown-item @click="handleClick('1')"
|
||||
>已发送短信查询</el-dropdown-item
|
||||
>
|
||||
|
||||
<el-dropdown-item @click="handleClick('2')"
|
||||
<!-- <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('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('7')">
|
||||
短信发送
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click="handleClick('6')">
|
||||
缓存刷新
|
||||
</el-dropdown-item>
|
||||
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
@@ -91,36 +86,22 @@
|
||||
<alarm ref="alarmRef" />
|
||||
<!-- 紧急告警 -->
|
||||
|
||||
<div
|
||||
class="icon"
|
||||
v-if="!(bottomTextRef?.urgentList.length == 0)"
|
||||
:color="color[0][1]"
|
||||
:class="
|
||||
bottomTextRef?.urgentList.length > 0
|
||||
? 'animate-flash-red'
|
||||
: ''
|
||||
"
|
||||
@click="drawerClick"
|
||||
>
|
||||
<div class="icon" v-if="!(bottomTextRef?.urgentList.length == 0)" :color="color[0][1]" :class="bottomTextRef?.urgentList.length > 0
|
||||
? 'animate-flash-red'
|
||||
: ''
|
||||
" @click="drawerClick">
|
||||
<!-- <WarnTriangleFilled /> -->
|
||||
<span
|
||||
class="iconfont icon-gaojing"
|
||||
:style="{
|
||||
color:
|
||||
bottomTextRef?.urgentList.length > 0
|
||||
? '#ff0000'
|
||||
: color[0][1],
|
||||
}"
|
||||
></span>
|
||||
<span
|
||||
class="count"
|
||||
v-if="bottomTextRef?.urgentList.length > 0"
|
||||
>{{
|
||||
bottomTextRef?.urgentList.length > 99
|
||||
? "99+"
|
||||
: bottomTextRef?.urgentList.length
|
||||
}}</span
|
||||
>
|
||||
<span class="iconfont icon-gaojing" :style="{
|
||||
color:
|
||||
bottomTextRef?.urgentList.length > 0
|
||||
? '#ff0000'
|
||||
: color[0][1],
|
||||
}"></span>
|
||||
<span class="count" v-if="bottomTextRef?.urgentList.length > 0">{{
|
||||
bottomTextRef?.urgentList.length > 99
|
||||
? "99+"
|
||||
: bottomTextRef?.urgentList.length
|
||||
}}</span>
|
||||
</div>
|
||||
</dv-border-box-13>
|
||||
</div>
|
||||
@@ -133,10 +114,7 @@
|
||||
<!-- <bottom-left /> -->
|
||||
</dv-border-box-13>
|
||||
<dv-border-box-13 :color="color[0]">
|
||||
<informationTable
|
||||
ref="informationTableRef"
|
||||
@handleCurrentChange="handleCurrentChange"
|
||||
/>
|
||||
<informationTable ref="informationTableRef" @handleCurrentChange="handleCurrentChange" />
|
||||
</dv-border-box-13>
|
||||
<dv-border-box-13 :color="color[0]">
|
||||
<sendTrends ref="sendTrendsRef" />
|
||||
@@ -146,21 +124,16 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<bottomText
|
||||
ref="bottomTextRef"
|
||||
@handleCurrentChange="handleCurrentChange"
|
||||
/>
|
||||
<bottomText ref="bottomTextRef" @handleCurrentChange="handleCurrentChange" />
|
||||
|
||||
<!-- 已发短信查询 -->
|
||||
<smsQueries
|
||||
ref="smsQueriesRef"
|
||||
v-if="smsQueriesFlag"
|
||||
@close="smsQueriesFlag = false"
|
||||
/>
|
||||
<smsQueries ref="smsQueriesRef" v-if="smsQueriesFlag" @close="smsQueriesFlag = false" />
|
||||
|
||||
|
||||
<!-- 系统配置 -->
|
||||
<Config ref="ConfigRef" @flushed="inquire" />
|
||||
|
||||
<!-- 短信发送 -->
|
||||
<Send ref="SendRef" />
|
||||
<!-- 报表导出 -->
|
||||
<ReportForms ref="reportForms" />
|
||||
</div>
|
||||
@@ -196,7 +169,10 @@ import socketClient from "@/utils/webSocketClient";
|
||||
import { useStore } from "vuex";
|
||||
import Config from "./components/config.vue";
|
||||
import ReportForms from "./components/reportForms.vue";
|
||||
import { exportLineData } from "@/api/statistics/index";
|
||||
import Send from "./components/send.vue";
|
||||
import { exportLineData, refreshRedis } from "@/api/statistics/index";
|
||||
import { ElMessage } from "element-plus";
|
||||
|
||||
const store = useStore();
|
||||
const smsQueriesRef = ref(); // 短信查询组件引用
|
||||
const endpointStatisticsRef = ref(); // 终端在线统计组件引用
|
||||
@@ -224,6 +200,7 @@ const timeInfo: any = reactive({
|
||||
});
|
||||
const timeType = ref(3);
|
||||
const reportForms = ref();
|
||||
const SendRef = ref();
|
||||
// 适配处理
|
||||
const { appRef, calcRate, windowDraw, unWindowDraw } = useDraw();
|
||||
// 连接webSocket客户端
|
||||
@@ -292,6 +269,10 @@ const handleClick = (type: string) => {
|
||||
smsQueriesFlag.value = true;
|
||||
|
||||
setTimeout(() => {
|
||||
if (type === "1") {
|
||||
smsQueriesRef.value.open("已发送短信查询");
|
||||
}
|
||||
|
||||
if (type === "3") {
|
||||
ConfigRef.value.open("系统配置");
|
||||
}
|
||||
@@ -312,6 +293,15 @@ const handleClick = (type: string) => {
|
||||
document.body.removeChild(link);
|
||||
});
|
||||
}
|
||||
if (type === "6") {
|
||||
refreshRedis().then((res: any) => {
|
||||
ElMessage.success("刷新缓存成功");
|
||||
});
|
||||
}
|
||||
if (type === "7") {
|
||||
SendRef.value.open("短信发送");
|
||||
}
|
||||
|
||||
}, 100);
|
||||
};
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ export default ({ command, mode }) => {
|
||||
// target: "http://192.168.1.133:18093",
|
||||
//target: "http://192.168.1.62:10215",
|
||||
// target: 'http://192.168.1.127:18093', //cdf
|
||||
target: "http://192.168.1.103:19001", //cdf
|
||||
target: "http://192.168.2.130:18093", //cdf
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
rewrite: (path) => path.replace(/^\/api/, ""),
|
||||
|
||||
Reference in New Issue
Block a user