Former-commit-id: c82f66914e83de712708c2ab98e22152d8eb98c9
TangShanKaiPing
zhengpengju 6 years ago
commit cadebda45b

@ -146,13 +146,13 @@ RectTransform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 40919614}
m_LocalRotation: {x: 0, y: 1, z: 0, w: 0}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 223974230}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
@ -170,7 +170,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: bcb2c646595564140aee7b32397fd755, type: 3}
m_Name:
m_EditorClassIdentifier:
cameraTexture: {fileID: 40919617}
rawImage: {fileID: 40919617}
text: {fileID: 1231679782}
--- !u!114 &40919617
MonoBehaviour:
m_ObjectHideFlags: 0
@ -295,6 +296,7 @@ RectTransform:
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 40919615}
- {fileID: 1231679781}
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -430,7 +432,7 @@ Camera:
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
@ -543,3 +545,80 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1231679780
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1231679781}
- component: {fileID: 1231679783}
- component: {fileID: 1231679782}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1231679781
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1231679780}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 223974230}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 4.900879, y: -2.1437988}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1231679782
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1231679780}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 0
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: New Text
--- !u!222 &1231679783
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1231679780}
m_CullTransparentMesh: 0

@ -14,15 +14,11 @@ namespace Infrastructure.Data
{
public class EfDbContext : DbContext
{
public static readonly ILoggerFactory DebugLogFactory = LoggerFactory.Create(builder =>
public static readonly ILoggerFactory MyLoggerFactory = LoggerFactory.Create(builder =>
{
builder.AddConsole();
});
public static readonly ILoggerFactory ProductLogFactory = LoggerFactory.Create(builder =>
{
});
private readonly IHostEnvironment _env;
private readonly IConfiguration _cfg;
@ -34,14 +30,7 @@ namespace Infrastructure.Data
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (this._cfg.GetValue<bool>("debug", false))
{
optionsBuilder?.UseLoggerFactory(DebugLogFactory);
}
else
{
optionsBuilder?.UseLoggerFactory(ProductLogFactory);
}
optionsBuilder?.UseLoggerFactory(MyLoggerFactory);
optionsBuilder?.EnableSensitiveDataLogging();
base.OnConfiguring(optionsBuilder);
}

@ -1,8 +1,10 @@
using Infrastructure.Application;
using Application.Domain.Entities;
using Infrastructure.Application;
using Infrastructure.Data;
using Infrastructure.Domain;
using Infrastructure.Events;
using Infrastructure.Extensions;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
@ -84,6 +86,13 @@ namespace IoT.Shared.Services
entity.From(model);
if (repo.SaveChanges() > 0)
{
if (entity is Data)
{
var data = entity as Data;
data.Device = scope.ServiceProvider.GetService<IRepository<Device>>().ReadOnlyTable().Include(o => o.Node)
.Where(o => o.Id == data.DeviceId)
.Select(o => new Device { DisplayName = o.DisplayName, Node = new Node { Name = o.Node.Name } }).FirstOrDefault();
}
var eventPublisher = scope.ServiceProvider.GetService<IEventPublisher>();
if (isNew)
{

@ -82,10 +82,10 @@ const store = new Vuex.Store({
updateByKey(device.data, model);
}
}
state.messages.push(model);
while (state.messages.length > 10) {
state.messages.unshift();
}
//state.messages.push(model);
//while (state.messages.length > 10) {
// state.messages.unshift();
//}
}
//update(state,method,message,to,from) {
// alert(1);

@ -4,7 +4,7 @@
<div class="weui-cells">
<div class="weui-cell weui-cell_active weui-cell_access" v-for="message in store.state.messages">
<div class="weui-cell__bd">
<span class="badge badge-success" style="margin-left: 5px;">{{message.name}}:{{message.value}} {{message.unit}} {{message.description}}</span>
<span class="badge badge-success" style="margin-left: 5px;">{{message.device.node.name}}{{message.device.displayName}}{{message.name}}:{{message.value}} {{message.unit}} {{message.description}}</span>
</div>
</div>
</div>

Loading…
Cancel
Save