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. 44
      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. 132
      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. 9
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/index.vue
  11. 4
      ruoyi-ui/src/views/JiHeExpressway/pages/datav/roadNet/index.vue
  12. 42
      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: { defaultHeight: {
type: Number, type: Number,
default: () => 1080 default: () => 1080
},
headerHeight: {
type: Number,
default: () => 68
} }
}, },
provide() { provide() {
@ -33,10 +38,10 @@ export default {
computed: { computed: {
transformStyle() { transformStyle() {
const obj = {}; const obj = {};
obj["transform"] = `scaleX(${this.scale.scaleX}) scaleY(${this.scale.scaleY})`; obj["transform"] = `scaleX(${this.scale.scaleX}) scaleY(${this.scale.scaleY})`;
obj["width"] = this.defaultWidth + "px"; 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.top = `calc(50% - ${(this.defaultHeight / 2) * this.scaleY}px)`;
// obj.left = `calc(50% - ${(this.defaultWidth / 2) * this.scaleX}px)`; // obj.left = `calc(50% - ${(this.defaultWidth / 2) * this.scaleX}px)`;
@ -46,12 +51,16 @@ export default {
return this.scale return this.scale
} }
}, },
watch:{
headerHeight(){
}
},
methods: { methods: {
initScale() { initScale() {
let winW = window.innerWidth; 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) { setScale(scaleX, scaleY) {
const cssGlobalVariable = [ const cssGlobalVariable = [
@ -141,7 +150,7 @@ body {
<style lang="scss" scoped> <style lang="scss" scoped>
.Adaptation { .Adaptation {
transition: all 0.15s linear; transition: all 0.15s linear;
position: absolute; position: fixed;
transform-origin: 0 0; transform-origin: 0 0;
} }
</style> </style>

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

@ -1,12 +1,12 @@
<template> <template>
<Adaptation class="pageBox"> <div class="pageBox">
<HeaderMenu @onChange="handleChange" class="header" /> <HeaderMenu @onChange="handleChange" class="header" :style="headerStyle"/>
<div class="content"> <Adaptation class="content" :headerHeight="headerHeight">
<Transition name="fade"> <Transition name="fade">
<router-view v-if="isShowContent" /> <router-view v-if="isShowContent" />
</Transition> </Transition>
</div>
</Adaptation> </Adaptation>
</div>
</template> </template>
<script> <script>
@ -19,14 +19,29 @@ export default {
name: "ji_ze_gao_su", name: "ji_ze_gao_su",
components: { components: {
HeaderMenu, HeaderMenu,
Adaptation, Adaptation
// ...modules // ...modules
}, },
data() { data() {
return { 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(){ mounted(){
getBoardBaseData().then(res => { getBoardBaseData().then(res => {
this.isShowContent = true; this.isShowContent = true;
@ -34,8 +49,18 @@ export default {
// Promise.all()getBoardBaseData().then(()=>{ // Promise.all()getBoardBaseData().then(()=>{
// this.isShowContent = true ; // this.isShowContent = true ;
// }); // });
window.addEventListener(
"resize",
_.debounce(this.calcHeaderScale.bind(this), 360)
);
this.calcHeaderScale();
}, },
methods: { methods: {
calcHeaderScale(){
let winW = window.innerWidth;
this.header.scale = winW / this.header.originW;
this.headerHeight = this.header.scale * this.header.originH;
},
handleChange(activeMenu) { handleChange(activeMenu) {
this.$route.path != activeMenu.path && this.$router.push(activeMenu.path); this.$route.path != activeMenu.path && this.$router.push(activeMenu.path);
} }
@ -66,15 +91,14 @@ export default {
} }
.header { .header {
height: 68px; position: fixed;
transform-origin: left top;
left: 0; top:0; z-index: 1000;
} }
.content { .content {
flex: 1;
height: 0;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
position: relative;
pointer-events: none; pointer-events: none;
::v-deep { ::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 SmartDevice from "./../Dialogs/SmartDevice/index.vue";
import Intermodulation from "./../Dialogs/Intermodulation/index.vue"; import Intermodulation from "./../Dialogs/Intermodulation/index.vue";
import FatigueWakesUp from "./../Dialogs/FatigueWakesUp/index.vue"; import FatigueWakesUp from "./../Dialogs/FatigueWakesUp/index.vue";
import { addInGraphHandle } from "./utils/map"
import { lngLatMap } from "./utils/buttonEvent";
export default { export default {
name: 'RoadAndEvents', name: 'RoadAndEvents',
@ -137,11 +139,15 @@ export default {
}, },
watch: { watch: {
isGisCompleted: { isGisCompleted: {
handler(bool) { async handler(bool) {
if (!bool) return; if (!bool) return;
this.tabContentData.forEach(item => { await Promise.allSettled((this.tabContentData || []).map(item => this.handleDeviceImmediate(item, true)))
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.active = item.title;
this.tabContentData = item.children; this.tabContentData = item.children;
}, },
handleDeviceImmediate(item, isDefault) { async handleDeviceImmediate(item, isDefault) {
const key = getHandleDeviceType(item) || `${this.active}/${item.title}`; const key = getHandleDeviceType(item) || `${this.active}/${item.title}`;
const status = item.status; const status = item.status;
@ -196,7 +202,7 @@ export default {
if (!eventMap[`${key}${status ? "_close" : ""}`]) return this.$emit("onClickItem", item); 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) { handleDevice: debounce(function (item) {
this.handleDeviceImmediate(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 { delay } from "@screen/utils/common";
import { Message } from "element-ui"; import { Message } from "element-ui";
import { EventTopics } from "@screen/utils/enum.js"; import { EventTopics } from "@screen/utils/enum.js";
import { debounce } from "lodash"; import { debounce, cloneDeep } from "lodash";
import Vue from "vue"; import Vue from "vue";
import { markerClusterIns, getContent } from "./map"; import { markerClusterIns, getContent } from "./map";
@ -155,7 +155,7 @@ export const eventMap = {
removeData removeData
); );
addDataPreHandle(removeData); addDataPreHandle(removeData);
markerClusterIns.addData(removeData); markerClusterIns.addData(removeData, isDefault);
cacheRemoveFunc[`地图路测设备/${item.title}`] = () => { cacheRemoveFunc[`地图路测设备/${item.title}`] = () => {
removeDataPreHandle(removeData); removeDataPreHandle(removeData);
@ -208,7 +208,7 @@ export const eventMap = {
) )
); );
addDataPreHandle(removeData); addDataPreHandle(removeData);
markerClusterIns.addData(removeData); markerClusterIns.addData(removeData, isDefault);
cacheRemoveFunc[`地图事件专题/${item.title}`] = () => { cacheRemoveFunc[`地图事件专题/${item.title}`] = () => {
removeDataPreHandle(removeData); removeDataPreHandle(removeData);
@ -255,7 +255,7 @@ export const eventMap = {
resolveDataOptions.call(this, item, options, "PerceiveEvent", isDefault) resolveDataOptions.call(this, item, options, "PerceiveEvent", isDefault)
); );
addDataPreHandle(removeData); addDataPreHandle(removeData);
markerClusterIns.addData(removeData); markerClusterIns.addData(removeData, isDefault);
loadingMessage?.close(); loadingMessage?.close();
@ -295,14 +295,18 @@ function addDataPreHandle(markers) {
} }
function removeDataPreHandle(markers) { function removeDataPreHandle(markers) {
// 完善校验逻辑 避免删除额外节点
const cb = (lngLatStr, markerData) => { const cb = (lngLatStr, markerData) => {
if (lngLatMap[lngLatStr]) { const lngLatArr = lngLatMap[lngLatStr];
if (lngLatMap[lngLatStr].length < 2) delete lngLatMap[lngLatStr]; if (lngLatArr) {
if (lngLatArr.length === 0) delete lngLatMap[lngLatStr];
else if (lngLatArr.length === 1 && lngLatArr[0] === markerData)
delete lngLatMap[lngLatStr];
else { else {
const findIndex = lngLatMap[lngLatStr].findIndex( const findIndex = lngLatArr.findIndex(
(removeData) => removeData === markerData (removeData) => removeData === markerData
); );
lngLatMap[lngLatStr].splice(findIndex, 1); if (findIndex !== -1) lngLatArr.splice(findIndex, 1);
} }
} }
}; };

132
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); return (this.map = Vue.prototype.mapIns);
} }
async addData(data) { async addData(data, isDefault) {
this.infoWindow?.close?.(); this.infoWindow?.close?.();
const graphInstance = window.graphInstance; if (!isDefault) {
console.log(data, "xxxxx"); marksAddInGraph(data);
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 (!data) return; if (!data) return;
if (!Array.isArray(data)) data = [data]; if (!Array.isArray(data)) data = [data];
@ -124,7 +67,7 @@ export class MarkerCluster {
"font-size:15px; background:#641f14; color:#a86358;", "font-size:15px; background:#641f14; color:#a86358;",
data data
); );
console.log();
this.markerCluster.addData(data); this.markerCluster.addData(data);
console.log( console.log(
"%c [ this.markerCluster ]-234-「map.js」", "%c [ this.markerCluster ]-234-「map.js」",
@ -398,4 +341,71 @@ function getStateSingle({ config, extData }) {
: extData.deviceState == 1; : 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(); 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; window.graphInstance = graph;
baseData.nodes.forEach(node => { graph.addNodes(baseData.nodes);
graph.addNode(node)
});
this.drawCongestionAreas(graph, 1404, 80); 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 = { export const eventSources = {
label: "事件源:", label: "事件源:",
key: "eventSources", key: "eventSource",
type: "select", type: "select",
options: { options: {
clearable: true,
options: [ options: [
{ {
key: "1", 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, // eventType: Number(this.index) + 1,
// stakeMark: (stakeMark && stakeMark[0] != null) ? ((stakeMark && stakeMark.length > 0) ? ('K' + stakeMark[0] + '+' + stakeMark[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; // return;
request({ request({
@ -181,6 +184,7 @@ export default {
data: { data: {
...formData, ...formData,
eventType: Number(this.index) + 1, eventType: Number(this.index) + 1,
eventState: 0,
stakeMark: (stakeMark && stakeMark[0] != null) ? ((stakeMark && stakeMark.length > 0) ? ('K' + stakeMark[0] + '+' + stakeMark[1]) : '') : '', stakeMark: (stakeMark && stakeMark[0] != null) ? ((stakeMark && stakeMark.length > 0) ? ('K' + stakeMark[0] + '+' + stakeMark[1]) : '') : '',
} }
}).then((result) => { }).then((result) => {
@ -191,6 +195,7 @@ export default {
Message.error("提交失败"); Message.error("提交失败");
}).finally(() => { }).finally(() => {
this.submitting = false; 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", key: "warningSource",
type: "select", type: "select",
options: { options: {
clearable: true,
options: [ options: [
{ {
key: "1", key: "1",
@ -113,6 +114,7 @@ export const gjSearchFormList = [
required: false, required: false,
type: "datePicker", type: "datePicker",
options: { options: {
style: 'width: 250px',
type: "datetimerange", type: "datetimerange",
format: "yyyy-MM-dd HH:mm:ss", format: "yyyy-MM-dd HH:mm:ss",
valueFormat: "yyyy-MM-dd HH:mm:ss", valueFormat: "yyyy-MM-dd HH:mm:ss",
@ -123,25 +125,16 @@ export const gjSearchFormList = [
label: "桩号:", label: "桩号:",
required: false, required: false,
}, },
// merge(cloneDeep(PresetFormItems.station), {
// options: {
// options: [
// {
// key: "endStakeMark[0]",
// },
// {
// key: "endStakeMark[1]",
// },
// ],
// },
// label: "结束桩号:",
// required: false,
// }),
]; ];
export const gzSearchFormList = [ export const gzSearchFormList = [
PresetFormItems.eventSources, PresetFormItems.eventSources,
PresetFormItems.eventType, merge(PresetFormItems.eventType, {
options: {
clearable: true,
},
}),
// PresetFormItems.eventType,
{ {
label: "方向:", label: "方向:",
key: "direction", key: "direction",

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

@ -5,7 +5,7 @@
<!-- 搜索栏 --> <!-- 搜索栏 -->
<div class="filter"> <div class="filter">
<div> <div>
<ButtonGradient @click="onAddNew" v-if="activeName != '1' && activeName != '2'"> <ButtonGradient @click="onAddNew" v-if="activeName == '0'">
<template #prefix> <template #prefix>
<img src="./images/insert.svg" /> <img src="./images/insert.svg" />
</template> </template>
@ -43,9 +43,10 @@
</div> </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> </div>
</template> </template>
@ -353,7 +354,7 @@ export default {
this.searchData = { this.searchData = {
...this.searchData, ...this.searchData,
eventType: data.eventType, eventType: data.eventType,
eventSources: data.eventSources, eventSource: data.eventSource,
warningSource: data?.warningSource || '', warningSource: data?.warningSource || '',
direction: data.direction, direction: data.direction,
startTime: daterange && daterange.length > 0 ? daterange[0] : "", 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; flex-basis: 816px; display: flex; flex-direction: column; justify-content: space-between;
} }
.share{ .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);} .arrow{ transform: rotateZ(90deg); left: 48%; top:calc(100% + 8px);}
.shareCon{ .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; 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{ .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; .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; .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; h4, p{ font-family: PangMenZhengDao; font-size: 15px; line-height: 22px; margin: 0; padding:0;

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

@ -1,6 +1,6 @@
<template> <template>
<div class="compBox"> <div class="compBox">
<div id="container" class="compCon"> <div id="container" class="compCon" ref="canvas">
</div> </div>
</div> </div>
</template> </template>
@ -12,22 +12,34 @@ export default {
name: 'sensors', name: 'sensors',
data(){ data(){
return { return {
graph:null
} }
}, },
components: { components: {
}, },
mounted(){ mounted(){
this.initGraph(); this.refresh();
window.addEventListener("resize",
_.debounce(this.refresh.bind(this), 1000)
)
}, },
methods: { 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( Graph.registerNode(
'sensor', 'sensor',
{ {
width: 180, width: 180,
height: 42, height: unitH,
markup: [ markup: [
{ {
tagName: 'rect', tagName: 'rect',
@ -97,8 +109,12 @@ export default {
}, },
true, true,
) )
if(this.graph){
this.graph.clearCells();
this.graph = null;
}
const graph = new Graph({ this.graph = new Graph({
container: document.getElementById('container'), container: document.getElementById('container'),
autoResize: true, autoResize: true,
grid: false, grid: false,
@ -114,8 +130,8 @@ export default {
}) })
function createSub(x, y, title) { const createSub = (x, y, title) => {
return graph.addNode({ return this.graph.addNode({
x, x,
y, y,
shape: 'sensor', shape: 'sensor',
@ -132,8 +148,8 @@ export default {
}) })
} }
function link(source, target, vertices) { const link = (source, target, vertices) => {
return graph.addEdge({ return this.graph.addEdge({
source: { source: {
cell: source, cell: source,
anchor: { anchor: {
@ -153,7 +169,7 @@ export default {
}) })
} }
const main = graph.addNode({ const main = this.graph.addNode({
shape: 'circle', shape: 'circle',
x: 310, x: 310,
y: 80, y: 80,
@ -184,7 +200,7 @@ export default {
] ]
subItems.forEach((item, index) => { subItems.forEach((item, index) => {
let temp = createSub(0, index * 68, item); let temp = createSub(0, index * average, item);
link(main, temp); 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 = { var options = {
color: ["#07A3FB"], color: ["#07A3FB"],
grid: { grid: {
left: "0%", left: "2px",
right: "8%", right: "8%",
bottom: "0%", bottom: "0%",
top: "25px", top: "28px",
containLabel: true, containLabel: true,
}, },
tooltip: { 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 = { var options = {
color: ["#E29E37"], color: ["#E29E37"],
grid: { grid: {
left: "0%", left: "2px",
right: "0%", right: "0%",
bottom: "0%", bottom: "0%",
top: "25px", top: "28px",
containLabel: true, containLabel: true,
}, },
tooltip: { 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", trigger: "axis",
}, },
grid: { grid: {
left: "0%", left: "2px",
right: "0%", right: "0%",
bottom: "0%", bottom: "0%",
top: "25px", top: "28px",
containLabel: true, containLabel: true,
}, },

4
ruoyi-ui/vue.config.js

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

Loading…
Cancel
Save