This commit is contained in:
lcw
2025-07-21 17:47:27 +08:00
parent 1b567a8e75
commit 30d5a663ef
111 changed files with 1663 additions and 393 deletions

View File

@ -1,8 +1,7 @@
<template>
<div :id="mapid" class="map"></div>
<div class="changeMap_box" v-if="props.isShow">
<el-switch v-model="conditionRoute" @change="handleSwitch" active-text="打开路况" inactive-text="关闭路况"
style="--el-switch-color: #13ce66; --el-switch-off-color: #ff4949" />
<el-switch v-model="conditionRoute" @change="handleSwitch" active-text="打开路况" inactive-text="关闭路况" style="--el-switch-color:#13ce66;--el-switch-off-color:#ff4949;" />
<!-- <el-carousel type="card" height="75px" :autoplay="false" indicator-position="none" :initial-index="3" @change="onMapImageChange">
<el-carousel-item>
<div class="mapImageItem">
@ -75,7 +74,7 @@ const props = defineProps({
});
try {
const userInfo = getItem("deptId")[0].deptCode;
} catch (error) { }
} catch (error) {}
let map;
let mapLayer;
let mapLayer1;
@ -89,33 +88,27 @@ onMounted(() => {
map = new EliMap({
id: props.mapid,
crs: "EPSG:4490",
crs: "EPSG:3857",
style: {
glyphs: "./fonts/{fontstack}/{range}.pbf",
center: [94.36057012, 29.64276831],
zoom: 15
center: [94.36,29.65],
zoom: 10
},
minZoom: 7,
maxZoom: 18,
transformRequest: (url) => {
if (url.indexOf("TileMatrix=") != -1) {
const arr = url.split("TileMatrix=");
const arr1 = arr[1].split("&");
const nurl = `${arr[0]}&TileMatrix=${Number(arr1[0])}&${arr1[1]}&${arr1[2]}`;
}
}
});
window.map = map;
map.mapboxGLMap.on("load", () => {
map.addWMTSLayer(
"http://89.0.23.24/PGIS_S_TileMapServer/Maps/XZDJ_SL/EzMap"
,
{
Service: "getImage",
Type: "RGB",
ZoomOffset: "0",
V: "0.3",
Zoom: "{z}",
Row: "{y}",
Col: "{x}"
},
{
tileSize: 300
}
);
map.addGaudLayer({
url: 'http://webrd02.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}',
})
zoomTarget.value = map.mapboxGLMap.getZoom();
});
mapUtil.value = new MapUtil(map);
@ -135,6 +128,8 @@ onMounted(() => {
});
//
emitter.on("addPointArea", (obj) => {
console.log(obj);
mapUtil.value.makerSki(obj);
});
//
@ -173,7 +168,7 @@ onMounted(() => {
});
// 线
emitter.on("echoLine", (res) => {
mapUtil.value.createLine(res, res.flag);
mapUtil.value.createLine(res);
});
//geojson
emitter.on("setBoundarys", (res) => {
@ -204,6 +199,11 @@ onMounted(() => {
mapUtil.value.diffusionCircle(res);
});
//
emitter.on("removeElementAll", () => {
mapUtil.value.removeElementAll();
});
//
emitter.on("showGapText", (obj) => {
mapUtil.value.gapText(obj);
@ -302,6 +302,7 @@ onUnmounted(() => {
emitter.off("diffusionCircle");
emitter.off("SsCircle");
emitter.off("ClearssCircle");
emitter.off("removeElementAll");
});
</script>
@ -324,35 +325,29 @@ onUnmounted(() => {
right: 398px;
bottom: 4px;
z-index: 9;
.mapImageItem {
border: 1px solid #08aae8;
background: rgb(9, 26, 70);
&>img {
& > img {
width: 100%;
height: 50px;
}
&>div {
& > div {
text-align: center;
position: relative;
top: -3px;
}
}
.zoomTargetBox {
margin-top: 10px;
margin-left: 23px;
}
::v-deep .el-input-number__decrease,
::v-deep .el-input-number__increase {
background: #133362;
color: #fff;
border: none;
}
::v-deep .el-input__inner {
background: #0c1641;
}

View File

@ -1,7 +1,8 @@
<template>
<div :id="mapid" class="map"></div>
<div class="changeMap_box" v-if="props.isShow">
<el-switch v-model="conditionRoute" @change="handleSwitch" active-text="打开路况" inactive-text="关闭路况" style="--el-switch-color:#13ce66;--el-switch-off-color:#ff4949;" />
<el-switch v-model="conditionRoute" @change="handleSwitch" active-text="打开路况" inactive-text="关闭路况"
style="--el-switch-color: #13ce66; --el-switch-off-color: #ff4949" />
<!-- <el-carousel type="card" height="75px" :autoplay="false" indicator-position="none" :initial-index="3" @change="onMapImageChange">
<el-carousel-item>
<div class="mapImageItem">
@ -74,7 +75,7 @@ const props = defineProps({
});
try {
const userInfo = getItem("deptId")[0].deptCode;
} catch (error) {}
} catch (error) { }
let map;
let mapLayer;
let mapLayer1;
@ -88,27 +89,32 @@ onMounted(() => {
map = new EliMap({
id: props.mapid,
crs: "EPSG:3857",
crs: "EPSG:4490",
style: {
glyphs: "./fonts/{fontstack}/{range}.pbf",
center: [94.36,29.65],
zoom: 10
center: [94.36057012, 29.64276831],
zoom: 15
},
transformRequest: (url) => {
if (url.indexOf("TileMatrix=") != -1) {
const arr = url.split("TileMatrix=");
const arr1 = arr[1].split("&");
const nurl = `${arr[0]}&TileMatrix=${Number(arr1[0])}&${arr1[1]}&${arr1[2]}`;
}
}
minZoom: 7,
maxZoom: 18,
});
window.map = map;
map.mapboxGLMap.on("load", () => {
map.addGaudLayer({
url: 'http://webrd02.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}',
})
map.addWMTSLayer(
"/PGIS_S_TileMapServer/Maps/XZDJ_SL/EzMap",
{
Service: "getImage",
Type: "RGB",
ZoomOffset: "0",
V: "0.3",
Zoom: "{z}",
Row: "{y}",
Col: "{x}"
},
{
tileSize: 300
}
);
zoomTarget.value = map.mapboxGLMap.getZoom();
});
mapUtil.value = new MapUtil(map);
@ -128,8 +134,6 @@ onMounted(() => {
});
// 撒点
emitter.on("addPointArea", (obj) => {
console.log(obj);
mapUtil.value.makerSki(obj);
});
// 鼠标滑过提示文字的点位
@ -168,7 +172,7 @@ onMounted(() => {
});
// 回显线
emitter.on("echoLine", (res) => {
mapUtil.value.createLine(res);
mapUtil.value.createLine(res, res.flag);
});
//创建边界面geojson
emitter.on("setBoundarys", (res) => {
@ -199,11 +203,6 @@ onMounted(() => {
mapUtil.value.diffusionCircle(res);
});
// 清除全部覆盖物
emitter.on("removeElementAll", () => {
mapUtil.value.removeElementAll();
});
// 展示盘曲
emitter.on("showGapText", (obj) => {
mapUtil.value.gapText(obj);
@ -302,7 +301,6 @@ onUnmounted(() => {
emitter.off("diffusionCircle");
emitter.off("SsCircle");
emitter.off("ClearssCircle");
emitter.off("removeElementAll");
});
</script>
@ -325,29 +323,35 @@ onUnmounted(() => {
right: 398px;
bottom: 4px;
z-index: 9;
.mapImageItem {
border: 1px solid #08aae8;
background: rgb(9, 26, 70);
& > img {
&>img {
width: 100%;
height: 50px;
}
& > div {
&>div {
text-align: center;
position: relative;
top: -3px;
}
}
.zoomTargetBox {
margin-top: 10px;
margin-left: 23px;
}
::v-deep .el-input-number__decrease,
::v-deep .el-input-number__increase {
background: #133362;
color: #fff;
border: none;
}
::v-deep .el-input__inner {
background: #0c1641;
}

View File

@ -0,0 +1,334 @@
<template>
<div>
<el-dialog
:title="titleValue"
width="1400px"
v-model="modelValue"
@close="closed"
>
<div v-if="modelValue">
<el-form :model="listQuery" class="mosty-from-wrap" :inline="true">
<el-form-item label="所属部门">
<MOSTY.Department
width="100%"
clearable
v-model="listQuery.ssbmdm"
/>
</el-form-item>
<el-form-item label="感知源名称">
<el-input
v-model="listQuery.sbmc"
placeholder="请输入感知源名称"
clearable
/>
</el-form-item>
<el-form-item>
<el-button type="success" @click="handleFilter">查询</el-button>
<el-button type="info" @click="reset()"> 重置 </el-button>
</el-form-item>
</el-form>
<div class="tabBox" style="margin-top: 0px" v-if="modelValue">
<el-table
ref="multipleUserRef"
@selection-change="handleSelectionChange"
:data="tableData"
:highlight-current-row="props.Single"
border
v-loading="loading"
style="width: 100%"
:row-key="keyid"
height="450"
>
<el-table-column
type="selection"
width="55"
:reserve-selection="true"
v-if="!props.Single"
/>
<el-table-column width="55" #default="{ row }" v-else>
<el-radio v-model="ridioIndex" :label="row.id"></el-radio>
</el-table-column>
<el-table-column
label="序号"
type="index"
align="center"
sortable
width="80"
/>
<el-table-column
sortable
prop="ssbm"
label="所属部门"
show-overflow-tooltip
align="center"
></el-table-column>
<el-table-column
sortable
prop="sbmc"
show-overflow-tooltip
align="center"
label="感知源名称"
>
</el-table-column>
<el-table-column
show-overflow-tooltip
align="center"
label="厂商名称"
prop="csmc"
/>
<el-table-column
prop="sbbh"
show-overflow-tooltip
align="center"
label="设备编号"
>
</el-table-column>
<el-table-column
sortable
prop="jd"
show-overflow-tooltip
label="经度"
align="center"
>
</el-table-column>
<el-table-column
sortable
prop="wd"
show-overflow-tooltip
label="纬度"
align="center"
>
</el-table-column>
</el-table>
</div>
<div class="fenye">
<el-pagination
class="pagination"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="listQuery.pageCurrent"
:page-sizes="[2, 5, 10, 20]"
:page-size="listQuery.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
></el-pagination>
</div>
</div>
<template #footer>
<div class="dialog-footer">
<el-button @click="closed">取消</el-button>
<el-button type="primary" @click="onComfirm">确认</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup>
import * as rule from "@/utils/rules.js";
import * as MOSTY from "@/components/MyComponents/index";
import { ElMessage } from "element-plus";
import { qcckGet, qcckPost } from "@/api/qcckApi.js";
import {ysSxtgetPageList} from '@/api/yszx.js'
import {
defineProps,
watch,
ref,
onMounted,
nextTick,
getCurrentInstance
} from "vue";
const { proxy } = getCurrentInstance();
const { D_BZ_JCZLX } = proxy.$dict("D_BZ_JCZLX");
const props = defineProps({
//是否显示
modelValue: {
type: Boolean,
required: true
},
//标题
titleValue: {
type: String,
default: "选择环林卡口"
},
//是否单选
Single: {
type: Boolean,
default: false
},
//已经选中得数据回显
data: {
type: Array,
default: []
}
});
const keyid = (row) => {
return row.id;
};
const ridioIndex = ref(null);
const total = ref(0);
const listQuery = ref({
pageCurrent: 1,
pageSize: 20,
jczmc: "",
ssbmdm: ""
});
const tableData = ref([]);
const loading = ref(false);
const emits = defineEmits(["update:modelValue", "choosedJcz"]);
const closed = () => {
listQuery.value.jczmc = "";
emits("update:modelValue", false);
};
const reset = () => {
listQuery.value = {
pageCurrent: 1,
pageSize: 20,
jczmc: "",
ssbmdm: ""
};
getListData();
};
// 判断传进来的选中数据和加载的选中数据不满足的数据
const checkopenList = ref([]);
// 确定选中
const onComfirm = () => {
//单选
if (props.Single) {
if (![ridioIndex.value][0]) {
proxy.$message.warning("请选择环林卡口");
return;
}
const info = tableData.value.find((item) => {
return item.id === ridioIndex.value;
});
emits("choosedJcz", JSON.parse(JSON.stringify(info)));
} else {
//多选
const jczList = JSON.parse(JSON.stringify(multipleSelectionUser.value));
if (jczList.length === 0) {
proxy.$message.warning("请选择环林卡口");
return;
}
emits("choosedJcz", [...jczList, ...checkopenList.value]);
}
closed();
};
onMounted(() => {
getListData();
});
/**
* pageSize 改变触发
*/
const handleSizeChange = (currentSize) => {
listQuery.value.pageSize = currentSize;
getListData();
};
/**
* 页码改变触发
*/
const handleCurrentChange = (currentPage) => {
listQuery.value.pageCurrent = currentPage;
getListData();
};
//检查站数据
const getListData = async () => {
loading.value = true;
ysSxtgetPageList(listQuery.value)
.then((res) => {
tableData.value = res?.records;
loading.value = false;
multipleUser(props.data, tableData.value);
total.value = Number(res.total);
})
.catch(() => {
loading.value = false;
});
};
const handleFilter = () => {
listQuery.value.pageCurrent = 1;
getListData();
};
const multipleUserRef = ref(null);
const multipleSelectionUser = ref([]);
const handleSelectionChange = (val) => {
multipleSelectionUser.value = val;
if (checkopenList.value) {
for (let i = 0; i < multipleSelectionUser.value.length; i++) {
const l = multipleSelectionUser.value[i];
for (let j = 0; j < checkopenList.value.length; j++) {
const z = checkopenList.value[j];
if (l.id == z.id) {
checkopenList.value.splice(j, 1);
}
}
}
}
};
//回显--用于多选表格
function multipleUser(row, list) {
if (row) {
if (props.Single) {
row.forEach((item) => {
list.forEach((select) => {
if (typeof item == "object") {
if (item.id == select.id) {
ridioIndex.value = item.id;
}
} else {
if (item == select.id) {
ridioIndex.value = item;
}
}
});
});
} else {
row.forEach((item) => {
list.forEach((select) => {
if (item.id == select.id) {
if (multipleUserRef.value) {
multipleUserRef.value.toggleRowSelection(select, true);
}
}
});
});
}
}
}
watch(
() => props.modelValue,
(val) => {
if (val === true) {
ridioIndex.value = "";
handleFilter();
}
}
);
watch(
() => props.data,
(val) => {
if (multipleUserRef.value) multipleUser(val, tableData.value);
checkopenList.value = JSON.parse(JSON.stringify(val));
}
);
</script>
<style lang="scss" scoped>
@import "@/assets/css/layout.scss";
@import "@/assets/css/element-plus.scss";
::v-deep .el-form--inline {
padding-left: 0 !important;
}
::v-deep .el-radio__label {
display: none;
}
::v-deep .el-table__body tr.current-row > td.el-table__cell {
// background: #106fdc;
}
</style>

View File

@ -0,0 +1,48 @@
<template>
<div style="width: 100%; height: 100%; overflow: hidden;">
<iframe v-if="urls" :src="'http://80.2.22.233:56233?sbbh=' + urls" style="border: none; width: 100%; height: 100%; "
allowfullscreen allowtransparency scrolling="no"></iframe>
<iframe v-else src="https://stream7.iqilu.com/10339/upload_transcode/202002/09/20200209105011F0zPoYzHry.mp4" style="border: none; width: 100%; height: 100%; "
allowfullscreen allowtransparency scrolling="no"></iframe>
</div>
</template>
<script setup>
import { http } from "@/api/service";
import { ref, onMounted, onUnmounted, watch, getCurrentInstance } from "vue";
const props = defineProps({
sbbh: String
})
const { proxy } = getCurrentInstance();
const urls = ref(null)
watch(() => props.sbbh, (val) => {
if (!val) {
proxy.$message({
message: "获取不到视频流,播放失败!!!",
grouping: true,
type: "info"
});
} else {
getUrl(val)
}
}, { immediate: true })
function getUrl(sbbh) {
http.previewURLs({ sbbh: sbbh, protocol: 'sbbh' }).then((res) => {
console.log(res);
let data = JSON.parse(res);
if (data && data.url) {
urls.value = data.data.url
} else {
proxy.$message({
message: "获取不到视频流,播放失败!!!",
grouping: true,
type: "info"
});
}
})
}
</script>
<style lang="scss" scoped></style>