Browse Source

更改

wangqin
zhangzhang 12 months ago
parent
commit
4b43de8542
  1. 38
      ruoyi-ui/src/views/JiHeExpressway/components/InputSearch/index.vue
  2. 63
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/governanceAnalysis/components/channelAnalytics/index.vue
  3. 63
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/governanceAnalysis/components/eventTypeAnalysis/index.vue
  4. 2
      ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/components/auditAnalytics/assets/charts.js
  5. 2
      ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/components/channelAnalytics/assets/charts.js
  6. 2
      ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/components/eventTypeAnalysis/assets/charts.js

38
ruoyi-ui/src/views/JiHeExpressway/components/InputSearch/index.vue

@ -23,8 +23,8 @@
v-model="value" v-model="value"
:placeholder="placeholder" :placeholder="placeholder"
clearable clearable
@change="handleSearch" @keyup.enter.native="handleSearch"
></ElInput> ></ElInput>
<img src="./search.svg" v-show="!disable" @click="onOpenPop" /> <img src="./search.svg" v-show="!disable" @click="onOpenPop" />
</div> </div>
<div <div
@ -35,7 +35,7 @@
@click="onOpenPop" @click="onOpenPop"
> >
<span>{{ placeholder }}</span> <span>{{ placeholder }}</span>
<img src="./search.svg"/> <img src="./search.svg" />
</div> </div>
<div style="width: 100%; max-height: 360px" v-show="visible"> <div style="width: 100%; max-height: 360px" v-show="visible">
@ -128,24 +128,28 @@ export default {
}; };
}, },
}, },
mounted(){ mounted() {
// document.getElementById("app") // document.getElementById("app")
document.addEventListener("click" , ()=>{ document.addEventListener(
if(!this.isClickedBtn){ "click",
setTimeout(() => { () => {
this.visible = false; if (!this.isClickedBtn) {
}, 100) setTimeout(() => {
} this.visible = false;
this.isClickedBtn = false; }, 100);
} , false) }
this.isClickedBtn = false;
},
false
);
}, },
methods: { methods: {
onOpenPop(){ onOpenPop() {
this.isClickedBtn = true; this.isClickedBtn = true;
this.visible = !this.visible; this.visible = !this.visible;
}, },
onClickMask(){ onClickMask() {
this.visible = false; this.visible = false;
}, },
handleShow() { handleShow() {
@ -193,7 +197,7 @@ export default {
console.log("catch"); console.log("catch");
}); });
} }
} },
}, },
}; };
</script> </script>

63
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/governanceAnalysis/components/channelAnalytics/index.vue

@ -1,56 +1,52 @@
<template> <template>
<div class='congestion'> <div class="congestion">
<WgtTitle :title="'事件源分析'"></WgtTitle> <WgtTitle :title="'事件源分析'"></WgtTitle>
<div class="board"> <div class="board">
<div class="charts keep-ratio " id="channelAnalytics"></div> <div class="charts keep-ratio" id="channelAnalytics"></div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import WgtTitle from "@screen/pages/perception/widgets/title"; import WgtTitle from "@screen/pages/perception/widgets/title";
import * as echarts from "echarts"; import * as echarts from "echarts";
import chartsStatistics from "./assets/charts"; import chartsStatistics from "./assets/charts";
import { eventSourceRatio } from "@/api/event/governanceAnalysis" import { eventSourceRatio } from "@/api/event/governanceAnalysis";
export default { export default {
name: 'RailWayDay', name: "RailWayDay",
components: { components: {
WgtTitle WgtTitle,
}, },
data() { data() {
return { return {};
}
}, },
created() { created() {},
},
methods: { methods: {
getEventSourceRatio() { getEventSourceRatio() {
return eventSourceRatio().then((response) => { return eventSourceRatio().then((response) => {
console.log("response", response) console.log("response", response);
let data = [] let data = [];
let total = null let total = null;
let nameData = [] let nameData = [];
const newObj = { value: 1, name: "" }; const newObj = { value: 1, name: "" };
for (let i = 0; i < response.data.length; i++) { for (let i = 0; i < response.data.length; i++) {
data.push({ data.push({
value: response.data[i].num, value: response.data[i].num,
name: response.data[i].eventSourceName name: response.data[i].eventSourceName,
}) });
total += response.data[i].num; total += response.data[i].num;
} }
console.log("total", total) console.log("total", total);
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
// if (i % 2 === 0) { // if (i % 2 === 0) {
// data.splice(i + 1, 0, newObj) // data.splice(i + 1, 0, newObj)
// } // }
if (data[i].name != "") { if (data[i].name != "") {
nameData.push(data[i].name) nameData.push(data[i].name);
} }
} }
console.log(6666, data, nameData) console.log(6666, data, nameData);
chartsStatistics.legend.formatter = function (name) { chartsStatistics.legend.formatter = function (name) {
let tarValue = 0; let tarValue = 0;
for (let i = 0; i < response.data.length; i++) { for (let i = 0; i < response.data.length; i++) {
@ -59,30 +55,30 @@ export default {
} }
} }
var percert = total == 0 ? 0 : ((tarValue / total) * 100).toFixed(2); var percert = total == 0 ? 0 : ((tarValue / total) * 100).toFixed(2);
return `{text|${name}} {number|${percert}%}`; return `{text|${name}} {number|${tarValue} 起 } {number|${percert}%}`;
}; };
chartsStatistics.legend.data = nameData; chartsStatistics.legend.data = nameData;
chartsStatistics.title[0].text = total; chartsStatistics.title[0].text = total;
// chartsStatistics.tooltip.show = false; // chartsStatistics.tooltip.show = false;
// chartsStatistics.series[1].data[0].value = total; // chartsStatistics.series[1].data[0].value = total;
chartsStatistics.series[2].data = data; chartsStatistics.series[2].data = data;
}) });
} },
}, },
async mounted() { async mounted() {
await this.getEventSourceRatio() await this.getEventSourceRatio();
setTimeout(() => { setTimeout(() => {
this.$nextTick(() => { this.$nextTick(() => {
var myChart = echarts.init(document.getElementById('channelAnalytics')); var myChart = echarts.init(document.getElementById("channelAnalytics"));
myChart.setOption(chartsStatistics); myChart.setOption(chartsStatistics);
}); });
}); });
}, },
} };
</script> </script>
<style lang='scss' scoped> <style lang="scss" scoped>
.congestion { .congestion {
width: 100%; width: 100%;
@ -94,11 +90,15 @@ export default {
border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px;
opacity: 1; opacity: 1;
border: 1px solid; border: 1px solid;
border-image: linear-gradient(360deg, rgba(55, 231, 255, 0.3), rgba(55, 231, 255, 0)) 1 1; border-image: linear-gradient(
360deg,
rgba(55, 231, 255, 0.3),
rgba(55, 231, 255, 0)
)
1 1;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
} }
} }
@ -107,4 +107,3 @@ export default {
width: 100%; width: 100%;
} }
</style> </style>

63
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/governanceAnalysis/components/eventTypeAnalysis/index.vue

@ -1,53 +1,49 @@
<template> <template>
<div class='congestion'> <div class="congestion">
<WgtTitle :title="'事件类型分析'"></WgtTitle> <WgtTitle :title="'事件类型分析'"></WgtTitle>
<div class="board"> <div class="board">
<div class="charts keep-ratio " id="eventTypeAnalysis"></div> <div class="charts keep-ratio" id="eventTypeAnalysis"></div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import WgtTitle from "@screen/pages/perception/widgets/title"; import WgtTitle from "@screen/pages/perception/widgets/title";
import * as echarts from "echarts"; import * as echarts from "echarts";
import chartsStatistics from "./assets/charts"; import chartsStatistics from "./assets/charts";
import { allEventNum } from "@/api/event/governanceAnalysis" import { allEventNum } from "@/api/event/governanceAnalysis";
export default { export default {
name: 'RailWayDay', name: "RailWayDay",
components: { components: {
WgtTitle WgtTitle,
}, },
data() { data() {
return { return {};
}
}, },
created() { created() {},
},
methods: { methods: {
getAllEventNum() { getAllEventNum() {
return allEventNum().then((response) => { return allEventNum().then((response) => {
console.log("response", response) console.log("response", response);
let data = [] let data = [];
let total = null let total = null;
let nameData = [] let nameData = [];
const newObj = { value: 1, name: "" }; const newObj = { value: 1, name: "" };
for (let i = 0; i < response.data.length; i++) { for (let i = 0; i < response.data.length; i++) {
data.push({ data.push({
value: response.data[i].num, value: response.data[i].num,
name: response.data[i].eventName name: response.data[i].eventName,
}) });
total += response.data[i].num; total += response.data[i].num;
} }
console.log("total88", total) console.log("total88", total);
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
// if (i % 2 === 0) { // if (i % 2 === 0) {
// data.splice(i + 1, 0, newObj) // data.splice(i + 1, 0, newObj)
// } // }
if (data[i].name != "") { if (data[i].name != "") {
nameData.push(data[i].name) nameData.push(data[i].name);
} }
} }
chartsStatistics.legend.data = nameData; chartsStatistics.legend.data = nameData;
@ -59,27 +55,29 @@ export default {
} }
} }
var percert = total == 0 ? 0 : ((tarValue / total) * 100).toFixed(2); var percert = total == 0 ? 0 : ((tarValue / total) * 100).toFixed(2);
return `{text|${name}} {number|${percert}%}`; return `{text|${name}} {number|${tarValue} 起 } {number|${percert}%}`;
}; };
chartsStatistics.title[0].text = total; chartsStatistics.title[0].text = total;
chartsStatistics.series[2].data = data; chartsStatistics.series[2].data = data;
}) });
} },
}, },
async mounted() { async mounted() {
await this.getAllEventNum() await this.getAllEventNum();
setTimeout(() => { setTimeout(() => {
this.$nextTick(() => { this.$nextTick(() => {
var myChart = echarts.init(document.getElementById('eventTypeAnalysis')); var myChart = echarts.init(
document.getElementById("eventTypeAnalysis")
);
myChart.setOption(chartsStatistics); myChart.setOption(chartsStatistics);
}); });
}); });
}, },
} };
</script> </script>
<style lang='scss' scoped> <style lang="scss" scoped>
.congestion { .congestion {
width: 100%; width: 100%;
@ -91,11 +89,15 @@ export default {
border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px;
opacity: 1; opacity: 1;
border: 1px solid; border: 1px solid;
border-image: linear-gradient(360deg, rgba(55, 231, 255, 0.3), rgba(55, 231, 255, 0)) 1 1; border-image: linear-gradient(
360deg,
rgba(55, 231, 255, 0.3),
rgba(55, 231, 255, 0)
)
1 1;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
} }
} }
@ -104,4 +106,3 @@ export default {
width: 100%; width: 100%;
} }
</style> </style>

2
ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/components/auditAnalytics/assets/charts.js

@ -117,7 +117,7 @@ var options = {
} }
var percert = total == 0 ? 0 : ((tarValue / total) * 100).toFixed(2); var percert = total == 0 ? 0 : ((tarValue / total) * 100).toFixed(2);
const arr = name + " " + tarValue; const arr = name + " " + tarValue;
return `{text|${name}} {number|${percert}%}`; return `{text|${name}} {number|${tarValue} 起 } {number|${percert}%}`;
}, },
pageIconColor: "#fff", pageIconColor: "#fff",
pageIconSize: 10, pageIconSize: 10,

2
ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/components/channelAnalytics/assets/charts.js

@ -118,7 +118,7 @@ var options = {
} }
var percert = total == 0 ? 0 : ((tarValue / total) * 100).toFixed(2); var percert = total == 0 ? 0 : ((tarValue / total) * 100).toFixed(2);
const arr = name + " " + tarValue; const arr = name + " " + tarValue;
return `{text|${name}} {number|${percert}%}`; return `{text|${name}} {number|${tarValue} 起 } {number|${percert}%}`;
}, },
pageIconColor: "#fff", pageIconColor: "#fff",
pageIconSize: 10, pageIconSize: 10,

2
ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/components/eventTypeAnalysis/assets/charts.js

@ -143,7 +143,7 @@ var options = {
} }
var percert = total == 0 ? 0 : ((tarValue / total) * 100).toFixed(2); var percert = total == 0 ? 0 : ((tarValue / total) * 100).toFixed(2);
const arr = name + " " + tarValue; const arr = name + " " + tarValue;
return `{text|${name}} {number|${percert}%}`; return `{text|${name}} {number|${tarValue} 起 } {number|${percert}%}`;
}, },
pageIconColor: "#fff", pageIconColor: "#fff",
pageIconSize: 10, pageIconSize: 10,

Loading…
Cancel
Save