diff --git a/src/util/theme.color.js b/src/util/theme.color.js new file mode 100644 index 0000000..0f1cf81 --- /dev/null +++ b/src/util/theme.color.js @@ -0,0 +1,22 @@ +let colorArr = [ + "#5B8FF9", + "#E6625B", + "#FF981E", + "#F6BD16", + "#07B79D", + "#9B6BDF", + "#FF99C3", + "#1E9493", + "#BA3FB7", + "#54BEF3", + "#3C21F7", + "#F87148", + "#3EB171" +] +let colorTemp = Math.floor(Math.random() * colorArr.length + 1) - 1 + +let a = { + randomColor:colorArr[colorTemp], + colorArr +} +export default a; \ No newline at end of file diff --git a/src/views/Equipment/equipmentDetailList.vue b/src/views/Equipment/equipmentDetailList.vue index ea7d530..4b6dd52 100644 --- a/src/views/Equipment/equipmentDetailList.vue +++ b/src/views/Equipment/equipmentDetailList.vue @@ -548,6 +548,7 @@ import * as echarts from "echarts"; import { mapGetters } from "vuex"; import { exportMethodPost } from "@/util/util"; +import colorTheme from "@/util/theme.color" export default { data() { return { @@ -1187,29 +1188,7 @@ export default { var option; option = { - color: [ - "#66AFF5", - "#FABD2B", - "#6F8EDC", - "#FFCF8F", - "#F98120", - "#1CC99E", - "#9474FB", - "#657292", - "#7A6A99", - "#BF5D52", - "#EE6666", - "#77B7E4", - "#E6A065", - "#9D5139", - "#C1AA88", - "#F87F7A", - "#F6CF74", - "#7F5506", - "#88BB9B", - "#6E99AA", - "#5789D0", - ], + color: colorTheme.colorArr, tooltip: { trigger: "axis", }, @@ -1298,35 +1277,13 @@ export default { var myChart = echarts.init(chartDom); var option; option = { - color: [ - "#66AFF5", - "#FABD2B", - "#6F8EDC", - "#FFCF8F", - "#F98120", - "#1CC99E", - "#9474FB", - "#657292", - "#7A6A99", - "#BF5D52", - "#EE6666", - "#77B7E4", - "#E6A065", - "#9D5139", - "#C1AA88", - "#F87F7A", - "#F6CF74", - "#7F5506", - "#88BB9B", - "#6E99AA", - "#5789D0", - ], + color: colorTheme.colorArr[0], tooltip: { trigger: "axis", }, legend: { data: [str1], - bottom: "10", + top: "10", }, grid: { left: 10, @@ -1382,6 +1339,16 @@ export default { data: arr1, type: "line", smooth: true, + areaStyle: { + color: new echarts.graphic.LinearGradient( + 0, 0, 0, 1, + [ + { offset: 0, color: colorTheme.colorArr[0] }, + { offset: 1, color: "#fff" } + ] + ), + opacity: 0.1 + } }, ], }; @@ -1479,29 +1446,7 @@ export default { var myChart = echarts.init(document.getElementById("mane")); var myChart1 = echarts.init(document.getElementById("mane2")); var option = { - color: [ - "#66AFF5", - "#FABD2B", - "#6F8EDC", - "#FFCF8F", - "#F98120", - "#1CC99E", - "#9474FB", - "#657292", - "#7A6A99", - "#BF5D52", - "#EE6666", - "#77B7E4", - "#E6A065", - "#9D5139", - "#C1AA88", - "#F87F7A", - "#F6CF74", - "#7F5506", - "#88BB9B", - "#6E99AA", - "#5789D0", - ], + color: colorTheme.colorArr, tooltip: { trigger: "item", }, @@ -1520,29 +1465,7 @@ export default { ], }; var option1 = { - color: [ - "#66AFF5", - "#FABD2B", - "#6F8EDC", - "#FFCF8F", - "#F98120", - "#1CC99E", - "#9474FB", - "#657292", - "#7A6A99", - "#BF5D52", - "#EE6666", - "#77B7E4", - "#E6A065", - "#9D5139", - "#C1AA88", - "#F87F7A", - "#F6CF74", - "#7F5506", - "#88BB9B", - "#6E99AA", - "#5789D0", - ], + color: colorTheme.colorArr, tooltip: { trigger: "item", }, diff --git a/src/views/Statistics/BuildingContrast.vue b/src/views/Statistics/BuildingContrast.vue index 18a23e3..cd1a0f1 100644 --- a/src/views/Statistics/BuildingContrast.vue +++ b/src/views/Statistics/BuildingContrast.vue @@ -15,17 +15,9 @@