1
This commit is contained in:
commit
9944b27e85
25
.gitignore
vendored
25
.gitignore
vendored
@ -1,4 +1,4 @@
|
||||
################################################################################
|
||||
################################################################################
|
||||
# 此 .gitignore 文件已由 Microsoft(R) Visual Studio 自动创建。
|
||||
################################################################################
|
||||
# 忽略所有bin文件夹及其内容
|
||||
@ -1077,6 +1077,29 @@ bin/release/
|
||||
/newFront/c#前端/.vs/SWS.CAD/v17/DocumentLayout.json
|
||||
/newFront/c#前端/.vs/SWS.CAD/v17/fileList.bin
|
||||
/.vs/VSWorkspaceState.json
|
||||
/Learun.Application.Organization/bin/Debug/Learun.Util.xml
|
||||
/Learun.Application.Web/.vs/Learun.Application.Web.csproj.dtbcache.json
|
||||
/Learun.Application.Web/bin/XmlConfig/log4net.config
|
||||
/Learun.Application.Web/bin/Learun.Util.xml
|
||||
/Learun.Framework.Module/Learun.Application.Module/Learun.Application.AppMagager/bin/Debug/Learun.Util.xml
|
||||
/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Form/bin/Debug/Learun.Util.xml
|
||||
/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Base/bin/Debug/Learun.Util.xml
|
||||
/Learun.Framework.Module/Learun.Application.Module/Learun.Application.IM/bin/Debug/Learun.Util.xml
|
||||
/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/bin/Debug/Learun.Util.xml
|
||||
/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Message/bin/Debug/Learun.Util.xml
|
||||
/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/bin/Debug/Learun.Util.xml
|
||||
/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Report/bin/Debug/Learun.Util.xml
|
||||
/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Scheduler/bin/Debug/Learun.Util.xml
|
||||
/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/bin/Debug/Learun.Util.xml
|
||||
/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WeChat/bin/Debug/Learun.Util.xml
|
||||
/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/bin/Debug/Learun.Util.xml
|
||||
/Learun.Framework.Module/Learun.Db/Learun.DataBase/bin/Debug/Learun.Util.xml
|
||||
/Learun.Framework.Module/Learun.Db/Learun.DataBase.Repository/bin/Debug/Learun.Util.xml
|
||||
/Learun.Framework.Module/Learun.Util/Learun.Util/bin/Debug/Learun.Util.xml
|
||||
/Learun.Framework.Module/Learun.Workflow/Learun.Workflow.Engine/bin/Debug/Learun.Util.xml
|
||||
/Learun.Framework.Module/Learun.Util/Learun.Util.Operat/bin/Debug/Learun.Util.xml
|
||||
/Learun.Framework.Module/Learun.Util/Learun.Util/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
|
||||
newFront/c#前端/.vs/
|
||||
/Department2/obj/Debug/Department2.csproj.AssemblyReference.cache
|
||||
/newFront/c#前端/.vs/SWS.CAD/FileContentIndex/3ad7c96f-983b-4ac1-9f92-f5a7901a6021.vsidx
|
||||
/newFront/c#前端/.vs/SWS.CAD/FileContentIndex/815c1f12-618a-42f1-9f48-530a4fe7066c.vsidx
|
||||
|
BIN
.vs/Di-Electrical/v17/.wsuo
Normal file
BIN
.vs/Di-Electrical/v17/.wsuo
Normal file
Binary file not shown.
41
.vs/Di-Electrical/v17/DocumentLayout.json
Normal file
41
.vs/Di-Electrical/v17/DocumentLayout.json
Normal file
@ -0,0 +1,41 @@
|
||||
{
|
||||
"Version": 1,
|
||||
"WorkspaceRootPath": "E:\\Di-Electrical\\",
|
||||
"Documents": [],
|
||||
"DocumentGroupContainers": [
|
||||
{
|
||||
"Orientation": 0,
|
||||
"VerticalTabListWidth": 256,
|
||||
"DocumentGroups": [
|
||||
{
|
||||
"DockedWidth": 203,
|
||||
"SelectedChildIndex": -1,
|
||||
"Children": [
|
||||
{
|
||||
"$type": "Bookmark",
|
||||
"Name": "ST:0:0:{f2e84780-2af1-11d1-a7fa-00a0c9110051}"
|
||||
},
|
||||
{
|
||||
"$type": "Bookmark",
|
||||
"Name": "ST:1787071360:0:{81164725-9a96-4ece-a4cb-440d8fd285e5}"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"DockedWidth": 197,
|
||||
"SelectedChildIndex": -1,
|
||||
"Children": [
|
||||
{
|
||||
"$type": "Bookmark",
|
||||
"Name": "ST:1:0:{3ae79031-e1bc-11d0-8f78-00a0c9110057}"
|
||||
},
|
||||
{
|
||||
"$type": "Bookmark",
|
||||
"Name": "ST:0:0:{3ae79031-e1bc-11d0-8f78-00a0c9110057}"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -160,7 +160,7 @@ namespace Learun.Application.Web.AppApi
|
||||
RES.AddRange(
|
||||
pubObjs.Where(y => y.FileRevision == DETAIL.DataItemName
|
||||
&&
|
||||
dwgs.Select(x => x.DrawingFileID).Contains(y.DrawingFileID)).OrderBy(X=>X.DrawingFileID).OrderBy(X=>X.CreateTime));
|
||||
dwgs.Select(x => x.DrawingFileID).Contains(y.DrawingFileID)).OrderBy(X => X.DrawingFileID).OrderBy(X => X.CreateTime));
|
||||
}
|
||||
|
||||
}
|
||||
@ -607,8 +607,7 @@ namespace Learun.Application.Web.AppApi
|
||||
{
|
||||
try
|
||||
{
|
||||
string queryJson = "{\"DrawingFileID\":\"" + drawingFileID + "\",\"ProjectId\":\"" + projectId + "\"}";
|
||||
var listDrawingSyn = ec_drawing_synIBLL.GetList(queryJson);
|
||||
var listDrawingSyn = ec_drawing_synIBLL.GetList(projectId, drawingFileID, null);
|
||||
return Success(listDrawingSyn);
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -628,8 +627,7 @@ namespace Learun.Application.Web.AppApi
|
||||
{
|
||||
try
|
||||
{
|
||||
string queryJson = "{\"DrawingFileID\":\"" + drawingFileID + "\",\"ProjectId\":\"" + projectId + "\"}";
|
||||
var listDrawingPublish = ec_drawing_publishIBLL.GetList(queryJson);
|
||||
var listDrawingPublish = ec_drawing_publishIBLL.GetList(projectId, drawingFileID);
|
||||
return Success(listDrawingPublish);
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -648,9 +646,8 @@ namespace Learun.Application.Web.AppApi
|
||||
public IHttpActionResult GetOperateLog(string projectId, string drawingFileID)
|
||||
{
|
||||
try
|
||||
{
|
||||
string queryJson = "{\"OwnerID\":\"" + drawingFileID + "\",\"ProjectId\":\"" + projectId + "\"}";
|
||||
var listlog = ec_operate_logIBLL.GetList(queryJson);
|
||||
{
|
||||
var listlog = ec_operate_logIBLL.GetList(projectId,drawingFileID);
|
||||
return Success(listlog);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
@ -93,8 +93,7 @@ namespace Learun.Application.Web.AppApi
|
||||
logEntity.F_ExecuteResult = 1;
|
||||
logEntity.F_ExecuteResultJson = "登录成功";
|
||||
logEntity.WriteLog();
|
||||
var X= log4net.LogManager.GetLogger("INFO");
|
||||
X.Info("登录成功!");
|
||||
|
||||
OperatorHelper.Instance.ClearCurrentErrorNum(); //成功了 就可以重置了
|
||||
bool isFirstLogin = false;
|
||||
if (userEntity.PasswordUpdateTime == null)//没有修改密码
|
||||
|
@ -39,7 +39,7 @@ namespace Learun.Application.Web.AppApi
|
||||
[HandlerApiLogin(FilterMode.Enforce)]
|
||||
public IHttpActionResult Add(string ProjectId, string Users, string DrawingID)
|
||||
{
|
||||
var synRecord = new ec_drawing_synBLL().GetList("{DrawingFileID:\"" + DrawingID + "\",ProjectId:\"" + ProjectId + "\"}");
|
||||
var synRecord = new ec_drawing_synBLL().GetList(ProjectId, DrawingID, null);
|
||||
var LatestSyn = synRecord.OrderByDescending(x => x.CreateTime).FirstOrDefault();
|
||||
if (LatestSyn != null)
|
||||
{
|
||||
@ -111,9 +111,8 @@ namespace Learun.Application.Web.AppApi
|
||||
public IHttpActionResult GetCheckInLogNeedApprove(string projectId)
|
||||
{
|
||||
try
|
||||
{
|
||||
string queryJson = "{\"IsProcess\":\"" + "1" + "\",\"ProjectId\":\"" + projectId + "\"}";
|
||||
var listDrawingSyn = new ec_drawing_synBLL().GetList(queryJson);
|
||||
{
|
||||
var listDrawingSyn = new ec_drawing_synBLL().GetList(projectId, "", 1);
|
||||
|
||||
return Success(listDrawingSyn.GroupBy(x => x.DrawingFileID).ToList());
|
||||
}
|
||||
|
@ -1,16 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Http;
|
||||
using System.Web.Http.Description;
|
||||
using Learun.Application.Base.SystemModule;
|
||||
using Learun.Application.Base.SystemModule;
|
||||
using Learun.Application.TwoDevelopment.ZZDT_EC;
|
||||
using Learun.Util;
|
||||
using Learun.Util.SqlSugar;
|
||||
using log4net.Config;
|
||||
using Newtonsoft.Json;
|
||||
using NPOI.POIFS.Properties;
|
||||
using Pipelines.Sockets.Unofficial.Arenas;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Http;
|
||||
using System.Web.Http.Description;
|
||||
|
||||
namespace Learun.Application.Web.AppApi
|
||||
{
|
||||
@ -47,6 +48,10 @@ namespace Learun.Application.Web.AppApi
|
||||
{
|
||||
var res = ec_CircuitBreakerBLL.GetBreakersUnderPDB(projId, PDBId);
|
||||
res2.Breakers = res;
|
||||
var settings = new JsonSerializerSettings
|
||||
{
|
||||
ReferenceLoopHandling = ReferenceLoopHandling.Ignore
|
||||
};
|
||||
return Success(res2);
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,10 @@ namespace Learun.Application.Web
|
||||
{
|
||||
static Log _logger = LogFactory.GetLogger("Info");
|
||||
private const string Key = "__action_duration__";
|
||||
/// <summary>
|
||||
/// 开始执行某个接口
|
||||
/// </summary>
|
||||
/// <param name="actionContext"></param>
|
||||
public override void OnActionExecuting(HttpActionContext actionContext)
|
||||
{
|
||||
var controllerName = actionContext.ControllerContext.ControllerDescriptor.ControllerName;
|
||||
@ -60,6 +64,10 @@ namespace Learun.Application.Web
|
||||
stopWatch.Start();
|
||||
base.OnActionExecuting(actionContext);
|
||||
}
|
||||
/// <summary>
|
||||
/// 某个接口执行完成
|
||||
/// </summary>
|
||||
/// <param name="actionExecutedContext"></param>
|
||||
public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext)
|
||||
{
|
||||
base.OnActionExecuted(actionExecutedContext);
|
||||
|
@ -2,6 +2,7 @@
|
||||
using Learun.Loger;
|
||||
using Learun.Util;
|
||||
using Learun.Util.Operat;
|
||||
using Newtonsoft.Json;
|
||||
using System.Web.Http;
|
||||
using System.Web.Http.Results;
|
||||
using System.Web.Mvc;
|
||||
@ -29,7 +30,10 @@ namespace Learun.Application.Web
|
||||
/// <returns></returns>
|
||||
protected new JsonResult<T> Json<T>(T content)
|
||||
{
|
||||
return Json<T>(content, GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings, System.Text.Encoding.UTF8);
|
||||
var SET = GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings;
|
||||
SET.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;//25 09 03,getbreaker,避免循环引用 remoteCB
|
||||
|
||||
return Json<T>(content, SET, System.Text.Encoding.UTF8);
|
||||
}
|
||||
|
||||
#region 日志操作
|
||||
|
@ -1,5 +1,8 @@
|
||||
using Learun.Application.TwoDevelopment.ZZDT_EC;
|
||||
using Learun.Util;
|
||||
using Learun.Util.Json;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Data;
|
||||
using System.Web.Mvc;
|
||||
|
||||
@ -25,7 +28,7 @@ namespace Learun.Application.Web.Areas.ZZDT_EC.Controllers
|
||||
[HttpGet]
|
||||
public ActionResult Index()
|
||||
{
|
||||
return View();
|
||||
return View();
|
||||
}
|
||||
/// <summary>
|
||||
/// 表单页
|
||||
@ -34,7 +37,7 @@ namespace Learun.Application.Web.Areas.ZZDT_EC.Controllers
|
||||
[HttpGet]
|
||||
public ActionResult Form()
|
||||
{
|
||||
return View();
|
||||
return View();
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -48,29 +51,17 @@ namespace Learun.Application.Web.Areas.ZZDT_EC.Controllers
|
||||
[AjaxOnly]
|
||||
public ActionResult GetList(string queryJson)
|
||||
{
|
||||
var data = ec_drawing_publishIBLL.GetList(queryJson);
|
||||
dynamic info = JsonHelper.Str2Dynamic(queryJson);
|
||||
|
||||
// 按键取值(注意:动态对象无编译时检查,属性名写错会运行报错)
|
||||
string drawingFileId = info.DrawingFileID;
|
||||
string projectId = info.ProjectId;
|
||||
|
||||
|
||||
var data = ec_drawing_publishIBLL.GetList(projectId, drawingFileId);
|
||||
return Success(data);
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取列表分页数据
|
||||
/// <param name="pagination">分页参数</param>
|
||||
/// <summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[AjaxOnly]
|
||||
public ActionResult GetPageList(string pagination, string queryJson)
|
||||
{
|
||||
Pagination paginationobj = pagination.ToObject<Pagination>();
|
||||
var data = ec_drawing_publishIBLL.GetList(queryJson, paginationobj);
|
||||
var jsonData = new
|
||||
{
|
||||
rows = data,
|
||||
total = paginationobj.total,
|
||||
page = paginationobj.page,
|
||||
records = paginationobj.records
|
||||
};
|
||||
return Success(jsonData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取表单数据
|
||||
/// <param name="keyValue">主键</param>
|
||||
@ -111,7 +102,7 @@ namespace Learun.Application.Web.Areas.ZZDT_EC.Controllers
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
[AjaxOnly]
|
||||
public ActionResult SaveForm(string keyValue,string strEntity, string ProjectId)
|
||||
public ActionResult SaveForm(string keyValue, string strEntity, string ProjectId)
|
||||
{
|
||||
ec_drawing_publishEntity entity = strEntity.ToObject<ec_drawing_publishEntity>();
|
||||
ec_drawing_publishIBLL.SaveEntity(keyValue, entity, ProjectId);
|
||||
|
@ -1,5 +1,8 @@
|
||||
using Learun.Application.TwoDevelopment.ZZDT_EC;
|
||||
using Learun.Util;
|
||||
using Learun.Util.Json;
|
||||
using Microsoft.AspNet.SignalR.Json;
|
||||
using Newtonsoft.Json;
|
||||
using System.Data;
|
||||
using System.Web.Mvc;
|
||||
|
||||
@ -25,7 +28,7 @@ namespace Learun.Application.Web.Areas.ZZDT_EC.Controllers
|
||||
[HttpGet]
|
||||
public ActionResult Index()
|
||||
{
|
||||
return View();
|
||||
return View();
|
||||
}
|
||||
/// <summary>
|
||||
/// 表单页
|
||||
@ -34,7 +37,7 @@ namespace Learun.Application.Web.Areas.ZZDT_EC.Controllers
|
||||
[HttpGet]
|
||||
public ActionResult Form()
|
||||
{
|
||||
return View();
|
||||
return View();
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -48,29 +51,16 @@ namespace Learun.Application.Web.Areas.ZZDT_EC.Controllers
|
||||
[AjaxOnly]
|
||||
public ActionResult GetList(string queryJson)
|
||||
{
|
||||
var data = ec_drawing_synIBLL.GetList(queryJson);
|
||||
// 反序列化为动态对象(dynamic)
|
||||
dynamic info = JsonHelper.Str2Dynamic(queryJson);
|
||||
|
||||
// 按键取值(注意:动态对象无编译时检查,属性名写错会运行报错)
|
||||
string drawingFileId = info.DrawingFileID;
|
||||
string projectId = info.ProjectId;
|
||||
var data = ec_drawing_synIBLL.GetList(projectId, drawingFileId, null);
|
||||
return Success(data);
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取列表分页数据
|
||||
/// <param name="pagination">分页参数</param>
|
||||
/// <summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[AjaxOnly]
|
||||
public ActionResult GetPageList(string pagination, string queryJson)
|
||||
{
|
||||
Pagination paginationobj = pagination.ToObject<Pagination>();
|
||||
var data = ec_drawing_synIBLL.GetList(queryJson, paginationobj);
|
||||
var jsonData = new
|
||||
{
|
||||
rows = data,
|
||||
total = paginationobj.total,
|
||||
page = paginationobj.page,
|
||||
records = paginationobj.records
|
||||
};
|
||||
return Success(jsonData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取表单数据
|
||||
/// <param name="keyValue">主键</param>
|
||||
@ -111,7 +101,7 @@ namespace Learun.Application.Web.Areas.ZZDT_EC.Controllers
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
[AjaxOnly]
|
||||
public ActionResult SaveForm(string keyValue,string strEntity, string ProjectId)
|
||||
public ActionResult SaveForm(string keyValue, string strEntity, string ProjectId)
|
||||
{
|
||||
ec_drawing_synEntity entity = strEntity.ToObject<ec_drawing_synEntity>();
|
||||
ec_drawing_synIBLL.SaveEntity(keyValue, entity, ProjectId);
|
||||
|
@ -1,5 +1,6 @@
|
||||
using Learun.Application.TwoDevelopment.ZZDT_EC;
|
||||
using Learun.Util;
|
||||
using Learun.Util.Json;
|
||||
using System.Data;
|
||||
using System.Web.Mvc;
|
||||
|
||||
@ -25,7 +26,7 @@ namespace Learun.Application.Web.Areas.ZZDT_EC.Controllers
|
||||
[HttpGet]
|
||||
public ActionResult Index()
|
||||
{
|
||||
return View();
|
||||
return View();
|
||||
}
|
||||
/// <summary>
|
||||
/// 表单页
|
||||
@ -34,7 +35,7 @@ namespace Learun.Application.Web.Areas.ZZDT_EC.Controllers
|
||||
[HttpGet]
|
||||
public ActionResult Form()
|
||||
{
|
||||
return View();
|
||||
return View();
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -48,29 +49,12 @@ namespace Learun.Application.Web.Areas.ZZDT_EC.Controllers
|
||||
[AjaxOnly]
|
||||
public ActionResult GetList(string queryJson)
|
||||
{
|
||||
var data = ec_operate_logIBLL.GetList(queryJson);
|
||||
var info = JsonHelper.Str2JObject(queryJson);
|
||||
var projId = info["ProjectId"].ToString();
|
||||
var OwnerId = info["OwnerID"].ToString();
|
||||
var data = ec_operate_logIBLL.GetList(projId, OwnerId);
|
||||
return Success(data);
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取列表分页数据
|
||||
/// <param name="pagination">分页参数</param>
|
||||
/// <summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[AjaxOnly]
|
||||
public ActionResult GetPageList(string pagination, string queryJson)
|
||||
{
|
||||
Pagination paginationobj = pagination.ToObject<Pagination>();
|
||||
var data = ec_operate_logIBLL.GetList(queryJson, paginationobj);
|
||||
var jsonData = new
|
||||
{
|
||||
rows = data,
|
||||
total = paginationobj.total,
|
||||
page = paginationobj.page,
|
||||
records = paginationobj.records
|
||||
};
|
||||
return Success(jsonData);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取表单数据
|
||||
/// <param name="keyValue">主键</param>
|
||||
@ -111,7 +95,7 @@ namespace Learun.Application.Web.Areas.ZZDT_EC.Controllers
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
[AjaxOnly]
|
||||
public ActionResult SaveForm(string keyValue,string strEntity, string ProjectId)
|
||||
public ActionResult SaveForm(string keyValue, string strEntity, string ProjectId)
|
||||
{
|
||||
ec_operate_logEntity entity = strEntity.ToObject<ec_operate_logEntity>();
|
||||
ec_operate_logIBLL.SaveEntity(keyValue, entity, ProjectId);
|
||||
|
@ -30,6 +30,8 @@ namespace Learun.Application.Web
|
||||
GlobalConfiguration.Configure(WebApiConfig.Register);
|
||||
RouteConfig.RegisterRoutes(RouteTable.Routes);
|
||||
|
||||
|
||||
|
||||
////一天执行一次备份
|
||||
Timer timer = new Timer(86400000);
|
||||
//timer.Elapsed += Timer_Elapsed;
|
||||
|
@ -15,7 +15,7 @@
|
||||
<!--错误 Error.log。type为:以回滚文件的形式记录日志-->
|
||||
<appender name="ErrorLog" type="log4net.Appender.RollingFileAppender">
|
||||
<!--目录路径,可以是相对路径或绝对路径-->
|
||||
<param name="File" value="C:\learun_log"/>
|
||||
<param name="File" value="C:\new-learun-log"/>
|
||||
<!--文件名,按日期生成文件夹-->
|
||||
<param name="DatePattern" value="/yyyy-MM-dd/"Error.log""/>
|
||||
<!--追加到文件-->
|
||||
@ -42,7 +42,7 @@
|
||||
<!--警告 Warn.log-->
|
||||
<appender name="WarnLog" type="log4net.Appender.RollingFileAppender">
|
||||
<!--目录路径,可以是相对路径或绝对路径-->
|
||||
<param name="File" value="C:\learun_log"/>
|
||||
<param name="File" value="C:\new-learun-log"/>
|
||||
<!--文件名,按日期生成文件夹-->
|
||||
<param name="DatePattern" value="/yyyy-MM-dd/"Warn.log""/>
|
||||
<!--追加到文件-->
|
||||
@ -68,7 +68,7 @@
|
||||
<!--信息 Info.log-->
|
||||
<appender name="InfoLog" type="log4net.Appender.RollingFileAppender">
|
||||
<!--目录路径,可以是相对路径或绝对路径-->
|
||||
<param name="File" value="C:\learun_log"/>
|
||||
<param name="File" value="C:\new-learun-log"/>
|
||||
<!--文件名,按日期生成文件夹-->
|
||||
<param name="DatePattern" value="/yyyy-MM-dd/"Info.log""/>
|
||||
<!--追加到文件-->
|
||||
@ -94,7 +94,7 @@
|
||||
<!--调试 Debug.log-->
|
||||
<appender name="DebugLog" type="log4net.Appender.RollingFileAppender">
|
||||
<!--目录路径,可以是相对路径或绝对路径-->
|
||||
<param name="File" value="C:\learun_log"/>
|
||||
<param name="File" value="C:\new-learun-log"/>
|
||||
<!--文件名,按日期生成文件夹-->
|
||||
<param name="DatePattern" value="/yyyy-MM-dd/"Debug.log""/>
|
||||
<!--追加到文件-->
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,158 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<log4net>
|
||||
<!--根配置-->
|
||||
<root>
|
||||
<!--日志级别:可选值: ERROR > WARN > INFO > DEBUG-->
|
||||
<level value="ERROR"/>
|
||||
<level value="WARN"/>
|
||||
<level value="INFO"/>
|
||||
<level value="DEBUG"/>
|
||||
<appender-ref ref="ErrorLog" />
|
||||
<appender-ref ref="WarnLog" />
|
||||
<appender-ref ref="InfoLog" />
|
||||
<appender-ref ref="DebugLog" />
|
||||
</root>
|
||||
<!--错误 Error.log。type为:以回滚文件的形式记录日志-->
|
||||
<appender name="ErrorLog" type="log4net.Appender.RollingFileAppender">
|
||||
<!--目录路径,可以是相对路径或绝对路径-->
|
||||
<param name="File" value="C:\learun_log"/>
|
||||
<!--文件名,按日期生成文件夹-->
|
||||
<param name="DatePattern" value="/yyyy-MM-dd/"Error.log""/>
|
||||
<!--追加到文件-->
|
||||
<appendToFile value="true"/>
|
||||
<!--创建日志文件的方式,可选值:Date[日期],文件大小[Size],混合[Composite]-->
|
||||
<rollingStyle value="Composite"/>
|
||||
<!--写到一个文件-->
|
||||
<staticLogFileName value="false"/>
|
||||
<!--单个文件大小。单位:KB|MB|GB-->
|
||||
<maximumFileSize value="200MB"/>
|
||||
<!--最多保留的文件数,设为"-1"则不限-->
|
||||
<maxSizeRollBackups value="-1"/>
|
||||
<!--日志格式-->
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<conversionPattern value="%datetime, %message"/>
|
||||
</layout>
|
||||
<!--日志等级在指定范围内的事件才被记录-->
|
||||
<filter type="log4net.Filter.LevelRangeFilter">
|
||||
<param name="LevelMin" value="ERROR" />
|
||||
<param name="LevelMax" value="ERROR" />
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!--警告 Warn.log-->
|
||||
<appender name="WarnLog" type="log4net.Appender.RollingFileAppender">
|
||||
<!--目录路径,可以是相对路径或绝对路径-->
|
||||
<param name="File" value="C:\learun_log"/>
|
||||
<!--文件名,按日期生成文件夹-->
|
||||
<param name="DatePattern" value="/yyyy-MM-dd/"Warn.log""/>
|
||||
<!--追加到文件-->
|
||||
<appendToFile value="true"/>
|
||||
<!--创建日志文件的方式,可选值:Date[日期],文件大小[Size],混合[Composite]-->
|
||||
<rollingStyle value="Composite"/>
|
||||
<!--写到一个文件-->
|
||||
<staticLogFileName value="false"/>
|
||||
<!--单个文件大小。单位:KB|MB|GB-->
|
||||
<maximumFileSize value="200MB"/>
|
||||
<!--最多保留的文件数,设为"-1"则不限-->
|
||||
<maxSizeRollBackups value="-1"/>
|
||||
<!--日志格式-->
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<conversionPattern value="%message"/>
|
||||
</layout>
|
||||
<filter type="log4net.Filter.LevelRangeFilter">
|
||||
<param name="LevelMin" value="WARN" />
|
||||
<param name="LevelMax" value="WARN" />
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!--信息 Info.log-->
|
||||
<appender name="InfoLog" type="log4net.Appender.RollingFileAppender">
|
||||
<!--目录路径,可以是相对路径或绝对路径-->
|
||||
<param name="File" value="C:\learun_log"/>
|
||||
<!--文件名,按日期生成文件夹-->
|
||||
<param name="DatePattern" value="/yyyy-MM-dd/"Info.log""/>
|
||||
<!--追加到文件-->
|
||||
<appendToFile value="true"/>
|
||||
<!--创建日志文件的方式,可选值:Date[日期],文件大小[Size],混合[Composite]-->
|
||||
<rollingStyle value="Composite"/>
|
||||
<!--写到一个文件-->
|
||||
<staticLogFileName value="false"/>
|
||||
<!--单个文件大小。单位:KB|MB|GB-->
|
||||
<maximumFileSize value="200MB"/>
|
||||
<!--最多保留的文件数,设为"-1"则不限-->
|
||||
<maxSizeRollBackups value="-1"/>
|
||||
<!--日志格式-->
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<conversionPattern value="%message"/>
|
||||
</layout>
|
||||
<filter type="log4net.Filter.LevelRangeFilter">
|
||||
<param name="LevelMin" value="INFO" />
|
||||
<param name="LevelMax" value="INFO" />
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!--调试 Debug.log-->
|
||||
<appender name="DebugLog" type="log4net.Appender.RollingFileAppender">
|
||||
<!--目录路径,可以是相对路径或绝对路径-->
|
||||
<param name="File" value="C:\learun_log"/>
|
||||
<!--文件名,按日期生成文件夹-->
|
||||
<param name="DatePattern" value="/yyyy-MM-dd/"Debug.log""/>
|
||||
<!--追加到文件-->
|
||||
<appendToFile value="true"/>
|
||||
<!--创建日志文件的方式,可选值:Date[日期],文件大小[Size],混合[Composite]-->
|
||||
<rollingStyle value="Composite"/>
|
||||
<!--写到一个文件-->
|
||||
<staticLogFileName value="false"/>
|
||||
<!--单个文件大小。单位:KB|MB|GB-->
|
||||
<maximumFileSize value="200MB"/>
|
||||
<!--最多保留的文件数,设为"-1"则不限-->
|
||||
<maxSizeRollBackups value="-1"/>
|
||||
<!--日志格式-->
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<conversionPattern value="%message"/>
|
||||
</layout>
|
||||
<filter type="log4net.Filter.LevelRangeFilter">
|
||||
<param name="LevelMin" value="DEBUG" />
|
||||
<param name="LevelMax" value="DEBUG" />
|
||||
</filter>
|
||||
</appender>
|
||||
<!--yxh 2022 09 14 Logger是直接和应用程序交互的组件-->
|
||||
<!--<logger name="Test">
|
||||
<level value="ALL"/>
|
||||
<appender-ref ref="ErrorLog"/>
|
||||
</logger>-->
|
||||
</log4net>
|
||||
|
||||
|
||||
<!--<log4net>
|
||||
--><!-- 控制台日志配置 --><!--
|
||||
<appender name="Console" type="log4net.Appender.ConsoleAppender">
|
||||
--><!-- 日志输出格式 --><!--
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<conversionPattern value="%5level [%thread] (%file:%line) - %message%newline" />
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
--><!-- 文件存储日志配置 --><!--
|
||||
<appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
|
||||
--><!-- 保存文件的名称 --><!--
|
||||
<file value="D:\log.log" />
|
||||
<appendToFile value="true" />
|
||||
--><!-- 文件的编码方式 --><!--
|
||||
<param name="Encoding" value="UTF-8"/>
|
||||
--><!-- 每个文件的大小 --><!--
|
||||
<maximumFileSize value="100KB" />
|
||||
--><!-- 保存文件数量 --><!--
|
||||
<maxSizeRollBackups value="2" />
|
||||
--><!-- 日志输出格式 --><!--
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<conversionPattern value="%level %thread %logger - %message%newline" />
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<root>
|
||||
<level value="ALL" />
|
||||
<appender-ref ref="Console" />
|
||||
<appender-ref ref="RollingFile" />
|
||||
</root>
|
||||
</log4net>-->
|
@ -100,6 +100,12 @@ var bootstrap = function ($, learun) {
|
||||
return cellvalue == 1 ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "是否同时显示英文", name: "ShowEN", width: 50, align: "center",
|
||||
formatter: function (cellvalue) {
|
||||
return cellvalue == 1 ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "是否允许编辑", name: "IsAllowEdit", width: 90, align: "center", ishide: ProjectId ? true : false,
|
||||
formatter: function (cellvalue) {
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -82,9 +82,9 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
if (property != null && property.CanWrite)
|
||||
{
|
||||
property.SetValue(CB, Convert.ChangeType(item.PropertyValue, property.PropertyType));
|
||||
}
|
||||
} //属性要怎么来,从property来了,然后通过反射,填充到 cb 类的属性里
|
||||
}
|
||||
//属性要怎么来,从property来了
|
||||
|
||||
|
||||
|
||||
//所有在一端是开关的关联关系
|
||||
|
@ -22,16 +22,13 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
#region 获取数据
|
||||
|
||||
/// <summary>
|
||||
/// 获取列表数据
|
||||
/// 图纸的发布记录
|
||||
/// <summary>
|
||||
/// <returns></returns>
|
||||
public IEnumerable<ec_drawing_publishEntity> GetList(string queryJson, Pagination pagination = null)
|
||||
public IEnumerable<ec_drawing_publishEntity> GetList(string ProjectId,string DrawingFileID, Pagination pagination = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
var queryParam = queryJson.ToJObject();
|
||||
var ProjectId = queryParam["ProjectId"]?.ToString();
|
||||
var DrawingFileID = queryParam["DrawingFileID"]?.ToString();
|
||||
{
|
||||
|
||||
var tableName = TableName<ec_drawing_publishEntity>(ProjectId);
|
||||
var query = Db.Queryable<ec_drawing_publishEntity>().AS(tableName)
|
||||
|
@ -19,7 +19,7 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
/// 获取列表数据
|
||||
/// <summary>
|
||||
/// <returns></returns>
|
||||
IEnumerable<ec_drawing_publishEntity> GetList(string queryJson, Pagination pagination = null);
|
||||
IEnumerable<ec_drawing_publishEntity> GetList(string ProjectId, string DrawingFileID, Pagination pagination = null);
|
||||
/// <summary>
|
||||
/// 获取实体数据
|
||||
/// <param name="keyValue">主键</param>
|
||||
|
@ -20,24 +20,24 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
private ec_drawing_synService ec_drawing_synService = new ec_drawing_synService();
|
||||
|
||||
#region 获取数据
|
||||
|
||||
/// <summary>
|
||||
/// 获取列表数据
|
||||
/// <summary>
|
||||
/// 获取单个图纸的检入记录
|
||||
/// </summary>
|
||||
/// <param name="ProjectId"></param>
|
||||
/// <param name="DrawingFileID"></param>
|
||||
/// <param name="IsProcess">是否影响生产设计。1代表影响,然后需要生产主管去确认</param>
|
||||
/// <param name="pagination"></param>
|
||||
/// <returns></returns>
|
||||
public IEnumerable<ec_drawing_synEntity> GetList(string queryJson, Pagination pagination = null)
|
||||
public IEnumerable<ec_drawing_synEntity> GetList(string ProjectId, string DrawingFileID, int? IsProcess,
|
||||
Pagination pagination = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
var queryParam = queryJson.ToJObject();
|
||||
var ProjectId = queryParam["ProjectId"]?.ToString();
|
||||
var DrawingFileID = queryParam["DrawingFileID"]?.ToString();
|
||||
var NeedApprove = queryParam["IsProcess"]?.ToString();
|
||||
|
||||
var tableName = TableName<ec_drawing_synEntity>(ProjectId);
|
||||
var query = Db.Queryable<ec_drawing_synEntity>().AS(tableName)
|
||||
.WhereIF(!string.IsNullOrEmpty(DrawingFileID), x => x.DrawingFileID == DrawingFileID)
|
||||
.WhereIF(!string.IsNullOrEmpty(NeedApprove), x => x.IsProcess == 1)
|
||||
.WhereIF(IsProcess != null, x => x.IsProcess == 1)
|
||||
.OrderByDescending(x => x.CreateTime);
|
||||
List<ec_drawing_synEntity> list;
|
||||
if (pagination == null)
|
||||
|
@ -18,7 +18,7 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
/// 获取列表数据
|
||||
/// <summary>
|
||||
/// <returns></returns>
|
||||
IEnumerable<ec_drawing_synEntity> GetList(string queryJson, Pagination pagination = null);
|
||||
IEnumerable<ec_drawing_synEntity> GetList(string ProjectId, string DrawingFileID, int? IsProcess, Pagination pagination = null);
|
||||
/// <summary>
|
||||
/// 获取实体数据
|
||||
/// <param name="keyValue">主键</param>
|
||||
|
@ -25,13 +25,10 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
/// 获取列表数据
|
||||
/// <summary>
|
||||
/// <returns></returns>
|
||||
public IEnumerable<ec_operate_logEntity> GetList(string queryJson, Pagination pagination = null)
|
||||
public IEnumerable<ec_operate_logEntity> GetList(string ProjectId, string OwnerID, Pagination pagination = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
var queryParam = queryJson.ToJObject();
|
||||
var ProjectId = queryParam["ProjectId"]?.ToString();
|
||||
var OwnerID = queryParam["OwnerID"]?.ToString();
|
||||
{
|
||||
|
||||
var tableName = TableName<ec_operate_logEntity>(ProjectId);
|
||||
var query = Db.Queryable<ec_operate_logEntity>().AS(tableName)
|
||||
|
@ -18,7 +18,7 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
/// 获取列表数据
|
||||
/// <summary>
|
||||
/// <returns></returns>
|
||||
IEnumerable<ec_operate_logEntity> GetList(string queryJson, Pagination pagination = null);
|
||||
IEnumerable<ec_operate_logEntity> GetList(string ProjectId, string OwnerID, Pagination pagination = null);
|
||||
/// <summary>
|
||||
/// 获取实体数据
|
||||
/// <param name="keyValue">主键</param>
|
||||
|
@ -273,7 +273,7 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
//创建操作日志表
|
||||
baseDAL.Create<ec_operate_logEntity>(sqlitePath);
|
||||
//添加操作日志表数据
|
||||
baseDAL.Add(new ec_operate_logBLL().GetList(queryJson).ToList(), sqlitePath);
|
||||
baseDAL.Add(new ec_operate_logBLL().GetList(ProjectId, "").ToList(), sqlitePath);
|
||||
continue;
|
||||
}
|
||||
if (table == "ec_drawing_publish")
|
||||
@ -281,7 +281,7 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
//创建图纸发布表
|
||||
baseDAL.Create<ec_drawing_publishEntity>(sqlitePath);
|
||||
//添加图纸发布表数据
|
||||
baseDAL.Add(new ec_drawing_publishBLL().GetList(queryJson).ToList(), sqlitePath);
|
||||
baseDAL.Add(new ec_drawing_publishBLL().GetList(ProjectId, "").ToList(), sqlitePath);
|
||||
continue;
|
||||
}
|
||||
if (table == "ec_drawing_syn")
|
||||
@ -289,7 +289,7 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
//创建图纸同步表
|
||||
baseDAL.Create<ec_drawing_synEntity>(sqlitePath);
|
||||
//添加图纸同步表数据
|
||||
baseDAL.Add(new ec_drawing_synBLL().GetList(queryJson).ToList(), sqlitePath);
|
||||
baseDAL.Add(new ec_drawing_synBLL().GetList(ProjectId, "", null).ToList(), sqlitePath);
|
||||
continue;
|
||||
}
|
||||
if (table == "ec_drawing_file")
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,38 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Data;
|
||||
using System.Data.SQLite;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
namespace Learun.Util.Json
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class JsonHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// 字符串转为动态对象。然后直接用点操作符取值。如 res.DrawingFileID;
|
||||
/// </summary>
|
||||
/// <param name="queryJson"></param>
|
||||
/// <returns></returns>
|
||||
public static dynamic Str2Dynamic(string queryJson)
|
||||
{
|
||||
return JsonConvert.DeserializeObject<dynamic>(queryJson);
|
||||
}
|
||||
/// <summary>
|
||||
/// 字符串转为JObject对象。然后用["DrawingFileID"]取值。
|
||||
/// </summary>
|
||||
/// <param name="queryJson"></param>
|
||||
/// <returns></returns>
|
||||
public static JObject Str2JObject(string queryJson)
|
||||
{
|
||||
return JObject.Parse(queryJson);
|
||||
}
|
||||
}
|
||||
}
|
@ -139,6 +139,7 @@
|
||||
<Compile Include="DataBase\FieldValueParam.cs" />
|
||||
<Compile Include="DataBase\DbWhere.cs" />
|
||||
<Compile Include="Extensions\DataTableExtensions.cs" />
|
||||
<Compile Include="Json\JsonHelper.cs" />
|
||||
<Compile Include="Mail\Model\MailAccount .cs" />
|
||||
<Compile Include="Mail\Model\MailFile.cs" />
|
||||
<Compile Include="Mail\Model\MailModel.cs" />
|
||||
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -528,11 +528,15 @@ WHERE
|
||||
var subsql = sql.Split(';');
|
||||
#region 处理
|
||||
// 正则表达式
|
||||
string pattern = @"(?<=ALTER\s+TABLE\s+`)[^`]+";
|
||||
string pattern2 = @"(?<=CREATE\s+TABLE\s+`)[^`]+";
|
||||
string pattern = @"(?i)\balter\s+table\s+[`']?([a-zA-Z0-9_]+)[`']?";
|
||||
string pattern2 = @"(?i)\bcreate\s+table\s+[`']?([a-zA-Z0-9_]+)[`']?";
|
||||
int patternType;//1是create,0是update
|
||||
foreach (var sqlstr in subsql)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(sqlstr))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// 匹配表名
|
||||
Match match = Regex.Match(sqlstr, pattern);
|
||||
if (string.IsNullOrEmpty(sqlstr))
|
||||
@ -550,7 +554,7 @@ WHERE
|
||||
if (match.Length == 0 )
|
||||
{
|
||||
//无效的sql
|
||||
LogInfo(baseDirectory + logFileName, $"无法从{SQLFILENAME}.sql文件中解析出正确的create table 或 update table。确保只有一条sql。");
|
||||
LogInfo(baseDirectory + logFileName, $"无法从{SQLFILENAME}文件中解析出正确的create table 或 update table。确保是有效的sql。文本为 {sqlstr}");
|
||||
continue;
|
||||
}
|
||||
var groupMatch = Regex.Matches(sqlstr, pattern);
|
||||
|
@ -20,7 +20,7 @@
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<OutputPath>..\..\..\..\IIS\SWS\UpgradeTool\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -7,7 +7,7 @@
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="/DI-Electrical;component/Style/CustomStyles.xaml" />
|
||||
<ResourceDictionary Source="/SWS.WPF;component/Style/CustomStyles.xaml" />
|
||||
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
using System.Windows;
|
||||
using DI_Electrical.Helper;
|
||||
using DI_Electrical.Services;
|
||||
using DI_Electrical.ViewModels;
|
||||
using DI_Electrical.Views;
|
||||
using DI_Electrical.Views.Dialog;
|
||||
using DI_Electrical.Views.Dialog.DialogSignalManagements;
|
||||
using Prism.Events;
|
||||
using Prism.Ioc;
|
||||
using Prism.Services.Dialogs;
|
||||
using Prism.Unity;
|
||||
using SWS.Commons;
|
||||
using SWS.Service;
|
||||
using SWS.WPF.ViewModels;
|
||||
using SWS.WPF.Views;
|
||||
using Unity;
|
||||
|
||||
namespace DI_Electrical
|
||||
@ -16,23 +16,23 @@ namespace DI_Electrical
|
||||
/// <summary>
|
||||
/// App.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class App : PrismApplication
|
||||
public partial class App : Prism.Unity.PrismApplication
|
||||
{
|
||||
protected override Window CreateShell()
|
||||
{
|
||||
return Container.Resolve<MainWindow>();
|
||||
return GlobalObject._prismContainer.Resolve<MainWindow>();
|
||||
}
|
||||
|
||||
protected override void InitializeShell(Window shell)
|
||||
{
|
||||
var login = Container.Resolve<Login>();
|
||||
var login = GlobalObject._prismContainer.Resolve<Login>();
|
||||
login.ShowDialog();
|
||||
if (GlobalObject.userInfo == null)
|
||||
{
|
||||
Application.Current?.Shutdown();
|
||||
return;
|
||||
}
|
||||
var project = Container.Resolve<Project>();
|
||||
var project = GlobalObject._prismContainer.Resolve<Views.Project>();
|
||||
project.ShowDialog();
|
||||
if (GlobalObject.curProject == null)
|
||||
{
|
||||
@ -45,26 +45,32 @@ namespace DI_Electrical
|
||||
|
||||
protected override void RegisterTypes(IContainerRegistry containerRegistry)
|
||||
{
|
||||
containerRegistry.RegisterForNavigation<MainWindow, MainWindowViewModel>();
|
||||
containerRegistry.RegisterForNavigation<Login, LoginViewModel>();
|
||||
containerRegistry.RegisterForNavigation<Config, ConfigViewModel>();
|
||||
containerRegistry.RegisterForNavigation<Project, ProjectViewModel>();
|
||||
containerRegistry.RegisterDialog<DialogTest, DialogTestViewModel>();
|
||||
containerRegistry.RegisterDialog<DialogSignalManagement, DialogSignalManagementViewModel>();
|
||||
containerRegistry.RegisterDialog<DialogSignalNotice, DialogSignalNoticeViewModel>();
|
||||
containerRegistry.RegisterDialog<DialogSignalPropertyhisAndLogs, DialogSignalPropertyhisAndLogsViewModel>();
|
||||
containerRegistry.RegisterDialog<DialogSignalSelect, DialogSignalSelectViewModel>();
|
||||
containerRegistry.RegisterDialog<DialogInput, DialogInputViewModel>();
|
||||
//GlobalObject._prismContainer = new DryIocContainerExtension();
|
||||
GlobalObject._prismContainer = (IContainerExtension)containerRegistry;
|
||||
|
||||
containerRegistry.Register<IDialogService, DialogService>();
|
||||
GlobalObject._prismContainer.RegisterForNavigation<MainWindow, MainWindowViewModel>();
|
||||
GlobalObject._prismContainer.RegisterForNavigation<Login, LoginViewModel>();
|
||||
GlobalObject._prismContainer.RegisterForNavigation<Config, ConfigViewModel>();
|
||||
GlobalObject._prismContainer.RegisterForNavigation<Views.Project, ViewModels.ProjectViewModel>();
|
||||
GlobalObject._prismContainer.RegisterDialog<DialogTest, DialogTestViewModel>();
|
||||
GlobalObject._prismContainer.RegisterDialog<DialogSignalManagement, DialogSignalManagementViewModel>();
|
||||
GlobalObject._prismContainer.RegisterDialog<DialogSignalNotice, DialogSignalNoticeViewModel>();
|
||||
GlobalObject._prismContainer.RegisterDialog<DialogSignalPropertyhisAndLogs, DialogSignalPropertyhisAndLogsViewModel>();
|
||||
GlobalObject._prismContainer.RegisterDialog<DialogSignalSelect, DialogSignalSelectViewModel>();
|
||||
GlobalObject._prismContainer.RegisterDialog<DialogAllOutputSignal, DialogAllOutputSignalViewModel>();
|
||||
GlobalObject._prismContainer.RegisterDialog<DialogInput, DialogInputViewModel>();
|
||||
|
||||
containerRegistry.RegisterSingleton<IEventAggregator, EventAggregator>();
|
||||
containerRegistry.RegisterSingleton<HttpService>();
|
||||
containerRegistry.RegisterSingleton<ConfigService>();
|
||||
containerRegistry.RegisterSingleton<LoginService>();
|
||||
containerRegistry.RegisterSingleton<UserService>();
|
||||
containerRegistry.RegisterSingleton<DataItemService>();
|
||||
containerRegistry.RegisterSingleton<WireGroupService>();
|
||||
GlobalObject._prismContainer.Register<IDialogService, DialogService>();
|
||||
|
||||
GlobalObject.container = new UnityContainer();
|
||||
GlobalObject.container.RegisterSingleton<IEventAggregator, EventAggregator>();
|
||||
GlobalObject.container.RegisterSingleton<HttpService>();
|
||||
GlobalObject.container.RegisterSingleton<ConfigService>();
|
||||
GlobalObject.container.RegisterSingleton<LoginService>();
|
||||
GlobalObject.container.RegisterSingleton<UserService>();
|
||||
GlobalObject.container.RegisterSingleton<ProjectService>();
|
||||
GlobalObject.container.RegisterSingleton<DataItemService>();
|
||||
GlobalObject.container.RegisterSingleton<WireGroupService>();
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,8 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="DryIoc, Version=5.4.3.0, Culture=neutral, PublicKeyToken=dfbf2bd50fcf7768, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\DryIoc.dll.5.4.3\lib\net45\DryIoc.dll</HintPath>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\DryIoc.dll.4.7.7\lib\net45\DryIoc.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EasyEncryption">
|
||||
<HintPath>..\packages\EasyEncryption.1.0.2\lib\EasyEncryption.dll</HintPath>
|
||||
@ -140,40 +141,9 @@
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Event\loginEvent.cs" />
|
||||
<Compile Include="GlobalObject.cs" />
|
||||
<Compile Include="Helper\ConfigService.cs" />
|
||||
<Compile Include="Helper\Converter\CollectionToStringConverter.cs" />
|
||||
<Compile Include="Helper\Converter\RadGridViewRowToBoolConverter.cs" />
|
||||
<Compile Include="Helper\Converter\StatusToColourConverter.cs" />
|
||||
<Compile Include="Helper\FileHelper.cs" />
|
||||
<Compile Include="Helper\LoggerHelper.cs" />
|
||||
<Compile Include="Model\ec_dataitemdetail.cs" />
|
||||
<Compile Include="Model\ec_project.cs" />
|
||||
<Compile Include="Model\ec_Wire_Group.cs" />
|
||||
<Compile Include="Model\ec_wire_group_log.cs" />
|
||||
<Compile Include="Model\ec_wire_group_notice.cs" />
|
||||
<Compile Include="Model\ec_wire_group_propertyhis.cs" />
|
||||
<Compile Include="Model\NoEntity\ConfigIni.cs" />
|
||||
<Compile Include="Model\NoEntity\learunHttpRes.cs" />
|
||||
<Compile Include="Model\NoEntity\loginRes.cs" />
|
||||
<Compile Include="Model\NoEntity\PageModel.cs" />
|
||||
<Compile Include="Model\user.cs" />
|
||||
<Compile Include="Services\DataItemService.cs" />
|
||||
<Compile Include="Services\HttpService.cs" />
|
||||
<Compile Include="Services\LoginService.cs" />
|
||||
<Compile Include="Services\ProjectService.cs" />
|
||||
<Compile Include="Services\UserService.cs" />
|
||||
<Compile Include="Services\WireGroupService.cs" />
|
||||
<Compile Include="Style\StyleSelectors\ConditionalStyleSelector.cs" />
|
||||
<Compile Include="Style\StyleSelectors\SignalNoticeStyleSelector.cs" />
|
||||
<Compile Include="GlobalObj.cs" />
|
||||
<Compile Include="ViewModels\ConfigViewModel.cs" />
|
||||
<Compile Include="ViewModels\DialogInputViewModel.cs" />
|
||||
<Compile Include="ViewModels\DialogSignalManagementVM\DialogSignalManagementViewModel.cs" />
|
||||
<Compile Include="ViewModels\DialogSignalManagementVM\DialogSignalNoticeViewModel.cs" />
|
||||
<Compile Include="ViewModels\DialogSignalManagementVM\DialogSignalPropertyhisAndLogsViewModel.cs" />
|
||||
<Compile Include="ViewModels\DialogSignalManagementVM\DialogSignalSelectViewModel.cs" />
|
||||
<Compile Include="ViewModels\LoginViewModel.cs" />
|
||||
<Compile Include="ViewModels\DialogTestViewModel.cs" />
|
||||
<Compile Include="ViewModels\myViewModelBase\DialogBase.cs" />
|
||||
<Compile Include="ViewModels\ProjectViewModel.cs" />
|
||||
<Compile Include="Views\Config.xaml.cs">
|
||||
@ -182,7 +152,6 @@
|
||||
<Compile Include="Views\CustomControl\customWindowTitleBar.xaml.cs">
|
||||
<DependentUpon>customWindowTitleBar.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Helper\PasswordHelper.cs" />
|
||||
<Compile Include="ViewModels\MainWindowViewModel.cs" />
|
||||
<Compile Include="Views\CustomControl\IconButton\IconButton.cs" />
|
||||
<Compile Include="Views\CustomControl\MultiSelectSearchComboBox\CollectionToStringConverter.cs" />
|
||||
@ -195,24 +164,6 @@
|
||||
<Compile Include="Views\CustomControl\MultiSelectSearchComboBox\SmallPanel.cs" />
|
||||
<Compile Include="Views\CustomControl\MultiSelectSearchComboBox\WDBorder.cs" />
|
||||
<Compile Include="Views\CustomControl\MultiSelectSearchComboBox\Win32.cs" />
|
||||
<Compile Include="Views\Dialog\DialogInput.xaml.cs">
|
||||
<DependentUpon>DialogInput.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\Dialog\DialogSignalManagements\DialogSignalManagement.xaml.cs">
|
||||
<DependentUpon>DialogSignalManagement.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\Dialog\DialogSignalManagements\DialogSignalNotice.xaml.cs">
|
||||
<DependentUpon>DialogSignalNotice.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\Dialog\DialogSignalManagements\DialogSignalPropertyhisAndLogs.xaml.cs">
|
||||
<DependentUpon>DialogSignalPropertyhisAndLogs.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\Dialog\DialogSignalManagements\DialogSignalSelect.xaml.cs">
|
||||
<DependentUpon>DialogSignalSelect.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\Dialog\DialogTest.xaml.cs">
|
||||
<DependentUpon>DialogTest.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\Login.xaml.cs">
|
||||
<DependentUpon>Login.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@ -253,7 +204,28 @@
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SWS.Commons\SWS.Commons.csproj">
|
||||
<Project>{9ac724f6-883d-4357-9422-602748f25b69}</Project>
|
||||
<Name>SWS.Commons</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\SWS.CustomControl\SWS.CustomControl.csproj">
|
||||
<Project>{2dcf996e-063b-4b95-8530-28f6df0da58a}</Project>
|
||||
<Name>SWS.CustomControl</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\SWS.Model\SWS.Model.csproj">
|
||||
<Project>{1995385b-d1b0-4c55-835e-d3e769972a6a}</Project>
|
||||
<Name>SWS.Model</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\SWS.Service\SWS.Service.csproj">
|
||||
<Project>{51cb6f5b-16e9-4ee0-baa4-144dd1ec8580}</Project>
|
||||
<Name>SWS.Service</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\SWS.WPF\SWS.WPF.csproj">
|
||||
<Project>{7aff9117-78e7-4395-9f23-6dcfe09f9299}</Project>
|
||||
<Name>SWS.WPF</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="Views\Config.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
@ -263,34 +235,6 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Style\CustomStyles.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Views\Dialog\DialogInput.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\Dialog\DialogSignalManagements\DialogSignalManagement.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\Dialog\DialogSignalManagements\DialogSignalNotice.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Views\Dialog\DialogSignalManagements\DialogSignalPropertyhisAndLogs.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Views\Dialog\DialogSignalManagements\DialogSignalSelect.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Views\Dialog\DialogTest.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\Login.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
55
newFront/c#前端/DI-Electrical/GlobalObj.cs
Normal file
55
newFront/c#前端/DI-Electrical/GlobalObj.cs
Normal file
@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using IniParser;
|
||||
using Prism.Ioc;
|
||||
using SWS.Model;
|
||||
using Unity;
|
||||
|
||||
namespace DI_Electrical
|
||||
{
|
||||
public class GlobalObj
|
||||
{
|
||||
public static loginRes userInfo;
|
||||
public static HttpClient client;
|
||||
public static bool isConfigIniCreateBySys = true;
|
||||
public static List<User> Users;
|
||||
public static ec_project curProject;
|
||||
public static string ConfigPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"Config.ini");
|
||||
public static IUnityContainer container;
|
||||
#region 本地文件目录
|
||||
static string _LocalFileDirectory;
|
||||
/// <summary>
|
||||
/// 获取本地目录文件夹
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static string GetLocalFileDirectory()
|
||||
{
|
||||
if (string.IsNullOrEmpty(_LocalFileDirectory))
|
||||
{
|
||||
FileIniDataParser parser = new FileIniDataParser();
|
||||
var data = parser.ReadFile(ConfigPath);
|
||||
_LocalFileDirectory = data["Profile"]["Directory"];
|
||||
return _LocalFileDirectory;
|
||||
}
|
||||
else
|
||||
{ return _LocalFileDirectory; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 设置本地目录文件夹
|
||||
/// </summary>
|
||||
/// <param name="dir">文件夹目录</param>
|
||||
public static void SetLocalFileDirectory(string dir)
|
||||
{ _LocalFileDirectory = dir; }
|
||||
#endregion
|
||||
public enum dialogPar
|
||||
{
|
||||
id,
|
||||
title,
|
||||
info,
|
||||
para1,
|
||||
para2
|
||||
}
|
||||
}
|
||||
}
|
@ -1,107 +0,0 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using DI_Electrical.Services;
|
||||
using IniParser;
|
||||
|
||||
namespace DI_Electrical.Helper
|
||||
{
|
||||
public class ConfigService
|
||||
{
|
||||
//public string path = Environment.ExpandEnvironmentVariables(@"%USERPROFILE%\AppData\Roaming\SWS\Config.ini");
|
||||
public string path = GlobalObject.ConfigPath;// Path.Combine(AppDomain.CurrentDomain.BaseDirectory,@"\Config.ini");
|
||||
public FileIniDataParser parser = new FileIniDataParser();
|
||||
public HttpService _httpService;
|
||||
/// <summary>
|
||||
/// config.ini 给默认值,且创建出来
|
||||
/// </summary>
|
||||
void SetDefaultConfigValue()
|
||||
{
|
||||
if (!File.Exists(path))
|
||||
{
|
||||
//默认值
|
||||
var data = parser.Parser.Parse("");
|
||||
data["Profile"]["Address"] = "1.117.161.11";
|
||||
data["Profile"]["Port"] = "8080";
|
||||
string userProfilePath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
|
||||
|
||||
data["Profile"]["Directory"] = $"{userProfilePath}\\AppData\\Roaming\\SWS";
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(path));
|
||||
parser.WriteFile(path, data);
|
||||
GlobalObject.isConfigIniCreateBySys = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
GlobalObject.isConfigIniCreateBySys = false;
|
||||
}
|
||||
}
|
||||
public ConfigService(HttpService httpService)
|
||||
{
|
||||
_httpService = httpService;
|
||||
SetDefaultConfigValue();
|
||||
string address;
|
||||
int port;
|
||||
string locDrawingPath;
|
||||
Read(out address, out port,out locDrawingPath);
|
||||
_httpService.Init(address, port);
|
||||
}
|
||||
public void Read(out string address, out int port, out string directory)
|
||||
{
|
||||
var data = parser.ReadFile(path);
|
||||
address = data["Profile"]["Address"];
|
||||
port = int.Parse(data["Profile"]["Port"]);
|
||||
directory = data["Profile"]["Directory"];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询某个
|
||||
/// </summary>
|
||||
/// <param name="keyName"></param>
|
||||
/// <returns></returns>
|
||||
public string Read(string keyName)
|
||||
{
|
||||
var data = parser.ReadFile(path);
|
||||
return data["Profile"][keyName];
|
||||
}
|
||||
/// <summary>
|
||||
/// 查询某个
|
||||
/// </summary>
|
||||
/// <param name="session">节点</param>
|
||||
/// <param name="keyName">key名称</param>
|
||||
/// <returns></returns>
|
||||
public string Read(string session,string keyName)
|
||||
{
|
||||
try
|
||||
{
|
||||
var data = parser.ReadFile(path);
|
||||
return data[session][keyName];
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存某个
|
||||
/// </summary>
|
||||
/// <param name="keyName"></param>
|
||||
/// <param name="value"></param>
|
||||
public void Save(string keyName, string value)
|
||||
{
|
||||
var data = parser.ReadFile(path);
|
||||
data["Profile"][keyName] = value;
|
||||
parser.WriteFile(path, data);
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存某个值
|
||||
/// </summary>
|
||||
/// <param name="session">节点</param>
|
||||
/// <param name="keyName">key名称</param>
|
||||
/// <param name="value">值</param>
|
||||
public void Save(string session, string keyName, string value)
|
||||
{
|
||||
var data = parser.ReadFile(path);
|
||||
data[session][keyName] = value;
|
||||
parser.WriteFile(path, data);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
using DI_Electrical.Models;
|
||||
|
||||
namespace DI_Electrical.Helper.Converter
|
||||
{
|
||||
public class CollectionToStringConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
ObservableCollection<ec_dataitemdetail> WHCPUs = value as ObservableCollection<ec_dataitemdetail>;
|
||||
if (WHCPUs != null)
|
||||
{
|
||||
string sWHCPU = "";
|
||||
for (int i = 0; i < WHCPUs.Count; i++)
|
||||
{
|
||||
if (i!= WHCPUs.Count-1)
|
||||
{
|
||||
if (WHCPUs[i] != null)
|
||||
{
|
||||
sWHCPU = sWHCPU + WHCPUs[i].DataItemCode + "|";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (WHCPUs[i] != null)
|
||||
{
|
||||
sWHCPU = sWHCPU + WHCPUs[i].DataItemCode;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return sWHCPU;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,55 +0,0 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
using DI_Electrical.ViewModels;
|
||||
|
||||
namespace DI_Electrical.Helper.Converter
|
||||
{
|
||||
public class RadGridViewRowToBoolConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
SignalManagementInfo smif = value as SignalManagementInfo;
|
||||
if (smif != null)
|
||||
{
|
||||
if (smif.Status.Equals("deleted") || smif.Status.Equals("Confirmed"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (smif.type.Equals("信号"))
|
||||
{
|
||||
switch (parameter.ToString())
|
||||
{
|
||||
case "关联的电缆信息":
|
||||
case "关联的通道信息":
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (parameter.ToString())
|
||||
{
|
||||
case "组别":
|
||||
case "编码":
|
||||
case "信号类型":
|
||||
case "Min":
|
||||
case "Max":
|
||||
case "单位":
|
||||
case "CODE":
|
||||
case "设备名":
|
||||
case "关联的电缆信息":
|
||||
case "关联的通道信息":
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
using DI_Electrical.ViewModels;
|
||||
|
||||
namespace DI_Electrical.Helper.Converter
|
||||
{
|
||||
internal class StatusToColourConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
SignalManagementInfo smif = value as SignalManagementInfo;
|
||||
if (smif != null)
|
||||
{
|
||||
return smif.Status;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,118 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Dl_Electrical.Helper
|
||||
{
|
||||
public static class FileHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// dwg等文件名是否合法。不带后缀
|
||||
/// </summary>
|
||||
/// <param name="fileName"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsValidFileName(string fileName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(fileName))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// 获取 Windows 文件系统中不允许出现在文件名中的字符数组
|
||||
char[] invalidChars = Path.GetInvalidFileNameChars();
|
||||
|
||||
// 检查文件名中是否包含非法字符
|
||||
foreach (char c in invalidChars)
|
||||
{
|
||||
if (fileName.IndexOf(c) >= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 检查是否为保留文件名
|
||||
string[] reservedNames = { "CON", "PRN", "AUX", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9" };
|
||||
string trimmedFileName = Path.GetFileNameWithoutExtension(fileName).Trim().ToUpper();
|
||||
foreach (string reservedName in reservedNames)
|
||||
{
|
||||
if (trimmedFileName == reservedName)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 检查文件名是否以空格或句点结尾
|
||||
if (fileName.TrimEnd().Length != fileName.Length || fileName.TrimEnd('.').Length != fileName.Length)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public static string GetFileMD5(string filePath)
|
||||
{
|
||||
if (string.IsNullOrEmpty(filePath) || !File.Exists(filePath))
|
||||
{
|
||||
throw new ArgumentException("文件路径无效或文件不存在", nameof(filePath));
|
||||
}
|
||||
|
||||
using (var md5 = MD5.Create()) // 创建 MD5 哈希算法实例
|
||||
using (var stream = File.OpenRead(filePath)) // 打开文件流
|
||||
{
|
||||
// 计算文件的 MD5 值
|
||||
byte[] hashBytes = md5.ComputeHash(stream);
|
||||
|
||||
// 将字节数组转换为十六进制字符串
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (var b in hashBytes)
|
||||
{
|
||||
sb.Append(b.ToString("x2")); // x2 格式化为两位小写十六进制数
|
||||
}
|
||||
|
||||
return sb.ToString(); // 返回 MD5 值的字符串
|
||||
}
|
||||
}
|
||||
|
||||
#region 检查文件是否被其他进程占用
|
||||
/// <summary>
|
||||
/// 检查文件是否被其他进程占用
|
||||
/// </summary>
|
||||
public static bool IsFileLocked(string filePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 尝试以独占模式打开文件
|
||||
using (FileStream fs = File.Open(
|
||||
filePath,
|
||||
FileMode.Open,
|
||||
FileAccess.ReadWrite,
|
||||
FileShare.None)) // FileShare.None 表示禁止共享
|
||||
{
|
||||
return false; // 成功打开则未被占用
|
||||
}
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
// 检查特定错误码
|
||||
int errorCode = Marshal.GetHRForException(ex) & 0xFFFF;
|
||||
return errorCode == 32 || errorCode == 33; // 32: 共享冲突, 33: 进程锁定
|
||||
}
|
||||
catch (UnauthorizedAccessException)
|
||||
{
|
||||
return true; // 无权限访问(可能被占用)
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false; // 其他异常视为未被占用
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,145 +0,0 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using Dl_Electrical.Helper;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace DI_Electrical.Helper
|
||||
{
|
||||
/// <summary>
|
||||
/// nLog使用帮助类
|
||||
/// </summary>
|
||||
public class LoggerHelper
|
||||
{
|
||||
private static readonly log4net.ILog loginfo = log4net.LogManager.GetLogger("loginfo");
|
||||
private static readonly log4net.ILog logerror = log4net.LogManager.GetLogger("logerror");
|
||||
private static readonly log4net.ILog logdebug = log4net.LogManager.GetLogger("logdebug");
|
||||
private static readonly log4net.ILog logwarn = log4net.LogManager.GetLogger("logwarn");
|
||||
private static readonly log4net.ILog logfatal = log4net.LogManager.GetLogger("logfatal");
|
||||
|
||||
private static LoggerHelper _obj = null;
|
||||
private static string logPath = string.Empty;
|
||||
private LoggerHelper()
|
||||
{
|
||||
string codeBase = Assembly.GetExecutingAssembly().CodeBase;
|
||||
string dllPath = codeBase.Replace("file:///", "");
|
||||
dllPath = Path.GetDirectoryName(dllPath);
|
||||
logPath = Path.Combine(dllPath, "Logs\\");
|
||||
var configFile = new FileInfo(Path.Combine(dllPath, "log4net.config"));
|
||||
log4net.Config.XmlConfigurator.ConfigureAndWatch(configFile);
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取当前的日志记录<see cref="LoggerHelper"/>对象。
|
||||
/// </summary>
|
||||
public static LoggerHelper Current
|
||||
{
|
||||
get => _obj ?? (new LoggerHelper());
|
||||
set => _obj = value;
|
||||
}
|
||||
|
||||
#region Debug,调试
|
||||
/// <summary>
|
||||
/// 调试信息输出。
|
||||
/// </summary>
|
||||
/// <param name="msg">需要记录的信息。</param>
|
||||
public void Debug(string msg)
|
||||
{
|
||||
logdebug.Debug(msg);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Info,信息
|
||||
/// <summary>
|
||||
/// 普通信息输出。
|
||||
/// </summary>
|
||||
/// <param name="msg">需要记录的信息。</param>
|
||||
public void Info(string msg)
|
||||
{
|
||||
loginfo.Info(msg);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Warn,警告
|
||||
/// <summary>
|
||||
/// 警告级别信息输出。
|
||||
/// </summary>
|
||||
/// <param name="msg">需要记录的信息。</param>
|
||||
public void Warn(string msg)
|
||||
{
|
||||
logwarn.Warn(msg);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Error,错误
|
||||
/// <summary>
|
||||
/// 错误级别信息输出。
|
||||
/// </summary>
|
||||
/// <param name="msg">需要记录的信息。</param>
|
||||
public void Error(string msg)
|
||||
{
|
||||
logerror.Error("----------------------------Error BEGIN------------------------------");
|
||||
logerror.Error(msg);
|
||||
logerror.Error("-----------------------------Error END-------------------------------");
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Fatal,致命错误
|
||||
/// <summary>
|
||||
/// 致命错误级别信息输出。
|
||||
/// </summary>
|
||||
/// <param name="msg">需要记录的信息。</param>
|
||||
/// <param name="err">需要记录的系统异常。</param>
|
||||
public void Fatal(string msg)
|
||||
{
|
||||
logfatal.Fatal("----------------------------Fatal BEGIN------------------------------");
|
||||
logerror.Fatal(msg);
|
||||
logerror.Fatal("-----------------------------Fatal END-------------------------------");
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 输出json日志
|
||||
|
||||
/// <summary>
|
||||
/// 输出json日志
|
||||
/// </summary>
|
||||
/// <param name="funName">json方法名</param>
|
||||
/// <param name="json">json数据</param>
|
||||
public void WriteJson(string funName, string json)
|
||||
{
|
||||
try
|
||||
{
|
||||
//json路径文件名 Environment.ExpandEnvironmentVariables(@"%USERPROFILE%\AppData\Roaming\SWS\Logs\"
|
||||
string filename = Path.Combine(logPath, funName + ".json");
|
||||
//判断文件是否被打开占用
|
||||
if (!FileHelper.IsFileLocked(filename))
|
||||
{
|
||||
File.Delete(filename);
|
||||
string strJson = string.Empty;
|
||||
if (json.StartsWith("["))
|
||||
{
|
||||
//格式化json数据 当前为组类型
|
||||
JArray jobj = JArray.Parse(json);
|
||||
strJson = jobj.ToString();
|
||||
}
|
||||
else if (json.StartsWith("{"))
|
||||
{
|
||||
//格式化json数据 当前为类类型
|
||||
JObject jobj = JObject.Parse(json);
|
||||
strJson = jobj.ToString();
|
||||
}
|
||||
//创建json文件,并输出数据
|
||||
FileStream fs = new FileStream(filename, FileMode.Append);
|
||||
StreamWriter wr = null;
|
||||
wr = new StreamWriter(fs);
|
||||
wr.WriteLine(strJson);
|
||||
wr.Close();
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DI_Electrical.Model
|
||||
{
|
||||
public class ConfigIni
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户名
|
||||
/// </summary>
|
||||
public string UserName { get; set; }
|
||||
/// <summary>
|
||||
/// 用户密码
|
||||
/// </summary>
|
||||
public string UserPs { get; set; }
|
||||
/// <summary>
|
||||
/// 项目id
|
||||
/// </summary>
|
||||
public string ProjectID { get; set; }
|
||||
/// <summary>
|
||||
/// 服务器ip
|
||||
/// </summary>
|
||||
public string Address { get; set; }
|
||||
/// <summary>
|
||||
/// 端口
|
||||
/// </summary>
|
||||
public string Port { get; set; }
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace DI_Electrical.Model
|
||||
{
|
||||
public class PageModel<T>
|
||||
{
|
||||
public List<T> Rows { get; set; }
|
||||
public int Total { get; set; }
|
||||
public int Records { get; set; }
|
||||
}
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
namespace DI_Electrical.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// learun mvc标准的http返回结果
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public class learunHttpRes<T>
|
||||
{
|
||||
public int code { get; set; }
|
||||
public string info { get; set; }
|
||||
public T data { get; set; }
|
||||
}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DI_Electrical.Model
|
||||
{
|
||||
public class loginRes
|
||||
{
|
||||
public string token { get; set; }
|
||||
public string loginMark { get; set; }
|
||||
public string account { get; set; }
|
||||
public string userId { get; set; }
|
||||
public string RealName { get; set; }
|
||||
|
||||
public string userPs { get; set; }
|
||||
public string IsIOModuleAdmin { get; set; }
|
||||
public string isFirstLogin { get; set; }
|
||||
public string Department { get; set; }
|
||||
}
|
||||
}
|
@ -1,438 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DI_Electrical.Models
|
||||
{
|
||||
public class ec_Wire_Group
|
||||
{
|
||||
public ec_Wire_Group()
|
||||
{
|
||||
//SoftTags = new List<ec_SofttagEntity>();
|
||||
NewSoftTags = new List<ec_Wire_Group>();
|
||||
//Status = WireGroupStatusEnum.New;
|
||||
}
|
||||
#region 实体成员
|
||||
/// <summary>
|
||||
/// 状态。比如“待删除的”。默认为New
|
||||
/// 去找lr base dataitem数据字典的be_signalstate
|
||||
/// </summary>
|
||||
//[JsonConverter(typeof(SignalStatusConverter))]
|
||||
public WireGroupStatusEnum Status { get; set; } = WireGroupStatusEnum.New;
|
||||
|
||||
/// <summary>
|
||||
/// 某一个输出的信号,可以关联多个输入的信号。关联的是<see cref="Wire_Group_ID"/>
|
||||
/// </summary>
|
||||
public string LinkedID { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
|
||||
public string Wire_Group_ID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 信号名称(CH. No.)。
|
||||
/// 1462,C列。
|
||||
/// 8600,A列。
|
||||
/// 如果是虚拟点。就是主信号+<see cref="Code"/>
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Group_Name { get; set; } = "";
|
||||
/// <summary>
|
||||
/// ChannelID。ec_panel_channel里。
|
||||
/// 如果为空,说明这个信号是关联前的状态(或者说未关联的状态)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string ChannelID { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 英文描述(Description)。
|
||||
/// 1462,D列。
|
||||
/// 8600,B列。
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Group_Desc_EN { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 中文描述。
|
||||
/// 8600,B列(第二行)。
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Group_Desc { get; set; } = "";
|
||||
/// <summary>
|
||||
/// (Signal_Type)信号类型,如4-20mA。
|
||||
/// 1462,I列。
|
||||
/// 8600,E列(模拟量)或F列(开关量)。
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string IO_Type { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// 信号的分组(组成Group Name的第一部分)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Signal_Group { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 信号的序号(组成Group Name的第二部分)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Signal_SeqNo { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 信号组模板ID(平台上,savesignal时,不会带出这个)。
|
||||
/// 只是公司级上才有意义。
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string WireGroupTemplateID { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 代码。
|
||||
/// 1462,H列。
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Code { get; set; } = "";
|
||||
/// <summary>
|
||||
/// Range_Min。
|
||||
/// 1462,J列。
|
||||
/// 8600,G列(111~222)。
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Range_Min { get; set; } = "";
|
||||
/// <summary>
|
||||
/// Range_Max.
|
||||
/// 1462,k列。
|
||||
/// 8600,G列(111~222)。
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Range_Max { get; set; } = "";
|
||||
/// <summary>
|
||||
/// Range_Min和Range_Max的单位。
|
||||
/// 1462,L列。
|
||||
/// 8600,H列。
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Unit { get; set; } = "";
|
||||
/// <summary>
|
||||
/// Alarm_LL。
|
||||
/// 1462,m列。
|
||||
/// 8600,J列(第一行或第二行不确定)。
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Alarm_LL { get; set; } = "";
|
||||
/// <summary>
|
||||
/// Alarm_L。
|
||||
/// 1462,n列。
|
||||
/// 8600,I列(第一行或第二行不确定)。
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Alarm_L { get; set; } = "";
|
||||
/// <summary>
|
||||
/// Alarm_H。
|
||||
/// 1462,o列。
|
||||
/// 8600,I列(第一行或第二行不确定)。
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Alarm_H { get; set; } = "";
|
||||
/// <summary>
|
||||
/// Alarm_HH。
|
||||
/// 1462,p列。
|
||||
/// 8600,J列(第一行或第二行不确定)。
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Alarm_HH { get; set; } = "";
|
||||
/// <summary>
|
||||
/// AL_GRP 延申报警组。
|
||||
/// 1462,S列。
|
||||
/// 8600,U列。
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string AL_GRP { get; set; } = "";
|
||||
/// <summary>
|
||||
/// BL_GRP 抑制报警。
|
||||
/// 1462,T列。
|
||||
/// 8600,T列。
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string BL_GRP { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 延时。
|
||||
/// 1462,U列。
|
||||
/// 8600,S列。
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Time_Delay { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 供应商。
|
||||
/// 1463,V列。
|
||||
/// 8600,L列。
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Supplier { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// 设备名
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string EquipName { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 传感器代码。
|
||||
/// 1462,W列。
|
||||
/// 8600,K列。
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string SENSOR_CODE { get; set; } = "";
|
||||
/// <summary>
|
||||
/// VDR_Record。
|
||||
/// 1462,X列。
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool VDR_Record { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 是否为slow down信号。
|
||||
/// 1462,Q列。
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool SLD { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 是否为shut down信号。
|
||||
/// 1462,R列。
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool SHD { get; set; } = false;
|
||||
/// <summary>
|
||||
/// Remarks。
|
||||
/// 1462,Y列。
|
||||
/// 8600,X列。
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Remarks { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// 信号归属
|
||||
/// true,代表该信号是电气进行最终审核确认;
|
||||
/// false,代表该信号是轮机进行最终审核确认;
|
||||
/// </summary>
|
||||
public bool ElecOnly { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 是否为通讯点。
|
||||
/// 1462,通过<see cref="ec_Wire_GroupEntity.Remarks"/>里的文字判断
|
||||
/// 8600,通过K列里的文字判断
|
||||
/// </summary>
|
||||
public bool CommunicationPoint { get; set; } = false;
|
||||
|
||||
|
||||
///// <summary>
|
||||
///// ECC 。Bool类型数据库要么是int要么是bool
|
||||
///// </summary>
|
||||
//public bool ECC { get; set; } = false;
|
||||
|
||||
///// <summary>
|
||||
///// WCC
|
||||
///// </summary>
|
||||
//public bool WCC { get; set; } = false;
|
||||
///// <summary>
|
||||
///// BCC
|
||||
///// </summary>
|
||||
//public bool BCC { get; set; } = false;
|
||||
/// <summary>
|
||||
/// IO类型,AI AO DI DO
|
||||
/// </summary>
|
||||
public string InOrOut { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 驾驶室(控制台)。
|
||||
/// 8600,M列。导入时,如果2行都有值,中间会|分开
|
||||
/// </summary>
|
||||
public string WHConsole { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 驾驶室(计算机)。
|
||||
/// 8600,N列。导入时,如果2行都有值,中间会|分开
|
||||
/// </summary>
|
||||
public string WHCPU { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 集控室(控制台)。
|
||||
/// 8600,O列。导入时,如果2行都有值,中间会|分开
|
||||
/// </summary>
|
||||
public string ECRConsole { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 集控室(计算机)。
|
||||
/// 8600,P列(excel中,两行均有值时,以|分开)
|
||||
/// </summary>
|
||||
public string ECRCPU { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 船舶办公室(控制台)。
|
||||
/// 8600,Q列。导入时,如果2行都有值,中间会|分开
|
||||
/// </summary>
|
||||
public string ShipOfficeConsole { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 船舶办公室(计算机)。
|
||||
/// 8600,R列。导入时,如果2行都有值,中间会|分开
|
||||
/// </summary>
|
||||
public string ShipOfficeCPU { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 安全保护。(和<see cref="SLD"/> <see cref="SHD"/>列有关系)
|
||||
/// 8600,V列。
|
||||
/// </summary>
|
||||
public string SafetyProt { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 安全保护延时。
|
||||
/// 8600,V列下。
|
||||
/// </summary>
|
||||
public string SafetyDelay { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// SeriousType
|
||||
/// 1462,AG列。
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string SeriousType { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// 自动控制。
|
||||
/// 8600,W列。
|
||||
/// </summary>
|
||||
public string AutoCtrl { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 爸爸。如果有值,则代表其为虚拟点的概念
|
||||
/// <see cref="Wire_Group_ID"/>
|
||||
/// </summary>
|
||||
public string ParentID { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 删除标记。因为哪怕是删除了,也要保留数据,以便日后查看。
|
||||
/// </summary>
|
||||
public bool DeleteFlg { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 电缆位号(某些项目的<see cref="ec_projectSettingsEntity"/>里,是允许编辑的IO_allowManualAssign)
|
||||
/// </summary>
|
||||
public string CableName { get; set; }
|
||||
/// <summary>
|
||||
/// 通讯类信号<see cref="ec_CableEntity.CableClass"/>的母线ID<see cref="ec_CableEntity.CableID"/>
|
||||
/// </summary>
|
||||
public string CableId { get; set; }
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string CreateUserID { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 更新人
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string UpdateUserID { get; set; }
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DateTime? UpdateTime { get; set; }
|
||||
#endregion
|
||||
|
||||
|
||||
#region 扩展字段
|
||||
///// <summary>
|
||||
///// 虚拟点 集合
|
||||
///// </summary>
|
||||
////[SugarColumn(IsIgnore = true)]
|
||||
//[Obsolete]
|
||||
//[Navigate(NavigateType.OneToMany, nameof(ec_SofttagEntity.Wire_Group_ID))] //配置了导航,方便DeleteNav,ec_softtag表中的wiregroupid
|
||||
//public List<ec_SofttagEntity> SoftTags { get; set; }
|
||||
|
||||
|
||||
|
||||
public List<ec_Wire_Group> NewSoftTags { get; set; }
|
||||
/// <summary>
|
||||
/// 柜子
|
||||
/// </summary>
|
||||
|
||||
public string PanelName { get; set; }
|
||||
/// <summary>
|
||||
/// 通道号
|
||||
/// </summary>
|
||||
|
||||
public string ChannelName { get; set; }
|
||||
/// <summary>
|
||||
/// 端子排
|
||||
/// </summary>
|
||||
|
||||
public string StripName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 电缆对
|
||||
/// </summary>
|
||||
|
||||
public string CableSetName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// status的具体文字描述
|
||||
/// </summary>
|
||||
|
||||
public string StatusValue { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 操作历史(因为现在插件端的保存是一次性的。哪怕有多个动作,也只是一次提交)
|
||||
/// </summary>
|
||||
|
||||
public List<ActionHistory> ActionHistorys { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 信号属性变更历史
|
||||
/// </summary>
|
||||
|
||||
public List<ec_wire_group_propertyhis> Propertyhis { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 信号日志
|
||||
/// </summary>
|
||||
|
||||
public List<ec_wire_group_log> Logs { get; set; }
|
||||
#endregion
|
||||
}
|
||||
public enum WireGroupStatusEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// 待删除
|
||||
/// </summary>
|
||||
[Description("待删除")]
|
||||
ToDelete = 01,
|
||||
/// <summary>
|
||||
/// 新增的
|
||||
/// </summary>
|
||||
[Description("新增的")]
|
||||
New = 02,
|
||||
/// <summary>
|
||||
/// 已关联
|
||||
/// </summary>
|
||||
[Description("已使用(关联)")]
|
||||
Used = 03,
|
||||
/// <summary>
|
||||
/// 已审核
|
||||
/// </summary>
|
||||
[Description("已确认(审核)")]
|
||||
Confirmed = 04,
|
||||
/// <summary>
|
||||
/// 重新打开
|
||||
/// </summary>
|
||||
[Description("重新打开")]
|
||||
Reopen = 05,
|
||||
/// <summary>
|
||||
/// 彻底删除
|
||||
/// </summary>
|
||||
[Description("彻底删除")]
|
||||
deleted = 06
|
||||
}
|
||||
public class ActionHistory
|
||||
{
|
||||
public DateTime? ActionTime { get; set; }
|
||||
public Action ActionType { get; set; }
|
||||
public string reason { get; set; }
|
||||
}
|
||||
}
|
@ -1,81 +0,0 @@
|
||||
using DryIoc.ImTools;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DI_Electrical.Models
|
||||
{
|
||||
public class ec_dataitemdetail
|
||||
{
|
||||
#region 实体成员
|
||||
/// <summary>
|
||||
/// 字典明细ID
|
||||
/// </summary>
|
||||
|
||||
public string DataItemDetailID { get; set; }
|
||||
/// <summary>
|
||||
/// 字典分类ID(存的是<see cref="ec_dataitemEntity.DataItemID"/>
|
||||
/// </summary>
|
||||
public string DataItemID { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 上级字典明细ID。<see cref="DataItemDetailID"/>
|
||||
/// </summary>
|
||||
public string UpDataItemDetailID { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 字典明细名称
|
||||
/// </summary>
|
||||
public string DataItemName { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 字典明细名称(英文)
|
||||
/// </summary>
|
||||
public string DataItemNameEN { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 字典明细编号
|
||||
/// </summary>
|
||||
public string DataItemCode { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
public int? OrderID { get; set; }
|
||||
/// <summary>
|
||||
/// 是否有效
|
||||
/// </summary>
|
||||
public int? IsEnabled { get; set; }
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string Remark { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
public string CreateUserID { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 更新人
|
||||
/// </summary>
|
||||
public string UpdateUserID { get; set; }
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
public DateTime? UpdateTime { get; set; }
|
||||
#endregion
|
||||
|
||||
#region 扩展字段
|
||||
/// <summary>
|
||||
/// 字典编号<see cref="ec_dataitemEntity.DataItemCode"/>。如Be_signal_group
|
||||
/// </summary>
|
||||
|
||||
public string ItemCode { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 信号
|
||||
/// </summary>
|
||||
|
||||
public List<ec_Wire_Group> Signals { get; set; }
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,123 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace DI_Electrical.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 项目
|
||||
/// </summary>
|
||||
public class ec_project
|
||||
{
|
||||
#region 实体成员
|
||||
/// <summary>
|
||||
/// 项目ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string ProjectId { get; set; }
|
||||
/// <summary>
|
||||
/// 项目名称
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string ProjectName { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 项目代号
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string ProjectCode { get; set; } = "";
|
||||
|
||||
///// <summary>
|
||||
///// 船检
|
||||
///// </summary>
|
||||
//public string ShipCheck { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 船名(中文)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string ShipNameCN { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 船名(英文)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string ShipNameEN { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 船型(中文)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string ShipTypeCN { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 船型(英文)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string ShipTypeEN { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 船级社(id)。和船检的概念有些冲突
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string ShipSociety { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 船东
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string ShipOwner { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 挂旗国(船籍国)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string FlagState { get; set; } = "";
|
||||
/// <summary>
|
||||
/// IMO编号
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string IMONumber { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 项目更多描述一
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Describe1 { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 项目更多描述二
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Describe2 { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 项目更多描述三
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Describe3 { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 项目更多描述四
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Describe4 { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 项目更多描述五
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Describe5 { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 项目序号
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int? ProjectIndex { get; set; }
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string CreateUserID { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 更新人
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string UpdateUserID { get; set; }
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DateTime? UpdateTime { get; set; }
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,95 +0,0 @@
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DI_Electrical.Models
|
||||
{
|
||||
public class ec_wire_group_log
|
||||
{
|
||||
public ec_wire_group_log()
|
||||
{
|
||||
|
||||
}
|
||||
public ec_wire_group_log(Action OperateType, string WireGroupID)
|
||||
{
|
||||
this.OperateType = OperateType;
|
||||
this.WireGroupID = WireGroupID;
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="OperateType"></param>
|
||||
/// <param name="WireGroupID"></param>
|
||||
/// <param name="createtime">因为<see cref="ec_Wire_GroupEntity.ActionHistorys"/>的关系,所以时间是有值的</param>
|
||||
public ec_wire_group_log(Action OperateType, string WireGroupID, DateTime? createtime)
|
||||
{
|
||||
this.OperateType = OperateType;
|
||||
this.WireGroupID = WireGroupID;
|
||||
|
||||
if (createtime != null)
|
||||
{
|
||||
this.CreateTime = createtime;
|
||||
}
|
||||
|
||||
}
|
||||
#region 实体成员
|
||||
/// <summary>
|
||||
/// 操作日志ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
|
||||
public string WireGroupLogID { get; set; }
|
||||
/// <summary>
|
||||
/// 信号ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string WireGroupID { get; set; }
|
||||
/// <summary>
|
||||
/// 操作类型
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public Action OperateType { get; set; }
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string ExtraMsg { get; set; }
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string CreateUserID { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 更新人
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string UpdateUserID { get; set; }
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DateTime? UpdateTime { get; set; }
|
||||
#endregion
|
||||
|
||||
|
||||
#region 扩展字段
|
||||
/// <summary>
|
||||
/// 创建人名称
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
|
||||
public string CreateUserName { get; set; }
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,130 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace DI_Electrical.Models
|
||||
|
||||
{
|
||||
/// <summary>
|
||||
/// 动作。和状态是两码事情。
|
||||
/// </summary>
|
||||
public enum Action
|
||||
{
|
||||
|
||||
新增 = 0,
|
||||
修改 = 1,
|
||||
准备删除 = 2,
|
||||
撤销删除 = 3,
|
||||
删除 = 4,
|
||||
关联通道 = 5,
|
||||
审核 = 6,
|
||||
重新打开 = 7,
|
||||
关联解除 = 8,
|
||||
回收站恢复 = 9
|
||||
}
|
||||
|
||||
public enum Department
|
||||
{
|
||||
轮机 = 0,
|
||||
电气 = 1
|
||||
}
|
||||
|
||||
public class ec_wire_group_notice
|
||||
{
|
||||
public ec_wire_group_notice()
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="action"></param>
|
||||
/// <param name="departmentRetrieveNotice">接收方</param>
|
||||
/// <param name="WireGroupID"></param>
|
||||
public ec_wire_group_notice(Action action, Department departmentRetrieveNotice, string WireGroupID)
|
||||
{
|
||||
ActionID = action;
|
||||
CompanyID = departmentRetrieveNotice;
|
||||
this.WireGroupID = WireGroupID;
|
||||
|
||||
}
|
||||
|
||||
#region 实体成员
|
||||
/// <summary>
|
||||
/// 信号表通知ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string WireGroupNoticeID { get; set; }
|
||||
/// <summary>
|
||||
/// 信号ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string WireGroupID { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 动作
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Action ActionID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 额外的消息(如删除时,必须要给一个删除理由)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Message { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 是否被确认。false未读。true已读。
|
||||
/// </summary>
|
||||
public bool CheckFLG { get; set; } = false;
|
||||
/// <summary>
|
||||
/// 接收者的部门
|
||||
/// </summary>
|
||||
public Department CompanyID { get; set; }
|
||||
/// <summary>
|
||||
/// 创建人(也就是发起通知的人)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string CreateUserID { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 更新人(也就是确认这个消息已阅的人)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string UpdateUserID { get; set; }
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DateTime? UpdateTime { get; set; }
|
||||
#endregion
|
||||
|
||||
#region 扩展字段
|
||||
|
||||
/// <summary>
|
||||
/// 动作(描述)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Action { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人名称
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string CreateUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 批准人名字
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string UpdateUserName { get; set; }
|
||||
#region 用于前端UI渲染,对应的信号的内容
|
||||
public string Group_Name { get; set; }
|
||||
public string Group_Desc { get; set; }
|
||||
public string Group_Desc_EN { get; set; }
|
||||
public string IO_Type { get; set; }
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,199 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace DI_Electrical.Model
|
||||
{
|
||||
public class User
|
||||
{
|
||||
#region 实体成员
|
||||
/// <summary>
|
||||
/// 用户主键
|
||||
/// </summary>
|
||||
public string F_UserId { get; set; }
|
||||
/// <summary>
|
||||
/// 工号
|
||||
/// </summary>
|
||||
public string F_EnCode { get; set; }
|
||||
/// <summary>
|
||||
/// 账户
|
||||
/// </summary>
|
||||
public string F_Account { get; set; }
|
||||
/// <summary>
|
||||
/// 登录密码
|
||||
/// </summary>
|
||||
public string F_Password { get; set; }
|
||||
/// <summary>
|
||||
/// 密码秘钥
|
||||
/// </summary>
|
||||
public string F_Secretkey { get; set; }
|
||||
/// <summary>
|
||||
/// 真实姓名
|
||||
/// </summary>
|
||||
public string F_RealName { get; set; }
|
||||
/// <summary>
|
||||
/// 呢称
|
||||
/// </summary>
|
||||
public string F_NickName { get; set; }
|
||||
/// <summary>
|
||||
/// 头像
|
||||
/// </summary>
|
||||
public string F_HeadIcon { get; set; }
|
||||
/// <summary>
|
||||
/// 快速查询
|
||||
/// </summary>
|
||||
public string F_QuickQuery { get; set; }
|
||||
/// <summary>
|
||||
/// 简拼
|
||||
/// </summary>
|
||||
public string F_SimpleSpelling { get; set; }
|
||||
/// <summary>
|
||||
/// 性别
|
||||
/// </summary>
|
||||
public int? F_Gender { get; set; }
|
||||
/// <summary>
|
||||
/// 生日
|
||||
/// </summary>
|
||||
public DateTime? F_Birthday { get; set; }
|
||||
/// <summary>
|
||||
/// 手机
|
||||
/// </summary>
|
||||
public string F_Mobile { get; set; }
|
||||
/// <summary>
|
||||
/// 电话
|
||||
/// </summary>
|
||||
public string F_Telephone { get; set; }
|
||||
/// <summary>
|
||||
/// 电子邮件
|
||||
/// </summary>
|
||||
public string F_Email { get; set; }
|
||||
/// <summary>
|
||||
/// QQ号
|
||||
/// </summary>
|
||||
public string F_OICQ { get; set; }
|
||||
/// <summary>
|
||||
/// 微信号
|
||||
/// </summary>
|
||||
public string F_WeChat { get; set; }
|
||||
/// <summary>
|
||||
/// MSN
|
||||
/// </summary>
|
||||
public string F_MSN { get; set; }
|
||||
/// <summary>
|
||||
/// 公司或部门的主键<see cref="CompanyEntity.F_CompanyId"/>
|
||||
/// </summary>
|
||||
public string F_CompanyId { get; set; }
|
||||
/// <summary>
|
||||
/// 部门主键
|
||||
/// </summary>
|
||||
public string F_DepartmentId { get; set; }
|
||||
/// <summary>
|
||||
/// 安全级别
|
||||
/// </summary>
|
||||
public int? F_SecurityLevel { get; set; }
|
||||
/// <summary>
|
||||
/// 单点登录标识
|
||||
/// </summary>
|
||||
public int? F_OpenId { get; set; }
|
||||
/// <summary>
|
||||
/// 密码提示问题
|
||||
/// </summary>
|
||||
public string F_Question { get; set; }
|
||||
/// <summary>
|
||||
/// 密码提示答案
|
||||
/// </summary>
|
||||
public string F_AnswerQuestion { get; set; }
|
||||
/// <summary>
|
||||
/// 允许多用户同时登录
|
||||
/// </summary>
|
||||
public int? F_CheckOnLine { get; set; }
|
||||
/// <summary>
|
||||
/// 允许登录时间开始
|
||||
/// </summary>
|
||||
public DateTime? F_AllowStartTime { get; set; }
|
||||
/// <summary>
|
||||
/// 允许登录时间结束
|
||||
/// </summary>
|
||||
public DateTime? F_AllowEndTime { get; set; }
|
||||
/// <summary>
|
||||
/// 暂停用户开始日期
|
||||
/// </summary>
|
||||
public DateTime? F_LockStartDate { get; set; }
|
||||
/// <summary>
|
||||
/// 暂停用户结束日期
|
||||
/// </summary>
|
||||
public DateTime? F_LockEndDate { get; set; }
|
||||
/// <summary>
|
||||
/// 排序码
|
||||
/// </summary>
|
||||
public int? F_SortCode { get; set; }
|
||||
/// <summary>
|
||||
/// 删除标记
|
||||
/// </summary>
|
||||
public int? F_DeleteMark { get; set; }
|
||||
/// <summary>
|
||||
/// 有效标志
|
||||
/// </summary>
|
||||
public int? F_EnabledMark { get; set; }
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string F_Description { get; set; }
|
||||
/// <summary>
|
||||
/// 创建日期
|
||||
/// </summary>
|
||||
public DateTime? F_CreateDate { get; set; }
|
||||
/// <summary>
|
||||
/// 创建用户主键
|
||||
/// </summary>
|
||||
public string F_CreateUserId { get; set; }
|
||||
/// <summary>
|
||||
/// 创建用户
|
||||
/// </summary>
|
||||
public string F_CreateUserName { get; set; }
|
||||
/// <summary>
|
||||
/// 修改日期
|
||||
/// </summary>
|
||||
public DateTime? F_ModifyDate { get; set; }
|
||||
/// <summary>
|
||||
/// 修改用户主键
|
||||
/// </summary>
|
||||
public string F_ModifyUserId { get; set; }
|
||||
/// <summary>
|
||||
/// 修改用户
|
||||
/// </summary>
|
||||
public string F_ModifyUserName { get; set; }
|
||||
/// <summary>
|
||||
/// 密码更新时间
|
||||
/// </summary>
|
||||
public DateTime? PasswordUpdateTime { get; set; }//add by chenkai 20210322
|
||||
/// <summary>
|
||||
/// 微信OpenId
|
||||
/// </summary>
|
||||
public string WX_OpenId { get; set; }
|
||||
#endregion
|
||||
|
||||
|
||||
#region 扩展属性
|
||||
/// <summary>
|
||||
/// 登录信息
|
||||
/// </summary>
|
||||
public string LoginMsg { get; set; }
|
||||
/// <summary>
|
||||
/// 登录状态
|
||||
/// </summary>
|
||||
public bool LoginOk { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 公司名称
|
||||
/// </summary>
|
||||
public string F_FullName { get; set; }
|
||||
/// <summary>
|
||||
/// 岗位名称
|
||||
/// </summary>
|
||||
public string F_PostName { get; set; }
|
||||
/// <summary>
|
||||
/// 单位名称
|
||||
/// </summary>
|
||||
public string F_CompanyName { get { return F_FullName; } }
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using DI_Electrical.Models;
|
||||
|
||||
namespace DI_Electrical.Services
|
||||
{
|
||||
public class DataItemService : HttpService
|
||||
{
|
||||
public DataItemService( ) : base()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public async Task<List<ec_dataitemdetail>> GetDetails(string itemCode)
|
||||
{
|
||||
var res = await this.GetAsync<List<ec_dataitemdetail>>($"DataItemApi/GetDetails?projectId={GlobalObject.curProject.ProjectId}&itemCode={itemCode}");
|
||||
//OnRefresh();
|
||||
if (res.code == 200)
|
||||
{
|
||||
|
||||
return res.data;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;//ERROR INFO
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,263 +0,0 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using DI_Electrical.Helper;
|
||||
using DI_Electrical.Model;
|
||||
using Newtonsoft.Json;
|
||||
namespace DI_Electrical.Services
|
||||
{
|
||||
public class HttpService
|
||||
{
|
||||
public HttpService()
|
||||
{
|
||||
}
|
||||
public void Init(string address, int port)
|
||||
{
|
||||
// 如果 GlobalObject.client 已经是 null,初始化一个新的 HttpClient 实例
|
||||
//if (GlobalObject.client == null)
|
||||
//{
|
||||
GlobalObject.client = new HttpClient()
|
||||
{
|
||||
BaseAddress = new Uri($"http://{address}:{port}/api/"),
|
||||
Timeout = TimeSpan.FromSeconds(120)
|
||||
};
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// // 如果已经有 client 实例,则更新它的 BaseAddress
|
||||
// GlobalObject.client.BaseAddress = new Uri($"http://{address}:{port}/api/");
|
||||
//}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 带入授权码。
|
||||
/// </summary>
|
||||
/// <param name="httpClient"></param>
|
||||
protected virtual void OnInitAuthorizationCode()
|
||||
{
|
||||
//httpClient.DefaultRequestHeaders.Add("User-Agent", "Mozilla/5.0 (Windows 10.0.22621.1265; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/110.0.835.163 Safari/535.1");
|
||||
|
||||
//if (AuthorizationCode.IsNullOrEmpty() || httpClient == null) return;
|
||||
//httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + AuthorizationCode);
|
||||
}
|
||||
protected virtual void OnInitRequestHeader(HttpClient httpClient, string mediaType)
|
||||
{
|
||||
//httpClient.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue(mediaType));
|
||||
httpClient.DefaultRequestHeaders.Add("Accept", mediaType);
|
||||
httpClient.DefaultRequestHeaders.Add("ContentType", mediaType);
|
||||
}
|
||||
|
||||
private void WriteLog(string requestUri, string strJson)
|
||||
{
|
||||
try
|
||||
{
|
||||
var uri = new Uri(GlobalObject.client.BaseAddress + requestUri);
|
||||
var funName = uri.Segments.Last();
|
||||
LoggerHelper.Current.WriteJson(funName, strJson);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
public async Task<learunHttpRes<T>> GetAsync<T>(string requestUri)
|
||||
{
|
||||
//httpClient.Timeout = TimeSpan.FromSeconds(3000);
|
||||
OnInitAuthorizationCode();
|
||||
string result = string.Empty;
|
||||
learunHttpRes<T> resultObj = null;
|
||||
try
|
||||
{
|
||||
var response = await GlobalObject.client.GetAsync(requestUri);
|
||||
if (response.StatusCode != HttpStatusCode.OK)
|
||||
{
|
||||
string errorMsg = $"服务器地址 [{requestUri}] 获取数据失败, 返回HTTP代码:" + response.StatusCode;
|
||||
LoggerHelper.Current.Error(errorMsg);
|
||||
throw new HttpRequestException(errorMsg);
|
||||
}
|
||||
result = await response.Content.ReadAsStringAsync();
|
||||
WriteLog(requestUri, result);
|
||||
resultObj = JsonConvert.DeserializeObject<learunHttpRes<T>>(result);
|
||||
}
|
||||
catch (JsonException)
|
||||
{
|
||||
string errorMsg = $"服务器地址 [{requestUri}] 解析为{typeof(T).Name}失败,原始返回数据为: " + result;
|
||||
LoggerHelper.Current.Error(errorMsg);
|
||||
resultObj = new learunHttpRes<T>() { code = -100, info = errorMsg };
|
||||
return resultObj;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string errorMsg = $"接口:{requestUri}失败,异常:{ex.Message} ";
|
||||
LoggerHelper.Current.Error(errorMsg);
|
||||
resultObj = new learunHttpRes<T>() { code = -100, info=errorMsg };
|
||||
return resultObj;
|
||||
}
|
||||
|
||||
if (resultObj.code != 200)
|
||||
{
|
||||
switch (resultObj.code)
|
||||
{
|
||||
case 400:
|
||||
case 500:
|
||||
break;
|
||||
//业务错误,不是http本质错误
|
||||
default:
|
||||
string errorMsg = $"服务器地址 [{requestUri}] Get失败, 返回自定义代码:" + resultObj.code;
|
||||
LoggerHelper.Current.Error(errorMsg);
|
||||
throw new HttpRequestException(errorMsg);
|
||||
}
|
||||
|
||||
}
|
||||
LoggerHelper.Current.Info($"Get成功:{requestUri}");
|
||||
return resultObj;
|
||||
|
||||
|
||||
}
|
||||
public async Task<T> GetAsyncByOnlyData<T>(string requestUri)
|
||||
{
|
||||
//httpClient.Timeout = TimeSpan.FromSeconds(3000);
|
||||
OnInitAuthorizationCode();
|
||||
string result = string.Empty;
|
||||
T resultObj;
|
||||
try
|
||||
{
|
||||
var response = await GlobalObject.client.GetAsync(requestUri);
|
||||
if (response.StatusCode != HttpStatusCode.OK)
|
||||
{
|
||||
string errorMsg = $"服务器地址 [{requestUri}] 获取数据失败, 返回HTTP代码:" + response.StatusCode;
|
||||
LoggerHelper.Current.Error(errorMsg);
|
||||
throw new HttpRequestException(errorMsg);
|
||||
}
|
||||
result = await response.Content.ReadAsStringAsync();
|
||||
WriteLog(requestUri, result);
|
||||
resultObj = JsonConvert.DeserializeObject<T>(result);
|
||||
}
|
||||
catch (JsonException)
|
||||
{
|
||||
string errorMsg = $"服务器地址 [{requestUri}] 解析为{typeof(T).Name}失败,原始返回数据为: " + result;
|
||||
LoggerHelper.Current.Error(errorMsg);
|
||||
throw new JsonException(errorMsg);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string errorMsg = $"接口:{requestUri}失败,异常:{ex.Message} ";
|
||||
LoggerHelper.Current.Error(errorMsg);
|
||||
throw new JsonException(errorMsg);
|
||||
}
|
||||
|
||||
LoggerHelper.Current.Info($"Get成功:{requestUri}");
|
||||
return resultObj;
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <typeparam name="T">响应后的返回数据的类型</typeparam>
|
||||
/// <typeparam name="T1">POST数据对象的类型</typeparam>
|
||||
/// <param name="requestUri"></param>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="HttpRequestException"></exception>
|
||||
/// <exception cref="JsonException"></exception>
|
||||
public async Task<learunHttpRes<T>> PostBodyAsync<T, T1>(string requestUri, T1 postObj)
|
||||
{
|
||||
OnInitAuthorizationCode();
|
||||
|
||||
string contentType = "application/json";
|
||||
string strContent = postObj != null ? JsonConvert.SerializeObject(postObj) : "";
|
||||
var content = new StringContent(strContent, Encoding.UTF8, contentType);
|
||||
OnInitRequestHeader(GlobalObject.client, contentType);
|
||||
learunHttpRes<T> resultObj = null;
|
||||
string result = string.Empty;
|
||||
try
|
||||
{
|
||||
var response = await GlobalObject.client.PostAsync(requestUri, content);
|
||||
if (response.StatusCode != HttpStatusCode.OK)
|
||||
{
|
||||
string errorMsg = $"服务器地址 [{requestUri}] Post数据失败, 返回HTTP代码:" + response.StatusCode;
|
||||
LoggerHelper.Current.Error(errorMsg);
|
||||
throw new HttpRequestException(errorMsg);
|
||||
}
|
||||
result = await response.Content.ReadAsStringAsync();
|
||||
WriteLog(requestUri, result);
|
||||
resultObj = JsonConvert.DeserializeObject<learunHttpRes<T>>(result);
|
||||
}
|
||||
catch (JsonException)
|
||||
{
|
||||
string errorMsg = $"服务器地址 [{requestUri}] 解析为{typeof(T).Name}失败,原始返回数据为: " + result;
|
||||
LoggerHelper.Current.Error(errorMsg);
|
||||
resultObj = new learunHttpRes<T>() { code = -100, info = errorMsg };
|
||||
return resultObj;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string errorMsg = $"接口:{requestUri}失败,参数数据为:{strContent},异常:{ex.Message} ";
|
||||
LoggerHelper.Current.Error(errorMsg);
|
||||
resultObj = new learunHttpRes<T>() { code = -100, info = errorMsg };
|
||||
return resultObj;
|
||||
}
|
||||
|
||||
if (resultObj.code != 200)
|
||||
{
|
||||
switch (resultObj.code)
|
||||
{
|
||||
case 400:
|
||||
case 500:
|
||||
break;
|
||||
//业务错误,不是http本质错误
|
||||
default:
|
||||
string errorMsg = $"服务器地址 [{requestUri}] Post失败, 返回自定义代码:" + resultObj.code;
|
||||
LoggerHelper.Current.Error(errorMsg);
|
||||
throw new HttpRequestException(errorMsg);
|
||||
}
|
||||
|
||||
}
|
||||
LoggerHelper.Current.Info($"Post成功:{requestUri}");
|
||||
return resultObj;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public async Task<T> PostFileAsync<T>(string requestUri, Stream stream, string fileName)
|
||||
{
|
||||
OnInitAuthorizationCode();
|
||||
|
||||
string contentType = "multipart/form-data";
|
||||
var streamContent = new StreamContent(stream, (int)stream.Length);
|
||||
streamContent.Headers.Add("Content-Type", "application/octet-stream");
|
||||
var content = new MultipartFormDataContent
|
||||
{
|
||||
{ streamContent, "file", fileName }
|
||||
};
|
||||
OnInitRequestHeader(GlobalObject.client, contentType);
|
||||
var response = await GlobalObject.client.PostAsync(requestUri, content);
|
||||
if (response.StatusCode != HttpStatusCode.OK)
|
||||
{
|
||||
string errorMsg = $"服务器地址 [{requestUri}] Post数据失败, 返回HTTP代码:" + response.StatusCode;
|
||||
LoggerHelper.Current.Error(errorMsg);
|
||||
throw new HttpRequestException(errorMsg);
|
||||
}
|
||||
var result = await response.Content.ReadAsStringAsync();
|
||||
T resultObj;
|
||||
try
|
||||
{
|
||||
resultObj = JsonConvert.DeserializeObject<T>(result);
|
||||
}
|
||||
catch (JsonException)
|
||||
{
|
||||
string errorMsg = $"服务器地址 [{requestUri}] 解析为 string 失败,原始返回数据为: " + result;
|
||||
LoggerHelper.Current.Error(errorMsg);
|
||||
throw new JsonException(errorMsg);
|
||||
}
|
||||
LoggerHelper.Current.Info($"Post上传文件成功:{requestUri}");
|
||||
return resultObj;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using DI_Electrical.Model;
|
||||
using EasyEncryption;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace DI_Electrical.Services
|
||||
{
|
||||
public class LoginService : HttpService
|
||||
{
|
||||
public LoginService() : base()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public async Task<string> Login(string userName, string passwordOrigin)
|
||||
{
|
||||
|
||||
var password = MD5.ComputeMD5Hash(passwordOrigin); //B156525AFDB610B9D6830A1E9D0A1024
|
||||
try
|
||||
{
|
||||
var res = await this.GetAsync<object>($"LoginApi/CheckLogin?username={userName}&password={password}");
|
||||
//OnRefresh();
|
||||
if (res.code == 200)
|
||||
{
|
||||
GlobalObject.userInfo = JsonConvert.DeserializeObject<loginRes>(res.data.ToString());// as loginRes;
|
||||
GlobalObject.userInfo.userPs = passwordOrigin;
|
||||
return "";
|
||||
}
|
||||
else
|
||||
{
|
||||
return res.info;//ERROR INFO
|
||||
}
|
||||
|
||||
}
|
||||
catch (HttpRequestException EX)
|
||||
{
|
||||
return "http错误。无法连接上服务器。请检查服务器 和 端口。" + EX.Message;
|
||||
}
|
||||
catch (Exception E)
|
||||
{
|
||||
return E.Message;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
using System.Threading.Tasks;
|
||||
using DI_Electrical.Model;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace DI_Electrical.Services
|
||||
{
|
||||
public class ProjectService : HttpService
|
||||
{
|
||||
public ProjectService() : base()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public async Task<PageModel<ec_project>> GetProjects(int pageNo, int pageSize)
|
||||
{
|
||||
|
||||
var res = await this.GetAsync<PageModel<ec_project>>($"ProjectApi/GetProjectSelectPageList?pageNo={pageNo}&pageSize={pageSize}");
|
||||
if (res.code == 200)
|
||||
{
|
||||
return res.data;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 插件端选择项目后,统一、整合加载左侧面板里的数据
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="userName"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<JToken> InitProjInfo(string projectId, string userName)
|
||||
{
|
||||
var res = await this.GetAsync<object>($"ProjectApi/InitProjInfo?ProjId={projectId}&User={userName}");
|
||||
if (res.code == 200)
|
||||
{
|
||||
var o = res.data as JToken;
|
||||
|
||||
return o;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using DI_Electrical.Model;
|
||||
|
||||
namespace DI_Electrical.Services
|
||||
{
|
||||
public class UserService : HttpService
|
||||
{
|
||||
public UserService() : base()
|
||||
{
|
||||
|
||||
}
|
||||
public async Task GetList()
|
||||
{
|
||||
|
||||
var res = await this.GetAsync<List<User>>($"UserApi/GetList");
|
||||
if (res.code == 200)
|
||||
{
|
||||
GlobalObject.Users = res.data;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,170 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using DI_Electrical.Models;
|
||||
|
||||
namespace DI_Electrical.Services
|
||||
{
|
||||
public class WireGroupService : HttpService
|
||||
{
|
||||
#region 辅助类
|
||||
/// <summary>
|
||||
/// SaveSignals 专用
|
||||
/// </summary>
|
||||
public class WireGroups
|
||||
{
|
||||
public string ID { get; set; }
|
||||
public List<ec_Wire_Group> Signals { get; set; }
|
||||
}
|
||||
#endregion
|
||||
public WireGroupService() : base()
|
||||
{
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取所有的信号
|
||||
/// </summary>
|
||||
/// <param name="projId"></param>
|
||||
/// <param name="Assigned"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<ec_Wire_Group>> GetSignals(string projId, bool Assigned)
|
||||
{
|
||||
|
||||
var res = await this.GetAsync<List<ec_Wire_Group>>($"WireGroupApi/GetSignals?projId={projId}&Assigned={Assigned}");
|
||||
if (res.code == 200)
|
||||
{
|
||||
return res.data;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取当前组可用的编码
|
||||
/// </summary>
|
||||
/// <param name="group"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<string> GetNextAvailableSeq(string group)
|
||||
{
|
||||
var res = await this.GetAsync<object>($"WireGroupApi/GetNextAvailableSeq?projId={GlobalObject.curProject?.ProjectId}&group={group}");
|
||||
if (res.code == 200)
|
||||
{
|
||||
return res.info;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 验证是否可以保存
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<string> CanSaveSignals(WireGroups entity ,Models.Action ActionType)
|
||||
{
|
||||
var res = await this.PostBodyAsync<List<ec_Wire_Group>, WireGroups>($"WireGroupApi/CanSaveSignals?projId={GlobalObject.curProject?.ProjectId}&ActionType={ActionType}", entity);
|
||||
if (res.code == 200)
|
||||
{
|
||||
return "OK";
|
||||
}
|
||||
else
|
||||
{
|
||||
return res.info;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<ec_Wire_Group>> SaveSignals(WireGroups entity)
|
||||
{
|
||||
var res = await this.PostBodyAsync<List<ec_Wire_Group>, WireGroups>($"WireGroupApi/SaveSignals?projId={GlobalObject.curProject?.ProjectId}&mode=0", entity);
|
||||
if (res.code == 200)
|
||||
{
|
||||
return res.data;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询信号信息
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<ec_wire_group_notice>> GetNotification()
|
||||
{
|
||||
var res = await this.GetAsync<List<ec_wire_group_notice>>($"WireGroupApi/GetNotification?projId={GlobalObject.curProject?.ProjectId}");
|
||||
if (res.code == 200)
|
||||
{
|
||||
return res.data;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询信号历史
|
||||
/// </summary>
|
||||
/// <param name="projId">项目ID</param>
|
||||
/// <param name="wireGroupIds">信号ID,多个用都逗号隔开</param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<ec_wire_group_propertyhis>> GetSignalPropertyhis(string wireGroupIds)
|
||||
{
|
||||
var res = await this.GetAsync<List<ec_wire_group_propertyhis>>($"WireGroupApi/GetSignalPropertyhis?projId={GlobalObject.curProject?.ProjectId}&wireGroupIds={wireGroupIds}");
|
||||
if (res.code == 200)
|
||||
{
|
||||
return res.data;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询信号日志
|
||||
/// </summary>
|
||||
/// <param name="projId">项目ID</param>
|
||||
/// <param name="wireGroupIds">信号ID,多个用都逗号隔开</param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<ec_wire_group_log>> GetSignalLogs(string wireGroupIds)
|
||||
{
|
||||
var res = await this.GetAsync<List<ec_wire_group_log>>($"WireGroupApi/GetSignalLogs?projId={GlobalObject.curProject?.ProjectId}&wireGroupIds={wireGroupIds}");
|
||||
if (res.code == 200)
|
||||
{
|
||||
return res.data;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 读信号通知
|
||||
/// </summary>
|
||||
/// <param name="NoticeIds"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<ec_wire_group_notice>> ReadNotification(List<string> NoticeIds)
|
||||
{
|
||||
var res = await this.PostBodyAsync<List<ec_wire_group_notice>,List<string>>($"WireGroupApi/ReadNotification?projId={GlobalObject.curProject?.ProjectId}", NoticeIds);
|
||||
if (res.code == 200)
|
||||
{
|
||||
return res.data;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,552 +0,0 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:DI_Electrical.Views.CustomControl"
|
||||
xmlns:po="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
|
||||
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
|
||||
<!-- 系统颜色 -->
|
||||
<SolidColorBrush x:Key="ColorPrimary" Color="#026BE3" />
|
||||
<SolidColorBrush x:Key="ColorSecond" Color="#02ADFF" />
|
||||
<SolidColorBrush x:Key="ColorOther" Color="#DBE0E4" />
|
||||
|
||||
<!-- style放后面,单纯的属性放前面,否则解析顺序不对 -->
|
||||
<!-- modalwindow -->
|
||||
<Style x:Key="CustomWindowStyle" TargetType="Window">
|
||||
<Setter Property="AllowsTransparency" Value="True" />
|
||||
<Setter Property="Background" Value="White" />
|
||||
<Setter Property="ResizeMode" Value="NoResize" />
|
||||
<Setter Property="WindowStyle" Value="None" />
|
||||
</Style>
|
||||
<!-- 系统按钮风格 -->
|
||||
<Style x:Key="sysBtn" TargetType="Button">
|
||||
<Setter Property="Width" Value="65" />
|
||||
<Setter Property="Height" Value="26" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="FontSize" Value="12" />
|
||||
<Setter Property="Foreground" Value="White" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="Background" Value="{StaticResource ColorSecond}" />
|
||||
<Style.Triggers>
|
||||
<!-- 鼠标滑过时的背景颜色和前景颜色 -->
|
||||
<DataTrigger Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="True">
|
||||
<Setter Property="Background" Value="Red" />
|
||||
<!-- 高亮背景色 -->
|
||||
|
||||
<Setter Property="Foreground" Value="Black" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
<Style x:Key="sysBtn2" TargetType="Button">
|
||||
<Setter Property="Width" Value="65" />
|
||||
<Setter Property="Height" Value="26" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="FontSize" Value="12" />
|
||||
<Setter Property="Foreground" Value="Black" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="Background" Value="{StaticResource ColorOther}" />
|
||||
<Style.Triggers>
|
||||
<!-- 鼠标滑过时的背景颜色和前景颜色 -->
|
||||
<DataTrigger Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="True">
|
||||
<Setter Property="Background" Value="Red" />
|
||||
<!-- 高亮背景色 -->
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
<Style x:Key="sysBtn3" TargetType="Button">
|
||||
<Setter Property="Width" Value="120" />
|
||||
<Setter Property="Height" Value="40" />
|
||||
<Setter Property="Margin" Value="5,2,5,2" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="FontSize" Value="13" />
|
||||
<Setter Property="Foreground" Value="Black" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="Background" Value="{StaticResource ColorOther}" />
|
||||
<Style.Triggers>
|
||||
<!-- 鼠标滑过时的背景颜色和前景颜色 -->
|
||||
<DataTrigger Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="True">
|
||||
<Setter Property="Background" Value="{StaticResource ColorOther}" />
|
||||
<!-- 高亮背景色 -->
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
<!-- 系统textblock -->
|
||||
<Style x:Key="sysLabel" TargetType="TextBlock">
|
||||
<Setter Property="Height" Value="20" />
|
||||
<Setter Property="Margin" Value="0,5,0,0" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
|
||||
<!-- 系统textbox -->
|
||||
<Style x:Key="sysTextBox" TargetType="TextBox">
|
||||
<Setter Property="Height" Value="24" />
|
||||
<Setter Property="Margin" Value="5,5,5,0" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
</Style>
|
||||
<Style x:Key="sysTextAreaInfo" TargetType="TextBox">
|
||||
<Setter Property="Height" Value="100" />
|
||||
<Setter Property="Width" Value="300" />
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="AcceptsReturn" Value="True" />
|
||||
<Setter Property="Margin" Value="10,5,10,5" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="VerticalAlignment" Value="Top" />
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Top" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||
</Style>
|
||||
<!-- 全局 RadFilePathPicker 样式 -->
|
||||
<Style x:Key="sysFilePathPicker" TargetType="telerik:RadFilePathPicker">
|
||||
<Setter Property="Height" Value="24" />
|
||||
<Setter Property="Margin" Value="5,0,5,0" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
</Style>
|
||||
|
||||
<!-- 图标按钮 -->
|
||||
<Style TargetType="{x:Type local:IconButton}">
|
||||
<Setter Property="Padding" Value="5" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type local:IconButton}">
|
||||
<Grid>
|
||||
<!-- 背景层 -->
|
||||
<Border
|
||||
x:Name="border"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="3" />
|
||||
|
||||
<DockPanel>
|
||||
|
||||
|
||||
<!-- 图标层 -->
|
||||
<Path
|
||||
x:Name="PART_Icon"
|
||||
Width="{TemplateBinding IconSize}"
|
||||
Height="{TemplateBinding IconSize}"
|
||||
Margin="{TemplateBinding IconMargin}"
|
||||
Data="{TemplateBinding IconData}"
|
||||
DockPanel.Dock="{TemplateBinding IconPlacement}"
|
||||
Fill="{TemplateBinding Foreground}"
|
||||
Stretch="Uniform" />
|
||||
<!-- 内容层 -->
|
||||
<ContentPresenter
|
||||
x:Name="PART_Content"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
RecognizesAccessKey="True" />
|
||||
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
|
||||
<ControlTemplate.Triggers>
|
||||
<!-- 鼠标悬停效果 -->
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="border" Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}" />
|
||||
</Trigger>
|
||||
|
||||
<!-- 按下效果 -->
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="border" Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- 多选搜索 Combox Start -->
|
||||
<ExponentialEase x:Key="ExponentialEaseOut" EasingMode="EaseOut" />
|
||||
<DropShadowEffect
|
||||
x:Key="PopupShadowDepth"
|
||||
BlurRadius="12"
|
||||
Opacity="0.1"
|
||||
ShadowDepth="2"
|
||||
Color="Transparent" />
|
||||
<ControlTemplate x:Key="ComboBoxTextBox" TargetType="{x:Type TextBox}">
|
||||
<Border Background="{TemplateBinding Background}" Focusable="False">
|
||||
<ScrollViewer
|
||||
x:Name="PART_ContentHost"
|
||||
Background="Transparent"
|
||||
Focusable="False"
|
||||
HorizontalScrollBarVisibility="Hidden"
|
||||
VerticalScrollBarVisibility="Hidden" />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
<Color x:Key="PlaceholderTextColor" po:Freeze="True">#C0C4CC</Color>
|
||||
<Geometry x:Key="ChevronDownGeometry" po:Freeze="True">M998 352c0 -8 -4 -17 -10 -23l-50 -50c-6 -6 -14 -10 -23 -10c-8 0 -17 4 -23 10l-393 393l-393 -393c-6 -6 -15 -10 -23 -10s-17 4 -23 10l-50 50c-6 6 -10 15 -10 23s4 17 10 23l466 466c6 6 15 10 23 10s17 -4 23 -10l466 -466c6 -6 10 -15 10 -23z</Geometry>
|
||||
|
||||
<ControlTemplate x:Key="ComboBoxToggleButton1" TargetType="{x:Type ToggleButton}">
|
||||
<Border
|
||||
x:Name="PART_Border"
|
||||
Padding="6,1.2"
|
||||
BorderThickness="0"
|
||||
SnapsToDevicePixels="true">
|
||||
<Grid Background="Transparent">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="30" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Rectangle
|
||||
Grid.Column="1"
|
||||
Width="30"
|
||||
Height="Auto"
|
||||
Margin="0,1"
|
||||
Fill="{TemplateBinding Background}" />
|
||||
<Path
|
||||
x:Name="PART_Arrow"
|
||||
Grid.Column="1"
|
||||
Width="10"
|
||||
Height="6"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Data="{StaticResource ChevronDownGeometry}"
|
||||
RenderTransformOrigin=".5,.5"
|
||||
Stretch="Fill">
|
||||
<Path.Fill>
|
||||
<SolidColorBrush Color="{DynamicResource PlaceholderTextColor}" />
|
||||
</Path.Fill>
|
||||
<Path.RenderTransform>
|
||||
<RotateTransform Angle="0" />
|
||||
</Path.RenderTransform>
|
||||
</Path>
|
||||
</Grid>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="MouseOver" />
|
||||
<VisualState x:Name="Pressed" />
|
||||
<VisualState x:Name="Disabled" />
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="CheckStates">
|
||||
<VisualState x:Name="Checked">
|
||||
<Storyboard>
|
||||
<DoubleAnimation
|
||||
EasingFunction="{StaticResource ExponentialEaseOut}"
|
||||
Storyboard.TargetName="PART_Arrow"
|
||||
Storyboard.TargetProperty="(Path.RenderTransform).(RotateTransform.Angle)"
|
||||
To="-180"
|
||||
Duration="00:00:.3" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Unchecked">
|
||||
<Storyboard>
|
||||
<DoubleAnimation
|
||||
EasingFunction="{StaticResource ExponentialEaseOut}"
|
||||
Storyboard.TargetName="PART_Arrow"
|
||||
Storyboard.TargetProperty="(Path.RenderTransform).(RotateTransform.Angle)"
|
||||
To="0"
|
||||
Duration="00:00:.3" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Indeterminate" />
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
<Style x:Key="DefaultListBox" TargetType="{x:Type ListBox}">
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
|
||||
<Setter Property="ScrollViewer.CanContentScroll" Value="True" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ListBox}">
|
||||
<Border
|
||||
x:Name="Border"
|
||||
Margin="{TemplateBinding Margin}"
|
||||
Padding="0,0,0,.1"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{Binding Path=(local:ElementHelper.CornerRadius), RelativeSource={RelativeSource TemplatedParent}}"
|
||||
SnapsToDevicePixels="True">
|
||||
<ScrollViewer Clip="{Binding RelativeSource={RelativeSource AncestorType=local:WDBorder}, Path=ContentClip}" Focusable="False">
|
||||
<VirtualizingStackPanel IsItemsHost="True" />
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsGrouping" Value="True">
|
||||
<Setter Property="ScrollViewer.CanContentScroll" Value="False" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style x:Key="DefaultMultiSelectComboBoxItem" TargetType="{x:Type local:MultiSelectComboBoxItem}">
|
||||
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
|
||||
<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
|
||||
<Setter Property="SnapsToDevicePixels" Value="True" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource RegularTextSolidColorBrush}" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="Height" Value="34" />
|
||||
<Setter Property="Margin" Value="1,0" />
|
||||
<Setter Property="Padding" Value="6,0" />
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type local:MultiSelectComboBoxItem}">
|
||||
|
||||
<Border
|
||||
x:Name="PART_Border"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
SnapsToDevicePixels="true">
|
||||
<CheckBox
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
IsChecked="{Binding IsSelected, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}">
|
||||
|
||||
<ContentPresenter
|
||||
x:Name="PART_ContentPresenter"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||
TextElement.Foreground="{TemplateBinding Foreground}" />
|
||||
</CheckBox>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="{DynamicResource DefaultBackgroundSolidColorBrush}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
|
||||
<Style TargetType="{x:Type local:MultiSelectSearchComboBox}">
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
|
||||
<Setter Property="ScrollViewer.CanContentScroll" Value="True" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource BaseSolidColorBrush}" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="Background" Value="{DynamicResource BackgroundSolidColorBrush}" />
|
||||
<Setter Property="Padding" Value="14.5,3,30,3" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type local:MultiSelectSearchComboBox}">
|
||||
<ControlTemplate.Resources>
|
||||
<Storyboard x:Key="OpenStoryboard">
|
||||
<DoubleAnimation
|
||||
EasingFunction="{StaticResource ExponentialEaseOut}"
|
||||
Storyboard.TargetName="PART_DropDown"
|
||||
Storyboard.TargetProperty="(Grid.RenderTransform).(ScaleTransform.ScaleY)"
|
||||
To="1"
|
||||
Duration="00:00:.2" />
|
||||
</Storyboard>
|
||||
<Storyboard x:Key="CloseStoryboard">
|
||||
<DoubleAnimation
|
||||
EasingFunction="{StaticResource ExponentialEaseOut}"
|
||||
Storyboard.TargetName="PART_DropDown"
|
||||
Storyboard.TargetProperty="(Grid.RenderTransform).(ScaleTransform.ScaleY)"
|
||||
To="0"
|
||||
Duration="00:00:.2" />
|
||||
</Storyboard>
|
||||
</ControlTemplate.Resources>
|
||||
<Border
|
||||
Name="PART_Border"
|
||||
Width="{TemplateBinding Width}"
|
||||
Height="{TemplateBinding Height}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{Binding Path=(local:ElementHelper.CornerRadius), RelativeSource={RelativeSource TemplatedParent}}"
|
||||
SnapsToDevicePixels="True">
|
||||
<Grid Grid.IsSharedSizeScope="true">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="ComboBoxButton" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox
|
||||
Name="PART_EditableTextBox"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Panel.ZIndex="1"
|
||||
Background="Transparent"
|
||||
Focusable="True"
|
||||
Foreground="{DynamicResource PrimaryTextSolidColorBrush}"
|
||||
IsReadOnly="True"
|
||||
SelectionBrush="{DynamicResource WindowBorderBrushSolidColorBrush}"
|
||||
Style="{x:Null}"
|
||||
Template="{StaticResource ComboBoxTextBox}"
|
||||
Text="{Binding Text, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}" />
|
||||
<TextBlock
|
||||
x:Name="PART_Watermark"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Background="Transparent"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
Foreground="{DynamicResource RegularTextSolidColorBrush}"
|
||||
IsHitTestVisible="False"
|
||||
Text="{Binding Path=(local:ElementHelper.Watermark), RelativeSource={RelativeSource TemplatedParent}}"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
Visibility="Collapsed" />
|
||||
<ToggleButton
|
||||
x:Name="PART_ToggleButton"
|
||||
Grid.ColumnSpan="2"
|
||||
Panel.ZIndex="2"
|
||||
Background="{TemplateBinding Background}"
|
||||
ClickMode="Release"
|
||||
Focusable="False"
|
||||
IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Style="{x:Null}"
|
||||
Template="{StaticResource ComboBoxToggleButton1}" />
|
||||
<Popup
|
||||
x:Name="PART_Popup"
|
||||
AllowsTransparency="True"
|
||||
IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
|
||||
Placement="Bottom"
|
||||
PlacementTarget="{Binding ElementName=PART_Border}"
|
||||
StaysOpen="False">
|
||||
<local:SmallPanel
|
||||
x:Name="PART_DropDown"
|
||||
MinWidth="{TemplateBinding FrameworkElement.ActualWidth}"
|
||||
MaxHeight="{TemplateBinding MaxDropDownHeight}"
|
||||
Margin="24,2,24,24"
|
||||
RenderTransformOrigin=".5,0"
|
||||
SnapsToDevicePixels="True">
|
||||
<local:SmallPanel.RenderTransform>
|
||||
<ScaleTransform ScaleY="0" />
|
||||
</local:SmallPanel.RenderTransform>
|
||||
<Border
|
||||
Name="PART_DropDownBorder"
|
||||
Background="White"
|
||||
BorderBrush="Blue"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{Binding Path=(local:ElementHelper.CornerRadius), RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Effect="{StaticResource PopupShadowDepth}"
|
||||
SnapsToDevicePixels="True"
|
||||
UseLayoutRounding="True" />
|
||||
<Grid Margin="0,8" ClipToBounds="False">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBox
|
||||
x:Name="PART_TextBox"
|
||||
Height="{Binding ElementName=PART_EditableTextBox, Path=Height}"
|
||||
Margin="6,0"
|
||||
local:ElementHelper.CornerRadius="{Binding Path=(local:ElementHelper.CornerRadius), RelativeSource={RelativeSource TemplatedParent}}"
|
||||
local:ElementHelper.IsClear="True"
|
||||
local:ElementHelper.Watermark="{Binding SearchWatermark, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
|
||||
FontSize="{Binding ElementName=PART_EditableTextBox, Path=FontSize}" />
|
||||
<CheckBox
|
||||
x:Name="PART_SelectAll"
|
||||
Grid.Row="1"
|
||||
Margin="4"
|
||||
local:ElementHelper.CornerRadius="{Binding Path=(local:ElementHelper.CornerRadius), RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Content="{TemplateBinding SelectAllContent}"
|
||||
Visibility="{TemplateBinding IsSelectAllActive}" />
|
||||
<local:MultiSelectListBox
|
||||
x:Name="PART_Selector"
|
||||
Grid.Row="2"
|
||||
Margin="1,0"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
local:ElementHelper.CornerRadius="{Binding Path=(local:ElementHelper.CornerRadius), RelativeSource={RelativeSource TemplatedParent}}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="0"
|
||||
DisplayMemberPath="{TemplateBinding DisplayMemberPath}"
|
||||
ItemContainerStyle="{StaticResource DefaultMultiSelectComboBoxItem}"
|
||||
ItemsSource="{TemplateBinding ItemsSource}"
|
||||
ScrollViewer.CanContentScroll="{Binding ScrollViewer.CanContentScroll, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="{Binding ScrollViewer.HorizontalScrollBarVisibility, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
SelectedValuePath="{TemplateBinding SelectedValuePath}"
|
||||
SelectionMode="Multiple"
|
||||
Style="{StaticResource DefaultListBox}" />
|
||||
<local:MultiSelectListBox
|
||||
x:Name="PART_SearchSelector"
|
||||
Grid.Row="2"
|
||||
Margin="1,0"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
local:ElementHelper.CornerRadius="{Binding Path=(local:ElementHelper.CornerRadius), RelativeSource={RelativeSource TemplatedParent}}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="0"
|
||||
DisplayMemberPath="{TemplateBinding DisplayMemberPath}"
|
||||
ItemContainerStyle="{StaticResource DefaultMultiSelectComboBoxItem}"
|
||||
ItemsSource="{TemplateBinding ItemsSourceSearch}"
|
||||
ScrollViewer.CanContentScroll="{Binding ScrollViewer.CanContentScroll, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="{Binding ScrollViewer.HorizontalScrollBarVisibility, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
SelectedValuePath="{TemplateBinding SelectedValuePath}"
|
||||
SelectionMode="Multiple"
|
||||
Style="{StaticResource DefaultListBox}"
|
||||
Visibility="Collapsed" />
|
||||
</Grid>
|
||||
</local:SmallPanel>
|
||||
</Popup>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger SourceName="PART_ToggleButton" Property="IsChecked" Value="True">
|
||||
<Trigger.EnterActions>
|
||||
<BeginStoryboard x:Name="BeginStoryboardOpenStoryboard" Storyboard="{StaticResource OpenStoryboard}" />
|
||||
</Trigger.EnterActions>
|
||||
<Trigger.ExitActions>
|
||||
<StopStoryboard BeginStoryboardName="BeginStoryboardOpenStoryboard" />
|
||||
</Trigger.ExitActions>
|
||||
</Trigger>
|
||||
<Trigger SourceName="PART_ToggleButton" Property="IsChecked" Value="False">
|
||||
<Trigger.EnterActions>
|
||||
<BeginStoryboard x:Name="BeginStoryboardCloseStoryboard" Storyboard="{StaticResource CloseStoryboard}" />
|
||||
</Trigger.EnterActions>
|
||||
<Trigger.ExitActions>
|
||||
<StopStoryboard BeginStoryboardName="BeginStoryboardCloseStoryboard" />
|
||||
</Trigger.ExitActions>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="PART_Border" Property="BorderBrush" Value="{DynamicResource PrimaryNormalSolidColorBrush}" />
|
||||
</Trigger>
|
||||
<Trigger SourceName="PART_Popup" Property="AllowsTransparency" Value="True">
|
||||
<Setter TargetName="PART_DropDownBorder" Property="Margin" Value="0,2,0,0" />
|
||||
</Trigger>
|
||||
<Trigger Property="Text" Value="">
|
||||
<Setter TargetName="PART_Watermark" Property="Visibility" Value="Visible" />
|
||||
</Trigger>
|
||||
<Trigger Property="Text" Value="{x:Null}">
|
||||
<Setter TargetName="PART_Watermark" Property="Visibility" Value="Visible" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsSelectAllActive" Value="False">
|
||||
<Setter TargetName="PART_TextBox" Property="Margin" Value="6,2" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<!-- 多选搜索 Combox End -->
|
||||
</ResourceDictionary>
|
@ -1,82 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace DI_Electrical.Style
|
||||
{
|
||||
internal class ConditionalStyleSelector:StyleSelector
|
||||
{
|
||||
public override System.Windows.Style SelectStyle(object item, System.Windows.DependencyObject container)
|
||||
{
|
||||
//获取到转换器返回的值
|
||||
object conditionValue = this.ConditionConverter.Convert(item, null, null, null);
|
||||
foreach (ConditionalStyleRule rule in this.Rules)
|
||||
{
|
||||
//值相同则返回当前样式
|
||||
if (Equals(rule.Value, conditionValue))
|
||||
{
|
||||
return rule.Style;
|
||||
}
|
||||
}
|
||||
|
||||
return base.SelectStyle(item, container);
|
||||
}
|
||||
|
||||
List<ConditionalStyleRule> _Rules;
|
||||
public List<ConditionalStyleRule> Rules
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._Rules == null)
|
||||
{
|
||||
this._Rules = new List<ConditionalStyleRule>();
|
||||
}
|
||||
|
||||
return this._Rules;
|
||||
}
|
||||
}
|
||||
|
||||
IValueConverter _ConditionConverter;
|
||||
public IValueConverter ConditionConverter
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._ConditionConverter;
|
||||
}
|
||||
set
|
||||
{
|
||||
this._ConditionConverter = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ConditionalStyleRule
|
||||
{
|
||||
object _Value;
|
||||
public object Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Value;
|
||||
}
|
||||
set
|
||||
{
|
||||
this._Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
System.Windows.Style _Style;
|
||||
public System.Windows.Style Style
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Style;
|
||||
}
|
||||
set
|
||||
{
|
||||
this._Style = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using DI_Electrical.ViewModels;
|
||||
|
||||
namespace DI_Electrical.Style
|
||||
{
|
||||
internal class SignalNoticeStyleSelector:StyleSelector
|
||||
{
|
||||
public override System.Windows.Style SelectStyle(object item, DependencyObject container)
|
||||
{
|
||||
SignalNotice conditionValue = item as SignalNotice;
|
||||
string value = conditionValue.CheckFLG.ToString();
|
||||
foreach (ConditionalStyleRule rule in this.Rules)
|
||||
{
|
||||
//值相同则返回当前样式
|
||||
if (Equals(rule.Value, value))
|
||||
{
|
||||
return rule.Style;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return base.SelectStyle(item, container);
|
||||
}
|
||||
|
||||
List<ConditionalStyleRule> _Rules;
|
||||
public List<ConditionalStyleRule> Rules
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._Rules == null)
|
||||
{
|
||||
this._Rules = new List<ConditionalStyleRule>();
|
||||
}
|
||||
|
||||
return this._Rules;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
using System.Windows;
|
||||
using DI_Electrical.Helper;
|
||||
using DI_Electrical.Services;
|
||||
using SWS.Commons;
|
||||
using SWS.Service;
|
||||
|
||||
namespace DI_Electrical.ViewModels
|
||||
{
|
||||
|
@ -1,17 +1,12 @@
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using DI_Electrical.Helper;
|
||||
using DI_Electrical.Model;
|
||||
using DI_Electrical.Services;
|
||||
using DI_Electrical.Views;
|
||||
using Prism.Events;
|
||||
using Prism.Ioc;
|
||||
using Prism.Mvvm;
|
||||
using Prism.Services.Dialogs;
|
||||
using SWS.Commons;
|
||||
using SWS.Model;
|
||||
using SWS.Service;
|
||||
using Telerik.Windows.Controls;
|
||||
using Unity;
|
||||
using DialogParameters = Prism.Services.Dialogs.DialogParameters;
|
||||
|
||||
namespace DI_Electrical.ViewModels
|
||||
{
|
||||
@ -121,7 +116,7 @@ namespace DI_Electrical.ViewModels
|
||||
else
|
||||
{
|
||||
IsBusy = true; BusyContent = "登录中...";
|
||||
var res = await _Service.Login(UserName, Userpass);
|
||||
var res = await _Service.Login(UserName, Userpass);
|
||||
IsBusy = false;
|
||||
if (string.IsNullOrEmpty(res))
|
||||
{
|
||||
|
@ -1,16 +1,12 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using DI_Electrical.Event;
|
||||
using DI_Electrical.Views.Dialog;
|
||||
using DI_Electrical.Views.Dialog.DialogSignalManagements;
|
||||
using DryIoc;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Prism.Events;
|
||||
using Prism.Ioc;
|
||||
using Prism.Mvvm;
|
||||
using Prism.Services.Dialogs;
|
||||
using SWS.Commons;
|
||||
using SWS.WPF.Views;
|
||||
using Telerik.Windows.Controls;
|
||||
using DialogParameters = Prism.Services.Dialogs.DialogParameters;
|
||||
|
||||
namespace DI_Electrical.ViewModels
|
||||
{
|
||||
@ -54,7 +50,7 @@ namespace DI_Electrical.ViewModels
|
||||
}
|
||||
public void onShowDialogTest(object o)
|
||||
{
|
||||
IDialogParameters par = new DialogParameters();
|
||||
IDialogParameters par = new Prism.Services.Dialogs.DialogParameters();
|
||||
par.Add(GlobalObject.dialogPar.para1.ToString(), "abc你我他");
|
||||
_dialogService.ShowDialog(nameof(DialogTest), par, (result) =>
|
||||
{
|
||||
@ -72,7 +68,7 @@ namespace DI_Electrical.ViewModels
|
||||
}
|
||||
public void onShowDialogSignalManagement(object o)
|
||||
{
|
||||
IDialogParameters par = new DialogParameters();
|
||||
IDialogParameters par = new Prism.Services.Dialogs.DialogParameters();
|
||||
_dialogService.ShowDialog(nameof(DialogSignalManagement), par, (result) =>
|
||||
{
|
||||
var res = result.Parameters.GetValue<string>(GlobalObject.dialogPar.para1.ToString());
|
||||
|
@ -1,11 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
using DI_Electrical.Event;
|
||||
using DI_Electrical.Helper;
|
||||
using DI_Electrical.Model;
|
||||
using DI_Electrical.Services;
|
||||
using Prism.Events;
|
||||
using Prism.Ioc;
|
||||
using SWS.Commons;
|
||||
using SWS.Model;
|
||||
using SWS.Service;
|
||||
using Unity;
|
||||
|
||||
namespace DI_Electrical.ViewModels
|
||||
{
|
||||
@ -32,12 +33,13 @@ namespace DI_Electrical.ViewModels
|
||||
ProjectService _Service;
|
||||
ConfigService _configService;
|
||||
IEventAggregator _eventAggregator;
|
||||
public ProjectViewModel(IContainerProvider container) : base()
|
||||
public ProjectViewModel() : base()
|
||||
{
|
||||
title = "项目选择";
|
||||
_Service = container.Resolve<ProjectService>();
|
||||
_configService = container.Resolve<ConfigService>();
|
||||
_eventAggregator= container.Resolve<IEventAggregator>();
|
||||
|
||||
_Service = GlobalObject.container.Resolve<ProjectService>();
|
||||
_configService = GlobalObject.container.Resolve<ConfigService>();
|
||||
_eventAggregator= GlobalObject.container.Resolve<IEventAggregator>();
|
||||
}
|
||||
public async override void onWindow_loaded(object para)
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
using DI_Electrical.Models;
|
||||
using SWS.Model;
|
||||
|
||||
namespace DI_Electrical.Views.CustomControl
|
||||
{
|
||||
|
@ -5,7 +5,7 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:local="clr-namespace:DI_Electrical.Views"
|
||||
xmlns:local2="clr-namespace:DI_Electrical.Helper"
|
||||
xmlns:local2="clr-namespace:SWS.Commons;assembly=SWS.Commons"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
|
||||
Width="300"
|
||||
|
@ -1,14 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="DryIoc.dll" version="5.4.3" targetFramework="net48" />
|
||||
<package id="DryIoc.dll" version="4.7.7" targetFramework="net48" />
|
||||
<package id="log4net" version="3.1.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Bcl.AsyncInterfaces" version="8.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="8.0.1" targetFramework="net48" />
|
||||
<package id="Microsoft.Xaml.Behaviors.Wpf" version="1.1.122" targetFramework="net48" />
|
||||
<package id="Prism.Container.Abstractions" version="9.0.107" targetFramework="net48" />
|
||||
<package id="Prism.Container.DryIoc" version="9.0.107" targetFramework="net48" />
|
||||
<package id="Prism.Container.Unity" version="9.0.106" targetFramework="net48" />
|
||||
<package id="Prism.Core" version="8.1.97" targetFramework="net48" />
|
||||
<package id="Prism.DryIoc" version="8.1.97" targetFramework="net48" />
|
||||
<package id="Prism.Unity" version="8.1.97" targetFramework="net48" />
|
||||
<package id="Prism.Wpf" version="8.1.97" targetFramework="net48" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.3" targetFramework="net48" />
|
||||
|
@ -3,8 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.7.34221.43
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SWS.CAD", "SWS.CAD\SWS.CAD.csproj", "{6BD9B3FC-7D55-4762-AF68-A50183342537}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CAD.Extend", "CAD.Extend\CAD.Extend.csproj", "{8740B023-B585-4E69-8521-4F62FA754A1B}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SWS.Model", "SWS.Model\SWS.Model.csproj", "{1995385B-D1B0-4C55-835E-D3E769972A6A}"
|
||||
@ -27,6 +25,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DI-Electrical", "DI-Electri
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SWS.WPF", "SWS.WPF\SWS.WPF.csproj", "{7AFF9117-78E7-4395-9F23-6DCFE09F9299}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SWS.CAD", "SWS.CAD\SWS.CAD.csproj", "{6BD9B3FC-7D55-4762-AF68-A50183342537}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@ -39,22 +39,6 @@ Global
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Debug|ARM64.ActiveCfg = Debug|Any CPU
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Debug|ARM64.Build.0 = Debug|Any CPU
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Debug|x64.Build.0 = Debug|x64
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Debug|x86.Build.0 = Debug|x86
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Release|x64.ActiveCfg = Release|x64
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Release|x64.Build.0 = Release|x64
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Release|x86.ActiveCfg = Release|x86
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Release|x86.Build.0 = Release|x86
|
||||
{8740B023-B585-4E69-8521-4F62FA754A1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8740B023-B585-4E69-8521-4F62FA754A1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8740B023-B585-4E69-8521-4F62FA754A1B}.Debug|ARM64.ActiveCfg = Debug|Any CPU
|
||||
@ -215,15 +199,31 @@ Global
|
||||
{7AFF9117-78E7-4395-9F23-6DCFE09F9299}.Release|x64.Build.0 = Release|Any CPU
|
||||
{7AFF9117-78E7-4395-9F23-6DCFE09F9299}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{7AFF9117-78E7-4395-9F23-6DCFE09F9299}.Release|x86.Build.0 = Release|Any CPU
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Debug|ARM64.ActiveCfg = Debug|Any CPU
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Debug|ARM64.Build.0 = Debug|Any CPU
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Release|ARM64.ActiveCfg = Release|Any CPU
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Release|ARM64.Build.0 = Release|Any CPU
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Release|x64.Build.0 = Release|Any CPU
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537} = {00C64D96-E9F1-4525-A542-C7D23206B2E4}
|
||||
{8740B023-B585-4E69-8521-4F62FA754A1B} = {00C64D96-E9F1-4525-A542-C7D23206B2E4}
|
||||
{A399B5A6-0E27-417B-BF2A-6B1FF89EB6A0} = {00C64D96-E9F1-4525-A542-C7D23206B2E4}
|
||||
{924A2824-BE62-42A7-81A8-49BEFCB3801F} = {00C64D96-E9F1-4525-A542-C7D23206B2E4}
|
||||
{6BD9B3FC-7D55-4762-AF68-A50183342537} = {00C64D96-E9F1-4525-A542-C7D23206B2E4}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {819AA00B-0A09-49DD-AC3A-2AC6041E0524}
|
||||
|
@ -1,4 +1,5 @@
|
||||
using Bricscad.ApplicationServices;
|
||||
using SWS.Commons;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
@ -2,34 +2,28 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Interop;
|
||||
using System.Windows.Threading;
|
||||
using Aspose.Cells.Charts;
|
||||
using Bricscad.ApplicationServices;
|
||||
using Bricscad.EditorInput;
|
||||
using Bricscad.Ribbon;
|
||||
using Bricscad.Windows;
|
||||
using Prism.Dialogs;
|
||||
using Prism.Events;
|
||||
using Prism.Ioc;
|
||||
using Prism.Services.Dialogs;
|
||||
using SWS.CAD;
|
||||
using SWS.CAD.CADFunc;
|
||||
using SWS.CAD.Event;
|
||||
using SWS.CAD.Models;
|
||||
using SWS.CAD.Services;
|
||||
using SWS.CAD.Views;
|
||||
using SWS.CAD.Views.CustomControl;
|
||||
using SWS.CAD.Views.Dialog;
|
||||
using SWS.CAD.Views.SignalManagementViews;
|
||||
using Teigha.DatabaseServices;
|
||||
using Teigha.Runtime;
|
||||
using Telerik.Windows.Controls;
|
||||
using Unity;
|
||||
using Application = Bricscad.ApplicationServices.Application;
|
||||
using Panel = Bricscad.Windows.Panel;
|
||||
using GlobalObject = SWS.Commons.GlobalObject;
|
||||
using SWS.Model;
|
||||
using SWS.Service;
|
||||
|
||||
|
||||
[assembly: CommandClass(typeof(Commands))]
|
||||
@ -56,7 +50,7 @@ namespace SWS.CAD
|
||||
var drawingView = GlobalObject.container.Resolve<LeftPanel>();
|
||||
Panel panel = new Panel(nameof(LeftPanel), dockTemplate, drawingView);
|
||||
panel.Title = "DI_左面板";
|
||||
panel.Icon = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.CSharp.ico");
|
||||
panel.Icon = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"CSharp.ico");
|
||||
panel.Visible = true;
|
||||
|
||||
AddTab();
|
||||
@ -69,7 +63,7 @@ namespace SWS.CAD
|
||||
var drawingView2 = GlobalObject.container.Resolve<RightPanel>();
|
||||
panel = new Panel(nameof(RightPanel), dockTemplate2, drawingView2);
|
||||
panel.Title = "DI_右面板";
|
||||
panel.Icon = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.CSharp.ico");
|
||||
panel.Icon = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"CSharp.ico");
|
||||
panel.Visible = true;
|
||||
|
||||
}
|
||||
@ -116,7 +110,7 @@ namespace SWS.CAD
|
||||
|
||||
ObservableCollection<propertyModel> ReslistPro = new ObservableCollection<propertyModel>();
|
||||
//打开窗体
|
||||
Prism.Dialogs.DialogParameters para = new Prism.Dialogs.DialogParameters();
|
||||
var para = new Prism.Services.Dialogs.DialogParameters();
|
||||
para.Add(GlobalObject.dialogPar.title.ToString(), title);
|
||||
para.Add(GlobalObject.dialogPar.para1.ToString(), listPropertys);
|
||||
var _dialogService = GlobalObject._prismContainer.Resolve<IDialogService>();
|
||||
@ -167,7 +161,7 @@ namespace SWS.CAD
|
||||
}
|
||||
|
||||
});
|
||||
project.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.OpenProject.png");
|
||||
project.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"OpenProject.png");
|
||||
project.Id = "选择项目";
|
||||
userSource.Items.Add(project);
|
||||
#endregion
|
||||
@ -180,7 +174,7 @@ namespace SWS.CAD
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
});
|
||||
btnRefresh.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.RefreshProject.png");
|
||||
btnRefresh.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"RefreshProject.png");
|
||||
btnRefresh.Id = "刷新项目";
|
||||
userSource.Items.Add(btnRefresh);
|
||||
#endregion
|
||||
@ -200,7 +194,7 @@ namespace SWS.CAD
|
||||
//Application.ShowModalDialog(Application.MainWindow,);// 用来显示WinForms对话框
|
||||
Application.ShowModalWindow(Application.MainWindow.Handle, loginView);//用来显示WPF的对话框,任务栏里可以看到2个Windows
|
||||
});
|
||||
login.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.Login.png");
|
||||
login.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"Login.png");
|
||||
login.Id = "用户登录";
|
||||
//userSource.Items.Add(login);
|
||||
ribbonRowPanel.Items.Add(login);
|
||||
@ -215,7 +209,7 @@ namespace SWS.CAD
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
});
|
||||
btnProperty.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.Message.png");
|
||||
btnProperty.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"Message.png");
|
||||
btnProperty.Id = "属性窗口";
|
||||
ribbonRowPanel.Items.Add(btnProperty);
|
||||
ribbonRowPanel.Items.Add(new RibbonRowBreak());//换行,这样可以使按钮多行排列
|
||||
@ -236,7 +230,7 @@ namespace SWS.CAD
|
||||
{
|
||||
var View = GlobalObject.container.Resolve<UserNotification>();
|
||||
var eventAggregator = GlobalObject.container.Resolve<IEventAggregator>();
|
||||
eventAggregator.GetEvent<SelectProjectEvent>().Publish(new System.Collections.Generic.List<Models.ec_notification>());
|
||||
eventAggregator.GetEvent<SelectProjectEvent>().Publish(new List<SWS.Model.ec_notification>());
|
||||
Application.ShowModalWindow(Application.MainWindow.Handle, View);
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
@ -245,7 +239,7 @@ namespace SWS.CAD
|
||||
}
|
||||
|
||||
});
|
||||
UserNotification.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.Message.png");
|
||||
UserNotification.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"Message.png");
|
||||
UserNotification.Id = "项目消息";
|
||||
//userSource.Items.Add(UserNotification);
|
||||
ribbonRowPanel.Items.Add(UserNotification);
|
||||
@ -273,7 +267,7 @@ namespace SWS.CAD
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
});
|
||||
btnCableDrop.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.CalCable.png");
|
||||
btnCableDrop.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"CalCable.png");
|
||||
btnCableDrop.Id = "电缆压降";
|
||||
ribbonRowPanel.Items.Add(btnCableDrop);
|
||||
ribbonRowPanel.Items.Add(new RibbonRowBreak());//换行,这样可以使按钮多行排列
|
||||
@ -287,7 +281,7 @@ namespace SWS.CAD
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
});
|
||||
btnCalBoot.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.CalBoot.png");
|
||||
btnCalBoot.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"CalBoot.png");
|
||||
btnCalBoot.Id = "启动顺序";
|
||||
ribbonRowPanel.Items.Add(btnCalBoot);
|
||||
#endregion
|
||||
@ -311,7 +305,7 @@ namespace SWS.CAD
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
});
|
||||
btnLightLine.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.lightLine.png");
|
||||
btnLightLine.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"lightLine.png");
|
||||
btnLightLine.Id = "绘照明线路";
|
||||
designSource.Items.Add(btnLightLine);
|
||||
#endregion
|
||||
@ -326,7 +320,7 @@ namespace SWS.CAD
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
});
|
||||
btnEquipmentjoin.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.Equipmentjoin.png");
|
||||
btnEquipmentjoin.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"Equipmentjoin.png");
|
||||
btnEquipmentjoin.Id = "生成端子图";
|
||||
ribbonRowPanel.Items.Add(btnEquipmentjoin);
|
||||
ribbonRowPanel.Items.Add(new RibbonRowBreak());//换行,这样可以使按钮多行排列
|
||||
@ -340,7 +334,7 @@ namespace SWS.CAD
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
});
|
||||
btnJoinSys.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.joinsys.png");
|
||||
btnJoinSys.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"joinsys.png");
|
||||
btnJoinSys.Id = "生成系统图";
|
||||
ribbonRowPanel.Items.Add(btnJoinSys);
|
||||
ribbonRowPanel.Items.Add(new RibbonRowBreak());//换行,这样可以使按钮多行排列
|
||||
@ -354,7 +348,7 @@ namespace SWS.CAD
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
});
|
||||
btnOPC.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.OPC.png");
|
||||
btnOPC.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"OPC.png");
|
||||
btnOPC.Id = "生成OPC";
|
||||
ribbonRowPanel.Items.Add(btnOPC);
|
||||
#endregion
|
||||
@ -370,7 +364,7 @@ namespace SWS.CAD
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
});
|
||||
btnPlaneLayout.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.PlaneLayout.png");
|
||||
btnPlaneLayout.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"PlaneLayout.png");
|
||||
btnPlaneLayout.Id = "生成布置图";
|
||||
ribbonRowPanel.Items.Add(btnPlaneLayout);
|
||||
ribbonRowPanel.Items.Add(new RibbonRowBreak());//换行,这样可以使按钮多行排列
|
||||
@ -384,7 +378,7 @@ namespace SWS.CAD
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
});
|
||||
btnEquipmentSys.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.EquipmentSys.png");
|
||||
btnEquipmentSys.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"EquipmentSys.png");
|
||||
btnEquipmentSys.Id = "生成链路系统图";
|
||||
ribbonRowPanel.Items.Add(btnEquipmentSys);
|
||||
ribbonRowPanel.Items.Add(new RibbonRowBreak());//换行,这样可以使按钮多行排列
|
||||
@ -398,7 +392,7 @@ namespace SWS.CAD
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
});
|
||||
btnBatchSwitch.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.BatchSwitch.png");
|
||||
btnBatchSwitch.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"BatchSwitch.png");
|
||||
btnBatchSwitch.Id = "照明回路开关";
|
||||
ribbonRowPanel.Items.Add(btnBatchSwitch);
|
||||
#endregion
|
||||
@ -423,7 +417,7 @@ namespace SWS.CAD
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
});
|
||||
btnSwitchbox.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.Switchbox.png");
|
||||
btnSwitchbox.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"Switchbox.png");
|
||||
btnSwitchbox.Id = "分电箱";
|
||||
dataSource.Items.Add(btnSwitchbox);
|
||||
#endregion
|
||||
@ -501,7 +495,7 @@ namespace SWS.CAD
|
||||
};
|
||||
|
||||
//打开窗体
|
||||
Prism.Dialogs.DialogParameters para = new Prism.Dialogs.DialogParameters();
|
||||
var para = new Prism.Services.Dialogs.DialogParameters();
|
||||
para.Add(GlobalObject.dialogPar.info.ToString(), res[0]);
|
||||
para.Add(GlobalObject.dialogPar.para1.ToString(), model1);
|
||||
para.Add(GlobalObject.dialogPar.para2.ToString(), model2);
|
||||
@ -517,7 +511,7 @@ namespace SWS.CAD
|
||||
});
|
||||
#endregion
|
||||
});
|
||||
btnParallel.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.Parallel.png");
|
||||
btnParallel.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"Parallel.png");
|
||||
btnParallel.Id = "平行电缆";
|
||||
ribbonRowPanel.Items.Add(btnParallel);
|
||||
ribbonRowPanel.Items.Add(new RibbonRowBreak());//换行,这样可以使按钮多行排列
|
||||
@ -544,7 +538,7 @@ namespace SWS.CAD
|
||||
Database db = doc.Database;
|
||||
Editor ed = doc.Editor;
|
||||
//选择的元素返回的属性信息
|
||||
var ResTagInfosByPixels = new ec_objecttype();
|
||||
var ResTagInfosByPixels = new Model.ec_objecttype();
|
||||
var listPropertys = new List<propertyModel>();
|
||||
// 持续选择直到获取有效电缆
|
||||
bool isValidCable = false;
|
||||
@ -759,7 +753,7 @@ namespace SWS.CAD
|
||||
|
||||
IntPtr cadHandle = Bricscad.ApplicationServices.Application.MainWindow.Handle;
|
||||
//打开窗体
|
||||
Prism.Dialogs.DialogParameters para = new Prism.Dialogs.DialogParameters();
|
||||
var para = new Prism.Services.Dialogs.DialogParameters();
|
||||
//para.Add(GlobalObject.dialogPar.para1.ToString(), "6e2919e4-28cd-4fb6-9035-10b2ff0e30fb");
|
||||
para.Add(GlobalObject.dialogPar.info.ToString(), cadHandle);
|
||||
|
||||
@ -788,7 +782,7 @@ namespace SWS.CAD
|
||||
|
||||
#endregion
|
||||
});
|
||||
btnCableConnect.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.CableConnect.png");
|
||||
btnCableConnect.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"CableConnect.png");
|
||||
btnCableConnect.Id = "电缆连接";
|
||||
ribbonRowPanel.Items.Add(btnCableConnect);
|
||||
ribbonRowPanel.Items.Add(new RibbonRowBreak());//换行,这样可以使按钮多行排列
|
||||
@ -801,7 +795,7 @@ namespace SWS.CAD
|
||||
btnIO.CommandHandler = new DelegateCommand(x =>
|
||||
{
|
||||
//打开窗体
|
||||
Prism.Dialogs.DialogParameters para = new Prism.Dialogs.DialogParameters();
|
||||
var para = new Prism.Services.Dialogs.DialogParameters();
|
||||
var _dialogService = GlobalObject._prismContainer.Resolve<IDialogService>();
|
||||
_dialogService.ShowDialog(nameof(DialogIODistribution), para, (RES) =>
|
||||
{
|
||||
@ -813,7 +807,7 @@ namespace SWS.CAD
|
||||
{ }
|
||||
});
|
||||
});
|
||||
btnIO.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.IO.png");
|
||||
btnIO.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"IO.png");
|
||||
btnIO.Id = "IO分配";
|
||||
ribbonRowPanel.Items.Add(btnIO);
|
||||
#endregion
|
||||
@ -827,10 +821,15 @@ namespace SWS.CAD
|
||||
btnSinalManage.ButtonStyle = RibbonButtonStyle.SmallWithText;
|
||||
btnSinalManage.CommandHandler = new DelegateCommand(x =>
|
||||
{
|
||||
if (GlobalObject.userInfo == null || GlobalObject.curProject == null)
|
||||
{
|
||||
MessageBox.Show("请先登录系统并选择项目!");
|
||||
return;
|
||||
}
|
||||
//打开窗体
|
||||
Prism.Dialogs.DialogParameters para = new Prism.Dialogs.DialogParameters();
|
||||
var para = new Prism.Services.Dialogs.DialogParameters();
|
||||
var _dialogService = GlobalObject._prismContainer.Resolve<IDialogService>();
|
||||
_dialogService.ShowDialog(nameof(DialogSignalManagement), para, (RES) =>
|
||||
_dialogService.ShowDialog(nameof(SWS.WPF.Views.DialogSignalManagement), para, (RES) =>
|
||||
{
|
||||
if (RES.Result == ButtonResult.Yes)
|
||||
{
|
||||
@ -840,7 +839,7 @@ namespace SWS.CAD
|
||||
{ }
|
||||
});
|
||||
});
|
||||
btnSinalManage.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.SinalManage.png");
|
||||
btnSinalManage.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SinalManage.png");
|
||||
btnSinalManage.Id = "信号管理";
|
||||
ribbonRowPanel.Items.Add(btnSinalManage);
|
||||
ribbonRowPanel.Items.Add(new RibbonRowBreak());//换行,这样可以使按钮多行排列
|
||||
@ -852,9 +851,20 @@ namespace SWS.CAD
|
||||
btnCableSinal.ButtonStyle = RibbonButtonStyle.SmallWithText;
|
||||
btnCableSinal.CommandHandler = new DelegateCommand(x =>
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
//打开窗体
|
||||
var para = new Prism.Services.Dialogs.DialogParameters();
|
||||
var _dialogService = GlobalObject._prismContainer.Resolve<IDialogService>();
|
||||
_dialogService.ShowDialog(nameof(DialogSignalPredistribution), para, (RES) =>
|
||||
{
|
||||
if (RES.Result == ButtonResult.Yes)
|
||||
{
|
||||
|
||||
}
|
||||
else if (RES.Result == ButtonResult.No)
|
||||
{ }
|
||||
});
|
||||
});
|
||||
btnCableSinal.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.CableSinal.png");
|
||||
btnCableSinal.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"CableSinal.png");
|
||||
btnCableSinal.Id = "信号预分配";
|
||||
ribbonRowPanel.Items.Add(btnCableSinal);
|
||||
ribbonRowPanel.Items.Add(new RibbonRowBreak());//换行,这样可以使按钮多行排列
|
||||
@ -868,7 +878,7 @@ namespace SWS.CAD
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
});
|
||||
btnRelevancy.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.relevancy.png");
|
||||
btnRelevancy.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"relevancy.png");
|
||||
btnRelevancy.Id = "批量反向关联";
|
||||
ribbonRowPanel.Items.Add(btnRelevancy);
|
||||
#endregion
|
||||
@ -884,7 +894,7 @@ namespace SWS.CAD
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
});
|
||||
btnGraphRec.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.GraphRec.png");
|
||||
btnGraphRec.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"GraphRec.png");
|
||||
btnGraphRec.Id = "系统图识别";
|
||||
ribbonRowPanel.Items.Add(btnGraphRec);
|
||||
ribbonRowPanel.Items.Add(new RibbonRowBreak());//换行,这样可以使按钮多行排列
|
||||
@ -898,7 +908,7 @@ namespace SWS.CAD
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
});
|
||||
btnVerticalRec.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.VerticalRec.png");
|
||||
btnVerticalRec.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"VerticalRec.png");
|
||||
btnVerticalRec.Id = "竖向图识别";
|
||||
ribbonRowPanel.Items.Add(btnVerticalRec);
|
||||
ribbonRowPanel.Items.Add(new RibbonRowBreak());//换行,这样可以使按钮多行排列
|
||||
@ -912,7 +922,7 @@ namespace SWS.CAD
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
});
|
||||
btnLightLineRec.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.lightLine.png");
|
||||
btnLightLineRec.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"lightLine.png");
|
||||
btnLightLineRec.Id = "链路图识别";
|
||||
ribbonRowPanel.Items.Add(btnLightLineRec);
|
||||
#endregion
|
||||
@ -936,7 +946,7 @@ namespace SWS.CAD
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
});
|
||||
btnRefreshText.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.RefreshText.png");
|
||||
btnRefreshText.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"RefreshText.png");
|
||||
btnRefreshText.Id = "刷新标注";
|
||||
dwgRefreshSource.Items.Add(btnRefreshText);
|
||||
#endregion
|
||||
@ -951,7 +961,7 @@ namespace SWS.CAD
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
});
|
||||
btnRefreshBlock.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.RefreshBlock.png");
|
||||
btnRefreshBlock.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"RefreshBlock.png");
|
||||
btnRefreshBlock.Id = "刷新元件";
|
||||
ribbonRowPanel.Items.Add(btnRefreshBlock);
|
||||
ribbonRowPanel.Items.Add(new RibbonRowBreak());//换行,这样可以使按钮多行排列
|
||||
@ -965,7 +975,7 @@ namespace SWS.CAD
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
});
|
||||
btnRefreshFrame.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.RefreshFrame.png");
|
||||
btnRefreshFrame.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"RefreshFrame.png");
|
||||
btnRefreshFrame.Id = "刷新图框";
|
||||
ribbonRowPanel.Items.Add(btnRefreshFrame);
|
||||
ribbonRowPanel.Items.Add(new RibbonRowBreak());//换行,这样可以使按钮多行排列
|
||||
@ -980,7 +990,7 @@ namespace SWS.CAD
|
||||
var configView = GlobalObject.container.Resolve<Config>();
|
||||
Application.ShowModalWindow(Application.MainWindow.Handle, configView);
|
||||
});
|
||||
btnRefreshLink.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.RefreshLink.png");
|
||||
btnRefreshLink.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"RefreshLink.png");
|
||||
btnRefreshLink.Id = "刷新连接";
|
||||
ribbonRowPanel.Items.Add(btnRefreshLink);
|
||||
#endregion
|
||||
@ -996,7 +1006,7 @@ namespace SWS.CAD
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
});
|
||||
btnShowLink.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.ShowLink.png");
|
||||
btnShowLink.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"ShowLink.png");
|
||||
btnShowLink.Id = "查看链路";
|
||||
ribbonRowPanel.Items.Add(btnShowLink);
|
||||
ribbonRowPanel.Items.Add(new RibbonRowBreak());//换行,这样可以使按钮多行排列
|
||||
@ -1010,7 +1020,7 @@ namespace SWS.CAD
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
});
|
||||
btnUpdatePosition.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.UpdatePosition.png");
|
||||
btnUpdatePosition.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"UpdatePosition.png");
|
||||
btnUpdatePosition.Id = "刷新位置";
|
||||
ribbonRowPanel.Items.Add(btnUpdatePosition);
|
||||
ribbonRowPanel.Items.Add(new RibbonRowBreak());//换行,这样可以使按钮多行排列
|
||||
@ -1024,7 +1034,7 @@ namespace SWS.CAD
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
});
|
||||
btnRefreshPosition.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.RefreshPosition.png");
|
||||
btnRefreshPosition.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"RefreshPosition.png");
|
||||
btnRefreshPosition.Id = "刷新坐标";
|
||||
ribbonRowPanel.Items.Add(btnRefreshPosition);
|
||||
#endregion
|
||||
@ -1040,7 +1050,7 @@ namespace SWS.CAD
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
});
|
||||
btnActiveObject.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.ActiveObject.png");
|
||||
btnActiveObject.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"ActiveObject.png");
|
||||
btnActiveObject.Id = "图元高亮";
|
||||
ribbonRowPanel.Items.Add(btnActiveObject);
|
||||
ribbonRowPanel.Items.Add(new RibbonRowBreak());//换行,这样可以使按钮多行排列
|
||||
@ -1066,7 +1076,7 @@ namespace SWS.CAD
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
});
|
||||
btnImput.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.Imput.png");
|
||||
btnImput.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"Imput.png");
|
||||
btnImput.Id = "元件导入";
|
||||
ribbonRowPanel.Items.Add(btnImput);
|
||||
ribbonRowPanel.Items.Add(new RibbonRowBreak());//换行,这样可以使按钮多行排列
|
||||
@ -1080,7 +1090,7 @@ namespace SWS.CAD
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
});
|
||||
btnExport.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.Export.png");
|
||||
btnExport.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"Export.png");
|
||||
btnExport.Id = "元件导出";
|
||||
ribbonRowPanel.Items.Add(btnExport);
|
||||
#endregion
|
||||
@ -1096,7 +1106,7 @@ namespace SWS.CAD
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
});
|
||||
btnCheckCable.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.CheckCable.png");
|
||||
btnCheckCable.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"CheckCable.png");
|
||||
btnCheckCable.Id = "电缆检查";
|
||||
ribbonRowPanel.Items.Add(btnCheckCable);
|
||||
ribbonRowPanel.Items.Add(new RibbonRowBreak());//换行,这样可以使按钮多行排列
|
||||
@ -1110,7 +1120,7 @@ namespace SWS.CAD
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
});
|
||||
btnPropertyCheck.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.Property.png");
|
||||
btnPropertyCheck.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"Property.png");
|
||||
btnPropertyCheck.Id = "属性检查";
|
||||
ribbonRowPanel.Items.Add(btnPropertyCheck);
|
||||
#endregion
|
||||
@ -1140,7 +1150,7 @@ namespace SWS.CAD
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
});
|
||||
btnDwgConfig.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.DConfig.png");
|
||||
btnDwgConfig.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"DConfig.png");
|
||||
btnDwgConfig.Id = "绘图配置";
|
||||
splitButton.Items.Add(btnDwgConfig);
|
||||
#endregion
|
||||
@ -1153,7 +1163,7 @@ namespace SWS.CAD
|
||||
{
|
||||
MessageBox.Show("功能开发中...");
|
||||
});
|
||||
btnAaConfig.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.TConfig.png");
|
||||
btnAaConfig.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"TConfig.png");
|
||||
btnAaConfig.Id = "标注配置";
|
||||
splitButton.Items.Add(btnAaConfig);
|
||||
#endregion
|
||||
@ -1167,7 +1177,7 @@ namespace SWS.CAD
|
||||
var configView = GlobalObject.container.Resolve<Config>();
|
||||
Application.ShowModalWindow(Application.MainWindow.Handle, configView);
|
||||
});
|
||||
btnSystemConfig.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SWS.CAD.Images.SConfig.png");
|
||||
btnSystemConfig.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"SConfig.png");
|
||||
btnSystemConfig.Id = "系统配置";
|
||||
splitButton.Items.Add(btnSystemConfig);
|
||||
#endregion
|
||||
|
@ -1,11 +1,5 @@
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Prism.Events;
|
||||
using SWS.CAD.Models;
|
||||
using System;
|
||||
using Prism.Events;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SWS.CAD.Event
|
||||
{
|
||||
|
@ -1,11 +1,4 @@
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Prism.Events;
|
||||
using SWS.CAD.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Prism.Events;
|
||||
|
||||
namespace SWS.CAD.Event
|
||||
{
|
||||
|
@ -1,11 +1,5 @@
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Prism.Events;
|
||||
using SWS.CAD.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SWS.CAD.Event
|
||||
{
|
||||
|
@ -1,12 +1,6 @@
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Prism.Events;
|
||||
using SWS.CAD.Models;
|
||||
using SWS.CAD.Views.CustomControl;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using SWS.Model;
|
||||
|
||||
namespace SWS.CAD.Event
|
||||
{
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user