更新菜单,选择药品时显示批次、厂家信息
This commit is contained in:
parent
5682e11660
commit
f824236252
|
@ -3,7 +3,7 @@
|
||||||
<connectionStrings>
|
<connectionStrings>
|
||||||
<!-- 数据库连接字符串 -->
|
<!-- 数据库连接字符串 -->
|
||||||
<!--<add name="database" connectionString="server=127.0.0.1;database=wpf_dm_program;userid=root;password=qq1223" />-->
|
<!--<add name="database" connectionString="server=127.0.0.1;database=wpf_dm_program;userid=root;password=qq1223" />-->
|
||||||
<add name="database" connectionString="server=127.0.0.1;port=3306;database=xiangtan;userid=root;password=root" />
|
<add name="database" connectionString="server=127.0.0.1;port=3306;database=xiangtan_xc;userid=root;password=root" />
|
||||||
</connectionStrings>
|
</connectionStrings>
|
||||||
<!--<runtime>
|
<!--<runtime>
|
||||||
-->
|
-->
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
<appSettings>
|
<appSettings>
|
||||||
|
|
||||||
<!-- 设备id -->
|
<!-- 设备id -->
|
||||||
<add key="machineId" value="DM3" />
|
<add key="machineId" value="DM1" />
|
||||||
<!--请领药库-->
|
<!--请领药库-->
|
||||||
<add key="colloctedId" value="住院,DM2,门诊,DM22" />
|
<add key="colloctedId" value="住院,DM2,门诊,DM22" />
|
||||||
<!-- 供应单位 -->
|
<!-- 供应单位 -->
|
||||||
|
|
|
@ -17,9 +17,9 @@ namespace DM_Weight.Models
|
||||||
private int _baseId = 0;
|
private int _baseId = 0;
|
||||||
[SugarColumn(ColumnName = "id", IsPrimaryKey = true)]
|
[SugarColumn(ColumnName = "id", IsPrimaryKey = true)]
|
||||||
public int BaseId { get=> _baseId; set { SetProperty(ref _baseId, value); } }
|
public int BaseId { get=> _baseId; set { SetProperty(ref _baseId, value); } }
|
||||||
private long _drugId = 0;
|
private string _drugId;
|
||||||
[SugarColumn(ColumnName = "drugid")]
|
[SugarColumn(ColumnName = "drugid")]
|
||||||
public long DrugId { get => _drugId; set { SetProperty(ref _drugId, value); } }
|
public string DrugId { get => _drugId; set { SetProperty(ref _drugId, value); } }
|
||||||
private string _machineId = "";
|
private string _machineId = "";
|
||||||
[SugarColumn(ColumnName = "machine_id")]
|
[SugarColumn(ColumnName = "machine_id")]
|
||||||
public string MachineId { get => _machineId; set { SetProperty(ref _machineId, value); } }
|
public string MachineId { get => _machineId; set { SetProperty(ref _machineId, value); } }
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Security.Policy;
|
||||||
using Prism.Mvvm;
|
using Prism.Mvvm;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
namespace DM_Weight.Models
|
namespace DM_Weight.Models
|
||||||
|
@ -20,7 +21,7 @@ namespace DM_Weight.Models
|
||||||
/// ҩƷID
|
/// ҩƷID
|
||||||
///</summary>
|
///</summary>
|
||||||
[SugarColumn(ColumnName = "drug_id", IsPrimaryKey = true)]
|
[SugarColumn(ColumnName = "drug_id", IsPrimaryKey = true)]
|
||||||
public long DrugId { get; set; }
|
public string DrugId { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ƴ
|
/// ƴ
|
||||||
///</summary>
|
///</summary>
|
||||||
|
@ -90,7 +91,8 @@ namespace DM_Weight.Models
|
||||||
set { SetProperty(ref _base, value); }
|
set { SetProperty(ref _base, value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[SugarColumn(IsIgnore = true)]
|
||||||
|
public string drug_name_spec { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -165,8 +165,10 @@ namespace DM_Weight.ViewModels
|
||||||
|
|
||||||
private void GetAllDrugInfos()
|
private void GetAllDrugInfos()
|
||||||
{
|
{
|
||||||
var list = SqlSugarHelper.Db.Queryable<DrugInfo>().Includes<DrugManuNo>(di => di.DrugManuNos).OrderBy(di => di.DrugId).ToList();
|
//var list = SqlSugarHelper.Db.Queryable<DrugInfo>().Includes<DrugManuNo>(di => di.DrugManuNos).OrderBy(di => di.DrugId).ToList();
|
||||||
DrugInfos = list;
|
//DrugInfos = list;
|
||||||
|
string str = "SELECT d.drug_id,d.py_code,d.drug_barcode,d.drug_name,d.drug_brand_name,d.drug_spec,d.dosage,d.pack_unit,d.manufactory,d.max_stock,CONCAT(drug_name,' / ',drug_spec,' / ',manufactory) as drug_name_spec FROM `drug_info` d";
|
||||||
|
DrugInfos = SqlSugarHelper.Db.SqlQueryable<DrugInfo>(str).OrderBy(di => di.DrugName).OrderBy(di => di.DrugId).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void GetChannelsByDrawerNo()
|
private void GetChannelsByDrawerNo()
|
||||||
|
@ -280,7 +282,7 @@ namespace DM_Weight.ViewModels
|
||||||
item.DrugId = DrugInfo.DrugId.ToString();
|
item.DrugId = DrugInfo.DrugId.ToString();
|
||||||
item.ManuNo = DrugManuNo.ManuNo;
|
item.ManuNo = DrugManuNo.ManuNo;
|
||||||
item.DrugInfo = DrugInfo;
|
item.DrugInfo = DrugInfo;
|
||||||
item.EffDate = String.Format("{0:yyyy-MM-dd}", DrugManuNo.EffDate);
|
item.EffDate = String.Format("{0:yyyy-MM-dd}", DrugManuNo.EffDate).Substring(0, 10);
|
||||||
SqlSugarHelper.Db.Updateable(item).UpdateColumns(it => new { it.DrugId, it.ManuNo, it.EffDate, it.PosNo }).ExecuteCommand();
|
SqlSugarHelper.Db.Updateable(item).UpdateColumns(it => new { it.DrugId, it.ManuNo, it.EffDate, it.PosNo }).ExecuteCommand();
|
||||||
|
|
||||||
if (item.BoardType == 5)
|
if (item.BoardType == 5)
|
||||||
|
@ -391,7 +393,7 @@ namespace DM_Weight.ViewModels
|
||||||
public void UpdateComboBoxItems(string text)
|
public void UpdateComboBoxItems(string text)
|
||||||
{
|
{
|
||||||
string str = @"SELECT d.drug_id,d.py_code,d.drug_barcode,d.drug_name,d.drug_brand_name,d.drug_spec,d.dosage,d.pack_unit,
|
string str = @"SELECT d.drug_id,d.py_code,d.drug_barcode,d.drug_name,d.drug_brand_name,d.drug_spec,d.dosage,d.pack_unit,
|
||||||
d.manufactory,d.max_stock,CONCAT(drug_name,' ',drug_spec)as drug_name_spec FROM `drug_info` d";
|
d.manufactory,d.max_stock,CONCAT(drug_name,' / ',drug_spec,' / ',manufactory) as drug_name_spec FROM `drug_info` d";
|
||||||
if(string.IsNullOrEmpty(text))
|
if(string.IsNullOrEmpty(text))
|
||||||
{
|
{
|
||||||
DrugInfos = SqlSugarHelper.Db.SqlQueryable<DrugInfo>(str).OrderBy(di => di.DrugName).OrderBy(di => di.DrugId).ToList();
|
DrugInfos = SqlSugarHelper.Db.SqlQueryable<DrugInfo>(str).OrderBy(di => di.DrugName).OrderBy(di => di.DrugId).ToList();
|
||||||
|
|
|
@ -208,9 +208,11 @@ namespace DM_Weight.ViewModels
|
||||||
|
|
||||||
private void GetAllDrugInfos()
|
private void GetAllDrugInfos()
|
||||||
{
|
{
|
||||||
var list = SqlSugarHelper.Db.Queryable<DrugInfo>().Includes<DrugManuNo>(di => di.DrugManuNos).OrderBy(di => di.DrugId).ToList();
|
//var list = SqlSugarHelper.Db.Queryable<DrugInfo>().Includes<DrugManuNo>(di => di.DrugManuNos).OrderBy(di => di.DrugId).ToList();
|
||||||
DrugInfos = list;
|
//DrugInfos = list;
|
||||||
//DrugInfos_PY = list;
|
//DrugInfos_PY = list;
|
||||||
|
string str = "SELECT d.drug_id,d.py_code,d.drug_barcode,d.drug_name,d.drug_brand_name,d.drug_spec,d.dosage,d.pack_unit,d.manufactory,d.max_stock,CONCAT(drug_name,' / ',drug_spec,' / ',manufactory) as drug_name_spec FROM `drug_info` d";
|
||||||
|
DrugInfos = SqlSugarHelper.Db.SqlQueryable<DrugInfo>(str).OrderBy(di => di.DrugName).OrderBy(di => di.DrugId).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void GetChannelsByDrawerNo()
|
private void GetChannelsByDrawerNo()
|
||||||
|
@ -468,7 +470,7 @@ namespace DM_Weight.ViewModels
|
||||||
public void UpdateComboBoxItems(string text)
|
public void UpdateComboBoxItems(string text)
|
||||||
{
|
{
|
||||||
string str = @"SELECT d.drug_id,d.py_code,d.drug_barcode,d.drug_name,d.drug_brand_name,d.drug_spec,d.dosage,d.pack_unit,
|
string str = @"SELECT d.drug_id,d.py_code,d.drug_barcode,d.drug_name,d.drug_brand_name,d.drug_spec,d.dosage,d.pack_unit,
|
||||||
d.manufactory,d.max_stock,CONCAT(drug_name,' ',drug_spec)as drug_name_spec FROM `drug_info` d";
|
d.manufactory,d.max_stock,CONCAT(drug_name,' / ',drug_spec,' / ',manufactory) as drug_name_spec FROM `drug_info` d";
|
||||||
if (string.IsNullOrEmpty(text))
|
if (string.IsNullOrEmpty(text))
|
||||||
{
|
{
|
||||||
DrugInfos = SqlSugarHelper.Db.SqlQueryable<DrugInfo>(str).OrderBy(di => di.DrugName).OrderBy(di => di.DrugId).ToList();
|
DrugInfos = SqlSugarHelper.Db.SqlQueryable<DrugInfo>(str).OrderBy(di => di.DrugName).OrderBy(di => di.DrugId).ToList();
|
||||||
|
|
|
@ -199,7 +199,7 @@ namespace DM_Weight.ViewModels
|
||||||
|
|
||||||
|
|
||||||
//查询最大药品id并+1赋值给新增药品
|
//查询最大药品id并+1赋值给新增药品
|
||||||
long maxDrugId = SqlSugarHelper.Db.Queryable<DrugInfo>().Max(it => it.DrugId);
|
string maxDrugId = SqlSugarHelper.Db.Queryable<DrugInfo>().Max(it => it.DrugId);
|
||||||
SelectedDrug.DrugId = maxDrugId + 1;
|
SelectedDrug.DrugId = maxDrugId + 1;
|
||||||
var f = SqlSugarHelper.Db.UseTran(() =>
|
var f = SqlSugarHelper.Db.UseTran(() =>
|
||||||
{
|
{
|
||||||
|
@ -207,7 +207,7 @@ namespace DM_Weight.ViewModels
|
||||||
|
|
||||||
SqlSugarHelper.Db.Insertable(new DrugBase()
|
SqlSugarHelper.Db.Insertable(new DrugBase()
|
||||||
{
|
{
|
||||||
DrugId = SelectedDrug.DrugId,
|
DrugId = SelectedDrug.DrugId.ToString(),
|
||||||
MachineId = ConfigurationManager.AppSettings["machineId"] ?? "DM1",
|
MachineId = ConfigurationManager.AppSettings["machineId"] ?? "DM1",
|
||||||
BaseQuantity = SelectedDrug.drugBase.BaseQuantity
|
BaseQuantity = SelectedDrug.drugBase.BaseQuantity
|
||||||
}).ExecuteCommand();
|
}).ExecuteCommand();
|
||||||
|
@ -246,7 +246,7 @@ namespace DM_Weight.ViewModels
|
||||||
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}, () => SelectedDrug.DrugId <= 0).ObservesProperty(() => SelectedDrug);
|
}, () => SelectedDrug.DrugId ==null).ObservesProperty(() => SelectedDrug);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DelegateCommand EditDrugCommand
|
public DelegateCommand EditDrugCommand
|
||||||
|
@ -262,7 +262,7 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
SqlSugarHelper.Db.Insertable(new DrugBase()
|
SqlSugarHelper.Db.Insertable(new DrugBase()
|
||||||
{
|
{
|
||||||
DrugId = SelectedDrug.DrugId,
|
DrugId = SelectedDrug.DrugId.ToString(),
|
||||||
MachineId = ConfigurationManager.AppSettings["machineId"] ?? "DM1",
|
MachineId = ConfigurationManager.AppSettings["machineId"] ?? "DM1",
|
||||||
BaseQuantity = SelectedDrug.drugBase.BaseQuantity
|
BaseQuantity = SelectedDrug.drugBase.BaseQuantity
|
||||||
}).ExecuteCommand();
|
}).ExecuteCommand();
|
||||||
|
@ -276,7 +276,7 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
SqlSugarHelper.Db.Insertable(new DrugBase()
|
SqlSugarHelper.Db.Insertable(new DrugBase()
|
||||||
{
|
{
|
||||||
DrugId = SelectedDrug.DrugId,
|
DrugId = SelectedDrug.DrugId.ToString(),
|
||||||
MachineId = ConfigurationManager.AppSettings["machineId"]??"DM1",
|
MachineId = ConfigurationManager.AppSettings["machineId"]??"DM1",
|
||||||
BaseQuantity = SelectedDrug.drugBase.BaseQuantity
|
BaseQuantity = SelectedDrug.drugBase.BaseQuantity
|
||||||
}).ExecuteCommand();
|
}).ExecuteCommand();
|
||||||
|
@ -306,7 +306,7 @@ namespace DM_Weight.ViewModels
|
||||||
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
}
|
}
|
||||||
RequestData();
|
RequestData();
|
||||||
}, () => SelectedDrug.DrugId > 0).ObservesProperty(() => SelectedDrug);
|
}, () => SelectedDrug.DrugId==null).ObservesProperty(() => SelectedDrug);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DelegateCommand AddManuCommand
|
public DelegateCommand AddManuCommand
|
||||||
|
@ -322,7 +322,7 @@ namespace DM_Weight.ViewModels
|
||||||
GetManuNos();
|
GetManuNos();
|
||||||
}
|
}
|
||||||
|
|
||||||
}, () => SelectedDrug.DrugId > 0).ObservesProperty(() => SelectedDrug);
|
}, () => SelectedDrug.DrugId == null).ObservesProperty(() => SelectedDrug);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DelegateCommand EditManuCommand
|
public DelegateCommand EditManuCommand
|
||||||
|
|
|
@ -78,76 +78,76 @@ namespace DM_Weight.ViewModels
|
||||||
get { return _selectedChildMenu; }
|
get { return _selectedChildMenu; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (!_portUtil.Operate)
|
//if (!_portUtil.Operate)
|
||||||
{
|
//{
|
||||||
if (value != null)
|
// if (value != null)
|
||||||
{
|
// {
|
||||||
if (value.PremissionPath.Equals("TakeRecordWindow"))
|
// if (value.PremissionPath.Equals("TakeRecordWindow"))
|
||||||
{
|
// {
|
||||||
//定义传参变量
|
// //定义传参变量
|
||||||
NavigationParameters keys = new NavigationParameters();
|
// NavigationParameters keys = new NavigationParameters();
|
||||||
|
|
||||||
//添加参数,键值对格式
|
// //添加参数,键值对格式
|
||||||
keys.Add("Type", 2);
|
// keys.Add("Type", 2);
|
||||||
_regionManager.RequestNavigate("ContentRegion", "MachineRecordWindow", keys);
|
// _regionManager.RequestNavigate("ContentRegion", "MachineRecordWindow", keys);
|
||||||
}
|
// }
|
||||||
else if (value.PremissionPath.Equals("AddRecordWindow"))
|
// else if (value.PremissionPath.Equals("AddRecordWindow"))
|
||||||
{
|
// {
|
||||||
//定义传参变量
|
// //定义传参变量
|
||||||
NavigationParameters keys = new NavigationParameters();
|
// NavigationParameters keys = new NavigationParameters();
|
||||||
|
|
||||||
//添加参数,键值对格式
|
// //添加参数,键值对格式
|
||||||
keys.Add("Type", 1);
|
// keys.Add("Type", 1);
|
||||||
_regionManager.RequestNavigate("ContentRegion", "MachineRecordWindow", keys);
|
// _regionManager.RequestNavigate("ContentRegion", "MachineRecordWindow", keys);
|
||||||
}
|
// }
|
||||||
else if (value.PremissionPath.Equals("ReturnRecordWindow"))
|
// else if (value.PremissionPath.Equals("ReturnRecordWindow"))
|
||||||
{
|
// {
|
||||||
//定义传参变量
|
// //定义传参变量
|
||||||
NavigationParameters keys = new NavigationParameters();
|
// NavigationParameters keys = new NavigationParameters();
|
||||||
|
|
||||||
//添加参数,键值对格式
|
// //添加参数,键值对格式
|
||||||
keys.Add("Type", 3);
|
// keys.Add("Type", 3);
|
||||||
_regionManager.RequestNavigate("ContentRegion", "MachineRecordWindow", keys);
|
// _regionManager.RequestNavigate("ContentRegion", "MachineRecordWindow", keys);
|
||||||
}
|
// }
|
||||||
else if (value.PremissionPath.Equals("RetrunEmptyRecordWindow"))
|
// else if (value.PremissionPath.Equals("RetrunEmptyRecordWindow"))
|
||||||
{
|
// {
|
||||||
//定义传参变量
|
// //定义传参变量
|
||||||
NavigationParameters keys = new NavigationParameters();
|
// NavigationParameters keys = new NavigationParameters();
|
||||||
|
|
||||||
//添加参数,键值对格式
|
// //添加参数,键值对格式
|
||||||
keys.Add("Type", 3);
|
// keys.Add("Type", 3);
|
||||||
_regionManager.RequestNavigate("ContentRegion", value.PremissionPath, keys);
|
// _regionManager.RequestNavigate("ContentRegion", value.PremissionPath, keys);
|
||||||
}
|
// }
|
||||||
else if (value.PremissionPath.Equals("CheckRecordWindow"))
|
// else if (value.PremissionPath.Equals("CheckRecordWindow"))
|
||||||
{
|
// {
|
||||||
//定义传参变量
|
// //定义传参变量
|
||||||
NavigationParameters keys = new NavigationParameters();
|
// NavigationParameters keys = new NavigationParameters();
|
||||||
|
|
||||||
//添加参数,键值对格式
|
// //添加参数,键值对格式
|
||||||
keys.Add("Type", 4);
|
// keys.Add("Type", 4);
|
||||||
_regionManager.RequestNavigate("ContentRegion", "MachineRecordWindow", keys);
|
// _regionManager.RequestNavigate("ContentRegion", "MachineRecordWindow", keys);
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
if (value.PremissionPath.Equals("ReturnDrugWindow") || value.PremissionPath.Equals("ReturnDrugWindow2"))
|
// if (value.PremissionPath.Equals("ReturnDrugWindow") || value.PremissionPath.Equals("ReturnDrugWindow2"))
|
||||||
{
|
// {
|
||||||
if (ConfigurationManager.AppSettings["returnDrugMode"].ToString().Equals("1"))
|
// if (ConfigurationManager.AppSettings["returnDrugMode"].ToString().Equals("1"))
|
||||||
{
|
// {
|
||||||
_regionManager.RequestNavigate("ContentRegion", "ReturnDrugWindow2");
|
// _regionManager.RequestNavigate("ContentRegion", "ReturnDrugWindow2");
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
_regionManager.RequestNavigate("ContentRegion", "ReturnDrugWindow");
|
// _regionManager.RequestNavigate("ContentRegion", "ReturnDrugWindow");
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
_regionManager.RequestNavigate("ContentRegion", value.PremissionPath);
|
// _regionManager.RequestNavigate("ContentRegion", value.PremissionPath);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
SetProperty(ref _selectedChildMenu, value);
|
SetProperty(ref _selectedChildMenu, value);
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,39 +183,150 @@ namespace DM_Weight.ViewModels
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private DelegateCommand<ListBox> _selectionCommon;
|
private DelegateCommand _selectionCommon;
|
||||||
public DelegateCommand<ListBox> SelectionCommon
|
public DelegateCommand SelectionCommon
|
||||||
{
|
{
|
||||||
get => _selectionCommon ?? (_selectionCommon = new DelegateCommand<ListBox>(SelectionMethod));
|
//get => _selectionCommon ?? (_selectionCommon = new DelegateCommand<ListBox>(SelectionMethod));
|
||||||
|
get => _selectionCommon ?? (_selectionCommon = new DelegateCommand(SelectionMethod));
|
||||||
}
|
}
|
||||||
private void SelectionMethod(ListBox viewName)
|
private void SelectionMethod()
|
||||||
{
|
{
|
||||||
SelectedMenu = viewName.SelectedItem as PremissionDm;
|
//SelectedMenu = viewName.SelectedItem as PremissionDm;
|
||||||
if (SelectedMenu.PremissionName == "退出")
|
//if (SelectedMenu.PremissionName == "退出")
|
||||||
|
//{
|
||||||
|
// if (!_portUtil.Operate)
|
||||||
|
// {
|
||||||
|
// _chkFunction.HIKStopDVRRecord();
|
||||||
|
// logger.Info($"用户【{Operator?.Nickname}】退出登录");
|
||||||
|
// Operator = null;
|
||||||
|
// Reviewer = null;
|
||||||
|
// _regionManager.RequestNavigate("MainRegion", "LoginWindow");
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// logger.Info($"未关闭抽屉操作退出");
|
||||||
|
// SnackbarBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#b71c1c"));
|
||||||
|
// SnackbarMessageQueue.Enqueue("请关闭抽屉后再退出");
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
// //SelectedMenu.Children = SelectedMenu.Children;
|
||||||
|
// SelectedChildMenu = SelectedMenu.Children[0];
|
||||||
|
//}
|
||||||
|
logger.Info("开始进入父菜单");
|
||||||
|
if (SelectedMenu != null && SelectedMenu.PremissionName == "退出")
|
||||||
{
|
{
|
||||||
if (!_portUtil.Operate)
|
logger.Info($"用户【{Operator?.Nickname}】退出登录");
|
||||||
{
|
Operator = null;
|
||||||
_chkFunction.HIKStopDVRRecord();
|
Reviewer = null;
|
||||||
logger.Info($"用户【{Operator?.Nickname}】退出登录");
|
_regionManager.RequestNavigate("MainRegion", "LoginWindow");
|
||||||
Operator = null;
|
|
||||||
Reviewer = null;
|
|
||||||
_regionManager.RequestNavigate("MainRegion", "LoginWindow");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
logger.Info($"未关闭抽屉操作退出");
|
|
||||||
SnackbarBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#b71c1c"));
|
|
||||||
SnackbarMessageQueue.Enqueue("请关闭抽屉后再退出");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//SelectedMenu.Children = SelectedMenu.Children;
|
if (!_portUtil.Operate)
|
||||||
SelectedChildMenu = SelectedMenu.Children[0];
|
{
|
||||||
|
_regionManager.RequestNavigate("ContentRegion", SelectedMenu.Children[0].PremissionPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
logger.Info("结束父菜单");
|
||||||
|
}
|
||||||
|
#region
|
||||||
|
private DelegateCommand _selectionChildCommon;
|
||||||
|
public DelegateCommand SelectionChildCommon
|
||||||
|
{
|
||||||
|
get => _selectionChildCommon ?? (_selectionChildCommon = new DelegateCommand(SelectionChildMethod));
|
||||||
|
}
|
||||||
|
private void SelectionChildMethod()
|
||||||
|
{
|
||||||
|
SelectChildNavigate(SelectedChildMenu);
|
||||||
|
}
|
||||||
|
private void SelectChildNavigate(PremissionDm SelectedChildMenu)
|
||||||
|
{
|
||||||
|
if (!_portUtil.Operate)
|
||||||
|
{
|
||||||
|
if (SelectedChildMenu != null)
|
||||||
|
{
|
||||||
|
if (SelectedChildMenu.PremissionPath.Equals("TakeRecordWindow"))
|
||||||
|
{
|
||||||
|
//定义传参变量
|
||||||
|
NavigationParameters keys = new NavigationParameters();
|
||||||
|
|
||||||
|
//添加参数,键值对格式
|
||||||
|
keys.Add("Type", 2);
|
||||||
|
_regionManager.RequestNavigate("ContentRegion", "MachineRecordWindow", keys);
|
||||||
|
}
|
||||||
|
else if (SelectedChildMenu.PremissionPath.Equals("AddRecordWindow"))
|
||||||
|
{
|
||||||
|
//定义传参变量
|
||||||
|
NavigationParameters keys = new NavigationParameters();
|
||||||
|
|
||||||
|
//添加参数,键值对格式
|
||||||
|
keys.Add("Type", 1);
|
||||||
|
_regionManager.RequestNavigate("ContentRegion", "MachineRecordWindow", keys);
|
||||||
|
}
|
||||||
|
else if (SelectedChildMenu.PremissionPath.Equals("ReturnRecordWindow"))
|
||||||
|
{
|
||||||
|
//定义传参变量
|
||||||
|
NavigationParameters keys = new NavigationParameters();
|
||||||
|
|
||||||
|
//添加参数,键值对格式
|
||||||
|
keys.Add("Type", 3);
|
||||||
|
_regionManager.RequestNavigate("ContentRegion", "MachineRecordWindow", keys);
|
||||||
|
}
|
||||||
|
else if (SelectedChildMenu.PremissionPath.Equals("RetrunEmptyRecordWindow"))
|
||||||
|
{
|
||||||
|
//定义传参变量
|
||||||
|
NavigationParameters keys = new NavigationParameters();
|
||||||
|
|
||||||
|
//添加参数,键值对格式
|
||||||
|
keys.Add("Type", 3);
|
||||||
|
_regionManager.RequestNavigate("ContentRegion", SelectedChildMenu.PremissionPath, keys);
|
||||||
|
}
|
||||||
|
else if (SelectedChildMenu.PremissionPath.Equals("CheckRecordWindow"))
|
||||||
|
{
|
||||||
|
//定义传参变量
|
||||||
|
NavigationParameters keys = new NavigationParameters();
|
||||||
|
|
||||||
|
//添加参数,键值对格式
|
||||||
|
keys.Add("Type", 4);
|
||||||
|
_regionManager.RequestNavigate("ContentRegion", "MachineRecordWindow", keys);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (SelectedChildMenu.PremissionPath.Equals("ReturnDrugWindow") || SelectedChildMenu.PremissionPath.Equals("ReturnDrugWindow2"))
|
||||||
|
{
|
||||||
|
if (ConfigurationManager.AppSettings["returnDrugMode"].ToString().Equals("1"))
|
||||||
|
{
|
||||||
|
_regionManager.RequestNavigate("ContentRegion", "ReturnDrugWindow2");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_regionManager.RequestNavigate("ContentRegion", "ReturnDrugWindow");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (SelectedChildMenu.PremissionPath.Equals("SettingMainWindow") || SelectedChildMenu.PremissionPath.Equals("SettingWindow"))
|
||||||
|
{
|
||||||
|
//if (Convert.ToInt32(ConfigurationManager.AppSettings["hasFridge"])>0)
|
||||||
|
//{
|
||||||
|
// _regionManager.RequestNavigate("ContentRegion", "SettingMainWindow");
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
{
|
||||||
|
_regionManager.RequestNavigate("ContentRegion", "SettingWindow");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_regionManager.RequestNavigate("ContentRegion", SelectedChildMenu.PremissionPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
public List<PremissionDm> PremissionDmList { get { return _premissionDmList; } set { SetProperty(ref _premissionDmList, value); } }
|
public List<PremissionDm> PremissionDmList { get { return _premissionDmList; } set { SetProperty(ref _premissionDmList, value); } }
|
||||||
|
|
||||||
public UserList UserList { get { return _userList; } set { SetProperty(ref _userList, value); } }
|
public UserList UserList { get { return _userList; } set { SetProperty(ref _userList, value); } }
|
||||||
|
@ -350,6 +461,8 @@ namespace DM_Weight.ViewModels
|
||||||
PremissionDmList = premissions;
|
PremissionDmList = premissions;
|
||||||
SelectedMenu = premissions[0];
|
SelectedMenu = premissions[0];
|
||||||
SelectedChildMenu = premissions[0].Children[0];
|
SelectedChildMenu = premissions[0].Children[0];
|
||||||
|
_regionManager.RequestNavigate("ContentRegion", premissions[0].Children[0].PremissionPath);
|
||||||
|
|
||||||
FindDrawerCount();
|
FindDrawerCount();
|
||||||
|
|
||||||
int autoExit = Convert.ToInt32(ConfigurationManager.AppSettings["autoExit"] ?? "0");
|
int autoExit = Convert.ToInt32(ConfigurationManager.AppSettings["autoExit"] ?? "0");
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
IsEditable="True"
|
IsEditable="True"
|
||||||
ItemsSource="{Binding DrugInfos}"
|
ItemsSource="{Binding DrugInfos}"
|
||||||
SelectedItem="{Binding DrugInfo}"
|
SelectedItem="{Binding DrugInfo}"
|
||||||
DisplayMemberPath="DrugName" IsEnabled="True" IsTextSearchEnabled="False" KeyUp="ComboBox_KeyUp"
|
DisplayMemberPath="drug_name_spec" IsEnabled="True" IsTextSearchEnabled="False" KeyUp="ComboBox_KeyUp"
|
||||||
/>
|
/>
|
||||||
<ComboBox
|
<ComboBox
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
|
|
|
@ -71,7 +71,7 @@
|
||||||
IsEditable="True"
|
IsEditable="True"
|
||||||
ItemsSource="{Binding DrugInfos}"
|
ItemsSource="{Binding DrugInfos}"
|
||||||
SelectedItem="{Binding DrugInfo}"
|
SelectedItem="{Binding DrugInfo}"
|
||||||
DisplayMemberPath="DrugName" IsEnabled="True" IsTextSearchEnabled="False" KeyUp="ComboBox_KeyUp"
|
DisplayMemberPath="drug_name_spec" IsEnabled="True" IsTextSearchEnabled="False" KeyUp="ComboBox_KeyUp"
|
||||||
/>
|
/>
|
||||||
<StackPanel HorizontalAlignment="Right" Grid.Column="3" Orientation="Horizontal">
|
<StackPanel HorizontalAlignment="Right" Grid.Column="3" Orientation="Horizontal">
|
||||||
<Button
|
<Button
|
||||||
|
|
|
@ -26,10 +26,11 @@
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Image Grid.Column="0" Margin="30 0 30 0" HorizontalAlignment="Left" Width="Auto" Height="26" Source="/Images/logo.png" />
|
<Image Grid.Column="0" Margin="30 0 30 0" HorizontalAlignment="Left" Width="Auto" Height="26" Source="/Images/logo.png" />
|
||||||
<ListBox Name="ListBoxName" Grid.Column="1" ItemsSource="{Binding PremissionDmList}" HorizontalAlignment="Right" Cursor="Hand">
|
<ListBox Name="ListBoxName" Grid.Column="1" SelectedItem="{Binding SelectedMenu}" ItemsSource="{Binding PremissionDmList}" HorizontalAlignment="Right" Cursor="Hand">
|
||||||
<i:Interaction.Triggers>
|
<i:Interaction.Triggers>
|
||||||
<i:EventTrigger EventName="SelectionChanged">
|
<i:EventTrigger EventName="SelectionChanged">
|
||||||
<i:InvokeCommandAction Command="{Binding SelectionCommon}" CommandParameter="{Binding ElementName=ListBoxName}"/>
|
<!--<i:InvokeCommandAction Command="{Binding SelectionCommon}" CommandParameter="{Binding ElementName=ListBoxName}"/>-->
|
||||||
|
<i:InvokeCommandAction Command="{Binding SelectionCommon}"/>
|
||||||
</i:EventTrigger>
|
</i:EventTrigger>
|
||||||
</i:Interaction.Triggers>
|
</i:Interaction.Triggers>
|
||||||
<ListBox.ItemsPanel>
|
<ListBox.ItemsPanel>
|
||||||
|
@ -55,7 +56,11 @@
|
||||||
<materialDesign:Card Grid.Row="0">
|
<materialDesign:Card Grid.Row="0">
|
||||||
|
|
||||||
<ListBox ItemsSource="{Binding SelectedMenu.Children}" SelectedItem="{ Binding SelectedChildMenu }" HorizontalAlignment="left" Cursor="Hand">
|
<ListBox ItemsSource="{Binding SelectedMenu.Children}" SelectedItem="{ Binding SelectedChildMenu }" HorizontalAlignment="left" Cursor="Hand">
|
||||||
|
<i:Interaction.Triggers>
|
||||||
|
<i:EventTrigger EventName="SelectionChanged">
|
||||||
|
<i:InvokeCommandAction Command="{Binding SelectionChildCommon}"/>
|
||||||
|
</i:EventTrigger>
|
||||||
|
</i:Interaction.Triggers>
|
||||||
<ListBox.ItemsPanel>
|
<ListBox.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
<WrapPanel Orientation="Horizontal" IsItemsHost="True"/>
|
<WrapPanel Orientation="Horizontal" IsItemsHost="True"/>
|
||||||
|
|
Loading…
Reference in New Issue