Ver Fonte

首页部分联调

zhangliang2 há 3 anos atrás
pai
commit
3572ed054c

+ 3 - 1
src/api/index.js

@@ -5,13 +5,15 @@ import sceneLibrary from './sceneLibrary.js' // 场景库
 import workManagement from './workManagement.js' // 工作管理
 import modelLibrary from './modelLibrary.js' // 模型库
 import algorithmsLibrary from './algorithmsLibrary.js' // 算法库
+import mainPage from './mainPage.js' // 首页
 
 const api = {
     common,
     sceneLibrary,
     workManagement,
     modelLibrary,
-    algorithmsLibrary
+    algorithmsLibrary,
+    mainPage
 }
 
 export default api;

+ 22 - 0
src/api/mainPage.js

@@ -0,0 +1,22 @@
+const basePart = '/simulation/resource/server';
+
+const queryAllNum = basePart + '/homePage/queryAllNum'; // 首页数据概览(前四个)
+
+const selectRunProjectBySy = basePart + '/homePage/selectRunProjectBySy'; // 近一周运行运行项目数量
+const selectRunTaskBySy = basePart + '/homePage/selectRunTaskBySy'; // 近一周运行任务数量
+
+const selectRunProjectByState = basePart + '/homePage/selectRunProjectByState'; // 项目运行状态统计-饼图
+const selectRunTaskByState = basePart + '/homePage/selectRunTaskByState'; // 任务运行状态统计-饼图
+const selectEvaluationLevel = basePart + '/homePage/selectEvaluationLevel'; // 评测等级分布-饼图
+
+
+export default {
+    queryAllNum,
+
+    selectRunProjectBySy,
+    selectRunTaskBySy,
+
+    selectRunProjectByState,
+    selectRunTaskByState,
+    selectEvaluationLevel
+}

+ 0 - 212
src/components/echarts/lineChart2.vue

@@ -1,212 +0,0 @@
-<template>
-    <div
-        class="linechart"
-        :id="id"
-        style="width: calc(100vw - 240px); height: calc(48vh - 165px)"
-    ></div>
-</template>
-
-<script>
-import echarts from "echarts";
-
-export default {
-    name: "lineChart",
-    props: {
-        id: {
-            default: "a",
-            type: String,
-        },
-        LineChartData: {
-            text: String, //标题  不需要标题可不传
-            titleSize: {
-                //标题大小
-                type: Number,
-                default: 20,
-            },
-            download: {
-                //是否显示下载按钮
-                type: Boolean,
-                default: false,
-            },
-            data: [],
-        },
-    },
-    data() {
-        return {
-            tipData: [], //线数据
-            showData: [], //展示数据
-            charts: "",
-            // text: this.LineChartData.text, //大标题
-            // titleSize: this.LineChartData.titleSize, //标题大小
-            // download: this.LineChartData.download,
-        };
-    },
-    computed: {
-        text() {
-            return this.LineChartData.text;
-        },
-        titleSize() {
-            return this.LineChartData.titleSize;
-        },
-        download() {
-            return this.LineChartData.download;
-        },
-    },
-    mounted() {
-        // this.drawLine();
-        // import * as echarts from "echarts";
-
-        // 基于准备好的dom,初始化echarts实例
-        this.charts = this.$echarts.init(document.getElementById(this.id));
-
-        let option = {
-            xAxis: {
-                type: "category",
-                boundaryGap: false,
-                data: [
-                    "星期一",
-                    "星期二",
-                    "星期三",
-                    "星期四",
-                    "星期五",
-                    "星期六",
-                    "星期日",
-                ],
-            },
-            yAxis: {},
-            series: [
-                {
-                    data: [60, 72, 48, 63, 39, 99, 81],
-                    type: "line",
-                    smooth: true,
-                    lineStyle: {
-                        normal: {
-                            color: "#3397FF",
-                        },
-                    },
-                    areaStyle: {
-                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
-                            { offset: 0, color: "rgba(51, 151, 255, 0.7)" },
-                            { offset: 1, color: "rgba(170, 197, 255, 0.5)" },
-                        ]),
-                        // color: "#aac5ff",
-                    },
-                },
-            ],
-            grid: {
-                top: "10%",
-                left: "20px",
-                right: "20px",
-                bottom: "10%",
-                containLabel: true,
-            },
-        };
-        this.charts.setOption(option);
-    },
-    methods: {
-        //绘制图表
-        drawLine() {
-            // 基于准备好的dom,初始化echarts实例
-            let id = "echartBar" + Math.random() * 1000;
-            this.$el.setAttribute("id", id);
-            let myChartContainer = document.getElementById(id);
-            // let myChartChina = echarts.init(myChartContainer);
-            let myChartChina = echarts.init("aa");
-            // 绘制图表
-            let optionMap = {
-                //折线图配置数据
-                color: ["#6cacaf", "#e4a526", "#e4391d", "#a1cb37", "#8c97cb"],
-                title: {
-                    x: "center",
-                    text: this.text,
-                    textStyle: {
-                        fontSize: this.titleSize,
-                    },
-                },
-                tooltip: {
-                    trigger: "axis",
-                },
-                legend: {
-                    top: [30],
-                    data: this.tipData,
-                },
-                grid: {
-                    left: "3%",
-                    right: "4%",
-                    bottom: "3%",
-                    containLabel: true,
-                },
-                toolbox: {
-                    show: this.download,
-                    top: [5],
-                    right: [20],
-                    feature: {
-                        saveAsImage: {},
-                    },
-                },
-                xAxis: {
-                    interval: ["0"], //标签显示间隔
-                    type: "category",
-                    boundaryGap: false,
-                    data: [
-                        "1月",
-                        "2月",
-                        "3月",
-                        "4月",
-                        "5月",
-                        "6月",
-                        "7月",
-                        "8月",
-                        "9月",
-                        "10月",
-                        "11月",
-                        "12月",
-                    ], //x轴数据
-                },
-                yAxis: {
-                    name: "(万元)",
-                    nameGap: [10],
-                    type: "value",
-                },
-                series: this.showData,
-            };
-            myChartChina.setOption(optionMap);
-            window.onresize = function () {
-                myChartChina.resize();
-            };
-        },
-    },
-    watch: {
-        "LineChartData.data": function (val) {
-            this.tipData = [];
-            this.showData = [];
-            for (let i = 0; i < val.length; i++) {
-                let obj = {
-                    //折线图需要的数据结构
-                    name: "",
-                    type: "line",
-                    data: [],
-                };
-                obj.name = val[i].name;
-                this.tipData.push(val[i].name);
-                for (let j = 0; j < val[i].monthlySales.length; j++) {
-                    obj.data.push(parseFloat(val[i].monthlySales[j]));
-                }
-                this.showData.push(obj);
-            }
-            this.drawLine();
-        },
-    },
-    destroyed() {
-        console.log("destroyed");
-        this.charts.dispose();
-    },
-};
-</script>
-
-
-<style lang='less' scoped>
-.linechart {
-    margin: 0 auto;
-}
-</style>

+ 167 - 0
src/components/echarts/lineChartA.vue

@@ -0,0 +1,167 @@
+<template>
+    <div
+        class="linechart"
+        :id="id"
+        style="width: calc(100vw - 240px); height: calc(48vh - 165px)"
+    ></div>
+</template>
+
+<script>
+import echarts from "echarts";
+
+export default {
+    name: "lineChartA",
+    props: {
+        id: {
+            default: "a",
+            type: String,
+        },
+        dataList: {
+            default: function () {
+                return [];
+            },
+            type: Array,
+        },
+    },
+    data() {
+        return {
+            tipData: [], //线数据
+            showData: [], //展示数据
+            charts: "",
+        };
+    },
+
+    watch: {
+        dataList(val) {
+            if (val.length > 0) {
+                this.initStateList();
+            }
+        },
+    },
+
+    methods: {
+        initStateList() {
+            let xData = [];
+            let yData = [];
+            for (let index = 0; index < this.dataList.length; index++) {
+                const element = this.dataList[index];
+                xData.push(element.toDate.slice(5));
+                yData.push(element.num);
+            }
+
+            let option = {
+                tooltip: {
+                    //提示框,可以在全局也可以在
+                    trigger: "item", //提示框的样式
+                    formatter: "{b}: {c}",
+                    color: "#000", //提示框的背景色
+                    textStyle: {
+                        //提示的字体样式
+                        color: "#ffffff",
+                    },
+                },
+                xAxis: {
+                    type: "category",
+                    boundaryGap: false,
+                    // data: [
+                    //     "星期一",
+                    //     "星期二",
+                    //     "星期三",
+                    //     "星期四",
+                    //     "星期五",
+                    //     "星期六",
+                    //     "星期日",
+                    // ],
+                    // data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
+                    data: xData,
+                },
+                yAxis: {
+                    minInterval: 1
+                },
+                series: [
+                    {
+                        // data: [60, 72, 48, 63, 39, 99, 81],
+                        data: yData,
+                        type: "line",
+                        smooth: true,
+                        symbol: "circle",
+                        symbolSize: 6,
+                        lineStyle: {
+                            normal: {
+                                width: 1.5,
+                                color: "#3397FF",
+                            },
+                        },
+                        areaStyle: {
+                            color: new echarts.graphic.LinearGradient(
+                                0,
+                                0,
+                                0,
+                                1,
+                                [
+                                    {
+                                        offset: 0,
+                                        color: "rgba(51, 151, 255, 0.42)",
+                                    },
+                                    {
+                                        offset: 1,
+                                        color: "rgba(170, 197, 255, 0.12)",
+                                    },
+                                ]
+                            ),
+                            // color: "#aac5ff",
+                        },
+                        itemStyle: {
+                            normal: {
+                                // 拐点上显示数值
+                                // label: {
+                                //     show: true,
+                                // },
+                                // borderColor: "#3397FF", // 拐点边框颜色
+                                color: "#3397FF",
+                                lineStyle: {
+                                    // width: 3, // 设置线宽
+                                    // type: "dotted", //'dotted'虚线 'solid'实线
+                                    // normal: {
+                                    //     color: "#000",
+                                    // },
+                                },
+                            },
+                        },
+                    },
+                ],
+                grid: {
+                    top: "10%",
+                    left: "20px",
+                    right: "20px",
+                    bottom: "10%",
+                    containLabel: true,
+                },
+            };
+            this.charts.setOption(option);
+        },
+    },
+
+    mounted() {
+        this.charts = this.$echarts.init(document.getElementById(this.id));
+
+        this.$nextTick(() => {
+            window.addEventListener("resize", () => {
+                this.charts.resize();
+            });
+        });
+    },
+
+    destroyed() {
+        console.log("destroyed");
+        this.charts.dispose();
+    },
+};
+</script>
+
+
+<style lang='less' scoped>
+.linechart {
+    margin: 0 auto;
+}
+</style>

+ 7 - 3
src/components/echarts/pieChart.vue

@@ -34,6 +34,10 @@ export default {
             default: "a",
             type: String,
         },
+        seriesName: {
+            default: "统计",
+            type: String,
+        },
         stateName: {
             default: "name",
             type: String,
@@ -78,7 +82,7 @@ export default {
                     //提示框,可以在全局也可以在
                     trigger: "item", //提示框的样式
                     // formatter: "{a} <br/>{b}: {c} ({d}%)",
-                    formatter: "{a} <br/>{b}:{d}%",
+                    formatter: "{a} <br/>{b} ({d}%)",
                     color: "#000", //提示框的背景色
                     textStyle: {
                         //提示的字体样式
@@ -87,7 +91,7 @@ export default {
                 },
                 series: [
                     {
-                        name: "状态统计",
+                        name: this.seriesName,
                         type: "pie",
                         // radius: '55%',
                         data,
@@ -110,7 +114,7 @@ export default {
         });
     },
     destroyed() {
-        console.log("destroyed");
+        // console.log("destroyed");
         this.charts.dispose();
     },
 };

+ 0 - 402
src/components/echarts/pieChart1.vue

@@ -1,402 +0,0 @@
-<template>
-    <div
-        class="linechart"
-        :id="id"
-        style="width: calc(37.5vw - 180px); height: calc(42vh - 165px)"
-    ></div>
-    <!-- style="width: calc(33vw - 180px); height: calc(42vh - 165px)" -->
-</template>
-
-<script>
-//import  from '';
-
-export default {
-    name: "pieChart", //
-    components: {},
-    data() {
-        return {
-            charts: "",
-        };
-    },
-
-    props: {
-        id: {
-            default: "a",
-            type: String,
-        },
-    },
-
-    computed: {},
-
-    methods: {},
-
-    mounted() {
-        // 基于准备好的dom,初始化echarts实例
-        this.charts = this.$echarts.init(document.getElementById(this.id));
-
-        let option = {
-            tooltip: {
-                //提示框,可以在全局也可以在
-                trigger: "item", //提示框的样式
-                formatter: "{a} <br/>{b}: {c} ({d}%)",
-                color: "#000", //提示框的背景色
-                textStyle: {
-                    //提示的字体样式
-                    color: "#ffffff",
-                },
-            },
-            series: [
-                {
-                    type: "pie",
-                    // radius: '55%',
-                    data: [
-                        {
-                            value: 335,
-                            name: "图例一",
-                            itemStyle: {
-                                normal: {
-                                    color: "#5B8FF9",
-                                },
-                            },
-                        },
-                        {
-                            value: 1234,
-                            name: "图例二",
-                            itemStyle: {
-                                normal: {
-                                    color: "#61DDAA",
-                                },
-                            },
-                        },
-                        {
-                            value: 548,
-                            name: "图例三",
-                            itemStyle: {
-                                normal: {
-                                    color: "#65789B",
-                                },
-                            },
-                        },
-                        {
-                            value: 153,
-                            name: "图例四",
-                            itemStyle: {
-                                normal: {
-                                    color: "#F6BD16",
-                                },
-                            },
-                        },
-                    ],
-                    // left: 0,
-                    // right: "50%",
-                    top: 10,
-                    // bottom: 0,
-                },
-            ],
-        };
-
-        let optionX = {
-            tooltip: {
-                //提示框,可以在全局也可以在
-                trigger: "item", //提示框的样式
-                formatter: "{a} <br/>{b}: {c} ({d}%)",
-                color: "#000", //提示框的背景色
-                textStyle: {
-                    //提示的字体样式
-                    color: "#ffffff",
-                },
-            },
-            series: [
-                {
-                    type: "pie",
-                    // radius: '55%',
-                    data: [
-                        {
-                            value: 335,
-                            name: "未执行",
-                            itemStyle: {
-                                normal: {
-                                    color: "#5B8FF9",
-                                },
-                            },
-                        },
-                        {
-                            value: 1234,
-                            name: "执行中",
-                            itemStyle: {
-                                normal: {
-                                    color: "#61DDAA",
-                                },
-                            },
-                        },
-                        {
-                            value: 548,
-                            name: "已中止",
-                            itemStyle: {
-                                normal: {
-                                    color: "#65789B",
-                                },
-                            },
-                        },
-                        {
-                            value: 153,
-                            name: "已完成",
-                            itemStyle: {
-                                normal: {
-                                    color: "#F6BD16",
-                                },
-                            },
-                        },
-                    ],
-                    top: 10,
-                },
-            ],
-        };
-
-        let optionY = {
-            tooltip: {
-                //提示框,可以在全局也可以在
-                trigger: "item", //提示框的样式
-                formatter: "{a} <br/>{b}: {c} ({d}%)",
-                color: "#000", //提示框的背景色
-                textStyle: {
-                    //提示的字体样式
-                    color: "#ffffff",
-                },
-            },
-            series: [
-                {
-                    type: "pie",
-                    // radius: '55%',
-                    data: [
-                        {
-                            value: 435,
-                            name: "未执行",
-                            itemStyle: {
-                                normal: {
-                                    color: "#5B8FF9",
-                                },
-                            },
-                        },
-                        {
-                            value: 234,
-                            name: "执行中",
-                            itemStyle: {
-                                normal: {
-                                    color: "#61DDAA",
-                                },
-                            },
-                        },
-                        {
-                            value: 138,
-                            name: "已中止",
-                            itemStyle: {
-                                normal: {
-                                    color: "#65789B",
-                                },
-                            },
-                        },
-                        {
-                            value: 753,
-                            name: "已完成",
-                            itemStyle: {
-                                normal: {
-                                    color: "#F6BD16",
-                                },
-                            },
-                        },
-                    ],
-                    top: 10,
-                },
-            ],
-        };
-
-        let optionZ = {
-            tooltip: {
-                //提示框,可以在全局也可以在
-                trigger: "item", //提示框的样式
-                formatter: "{a} <br/>{b}: {c} ({d}%)",
-                color: "#000", //提示框的背景色
-                textStyle: {
-                    //提示的字体样式
-                    color: "#ffffff",
-                },
-            },
-            series: [
-                {
-                    type: "pie",
-                    // radius: '55%',
-                    data: [
-                        {
-                            value: 855,
-                            name: "优秀(G)",
-                            itemStyle: {
-                                normal: {
-                                    color: "#5B8FF9",
-                                },
-                            },
-                        },
-                        {
-                            value: 693,
-                            name: "良好(A)",
-                            itemStyle: {
-                                normal: {
-                                    color: "#61DDAA",
-                                },
-                            },
-                        },
-                        {
-                            value: 548,
-                            name: "一般(M)",
-                            itemStyle: {
-                                normal: {
-                                    color: "#65789B",
-                                },
-                            },
-                        },
-                        {
-                            value: 153,
-                            name: "较差(P)",
-                            itemStyle: {
-                                normal: {
-                                    color: "#F6BD16",
-                                },
-                            },
-                        },
-                    ],
-                    top: 10,
-                },
-            ],
-        };
-
-        let option1 = {
-            legend: {
-                orient: "vertical",
-                x: "right",
-                // y:'center',
-                data: ["图例一", "图例二", "图例三", "图例四"],
-            },
-            series: [
-                {
-                    type: "pie",
-                    radius: ["50%", "70%"],
-                    avoidLabelOverlap: false,
-                    color: ["#5B8FF9", "#61DDAA", "#65789B", "#F6BD16"],
-                    label: {
-                        show: false,
-                        position: "center",
-                        emphasis: {
-                            show: true,
-                        },
-                    },
-                    rich: {
-                        padding: [0, 0, 0, 0],
-                    },
-                    padding: [0, 10, 10, 10],
-                    labelLine: {
-                        show: false,
-                    },
-                    emphasis: {
-                        label: {
-                            show: true,
-                            fontSize: "30",
-                            fontWeight: "bold",
-                        },
-                    },
-                    data: [
-                        { value: 335, name: "图例一" },
-                        { value: 310, name: "图例二" },
-                        { value: 234, name: "图例三" },
-                        { value: 135, name: "图例四" },
-                    ],
-                },
-            ],
-        };
-
-        let option2 = {
-            tooltip: {
-                //提示框,可以在全局也可以在
-                trigger: "item", //提示框的样式
-                formatter: "{a} <br/>{b}: {c} ({d}%)",
-                color: "#000", //提示框的背景色
-                textStyle: {
-                    //提示的字体样式
-                    color: "#ffffff",
-                },
-            },
-            legend: {
-                //图例
-                orient: "vertical", //图例的布局,竖直    horizontal为水平
-                x: "right", //图例显示在右边
-                data: ["图例一", "图例二", "图例三", "图例四"],
-                textStyle: {
-                    //图例文字的样式
-                    color: "#333", //文字颜色
-                    fontSize: 12, //文字大小
-                },
-            },
-            series: [
-                {
-                    name: "访问来源",
-                    type: "pie", //环形图的type和饼图相同
-                    radius: ["50%", "70%"], //饼图的半径,第一个为内半径,第二个为外半径
-                    avoidLabelOverlap: false,
-                    color: ["#5B8FF9", "#61DDAA", "#65789B", "#F6BD16"],
-                    label: {
-                        normal: {
-                            //正常的样式
-                            show: true,
-                            position: "left",
-                        },
-                        emphasis: {
-                            //选中时候的样式
-                            show: true,
-                            textStyle: {
-                                fontSize: "20",
-                                fontWeight: "bold",
-                            },
-                        },
-                    }, //提示文字
-                    labelLine: {
-                        normal: {
-                            show: false,
-                        },
-                    },
-                    data: [
-                        { value: 335, name: "图例一" },
-                        { value: 310, name: "图例二" },
-                        { value: 234, name: "图例三" },
-                        { value: 135, name: "图例四" },
-                    ],
-                },
-            ],
-        };
-
-        if (this.id === "pieB") {
-            this.charts.setOption(option2);
-        } else if (this.id === "pieX") {
-            this.charts.setOption(optionX);
-        } else if (this.id === "pieY") {
-            this.charts.setOption(optionY);
-        } else if (this.id === "pieZ") {
-            this.charts.setOption(optionZ);
-        } else {
-            this.charts.setOption(option);
-        }
-
-        // window.onresize = function () {
-        //     this.charts.resize();
-        // };
-    },
-    destroyed() {
-        console.log("destroyed");
-        this.charts.dispose();
-    },
-};
-</script>
-
-<style lang='less' scoped>
-.linechart {
-    margin: 0 auto;
-}
-</style>

+ 145 - 0
src/components/echarts/pieChartA.vue

@@ -0,0 +1,145 @@
+<template>
+    <div
+        class="linechart"
+        :id="id"
+        style="width: calc(37.5vw - 180px); height: calc(42vh - 165px)"
+    ></div>
+</template>
+
+<script>
+//import  from '';
+
+export default {
+    name: "pieChart", //
+    components: {},
+    data() {
+        return {
+            charts: "",
+            colors: [
+                "#5B8FF9",
+                "#61DDAA",
+                "#65789B",
+                "#F6BD16",
+
+                "#FF5C5C",
+                "#4671C6",
+                "#7CCE7A",
+                "#FFC655",
+                "#4BC2DF",
+                "#00A476",
+                "#FF7D46",
+                "#A45DB2",
+            ],
+        };
+    },
+
+    props: {
+        id: {
+            default: "a",
+            type: String,
+        },
+        seriesName: {
+            default: "统计",
+            type: String,
+        },
+        stateName: {
+            default: "name",
+            type: String,
+        },
+        dataList: {
+            default: function () {
+                return [];
+            },
+            type: Array,
+        },
+    },
+
+    watch: {
+        dataList(val) {
+            if (val.length > 0) {
+                this.initStateList();
+            }
+        },
+    },
+
+    methods: {
+        initStateList() {
+            let dataList = this.dataList;
+
+            let data = [];
+
+            for (let index = 0; index < dataList.length; index++) {
+                const element = dataList[index];
+                data[index] = {
+                    value: element.num,
+                    name: element[this.stateName] + "\n" + element.num,
+                    itemStyle: {
+                        normal: {
+                            color: this.colors[index],
+                        },
+                    },
+                };
+            }
+
+            let option = {
+                tooltip: {
+                    //提示框,可以在全局也可以在
+                    trigger: "item", //提示框的样式
+                    // formatter: "{a} <br/>{b}: {c} ({d}%)",
+                    formatter: "{a} <br/>{b} ({d}%)",
+                    color: "#000", //提示框的背景色
+                    textStyle: {
+                        //提示的字体样式
+                        color: "#ffffff",
+                    },
+                },
+                series: [
+                    {
+                        name: this.seriesName,
+                        type: "pie",
+                        // radius: '55%',
+                        data,
+                        top: 15,
+                        label: {
+                            // alignTo: "edge",
+                            // formatter: "{name|{b}}\n{time|{c} 小时}",
+                            // minMargin: 5,
+                            edgeDistance: 15,
+                            distance: 25,
+                            // lineHeight: 15,
+                            // rich: {
+                            //     time: {
+                            //         fontSize: 10,
+                            //         color: "#999",
+                            //     },
+                            // },
+                        },
+                    },
+                ],
+            };
+
+            this.charts.setOption(option);
+        },
+    },
+
+    mounted() {
+        this.charts = this.$echarts.init(document.getElementById(this.id));
+
+        this.$nextTick(() => {
+            window.addEventListener("resize", () => {
+                this.charts.resize();
+            });
+        });
+    },
+    destroyed() {
+        // console.log("destroyed");
+        this.charts.dispose();
+    },
+};
+</script>
+
+<style lang='less' scoped>
+.linechart {
+    margin: 0 auto;
+}
+</style>

+ 99 - 86
src/views/mainPage.vue

@@ -102,27 +102,27 @@
                 <ul class="listPanel listPanelB">
                     <li class="shadowBox">
                         <b>场景数量</b>
-                        <i>678</i>
+                        <i>{{ dataOverview.SceneNum || 0 }}</i>
                     </li>
                     <li class="shadowBox">
                         <b>车辆配置数量</b>
-                        <i>3453</i>
+                        <i>{{ dataOverview.ConfigTotal || 0 }}</i>
                     </li>
                     <li class="shadowBox">
                         <b>算法文件数量</b>
-                        <i>486</i>
+                        <i>{{ dataOverview.fileNum || 0 }}</i>
                     </li>
                     <li class="shadowBox">
                         <b>算法地址数量</b>
-                        <i>177</i>
+                        <i>{{ dataOverview.pathNum || 0 }}</i>
                     </li>
                     <li class="shadowBox">
                         <b>最大并发数量</b>
-                        <i>600</i>
+                        <i>{{ dataOverview.a || 0 }}</i>
                     </li>
                     <li class="shadowBox">
                         <b>当前并发数量</b>
-                        <i>282</i>
+                        <i>{{ dataOverview.b || 0 }}</i>
                     </li>
                 </ul>
             </div>
@@ -136,12 +136,18 @@
                     >
                         <el-tab-pane label="运行项目" name="1">
                             <div class="chartBBox shadowBox">
-                                <line-chart2 id="chartB"></line-chart2>
+                                <line-chartA
+                                    id="runProjectLine"
+                                    :dataList="runProjectList"
+                                ></line-chartA>
                             </div>
                         </el-tab-pane>
                         <el-tab-pane label="运行任务" name="2">
                             <div class="chartBBox shadowBox">
-                                <line-chart3 id="chartC"></line-chart3>
+                                <line-chartA
+                                    id="runTaskLine"
+                                    :dataList="runTaskList"
+                                ></line-chartA>
                             </div>
                         </el-tab-pane>
                     </el-tabs>
@@ -156,19 +162,34 @@
                     <div class="shadowBox">
                         <div class="title">项目运行状态统计</div>
                         <div class="pieBox">
-                            <pie-chart1 id="pieX"></pie-chart1>
+                            <pie-chartA
+                                id="mainPagePieA"
+                                :dataList="dataListA"
+                                stateName="nowRunState"
+                                seriesName="项目运行状态统计"
+                            ></pie-chartA>
                         </div>
                     </div>
                     <div class="shadowBox shadowBoxB">
                         <div class="title">任务运行状态统计</div>
                         <div class="pieBox">
-                            <pie-chart1 id="pieY"></pie-chart1>
+                            <pie-chartA
+                                id="mainPagePieB"
+                                :dataList="dataListB"
+                                stateName="runState"
+                                seriesName="任务运行状态统计"
+                            ></pie-chartA>
                         </div>
                     </div>
                     <div class="shadowBox">
                         <div class="title">评测等级分布</div>
                         <div class="pieBox">
-                            <pie-chart1 id="pieZ"></pie-chart1>
+                            <pie-chartA
+                                id="mainPagePieC"
+                                :dataList="dataListC"
+                                stateName="evaluationLevel"
+                                seriesName="评测等级分布"
+                            ></pie-chartA>
                         </div>
                     </div>
                 </div>
@@ -182,10 +203,10 @@ import toolbarTab from "@/components/toolbar/toolbarTab";
 import tableList from "@/components/grid/TableList";
 import LineChart from "../components/echarts/lineChart";
 import LineChart1 from "../components/echarts/lineChart1";
-import LineChart2 from "../components/echarts/lineChart2";
+import lineChartA from "../components/echarts/lineChartA";
 import LineChart3 from "../components/echarts/lineChart3";
 import pieChart from "../components/echarts/pieChart";
-import pieChart1 from "../components/echarts/pieChart1";
+import pieChartA from "../components/echarts/pieChartA";
 import pieChart2 from "../components/echarts/pieChart2";
 
 export default {
@@ -195,17 +216,16 @@ export default {
         tableList,
         LineChart,
         LineChart1,
-        LineChart2,
+        lineChartA,
         LineChart3,
         pieChart,
-        pieChart1,
+        pieChartA,
         pieChart2,
     },
     data() {
         return {
-            activeName: "1",
+            activeName: "2",
             activitedPageNumA: "1",
-            subPageActiveNameA: 1,
             pageBtnListA: [
                 {
                     type: "primary",
@@ -264,43 +284,6 @@ export default {
                     prop: "projectDateStr1",
                 },
             ],
-            columnsA: [
-                {
-                    label: "配置ID",
-                    prop: "id",
-                    // width: 110,
-                },
-                {
-                    label: "配置名称",
-                    prop: "ktName",
-                    // template: true,
-                },
-                {
-                    label: "配置描述",
-                    prop: "jbSource",
-                    // width: 130,
-                },
-                {
-                    label: "车辆名称",
-                    prop: "startDateStr",
-                    width: 120,
-                },
-                {
-                    label: "车辆描述",
-                    prop: "endDateStr",
-                    width: 120,
-                },
-                {
-                    label: "传感器配置",
-                    prop: "projectDateStr",
-                    width: 120,
-                },
-                {
-                    label: "操作",
-                    prop: "cgInfos",
-                    template: true,
-                },
-            ],
             pagination: {
                 //分页使用
                 currentPage: 1,
@@ -309,14 +292,6 @@ export default {
                 pageSizes: [10, 30, 50, 100, 200],
                 layout: "sizes, total, prev, pager, next, jumper",
             },
-            paginationA: {
-                //分页使用
-                currentPage: 1,
-                pageSize: 10,
-                position: "right",
-                pageSizes: [10, 30, 50, 100, 200],
-                layout: "sizes, total, prev, pager, next, jumper",
-            },
             getDataWay: {
                 //加载表格数据
                 dataType: "data",
@@ -360,30 +335,22 @@ export default {
                 // data: this.$api.scientificStatistics.typeProjectStatistics,
                 param: {},
             },
-            getDataWayA: {
-                //加载表格数据
-                dataType: "data",
-                type: "post",
-                firstRequest: false,
-                data: [
-                    {
-                        id: 6,
-                        ktName: "沃尔沃二",
-                        jbSource: "收到就好付款时间的回复可见收到货覅无痕",
-                    },
-                    { id: 66 },
-                    {
-                        id: 666,
-                        tName: "沃尔沃二",
-                        jbSource: "收到就好付款时间的回复可见收到货覅无痕",
-                    },
-                    { id: 6666 },
-                    { id: 51 },
-                    { id: 6 },
-                ],
-                // data: this.$api.scientificStatistics.typeProjectStatistics,
-                param: {},
+            // 数据概览
+            dataOverview: {
+                SceneNum: 0,
+                ConfigTotal: 0,
+                fileNum: 0,
+                pathNum: 0,
+                a: 0,
+                b: 0,
             },
+            // 运行项目
+            runProjectList: [],
+            // 运行任务
+            runTaskList: [],
+            dataListA: [],
+            dataListB: [],
+            dataListC: [],
         };
     },
 
@@ -396,9 +363,55 @@ export default {
         pageControlA(data) {
             this.activitedPageNumA = data.name;
         },
+        getData(url, infoObj) {
+            this.$axios({
+                method: "post",
+                url,
+                data: {},
+            }).then((res) => {
+                if (res.code == 200 && res.info) {
+                    this[infoObj] = res.info;
+                } else {
+                    this.$message.error(res.message || "获取信息失败");
+                }
+            });
+        },
+        getDataOverview() {
+            this.$axios({
+                method: "post",
+                url: this.$api.mainPage.queryAllNum,
+                data: {},
+            }).then((res) => {
+                if (res.code == 200 && res.info) {
+                    this.dataOverview = res.info;
+                } else {
+                    this.$message.error(res.message || "获取信息失败");
+                }
+            });
+        },
+        getLineData() {
+            this.$axios({
+                method: "post",
+                url: this.$api.mainPage.selectRunProjectBySy,
+                data: {},
+            }).then((res) => {
+                if (res.code == 200 && res.info) {
+                    // this.data1 = res.info;
+                } else {
+                    this.$message.error(res.message || "获取信息失败");
+                }
+            });
+        },
     },
 
-    // mounted() {},
+    mounted() {
+        this.getData(this.$api.mainPage.queryAllNum, "dataOverview");
+        this.getData(this.$api.mainPage.selectRunProjectBySy, "runProjectList");
+        this.getData(this.$api.mainPage.selectRunTaskBySy, "runTaskList");
+        this.getData(this.$api.mainPage.selectRunProjectByState, "dataListA");
+        this.getData(this.$api.mainPage.selectRunTaskByState, "dataListB");
+        this.getData(this.$api.mainPage.selectEvaluationLevel, "dataListC");
+    },
 };
 </script>
 

+ 2 - 0
src/views/workManagement/projectInfo.vue

@@ -130,6 +130,7 @@
                                 id="projectInfoPieA"
                                 :stateList="stateList"
                                 stateName="stateName"
+                                seriesName="任务运行状态统计"
                             ></pie-chart>
                         </div>
                     </div>
@@ -140,6 +141,7 @@
                                 id="projectInfoPieB"
                                 :stateList="resultList"
                                 stateName="resultName"
+                                seriesName="结果动态统计"
                             ></pie-chart>
                         </div>
                     </div>

+ 2 - 2
vue.config.js

@@ -101,8 +101,8 @@ module.exports = {
                 }
             },
             '/simulation/resource/server': {
-                // target: 'http://10.15.12.73:7003', // 王志强
-                target: 'http://10.15.12.88:7003', // 王耀栋
+                target: 'http://10.15.12.73:7003', // 王志强
+                // target: 'http://10.15.12.88:7003', // 王耀栋
                 // target: 'http://10.15.12.72:7003',  // 王晓峰
                 // target: 'http://10.15.12.87:7003',  // 赵艳
                 // target: 'http://10.15.12.70',  // windowstest