Ver código fonte

generation - elective color config

hare8999@163.com 3 anos atrás
pai
commit
196c9af24a

+ 9 - 1
doc/Mind/ElectiveGeneration.cs

@@ -222,7 +222,7 @@ namespace mxdemo.Mind
             // 展示字段
             int groupId; // 组合ID,没有组合为0比如未参与报名人数(实际只有两种统计数据,针对某个组合的统计和不针对组合的统计)
             int value; // 数值
-            string color; // 支持'R','G','B','',或者'#FA1234'等hexString
+            string color; // 常用值:'R,G,B,P,Y'(不分大小写,也可以hexString),R:红,G:绿,B:蓝,P:主题绿,Y:橙
             bool bold; // 加粗,重点展示
             bool star; // 带*,重点展示
 
@@ -396,6 +396,14 @@ namespace mxdemo.Mind
             // 5.5 hht 如果允许强制调剂,禁止调剂到哪个组合?一般禁止调剂到被录取组合,因为原地不动不叫调剂。没有禁止的给0或者null
             public int disableForceGroupId;
 
+            // 5.12 hht 增加颜色控制,常用值:'R,G,B,P,Y'(不分大小写,也可以hexString),R:红,G:绿,B:蓝,P:主题绿,Y:橙
+            // 颜色逻辑:currentGeneration>1
+            //          ?录取
+            //            ?当前查询组合录取?'G':'Y'
+            //            :'R'
+            //          :''
+            public string color;
+
             public long id { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
             public string category { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
             public EnumElectiveGeneration generation { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }

+ 2 - 0
src/common/mx-config.js

@@ -5,6 +5,8 @@ export default {
     primary_up: '#51C9A7',
     primary_down: '#D2F1E8',
     primary_report: '#2EC7C9',
+    success: '#13ce66',
+    warning: '#ffba00',
     yellow_up: '#F5AB86',
     yellow_down: '#FDEAE1',
     yellow_report: '#FFA400',

+ 7 - 3
src/views/elective/generation/components/elective-generation-table.vue

@@ -135,10 +135,14 @@ export default {
         const map = {
           R: config.color.error,
           r: config.color.error,
-          G: config.color.yellow_up,
-          g: config.color.yellow_up,
+          G: config.color.success,
+          g: config.color.success,
           B: config.color.blue_up,
-          b: config.color.blue_up
+          b: config.color.blue_up,
+          p: config.color.primary,
+          P: config.color.primary,
+          y: config.color.yellow_report,
+          Y: config.color.yellow_report
         }
         styles.color = map[option.color] || option.color
       }