From 921232746e724fcb0efdf6c8067f9d42d7974912 Mon Sep 17 00:00:00 2001 From: wq1234wq Date: Wed, 22 Dec 2021 19:49:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=A2=9E=E5=8A=A0=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IoTSharp.TaskAction/DeviceActionExcutor.cs | 2 +- .../flow/flowevents/flowevents.component.html | 19 ++++++++++++++-- .../flow/flowevents/flowevents.component.ts | 22 ++++++++++++++++--- .../src/app/shared/shared-zorro.module.ts | 3 ++- IoTSharp/Controllers/Models/IPageParam.cs | 4 +++- IoTSharp/Controllers/RulesController.cs | 15 +++++++++---- 6 files changed, 53 insertions(+), 12 deletions(-) diff --git a/IoTSharp.TaskAction/DeviceActionExcutor.cs b/IoTSharp.TaskAction/DeviceActionExcutor.cs index bd4a3d8e..9a24c4e8 100644 --- a/IoTSharp.TaskAction/DeviceActionExcutor.cs +++ b/IoTSharp.TaskAction/DeviceActionExcutor.cs @@ -32,7 +32,7 @@ namespace IoTSharp.TaskAction request.RequestFormat = DataFormat.Json; request.AddHeader("Content-Type", contentType); request.AddHeader("cache-control", "no-cache"); - request.AddJsonBody(JsonConvert.SerializeObject(new{ sosType="1", sosContent= input.Input, usingUserId= "zhangsan" })); + request.AddJsonBody(JsonConvert.SerializeObject(new{ sosType="1", sosContent= input.Input, usingUserId= "" })); var response = restclient.Execute(request); if (response.StatusCode == HttpStatusCode.OK) { diff --git a/IoTSharp/ClientApp/src/app/routes/flow/flowevents/flowevents.component.html b/IoTSharp/ClientApp/src/app/routes/flow/flowevents/flowevents.component.html index 1c186a72..fb04629c 100644 --- a/IoTSharp/ClientApp/src/app/routes/flow/flowevents/flowevents.component.html +++ b/IoTSharp/ClientApp/src/app/routes/flow/flowevents/flowevents.component.html @@ -10,11 +10,26 @@ + + +
+ + 规则 + + + + +
- 创建人 + 创建对象 - + + + + {{ option.text }} + +
diff --git a/IoTSharp/ClientApp/src/app/routes/flow/flowevents/flowevents.component.ts b/IoTSharp/ClientApp/src/app/routes/flow/flowevents/flowevents.component.ts index 4bfede39..663ca18b 100644 --- a/IoTSharp/ClientApp/src/app/routes/flow/flowevents/flowevents.component.ts +++ b/IoTSharp/ClientApp/src/app/routes/flow/flowevents/flowevents.component.ts @@ -1,6 +1,7 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { STPage, STReq, STRes, STComponent, STColumn, STData, STColumnTag } from '@delon/abc/st'; import { _HttpClient, SettingsService } from '@delon/theme'; +import { Guid } from 'guid-typescript'; import { NzDrawerService } from 'ng-zorro-antd/drawer'; import { NzMessageService } from 'ng-zorro-antd/message'; import { FloweventviewComponent } from '../floweventview/floweventview.component'; @@ -12,6 +13,12 @@ import { FloweventviewComponent } from '../floweventview/floweventview.component styleUrls: ['./flowevents.component.less'] }) export class FloweventsComponent implements OnInit { + devices:creator[]=[{value:Guid.EMPTY,text:'测试'}]; + + + + + TAG: STColumnTag = { 'Normal': { text: '设备', color: 'green' }, 'TestPurpose': { text: '测试', color: 'orange' }, @@ -26,7 +33,8 @@ export class FloweventsComponent implements OnInit { pi: number; ps: number; Name: string; - Creator: string; + Creator: string; + RuleName:string; CreatTime: Date[]; sorter: string; status: number | null; @@ -35,6 +43,7 @@ export class FloweventsComponent implements OnInit { ps: 10, Name: '', Creator: '', + RuleName:'', CreatTime: [], sorter: '', status: null, @@ -115,6 +124,7 @@ export class FloweventsComponent implements OnInit { ps: 10, Name: '', Creator: '', + RuleName:'', CreatTime: [], sorter: '', status: null, @@ -144,7 +154,13 @@ export interface baseevent{ Bizid: string; name: string; ruleId: string; - createrDateTime: string; - creatorName: string; + createrDateTime: string; + creatorName: string; } + + +export interface creator{ + value:string; + text:string; +} \ No newline at end of file diff --git a/IoTSharp/ClientApp/src/app/shared/shared-zorro.module.ts b/IoTSharp/ClientApp/src/app/shared/shared-zorro.module.ts index 0632c0a8..eeef0ab1 100644 --- a/IoTSharp/ClientApp/src/app/shared/shared-zorro.module.ts +++ b/IoTSharp/ClientApp/src/app/shared/shared-zorro.module.ts @@ -37,6 +37,7 @@ import { NzCodeEditorModule } from 'ng-zorro-antd/code-editor'; import { NzTreeViewModule } from 'ng-zorro-antd/tree-view'; import { NzResizableModule } from 'ng-zorro-antd/resizable'; import { NzCollapseModule } from 'ng-zorro-antd/collapse'; +import { NzAutocompleteModule } from 'ng-zorro-antd/auto-complete'; export const SHARED_ZORRO_MODULES = [ NzButtonModule, NzMessageModule, @@ -75,5 +76,5 @@ export const SHARED_ZORRO_MODULES = [ NzStepsModule, NzCodeEditorModule, NzTreeViewModule, - NzResizableModule,NzCollapseModule + NzResizableModule,NzCollapseModule,NzAutocompleteModule ]; diff --git a/IoTSharp/Controllers/Models/IPageParam.cs b/IoTSharp/Controllers/Models/IPageParam.cs index 2800169f..e0e099a0 100644 --- a/IoTSharp/Controllers/Models/IPageParam.cs +++ b/IoTSharp/Controllers/Models/IPageParam.cs @@ -33,8 +33,10 @@ namespace IoTSharp.Controllers.Models public class EventParam : IPageParam { public string Name { get; set; } + public string RuleName { get; set; } + public string CreatorName { get; set; } - public string Creator { get; set; } + public Guid? Creator { get; set; } public DateTime[] CreatTime { get; set; } } diff --git a/IoTSharp/Controllers/RulesController.cs b/IoTSharp/Controllers/RulesController.cs index e05fa52b..57379e85 100644 --- a/IoTSharp/Controllers/RulesController.cs +++ b/IoTSharp/Controllers/RulesController.cs @@ -1129,10 +1129,17 @@ namespace IoTSharp.Controllers condition = condition.And(x => x.CreaterDateTime > m.CreatTime[0] && x.CreaterDateTime < m.CreatTime[1]); } - //if (m.Creator!=null) - //{ - // condition = condition.And(x => x.Creator == m.Creator); - //} + if (!string.IsNullOrEmpty(m.RuleName)) + { + condition = condition.And(x => x.FlowRule.Name.Contains(m.RuleName)); + } + + + if (m.Creator!=null&&m.Creator!=Guid.Empty) + { + condition = condition.And(x => x.Creator==m.Creator.Value); + } + var result = _context.BaseEvents.OrderByDescending(c => c.CreaterDateTime).Where(condition) -- GitLab