Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
295cfc6ec1 | ||
|
|
37eef06a3b | ||
|
|
5c766684f9 | ||
| 5180dfaf60 | |||
|
|
6a1a7eb218 | ||
|
|
80ed66a2b0 | ||
|
|
7d86bbb6c2 | ||
|
|
2631f43623 |
@@ -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({
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ service.interceptors.response.use(
|
||||
});
|
||||
}
|
||||
} else {
|
||||
return Promise.reject(res.data);
|
||||
return Promise.reject(res.data||res.data.message);
|
||||
}
|
||||
},
|
||||
(error) => {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<span>监测点</span>
|
||||
</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
|
||||
@@ -344,6 +344,7 @@ onMounted(() => {
|
||||
|
||||
defineExpose({
|
||||
setIcon,
|
||||
init
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -967,7 +967,7 @@ const initialResponsibilityList = () => {
|
||||
// 根据实际字段进行拼接,示例:
|
||||
const content = `${item.lineName || ""}进行${
|
||||
item.dataTimes || ""
|
||||
}次谐波电压溯源,溯源对象:${item.userDataName || ""}`.trim();
|
||||
}次谐波电压溯源,溯源对象:${item.userDataName || "系统测点"}`.trim();
|
||||
return {
|
||||
...item,
|
||||
content: content,
|
||||
|
||||
@@ -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>
|
||||
@@ -132,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"
|
||||
@@ -155,13 +155,14 @@
|
||||
v-model="ruleForm.substionIds"
|
||||
placeholder="请选择"
|
||||
multiple
|
||||
:teleported="false"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dataList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
:disabled="item.bindFlag==true"
|
||||
:disabled="item.bindFlag == true && !setDisabled?.includes(item.id)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -214,6 +215,7 @@ import { useStore } from "vuex";
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: "project-change", project: { id: string; name: string }): void;
|
||||
(e: "station-map-updated"): void;
|
||||
}>();
|
||||
|
||||
const store = useStore();
|
||||
@@ -236,6 +238,8 @@ const firstForm = ref({
|
||||
|
||||
const dataList = ref([]); //变电站
|
||||
|
||||
const setDisabled = ref([]);
|
||||
|
||||
const params = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
@@ -247,7 +251,7 @@ interface RuleForm {
|
||||
projectIds: [];
|
||||
orderBy: string;
|
||||
remark: string;
|
||||
substionIds:[];
|
||||
substionIds: [];
|
||||
}
|
||||
|
||||
const formSize = ref("default");
|
||||
@@ -257,7 +261,7 @@ const ruleForm = reactive<RuleForm>({
|
||||
projectIds: [],
|
||||
orderBy: "100",
|
||||
remark: "",
|
||||
substionIds:[],
|
||||
substionIds: [],
|
||||
});
|
||||
|
||||
const rules = reactive<FormRules<RuleForm>>({
|
||||
@@ -278,6 +282,10 @@ const rules = reactive<FormRules<RuleForm>>({
|
||||
],
|
||||
});
|
||||
|
||||
const handleDialogClose = () => {
|
||||
emit('station-map-updated');
|
||||
};
|
||||
|
||||
const init = () => {
|
||||
stationMap({
|
||||
deptId: store.state.deptId,
|
||||
@@ -343,6 +351,8 @@ const onReset = () => {
|
||||
const onSubmitadd = () => {
|
||||
innerVisible.value = true;
|
||||
dialogTitle.value = "新增项目";
|
||||
init();
|
||||
setDisabled.value = [];
|
||||
// Object.assign(ruleForm, {}); 不生效
|
||||
Object.assign(ruleForm, {
|
||||
//生效,但是一个个赋值,麻烦
|
||||
@@ -351,7 +361,7 @@ const onSubmitadd = () => {
|
||||
orderBy: "100",
|
||||
projectIds: ["1dd1b076e104f15459ac401fc1b902c4"],
|
||||
remark: "",
|
||||
substionIds:[],
|
||||
substionIds: [],
|
||||
});
|
||||
//Object.keys(ruleForm).forEach((key) => delete ruleForm[key]); //生效,但是有默认值的,一进去会直接报校验
|
||||
};
|
||||
@@ -362,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,
|
||||
@@ -369,7 +381,7 @@ const editd = (row: any) => {
|
||||
orderBy: row.orderBy,
|
||||
projectIds: row.projectIds,
|
||||
remark: row.remark,
|
||||
substionIds:row.substionIds,
|
||||
substionIds: row.substionIds,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -382,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);
|
||||
@@ -421,6 +435,7 @@ const getEdit = async () => {
|
||||
|
||||
const resetForm = () => {
|
||||
innerVisible.value = false;
|
||||
emit('station-map-updated')
|
||||
};
|
||||
|
||||
const onTableSizeChange = (size: number) => {
|
||||
@@ -537,7 +552,6 @@ const activeItem = (item: any) => {
|
||||
|
||||
const open = () => {
|
||||
dialogVisible.value = true;
|
||||
init();
|
||||
};
|
||||
defineExpose({
|
||||
open,
|
||||
|
||||
@@ -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>
|
||||
|
||||
<!-- 添加加载事件监听 -->
|
||||
@@ -19,7 +20,12 @@
|
||||
: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>
|
||||
@@ -35,6 +41,8 @@ const props = defineProps<{
|
||||
project: { id: string; name: string } | null;
|
||||
}>();
|
||||
|
||||
const bdMapRef = ref(null)
|
||||
|
||||
const iframeSrc = ref("");
|
||||
const keyof = ref(0);
|
||||
// 监听 props 变化
|
||||
@@ -140,6 +148,18 @@ const backButton = () => {
|
||||
|
||||
// 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,
|
||||
// },
|
||||
|
||||
@@ -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="持续时间告警阈值">
|
||||
|
||||
@@ -63,7 +63,12 @@
|
||||
</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
|
||||
type="primary"
|
||||
:icon="Check"
|
||||
@click="save"
|
||||
size="small"
|
||||
:loading="loading"
|
||||
>确定</el-button
|
||||
>
|
||||
</template>
|
||||
@@ -81,6 +86,7 @@ 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);
|
||||
@@ -157,22 +163,27 @@ const save = () => {
|
||||
(form.value.searchBeginTime = timeValue.value[0]),
|
||||
(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",
|
||||
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