Compare commits
10 Commits
859d890434
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 5180dfaf60 | |||
|
|
6a1a7eb218 | ||
|
|
80ed66a2b0 | ||
|
|
7d86bbb6c2 | ||
|
|
2631f43623 | ||
|
|
b396686b61 | ||
|
|
1a0a42c5a5 | ||
|
|
980d5a22b3 | ||
|
|
0ffc0cd01e | ||
|
|
079263ed38 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -11,6 +11,8 @@ node_modules
|
|||||||
dist
|
dist
|
||||||
|
|
||||||
offline
|
offline
|
||||||
|
# tiles
|
||||||
|
# tiles1
|
||||||
dist-ssr
|
dist-ssr
|
||||||
*.local
|
*.local
|
||||||
# Editor directories and files
|
# Editor directories and files
|
||||||
|
|||||||
@@ -90,6 +90,15 @@ export function msgHandle(data: object) {
|
|||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//刷新redis缓存
|
||||||
|
export function refreshRedis() {
|
||||||
|
return service({
|
||||||
|
url: "/accept/refreshIdCache",
|
||||||
|
method: "get",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// 地图统计数量
|
// 地图统计数量
|
||||||
export function mapCount(data: object) {
|
export function mapCount(data: object) {
|
||||||
return service({
|
return service({
|
||||||
@@ -303,3 +312,12 @@ export function exportLineData() {
|
|||||||
responseType: "blob",
|
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 |
@@ -58,11 +58,13 @@ const emit = defineEmits(["timeChangeInfo"]);
|
|||||||
interface Props {
|
interface Props {
|
||||||
nextFlag?: boolean;
|
nextFlag?: boolean;
|
||||||
theCurrentTime?: boolean;
|
theCurrentTime?: boolean;
|
||||||
|
setWatch?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
nextFlag: false,
|
nextFlag: false,
|
||||||
theCurrentTime: true,
|
theCurrentTime: true,
|
||||||
|
setWatch: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
const interval = ref(3);
|
const interval = ref(3);
|
||||||
@@ -573,8 +575,10 @@ function formatDate(date: Date): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
watch(timeValue, async (newVal) => {
|
watch(timeValue, async (newVal) => {
|
||||||
|
if (props.setWatch) {
|
||||||
await store.dispatch("setTimeType", { type: interval, value: newVal });
|
await store.dispatch("setTimeType", { type: interval, value: newVal });
|
||||||
await emit("timeChangeInfo");
|
await emit("timeChangeInfo");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ export default createStore({
|
|||||||
state.count++;
|
state.count++;
|
||||||
},
|
},
|
||||||
[Mutations.SET_STATE](state: State, data: any) {
|
[Mutations.SET_STATE](state: State, data: any) {
|
||||||
console.log("🚀 ~ data:", data)
|
|
||||||
state[data.key] = data.value;
|
state[data.key] = data.value;
|
||||||
},
|
},
|
||||||
[Mutations.SET_TOKEN](state: State, data: any) {
|
[Mutations.SET_TOKEN](state: State, data: any) {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import store from "@/store/index";
|
|||||||
|
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
baseURL: "/api",
|
baseURL: "/api",
|
||||||
timeout: 60 * 1000,
|
timeout: 60 * 1000 * 3,
|
||||||
headers: { "Content-Type": "application/json;charset=utf-8" },
|
headers: { "Content-Type": "application/json;charset=utf-8" },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class HttpRequest {
|
|||||||
getInsideConfig() {
|
getInsideConfig() {
|
||||||
const config = {
|
const config = {
|
||||||
baseURL: this.baseUrl, // 所有的请求地址前缀部分(没有后端请求不用写)
|
baseURL: this.baseUrl, // 所有的请求地址前缀部分(没有后端请求不用写)
|
||||||
timeout: 80000, // 请求超时时间(毫秒)
|
timeout: 60 * 1000 * 3, // 请求超时时间(毫秒)
|
||||||
};
|
};
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,16 +2,16 @@
|
|||||||
<div v-loading="loading" element-loading-background="#343849c7">
|
<div v-loading="loading" element-loading-background="#343849c7">
|
||||||
<div class="iconBox">
|
<div class="iconBox">
|
||||||
<div class="div">
|
<div class="div">
|
||||||
<img src="@/assets/jcd.png" alt="" />
|
<img src="@/assets/bdz.png" alt="" />
|
||||||
<span>变电站</span>
|
<span>变电站</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="div">
|
<!-- <div class="div">
|
||||||
<img src="@/assets/img/txzcwzj.png" alt="" />
|
<img src="@/assets/img/txzcwzj.png" alt="" />
|
||||||
<span>监测点</span>
|
<span>监测点</span>
|
||||||
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<!-- <div class="bmSelect">
|
||||||
<div class="bmSelect">
|
|
||||||
<el-select
|
<el-select
|
||||||
v-model="value"
|
v-model="value"
|
||||||
@change="setIcon"
|
@change="setIcon"
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
:value="item.stationName"
|
:value="item.stationName"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<baidu-map
|
<baidu-map
|
||||||
@@ -45,26 +45,26 @@
|
|||||||
:double-click-zoom="false"
|
:double-click-zoom="false"
|
||||||
>
|
>
|
||||||
<!-- 线-->
|
<!-- 线-->
|
||||||
<div v-if="zoom > 13">
|
<!-- <div v-if="zoom > 13">
|
||||||
<bm-polyline
|
<bm-polyline
|
||||||
:path="path"
|
:path="path"
|
||||||
v-for="(path, index) in polyline"
|
v-for="(path, index) in polyline"
|
||||||
:key="index"
|
:key="index"
|
||||||
></bm-polyline>
|
></bm-polyline>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
<!-- 变电站-->
|
<!-- 变电站-->
|
||||||
<template v-if="zoom > 13">
|
<template>
|
||||||
<bm-marker
|
<bm-marker
|
||||||
:position="path"
|
:position="path"
|
||||||
v-for="path in siteList"
|
v-for="path in siteList"
|
||||||
:key="path.subId"
|
:key="path.subId"
|
||||||
:icon="path.icon"
|
:icon="path.icon"
|
||||||
@click="markerClick(path)"
|
@click="pointClick(path)"
|
||||||
></bm-marker>
|
></bm-marker>
|
||||||
</template>
|
</template>
|
||||||
<!-- 点 -->
|
<!-- 点 -->
|
||||||
<div maxZoom="12">
|
<!-- <div maxZoom="12">
|
||||||
<bm-marker
|
<bm-marker
|
||||||
:position="path"
|
:position="path"
|
||||||
v-for="path in areaLineInfo"
|
v-for="path in areaLineInfo"
|
||||||
@@ -72,7 +72,7 @@
|
|||||||
:icon="path.icon"
|
:icon="path.icon"
|
||||||
@click="pointClick(path)"
|
@click="pointClick(path)"
|
||||||
></bm-marker>
|
></bm-marker>
|
||||||
</div>
|
</div> -->
|
||||||
<bm-marker
|
<bm-marker
|
||||||
:position="infoWindowPoint"
|
:position="infoWindowPoint"
|
||||||
:icon="{ url: '1', size: { width: 0, height: 0 } }"
|
:icon="{ url: '1', size: { width: 0, height: 0 } }"
|
||||||
@@ -89,7 +89,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, nextTick, onMounted } from "vue";
|
import { ref, reactive, nextTick, onMounted } from "vue";
|
||||||
import { substationCount } from "@/api/statistics/index";
|
import { stationMap } from "@/api/statistics/index";
|
||||||
import { useStore } from "vuex";
|
import { useStore } from "vuex";
|
||||||
// import { BmlMarkerClusterer } from "vue-baidu-map-3x";
|
// import { BmlMarkerClusterer } from "vue-baidu-map-3x";
|
||||||
const emit = defineEmits(["pointClick"]);
|
const emit = defineEmits(["pointClick"]);
|
||||||
@@ -129,7 +129,7 @@ const handler = async ({ BMap, map }: any) => {
|
|||||||
const markerClick = (e: any) => {
|
const markerClick = (e: any) => {
|
||||||
zoom.value = 15;
|
zoom.value = 15;
|
||||||
infoWindowPoint.value = e;
|
infoWindowPoint.value = e;
|
||||||
infoWindowPoint.value.show = true;
|
// infoWindowPoint.value.show = true;
|
||||||
center.value.lng = 120.124367;
|
center.value.lng = 120.124367;
|
||||||
center.value.lat = 31.555421;
|
center.value.lat = 31.555421;
|
||||||
|
|
||||||
@@ -150,87 +150,87 @@ const init = () => {
|
|||||||
polyline.value = [];
|
polyline.value = [];
|
||||||
dataList.value = [];
|
dataList.value = [];
|
||||||
areaLineInfo.value = [];
|
areaLineInfo.value = [];
|
||||||
// substationCount({
|
stationMap({
|
||||||
// deptId: store.state.deptId,
|
deptId: store.state.deptId,
|
||||||
// type: store.state.timeType,
|
type: store.state.timeType,
|
||||||
// startTime: store.state.timeValue[0],
|
startTime: store.state.timeValue[0],
|
||||||
// endTime: store.state.timeValue[1],
|
endTime: store.state.timeValue[1],
|
||||||
// }).then((res: any) => {
|
}).then((res: any) => {
|
||||||
// dataList.value = res.data;
|
dataList.value = res.data;
|
||||||
dataList.value = [
|
// dataList.value = [
|
||||||
{
|
// {
|
||||||
stationId: 156,
|
// stationId: 156,
|
||||||
stationName: "110kV北京电视台变",
|
// stationName: "110kV北京电视台变",
|
||||||
gdName: "检修分公司",
|
// gdName: "检修分公司",
|
||||||
longitude: 120.33,
|
// longitude: 120.33,
|
||||||
latitude: 31.52,
|
// latitude: 31.52,
|
||||||
lineCount: 1,
|
// lineCount: 1,
|
||||||
eventCount: 1,
|
// eventCount: 1,
|
||||||
lineEventDetails: [
|
// lineEventDetails: [
|
||||||
{
|
// // {
|
||||||
gdName: "检修分公司",
|
// // gdName: "检修分公司",
|
||||||
pictureId: "5debb8bd0ce26527675eedffd74a3198",
|
// // pictureId: "5debb8bd0ce26527675eedffd74a3198",
|
||||||
pictureName: "无锡线上",
|
// // pictureName: "无锡线上",
|
||||||
},
|
// // },
|
||||||
{
|
// {
|
||||||
gdName: "检修分公司",
|
// gdName: "检修分公司",
|
||||||
pictureId: "35b1301833e3fdfc872b1a27a17c7245",
|
// pictureId: "35b1301833e3fdfc872b1a27a17c7245",
|
||||||
pictureName: "无锡修改1011--工程部",
|
// pictureName: "无锡修改1011--工程部",
|
||||||
},
|
// },
|
||||||
],
|
// ],
|
||||||
},
|
// },
|
||||||
];
|
// ];
|
||||||
let data = dataList.value;
|
let data = dataList.value;
|
||||||
let r = 0.0035;
|
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) => {
|
list.forEach((item: any) => {
|
||||||
// 变电站图标
|
// 变电站图标
|
||||||
item.icon = {
|
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: {
|
size: {
|
||||||
width: 40,
|
width: 40,
|
||||||
height: 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([
|
// polyline.value.push([
|
||||||
{
|
// {
|
||||||
lng: item.lng,
|
// lng: item.lng,
|
||||||
lat: item.lat,
|
// lat: item.lat,
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
lng: val.lng,
|
// lng: val.lng,
|
||||||
lat: val.lat,
|
// lat: val.lat,
|
||||||
},
|
// },
|
||||||
]);
|
// ]);
|
||||||
});
|
// });
|
||||||
|
|
||||||
areaLineInfo.value.push(...item.lineEventDetails);
|
// areaLineInfo.value.push(...item.lineEventDetails);
|
||||||
});
|
});
|
||||||
|
|
||||||
siteList.value = list;
|
siteList.value = list;
|
||||||
@@ -239,7 +239,7 @@ const init = () => {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}, 0);
|
}, 0);
|
||||||
// });
|
});
|
||||||
};
|
};
|
||||||
const moveenFlag = ref(true);
|
const moveenFlag = ref(true);
|
||||||
|
|
||||||
@@ -268,11 +268,11 @@ const checkMapData = () => {
|
|||||||
console.warn("当前区域无离线地图数据,将返回默认位置");
|
console.warn("当前区域无离线地图数据,将返回默认位置");
|
||||||
|
|
||||||
// 使用正确的BMap.Point创建方式
|
// 使用正确的BMap.Point创建方式
|
||||||
const point = new BMapInstance.value.Point(116.404367, 39.915421);
|
const point = new BMapInstance.value.Point(120.124367,31.555421);
|
||||||
|
|
||||||
// 平滑移动并设置合适缩放级别
|
// 平滑移动并设置合适缩放级别
|
||||||
mapInstance.value.panTo(point);
|
mapInstance.value.panTo(point);
|
||||||
mapInstance.value.setZoom(12);
|
mapInstance.value.setZoom(11);
|
||||||
// zoom.value = 12;
|
// zoom.value = 12;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -344,6 +344,7 @@ onMounted(() => {
|
|||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
setIcon,
|
setIcon,
|
||||||
|
init
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@@ -362,9 +363,9 @@ defineExpose({
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 10px;
|
bottom: 10px;
|
||||||
left: 10px;
|
left: 10px;
|
||||||
z-index: 2000;
|
z-index: 1;
|
||||||
width: 110px;
|
width: 110px;
|
||||||
height: 70px;
|
height: 40px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
background: #ffffff10 !important;
|
background: #ffffff10 !important;
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
|
|||||||
@@ -494,8 +494,8 @@ const generateFn = async () => {
|
|||||||
loading1.value = true;
|
loading1.value = true;
|
||||||
await getDynamicData({
|
await getDynamicData({
|
||||||
lineId: dotList.value.id,
|
lineId: dotList.value.id,
|
||||||
searchBeginTime: tabList.value[activeName.value].time[0],
|
searchBeginTime: time.value[0],
|
||||||
searchEndTime: tabList.value[activeName.value].time[1],
|
searchEndTime: time.value[1],
|
||||||
time: tabList.value[activeName.value].key,
|
time: tabList.value[activeName.value].key,
|
||||||
type: form.type,
|
type: form.type,
|
||||||
userDataId: form.loadDataId,
|
userDataId: form.loadDataId,
|
||||||
|
|||||||
@@ -623,6 +623,7 @@ watch(flag, (newVal) => {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (flag.value == 0) {
|
if (flag.value == 0) {
|
||||||
initHasEventList();
|
initHasEventList();
|
||||||
|
|
||||||
// flag 变化后重新绑定事件
|
// flag 变化后重新绑定事件
|
||||||
bindRankingClickEvent();
|
bindRankingClickEvent();
|
||||||
}
|
}
|
||||||
@@ -635,6 +636,29 @@ watch(flag, (newVal) => {
|
|||||||
}
|
}
|
||||||
}, 100);
|
}, 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 = () => {
|
const initialData = () => {
|
||||||
@@ -688,11 +712,9 @@ const initialAggregation = () => {
|
|||||||
tableData.splice(0, tableData.length);
|
tableData.splice(0, tableData.length);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
const interval = ref(null);
|
||||||
// 提取发送消息到iframe的公共方法
|
// 提取发送消息到iframe的公共方法
|
||||||
const sendMessageToIframe = (type: string, payload: any) => {
|
const sendMessageToIframe = (type: string, payload: any) => {
|
||||||
// console.log(123,store.state.iframeLoad);
|
|
||||||
|
|
||||||
// window.parent.postMessage(
|
// window.parent.postMessage(
|
||||||
// {
|
// {
|
||||||
// type,
|
// type,
|
||||||
@@ -701,6 +723,10 @@ const sendMessageToIframe = (type: string, payload: any) => {
|
|||||||
// "*"
|
// "*"
|
||||||
// );
|
// );
|
||||||
// 如果 iframe 已加载完成,直接发送消息
|
// 如果 iframe 已加载完成,直接发送消息
|
||||||
|
if (store.state.showMap) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (store.state.iframeLoad) {
|
if (store.state.iframeLoad) {
|
||||||
window.parent.postMessage(
|
window.parent.postMessage(
|
||||||
{
|
{
|
||||||
@@ -711,9 +737,13 @@ const sendMessageToIframe = (type: string, payload: any) => {
|
|||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (interval.value) {
|
||||||
|
clearInterval(interval.value);
|
||||||
|
interval.value = null;
|
||||||
|
}
|
||||||
|
|
||||||
// 如果未加载完成,每 1 秒尝试发送一次
|
// 如果未加载完成,每 1 秒尝试发送一次
|
||||||
const interval = setInterval(() => {
|
interval.value = setInterval(() => {
|
||||||
console.log("等待 iframe 加载,1 秒后重试...");
|
console.log("等待 iframe 加载,1 秒后重试...");
|
||||||
if (store.state.iframeLoad) {
|
if (store.state.iframeLoad) {
|
||||||
// 加载完成后发送消息并清除定时器
|
// 加载完成后发送消息并清除定时器
|
||||||
@@ -724,7 +754,7 @@ const sendMessageToIframe = (type: string, payload: any) => {
|
|||||||
},
|
},
|
||||||
"*" // 建议替换为具体域名
|
"*" // 建议替换为具体域名
|
||||||
);
|
);
|
||||||
clearInterval(interval);
|
clearInterval(interval.value);
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
};
|
};
|
||||||
@@ -937,7 +967,7 @@ const initialResponsibilityList = () => {
|
|||||||
// 根据实际字段进行拼接,示例:
|
// 根据实际字段进行拼接,示例:
|
||||||
const content = `${item.lineName || ""}进行${
|
const content = `${item.lineName || ""}进行${
|
||||||
item.dataTimes || ""
|
item.dataTimes || ""
|
||||||
}次谐波电压溯源,溯源对象:${item.userDataName || ""}`.trim();
|
}次谐波电压溯源,溯源对象:${item.userDataName || "系统测点"}`.trim();
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
content: content,
|
content: content,
|
||||||
@@ -1267,7 +1297,7 @@ const handleChildClose = () => {
|
|||||||
const init = () => {
|
const init = () => {
|
||||||
initialData();
|
initialData();
|
||||||
initialAggregation();
|
initialAggregation();
|
||||||
initHasEventList();
|
// initHasEventList();
|
||||||
initialResponsibilityList();
|
initialResponsibilityList();
|
||||||
// getInfoListAmplify();
|
// getInfoListAmplify();
|
||||||
tableInfoAmplify();
|
tableInfoAmplify();
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
v-model="form.userList"
|
v-model="form.userList"
|
||||||
:data="dataTree"
|
:data="dataTree"
|
||||||
multiple
|
multiple
|
||||||
|
|
||||||
filterable
|
filterable
|
||||||
show-checkbox
|
show-checkbox
|
||||||
ref="treeRef"
|
ref="treeRef"
|
||||||
@@ -46,6 +47,7 @@
|
|||||||
v-model="form.index"
|
v-model="form.index"
|
||||||
filterable
|
filterable
|
||||||
multiple
|
multiple
|
||||||
|
|
||||||
:multiple-limit="5"
|
:multiple-limit="5"
|
||||||
collapse-tags
|
collapse-tags
|
||||||
collapse-tags-tooltip
|
collapse-tags-tooltip
|
||||||
@@ -553,11 +555,13 @@ const generateFn = async () => {
|
|||||||
return ElMessage.warning("请选择用采用户");
|
return ElMessage.warning("请选择用采用户");
|
||||||
}
|
}
|
||||||
loading1.value = true;
|
loading1.value = true;
|
||||||
|
console.log("🚀 ~ generateFn ~ dotList.value:", dotList.value.id, tabList.value);
|
||||||
|
|
||||||
await getDynamicData({
|
await getDynamicData({
|
||||||
userDataId: "123",
|
userDataId: "123",
|
||||||
lineId: dotList.value.id,
|
lineId: dotList.value.id,
|
||||||
searchBeginTime: tabList.value[activeName.value].time[0],
|
searchBeginTime: time.value[0],
|
||||||
searchEndTime: tabList.value[activeName.value].time[1],
|
searchEndTime: time.value[1],
|
||||||
time: tabList.value[activeName.value].key,
|
time: tabList.value[activeName.value].key,
|
||||||
type: form.type,
|
type: form.type,
|
||||||
userList: form.userList,
|
userList: form.userList,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 项目管理弹框 -->
|
<!-- 项目管理弹框 -->
|
||||||
<el-dialog v-model="dialogVisible" title="项目管理" width="1600px">
|
<el-dialog v-model="dialogVisible" title="项目管理" width="1600px" @close="handleDialogClose">
|
||||||
<!-- <el-card class="transparent-card"> -->
|
<!-- <el-card class="transparent-card"> -->
|
||||||
<div style="display: flex; justify-content: space-between">
|
<div style="display: flex; justify-content: space-between">
|
||||||
<div>
|
<div>
|
||||||
@@ -65,22 +65,9 @@
|
|||||||
<Edit @click="editd(item)" />
|
<Edit @click="editd(item)" />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
</el-tooltip>
|
</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>
|
</span>
|
||||||
<div style="display: flex; justify-content: end">
|
<div style="display: flex; justify-content: end">
|
||||||
<el-button
|
<!-- <el-button
|
||||||
v-if="item.active == 0"
|
v-if="item.active == 0"
|
||||||
class="color"
|
class="color"
|
||||||
:icon="Compass"
|
:icon="Compass"
|
||||||
@@ -95,7 +82,7 @@
|
|||||||
style="padding: 3px 0; color: #82bd51"
|
style="padding: 3px 0; color: #82bd51"
|
||||||
type="text"
|
type="text"
|
||||||
>已激活</el-button
|
>已激活</el-button
|
||||||
>
|
> -->
|
||||||
<el-button
|
<el-button
|
||||||
class="color"
|
class="color"
|
||||||
:icon="Share"
|
:icon="Share"
|
||||||
@@ -163,17 +150,22 @@
|
|||||||
placeholder="请输入项目名称"
|
placeholder="请输入项目名称"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item label="工程项目" prop="projectIds">
|
<el-form-item label="变电站名称">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="ruleForm.projectIds"
|
v-model="ruleForm.substionIds"
|
||||||
placeholder="请选择"
|
placeholder="请选择"
|
||||||
:popper-append-to-body="false"
|
multiple
|
||||||
popper-class="custom-select-dropdown"
|
:teleported="false"
|
||||||
>
|
>
|
||||||
<el-option label="Zone one111" value="shanghai" />
|
<el-option
|
||||||
<el-option label="Zone two" value="beijing" />
|
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-select>
|
||||||
</el-form-item> -->
|
</el-form-item>
|
||||||
<el-form-item label="项目排序" prop="orderBy">
|
<el-form-item label="项目排序" prop="orderBy">
|
||||||
<el-input v-model="ruleForm.orderBy" placeholder="请输入" />
|
<el-input v-model="ruleForm.orderBy" placeholder="请输入" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -218,11 +210,15 @@ import {
|
|||||||
active,
|
active,
|
||||||
getActive,
|
getActive,
|
||||||
} from "@/api/manage_wx/index";
|
} from "@/api/manage_wx/index";
|
||||||
|
import { stationMap } from "@/api/statistics/index";
|
||||||
|
import { useStore } from "vuex";
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: "project-change", project: { id: string; name: string }): void;
|
(e: "project-change", project: { id: string; name: string }): void;
|
||||||
|
(e: "station-map-updated"): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
|
const store = useStore();
|
||||||
const projectData = ref([]);
|
const projectData = ref([]);
|
||||||
|
|
||||||
// 系统配置弹框
|
// 系统配置弹框
|
||||||
@@ -240,6 +236,10 @@ const firstForm = ref({
|
|||||||
id: "",
|
id: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const dataList = ref([]); //变电站
|
||||||
|
|
||||||
|
const setDisabled = ref([]);
|
||||||
|
|
||||||
const params = reactive({
|
const params = reactive({
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
@@ -251,6 +251,7 @@ interface RuleForm {
|
|||||||
projectIds: [];
|
projectIds: [];
|
||||||
orderBy: string;
|
orderBy: string;
|
||||||
remark: string;
|
remark: string;
|
||||||
|
substionIds: [];
|
||||||
}
|
}
|
||||||
|
|
||||||
const formSize = ref("default");
|
const formSize = ref("default");
|
||||||
@@ -260,17 +261,18 @@ const ruleForm = reactive<RuleForm>({
|
|||||||
projectIds: [],
|
projectIds: [],
|
||||||
orderBy: "100",
|
orderBy: "100",
|
||||||
remark: "",
|
remark: "",
|
||||||
|
substionIds: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
const rules = reactive<FormRules<RuleForm>>({
|
const rules = reactive<FormRules<RuleForm>>({
|
||||||
name: [{ required: true, message: "请输入项目名称", trigger: "blur" }],
|
name: [{ required: true, message: "请输入项目名称", trigger: "blur" }],
|
||||||
projectIds: [
|
// projectIds: [
|
||||||
{
|
// {
|
||||||
required: true,
|
// required: true,
|
||||||
message: "请选择",
|
// message: "请选择",
|
||||||
trigger: "change",
|
// trigger: "change",
|
||||||
},
|
// },
|
||||||
],
|
// ],
|
||||||
orderBy: [
|
orderBy: [
|
||||||
{
|
{
|
||||||
required: true,
|
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(() => {
|
onMounted(() => {
|
||||||
fetachData();
|
fetachData();
|
||||||
});
|
});
|
||||||
@@ -334,6 +351,8 @@ const onReset = () => {
|
|||||||
const onSubmitadd = () => {
|
const onSubmitadd = () => {
|
||||||
innerVisible.value = true;
|
innerVisible.value = true;
|
||||||
dialogTitle.value = "新增项目";
|
dialogTitle.value = "新增项目";
|
||||||
|
init();
|
||||||
|
setDisabled.value = [];
|
||||||
// Object.assign(ruleForm, {}); 不生效
|
// Object.assign(ruleForm, {}); 不生效
|
||||||
Object.assign(ruleForm, {
|
Object.assign(ruleForm, {
|
||||||
//生效,但是一个个赋值,麻烦
|
//生效,但是一个个赋值,麻烦
|
||||||
@@ -342,6 +361,7 @@ const onSubmitadd = () => {
|
|||||||
orderBy: "100",
|
orderBy: "100",
|
||||||
projectIds: ["1dd1b076e104f15459ac401fc1b902c4"],
|
projectIds: ["1dd1b076e104f15459ac401fc1b902c4"],
|
||||||
remark: "",
|
remark: "",
|
||||||
|
substionIds: [],
|
||||||
});
|
});
|
||||||
//Object.keys(ruleForm).forEach((key) => delete ruleForm[key]); //生效,但是有默认值的,一进去会直接报校验
|
//Object.keys(ruleForm).forEach((key) => delete ruleForm[key]); //生效,但是有默认值的,一进去会直接报校验
|
||||||
};
|
};
|
||||||
@@ -352,6 +372,8 @@ const querdata = (e: any) => {};
|
|||||||
const editd = (row: any) => {
|
const editd = (row: any) => {
|
||||||
innerVisible.value = true;
|
innerVisible.value = true;
|
||||||
dialogTitle.value = "修改项目";
|
dialogTitle.value = "修改项目";
|
||||||
|
init();
|
||||||
|
setDisabled.value = JSON.parse(JSON.stringify(row.substionIds));
|
||||||
// Object.assign(ruleForm, row);
|
// Object.assign(ruleForm, row);
|
||||||
Object.assign(ruleForm, {
|
Object.assign(ruleForm, {
|
||||||
id: row.id,
|
id: row.id,
|
||||||
@@ -359,6 +381,7 @@ const editd = (row: any) => {
|
|||||||
orderBy: row.orderBy,
|
orderBy: row.orderBy,
|
||||||
projectIds: row.projectIds,
|
projectIds: row.projectIds,
|
||||||
remark: row.remark,
|
remark: row.remark,
|
||||||
|
substionIds: row.substionIds,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -371,6 +394,8 @@ const submitForm = async (formEl: FormInstance | undefined) => {
|
|||||||
} else {
|
} else {
|
||||||
getEdit();
|
getEdit();
|
||||||
}
|
}
|
||||||
|
init();
|
||||||
|
emit('station-map-updated');
|
||||||
console.log("submit!");
|
console.log("submit!");
|
||||||
} else {
|
} else {
|
||||||
console.log("error submit!", fields);
|
console.log("error submit!", fields);
|
||||||
@@ -410,6 +435,7 @@ const getEdit = async () => {
|
|||||||
|
|
||||||
const resetForm = () => {
|
const resetForm = () => {
|
||||||
innerVisible.value = false;
|
innerVisible.value = false;
|
||||||
|
emit('station-map-updated')
|
||||||
};
|
};
|
||||||
|
|
||||||
const onTableSizeChange = (size: number) => {
|
const onTableSizeChange = (size: number) => {
|
||||||
|
|||||||
@@ -422,7 +422,13 @@
|
|||||||
align="center"
|
align="center"
|
||||||
label="责任对象"
|
label="责任对象"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
/>
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{
|
||||||
|
scope.row.userDataName==null? '系统测点':scope.row.userDataName
|
||||||
|
}}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="updateTime"
|
prop="updateTime"
|
||||||
align="center"
|
align="center"
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
width="100%"
|
width="100%"
|
||||||
height="100%"
|
height="100%"
|
||||||
@pointClick="pointClick"
|
@pointClick="pointClick"
|
||||||
|
ref="bdMapRef"
|
||||||
></bdMap>
|
></bdMap>
|
||||||
|
|
||||||
<!-- 添加加载事件监听 -->
|
<!-- 添加加载事件监听 -->
|
||||||
@@ -16,9 +17,15 @@
|
|||||||
frameborder="0"
|
frameborder="0"
|
||||||
scrolling="no"
|
scrolling="no"
|
||||||
id="iframeLeft"
|
id="iframeLeft"
|
||||||
|
:key="keyof"
|
||||||
@load="onIframeLoad"
|
@load="onIframeLoad"
|
||||||
></iframe>
|
></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
|
>返回</el-button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
@@ -34,8 +41,10 @@ const props = defineProps<{
|
|||||||
project: { id: string; name: string } | null;
|
project: { id: string; name: string } | null;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const iframeSrc = ref("");
|
const bdMapRef = ref(null)
|
||||||
|
|
||||||
|
const iframeSrc = ref("");
|
||||||
|
const keyof = ref(0);
|
||||||
// 监听 props 变化
|
// 监听 props 变化
|
||||||
watch(
|
watch(
|
||||||
() => props.project,
|
() => props.project,
|
||||||
@@ -56,7 +65,8 @@ watch(
|
|||||||
);
|
);
|
||||||
// 点击监测点传入 接线图id
|
// 点击监测点传入 接线图id
|
||||||
const pointClick = (row: any) => {
|
const pointClick = (row: any) => {
|
||||||
setUrl(row.pictureId, row.pictureName);
|
setUrl(row.configId, row.configName);
|
||||||
|
keyof.value += 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
@@ -71,8 +81,8 @@ onMounted(() => {
|
|||||||
});
|
});
|
||||||
const setUrl = (url: string, nam: string) => {
|
const setUrl = (url: string, nam: string) => {
|
||||||
iframeSrc.value =
|
iframeSrc.value =
|
||||||
// window.location.origin +
|
window.location.origin +
|
||||||
"http://192.168.1.179:4001" +
|
// "http://192.168.1.179:4001" +
|
||||||
`/zutai/?id=${url}&&name=${encodeURIComponent(
|
`/zutai/?id=${url}&&name=${encodeURIComponent(
|
||||||
nam
|
nam
|
||||||
)}&&preview=true&&display=true&&graphicDisplay=wx#/preview`;
|
)}&&preview=true&&display=true&&graphicDisplay=wx#/preview`;
|
||||||
@@ -133,9 +143,23 @@ const sendKeysToIframe = (keyList: string[]) => {
|
|||||||
};
|
};
|
||||||
// 返回地图
|
// 返回地图
|
||||||
const backButton = () => {
|
const backButton = () => {
|
||||||
window.removeEventListener("message", handleMessage);
|
store.dispatch("setStateKey", { key: "iframeLoad", value: false });
|
||||||
store.dispatch("setStateKey", { key: "showMap", value: true });
|
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>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.plan {
|
.plan {
|
||||||
|
|||||||
@@ -87,13 +87,14 @@
|
|||||||
<Management
|
<Management
|
||||||
ref="createRef"
|
ref="createRef"
|
||||||
@project-change="onProjectChange"
|
@project-change="onProjectChange"
|
||||||
|
@station-map-updated="handleStationMapUpdated"
|
||||||
></Management>
|
></Management>
|
||||||
</div>
|
</div>
|
||||||
<div class="body-box">
|
<div class="body-box">
|
||||||
<!-- 第三行数据 -->
|
<!-- 第三行数据 -->
|
||||||
<div class="content-box">
|
<div class="content-box">
|
||||||
<dv-border-box-10 :color="color[0]" style="position: relative">
|
<dv-border-box-10 :color="color[0]" style="position: relative">
|
||||||
<Plan :project="currentProject" />
|
<Plan :project="currentProject" ref="planRef"/>
|
||||||
<!-- 将 flag 值传递给 SecurityDetail 组件 -->
|
<!-- 将 flag 值传递给 SecurityDetail 组件 -->
|
||||||
<!-- showDetail从SecurityDetail 组件传过来 -->
|
<!-- showDetail从SecurityDetail 组件传过来 -->
|
||||||
<SecurityDetail
|
<SecurityDetail
|
||||||
@@ -235,6 +236,8 @@ const onProjectChange = (project: { id: string; name: string }) => {
|
|||||||
currentProject.value = project;
|
currentProject.value = project;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const planRef = ref() // 添加对 Plan 组件的引用
|
||||||
|
|
||||||
const smsQueriesRef = ref(); // 短信查询组件引用
|
const smsQueriesRef = ref(); // 短信查询组件引用
|
||||||
const smsConfigRef = ref(); // 短信查询组件引用
|
const smsConfigRef = ref(); // 短信查询组件引用
|
||||||
const sendRef = ref(); // 短信查询组件引用
|
const sendRef = ref(); // 短信查询组件引用
|
||||||
@@ -380,6 +383,14 @@ const createRef = ref();
|
|||||||
const openDialog = () => {
|
const openDialog = () => {
|
||||||
createRef.value.open();
|
createRef.value.open();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 处理 Management 组件发出的 station-map-updated 事件
|
||||||
|
const handleStationMapUpdated = () => {
|
||||||
|
// 通过 Plan 组件转发给 bdMap
|
||||||
|
if (planRef.value && typeof planRef.value.handleStationMapUpdated === 'function') {
|
||||||
|
planRef.value.handleStationMapUpdated()
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -113,7 +113,7 @@
|
|||||||
v-for="(value, index) in infoWindowPoint.objName.split(
|
v-for="(value, index) in infoWindowPoint.objName.split(
|
||||||
';'
|
';'
|
||||||
)"
|
)"
|
||||||
style="white-space: nowrap"
|
style="white-space: nowrap; font-size: 13px"
|
||||||
>
|
>
|
||||||
{{ value }}
|
{{ value }}
|
||||||
</div>
|
</div>
|
||||||
@@ -198,8 +198,8 @@ const markerClick = (e: any) => {
|
|||||||
zoom.value = 15;
|
zoom.value = 15;
|
||||||
infoWindowPoint.value = e;
|
infoWindowPoint.value = e;
|
||||||
infoWindowPoint.value.show = true;
|
infoWindowPoint.value.show = true;
|
||||||
center.value.lng = 116.404367;
|
center.value.lng = e.lng;
|
||||||
center.value.lat = 39.915421;
|
center.value.lat = e.lat+ 0.01000001;;
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
center.value.lng = e.lng;
|
center.value.lng = e.lng;
|
||||||
@@ -285,41 +285,41 @@ const init = () => {
|
|||||||
const moveenFlag = ref(true);
|
const moveenFlag = ref(true);
|
||||||
|
|
||||||
const checkMapData = () => {
|
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(() => {
|
// setTimeout(() => {
|
||||||
try {
|
// try {
|
||||||
// 1. 获取所有图片瓦片
|
// // 1. 获取所有图片瓦片
|
||||||
const tiles = Array.from(container.querySelectorAll("img"));
|
// const tiles = Array.from(container.querySelectorAll("img"));
|
||||||
|
|
||||||
// 2. 检查是否有离线地图瓦片
|
// // 2. 检查是否有离线地图瓦片
|
||||||
const hasOfflineTiles = tiles.some((tile: any) => {
|
// const hasOfflineTiles = tiles.some((tile: any) => {
|
||||||
// 确保tile是有效的DOM元素
|
// // 确保tile是有效的DOM元素
|
||||||
if (!tile || !tile.src) return false;
|
// if (!tile || !tile.src) return false;
|
||||||
|
|
||||||
// 检查是否是离线瓦片
|
// // 检查是否是离线瓦片
|
||||||
return tile.src.includes("/plugin/offline/tiles/");
|
// return tile.src.includes("/plugin/offline/tiles/");
|
||||||
});
|
// });
|
||||||
|
|
||||||
// 3. 如果没有离线瓦片,回到默认位置
|
// // 3. 如果没有离线瓦片,回到默认位置
|
||||||
if (!hasOfflineTiles) {
|
// if (!hasOfflineTiles) {
|
||||||
console.warn("当前区域无离线地图数据,将返回默认位置");
|
// console.warn("当前区域无离线地图数据,将返回默认位置");
|
||||||
|
|
||||||
// 使用正确的BMap.Point创建方式
|
// // 使用正确的BMap.Point创建方式
|
||||||
const point = new BMapInstance.value.Point(116.404367, 39.915421);
|
// const point = new BMapInstance.value.Point(116.404367, 39.915421);
|
||||||
|
|
||||||
// 平滑移动并设置合适缩放级别
|
// // 平滑移动并设置合适缩放级别
|
||||||
mapInstance.value.panTo(point);
|
// mapInstance.value.panTo(point);
|
||||||
mapInstance.value.setZoom(12);
|
// mapInstance.value.setZoom(12);
|
||||||
// zoom.value = 12;
|
// // zoom.value = 12;
|
||||||
}
|
// }
|
||||||
} catch (error) {
|
// } catch (error) {/
|
||||||
console.error("地图检测出错:", error);
|
// console.error("地图检测出错:", error);
|
||||||
}
|
// }
|
||||||
}, 1000); // 适当缩短延迟时间
|
// }, 1000); // 适当缩短延迟时间
|
||||||
};
|
};
|
||||||
|
|
||||||
// 处理地图滚轮缩放,修正scale导致的坐标偏移
|
// 处理地图滚轮缩放,修正scale导致的坐标偏移
|
||||||
|
|||||||
@@ -1,25 +1,56 @@
|
|||||||
<!--报表导出-->
|
<!--报表导出-->
|
||||||
<template>
|
<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>
|
||||||
<div class="smsConfig">
|
<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-form-item label="时间">
|
||||||
<el-date-picker v-model="timeValue" size="small" type="daterange" :disabled-date="isFutureDate"
|
<el-date-picker
|
||||||
style="width: 250px; margin-right: 10px" unlink-panels :clearable="false" range-separator="至"
|
v-model="timeValue"
|
||||||
start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYY-MM-DD HH:mm:ss" />
|
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>
|
||||||
|
|
||||||
<el-form-item label="部门集合">
|
<el-form-item label="部门集合">
|
||||||
<el-select v-model="form.deptList" placeholder="请选择部门集合" style="width: 250px" size="small" multiple
|
<el-select
|
||||||
collapse-tags collapse-tags-tooltip>
|
v-model="form.deptList"
|
||||||
|
placeholder="请选择部门集合"
|
||||||
|
style="width: 250px"
|
||||||
|
size="small"
|
||||||
|
multiple
|
||||||
|
collapse-tags
|
||||||
|
collapse-tags-tooltip
|
||||||
|
>
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-checkbox v-model="checkAll" :indeterminate="indeterminate" @change="handleCheckAll">
|
<el-checkbox
|
||||||
|
v-model="checkAll"
|
||||||
|
:indeterminate="indeterminate"
|
||||||
|
@change="handleCheckAll"
|
||||||
|
>
|
||||||
全部
|
全部
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</template>
|
</template>
|
||||||
<el-option v-for="item in deptLists" :key="item.deptsIndex" :label="item.deptsname"
|
<el-option
|
||||||
:value="item.deptsIndex" />
|
v-for="item in deptLists"
|
||||||
|
:key="item.deptsIndex"
|
||||||
|
:label="item.deptsname"
|
||||||
|
:value="item.deptsIndex"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
@@ -32,7 +63,14 @@
|
|||||||
</div>
|
</div>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button :icon="Close" @click="setUp" size="small">取消</el-button>
|
<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>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
@@ -41,17 +79,18 @@ import { ref, watch, inject, onMounted } from "vue";
|
|||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
import { Check, Close } from "@element-plus/icons-vue";
|
import { Check, Close } from "@element-plus/icons-vue";
|
||||||
import { getDept, exportForms } from "@/api/statistics/index";
|
import { getDept, exportForms } from "@/api/statistics/index";
|
||||||
import type { CheckboxValueType } from 'element-plus'
|
import type { CheckboxValueType } from "element-plus";
|
||||||
import { useStore } from "vuex";
|
import { useStore } from "vuex";
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const machineVisible = ref(false);
|
const machineVisible = ref(false);
|
||||||
const title = ref("报表导出");
|
const title = ref("报表导出");
|
||||||
const timeValue = ref([]);
|
const timeValue = ref([]);
|
||||||
const deptLists = ref();
|
const deptLists = ref();
|
||||||
|
const loading = ref(false);
|
||||||
//form表单校验规则
|
//form表单校验规则
|
||||||
const emit = defineEmits(["flushed"]);
|
const emit = defineEmits(["flushed"]);
|
||||||
const checkAll = ref(false)
|
const checkAll = ref(false);
|
||||||
const indeterminate = ref(false)
|
const indeterminate = ref(false);
|
||||||
const form = ref({
|
const form = ref({
|
||||||
searchBeginTime: "",
|
searchBeginTime: "",
|
||||||
searchEndTime: "",
|
searchEndTime: "",
|
||||||
@@ -91,25 +130,25 @@ watch(
|
|||||||
() => form.value.deptList, // 使用函数返回值的形式
|
() => form.value.deptList, // 使用函数返回值的形式
|
||||||
(val) => {
|
(val) => {
|
||||||
if (val.length == 0) {
|
if (val.length == 0) {
|
||||||
checkAll.value = false
|
checkAll.value = false;
|
||||||
indeterminate.value = false
|
indeterminate.value = false;
|
||||||
} else if (val.length == deptLists.value.length) {
|
} else if (val.length == deptLists.value.length) {
|
||||||
checkAll.value = true
|
checkAll.value = true;
|
||||||
indeterminate.value = false
|
indeterminate.value = false;
|
||||||
} else {
|
} else {
|
||||||
indeterminate.value = true
|
indeterminate.value = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ deep: true } // 添加深度监听选项
|
{ deep: true } // 添加深度监听选项
|
||||||
)
|
);
|
||||||
const handleCheckAll = (val: CheckboxValueType) => {
|
const handleCheckAll = (val: CheckboxValueType) => {
|
||||||
indeterminate.value = false
|
indeterminate.value = false;
|
||||||
if (val) {
|
if (val) {
|
||||||
form.value.deptList = deptLists.value.map((_) => _.deptsIndex)
|
form.value.deptList = deptLists.value.map((_) => _.deptsIndex);
|
||||||
} else {
|
} else {
|
||||||
form.value.deptList = []
|
form.value.deptList = [];
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
const save = () => {
|
const save = () => {
|
||||||
if (!timeValue.value[0]) {
|
if (!timeValue.value[0]) {
|
||||||
ElMessage.warning("请选择时间!");
|
ElMessage.warning("请选择时间!");
|
||||||
@@ -122,10 +161,10 @@ const save = () => {
|
|||||||
|
|
||||||
(form.value.deptId = store.state.deptId),
|
(form.value.deptId = store.state.deptId),
|
||||||
(form.value.searchBeginTime = timeValue.value[0]),
|
(form.value.searchBeginTime = timeValue.value[0]),
|
||||||
(form.value.searchEndTime = timeValue.value[1]
|
(form.value.searchEndTime = timeValue.value[1]);
|
||||||
? timeValue.value[1].split(" ")[0] + " 23:59:59"
|
|
||||||
: "");
|
exportForms(form.value)
|
||||||
exportForms(form.value).then((res: any) => {
|
.then((res: any) => {
|
||||||
let blob = new Blob([res], {
|
let blob = new Blob([res], {
|
||||||
type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8",
|
type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8",
|
||||||
});
|
});
|
||||||
@@ -140,6 +179,10 @@ const save = () => {
|
|||||||
document.body.removeChild(link);
|
document.body.removeChild(link);
|
||||||
|
|
||||||
machineVisible.value = false;
|
machineVisible.value = false;
|
||||||
|
loading.value = false;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
loading.value = false;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,30 @@
|
|||||||
<template>
|
<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="formBox">
|
||||||
<div class="formLeft">
|
<div class="formLeft">
|
||||||
<datePicker ref="datePickerRef" />
|
<datePicker
|
||||||
<span>发送结果: </span>
|
: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
|
<el-select
|
||||||
size="small"
|
size="small"
|
||||||
v-model="state"
|
v-model="state"
|
||||||
@@ -32,7 +52,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="tableBox">
|
<div class="tableBox">
|
||||||
<el-table
|
<el-table
|
||||||
:scrollbar-always-on="true" :data="tableData"
|
:scrollbar-always-on="true"
|
||||||
|
:data="tableData"
|
||||||
height="500px"
|
height="500px"
|
||||||
size="small"
|
size="small"
|
||||||
stripe
|
stripe
|
||||||
@@ -124,14 +145,15 @@ const inquire = () => {
|
|||||||
searchBeginTime: datePickerRef.value.timeValue[0],
|
searchBeginTime: datePickerRef.value.timeValue[0],
|
||||||
searchEndTime: datePickerRef.value.timeValue[1],
|
searchEndTime: datePickerRef.value.timeValue[1],
|
||||||
sendResult: state.value,
|
sendResult: state.value,
|
||||||
|
searchValue: searchValue.value,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
total.value = res.data.total;
|
total.value = res.data.total;
|
||||||
tableData.value = res.data.records;
|
tableData.value = res.data.records;
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
const searchValue = ref("");
|
||||||
const open = (text: string, data?: any) => {
|
const open = (text: string, data?: any) => {
|
||||||
|
|
||||||
machineVisible.value = true;
|
machineVisible.value = true;
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
inquire();
|
inquire();
|
||||||
@@ -183,6 +205,7 @@ const exportTable = () => {
|
|||||||
searchBeginTime: datePickerRef.value.timeValue[0],
|
searchBeginTime: datePickerRef.value.timeValue[0],
|
||||||
searchEndTime: datePickerRef.value.timeValue[1],
|
searchEndTime: datePickerRef.value.timeValue[1],
|
||||||
sendResult: state.value,
|
sendResult: state.value,
|
||||||
|
searchValue: searchValue.value,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
table2excel(
|
table2excel(
|
||||||
@@ -197,7 +220,7 @@ const exportTable = () => {
|
|||||||
};
|
};
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
emit("close", false);
|
emit("close", false);
|
||||||
}
|
};
|
||||||
|
|
||||||
defineExpose({ open });
|
defineExpose({ open });
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -54,22 +54,26 @@
|
|||||||
</el-icon>
|
</el-icon>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<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
|
||||||
> -->
|
> -->
|
||||||
<el-dropdown-item @click="handleClick('3')"
|
<el-dropdown-item @click="handleClick('3')">
|
||||||
>系统配置</el-dropdown-item
|
系统配置
|
||||||
>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item @click="handleClick('4')"
|
<el-dropdown-item @click="handleClick('4')">
|
||||||
>报表导出</el-dropdown-item
|
报表导出
|
||||||
>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item @click="handleClick('5')"
|
<el-dropdown-item @click="handleClick('5')">
|
||||||
>台账导出</el-dropdown-item
|
台账导出
|
||||||
>
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item @click="handleClick('1')">
|
||||||
|
短信管理
|
||||||
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item @click="handleClick('6')">
|
||||||
|
缓存刷新
|
||||||
|
</el-dropdown-item>
|
||||||
|
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</template>
|
</template>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
@@ -196,7 +200,9 @@ import socketClient from "@/utils/webSocketClient";
|
|||||||
import {useStore} from "vuex";
|
import {useStore} from "vuex";
|
||||||
import Config from "./components/config.vue";
|
import Config from "./components/config.vue";
|
||||||
import ReportForms from "./components/reportForms.vue";
|
import ReportForms from "./components/reportForms.vue";
|
||||||
import { exportLineData } from "@/api/statistics/index";
|
import {exportLineData,refreshRedis} from "@/api/statistics/index";
|
||||||
|
import {ElMessage} from "element-plus";
|
||||||
|
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const smsQueriesRef = ref(); // 短信查询组件引用
|
const smsQueriesRef = ref(); // 短信查询组件引用
|
||||||
const endpointStatisticsRef = ref(); // 终端在线统计组件引用
|
const endpointStatisticsRef = ref(); // 终端在线统计组件引用
|
||||||
@@ -292,6 +298,10 @@ const handleClick = (type: string) => {
|
|||||||
smsQueriesFlag.value = true;
|
smsQueriesFlag.value = true;
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
if (type === "1") {
|
||||||
|
smsQueriesRef.value.open("已发送短信查询");
|
||||||
|
}
|
||||||
|
|
||||||
if (type === "3") {
|
if (type === "3") {
|
||||||
ConfigRef.value.open("系统配置");
|
ConfigRef.value.open("系统配置");
|
||||||
}
|
}
|
||||||
@@ -312,6 +322,12 @@ const handleClick = (type: string) => {
|
|||||||
document.body.removeChild(link);
|
document.body.removeChild(link);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (type === "6") {
|
||||||
|
refreshRedis().then((res: any) => {
|
||||||
|
ElMessage.success("刷新缓存成功");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}, 100);
|
}, 100);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user