fix:项目菜单

This commit is contained in:
geh 2025-05-13 11:04:14 +08:00
parent 846933e9e7
commit 5d8f6ee65e
4 changed files with 520 additions and 8 deletions

View File

@ -1273,6 +1273,7 @@ namespace BLL
/// 人员管理
/// </summary>
public const string Menu_Person = "Menu_Person";
public const string Menu_Person_P = "Menu_Person_P";
/// <summary>
/// 通知
/// </summary>
@ -1341,10 +1342,12 @@ namespace BLL
/// 质量
/// </summary>
public const string Menu_CQMS = "Menu_CQMS";
public const string Menu_CQMS_P = "Menu_CQMS_P";
/// <summary>
/// 安全
/// </summary>
public const string Menu_HSSE = "Menu_HSSE";
public const string Menu_HSSE_P = "Menu_HSSE_P";
/// <summary>
/// 技术
/// </summary>
@ -1373,6 +1376,7 @@ namespace BLL
/// 视频监控
/// </summary>
public const string Menu_DigitalSite = "Menu_DigitalSite";
public const string Menu_DigitalSite_P = "Menu_DigitalSite_P";
/// <summary>
/// 现场考勤
/// </summary>
@ -1381,6 +1385,7 @@ namespace BLL
/// 设备管理
/// </summary>
public const string Menu_Device = "Menu_Device";
public const string Menu_Device_P = "Menu_Device_P";
/// <summary>
/// 消息
/// </summary>

View File

@ -653,6 +653,26 @@ namespace FineUIPro.Web
{
this.Tab1.IFrameUrl = "";
}
else if (type == Const.Menu_Person_P)
{
this.Tab1.IFrameUrl = "";
}
else if (type == Const.Menu_HSSE_P)
{
this.Tab1.IFrameUrl = "";
}
else if (type == Const.Menu_CQMS_P)
{
this.Tab1.IFrameUrl = "";
}
else if (type == Const.Menu_Device_P)
{
this.Tab1.IFrameUrl = "";
}
else if (type == Const.Menu_DigitalSite_P)
{
this.Tab1.IFrameUrl = "";
}
}
else
{
@ -683,13 +703,13 @@ namespace FineUIPro.Web
protected void btnPerson_Click(object sender, EventArgs e)
{
this.MenuSwitchMethod(Const.Menu_Person);
this.MenuSwitchMethod(Const.Menu_Person_P);
}
protected void btnCQMS_Click(object sender, EventArgs e)
{
this.MenuSwitchMethod(Const.Menu_CQMS);
this.MenuSwitchMethod(Const.Menu_CQMS_P);
}
protected void btnPersonal_Click(object sender, EventArgs e)
@ -703,12 +723,12 @@ namespace FineUIPro.Web
}
protected void btnDevice_Click(object sender, EventArgs e)
{
this.MenuSwitchMethod(Const.Menu_Device);
this.MenuSwitchMethod(Const.Menu_Device_P);
}
protected void btnHSSE_Click(object sender, EventArgs e)
{
this.MenuSwitchMethod(Const.Menu_HSSE);
this.MenuSwitchMethod(Const.Menu_HSSE_P);
}
protected void btnHJGL_Click(object sender, EventArgs e)
@ -734,7 +754,7 @@ namespace FineUIPro.Web
}
protected void btnDigitalSite_Click(object sender, EventArgs e)
{
if (CommonService.IsHaveSystemPower(this.CurrUser.UserId, Const.Menu_DigitalSite, this.drpProject.Value))
if (CommonService.IsHaveSystemPower(this.CurrUser.UserId, Const.Menu_DigitalSite_P, this.drpProject.Value))
{
string video_Url = string.Empty;
var sysSet16 = (from x in Funs.DB.Sys_Set where x.SetName == "视频监控地址" select x).ToList().FirstOrDefault();
@ -745,7 +765,7 @@ namespace FineUIPro.Web
var project = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId);
string url = video_Url + "#/screen?username=" + project.ProjectCode + "&password=" + project.MonitorPW;
Response.Write("<script>window.open(" + url + "'',''_blank'')</script>");
// this.MenuSwitchMethod(Const.Menu_DigitalSite);
// this.MenuSwitchMethod(Const.Menu_DigitalSite_P);
}
}
@ -753,7 +773,7 @@ namespace FineUIPro.Web
{
get
{
if (CommonService.IsHaveSystemPower(this.CurrUser.UserId, Const.Menu_DigitalSite, this.drpProject.Value))
if (CommonService.IsHaveSystemPower(this.CurrUser.UserId, Const.Menu_DigitalSite_P, this.drpProject.Value))
{
string video_Url = string.Empty;
var sysSet16 = (from x in Funs.DB.Sys_Set where x.SetName == "视频监控地址" select x).ToList().FirstOrDefault();

View File

@ -1128,7 +1128,7 @@ namespace WebAPI.Controllers
string url = Request.RequestUri.Scheme + "://" + Request.RequestUri.Host + ":" +
Request.RequestUri.Port +
"/JT/" + reUrl;
"/SUBQHSE/" + reUrl;
responeData.data = new {IDCard = APIIDCardInfoService.ReadIDCardInfo(url), IDCardUrl = reUrl,URL=url};
}
@ -1275,5 +1275,491 @@ namespace WebAPI.Controllers
#endregion
#region
public Model.ResponeData getSql()
{
var responeData = new Model.ResponeData();
try
{
var PersonList = (from x in Funs.DB.Sys_Menu
where x.MenuType == "Menu_Person"
select x).ToList();
var HSSEList = (from x in Funs.DB.Sys_Menu
where x.MenuType == "Menu_HSSE"
select x).ToList();
var CQMSList = (from x in Funs.DB.Sys_Menu
where x.MenuType == "Menu_CQMS"
select x).ToList();
var DeviceList = (from x in Funs.DB.Sys_Menu
where x.MenuType == "Menu_Device"
select x).ToList();
var DigitalSiteList = (from x in Funs.DB.Sys_Menu
where x.MenuType == "Menu_DigitalSite"
select x).ToList();
int a = 0;
int b = 0;
int c = 0;
int d = 0;
int e = 0;
Dictionary<string, string> amap = new Dictionary<string, string>();
Dictionary<string, string> aamap = new Dictionary<string, string>();
Dictionary<string, string> bmap = new Dictionary<string, string>();
Dictionary<string, string> bbmap = new Dictionary<string, string>();
Dictionary<string, string> bbbmap = new Dictionary<string, string>();
Dictionary<string, string> cmap = new Dictionary<string, string>();
Dictionary<string, string> ccmap = new Dictionary<string, string>();
Dictionary<string, string> dmap = new Dictionary<string, string>();
Dictionary<string, string> ddmap = new Dictionary<string, string>();
Dictionary<string, string> emap = new Dictionary<string, string>();
Dictionary<string, string> eemap = new Dictionary<string, string>();
Model.SUBQHSEDB db = Funs.DB;
if (PersonList.Count > 0)
{
var qq = PersonList.Where(x => x.SuperMenu == "0");
foreach (var q in qq)
{
var id = SQLHelper.GetNewID();
Model.Sys_Menu newmMenu = new Model.Sys_Menu
{
MenuId = id,
MenuName = q.MenuName,
Icon = q.Icon,
Url = q.Url,
SortIndex = q.SortIndex,
SuperMenu = "0",
MenuType = "Menu_Person_P",
IsOffice = q.IsOffice,
IsEnd = q.IsEnd,
IsUsed = q.IsUsed,
};
db.Sys_Menu.InsertOnSubmit(newmMenu);
db.SubmitChanges();
amap.Add(q.MenuId, id);
a = a++;
}
var nqq = PersonList.Where(x => x.SuperMenu != "0");
foreach (var nq in nqq)
{
var id = SQLHelper.GetNewID();
if (amap.TryGetValue(nq.SuperMenu, out string value))
{
Model.Sys_Menu newmMenu = new Model.Sys_Menu
{
MenuId = id,
MenuName = nq.MenuName,
Icon = nq.Icon,
Url = nq.Url,
SortIndex = nq.SortIndex,
SuperMenu = value,
MenuType = "Menu_Person_P",
IsOffice = nq.IsOffice,
IsEnd = nq.IsEnd,
IsUsed = nq.IsUsed,
};
db.Sys_Menu.InsertOnSubmit(newmMenu);
db.SubmitChanges();
aamap.Add(nq.MenuId,id);
a = a++;
}
}
if (aamap.Count > 0)
{
foreach (var nq in nqq)
{
var id = SQLHelper.GetNewID();
if (aamap.TryGetValue(nq.SuperMenu, out string value))
{
Model.Sys_Menu newmMenu = new Model.Sys_Menu
{
MenuId = id,
MenuName = nq.MenuName,
Icon = nq.Icon,
Url = nq.Url,
SortIndex = nq.SortIndex,
SuperMenu = value,
MenuType = "Menu_Person_P",
IsOffice = nq.IsOffice,
IsEnd = nq.IsEnd,
IsUsed = nq.IsUsed,
};
db.Sys_Menu.InsertOnSubmit(newmMenu);
db.SubmitChanges();
a = a++;
}
}
}
}
if (HSSEList.Count > 0)
{
var qq = HSSEList.Where(x => x.SuperMenu == "0");
foreach (var q in qq)
{
var id = SQLHelper.GetNewID();
Model.Sys_Menu newmMenu = new Model.Sys_Menu
{
MenuId = id,
MenuName = q.MenuName,
Icon = q.Icon,
Url = q.Url,
SortIndex = q.SortIndex,
SuperMenu = "0",
MenuType = "Menu_HSSE_P",
IsOffice = q.IsOffice,
IsEnd = q.IsEnd,
IsUsed = q.IsUsed,
};
db.Sys_Menu.InsertOnSubmit(newmMenu);
db.SubmitChanges();
bmap.Add(q.MenuId, id);
b = b++;
}
var nqq = HSSEList.Where(x => x.SuperMenu != "0");
foreach (var nq in nqq)
{
var id = SQLHelper.GetNewID();
if (bmap.TryGetValue(nq.SuperMenu, out string value))
{
Model.Sys_Menu newmMenu = new Model.Sys_Menu
{
MenuId = id,
MenuName = nq.MenuName,
Icon = nq.Icon,
Url = nq.Url,
SortIndex = nq.SortIndex,
SuperMenu = value,
MenuType = "Menu_HSSE_P",
IsOffice = nq.IsOffice,
IsEnd = nq.IsEnd,
IsUsed = nq.IsUsed,
};
db.Sys_Menu.InsertOnSubmit(newmMenu);
db.SubmitChanges();
bbmap.Add(nq.MenuId,id);
b = b++;
}
}
if (bbmap.Count>0)
{
foreach (var nq in nqq)
{
var id = SQLHelper.GetNewID();
if (bbmap.TryGetValue(nq.SuperMenu, out string value))
{
Model.Sys_Menu newmMenu = new Model.Sys_Menu
{
MenuId = id,
MenuName = nq.MenuName,
Icon = nq.Icon,
Url = nq.Url,
SortIndex = nq.SortIndex,
SuperMenu = value,
MenuType = "Menu_HSSE_P",
IsOffice = nq.IsOffice,
IsEnd = nq.IsEnd,
IsUsed = nq.IsUsed,
};
db.Sys_Menu.InsertOnSubmit(newmMenu);
db.SubmitChanges();
bbbmap.Add(nq.MenuId,id);
b = b++;
}
}
}
if (bbbmap.Count>0)
{
foreach (var nq in nqq)
{
var id = SQLHelper.GetNewID();
if (bbbmap.TryGetValue(nq.SuperMenu, out string value))
{
Model.Sys_Menu newmMenu = new Model.Sys_Menu
{
MenuId = id,
MenuName = nq.MenuName,
Icon = nq.Icon,
Url = nq.Url,
SortIndex = nq.SortIndex,
SuperMenu = value,
MenuType = "Menu_HSSE_P",
IsOffice = nq.IsOffice,
IsEnd = nq.IsEnd,
IsUsed = nq.IsUsed,
};
db.Sys_Menu.InsertOnSubmit(newmMenu);
db.SubmitChanges();
}
}
}
}
if (CQMSList.Count > 0)
{
var qq = CQMSList.Where(x => x.SuperMenu == "0");
foreach (var q in qq)
{
var id = SQLHelper.GetNewID();
Model.Sys_Menu newmMenu = new Model.Sys_Menu
{
MenuId = id,
MenuName = q.MenuName,
Icon = q.Icon,
Url = q.Url,
SortIndex = q.SortIndex,
SuperMenu = "0",
MenuType = "Menu_CQMS_P",
IsOffice = q.IsOffice,
IsEnd = q.IsEnd,
IsUsed = q.IsUsed,
};
db.Sys_Menu.InsertOnSubmit(newmMenu);
db.SubmitChanges();
cmap.Add(q.MenuId, id);
c = c++;
}
var nqq = CQMSList.Where(x => x.SuperMenu != "0");
foreach (var nq in nqq)
{
var id = SQLHelper.GetNewID();
if (cmap.TryGetValue(nq.SuperMenu, out string value))
{
Model.Sys_Menu newmMenu = new Model.Sys_Menu
{
MenuId = id,
MenuName = nq.MenuName,
Icon = nq.Icon,
Url = nq.Url,
SortIndex = nq.SortIndex,
SuperMenu = value,
MenuType = "Menu_CQMS_P",
IsOffice = nq.IsOffice,
IsEnd = nq.IsEnd,
IsUsed = nq.IsUsed,
};
db.Sys_Menu.InsertOnSubmit(newmMenu);
db.SubmitChanges();
ccmap.Add(nq.MenuId,id);
c = c++;
}
}
if (ccmap.Count>0)
{
foreach (var nq in nqq)
{
var id = SQLHelper.GetNewID();
if (ccmap.TryGetValue(nq.SuperMenu, out string value))
{
Model.Sys_Menu newmMenu = new Model.Sys_Menu
{
MenuId = id,
MenuName = nq.MenuName,
Icon = nq.Icon,
Url = nq.Url,
SortIndex = nq.SortIndex,
SuperMenu = value,
MenuType = "Menu_CQMS_P",
IsOffice = nq.IsOffice,
IsEnd = nq.IsEnd,
IsUsed = nq.IsUsed,
};
db.Sys_Menu.InsertOnSubmit(newmMenu);
db.SubmitChanges();
}
}
}
}
if (DeviceList.Count > 0)
{
var qq = DeviceList.Where(x => x.SuperMenu == "0");
foreach (var q in qq)
{
var id = SQLHelper.GetNewID();
Model.Sys_Menu newmMenu = new Model.Sys_Menu
{
MenuId = id,
MenuName = q.MenuName,
Icon = q.Icon,
Url = q.Url,
SortIndex = q.SortIndex,
SuperMenu = "0",
MenuType = "Menu_Device_P",
IsOffice = q.IsOffice,
IsEnd = q.IsEnd,
IsUsed = q.IsUsed,
};
db.Sys_Menu.InsertOnSubmit(newmMenu);
db.SubmitChanges();
dmap.Add(q.MenuId, id);
d = d++;
}
var nqq = DeviceList.Where(x => x.SuperMenu != "0");
foreach (var nq in nqq)
{
var id = SQLHelper.GetNewID();
if (dmap.TryGetValue(nq.SuperMenu, out string value))
{
Model.Sys_Menu newmMenu = new Model.Sys_Menu
{
MenuId = id,
MenuName = nq.MenuName,
Icon = nq.Icon,
Url = nq.Url,
SortIndex = nq.SortIndex,
SuperMenu = value,
MenuType = "Menu_Device_P",
IsOffice = nq.IsOffice,
IsEnd = nq.IsEnd,
IsUsed = nq.IsUsed,
};
db.Sys_Menu.InsertOnSubmit(newmMenu);
db.SubmitChanges();
ddmap.Add(nq.MenuId,id);
d = d++;
}
}
if (ddmap.Count>0)
{
foreach (var nq in nqq)
{
var id = SQLHelper.GetNewID();
if (ddmap.TryGetValue(nq.SuperMenu, out string value))
{
Model.Sys_Menu newmMenu = new Model.Sys_Menu
{
MenuId = id,
MenuName = nq.MenuName,
Icon = nq.Icon,
Url = nq.Url,
SortIndex = nq.SortIndex,
SuperMenu = value,
MenuType = "Menu_Device_P",
IsOffice = nq.IsOffice,
IsEnd = nq.IsEnd,
IsUsed = nq.IsUsed,
};
db.Sys_Menu.InsertOnSubmit(newmMenu);
db.SubmitChanges();
}
}
}
}
if (DigitalSiteList.Count > 0)
{
var qq = DigitalSiteList.Where(x => x.SuperMenu == "0");
foreach (var q in qq)
{
var id = SQLHelper.GetNewID();
Model.Sys_Menu newmMenu = new Model.Sys_Menu
{
MenuId = id,
MenuName = q.MenuName,
Icon = q.Icon,
Url = q.Url,
SortIndex = q.SortIndex,
SuperMenu = "0",
MenuType = "Menu_DigitalSite_P",
IsOffice = q.IsOffice,
IsEnd = q.IsEnd,
IsUsed = q.IsUsed,
};
db.Sys_Menu.InsertOnSubmit(newmMenu);
db.SubmitChanges();
emap.Add(q.MenuId, id);
e = e++;
}
var nqq = DigitalSiteList.Where(x => x.SuperMenu != "0");
foreach (var nq in nqq)
{
var id = SQLHelper.GetNewID();
if (emap.TryGetValue(nq.SuperMenu, out string value))
{
Model.Sys_Menu newmMenu = new Model.Sys_Menu
{
MenuId = id,
MenuName = nq.MenuName,
Icon = nq.Icon,
Url = nq.Url,
SortIndex = nq.SortIndex,
SuperMenu = value,
MenuType = "Menu_DigitalSite_P",
IsOffice = nq.IsOffice,
IsEnd = nq.IsEnd,
IsUsed = nq.IsUsed,
};
db.Sys_Menu.InsertOnSubmit(newmMenu);
db.SubmitChanges();
eemap.Add(nq.MenuId,id);
e = e++;
}
}
if (eemap.Count>0)
{
foreach (var nq in nqq)
{
var id = SQLHelper.GetNewID();
if (eemap.TryGetValue(nq.SuperMenu, out string value))
{
Model.Sys_Menu newmMenu = new Model.Sys_Menu
{
MenuId = id,
MenuName = nq.MenuName,
Icon = nq.Icon,
Url = nq.Url,
SortIndex = nq.SortIndex,
SuperMenu = value,
MenuType = "Menu_DigitalSite_P",
IsOffice = nq.IsOffice,
IsEnd = nq.IsEnd,
IsUsed = nq.IsUsed,
};
db.Sys_Menu.InsertOnSubmit(newmMenu);
db.SubmitChanges();
}
}
}
}
responeData.data = new { a=a,b=b,c=c,d=d,e=e };
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
}
}

View File

@ -151,6 +151,7 @@ namespace WebAPI.Filter
, "InformedConsentForm*getFormByWorkPostName"
, "Person*PostAddUrl"
, "Person*getWorkPostList"
, "Person*getSql"
, "ProjectUnitPenetrate*getDataByProjectUnitId"
, "Rectify*getRectifyList"
, "Rectify*getRectifyItemListBy"