@@ -43,6 +50,8 @@ export default {
name: "DailyIndex",
data() {
return {
+ // 巡查周期
+ checkCycle: "day",
// 巡查里程
mileage: 0,
// 覆盖道路数
@@ -55,7 +64,11 @@ export default {
this.getData();
},
methods: {
- /* 处理数据 */
+ /**
+ * @description: 处理数据
+ * @param {*}
+ * @return {*}
+ */
formatNumber(num) {
if (num >= 100000000) {
// 超过1亿显示 x.xx亿
@@ -69,16 +82,19 @@ export default {
}
},
- /* 获取数据 */
+ /**
+ * @description: 获取数据
+ * @param {*}
+ * @return {*}
+ */
getData() {
- getTaskToday().then(({ code, data }) => {
+ getTaskToday({ dateType: this.checkCycle }).then(({ code, data }) => {
if (code === 200) {
this.mileage = data.xclc;
this.roadNum = data.fgdlts;
this.diseaseChart = data.xclcbhqs;
this.roadChart = data.dlxzbhfb;
this.$nextTick(() => {
- // this.drawLeftChart();
this.drawTrendChart();
this.drawDistributionChart();
});
@@ -86,7 +102,11 @@ export default {
});
},
- /* 绘制病害趋势柱状图 */
+ /**
+ * @description: 绘制病害趋势柱状图
+ * @param {*}
+ * @return {*}
+ */
drawTrendChart() {
const xData = this.diseaseChart.map((item) => {
return item.label;
@@ -246,7 +266,11 @@ export default {
}
},
- /* 绘制病害分布柱状图 */
+ /**
+ * @description: 绘制病害分布柱状图
+ * @param {*}
+ * @return {*}
+ */
drawDistributionChart() {
const xData = this.roadChart.map((item) => {
return item.label;
@@ -402,87 +426,6 @@ export default {
});
}
},
-
- /* 绘制覆盖率饼图 */
- drawLeftChart() {
- if (this.$refs.rateChart) {
- const chart = echarts.init(this.$refs.rateChart);
- const current = 45;
- chart.setOption({
- // color: ['rgba(61, 137, 247, 1)', '#f07b3f'],
- title: [
- // 中心比例
- {
- text: "80%",
- x: "center",
- y: "52%",
- textStyle: {
- fontSize: 20,
- color: "#444",
- fontWeight: "bold",
- },
- },
- {
- text: "覆盖率",
- x: "center",
- y: "10%",
- textStyle: {
- fontSize: 14,
- },
- },
- ],
- polar: {
- center: ["50%", "60%"],
- radius: ["40%", "58%"],
- },
- angleAxis: {
- max: 100,
- show: false,
- },
- radiusAxis: {
- type: "category",
- show: true,
- axisLabel: {
- show: false,
- },
- axisLine: {
- show: false,
- },
- axisTick: {
- show: false,
- },
- },
- series: [
- {
- data: [80],
- name: "",
- type: "bar",
- roundCap: true,
- showBackground: true,
- backgroundStyle: {
- color: "#BDD5F4",
- },
- coordinateSystem: "polar",
- itemStyle: {
- color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
- {
- offset: 0,
- color: "#005DCF",
- },
- {
- offset: 1,
- color: "#00CCFF",
- },
- ]),
- },
- },
- ],
- });
- window.addEventListener("resize", () => {
- chart.resize();
- });
- }
- },
},
};
@@ -498,11 +441,15 @@ export default {
height: 10%;
display: flex;
align-items: center;
+ justify-content: space-between;
padding-left: 3rem;
- font-family: "DouYu";
background: url("../../assets/index/div-title.png") no-repeat;
background-size: 5%;
background-position: 0 30%;
+
+ span {
+ font-family: "DouYu";
+ }
}
.daily-content {
diff --git a/src/views/index-components/disease-index.vue b/src/views/index-components/disease-index.vue
index 6fbc266..d5d40fd 100644
--- a/src/views/index-components/disease-index.vue
+++ b/src/views/index-components/disease-index.vue
@@ -9,7 +9,14 @@
-
病害识别
+
+ 病害识别
+
+ 今日
+ 本月
+ 本年
+
+
@@ -67,10 +74,8 @@ export default {
},
data() {
return {
- // 下拉框数据绑定
- diseaseType: "",
- // 下拉框数据
- diseaseOptions: [],
+ // 巡查周期
+ checkCycle: "day",
// 病害总数
total: 0,
// 新增病害数
@@ -114,18 +119,27 @@ export default {
this.getBottomData();
},
methods: {
+ /**
+ * @description: 切换巡查周期事件
+ * @param {*}
+ * @return {*}
+ */
+ changCycle() {
+ this.getChartData();
+ this.getBottomData();
+ },
+
/**
* @description: 获取上部分echart图数据
* @param {*} val
* @return {*}
*/
getChartData() {
- getDefectLog().then(({ code, data }) => {
+ getDefectLog({ dateType: this.checkCycle }).then(({ code, data }) => {
if (code === 200) {
this.statisticsData = data;
this.$nextTick(() => {
this.drawStatisticsChart();
- // this.drawDistributionChart();
});
}
});
@@ -137,7 +151,7 @@ export default {
* @return {*}
*/
getBottomData() {
- getTotalList().then(({ code, data }) => {
+ getTotalList({ dateType: this.checkCycle }).then(({ code, data }) => {
if (code === 200) {
this.total = data.total;
this.newTotal = data.today;
@@ -403,11 +417,15 @@ export default {
height: 10%;
display: flex;
align-items: center;
+ justify-content: space-between;
padding-left: 3rem;
- font-family: "DouYu";
background: url("../../assets/index/div-title.png") no-repeat;
background-size: 5%;
background-position: 0 30%;
+
+ span {
+ font-family: "DouYu";
+ }
}
.disease-content {
diff --git a/src/views/index-components/road-index.vue b/src/views/index-components/road-index.vue
index 8e827f2..01f9a03 100644
--- a/src/views/index-components/road-index.vue
+++ b/src/views/index-components/road-index.vue
@@ -10,7 +10,14 @@
-
公路资产
+
+ 公路资产
+
+ 今日
+ 本月
+ 本年
+
+
累计公路资产总数
{{
@@ -45,6 +52,8 @@ export default {
name: "RoadIndex",
data() {
return {
+ // 巡查周期
+ checkCycle: "day",
// 累计公路资产总数
roadNum: [],
// 中间循环数据
@@ -58,9 +67,23 @@ export default {
this.getBottomData();
},
methods: {
- /* 获取顶端数据 */
+ /**
+ * @description: 切换巡查周期事件
+ * @param {*}
+ * @return {*}
+ */
+ changCycle() {
+ this.getTopData();
+ this.getBottomData();
+ },
+
+ /**
+ * @description: 获取顶端数据
+ * @param {*}
+ * @return {*}
+ */
getTopData() {
- getEquipment().then(({ code, data }) => {
+ getEquipment({ dateType: this.checkCycle }).then(({ code, data }) => {
if (code === 200) {
this.roadNum = String(data.count).split("");
this.middleList = data.sacle;
@@ -68,9 +91,13 @@ export default {
});
},
- /* 获取底部echart数据 */
+ /**
+ * @description: 获取底部echart数据
+ * @param {*}
+ * @return {*}
+ */
getBottomData() {
- getEquipmentLog().then(({ code, data }) => {
+ getEquipmentLog({ dateType: this.checkCycle }).then(({ code, data }) => {
if (code === 200) {
this.roadChartData = data;
this.$nextTick(() => {
@@ -80,7 +107,11 @@ export default {
});
},
- /* 绘制echart图 */
+ /**
+ * @description: 绘制echart图
+ * @param {*}
+ * @return {*}
+ */
drawRoadChart() {
if (this.$refs.roadChart) {
const xData = this.roadChartData.map((item) => {
@@ -247,10 +278,14 @@ export default {
display: flex;
align-items: center;
padding-left: 3rem;
- font-family: "DouYu";
+ justify-content: space-between;
background: url("../../assets/index/div-title.png") no-repeat;
background-size: 5%;
background-position: 0 30%;
+
+ span {
+ font-family: "DouYu";
+ }
}
.top-div {
diff --git a/src/views/index.vue b/src/views/index.vue
index adc0007..97b9696 100644
--- a/src/views/index.vue
+++ b/src/views/index.vue
@@ -7,7 +7,7 @@
* @Description: 系统首页
-->
-
+
{
if (code === 200) {
this.topList = [
@@ -81,6 +84,8 @@ export default {
{ name: "绿化待处理问题数", value: data.green, unit: "个" },
];
}
+ }).finally(() => {
+ this.loading = false;
});
},
},