|
|
|
@ -1,25 +1,22 @@ |
|
|
|
|
using EncryptFileTool.Entity; |
|
|
|
|
using HandyControl.Controls; |
|
|
|
|
using log4net; |
|
|
|
|
using Newtonsoft.Json; |
|
|
|
|
using Newtonsoft.Json.Converters; |
|
|
|
|
using NPOI.SS.Formula.Functions; |
|
|
|
|
using SharpDX; |
|
|
|
|
using SparkClient.Model.Helper; |
|
|
|
|
using System; |
|
|
|
|
using SparkClient.ViewModel.Grading; |
|
|
|
|
using System.Data; |
|
|
|
|
using System.Drawing; |
|
|
|
|
using System.IO; |
|
|
|
|
using System.Linq.Expressions; |
|
|
|
|
using System.Windows; |
|
|
|
|
using System.Windows.Controls; |
|
|
|
|
using System.Windows.Controls.Primitives; |
|
|
|
|
using System.Windows.Data; |
|
|
|
|
using System.Windows.Input; |
|
|
|
|
using MessageBox = SparkClient.Views.Dialog.MessageBox; |
|
|
|
|
|
|
|
|
|
namespace SparkClient.ViewModel.Configuration; |
|
|
|
|
|
|
|
|
|
public class LevelConfigVM : BaseViewModel |
|
|
|
|
{ |
|
|
|
|
private static readonly ILog Logger = LogManager.GetLogger(typeof(GradingResultVM)); |
|
|
|
|
public ICommand ChangeShapeModelCommand { get; } |
|
|
|
|
public ICommand ChangeInstituteModelCommand { get; } |
|
|
|
|
public ICommand LoadLevelConfigCommand { get; } |
|
|
|
@ -107,6 +104,8 @@ public class LevelConfigVM : BaseViewModel |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void setStandardList(DataTable gradeList, DataTable standardList) |
|
|
|
|
{ |
|
|
|
|
try |
|
|
|
|
{ |
|
|
|
|
Style cellStyle = new Style(typeof(TextBlock)); |
|
|
|
|
Setter setSellStyle = new Setter(TextBlock.HorizontalAlignmentProperty, HorizontalAlignment.Center); |
|
|
|
@ -146,7 +145,8 @@ public class LevelConfigVM : BaseViewModel |
|
|
|
|
if (standardList != null) |
|
|
|
|
{ |
|
|
|
|
var standardRules = standardList.AsEnumerable().GroupBy(r => r["RULE_ID"].ToString()); |
|
|
|
|
foreach (var ruleStandardList in standardRules) { |
|
|
|
|
foreach (var ruleStandardList in standardRules) |
|
|
|
|
{ |
|
|
|
|
var standards = ruleStandardList.AsEnumerable().GroupBy(r => r[STANDARD_NAME].ToString()); |
|
|
|
|
foreach (var standard in standards) |
|
|
|
|
{ |
|
|
|
@ -201,7 +201,8 @@ public class LevelConfigVM : BaseViewModel |
|
|
|
|
|
|
|
|
|
var arr = value.Split("\r\n", 2); |
|
|
|
|
rowInfo.Add(arr[0]); |
|
|
|
|
if (arr.Length > 1) { |
|
|
|
|
if (arr.Length > 1) |
|
|
|
|
{ |
|
|
|
|
rowInfo.Add(arr[1]); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
@ -283,6 +284,8 @@ public class LevelConfigVM : BaseViewModel |
|
|
|
|
} |
|
|
|
|
string ruleId = ruleStandardList.Key; |
|
|
|
|
string prefix = ""; |
|
|
|
|
if (ruleId != null && !string.IsNullOrEmpty(ruleId)) |
|
|
|
|
{ |
|
|
|
|
string ta = ruleId.Substring(ruleId.Length - 2); |
|
|
|
|
if (ruleId.StartsWith("GB")) |
|
|
|
|
{ |
|
|
|
@ -299,6 +302,7 @@ public class LevelConfigVM : BaseViewModel |
|
|
|
|
prefix = "[台宽比=" + ruleId.Substring(ruleId.Length - 2) + "] "; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
rowInfo.Insert(0, prefix + standard.Key); |
|
|
|
|
var showRow = StandardList.NewRow(); |
|
|
|
|
showRow.ItemArray = rowInfo.ToArray(); |
|
|
|
@ -308,6 +312,12 @@ public class LevelConfigVM : BaseViewModel |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
catch (Exception ex) |
|
|
|
|
{ |
|
|
|
|
new MessageBox().Show($"{MultilingualHelper.getString("ApplicationError")}{ex.Message}"); |
|
|
|
|
Logger.Error($"全局异常捕获:{ex.Message}", ex); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
private DataGridColumn GetDataGridColumn(string Header,string Binding,int lineCount = 2) |
|
|
|
|
{ |
|
|
|
|
//Style cellStyle = new Style(typeof(TextBlock)); |
|
|
|
@ -449,7 +459,7 @@ public class LevelConfigVM : BaseViewModel |
|
|
|
|
} |
|
|
|
|
catch (Exception ex) { |
|
|
|
|
DataBaseHelper.rollback(); |
|
|
|
|
Console.WriteLine(ex.Message); |
|
|
|
|
Logger.Error($"全局异常捕获:{ex.Message}", ex); |
|
|
|
|
Growl.Error(save_fail_message); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -467,6 +477,8 @@ public class LevelConfigVM : BaseViewModel |
|
|
|
|
/// </summary> |
|
|
|
|
/// <param name="param"></param> |
|
|
|
|
public void LoadLevelConfig(object param) |
|
|
|
|
{ |
|
|
|
|
try |
|
|
|
|
{ |
|
|
|
|
InstitutesEnabled = false; |
|
|
|
|
ShapesEnabled = false; |
|
|
|
@ -532,6 +544,12 @@ public class LevelConfigVM : BaseViewModel |
|
|
|
|
setStandardList(gradeInfos, standardInfos); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
catch (Exception ex) |
|
|
|
|
{ |
|
|
|
|
new MessageBox().Show($"{MultilingualHelper.getString("ApplicationError")}{ex.Message}"); |
|
|
|
|
Logger.Error($"全局异常捕获:{ex.Message}", ex); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// 切换规则响应 |
|
|
|
|