添加了搜索框
更改了UI样式 添加了标识搜索框
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Net.Mime;
|
||||
@@ -6,6 +7,7 @@ using BITKit;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using Godot;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using RosSharp.RosBridgeClient.MessageTypes.Sensor;
|
||||
|
||||
namespace BITFactory;
|
||||
// ReSharper disable once IdentifierTypo
|
||||
@@ -123,6 +125,7 @@ public class IDIS_DBContext:DbContext
|
||||
optionsBuilder.UseSqlite(sql);
|
||||
BIT4Log.Log<IDIS_DBContext>($"已创建标识数据库:{path}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询多个标识
|
||||
/// </summary>
|
||||
@@ -131,18 +134,20 @@ public class IDIS_DBContext:DbContext
|
||||
/// <returns>是否查询到了内容</returns>
|
||||
public bool Query(string key, out IDIS_Query[] queries)
|
||||
{
|
||||
var _query = Values.Where(x => x.Handle.Contains(key));
|
||||
var result = _query.Select(x=>new IDIS_Query()
|
||||
{
|
||||
Handle = x.Handle,
|
||||
CreateDate = x.CreateDate,
|
||||
UpdateDate = x.UpdateDate,
|
||||
Datas = Datas.Where(data=>data.Handle == key).ToArray(),
|
||||
References = References.Where(reference=>reference.Handle == key).ToArray()
|
||||
});
|
||||
queries = result.ToArray();
|
||||
return result.Any();
|
||||
queries = Values
|
||||
.ToList()
|
||||
.Where(x => x.Handle.Contains(key))
|
||||
.Select(x => new IDIS_Query()
|
||||
{
|
||||
Handle = x.Handle,
|
||||
CreateDate = x.CreateDate,
|
||||
UpdateDate = x.UpdateDate,
|
||||
Datas = Datas.Where(data => data.Handle == key).ToArray(),
|
||||
References = References.Where(reference => reference.Handle == key).ToArray()
|
||||
}).ToArray();
|
||||
return queries.Any();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询单个标识
|
||||
/// </summary>
|
||||
@@ -219,7 +224,7 @@ public partial class IDIS_Service:Node
|
||||
BIT4Log.Log<IDIS_Service>("已创建标识数据库");
|
||||
UniTask.Run(()=>Context.Database.EnsureCreatedAsync());
|
||||
}
|
||||
|
||||
public bool TrySearch(string word,out IDIS_Query[] queries) => Context.Query(word, out queries);
|
||||
public bool Register(string handle) => Context.Register(handle);
|
||||
public void Register(string handle, string format, string value) => Context.Register(handle, format, value);
|
||||
public void RegisterReference(string handle,string refenceHandle) => Context.RegisterReference(handle,refenceHandle);
|
||||
|
Reference in New Issue
Block a user