项目要求更改

This commit is contained in:
2026-03-27 12:39:12 +08:00
parent f40086a0b0
commit 2262c2a1db
16 changed files with 162 additions and 31 deletions

View File

@@ -57,6 +57,12 @@ namespace CapMachine.Model
[Column(Name = "CapNo", IsNullable = true, StringLength = 150)] [Column(Name = "CapNo", IsNullable = true, StringLength = 150)]
public string? CapNo { get; set; } public string? CapNo { get; set; }
/// <summary>
/// 压缩机排量
/// </summary>
[Column(Name = "CapDisplacement", IsNullable = true, StringLength = 100)]
public string? CapDisplacement { get; set; }
/// <summary> /// <summary>
/// 制冷剂 /// 制冷剂
/// </summary> /// </summary>

View File

@@ -268,7 +268,7 @@ namespace CapMachine.Wpf
//给MainView的MainViewFooterContentRegion区域设置FooterView具体的信息 //给MainView的MainViewFooterContentRegion区域设置FooterView具体的信息
regionManager.RequestNavigate("MainViewFooterContentRegion", nameof(FooterView)); regionManager.RequestNavigate("MainViewFooterContentRegion", nameof(FooterView));
regionManager.RequestNavigate("MainViewContentRegion", nameof(MonitorView)); regionManager.RequestNavigate("MainViewContentRegion", nameof(UserManageView));
//调用首页的INavigationAware 接口做一个初始化操作 //调用首页的INavigationAware 接口做一个初始化操作
if (view.DataContext is INavigationAware navigationAware) if (view.DataContext is INavigationAware navigationAware)

View File

@@ -92,6 +92,16 @@ namespace CapMachine.Wpf.Dtos
set { _CapNo = value; RaisePropertyChanged(); } set { _CapNo = value; RaisePropertyChanged(); }
} }
private string? _CapDisplacement;
/// <summary>
/// 压缩机排量
/// </summary>
public string? CapDisplacement
{
get { return _CapDisplacement; }
set { _CapDisplacement = value; RaisePropertyChanged(); }
}
private string? _RfNo; private string? _RfNo;
/// <summary> /// <summary>
/// 制冷剂 /// 制冷剂

View File

@@ -227,9 +227,9 @@ namespace CapMachine.Wpf.Models
public double Subcooling { get; set; } public double Subcooling { get; set; }
/// <summary> /// <summary>
/// 制热量Qh[KW] /// 制热量Qh[W]
/// </summary> /// </summary>
[Name("制热量Qh[KW]")] [Name("制热量Qh[W]")]
public double HeatingCapacity { get; set; } public double HeatingCapacity { get; set; }
/// <summary> /// <summary>
@@ -245,9 +245,9 @@ namespace CapMachine.Wpf.Models
public double IsentrpEff { get; set; } public double IsentrpEff { get; set; }
/// <summary> /// <summary>
/// 制冷量Qc[KW] /// 制冷量Qc[W]
/// </summary> /// </summary>
[Name("制冷量Qc[KW]")] [Name("制冷量Qc[W]")]
public double CoolCapacity { get; set; } public double CoolCapacity { get; set; }
/// <summary> /// <summary>

View File

@@ -49,15 +49,15 @@ namespace CapMachine.Wpf.Models
Map(m => m.LiqRefFlow).Name("液冷媒流量[kg/h]"); Map(m => m.LiqRefFlow).Name("液冷媒流量[kg/h]");
Map(m => m.InsRes).Name("绝缘电阻[KΩ]"); Map(m => m.InsRes).Name("绝缘电阻[KΩ]");
Map(m => m.Superheat).Name("过热度[K]").TypeConverterOption.Format("0.00"); Map(m => m.Superheat).Name("过热度[K]").TypeConverterOption.Format("0.0");
Map(m => m.Subcooling).Name("过冷度[K]").TypeConverterOption.Format("0.00"); Map(m => m.Subcooling).Name("过冷度[K]").TypeConverterOption.Format("0.0");
Map(m => m.HeatingCapacity).Name("制热量Qh[KW]").TypeConverterOption.Format("0.00"); Map(m => m.HeatingCapacity).Name("制热量Qh[W]").TypeConverterOption.Format("0");
Map(m => m.COPHeat).Name("压缩机性能系数(制热)").TypeConverterOption.Format("0.00"); Map(m => m.COPHeat).Name("压缩机性能系数(制热)").TypeConverterOption.Format("0.0");
Map(m => m.IsentrpEff).Name("等熵效率ns[%]").TypeConverterOption.Format("0.00"); Map(m => m.IsentrpEff).Name("等熵效率ns[%]").TypeConverterOption.Format("0.0");
Map(m => m.CoolCapacity).Name("制冷量Qc[KW]").TypeConverterOption.Format("0.00"); Map(m => m.CoolCapacity).Name("制冷量Qc[W]").TypeConverterOption.Format("0");
Map(m => m.COPCool).Name("压缩机性能系数(制冷)").TypeConverterOption.Format("0.00"); Map(m => m.COPCool).Name("压缩机性能系数(制冷)").TypeConverterOption.Format("0.0");
Map(m => m.VoltricEff).Name("容积效率nv[%]").TypeConverterOption.Format("0.00"); Map(m => m.VoltricEff).Name("容积效率nv[%]").TypeConverterOption.Format("0.0");
//Map(m => m.PTCFlow).Name("PTC流量[L/min]"); //Map(m => m.PTCFlow).Name("PTC流量[L/min]");
//Map(m => m.PTCEntTemp).Name("PTC入水温度[℃]"); //Map(m => m.PTCEntTemp).Name("PTC入水温度[℃]");

View File

@@ -267,13 +267,13 @@ namespace CapMachine.Wpf.Models.LightChart
case "过冷度[K]": case "过冷度[K]":
return CurHistoryData.Select(a => new ChartPoint() { Value = a.Subcooling, Time = a.CreateTime }).OrderBy(a => a.Time).ToList(); return CurHistoryData.Select(a => new ChartPoint() { Value = a.Subcooling, Time = a.CreateTime }).OrderBy(a => a.Time).ToList();
case "制热量Qh[KW]": case "制热量Qh[W]":
return CurHistoryData.Select(a => new ChartPoint() { Value = a.HeatingCapacity, Time = a.CreateTime }).OrderBy(a => a.Time).ToList(); return CurHistoryData.Select(a => new ChartPoint() { Value = a.HeatingCapacity, Time = a.CreateTime }).OrderBy(a => a.Time).ToList();
case "压缩机性能系数(制热)": case "压缩机性能系数(制热)":
return CurHistoryData.Select(a => new ChartPoint() { Value = a.COPHeat, Time = a.CreateTime }).OrderBy(a => a.Time).ToList(); return CurHistoryData.Select(a => new ChartPoint() { Value = a.COPHeat, Time = a.CreateTime }).OrderBy(a => a.Time).ToList();
case "等熵效率ns[%]": case "等熵效率ns[%]":
return CurHistoryData.Select(a => new ChartPoint() { Value = a.IsentrpEff, Time = a.CreateTime }).OrderBy(a => a.Time).ToList(); return CurHistoryData.Select(a => new ChartPoint() { Value = a.IsentrpEff, Time = a.CreateTime }).OrderBy(a => a.Time).ToList();
case "制冷量Qc[KW]": case "制冷量Qc[W]":
return CurHistoryData.Select(a => new ChartPoint() { Value = a.CoolCapacity, Time = a.CreateTime }).OrderBy(a => a.Time).ToList(); return CurHistoryData.Select(a => new ChartPoint() { Value = a.CoolCapacity, Time = a.CreateTime }).OrderBy(a => a.Time).ToList();
case "压缩机性能系数(制冷)": case "压缩机性能系数(制冷)":
return CurHistoryData.Select(a => new ChartPoint() { Value = a.COPCool, Time = a.CreateTime }).OrderBy(a => a.Time).ToList(); return CurHistoryData.Select(a => new ChartPoint() { Value = a.COPCool, Time = a.CreateTime }).OrderBy(a => a.Time).ToList();

View File

@@ -144,6 +144,16 @@ namespace CapMachine.Wpf.Services
set { _CurUserDto = value; RaisePropertyChanged(); } set { _CurUserDto = value; RaisePropertyChanged(); }
} }
private bool _IsUserLoggedIn;
/// <summary>
/// 当前用户是否已登录
/// </summary>
public bool IsUserLoggedIn
{
get { return _IsUserLoggedIn; }
set { _IsUserLoggedIn = value; RaisePropertyChanged(); }
}
public IEventAggregator EventAggregator { get; } public IEventAggregator EventAggregator { get; }
public PPCService PPCService { get; } public PPCService PPCService { get; }
public IDialogService DialogService { get; } public IDialogService DialogService { get; }

View File

@@ -138,10 +138,10 @@ namespace CapMachine.Wpf.Services
new Columns(){ Name="过热度[K]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, new Columns(){ Name="过热度[K]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false},
new Columns(){ Name="过冷度[K]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, new Columns(){ Name="过冷度[K]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false},
new Columns(){ Name="制热量Qh[KW]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, new Columns(){ Name="制热量Qh[W]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false},
new Columns(){ Name="压缩机性能系数(制热)",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, new Columns(){ Name="压缩机性能系数(制热)",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false},
new Columns(){ Name="等熵效率ns[%]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, new Columns(){ Name="等熵效率ns[%]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false},
new Columns(){ Name="制冷量Qc[KW]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, new Columns(){ Name="制冷量Qc[W]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false},
new Columns(){ Name="压缩机性能系数(制冷)",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, new Columns(){ Name="压缩机性能系数(制冷)",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false},
new Columns(){ Name="容积效率nv[%]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, new Columns(){ Name="容积效率nv[%]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false},

View File

@@ -198,10 +198,10 @@ namespace CapMachine.Wpf.Services
TagManger.AddTag(new Tag<short>("过热度", "过热度[K]", "Superheat", "程序", "", 100, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 }); TagManger.AddTag(new Tag<short>("过热度", "过热度[K]", "Superheat", "程序", "", 100, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 });
TagManger.AddTag(new Tag<short>("过冷度", "过冷度[K]", "Subcooling", "程序", "", 100, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 }); TagManger.AddTag(new Tag<short>("过冷度", "过冷度[K]", "Subcooling", "程序", "", 100, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 });
TagManger.AddTag(new Tag<short>("制热量Qh", "制热量Qh[KW]", "HeatingCapacity", "程序", "", 1000, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 }); TagManger.AddTag(new Tag<short>("制热量Qh", "制热量Qh[W]", "HeatingCapacity", "程序", "", 1000, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 });
TagManger.AddTag(new Tag<short>("压缩机性能系数(制热)", "压缩机性能系数(制热)", "COPHeat", "程序", "", 1000, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 }); TagManger.AddTag(new Tag<short>("压缩机性能系数(制热)", "压缩机性能系数(制热)", "COPHeat", "程序", "", 1000, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 });
TagManger.AddTag(new Tag<short>("等熵效率ns", "等熵效率ns[%]", "IsentrpEff", "程序", "", 1000, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 }); TagManger.AddTag(new Tag<short>("等熵效率ns", "等熵效率ns[%]", "IsentrpEff", "程序", "", 1000, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 });
TagManger.AddTag(new Tag<short>("制冷量Qc", "制冷量Qc[KW]", "CoolCapacity", "程序", "", 1000, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 }); TagManger.AddTag(new Tag<short>("制冷量Qc", "制冷量Qc[W]", "CoolCapacity", "程序", "", 1000, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 });
TagManger.AddTag(new Tag<short>("压缩机性能系数(制冷)", "压缩机性能系数(制冷)", "COPCool", "程序", "", 1000, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 }); TagManger.AddTag(new Tag<short>("压缩机性能系数(制冷)", "压缩机性能系数(制冷)", "COPCool", "程序", "", 1000, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 });
TagManger.AddTag(new Tag<short>("容积效率nv", "容积效率nv[%]", "VoltricEff", "程序", "", 1000, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 }); TagManger.AddTag(new Tag<short>("容积效率nv", "容积效率nv[%]", "VoltricEff", "程序", "", 1000, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 });

View File

@@ -106,10 +106,10 @@ namespace CapMachine.Wpf.Services
Subcool = TagManager.DicTags.GetValueOrDefault("过冷度[K]"); Subcool = TagManager.DicTags.GetValueOrDefault("过冷度[K]");
HeatingCapacity = TagManager.DicTags.GetValueOrDefault("制热量Qh[KW]"); HeatingCapacity = TagManager.DicTags.GetValueOrDefault("制热量Qh[W]");
COPHeat = TagManager.DicTags.GetValueOrDefault("压缩机性能系数(制热)"); COPHeat = TagManager.DicTags.GetValueOrDefault("压缩机性能系数(制热)");
IsentrpEff = TagManager.DicTags.GetValueOrDefault("等熵效率ns[%]"); IsentrpEff = TagManager.DicTags.GetValueOrDefault("等熵效率ns[%]");
CoolCapacity = TagManager.DicTags.GetValueOrDefault("制冷量Qc[KW]"); CoolCapacity = TagManager.DicTags.GetValueOrDefault("制冷量Qc[W]");
COPCool = TagManager.DicTags.GetValueOrDefault("压缩机性能系数(制冷)"); COPCool = TagManager.DicTags.GetValueOrDefault("压缩机性能系数(制冷)");
VoltricEff = TagManager.DicTags.GetValueOrDefault("容积效率nv[%]"); VoltricEff = TagManager.DicTags.GetValueOrDefault("容积效率nv[%]");

View File

@@ -23,6 +23,7 @@ namespace CapMachine.Wpf.ViewModels
FreeSql = freeSql; FreeSql = freeSql;
this.Mapper = mapper; this.Mapper = mapper;
MachineRtDataService = machineRtDataService; MachineRtDataService = machineRtDataService;
UserLevelOptions = new ObservableCollection<string> { "操作员", "管理员" };
} }
@@ -54,6 +55,11 @@ namespace CapMachine.Wpf.ViewModels
/// </summary> /// </summary>
public MachineRtDataService MachineRtDataService { get; } public MachineRtDataService MachineRtDataService { get; }
/// <summary>
/// 用户等级可选项
/// </summary>
public ObservableCollection<string> UserLevelOptions { get; }
private UserDto _CurSelectedItem; private UserDto _CurSelectedItem;
/// <summary> /// <summary>
@@ -136,6 +142,7 @@ namespace CapMachine.Wpf.ViewModels
UserDtoItems.Add(new UserDto() UserDtoItems.Add(new UserDto()
{ {
IsEnable = true, IsEnable = true,
Level = "操作员"
}); });
} }
@@ -269,6 +276,11 @@ namespace CapMachine.Wpf.ViewModels
MessageBox.Show("请确认等级是否正确", "提示", MessageBoxButton.OK, MessageBoxImage.Hand); MessageBox.Show("请确认等级是否正确", "提示", MessageBoxButton.OK, MessageBoxImage.Hand);
return; return;
} }
if (!UserLevelOptions.Contains(item.Level))
{
MessageBox.Show("等级仅支持【操作员】或【管理员】", "提示", MessageBoxButton.OK, MessageBoxImage.Hand);
return;
}
} }
//检查数据是否正常 //检查数据是否正常

View File

@@ -6,24 +6,28 @@ using CapMachine.Wpf.Services;
using Prism.Commands; using Prism.Commands;
using Prism.Events; using Prism.Events;
using Prism.Regions; using Prism.Regions;
using System;
using System.Windows;
using System.Windows.Input; using System.Windows.Input;
namespace CapMachine.Wpf.ViewModels namespace CapMachine.Wpf.ViewModels
{ {
public class MainViewModel : NavigationViewModel public class MainViewModel : NavigationViewModel
{ {
public MainViewModel(IRegionManager region, INavigationMenuService menuService, SysRunService sysService, IEventAggregator eventAggregator) public MainViewModel(IRegionManager region, INavigationMenuService menuService, SysRunService sysService, IEventAggregator eventAggregator, ConfigService configService)
{ {
this.region = region; this.region = region;
MenuService = menuService; MenuService = menuService;
SysService = sysService; SysService = sysService;
EventAggregator = eventAggregator; EventAggregator = eventAggregator;
ConfigService = configService;
NavigateCommand = new DelegateCommand<NavigationItem>(Navigate); NavigateCommand = new DelegateCommand<NavigationItem>(Navigate);
} }
public INavigationMenuService MenuService { get; } public INavigationMenuService MenuService { get; }
public SysRunService SysService { get; } public SysRunService SysService { get; }
public IEventAggregator EventAggregator { get; } public IEventAggregator EventAggregator { get; }
public ConfigService ConfigService { get; }
public DelegateCommand<NavigationItem> NavigateCommand { get; private set; } public DelegateCommand<NavigationItem> NavigateCommand { get; private set; }
private int selectedIndex = -1; private int selectedIndex = -1;
@@ -59,11 +63,43 @@ namespace CapMachine.Wpf.ViewModels
return; return;
} }
if (!CanNavigate(item.PageName))
{
IsTopDrawerOpen = false;
return;
}
NavigatePage(item.PageName); NavigatePage(item.PageName);
IsTopDrawerOpen = false; IsTopDrawerOpen = false;
} }
/// <summary>
/// 校验当前页面是否允许导航
/// </summary>
/// <param name="pageName">目标页面名称</param>
/// <returns>true允许导航false禁止导航</returns>
private bool CanNavigate(string pageName)
{
if (string.IsNullOrWhiteSpace(pageName))
{
return false;
}
if (pageName.Equals("UserManageView", StringComparison.OrdinalIgnoreCase))
{
return true;
}
if (ConfigService.IsUserLoggedIn)
{
return true;
}
MessageBox.Show("请先登录用户,再切换到其他界面!", "提示");
return false;
}
private DelegateCommand<string> _TopDrawerCmd; private DelegateCommand<string> _TopDrawerCmd;
/// <summary> /// <summary>
/// 顶部弹窗按钮命令 /// 顶部弹窗按钮命令

View File

@@ -5,6 +5,7 @@ using CapMachine.Wpf.Services;
using Masuit.Tools; using Masuit.Tools;
using Prism.Commands; using Prism.Commands;
using Prism.Events; using Prism.Events;
using Prism.Regions;
using Prism.Services.Dialogs; using Prism.Services.Dialogs;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@@ -17,19 +18,21 @@ namespace CapMachine.Wpf.ViewModels
{ {
public class UserManageViewModel : NavigationViewModel public class UserManageViewModel : NavigationViewModel
{ {
public UserManageViewModel(IEventAggregator eventAggregator, IFreeSql freeSql, ConfigService configService, IDialogService dialogService) public UserManageViewModel(IEventAggregator eventAggregator, IFreeSql freeSql, ConfigService configService, IDialogService dialogService, IRegionManager regionManager)
{ {
//事件服务 //事件服务
_EventAggregator = eventAggregator; _EventAggregator = eventAggregator;
FreeSql = freeSql; FreeSql = freeSql;
ConfigService = configService; ConfigService = configService;
DialogService = dialogService; DialogService = dialogService;
RegionManager = regionManager;
CurUserDto = new UserDto() { IsEnable = true }; CurUserDto = new UserDto() { IsEnable = true };
} }
private IEventAggregator _EventAggregator { get; set; } private IEventAggregator _EventAggregator { get; set; }
public IFreeSql FreeSql { get; } public IFreeSql FreeSql { get; }
public ConfigService ConfigService { get; } public ConfigService ConfigService { get; }
public IDialogService DialogService { get; } public IDialogService DialogService { get; }
public IRegionManager RegionManager { get; }
@@ -81,18 +84,30 @@ namespace CapMachine.Wpf.ViewModels
if (ListUser.FirstOrDefault().Password == CurUserDto.Password.Trim()) if (ListUser.FirstOrDefault().Password == CurUserDto.Password.Trim())
{ {
MessageBox.Show("登录成功!", "提示"); MessageBox.Show("登录成功!", "提示");
CurUserDto.Level = ListUser.FirstOrDefault().Level;
var loginUser = ListUser.FirstOrDefault();
CurUserDto.Id = loginUser.Id;
CurUserDto.Name = loginUser.Name;
CurUserDto.Level = loginUser.Level;
CurUserDto.IsEnable = loginUser.IsEnable;
CurUserDto.Password = ""; CurUserDto.Password = "";
ConfigService.CurUserDto = CurUserDto; ConfigService.CurUserDto = CurUserDto;
ConfigService.IsUserLoggedIn = true;
_UserManageCmd?.RaiseCanExecuteChanged();
RegionManager.RequestNavigate("MainViewContentRegion", "MonitorView");
} }
else else
{ {
ConfigService.IsUserLoggedIn = false;
_UserManageCmd?.RaiseCanExecuteChanged();
MessageBox.Show("密码错误!", "提示"); MessageBox.Show("密码错误!", "提示");
} }
} }
else else
{ {
ConfigService.IsUserLoggedIn = false;
_UserManageCmd?.RaiseCanExecuteChanged();
MessageBox.Show("当前用户不存在!", "提示"); MessageBox.Show("当前用户不存在!", "提示");
} }
@@ -115,19 +130,36 @@ namespace CapMachine.Wpf.ViewModels
{ {
if (_UserManageCmd == null) if (_UserManageCmd == null)
{ {
_UserManageCmd = new DelegateCommand(() => UserManageCmdMethod()); _UserManageCmd = new DelegateCommand(() => UserManageCmdMethod(), () => CanUserManage());
} }
return _UserManageCmd; return _UserManageCmd;
} }
} }
/// <summary>
/// 判断当前用户是否可以进行用户管理
/// </summary>
/// <returns>true可管理false不可管理</returns>
private bool CanUserManage()
{
return ConfigService.IsUserLoggedIn &&
ConfigService.CurUserDto != null &&
ConfigService.CurUserDto.Level == "管理员";
}
/// <summary> /// <summary>
/// 用户管理 /// 用户管理
/// </summary> /// </summary>
/// <exception cref="NotImplementedException"></exception> /// <exception cref="NotImplementedException"></exception>
private void UserManageCmdMethod() private void UserManageCmdMethod()
{ {
if (CurUserDto != null && CurUserDto.Level == "管理员") if (!ConfigService.IsUserLoggedIn)
{
MessageBox.Show("请先登录后再进行用户管理!", "提示");
return;
}
if (ConfigService.CurUserDto != null && ConfigService.CurUserDto.Level == "管理员")
{ {
ShowDialogExpInfo(); ShowDialogExpInfo();
} }
@@ -157,5 +189,15 @@ namespace CapMachine.Wpf.ViewModels
}); });
} }
/// <summary>
/// 导航到当前页面时刷新用户管理按钮状态
/// </summary>
/// <param name="navigationContext">导航上下文</param>
public override void OnNavigatedTo(NavigationContext navigationContext)
{
_UserManageCmd?.RaiseCanExecuteChanged();
base.OnNavigatedTo(navigationContext);
}
} }
} }

View File

@@ -125,6 +125,10 @@
Binding="{Binding CapNo}" Binding="{Binding CapNo}"
Header="压缩机编号" Header="压缩机编号"
IsReadOnly="{Binding Source={StaticResource Proxy}, Path=Data.IsComplete}" /> IsReadOnly="{Binding Source={StaticResource Proxy}, Path=Data.IsComplete}" />
<DataGridTextColumn
Binding="{Binding CapDisplacement}"
Header="压缩机排量"
IsReadOnly="{Binding Source={StaticResource Proxy}, Path=Data.IsComplete}" />
<DataGridTextColumn <DataGridTextColumn
Binding="{Binding RfNo}" Binding="{Binding RfNo}"
Header="制冷剂" Header="制冷剂"

View File

@@ -109,10 +109,21 @@
Binding="{Binding Password}" Binding="{Binding Password}"
Header="密码" Header="密码"
IsReadOnly="{Binding Source={StaticResource Proxy}, Path=Data.IsComplete}" /> IsReadOnly="{Binding Source={StaticResource Proxy}, Path=Data.IsComplete}" />
<DataGridTextColumn <DataGridTemplateColumn Header="等级" IsReadOnly="{Binding Source={StaticResource Proxy}, Path=Data.IsComplete}">
Binding="{Binding Level}" <DataGridTemplateColumn.CellTemplate>
Header="等级" <DataTemplate>
IsReadOnly="{Binding Source={StaticResource Proxy}, Path=Data.IsComplete}" /> <TextBlock VerticalAlignment="Center" Text="{Binding Level}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox
MinWidth="100"
ItemsSource="{Binding Source={StaticResource Proxy}, Path=Data.UserLevelOptions}"
SelectedItem="{Binding Level, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
<DataGridCheckBoxColumn <DataGridCheckBoxColumn
Binding="{Binding IsEnable}" Binding="{Binding IsEnable}"
Header="是否启用" Header="是否启用"

View File

@@ -16,7 +16,7 @@
<RowDefinition Height="150" /> <RowDefinition Height="150" />
<RowDefinition /> <RowDefinition />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Border Margin="0,5" Background="SkyBlue"> <Border Margin="0,5" Background="LightSkyBlue">
<TextBlock <TextBlock
HorizontalAlignment="Center" HorizontalAlignment="Center"
VerticalAlignment="Center" VerticalAlignment="Center"