Browse Source

Merge branch 'develop' of http://39.106.31.193:9211/mengff/jihe-hs into develop

wangqin
zhangzhang 9 months ago
parent
commit
ac6608e194
  1. 19
      ruoyi-ui/src/views/JiHeExpressway/components/Adaptation.vue
  2. 46
      ruoyi-ui/src/views/JiHeExpressway/index.vue
  3. 18
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue
  4. 20
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js
  5. 134
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js
  6. 4
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Thumbnail/index.vue
  7. 3
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/PresetFormItems.js
  8. 5
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/index.vue
  9. 23
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/data.js
  10. 11
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/index.vue
  11. 4
      ruoyi-ui/src/views/JiHeExpressway/pages/datav/roadNet/index.vue
  12. 46
      ruoyi-ui/src/views/JiHeExpressway/pages/datav/roadNet/sensors.vue
  13. 4
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/trafficSituation/components/IndicatorAnalysis/components/composeFeatures/assets/charts.js
  14. 4
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/trafficSituation/components/IndicatorAnalysis/components/crowding/assets/charts.js
  15. 4
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/trafficSituation/components/IndicatorAnalysis/components/saturationMax/assets/charts.js
  16. 4
      ruoyi-ui/vue.config.js

19
ruoyi-ui/src/views/JiHeExpressway/components/Adaptation.vue

@ -15,6 +15,11 @@ export default {
defaultHeight: {
type: Number,
default: () => 1080
},
headerHeight: {
type: Number,
default: () => 68
}
},
provide() {
@ -33,10 +38,10 @@ export default {
computed: {
transformStyle() {
const obj = {};
obj["transform"] = `scaleX(${this.scale.scaleX}) scaleY(${this.scale.scaleY})`;
obj["width"] = this.defaultWidth + "px";
obj["height"] = this.defaultHeight + "px";
obj["height"] = this.defaultHeight - this.headerHeight + "px";
obj["top"] = this.headerHeight + "px";
// obj.top = `calc(50% - ${(this.defaultHeight / 2) * this.scaleY}px)`;
// obj.left = `calc(50% - ${(this.defaultWidth / 2) * this.scaleX}px)`;
@ -46,12 +51,16 @@ export default {
return this.scale
}
},
watch:{
headerHeight(){
}
},
methods: {
initScale() {
let winW = window.innerWidth;
let winH = window.innerHeight;
let winH = window.innerHeight - this.headerHeight;
this.setScale(this.scale.scaleX = winW / this.defaultWidth, this.scale.scaleY = winH / this.defaultHeight)
this.setScale(this.scale.scaleX = winW / this.defaultWidth, this.scale.scaleY = winH / (this.defaultHeight - this.headerHeight))
},
setScale(scaleX, scaleY) {
const cssGlobalVariable = [
@ -141,7 +150,7 @@ body {
<style lang="scss" scoped>
.Adaptation {
transition: all 0.15s linear;
position: absolute;
position: fixed;
transform-origin: 0 0;
}
</style>

46
ruoyi-ui/src/views/JiHeExpressway/index.vue

@ -1,12 +1,12 @@
<template>
<Adaptation class="pageBox">
<HeaderMenu @onChange="handleChange" class="header" />
<div class="content">
<div class="pageBox">
<HeaderMenu @onChange="handleChange" class="header" :style="headerStyle"/>
<Adaptation class="content" :headerHeight="headerHeight">
<Transition name="fade">
<router-view v-if="isShowContent" />
</Transition>
</div>
</Adaptation>
</Adaptation>
</div>
</template>
<script>
@ -19,14 +19,29 @@ export default {
name: "ji_ze_gao_su",
components: {
HeaderMenu,
Adaptation,
Adaptation
// ...modules
},
data() {
return {
isShowContent:false
isShowContent:false,
headerHeight:68,
header: {
scale: 1,
originW: 1920,
originH: 68
},
};
},
computed:{
headerStyle(){
return {
width : `${this.header.originW}px`,
height : `${this.header.originH}px`,
transform : `scale(${this.header.scale}, ${this.header.scale})`
}
}
},
mounted(){
getBoardBaseData().then(res => {
this.isShowContent = true;
@ -34,8 +49,18 @@ export default {
// Promise.all()getBoardBaseData().then(()=>{
// this.isShowContent = true ;
// });
window.addEventListener(
"resize",
_.debounce(this.calcHeaderScale.bind(this), 360)
);
this.calcHeaderScale();
},
methods: {
calcHeaderScale(){
let winW = window.innerWidth;
this.header.scale = winW / this.header.originW;
this.headerHeight = this.header.scale * this.header.originH;
},
handleChange(activeMenu) {
this.$route.path != activeMenu.path && this.$router.push(activeMenu.path);
}
@ -66,15 +91,14 @@ export default {
}
.header {
height: 68px;
position: fixed;
transform-origin: left top;
left: 0; top:0; z-index: 1000;
}
.content {
flex: 1;
height: 0;
display: flex;
flex-direction: row;
position: relative;
pointer-events: none;
::v-deep {

18
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue

@ -48,6 +48,8 @@ import PerceiveEvent from "./../Dialogs/PerceiveEvent/index.vue";
import SmartDevice from "./../Dialogs/SmartDevice/index.vue";
import Intermodulation from "./../Dialogs/Intermodulation/index.vue";
import FatigueWakesUp from "./../Dialogs/FatigueWakesUp/index.vue";
import { addInGraphHandle } from "./utils/map"
import { lngLatMap } from "./utils/buttonEvent";
export default {
name: 'RoadAndEvents',
@ -137,11 +139,15 @@ export default {
},
watch: {
isGisCompleted: {
handler(bool) {
async handler(bool) {
if (!bool) return;
this.tabContentData.forEach(item => {
this.handleDeviceImmediate(item, true);
});
await Promise.allSettled((this.tabContentData || []).map(item => this.handleDeviceImmediate(item, true)))
// for (let item of this.tabContentData || []) {
// await this.handleDeviceImmediate(item, true);
// };
Object.keys(lngLatMap).forEach(key => {
addInGraphHandle(lngLatMap[key]);
})
}
}
},
@ -185,7 +191,7 @@ export default {
this.active = item.title;
this.tabContentData = item.children;
},
handleDeviceImmediate(item, isDefault) {
async handleDeviceImmediate(item, isDefault) {
const key = getHandleDeviceType(item) || `${this.active}/${item.title}`;
const status = item.status;
@ -196,7 +202,7 @@ export default {
if (!eventMap[`${key}${status ? "_close" : ""}`]) return this.$emit("onClickItem", item);
eventMap[`${key}${status ? "_close" : ""}`]?.call(this, item, this.filterData, isDefault);
await eventMap[`${key}${status ? "_close" : ""}`]?.call(this, item, this.filterData, isDefault);
},
handleDevice: debounce(function (item) {
this.handleDeviceImmediate(item);

20
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js

@ -6,7 +6,7 @@ import {
import { delay } from "@screen/utils/common";
import { Message } from "element-ui";
import { EventTopics } from "@screen/utils/enum.js";
import { debounce } from "lodash";
import { debounce, cloneDeep } from "lodash";
import Vue from "vue";
import { markerClusterIns, getContent } from "./map";
@ -155,7 +155,7 @@ export const eventMap = {
removeData
);
addDataPreHandle(removeData);
markerClusterIns.addData(removeData);
markerClusterIns.addData(removeData, isDefault);
cacheRemoveFunc[`地图路测设备/${item.title}`] = () => {
removeDataPreHandle(removeData);
@ -208,7 +208,7 @@ export const eventMap = {
)
);
addDataPreHandle(removeData);
markerClusterIns.addData(removeData);
markerClusterIns.addData(removeData, isDefault);
cacheRemoveFunc[`地图事件专题/${item.title}`] = () => {
removeDataPreHandle(removeData);
@ -255,7 +255,7 @@ export const eventMap = {
resolveDataOptions.call(this, item, options, "PerceiveEvent", isDefault)
);
addDataPreHandle(removeData);
markerClusterIns.addData(removeData);
markerClusterIns.addData(removeData, isDefault);
loadingMessage?.close();
@ -295,14 +295,18 @@ function addDataPreHandle(markers) {
}
function removeDataPreHandle(markers) {
// 完善校验逻辑 避免删除额外节点
const cb = (lngLatStr, markerData) => {
if (lngLatMap[lngLatStr]) {
if (lngLatMap[lngLatStr].length < 2) delete lngLatMap[lngLatStr];
const lngLatArr = lngLatMap[lngLatStr];
if (lngLatArr) {
if (lngLatArr.length === 0) delete lngLatMap[lngLatStr];
else if (lngLatArr.length === 1 && lngLatArr[0] === markerData)
delete lngLatMap[lngLatStr];
else {
const findIndex = lngLatMap[lngLatStr].findIndex(
const findIndex = lngLatArr.findIndex(
(removeData) => removeData === markerData
);
lngLatMap[lngLatStr].splice(findIndex, 1);
if (findIndex !== -1) lngLatArr.splice(findIndex, 1);
}
}
};

134
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js

@ -43,68 +43,11 @@ export class MarkerCluster {
return (this.map = Vue.prototype.mapIns);
}
async addData(data) {
async addData(data, isDefault) {
this.infoWindow?.close?.();
const graphInstance = window.graphInstance;
console.log(data, "xxxxx");
data?.forEach((markerData, index) => {
const lnglat = markerData.lnglat;
if (lnglat) {
const getLatAndLng = () => {
if (Array.isArray(lnglat)) return { lng: lnglat[0], lat: lnglat[1] };
else return lnglat;
};
const { lat, lng } = getLatAndLng();
const lngLatStr = `${lng}/${lat}`;
const data = lngLatMap[lngLatStr];
const nowBg = getState(data) ? normalBg : faultBg;
const extData = data[0].extData;
const { item: eventItem } = data[0].config;
if (eventItem.id.match("./事件专题")) {
let { stakeMark, lang } = extData;
const distance =
(Number(
stakeMark
.replace(/\.\d+/, "")
.replace("+", ".")
.replace(/[Kk]/, "")
) -
54.394) *
window.canvasRatio +
window.canvasWidth * 0.0755; //K54+394 开始到K208+979计算的比例尺
const node = {};
if (data.length === 1) {
node.shape = "singleNode-html";
node.data = {
nowBg,
src: `${getIcon(data[0])}`,
extData,
};
} else {
node.shape = "multiNode-html";
node.data = {
nowBg,
// width: `${36 + `${data.length}`.length * 15}px`,
length: data.length,
extData,
};
}
if (graphInstance.getCellById(stakeMark)) {
graphInstance.removeNode(stakeMark);
}
graphInstance.addNode({
x: distance,
y: 60,
width: 20,
height: 20,
...node,
zIndex: 1,
id: stakeMark,
});
}
}
});
if (!isDefault) {
marksAddInGraph(data);
}
if (!data) return;
if (!Array.isArray(data)) data = [data];
@ -124,7 +67,7 @@ export class MarkerCluster {
"font-size:15px; background:#641f14; color:#a86358;",
data
);
console.log();
this.markerCluster.addData(data);
console.log(
"%c [ this.markerCluster ]-234-「map.js」",
@ -398,4 +341,71 @@ function getStateSingle({ config, extData }) {
: extData.deviceState == 1;
}
export function marksAddInGraph(data) {
for (let markerData of data || []) {
const lnglat = markerData.lnglat;
if (lnglat) {
const getLatAndLng = () => {
if (Array.isArray(lnglat)) return { lng: lnglat[0], lat: lnglat[1] };
else return lnglat;
};
const { lat, lng } = getLatAndLng();
const lngLatStr = `${lng}/${lat}`;
const data = lngLatMap[lngLatStr];
addInGraphHandle(data);
}
}
}
export function addInGraphHandle(data) {
const graphInstance = window.graphInstance;
const nowBg = getState(data) ? normalBg : faultBg;
const extData = data[0].extData;
const { item: eventItem } = data[0].config;
if (eventItem.id.match("./事件专题")) {
let { stakeMark, lang } = extData;
const distance =
(Number(
stakeMark.replace(/\.\d+/, "").replace("+", ".").replace(/[Kk]/, "")
) -
54.394) *
window.canvasRatio +
window.canvasWidth * 0.0755; //K54+394 开始到K208+979计算的比例尺
const node = {};
if (data.length === 1) {
node.shape = "singleNode-html";
node.data = {
nowBg,
src: `${getIcon(data[0])}`,
extData,
};
} else {
node.shape = "multiNode-html";
node.data = {
nowBg,
// width: `${36 + `${data.length}`.length * 15}px`,
length: data.length,
extData,
};
}
const existNode = graphInstance.getCellById(stakeMark);
if (existNode) {
graphInstance.removeCell(existNode.id);
}
console.log(lang, "lang");
// setTimeout(() => {
graphInstance.addNode({
x: distance,
y: 60,
width: 20,
height: 20,
...node,
zIndex: 1,
id: stakeMark,
});
// }, 0);
}
}
export const markerClusterIns = new MarkerCluster();

4
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Thumbnail/index.vue

@ -241,9 +241,7 @@ export default {
},
})
window.graphInstance = graph;
baseData.nodes.forEach(node => {
graph.addNode(node)
});
graph.addNodes(baseData.nodes);
this.drawCongestionAreas(graph, 1404, 80);

3
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/PresetFormItems.js

@ -262,9 +262,10 @@ export const laneOccupancy = {
export const eventSources = {
label: "事件源:",
key: "eventSources",
key: "eventSource",
type: "select",
options: {
clearable: true,
options: [
{
key: "1",

5
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/index.vue

@ -173,6 +173,9 @@ export default {
// eventType: Number(this.index) + 1,
// stakeMark: (stakeMark && stakeMark[0] != null) ? ((stakeMark && stakeMark.length > 0) ? ('K' + stakeMark[0] + '+' + stakeMark[1]) : '') : '',
// })
// this.modelVisible = false;
// this.submitting = false;
// this.$emit('queryData',true)
// return;
request({
@ -181,6 +184,7 @@ export default {
data: {
...formData,
eventType: Number(this.index) + 1,
eventState: 0,
stakeMark: (stakeMark && stakeMark[0] != null) ? ((stakeMark && stakeMark.length > 0) ? ('K' + stakeMark[0] + '+' + stakeMark[1]) : '') : '',
}
}).then((result) => {
@ -191,6 +195,7 @@ export default {
Message.error("提交失败");
}).finally(() => {
this.submitting = false;
this.$emit('queryData',true);
})
})

23
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/data.js

@ -58,6 +58,7 @@ export const gjSearchFormList = [
key: "warningSource",
type: "select",
options: {
clearable: true,
options: [
{
key: "1",
@ -113,6 +114,7 @@ export const gjSearchFormList = [
required: false,
type: "datePicker",
options: {
style: 'width: 250px',
type: "datetimerange",
format: "yyyy-MM-dd HH:mm:ss",
valueFormat: "yyyy-MM-dd HH:mm:ss",
@ -123,25 +125,16 @@ export const gjSearchFormList = [
label: "桩号:",
required: false,
},
// merge(cloneDeep(PresetFormItems.station), {
// options: {
// options: [
// {
// key: "endStakeMark[0]",
// },
// {
// key: "endStakeMark[1]",
// },
// ],
// },
// label: "结束桩号:",
// required: false,
// }),
];
export const gzSearchFormList = [
PresetFormItems.eventSources,
PresetFormItems.eventType,
merge(PresetFormItems.eventType, {
options: {
clearable: true,
},
}),
// PresetFormItems.eventType,
{
label: "方向:",
key: "direction",

11
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/index.vue

@ -5,7 +5,7 @@
<!-- 搜索栏 -->
<div class="filter">
<div>
<ButtonGradient @click="onAddNew" v-if="activeName != '1' && activeName != '2'">
<ButtonGradient @click="onAddNew" v-if="activeName == '0'">
<template #prefix>
<img src="./images/insert.svg" />
</template>
@ -43,9 +43,10 @@
</div>
<!-- "详情"弹出框 -->
<EventDetailDialog :visible="eventDetailDialogVisible" :formData="detailDialogFormData" :activeName="activeName" @update:value="handleClose" @queryData="queryData"/>
<EventDetailDialog :visible="eventDetailDialogVisible" :formData="detailDialogFormData" :activeName="activeName"
@update:value="handleClose" @queryData="queryData" />
<!-- "新增"弹出框 -->
<FormEvent :visible="isShowAddNew" @close="onCloseAddNew" />
<FormEvent :visible="isShowAddNew" @close="onCloseAddNew" @queryData="queryData" />
</div>
</template>
@ -176,7 +177,7 @@ export default {
lastBtnText: text,
};
},
queryData(flag){
queryData(flag) {
this.getData()
},
getData() {
@ -353,7 +354,7 @@ export default {
this.searchData = {
...this.searchData,
eventType: data.eventType,
eventSources: data.eventSources,
eventSource: data.eventSource,
warningSource: data?.warningSource || '',
direction: data.direction,
startTime: daterange && daterange.length > 0 ? daterange[0] : "",

4
ruoyi-ui/src/views/JiHeExpressway/pages/datav/roadNet/index.vue

@ -316,7 +316,7 @@ h4, p, ul,li{ margin: 0; padding:0;}
flex-basis: 816px; display: flex; flex-direction: column; justify-content: space-between;
}
.share{
height: 420px; display: flex; justify-content: center; align-items: center;
flex:1.2; margin-bottom: 46px; display: flex; justify-content: center; align-items: center;
.arrow{ transform: rotateZ(90deg); left: 48%; top:calc(100% + 8px);}
.shareCon{
background-image: url(./img/ShareAll.svg); background-position: center center; background-size: contain; background-repeat: no-repeat; width: 756px; height: 245px; display: flex; align-items: center; justify-content: center; position: relative;
@ -340,7 +340,7 @@ h4, p, ul,li{ margin: 0; padding:0;}
}
.apply{
height: 390px; display: flex; flex-wrap: wrap; padding: 40px 45px; align-content: stretch;
flex: 1; display: flex; flex-wrap: wrap; padding: 40px 45px; align-content: stretch;
.applyUnit{ flex-basis: 25%; display: flex; flex-direction: column; justify-content: center; align-items: center;
.con{ width: 140px; text-align: center; align-items: center; justify-content: center;
h4, p{ font-family: PangMenZhengDao; font-size: 15px; line-height: 22px; margin: 0; padding:0;

46
ruoyi-ui/src/views/JiHeExpressway/pages/datav/roadNet/sensors.vue

@ -1,6 +1,6 @@
<template>
<div class="compBox">
<div id="container" class="compCon">
<div id="container" class="compCon" ref="canvas">
</div>
</div>
</template>
@ -12,22 +12,34 @@ export default {
name: 'sensors',
data(){
return {
graph:null
}
},
components: {
},
mounted(){
this.initGraph();
this.refresh();
window.addEventListener("resize",
_.debounce(this.refresh.bind(this), 1000)
)
},
methods: {
initGraph(){
refresh(){
let _this = this;
this.$nextTick(() => {
_this.initGraph(_this.$refs["canvas"].offsetHeight);
})
},
initGraph(canvasHeight){
let unitH = 42;
let average = unitH + (canvasHeight - unitH*13)/12;
Graph.registerNode(
'sensor',
{
width: 180,
height: 42,
height: unitH,
markup: [
{
tagName: 'rect',
@ -97,8 +109,12 @@ export default {
},
true,
)
const graph = new Graph({
if(this.graph){
this.graph.clearCells();
this.graph = null;
}
this.graph = new Graph({
container: document.getElementById('container'),
autoResize: true,
grid: false,
@ -114,8 +130,8 @@ export default {
})
function createSub(x, y, title) {
return graph.addNode({
const createSub = (x, y, title) => {
return this.graph.addNode({
x,
y,
shape: 'sensor',
@ -132,8 +148,8 @@ export default {
})
}
function link(source, target, vertices) {
return graph.addEdge({
const link = (source, target, vertices) => {
return this.graph.addEdge({
source: {
cell: source,
anchor: {
@ -153,7 +169,7 @@ export default {
})
}
const main = graph.addNode({
const main = this.graph.addNode({
shape: 'circle',
x: 310,
y: 80,
@ -184,7 +200,7 @@ export default {
]
subItems.forEach((item, index) => {
let temp = createSub(0, index * 68, item);
let temp = createSub(0, index * average, item);
link(main, temp);
})
@ -219,7 +235,7 @@ export default {
// },
// ])
// graph.zoomToFit({ padding: 0, maxScale: 1, mainScale: 1 })
// this.graph.zoomToFit({ padding: 0, maxScale: 1, mainScale: 1 })

4
ruoyi-ui/src/views/JiHeExpressway/pages/perception/trafficSituation/components/IndicatorAnalysis/components/composeFeatures/assets/charts.js

@ -2,10 +2,10 @@ import * as echarts from "echarts";
var options = {
color: ["#07A3FB"],
grid: {
left: "0%",
left: "2px",
right: "8%",
bottom: "0%",
top: "25px",
top: "28px",
containLabel: true,
},
tooltip: {

4
ruoyi-ui/src/views/JiHeExpressway/pages/perception/trafficSituation/components/IndicatorAnalysis/components/crowding/assets/charts.js

@ -2,10 +2,10 @@ import * as echarts from "echarts";
var options = {
color: ["#E29E37"],
grid: {
left: "0%",
left: "2px",
right: "0%",
bottom: "0%",
top: "25px",
top: "28px",
containLabel: true,
},
tooltip: {

4
ruoyi-ui/src/views/JiHeExpressway/pages/perception/trafficSituation/components/IndicatorAnalysis/components/saturationMax/assets/charts.js

@ -6,10 +6,10 @@ var options = {
trigger: "axis",
},
grid: {
left: "0%",
left: "2px",
right: "0%",
bottom: "0%",
top: "25px",
top: "28px",
containLabel: true,
},

4
ruoyi-ui/vue.config.js

@ -51,8 +51,8 @@ module.exports = {
// target: `http://10.0.81.204:8087`, //现场后台 刘文阁
// target: `http://10.168.69.255:8087`, //正晨后台 连现场物联 刘文阁
// target: `http://10.168.78.135:8087`, //王钦
target: `http://10.168.66.196:8087`, //正晨后台 连现场物联 刘文阁2
// target: `http://10.168.68.42:8087`, //王思祥
// target: `http://10.168.66.196:8087`, //正晨后台 连现场物联 刘文阁2
target: `http://10.168.68.42:8087`, //王思祥
changeOrigin: true,
pathRewrite: {
["^" + process.env.VUE_APP_BASE_API]: "",

Loading…
Cancel
Save