小彬 hace 2 años
padre
commit
93895995dd
Se han modificado 2 ficheros con 58 adiciones y 4 borrados
  1. 4 4
      reportPages/hotList/hotList.vue
  2. 54 0
      utils/styleClassify.js

+ 4 - 4
reportPages/hotList/hotList.vue

@@ -70,7 +70,7 @@
 
 <script>
 import { Reports } from "@/config/api.js";
-
+import { color_word_bg } from "@/utils/styleClassify";
 export default {
   data() {
     return {
@@ -172,9 +172,9 @@ export default {
       });
     },
     classifyColor(item) {
-      let color_word = item == "医药" ? "#04CE3D" : item == "科技" ? "#3385FF" : item == "消费" ? "#F1BA70" : item == "智造" ? "#8F72E1" : "#F1925C";
-      let color_bg = item == "医药" ? "#EEFFF2" : item == "科技" ? "#EEF5FF" : item == "消费" ? "#FFFAF3" : item == "智造" ? "#F4F0FF" : "#FFFAF2";
-      let _isColor = { color: color_word, border: ` 1px solid ${color_word}`, "background-color": color_bg };
+      let text_color = color_word_bg.color_word.find((key) => key.name == item).color;
+      let back_ground = color_word_bg.color_bg.find((key) => key.name == item).color;
+      let _isColor = { color: text_color, border: ` 1px solid ${text_color}`, "background-color": back_ground };
       return _isColor;
     },
   },

+ 54 - 0
utils/styleClassify.js

@@ -0,0 +1,54 @@
+export const color_word_bg = {
+  color_bg: [
+    {
+      name: "医药",
+      color: "#EEFFF2",
+    },
+    {
+      name: "科技",
+      color: "#EEF5FF",
+    },
+    {
+      name: "消费",
+      color: "#FFFAF3",
+    },
+    {
+      name: "智造",
+      color: "#F4F0FF",
+    },
+    {
+      name: "策略",
+      color: "#FFFAF2",
+    },
+    {
+      name: "买方严选",
+      color: "#FFEDED",
+    },
+  ],
+  color_word: [
+    {
+      name: "医药",
+      color: "#04CE3D",
+    },
+    {
+      name: "科技",
+      color: "#3385FF",
+    },
+    {
+      name: "消费",
+      color: "#F1BA70",
+    },
+    {
+      name: "智造",
+      color: "#8F72E1",
+    },
+    {
+      name: "策略",
+      color: "#F1925C",
+    },
+    {
+      name: "买方严选",
+      color: "#FF4242",
+    },
+  ],
+};