diff --git a/BPASmartClient.AGV/AGVHelper.cs b/BPASmartClient.AGV/AGVHelper.cs
index 5f00a27a..29a8c7ce 100644
--- a/BPASmartClient.AGV/AGVHelper.cs
+++ b/BPASmartClient.AGV/AGVHelper.cs
@@ -95,49 +95,49 @@ namespace BPASmartClient.AGV
///
public string AgvToLineOneLoadRoller(string robotJobId)
{
- string url = AGVRequestUrl.GetInstance.TaskSendUrl;
- //请求报文头
- HttpRequestHeaderModel.GetInstance.appKey = "";
- HttpRequestHeaderModel.GetInstance.appSecret = "";
- HttpRequestHeaderModel.GetInstance.requestId = "";
- HttpRequestHeaderModel.GetInstance.timestamp = "";
- HttpRequestHeaderModel.GetInstance.version = "2.8";
- string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance);
- //请求报文体
- AGVModel.GetInstance.robotJobId = robotJobId;//上游提供
- AGVModel.GetInstance.warehouseId = 123; //仓库编号
- AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级
- AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行
- AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE
- //详细任务数据
- //点到点
- AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位
- AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位
- AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料
- AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互
- AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料
- AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互
- AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance;
- string body = JsonConvert.SerializeObject(AGVModel.GetInstance);
- // string newBody = String.Join(",\r\n", body.Split(','));//格式处理,看需求
-
- //货位到货位
- //AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号
- //AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号
- //AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料
- //AGV_SlotRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互
- //AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料
- //AGV_SlotRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互
- //AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance;
+ //string url = AGVRequestUrl.GetInstance.TaskSendUrl;
+ ////请求报文头
+ //HttpRequestHeaderModel.GetInstance.appKey = "";
+ //HttpRequestHeaderModel.GetInstance.appSecret = "";
+ //HttpRequestHeaderModel.GetInstance.requestId = "";
+ //HttpRequestHeaderModel.GetInstance.timestamp = "";
+ //HttpRequestHeaderModel.GetInstance.version = "2.8";
+ //string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance);
+ ////请求报文体
+ //AGVModel.GetInstance.robotJobId = robotJobId;//上游提供
+ //AGVModel.GetInstance.warehouseId = 123; //仓库编号
+ //AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级
+ //AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行
+ //AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE
+ ////详细任务数据
+ ////点到点
+ //AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位
+ //AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位
+ //AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料
+ //AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互
+ //AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料
+ //AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互
+ //AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance;
//string body = JsonConvert.SerializeObject(AGVModel.GetInstance);
- //启用签名
- //url = url + "?sign=" + MD5Deal(body);
- string data = HttpRequest(url, head, body);
- object objData = JsonConvert.DeserializeObject(data);
- if (objData != null && objData is HttpResponseBodyModel response)
- {
- return response.code;
- }
+ //// string newBody = String.Join(",\r\n", body.Split(','));//格式处理,看需求
+
+ ////货位到货位
+ ////AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号
+ ////AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号
+ ////AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料
+ ////AGV_SlotRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互
+ ////AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料
+ ////AGV_SlotRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互
+ ////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance;
+ ////string body = JsonConvert.SerializeObject(AGVModel.GetInstance);
+ ////启用签名
+ ////url = url + "?sign=" + MD5Deal(body);
+ //string data = HttpRequest(url, head, body);
+ //object objData = JsonConvert.DeserializeObject(data);
+ //if (objData != null && objData is HttpResponseBodyModel response)
+ //{
+ // return response.code;
+ //}
return "Analysis Error";
}
///
@@ -239,6 +239,55 @@ namespace BPASmartClient.AGV
return "Analysis Error";
}
///
+ /// AGV从清洗台到4号线体卸桶
+ ///
+ ///
+ public string AgvFromCleanToLineFourUnLoadRoller(string robotJobId)
+ {
+ //string url = AGVRequestUrl.GetInstance.TaskSendUrl;
+ ////请求报文头
+ //HttpRequestHeaderModel.GetInstance.appKey = "";
+ //HttpRequestHeaderModel.GetInstance.appSecret = "";
+ //HttpRequestHeaderModel.GetInstance.requestId = "";
+ //HttpRequestHeaderModel.GetInstance.timestamp = "";
+ //HttpRequestHeaderModel.GetInstance.version = "2.8";
+ //string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance);
+ ////请求报文体
+ //AGVModel.GetInstance.robotJobId = robotJobId;//上游提供
+ //AGVModel.GetInstance.warehouseId = 123; //仓库编号
+ //AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级
+ //AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行
+ //AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE
+ ////详细任务数据
+ ////点到点
+ //AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位
+ //AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位
+ //AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料
+ //AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互
+ //AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料
+ //AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互
+ //AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance;
+ //string body = JsonConvert.SerializeObject(AGVModel.GetInstance);
+ ////货位到货位
+ ////AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号
+ ////AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号
+ ////AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料
+ ////AGV_SlotRollerJobData.GetInstance.enableIOLoad=true;//上料交互方式 false:接口交互 true:光电交互
+ ////AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料
+ ////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互
+ ////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance;
+ ////string body = JsonConvert.SerializeObject(AGVModel.GetInstance);
+ ////启用签名
+ ////url = url + "?sign=" + MD5Deal(body);
+ //string data = HttpRequest(url, head, body);
+ //object objData = JsonConvert.DeserializeObject(data);
+ //if (objData != null && objData is HttpResponseBodyModel response)
+ //{
+ // return response.code;
+ //}
+ return "Analysis Error";
+ }
+ ///
/// AGV离开炒锅1
///
///
@@ -483,6 +532,203 @@ namespace BPASmartClient.AGV
//}
return "Analysis Error";
}
+
+ ///
+ /// AGV从1号线运空桶洗桶
+ ///
+ ///
+ public string AgvLeaveLOneToClean(string robotJobId)
+ {
+ //string url = AGVRequestUrl.GetInstance.TaskSendUrl;
+ ////请求报文头
+ //HttpRequestHeaderModel.GetInstance.appKey = "";
+ //HttpRequestHeaderModel.GetInstance.appSecret = "";
+ //HttpRequestHeaderModel.GetInstance.requestId = "";
+ //HttpRequestHeaderModel.GetInstance.timestamp = "";
+ //HttpRequestHeaderModel.GetInstance.version = "2.8";
+ //string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance);
+ ////请求报文体
+ //AGVModel.GetInstance.robotJobId = robotJobId;//上游提供
+ //AGVModel.GetInstance.warehouseId = 123; //仓库编号
+ //AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级
+ //AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行
+ //AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE
+ ////详细任务数据
+ ////点到点
+ //AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位
+ //AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位
+ //AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料
+ //AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互
+ //AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料
+ //AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互
+ //AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance;
+ //string body = JsonConvert.SerializeObject(AGVModel.GetInstance);
+ ////货位到货位
+ ////AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号
+ ////AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号
+ ////AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料
+ ////AGV_SlotRollerJobData.GetInstance.enableIOLoad=true;//上料交互方式 false:接口交互 true:光电交互
+ ////AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料
+ ////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互
+ ////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance;
+ ////string body = JsonConvert.SerializeObject(AGVModel.GetInstance);
+ ////启用签名
+ ////url = url + "?sign=" + MD5Deal(body);
+ //string data = HttpRequest(url, head, body);
+ //object objData = JsonConvert.DeserializeObject(data);
+ //if (objData != null && objData is HttpResponseBodyModel response)
+ //{
+ // return response.code;
+ //}
+ return "Analysis Error";
+ }
+ ///
+ /// AGV从2号线运空桶洗桶
+ ///
+ ///
+ public string AgvLeaveLTwoToClean(string robotJobId)
+ {
+ //string url = AGVRequestUrl.GetInstance.TaskSendUrl;
+ ////请求报文头
+ //HttpRequestHeaderModel.GetInstance.appKey = "";
+ //HttpRequestHeaderModel.GetInstance.appSecret = "";
+ //HttpRequestHeaderModel.GetInstance.requestId = "";
+ //HttpRequestHeaderModel.GetInstance.timestamp = "";
+ //HttpRequestHeaderModel.GetInstance.version = "2.8";
+ //string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance);
+ ////请求报文体
+ //AGVModel.GetInstance.robotJobId = robotJobId;//上游提供
+ //AGVModel.GetInstance.warehouseId = 123; //仓库编号
+ //AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级
+ //AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行
+ //AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE
+ ////详细任务数据
+ ////点到点
+ //AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位
+ //AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位
+ //AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料
+ //AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互
+ //AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料
+ //AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互
+ //AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance;
+ //string body = JsonConvert.SerializeObject(AGVModel.GetInstance);
+ ////货位到货位
+ ////AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号
+ ////AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号
+ ////AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料
+ ////AGV_SlotRollerJobData.GetInstance.enableIOLoad=true;//上料交互方式 false:接口交互 true:光电交互
+ ////AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料
+ ////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互
+ ////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance;
+ ////string body = JsonConvert.SerializeObject(AGVModel.GetInstance);
+ ////启用签名
+ ////url = url + "?sign=" + MD5Deal(body);
+ //string data = HttpRequest(url, head, body);
+ //object objData = JsonConvert.DeserializeObject(data);
+ //if (objData != null && objData is HttpResponseBodyModel response)
+ //{
+ // return response.code;
+ //}
+ return "Analysis Error";
+ }
+ ///
+ /// AGV从3号线运空桶洗桶
+ ///
+ ///
+ public string AgvLeaveLThreeToClean(string robotJobId)
+ {
+ //string url = AGVRequestUrl.GetInstance.TaskSendUrl;
+ ////请求报文头
+ //HttpRequestHeaderModel.GetInstance.appKey = "";
+ //HttpRequestHeaderModel.GetInstance.appSecret = "";
+ //HttpRequestHeaderModel.GetInstance.requestId = "";
+ //HttpRequestHeaderModel.GetInstance.timestamp = "";
+ //HttpRequestHeaderModel.GetInstance.version = "2.8";
+ //string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance);
+ ////请求报文体
+ //AGVModel.GetInstance.robotJobId = robotJobId;//上游提供
+ //AGVModel.GetInstance.warehouseId = 123; //仓库编号
+ //AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级
+ //AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行
+ //AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE
+ ////详细任务数据
+ ////点到点
+ //AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位
+ //AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位
+ //AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料
+ //AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互
+ //AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料
+ //AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互
+ //AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance;
+ //string body = JsonConvert.SerializeObject(AGVModel.GetInstance);
+ ////货位到货位
+ ////AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号
+ ////AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号
+ ////AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料
+ ////AGV_SlotRollerJobData.GetInstance.enableIOLoad=true;//上料交互方式 false:接口交互 true:光电交互
+ ////AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料
+ ////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互
+ ////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance;
+ ////string body = JsonConvert.SerializeObject(AGVModel.GetInstance);
+ ////启用签名
+ ////url = url + "?sign=" + MD5Deal(body);
+ //string data = HttpRequest(url, head, body);
+ //object objData = JsonConvert.DeserializeObject(data);
+ //if (objData != null && objData is HttpResponseBodyModel response)
+ //{
+ // return response.code;
+ //}
+ return "Analysis Error";
+ }
+ ///
+ /// AGV从洗桶处运桶到4号洗桶线
+ ///
+ ///
+ public string AgvLeaveCleanToLFour(string robotJobId)
+ {
+ //string url = AGVRequestUrl.GetInstance.TaskSendUrl;
+ ////请求报文头
+ //HttpRequestHeaderModel.GetInstance.appKey = "";
+ //HttpRequestHeaderModel.GetInstance.appSecret = "";
+ //HttpRequestHeaderModel.GetInstance.requestId = "";
+ //HttpRequestHeaderModel.GetInstance.timestamp = "";
+ //HttpRequestHeaderModel.GetInstance.version = "2.8";
+ //string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance);
+ ////请求报文体
+ //AGVModel.GetInstance.robotJobId = robotJobId;//上游提供
+ //AGVModel.GetInstance.warehouseId = 123; //仓库编号
+ //AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级
+ //AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行
+ //AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE
+ ////详细任务数据
+ ////点到点
+ //AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位
+ //AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位
+ //AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料
+ //AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互
+ //AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料
+ //AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互
+ //AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance;
+ //string body = JsonConvert.SerializeObject(AGVModel.GetInstance);
+ ////货位到货位
+ ////AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号
+ ////AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号
+ ////AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料
+ ////AGV_SlotRollerJobData.GetInstance.enableIOLoad=true;//上料交互方式 false:接口交互 true:光电交互
+ ////AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料
+ ////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互
+ ////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance;
+ ////string body = JsonConvert.SerializeObject(AGVModel.GetInstance);
+ ////启用签名
+ ////url = url + "?sign=" + MD5Deal(body);
+ //string data = HttpRequest(url, head, body);
+ //object objData = JsonConvert.DeserializeObject(data);
+ //if (objData != null && objData is HttpResponseBodyModel response)
+ //{
+ // return response.code;
+ //}
+ return "Analysis Error";
+ }
///
/// 任务取消
///
diff --git a/BPASmartClient.Business/Plugin/ConfigMgr.cs b/BPASmartClient.Business/Plugin/ConfigMgr.cs
index a524cebb..82bde613 100644
--- a/BPASmartClient.Business/Plugin/ConfigMgr.cs
+++ b/BPASmartClient.Business/Plugin/ConfigMgr.cs
@@ -84,6 +84,7 @@ namespace BPASmartClient.Business
IConfigurationBuilder configurationBuilder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory());
configurationBuilder.AddApolloConfiguration(p =>
{
+
p.AppId = apoid;
p.MetaServer = apolloUri;
p.Namespaces = new List() { "application", namespa };
diff --git a/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj b/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj
index 80cbab40..b5146049 100644
--- a/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj
+++ b/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj
@@ -114,6 +114,10 @@
+
+
+
+
@@ -123,6 +127,7 @@
+
@@ -272,9 +277,14 @@
+
+
+
+
+
PreserveNewest
diff --git a/BPASmartClient.CustomResource/Image/按钮/AddGreen.png b/BPASmartClient.CustomResource/Image/按钮/AddGreen.png
new file mode 100644
index 00000000..13676da2
Binary files /dev/null and b/BPASmartClient.CustomResource/Image/按钮/AddGreen.png differ
diff --git a/BPASmartClient.CustomResource/Image/按钮/Delete.png b/BPASmartClient.CustomResource/Image/按钮/Delete.png
new file mode 100644
index 00000000..f53eb2b3
Binary files /dev/null and b/BPASmartClient.CustomResource/Image/按钮/Delete.png differ
diff --git a/BPASmartClient.CustomResource/Image/按钮/停用.png b/BPASmartClient.CustomResource/Image/按钮/停用.png
new file mode 100644
index 00000000..cb46f6d7
Binary files /dev/null and b/BPASmartClient.CustomResource/Image/按钮/停用.png differ
diff --git a/BPASmartClient.CustomResource/Image/按钮/添加.png b/BPASmartClient.CustomResource/Image/按钮/添加.png
new file mode 100644
index 00000000..d6e06298
Binary files /dev/null and b/BPASmartClient.CustomResource/Image/按钮/添加.png differ
diff --git a/BPASmartClient.CustomResource/Image/权限背景.png b/BPASmartClient.CustomResource/Image/权限背景.png
new file mode 100644
index 00000000..59876f6a
Binary files /dev/null and b/BPASmartClient.CustomResource/Image/权限背景.png differ
diff --git a/BPASmartClient.CustomResource/Pages/Model/Config.cs b/BPASmartClient.CustomResource/Pages/Model/Config.cs
index cf2e3fe3..dc0eb6ca 100644
--- a/BPASmartClient.CustomResource/Pages/Model/Config.cs
+++ b/BPASmartClient.CustomResource/Pages/Model/Config.cs
@@ -38,10 +38,7 @@ namespace BPASmartClient.CustomResource.Pages.Model
private void AddData()
{
- Global.userManager.userInfos.Add(new UserInfo() { Id = IdProcess(), permission = Permission.管理员, UserName = "admin", Password = "admin" }); ;
- Global.userManager.userInfos.Add(new UserInfo() { Id = IdProcess(), permission = Permission.操作员, UserName = "czy", Password = "123456" });
- Global.userManager.userInfos.Add(new UserInfo() { Id = IdProcess(), permission = Permission.观察员, UserName = "gcy", Password = "654321" });
- Global.userManager.userInfos.Add(new UserInfo() { Id = IdProcess(), permission = Permission.技术员, UserName = "jsy", Password = "88888888" });
+ Global.userManager.userInfos.Add(new UserInfo() { permission = Permission.管理员, UserName = "admin", Password = "admin" });
SaveUser();
}
diff --git a/BPASmartClient.CustomResource/Pages/Model/Global.cs b/BPASmartClient.CustomResource/Pages/Model/Global.cs
index cd0a6548..86de75c5 100644
--- a/BPASmartClient.CustomResource/Pages/Model/Global.cs
+++ b/BPASmartClient.CustomResource/Pages/Model/Global.cs
@@ -12,6 +12,10 @@ namespace BPASmartClient.CustomResource.Pages.Model
public static UserManager userManager { get; set; } = new UserManager();
public static UserInfo userInfo { get; set; } = new UserInfo();
+ ///
+ /// 重置密码页面传值
+ ///
+ public static UserInfo changeUserInfo { get; set; } = null;
}
}
diff --git a/BPASmartClient.CustomResource/Pages/Model/MenuManage.cs b/BPASmartClient.CustomResource/Pages/Model/MenuManage.cs
index 1edcc1ab..9522aae3 100644
--- a/BPASmartClient.CustomResource/Pages/Model/MenuManage.cs
+++ b/BPASmartClient.CustomResource/Pages/Model/MenuManage.cs
@@ -114,7 +114,7 @@ namespace BPASmartClient.CustomResource.Pages.Model
/// 子菜单的显示隐藏设置
///
public Visibility SubMenuVisibility { get { return _mSubMenuVisibility; } set { _mSubMenuVisibility = value; OnPropertyChanged(); } }
- private Visibility _mSubMenuVisibility;
+ private Visibility _mSubMenuVisibility = Visibility.Collapsed;
}
diff --git a/BPASmartClient.CustomResource/Pages/Model/MessageLog.cs b/BPASmartClient.CustomResource/Pages/Model/MessageLog.cs
index b82a7dca..251fa976 100644
--- a/BPASmartClient.CustomResource/Pages/Model/MessageLog.cs
+++ b/BPASmartClient.CustomResource/Pages/Model/MessageLog.cs
@@ -7,6 +7,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows;
using BPASmartClient.Model;
+using System.Windows.Media;
namespace BPASmartClient.CustomResource.Pages.Model
{
@@ -72,8 +73,9 @@ namespace BPASmartClient.CustomResource.Pages.Model
RunLog?.Invoke(info);
}
}
+
int AlarmID;
- public void ShowAlarmLog(string info, string AlarmNumber="_", AlarmLevel level= AlarmLevel.一般报警)
+ public void ShowAlarmLog(string info, string AlarmNumber = "_", AlarmLevel level = AlarmLevel.一般报警)
{
lock (alarmlock)
{
@@ -85,7 +87,7 @@ namespace BPASmartClient.CustomResource.Pages.Model
Time = DateTime.Now.ToString("HH:mm:ss"),
Info = info,
Value = AlarmNumber,
- Grade = (level)+""
+ Grade = (level) + ""
};
Sqlite.GetInstance.Base.Add(alarmLog);
Application.Current.Dispatcher.Invoke(new Action(() => { alarmLogs.Insert(0, alarmLog); }));
diff --git a/BPASmartClient.CustomResource/Pages/Model/PlcVariableInfoManage.cs b/BPASmartClient.CustomResource/Pages/Model/PlcVariableInfoManage.cs
index b8c11c6c..80834923 100644
--- a/BPASmartClient.CustomResource/Pages/Model/PlcVariableInfoManage.cs
+++ b/BPASmartClient.CustomResource/Pages/Model/PlcVariableInfoManage.cs
@@ -1,5 +1,6 @@
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System;
+using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
@@ -10,6 +11,6 @@ namespace BPASmartClient.CustomResource.Pages.Model
{
public class PlcVariableInfoManage:ObservableObject
{
- public ObservableCollection VariablesInfo { get; set; } = new ObservableCollection();
+ public ConcurrentDictionary> VariablesInfo { get; set; } = new ConcurrentDictionary>();
}
}
diff --git a/BPASmartClient.CustomResource/Pages/Model/UserInfo.cs b/BPASmartClient.CustomResource/Pages/Model/UserInfo.cs
index b0bd7add..7f85b3dc 100644
--- a/BPASmartClient.CustomResource/Pages/Model/UserInfo.cs
+++ b/BPASmartClient.CustomResource/Pages/Model/UserInfo.cs
@@ -10,6 +10,8 @@ namespace BPASmartClient.CustomResource.Pages.Model
{
public class UserInfo:ObservableObject
{
+ public String LastLogInTime { get; set; } = "无";
+ public List userTreeViewModels { get; set; }
public string Id { get { return _id; }set { _id = value;OnPropertyChanged(); } }
private string _id;
public Permission permission { get { return _perimission; } set { _perimission = value;OnPropertyChanged(); } }
diff --git a/BPASmartClient.CustomResource/Pages/Model/UserManager.cs b/BPASmartClient.CustomResource/Pages/Model/UserManager.cs
index 1baf3908..f07f7f37 100644
--- a/BPASmartClient.CustomResource/Pages/Model/UserManager.cs
+++ b/BPASmartClient.CustomResource/Pages/Model/UserManager.cs
@@ -10,5 +10,6 @@ namespace BPASmartClient.CustomResource.Pages.Model
public class UserManager
{
public ObservableCollection userInfos { get; set; } = new ObservableCollection();
+
}
}
diff --git a/BPASmartClient.CustomResource/Pages/Model/UserTreeViewModel.cs b/BPASmartClient.CustomResource/Pages/Model/UserTreeViewModel.cs
new file mode 100644
index 00000000..4fb56aae
--- /dev/null
+++ b/BPASmartClient.CustomResource/Pages/Model/UserTreeViewModel.cs
@@ -0,0 +1,16 @@
+using Microsoft.Toolkit.Mvvm.ComponentModel;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BPASmartClient.CustomResource.Pages.Model
+{
+ public class UserTreeViewModel: ObservableObject
+ {
+ public string Name { get; set; }
+
+ public List TreeViewItems { get; set; }
+ }
+}
diff --git a/BPASmartClient.CustomResource/Pages/View/AddNewUser.xaml b/BPASmartClient.CustomResource/Pages/View/AddNewUser.xaml
new file mode 100644
index 00000000..8ffed030
--- /dev/null
+++ b/BPASmartClient.CustomResource/Pages/View/AddNewUser.xaml
@@ -0,0 +1,330 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BPASmartClient.CustomResource/Pages/View/AddNewUser.xaml.cs b/BPASmartClient.CustomResource/Pages/View/AddNewUser.xaml.cs
new file mode 100644
index 00000000..86ccecec
--- /dev/null
+++ b/BPASmartClient.CustomResource/Pages/View/AddNewUser.xaml.cs
@@ -0,0 +1,60 @@
+using BPASmartClient.Helper;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace BPASmartClient.CustomResource.Pages.View
+{
+ ///
+ /// AddNewUser.xaml 的交互逻辑
+ ///
+ public partial class AddNewUser : Window
+ {
+ public AddNewUser()
+ {
+ InitializeComponent();
+ this.br.MouseLeftButtonDown += (o, e) =>
+ {
+ if (e.LeftButton == MouseButtonState.Pressed) this.DragMove();
+ };
+ ActionManage.GetInstance.CancelRegister("AddNewUserViewConfirm");
+ ActionManage.GetInstance.CancelRegister("AddNewUserViewCancel");
+ ActionManage.GetInstance.Register(new Action(() => { this.DialogResult = true; this.Close(); }), "AddNewUserViewConfirm");
+ ActionManage.GetInstance.Register(new Action(() => { this.DialogResult = false; this.Close(); }), "AddNewUserViewCancel");
+ }
+
+ private void newpb2_PasswordChanged(object sender, RoutedEventArgs e)
+ {
+ if (this.newpb2.Password.Length > 0)
+ {
+ this.newmarkText2.Visibility = Visibility.Collapsed;
+ }
+ else
+ {
+ this.newmarkText2.Visibility = Visibility.Visible;
+ }
+ }
+
+ private void newpb1_PasswordChanged(object sender, RoutedEventArgs e)
+ {
+ if (this.newpb1.Password.Length > 0)
+ {
+ this.newmarkText1.Visibility = Visibility.Collapsed;
+ }
+ else
+ {
+ this.newmarkText1.Visibility = Visibility.Visible;
+ }
+ }
+ }
+}
diff --git a/BPASmartClient.CustomResource/Pages/View/AlarmView.xaml b/BPASmartClient.CustomResource/Pages/View/AlarmView.xaml
index 9e780547..504777d0 100644
--- a/BPASmartClient.CustomResource/Pages/View/AlarmView.xaml
+++ b/BPASmartClient.CustomResource/Pages/View/AlarmView.xaml
@@ -25,7 +25,7 @@
-->
-
+
@@ -157,7 +157,7 @@
-
+
diff --git a/BPASmartClient.CustomResource/Pages/View/PermissionConfigurationView.xaml b/BPASmartClient.CustomResource/Pages/View/PermissionConfigurationView.xaml
new file mode 100644
index 00000000..318d52da
--- /dev/null
+++ b/BPASmartClient.CustomResource/Pages/View/PermissionConfigurationView.xaml
@@ -0,0 +1,14 @@
+
+
+
+
+
diff --git a/BPASmartClient.CustomResource/Pages/View/PermissionConfigurationView.xaml.cs b/BPASmartClient.CustomResource/Pages/View/PermissionConfigurationView.xaml.cs
new file mode 100644
index 00000000..6e4f38b1
--- /dev/null
+++ b/BPASmartClient.CustomResource/Pages/View/PermissionConfigurationView.xaml.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace BPASmartClient.CustomResource.Pages.View
+{
+ ///
+ /// PermissionConfigurationView.xaml 的交互逻辑
+ ///
+ public partial class PermissionConfigurationView : UserControl
+ {
+ public PermissionConfigurationView()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/BPASmartClient.CustomResource/Pages/View/RunLogView.xaml b/BPASmartClient.CustomResource/Pages/View/RunLogView.xaml
index 8a0f69a5..ec8e79db 100644
--- a/BPASmartClient.CustomResource/Pages/View/RunLogView.xaml
+++ b/BPASmartClient.CustomResource/Pages/View/RunLogView.xaml
@@ -25,7 +25,7 @@
-->
-
+
@@ -158,7 +158,7 @@
-
+
@@ -261,7 +261,8 @@
+ Text="{Binding RunLogInfo}"
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BPASmartClient.CustomResource/Pages/View/UserConfigView.xaml.cs b/BPASmartClient.CustomResource/Pages/View/UserConfigView.xaml.cs
new file mode 100644
index 00000000..c986e559
--- /dev/null
+++ b/BPASmartClient.CustomResource/Pages/View/UserConfigView.xaml.cs
@@ -0,0 +1,44 @@
+using BPASmartClient.Helper;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace BPASmartClient.CustomResource.Pages.View
+{
+ ///
+ /// UserConfigView.xaml 的交互逻辑
+ ///
+ public partial class UserConfigView : Window
+ {
+ public UserConfigView()
+ {
+ InitializeComponent();
+ this.br.MouseLeftButtonDown += (o, e) =>
+ {
+ if (e.LeftButton == MouseButtonState.Pressed) this.DragMove();
+ };
+ ActionManage.GetInstance.CancelRegister("UserConfigViewConfirm");
+ ActionManage.GetInstance.CancelRegister("UserConfigViewCancel");
+ ActionManage.GetInstance.Register(new Action(() => { this.DialogResult = true; this.Close(); }), "UserConfigViewConfirm");
+ ActionManage.GetInstance.Register(new Action(() => { this.DialogResult = false; this.Close(); }), "UserConfigViewCancel");
+
+
+ }
+
+
+
+
+ }
+
+
+}
diff --git a/BPASmartClient.CustomResource/Pages/View/UserLogView.xaml b/BPASmartClient.CustomResource/Pages/View/UserLogView.xaml
index dc8eb9c9..ac3ce937 100644
--- a/BPASmartClient.CustomResource/Pages/View/UserLogView.xaml
+++ b/BPASmartClient.CustomResource/Pages/View/UserLogView.xaml
@@ -26,7 +26,7 @@
-->
-
+
@@ -240,7 +240,7 @@
-
+
diff --git a/BPASmartClient.CustomResource/Pages/View/UserManagerView.xaml b/BPASmartClient.CustomResource/Pages/View/UserManagerView.xaml
new file mode 100644
index 00000000..5079533d
--- /dev/null
+++ b/BPASmartClient.CustomResource/Pages/View/UserManagerView.xaml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BPASmartClient.CustomResource/Pages/View/UserManagerView.xaml.cs b/BPASmartClient.CustomResource/Pages/View/UserManagerView.xaml.cs
new file mode 100644
index 00000000..5ceb5549
--- /dev/null
+++ b/BPASmartClient.CustomResource/Pages/View/UserManagerView.xaml.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace BPASmartClient.CustomResource.Pages.View
+{
+ ///
+ /// UserManager.xaml 的交互逻辑
+ ///
+ public partial class UserManagerView : UserControl
+ {
+ public UserManagerView()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/BPASmartClient.CustomResource/Pages/View/VariableConfigView.xaml b/BPASmartClient.CustomResource/Pages/View/VariableConfigView.xaml
index e58ed834..9abfd756 100644
--- a/BPASmartClient.CustomResource/Pages/View/VariableConfigView.xaml
+++ b/BPASmartClient.CustomResource/Pages/View/VariableConfigView.xaml
@@ -5,12 +5,14 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.CustomResource.Pages.View"
xmlns:vm="clr-namespace:BPASmartClient.CustomResource.Pages.ViewModel"
+ xmlns:theme="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero2"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -124,6 +568,5 @@
-->
-
diff --git a/BPASmartClient.CustomResource/Pages/View/VariableConfigView.xaml.cs b/BPASmartClient.CustomResource/Pages/View/VariableConfigView.xaml.cs
index f133e9ba..51a962d4 100644
--- a/BPASmartClient.CustomResource/Pages/View/VariableConfigView.xaml.cs
+++ b/BPASmartClient.CustomResource/Pages/View/VariableConfigView.xaml.cs
@@ -29,7 +29,93 @@ namespace BPASmartClient.CustomResource.Pages.View
{
e.Row.Header = e.Row.GetIndex() + 1;
}
+ private void fryOne_LoadingRow(object sender, DataGridRowEventArgs e)
+ {
+ e.Row.Header = e.Row.GetIndex() + 1;
+ }
+
+ private void fryTwo_LoadingRow(object sender, DataGridRowEventArgs e)
+ {
+ e.Row.Header = e.Row.GetIndex() + 1;
+ }
+
+ private void fryThree_LoadingRow(object sender, DataGridRowEventArgs e)
+ {
+ e.Row.Header = e.Row.GetIndex() + 1;
+ }
+
+ private void fryFour_LoadingRow(object sender, DataGridRowEventArgs e)
+ {
+ e.Row.Header = e.Row.GetIndex() + 1;
+ }
+
+ private void fryFive_LoadingRow(object sender, DataGridRowEventArgs e)
+ {
+ e.Row.Header = e.Row.GetIndex() + 1;
+ }
+
+ private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ ComboBox cbo= sender as ComboBox;
+ if (cbo != null)
+ {
+ switch (cbo.SelectedValue)
+ {
+ case "滚筒输送线":
+ this.GT.Visibility = Visibility.Visible;
+ this.fryOne.Visibility = Visibility.Collapsed;
+ this.fryTwo.Visibility=Visibility.Collapsed;
+ this.fryThree.Visibility = Visibility.Collapsed;
+ this.fryFour.Visibility = Visibility.Collapsed;
+ this.fryFive.Visibility = Visibility.Collapsed;
+ break;
+ case "炒锅1":
+ this.GT.Visibility = Visibility.Collapsed;
+ this.fryOne.Visibility = Visibility.Visible;
+ this.fryTwo.Visibility = Visibility.Collapsed;
+ this.fryThree.Visibility = Visibility.Collapsed;
+ this.fryFour.Visibility = Visibility.Collapsed;
+ this.fryFive.Visibility = Visibility.Collapsed;
+ break;
+ case "炒锅2":
+ this.GT.Visibility = Visibility.Collapsed;
+ this.fryOne.Visibility = Visibility.Collapsed;
+ this.fryTwo.Visibility = Visibility.Visible;
+ this.fryThree.Visibility = Visibility.Collapsed;
+ this.fryFour.Visibility = Visibility.Collapsed;
+ this.fryFive.Visibility = Visibility.Collapsed;
+ break;
+ case "炒锅3":
+ this.GT.Visibility = Visibility.Collapsed;
+ this.fryOne.Visibility = Visibility.Collapsed;
+ this.fryTwo.Visibility = Visibility.Collapsed;
+ this.fryThree.Visibility = Visibility.Visible;
+ this.fryFour.Visibility = Visibility.Collapsed;
+ this.fryFive.Visibility = Visibility.Collapsed;
+ break;
+ case "炒锅4":
+ this.GT.Visibility = Visibility.Collapsed;
+ this.fryOne.Visibility = Visibility.Collapsed;
+ this.fryTwo.Visibility = Visibility.Collapsed;
+ this.fryThree.Visibility = Visibility.Collapsed;
+ this.fryFour.Visibility = Visibility.Visible;
+ this.fryFive.Visibility = Visibility.Collapsed;
+ break;
+ case "炒锅5":
+ this.GT.Visibility = Visibility.Collapsed;
+ this.fryOne.Visibility = Visibility.Collapsed;
+ this.fryTwo.Visibility = Visibility.Collapsed;
+ this.fryThree.Visibility = Visibility.Collapsed;
+ this.fryFour.Visibility = Visibility.Collapsed;
+ this.fryFive.Visibility = Visibility.Visible;
+ break;
+ }
+
+
+ }
+
+ }
-
+
}
}
diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/AddNewUserViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/AddNewUserViewModel.cs
new file mode 100644
index 00000000..3d16eea7
--- /dev/null
+++ b/BPASmartClient.CustomResource/Pages/ViewModel/AddNewUserViewModel.cs
@@ -0,0 +1,61 @@
+using BPASmartClient.CustomResource.Pages.Model;
+using BPASmartClient.Helper;
+using Microsoft.Toolkit.Mvvm.ComponentModel;
+using Microsoft.Toolkit.Mvvm.Input;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BPASmartClient.CustomResource.Pages.ViewModel
+{
+ public class AddNewUserViewModel:ObservableObject
+ {
+ public string ErrorInfo { get { return _mErrorInfo; } set { _mErrorInfo = value; OnPropertyChanged(); } }
+ private string _mErrorInfo;
+
+ public string UserName { get { return _userName; } set { _userName = value; OnPropertyChanged(); } }
+ private string _userName;
+
+
+ public string NewPassword1 { get { return _mNewPassword1; } set { _mNewPassword1 = value; OnPropertyChanged(); } }
+ private string _mNewPassword1;
+
+
+ public string NewPassword2 { get { return _mNewPassword2; } set { _mNewPassword2 = value; OnPropertyChanged(); } }
+ private string _mNewPassword2;
+
+ public RelayCommand ExitCommand { get; set; }
+
+ public RelayCommand ConfirmCommand { get; set; }
+
+ private void Confirm()
+ {
+ if (UserName == null) { ErrorInfo = "用户名不能为空"; return; }
+ if (NewPassword1 == null) { ErrorInfo = "请输入密码"; return; }
+ if (NewPassword2 != NewPassword1) { ErrorInfo = "两次密码不一致"; return; }
+ var res = Global.userManager.userInfos.FirstOrDefault(p => p.UserName == UserName);
+ if (res != null) { ErrorInfo = "用户名已存在";return; }
+ Global.userManager.userInfos.Add(new UserInfo
+ {
+ UserName = UserName,
+ Password = NewPassword1,
+ userTreeViewModels = new List()
+ });
+ Config.GetInstance.SaveUser();
+ ActionManage.GetInstance.Send("AddNewUserViewConfirm");
+ }
+
+ public AddNewUserViewModel()
+ {
+ ConfirmCommand = new RelayCommand(Confirm);
+
+ ExitCommand = new RelayCommand(() =>
+ {
+ ActionManage.GetInstance.Send("AddNewUserViewCancel");
+
+ });
+ }
+ }
+}
diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/LoginViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/LoginViewModel.cs
index 1bb9c66a..0856154d 100644
--- a/BPASmartClient.CustomResource/Pages/ViewModel/LoginViewModel.cs
+++ b/BPASmartClient.CustomResource/Pages/ViewModel/LoginViewModel.cs
@@ -63,26 +63,60 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
Global.userInfo.permission = res.permission;
Global.userInfo.UserName = res.UserName;
Global.userInfo.Password = res.Password;
- for (int i = 0; i < MenuManage.GetInstance.menuModels.Count; i++)
+ Global.userInfo.LastLogInTime = DateTime.Now.ToString();
+ res.LastLogInTime = DateTime.Now.ToString();
+ Config.GetInstance.SaveUser();
+ if(res.permission == Enums.Permission.管理员)
{
- if (MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuPermission.Contains(res.permission))
- MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Visible;
- else
- MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Collapsed;
-
- if (MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.FirstOrDefault(p => p.SubMenuPermission.Contains(res.permission)) == null)
- MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Collapsed;
-
- for (int m = 0; m < MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.Count; m++)
+ foreach( var items in MenuManage.GetInstance.menuModels)
{
- if (MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuPermission.Contains(res.permission))
- MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuVisibility = Visibility.Visible;
- else
- MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuVisibility = Visibility.Collapsed;
+ foreach(var item in items.subMenumodels)
+ {
+ item.SubMenuVisibility = Visibility.Visible;
+ }
}
}
+ else
+ {
+ if (res.userTreeViewModels != null)
+ {
+ if (res.userTreeViewModels.Count > 0)
+ {
+ foreach (var items in MenuManage.GetInstance.menuModels)
+ {
+ foreach (var item in items.subMenumodels)
+ {
+ if (res.userTreeViewModels.FirstOrDefault(p => p.Name == item.SubMenuName) != null)
+ {
+ item.SubMenuVisibility = Visibility.Visible;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ //for (int i = 0; i < MenuManage.GetInstance.menuModels.Count; i++)
+ //{
+ // if (MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuPermission.Contains(res.permission))
+ // MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Visible;
+ // else
+ // MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Collapsed;
+
+ // if (MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.FirstOrDefault(p => p.SubMenuPermission.Contains(res.permission)) == null)
+ // MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Collapsed;
+
+ // for (int m = 0; m < MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.Count; m++)
+ // {
+ // if (MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuPermission.Contains(res.permission))
+ // MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuVisibility = Visibility.Visible;
+ // else
+ // MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuVisibility = Visibility.Collapsed;
+ // }
+ //}
ActionManage.GetInstance.Send("PermissionChange");
ActionManage.GetInstance.Send("LoginOk");
+
}
else
{
diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/PasswordChangeViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/PasswordChangeViewModel.cs
index 2acd2f58..acf516e9 100644
--- a/BPASmartClient.CustomResource/Pages/ViewModel/PasswordChangeViewModel.cs
+++ b/BPASmartClient.CustomResource/Pages/ViewModel/PasswordChangeViewModel.cs
@@ -10,37 +10,48 @@ using Microsoft.Toolkit.Mvvm.Input;
namespace BPASmartClient.CustomResource.Pages.ViewModel
{
+
public class PasswordChangeViewModel : ObservableObject
{
- public PasswordChangeViewModel()
+ private void CheckPassword(UserInfo userInfo)
{
- LoginCommand = new RelayCommand(() =>
+ if (userInfo.Password == OldPassword)
{
- if (Global.userInfo.Password == OldPassword)
+ if (NewPassword1 == NewPassword2)
{
- if (NewPassword1 == NewPassword2)
- {
- Global.userInfo.Password = NewPassword2;
- int index = Array.FindIndex(Global.userManager.userInfos.ToArray(), p => p.UserName == Global.userInfo.UserName);
- if (index >= 0 && index < Global.userManager.userInfos.Count)
- Global.userManager.userInfos.ElementAt(index).Password = NewPassword1;
- Config.GetInstance.SaveUser();
- ActionManage.GetInstance.Send("PasswordChangeViewconfirm");
- }
- else
- {
- ErrorInfo = "新密码不匹配";
- }
+ userInfo.Password = NewPassword2;
+ int index = Array.FindIndex(Global.userManager.userInfos.ToArray(), p => p.UserName == userInfo.UserName);
+ if (index >= 0 && index < Global.userManager.userInfos.Count)
+ Global.userManager.userInfos.ElementAt(index).Password = NewPassword1;
+ Config.GetInstance.SaveUser();
+ ActionManage.GetInstance.Send("PasswordChangeViewconfirm");
+ Global.changeUserInfo = null;
}
else
{
- ErrorInfo = "原密码错误";
+ ErrorInfo = "新密码不匹配";
}
+ }
+ else
+ {
+ ErrorInfo = "原密码错误";
+ }
+ }
+
+ public PasswordChangeViewModel( )
+ {
+ LoginCommand = new RelayCommand(() =>
+ {
+ if (Global.changeUserInfo == null) CheckPassword(Global.userInfo);
+ else { CheckPassword(Global.changeUserInfo); }
+
+
});
ExitCommand = new RelayCommand(() =>
{
ActionManage.GetInstance.Send("PasswordChangeViewCancel");
+ Global.changeUserInfo = null;
});
}
diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/PermissionConfigurationViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/PermissionConfigurationViewModel.cs
new file mode 100644
index 00000000..b9eb013c
--- /dev/null
+++ b/BPASmartClient.CustomResource/Pages/ViewModel/PermissionConfigurationViewModel.cs
@@ -0,0 +1,14 @@
+using Microsoft.Toolkit.Mvvm.ComponentModel;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BPASmartClient.CustomResource.Pages.ViewModel
+{
+ public class PermissionConfigurationViewModel:ObservableObject
+ {
+
+ }
+}
diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/UserConfigViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/UserConfigViewModel.cs
new file mode 100644
index 00000000..1a673535
--- /dev/null
+++ b/BPASmartClient.CustomResource/Pages/ViewModel/UserConfigViewModel.cs
@@ -0,0 +1,158 @@
+using BPASmartClient.CustomResource.Pages.Model;
+using BPASmartClient.CustomResource.Pages.View;
+using BPASmartClient.Helper;
+using Microsoft.Toolkit.Mvvm.ComponentModel;
+using Microsoft.Toolkit.Mvvm.Input;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BPASmartClient.CustomResource.Pages.ViewModel
+{
+ public class UserConfigViewModel:ObservableObject
+ {
+ ///
+ /// 页面列表集合
+ ///
+ public ObservableCollection pageTreeViewModels { get; set; } = new ObservableCollection();
+ ///
+ /// 已选择页面
+ ///
+ public ObservableCollection SelectePage { get; set; } = new ObservableCollection();
+
+ ///
+ /// 用户名
+ ///
+ public string UserName { get { return _username; } set { _username = value; OnPropertyChanged(); } }
+ private string _username;
+
+ public RelayCommand