客户设备数据隔离业务v1

dev-0829
ccongli 1 year ago
parent 019281f80a
commit c1aeddc8b2

@ -73,7 +73,7 @@ namespace VOL.Core.BaseProvider
protected virtual void Init(IRepository<T> repository)
{
IsMultiTenancy = true; // 开启租户隔离
}
protected virtual Type GetRealDetailType()

@ -16,16 +16,16 @@ namespace VOL.Core.Tenancy
{
string multiTenancyString = $"select * from {tableName}";
//超级管理员不限制
//if (UserContext.Current.IsSuperAdmin)
//{
// return multiTenancyString;
//}
if (UserContext.Current.IsSuperAdmin)
{
return multiTenancyString;
}
switch (tableName)
{
//例如:指定用户表指定查询条件
//case "Sys_User":
// multiTenancyString += $" where UserId='{UserContext.Current.UserId}'";
// break;
case "Sys_User":
multiTenancyString += $" where UserId='{UserContext.Current.UserId}'";
break;
default:
//开启数租户数据隔离,用户只能看到自己的表数据(自己根据需要写条件做租户数据隔离)
multiTenancyString += $" where CreateID='{UserContext.Current.UserId}'";

@ -11,5 +11,9 @@ namespace VOL.Data.IServices
{
// 获取设备配置列表
List<Data_Config> getConfigList();
// 根据主键查询设备
Data_Config GetConfigById(int id);
}
}

@ -20,6 +20,9 @@ namespace VOL.Data.IServices.modbus
Dictionary<string, Dictionary<string, object>> readGSKData(IModbusService modbus);
// 获取设备配置信息
Data_Config GetDataConfig(int deviceId);
// 保存设备数据
bool saveMachineData(Data_Machine machine, out string message);

@ -35,7 +35,7 @@ namespace VOL.Data.Services
_httpContextAccessor = httpContextAccessor;
_repository = dbRepository;
//多租户会用到这init代码其他情况可以不用
//base.Init(dbRepository);
base.Init(dbRepository);
}
public List<Data_Config> getConfigList() {
@ -44,5 +44,9 @@ namespace VOL.Data.Services
}).OrderBy(x => x.id).ToList();
return list;
}
public Data_Config GetConfigById(int id) {
return _repository.DbContext.Set<Data_Config>().FirstOrDefault(e => e.id == id);
}
}
}

@ -43,7 +43,7 @@ namespace VOL.Data.Services
_httpContextAccessor = httpContextAccessor;
_repository = dbRepository;
//多租户会用到这init代码其他情况可以不用
//base.Init(dbRepository);
base.Init(dbRepository);
}
public Dictionary<int, Data_Machine> GetMachineData()

@ -23,7 +23,6 @@ namespace VOL.Data.Services.modbus
// 生产数据
Dictionary<string, object> map1 = new Dictionary<string, object>
{
{ "config_id", 1},
{ "com_status",modbus.readData(1, 6430, "int16") }, // 通讯状态 5通讯正常 15通讯断线
{ "run_time", (int)modbus.readData(1, 6435, "int16") }, // 运行时长 分钟
{ "turnout_1",(int)modbus.readData(1, 6436, "int16") }, // 工单1产量 件
@ -45,18 +44,17 @@ namespace VOL.Data.Services.modbus
{
// 操作模式 0:JOG 1:AUTO 2:AUTO + TEACHIN 3:JOG + REPOIN 4:JOG + REPOS
// 5:MDA 6:MDA + REPOS 7:MDA + REPOS + TEAHIN8:MDA + TEACHIN
{ "config_id", 1},
{ "com_status", modbus.readData(1, 6430, "int16") }, // 通讯状态 5通讯正常 15通讯断线
{ "smode", modbus.readData(1, 6099, "int16") },
{ "state", modbus.readData(1, 6429, "int16") }, // 运行状态 0:待机 1:故障 2:运行 3:暂停
{ "temperature", (decimal)modbus.readData(1, 1201, "single")}, // 电机温度 ℃
{ "potential", (decimal)modbus.readData(1, 1203, "single")}, // 母线电压 V
{ "current", (decimal)modbus.readData(1, 1205, "single")}, // 实际电流 A
{ "quantity", (long)modbus.readData(1, 1215, "single")}, // 加工数 次
{ "cut_rate", (decimal)modbus.readData(1, 1225, "single")}, // 切削倍率
{ "main_rate", (decimal)modbus.readData(1, 1231, "single")}, // 主轴倍率
{ "run_program_no", modbus.readData(1, 6689, "string", 26)}, // 加工程序号 length = 52
{ "run_time_total", (long)modbus.readData(1, 6435, "int16")}, // 累计运行时长 分钟
{ "quantity_total", (long)modbus.readData(1, 1215, "single")}, // 累计加工数 次
};
// 组装Map返回
@ -72,7 +70,6 @@ namespace VOL.Data.Services.modbus
// 生产数据
Dictionary<string, object> map1 = new Dictionary<string, object>
{
{ "config_id", 2}, // 枚举todo
{ "program_no", (int)modbus.readData(1, 6429, "int16") }, // 程序编号
{ "com_status", modbus.readData(1, 6430, "int16") }, // 通讯状态 5通讯正常 15通讯断线
{ "run_time", (int)modbus.readData(1, 6435, "int16") }, // 运行时长 分钟
@ -93,18 +90,17 @@ namespace VOL.Data.Services.modbus
// 机床数据
Dictionary<string, object> map2 = new Dictionary<string, object>
{
{ "config_id", 2},
{ "com_status", modbus.readData(1, 6430, "int16") }, // 通讯状态 5通讯正常 15通讯断线
{ "gmode", modbus.readData(1, 6099, "int16") }, // 工作方式 0:编辑 1:自动 2:MDI 3:DNC 4:手动 5:手轮 6:回参考点
{ "state", modbus.readData(1, 6100, "int16") }, // 运行状态 0:复位 1:停止 2:运行 3:暂停
{ "quantity", (long)modbus.readData(1, 1199, "int32")}, // 加工数量 次
{ "quantity", (long)modbus.readData(1, 4117, "int32")}, // 当天加工数量 次
{ "on_time", (long)modbus.readData(1, 1201, "int32")}, // 开机时间 秒
{ "run_time", (long)modbus.readData(1, 1203, "int32")}, // 运行时间 秒
{ "feed_rate", (decimal)modbus.readData(1, 1242, "single")}, // 进给倍率
{ "main_rate", (decimal)modbus.readData(1, 1248, "single")}, // 主轴倍率
{ "feed_rate", (decimal)modbus.readData(1, 1241, "single")}, // 进给倍率
{ "main_rate", (decimal)modbus.readData(1, 1247, "single")}, // 主轴倍率
{ "run_program_no", modbus.readData(1, 6299, "string", 4)}, // 运行程序编号 length = 8
{ "run_time_total", (long)modbus.readData(1, 4115, "int32")}, // 累计运行时长 分钟
{ "quantity_total", (long)modbus.readData(1, 4117, "int32")} // 累计加工数 次
{ "quantity_total", (long)modbus.readData(1, 1199, "int32")} // 累计加工数 次
};
// 组装Map返回
@ -114,6 +110,12 @@ namespace VOL.Data.Services.modbus
return map;
}
// 查询设备信息
public Data_Config GetDataConfig(int deviceId) {
return Data_ConfigService.Instance.GetConfigById(deviceId);
}
// 保存机床数据
public bool saveMachineData(Data_Machine machine, out string message) {

@ -37,7 +37,7 @@ namespace VOL.Data.Services
_httpContextAccessor = httpContextAccessor;
_repository = dbRepository;
//多租户会用到这init代码其他情况可以不用
//base.Init(dbRepository);
base.Init(dbRepository);
}

@ -5,9 +5,12 @@ using VOL.Core.BaseProvider;
using VOL.Entity.DomainModels;
using VOL.Core.Utilities;
using System.Linq.Expressions;
using System.Threading.Tasks;
namespace VOL.System.IServices
{
public partial interface ISys_DepartmentService
{
// 获取用户关联根部门
Task<Sys_Department> GetUserDepartment(int userId);
}
}

@ -20,6 +20,8 @@ using VOL.System.IRepositories;
using System.Collections.Generic;
using VOL.Core.ManageUser;
using VOL.Core.UserManager;
using VOL.Core.DBManager;
using System.Threading.Tasks;
namespace VOL.System.Services
{
@ -96,6 +98,22 @@ namespace VOL.System.Services
{
return base.Del(keys, delList).Reload();
}
public async Task<Sys_Department> GetUserDepartment(int userId) {
var dapper = DBServerProvider.SqlDapper;
string sql = @"SELECT
d.DepartmentId,
d.DepartmentCode,
d.DepartmentName
FROM
sys_department AS d
LEFT JOIN sys_userdepartment AS ud ON ud.DepartmentId = d.DepartmentId
WHERE
ud.UserId = @userId
AND d.ParentId IS NULL;";
return await dapper.QueryFirstAsync<Sys_Department>(sql, new { userId }); ;
}
}
}

@ -1,148 +0,0 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using System;
using VOL.Core.Filters;
using VOL.Data.IServices.modbus;
using VOL.Data.Services.modbus;
using Microsoft.Extensions.DependencyInjection;
using VOL.WebApi.Utils;
using VOL.Entity.DomainModels;
using System.Collections.Generic;
using Confluent.Kafka;
namespace VOL.WebApi.Controllers.Data
{
/// <summary>
/// 数据采集API类
/// </summary>
[Route("api/Data_Capture")]
[AllowAnonymous]
public class DataCaptureController : Controller
{
private ModbusTcpService _service; // 静态字段
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly IDataProcessing _dataService; // 业务处理
[ActivatorUtilitiesConstructor]
public DataCaptureController(
IDataProcessing dataService,
IHttpContextAccessor httpContextAccessor
)
{
_dataService = dataService;
_httpContextAccessor = httpContextAccessor;
}
/// <summary>
/// 采集西门子设备
/// </summary>
/// <returns>IActionResult</returns>
[ApiTask]
[HttpGet, HttpPost, Route("gatherSiemens")]
public IActionResult gatherSiemens()
{
try
{
_service = new ModbusTcpService("192.168.1.99", 502);
Console.WriteLine("siemens modbus tcp connected...");
}
catch (Exception)
{
Console.WriteLine("siemens modbus tcp connect failed");
return Content("siemens modbus tcp connect failed!");
}
if (!_service.isConnected)
{
Console.WriteLine("siemens modbus tcp disconnect!");
return Content("siemens modbus tcp disconnect!");
}
string message = "";
try {
Dictionary<string, Dictionary<string, object>> dataMap = _dataService.readSiemensData(_service);
message = saveSourceData(dataMap);
} catch (Exception ex) {
Console.WriteLine(ex.Message);
message = "read data error: " + ex.Message;
} finally {
_service.disConnent();
}
return Content(message);
}
/// <summary>
/// 采集广数设备
/// </summary>
/// <returns>IActionResult</returns>
[ApiTask]
[HttpGet, HttpPost, Route("gatherGSK")]
public IActionResult gatherGSK()
{
try
{
_service = new ModbusTcpService("192.168.1.100", 502);
Console.WriteLine("siemens modbus tcp connected...");
}
catch (Exception)
{
Console.WriteLine("siemens modbus tcp connect failed");
return Content("siemens modbus tcp connect failed!");
}
if (!_service.isConnected)
{
Console.WriteLine("siemens modbus tcp disconnect!");
return Content("siemens modbus tcp disconnect!");
}
string message = "";
try
{
Dictionary<string, Dictionary<string, object>> dataMap = _dataService.readGSKData(_service);
message = saveSourceData(dataMap);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
message = "read data error: " + ex.Message;
}
finally
{
_service.disConnent();
}
return Content(message);
}
[HttpGet, HttpPost, Route("testSave")]
public IActionResult testSave()
{
Dictionary<string, Dictionary<string, object>> dataMap = new();
dataMap.Add("machine", new Dictionary<string, object>() { { "config_id", 666 } });
dataMap.Add("produce", new Dictionary<string, object>() { { "config_id", 666 } });
string message = saveSourceData(dataMap);
return Content(message);
}
private string saveSourceData(Dictionary<string, Dictionary<string, object>> dataMap) {
// 获取当前系统时间, 保证插入时间一致
DateTime now = DateTime.Now;
Dictionary<string, object> machineData = dataMap["machine"];
Data_Machine data_Machine = CommonUtil.ConvertToObject<Data_Machine>(machineData);
data_Machine.CreateDate = now;
bool result1 = _dataService.saveMachineData(data_Machine, out string message1);
Dictionary<string, object> produceData = dataMap["produce"];
Data_Produce data_Produce = CommonUtil.ConvertToObject<Data_Produce>(produceData);
data_Produce.CreateDate = now;
bool result2 = _dataService.saveProduceData(data_Produce, out string message2);
return (result1 && result2) ? "OK" : "save machine: " + message1 + "; save produce" + message2 + ";";
}
}
}

@ -0,0 +1,244 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using System;
using VOL.Core.Filters;
using VOL.Data.IServices.modbus;
using VOL.Data.Services.modbus;
using Microsoft.Extensions.DependencyInjection;
using VOL.WebApi.Utils;
using VOL.Entity.DomainModels;
using System.Collections.Generic;
using Microsoft.Extensions.Primitives;
/// <summary>
// 尼可尼数据采集
/// <summary>
namespace VOL.WebApi.Controllers.Data
{
/// <summary>
/// 数据采集API类
/// </summary>
[Route("api/NKNCapture")]
[AllowAnonymous]
public class NKNCaptureController : Controller
{
private ModbusTcpService _service; // 静态字段
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly IDataProcessing _dataService; // 业务处理
[ActivatorUtilitiesConstructor]
public NKNCaptureController(
IDataProcessing dataService,
IHttpContextAccessor httpContextAccessor
)
{
_dataService = dataService;
_httpContextAccessor = httpContextAccessor;
}
/// <summary>
/// 采集西门子设备
/// </summary>
/// <returns>IActionResult</returns>
[ApiTask]
[HttpGet, HttpPost, Route("gatherSiemens")]
public IActionResult gatherSiemens()
{
var headers = _httpContextAccessor.HttpContext.Request.Headers;
headers.TryGetValue("USER-DEVICE-ID", out StringValues deviceIdStr);
try
{
_service = new ModbusTcpService("192.168.1.99", 502);
Console.WriteLine("siemens modbus tcp connected...");
}
catch (Exception)
{
Console.WriteLine("siemens modbus tcp connect failed");
return Content("siemens modbus tcp connect failed!");
}
if (!_service.isConnected)
{
Console.WriteLine("siemens modbus tcp disconnect!");
return Content("siemens modbus tcp disconnect!");
}
// 切削倍率 17136 1
//_service.readData(1, 6435, "int16"); // 运行时长 分钟
//_service.readData(1, 6436, "int16"); // 工单1产量 件
//_service.readData(1, 6437, "int16"); // 工单2产量 件
//_service.readData(1, 6438, "int16"); // 工单3产量 件
//_service.readData(1, 6439, "int16"); // 当班产量 件
//_service.readData(1, 6440, "int16"); // 运行状态 0:待机 1运行 2故障
//_service.readData(1, 1315, "single"); // 工单1任务进度 %
//_service.readData(1, 1317, "single"); // 工单2任务进度 %
//_service.readData(1, 1319, "single"); // 工单3任务进度 %
//_service.readData(1, 1321, "single"); // 工单1良品率 % 真实值 *= 100
//_service.readData(1, 1323, "single"); // 工单2良品率 % 真实值 *= 100
//_service.readData(1, 1325, "single"); // 工单3良品率 % 真实值 *= 100
//_service.readData(1, 1339, "single"); // 设备综合效率 % 真实值 *= 100
//dynamic d1 = _service.readData(1, 1201, "single"); // 电机温度 ℃
//dynamic d2 = _service.readData(1, 1203, "single"); // 母线电压 V
//dynamic d3 = _service.readData(1, 1205, "single"); // 实际电流 A
//dynamic d4 = _service.readData(1, 1215, "single"); // 累计加工次数
//dynamic d5 = _service.readData(1, 1225, "single"); // 切削倍率
//dynamic d6 = _service.readData(1, 1231, "single"); // 主轴倍率
//dynamic d7 = _service.readData(1, 6689, "string", 50); // 运行程序编号 length = 8
//dynamic d8 = _service.readData(1, 6435, "int16"); // 累计运行时长 分钟
string message = "";
bool success = int.TryParse(deviceIdStr, out int deviceId);
try
{
if (success)
{
Dictionary<string, Dictionary<string, object>> dataMap = _dataService.readSiemensData(_service);
message = saveSourceData(dataMap, deviceId);
}
else
{
message = "设备非法或已下线";
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
message = "read data error: " + ex.Message;
}
finally
{
_service.disConnent();
}
return Content(message);
}
/// <summary>
/// 采集广数设备
/// </summary>
/// <returns>IActionResult</returns>
[ApiTask]
[HttpGet, HttpPost, Route("gatherGSK")]
public IActionResult gatherGSK()
{
var headers = _httpContextAccessor.HttpContext.Request.Headers;
headers.TryGetValue("USER-DEVICE-ID", out StringValues deviceIdStr);
try
{
_service = new ModbusTcpService("192.168.1.100", 502);
Console.WriteLine("GSK modbus tcp connected...");
}
catch (Exception)
{
Console.WriteLine("GSK modbus tcp connect failed");
return Content("GSK modbus tcp connect failed!");
}
if (!_service.isConnected)
{
Console.WriteLine("GSK modbus tcp disconnect!");
return Content("GSK modbus tcp disconnect!");
}
//_service.readData(1, 6429, "int16"); // 程序编号
//_service.readData(1, 6435, "int16"); // 通讯状态 5通讯正常 15通讯断线
//_service.readData(1, 6430, "int16");
//_service.readData(1, 6435, "int16"); // 运行时长 分钟
//_service.readData(1, 6436, "int16"); // 工单1产量 件
//_service.readData(1, 6437, "int16"); // 工单2产量 件
//_service.readData(1, 6438, "int16"); // 工单3产量 件
//_service.readData(1, 6439, "int16"); // 当班产量 件
//_service.readData(1, 6440, "int16"); // 运行状态 0:待机 1运行 2故障
//_service.readData(1, 1315, "single"); // 工单1任务进度 %
//_service.readData(1, 1317, "single"); // 工单2任务进度 %
//_service.readData(1, 1319, "single"); // 工单3任务进度 %
//_service.readData(1, 1321, "single"); // 工单1良品率 % 真实值 *= 100
//_service.readData(1, 1323, "single"); // 工单2良品率 % 真实值 *= 100
//_service.readData(1, 1325, "single"); // 工单3良品率 % 真实值 *= 100
//_service.readData(1, 1331, "single"); // 设备综合效率 % 真实值 *= 100
//_service.readData(1, 6430, "int16"); // 通讯状态 5通讯正常 15通讯断线
//_service.readData(1, 6099, "int16"); // 工作方式 0:编辑 1:自动 2:MDI 3:DNC 4:手动 5:手轮 6:回参考点
//_service.readData(1, 6100, "int16"); // 运行状态 0:复位 1:停止 2:运行 3:暂停
//dynamic d1 = _service.readData(1, 4117, "int32"); // 当天加工数量 次
//dynamic d2 = _service.readData(1, 1201, "int32"); // 开机时间 秒
//dynamic d3 = _service.readData(1, 1203, "int32"); // 运行时间 秒
//dynamic d4 = _service.readData(1, 1241, "single"); // 进给倍率
//dynamic d5 = _service.readData(1, 1247, "single"); // 主轴倍率
//dynamic d6 = _service.readData(1, 6299, "string", 8); // 运行程序编号 length = 8
//dynamic d7 = _service.readData(1, 4115, "int32"); // 累计运行时长 分钟
//dynamic d8 = _service.readData(1, 1199, "int32"); // 累计加工数 次
string message = "";
bool success = int.TryParse(deviceIdStr, out int deviceId);
try
{
if (success)
{
Dictionary<string, Dictionary<string, object>> dataMap = _dataService.readGSKData(_service);
message = saveSourceData(dataMap, deviceId);
}
else
{
message = "设备非法或已下线";
}
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
message = "read data error: " + ex.Message;
}
finally
{
_service.disConnent();
}
return Content(message);
}
[HttpGet, HttpPost, Route("testSave")]
public IActionResult testSave()
{
Dictionary<string, Dictionary<string, object>> dataMap = new();
dataMap.Add("machine", new Dictionary<string, object>() { { "config_id", 666 } });
dataMap.Add("produce", new Dictionary<string, object>() { { "config_id", 666 } });
string message = saveSourceData(dataMap, 1);
return Content(message);
}
/// <summary>
/// 保存采集数据
/// </summary>
/// <returns>IActionResult</returns>
private string saveSourceData(Dictionary<string, Dictionary<string, object>> dataMap, int deviceId)
{
// 获取当前系统时间, 保证插入时间一致
DateTime now = DateTime.Now;
// 设备关联的用户信息
Data_Config dataConfig = _dataService.GetDataConfig(deviceId);
if (dataConfig == null) {
return "设备不存在!";
}
int userId = dataConfig.CreateID ?? 1; // 默认超管
Dictionary<string, object> machineData = dataMap["machine"];
Data_Machine data_Machine = CommonUtil.ConvertToObject<Data_Machine>(machineData);
data_Machine.config_id = deviceId;
data_Machine.CreateDate = now;
data_Machine.CreateID = userId;
bool result1 = _dataService.saveMachineData(data_Machine, out string message1);
Dictionary<string, object> produceData = dataMap["produce"];
Data_Produce data_Produce = CommonUtil.ConvertToObject<Data_Produce>(produceData);
data_Produce.config_id = deviceId;
data_Produce.CreateDate = now;
data_Produce.CreateID = userId;
bool result2 = _dataService.saveProduceData(data_Produce, out string message2);
return (result1 && result2) ? "OK" : "save machine: " + message1 + "; save produce: " + message2 + ";";
}
}
}

@ -125,6 +125,20 @@ namespace VOL.System.Controllers
}).ToListAsync();
return JsonNormal(new { rows });
}
/// <summary>
/// 获取用户根部门
/// </summary>
/// <returns></returns>
[HttpGet, Route("getUserDepartment")]
[ApiActionPermission()]
public async Task<ActionResult> GetUserDepartment()
{
int useId = UserContext.Current.UserId;
var sysDepartment = await _service.GetUserDepartment(useId);
return JsonNormal(new { sysDepartment.DepartmentName, sysDepartment.DepartmentId });
}
}
}

@ -13,6 +13,7 @@ using VOL.Entity.DomainModels;
using VOL.System.IServices;
using VOL.Core.Filters;
using VOL.Core.Enums;
using Microsoft.Extensions.Primitives;
namespace VOL.System.Controllers
{
@ -40,6 +41,8 @@ namespace VOL.System.Controllers
[HttpGet, HttpPost, Route("test")]
public IActionResult Test()
{
//var headers = _httpContextAccessor.HttpContext.Request.Headers;
//headers.TryGetValue("USER-DEVICE-ID", out StringValues val); //AuthKey
return Content(DateTime.Now.ToString("yyyy-MM-dd HH:mm:sss"));
}

@ -65,15 +65,16 @@ namespace VOL.WebApi.Utils
try
{
ushort[] temp = new ushort[2];
for (int i = 0; i < 2; i++)
{
temp[i] = src[i + start];
}
byte[] bytesTemp = Ushorts2Bytes(temp,false);
Array.Reverse(bytesTemp);
Array.Reverse(temp);
// BitConverter默认是小端转换如果是大端字节顺序数组接收需要先反序字节顺序
float res = BitConverter.ToSingle(bytesTemp, 0);
return res;
byte[] bytesTemp = Ushorts2Bytes(temp,false);
float f = BitConverter.ToSingle(bytesTemp, 0);
return float.Parse(f.ToString("F2")); // 保留两位小数
} catch (Exception e)
{
return 0;
@ -148,7 +149,7 @@ namespace VOL.WebApi.Utils
temp[0] = src[start];
temp[1] = src[start + 1]; // 0 100
Array.Reverse(temp); // 100 0 地址低位存储低字节数据(小端)
byte[] bytesTemp = Ushorts2Bytes(temp);
byte[] bytesTemp = Ushorts2Bytes(temp,false);
int res = BitConverter.ToInt32(bytesTemp, 0);
return res;
} catch (Exception e)

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

@ -20,7 +20,7 @@
</div>
<div class="vol-container" :style="{ left: menuWidth - 1 + 'px' }">
<div class="vol-header">
<div class="project-name">上海尼可尼泵业有限公司</div>
<div class="project-name">{{departName}}</div>
<div class="header-text">
<!-- <div class="h-link">
<a
@ -226,6 +226,9 @@ export default defineComponent({
//
const { proxy } = getCurrentInstance();
//
const departName = ref("上海长江云息数字科技");
//
const menuWidth = ref(200);
const contextMenuVisible = ref(false);
@ -615,6 +618,14 @@ export default defineComponent({
});
};
created();
const getDepartName = () => {
// departName.value = "";
http.get("api/Sys_Department/getUserDepartment", {}, true).then((data) => {
departName.value = data.DepartmentName;
});
}
return {
menuWidth,
isCollapse,
@ -647,6 +658,8 @@ export default defineComponent({
closeTabsMenu,
closeTabs,
currentMenuId,
departName,
getDepartName,
};
},
/**
@ -661,6 +674,8 @@ export default defineComponent({
}, 1000);
this.bindRightClickMenu(true);
this.getDepartName();
},
methods: {

Loading…
Cancel
Save