Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
IoTSharp
IoTSharp
提交
1833cdf9
IoTSharp
项目概览
IoTSharp
/
IoTSharp
10 个月 前同步成功
通知
15
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
IoTSharp
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
1833cdf9
编写于
12月 23, 2021
作者:
W
wq1234wq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
事件搜索
上级
fc73350b
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
74 addition
and
64 deletion
+74
-64
IoTSharp/ClientApp/src/app/routes/flow/flowevents/flowevents.component.html
.../src/app/routes/flow/flowevents/flowevents.component.html
+10
-4
IoTSharp/ClientApp/src/app/routes/flow/flowevents/flowevents.component.ts
...pp/src/app/routes/flow/flowevents/flowevents.component.ts
+57
-45
IoTSharp/ClientApp/src/app/routes/flow/flowlist/flowlist.component.ts
...entApp/src/app/routes/flow/flowlist/flowlist.component.ts
+2
-2
IoTSharp/Controllers/Models/IPageParam.cs
IoTSharp/Controllers/Models/IPageParam.cs
+1
-1
IoTSharp/Controllers/RulesController.cs
IoTSharp/Controllers/RulesController.cs
+4
-12
未找到文件。
IoTSharp/ClientApp/src/app/routes/flow/flowevents/flowevents.component.html
浏览文件 @
1833cdf9
...
...
@@ -16,7 +16,12 @@
<nz-form-item>
<nz-form-label
nzFor=
"Name"
>
规则
</nz-form-label>
<nz-form-control>
<input
nz-input
[(ngModel)]=
"q.RuleName"
name=
"RuleName"
#UserName
placeholder=
"请输入"
/>
<nz-select
nzShowSearch
nzAllowClear
nzPlaceHolder=
"选择规则"
[(ngModel)]=
"q.RuleId"
name=
"RuleId"
>
<ng-container
*ngFor=
"let o of rules"
>
<nz-option
[nzValue]=
"o.ruleId"
[nzLabel]=
"o.name"
></nz-option>
</ng-container>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
...
...
@@ -24,10 +29,11 @@
<nz-form-item>
<nz-form-label
nzFor=
"Creator"
>
创建对象
</nz-form-label>
<nz-form-control>
<input
nz-input
[(ngModel)]=
"q.Creator"
(input)=
"onChange($event)"
name=
"Creator"
#UserPhone
placeholder=
"请输入"
[nzAutocomplete]=
"auto"
/>
<input
nz-input
[(ngModel)]=
"q.CreatorName"
(input)=
"onInput($event)"
(ngModelChange)=
"onChange($event)"
name=
"CreatorName"
placeholder=
"请输入"
[nzAutocomplete]=
"auto"
/>
<input
type=
"hidden"
[(ngModel)]=
"q.Creator"
name=
"Creator"
placeholder=
"请输入"
/>
<nz-autocomplete
#auto
>
<nz-auto-option
*ngFor=
"let option of devices"
[nzValue]=
"option.
value"
>
{{ option.text
}}
</nz-auto-option>
<nz-auto-option
*ngFor=
"let option of devices"
[nzValue]=
"option.
name"
>
{{ option.name
}}
</nz-auto-option>
</nz-autocomplete>
</nz-form-control>
...
...
@@ -37,7 +43,7 @@
<nz-form-item>
<nz-form-label
nzFor=
"CreatTime"
>
创建时间
</nz-form-label>
<nz-form-control>
<
input
nz-input
[(ngModel)]=
"q.CreatTime"
name=
"CreatTime"
placeholder=
"请输入"
/
>
<
nz-range-picker
[nzFormat]=
"dateFormat"
[(ngModel)]=
"q.CreatTime"
name=
"CreatTime"
placeholder=
"请输入"
></nz-range-picker
>
</nz-form-control>
</nz-form-item>
</div>
...
...
IoTSharp/ClientApp/src/app/routes/flow/flowevents/flowevents.component.ts
浏览文件 @
1833cdf9
...
...
@@ -14,9 +14,9 @@ import { FloweventviewComponent } from '../floweventview/floweventview.component
styleUrls
:
[
'
./flowevents.component.less
'
]
})
export
class
FloweventsComponent
implements
OnInit
{
devices
:
creator
[]
=
[{
value
:
Guid
.
EMPTY
,
text
:
'
测试
'
}];
TAG
:
STColumnTag
=
{
devices
:
creator
[]
=
[{
id
:
Guid
.
EMPTY
,
name
:
'
测试
'
}];
dateFormat
=
'
yyyy/MM/dd
'
TAG
:
STColumnTag
=
{
'
Normal
'
:
{
text
:
'
设备
'
,
color
:
'
green
'
},
'
TestPurpose
'
:
{
text
:
'
测试
'
,
color
:
'
orange
'
},
...
...
@@ -30,25 +30,27 @@ export class FloweventsComponent implements OnInit {
pi
:
number
;
ps
:
number
;
Name
:
string
;
Creator
:
string
;
RuleName
:
string
;
Creator
:
string
;
RuleId
:
string
;
CreatorName
:
string
;
CreatTime
:
Date
[];
sorter
:
string
;
status
:
number
|
null
;
}
=
{
pi
:
0
,
ps
:
10
,
Name
:
''
,
Creator
:
''
,
RuleName
:
''
,
CreatTime
:
[],
sorter
:
''
,
status
:
null
,
};
pi
:
0
,
ps
:
10
,
Name
:
''
,
Creator
:
''
,
RuleId
:
''
,
CreatorName
:
''
,
CreatTime
:
[],
sorter
:
''
,
status
:
null
,
};
total
=
0
;
loading
=
false
;
rules
=
[];
url
=
'
api/rules/flowevents
'
;
req
:
STReq
=
{
method
:
'
POST
'
,
allInBody
:
true
,
reName
:
{
pi
:
'
offset
'
,
ps
:
'
limit
'
},
params
:
this
.
q
};
...
...
@@ -65,7 +67,7 @@ export class FloweventsComponent implements OnInit {
columns
:
STColumn
[]
=
[
{
title
:
''
,
index
:
'
eventId
'
,
type
:
'
checkbox
'
},
{
title
:
'
事件名称
'
,
index
:
'
eventName
'
,
render
:
'
name
'
},
{
title
:
'
类型
'
,
index
:
'
type
'
,
type
:
'
tag
'
,
tag
:
this
.
TAG
},
{
title
:
'
类型
'
,
index
:
'
type
'
,
type
:
'
tag
'
,
tag
:
this
.
TAG
},
{
title
:
'
触发规则
'
,
index
:
'
name
'
},
{
title
:
'
事件源
'
,
index
:
'
creatorName
'
},
{
title
:
'
创建时间
'
,
type
:
'
date
'
,
index
:
'
createrDateTime
'
},
...
...
@@ -79,7 +81,7 @@ export class FloweventsComponent implements OnInit {
this
.
openComponent
(
item
);
},
},
],
},
];
...
...
@@ -89,7 +91,7 @@ export class FloweventsComponent implements OnInit {
expandForm
=
false
;
openComponent
(
event
:
baseevent
):
void
{
var
{
nzMaskClosable
,
width
}
=
this
.
settingService
.
getData
(
'
drawerconfig
'
);
var
title
=
'
回放
'
;
var
title
=
'
回放
'
;
const
drawerRef
=
this
.
drawerService
.
create
<
FloweventviewComponent
,
{
event
:
baseevent
},
string
>
({
nzTitle
:
title
,
nzContent
:
FloweventviewComponent
,
...
...
@@ -99,8 +101,8 @@ export class FloweventsComponent implements OnInit {
event
:
event
,
},
});
drawerRef
.
afterOpen
.
subscribe
(()
=>
{});
drawerRef
.
afterOpen
.
subscribe
(()
=>
{
});
drawerRef
.
afterClose
.
subscribe
((
data
)
=>
{
this
.
st
.
load
(
this
.
st
.
pi
);
...
...
@@ -108,52 +110,62 @@ export class FloweventsComponent implements OnInit {
}
});
}
onChange
(
$event
:
Event
){
var
element
=
$event
.
target
as
HTMLInputElement
this
.
http
.
get
(
'
api/Devices/Customers
'
,{
limit
:
20
,
offset
:
0
,
customerId
:
this
.
settingService
.
user
.
comstomer
,
name
:
element
?.
value
??
''
}).
pipe
(
debounceTime
(
500
)).
subscribe
(
next
=>
{},
error
=>
{},()
=>
{})
onInput
(
$event
:
Event
)
{
var
element
=
$event
.
target
as
HTMLInputElement
this
.
http
.
get
(
'
api/Devices/Customers
'
,
{
limit
:
20
,
offset
:
0
,
customerId
:
this
.
settingService
.
user
.
comstomer
,
name
:
element
?.
value
??
''
}).
pipe
(
debounceTime
(
500
)).
subscribe
(
next
=>
{
this
.
devices
=
[...
next
.
data
.
rows
.
map
(
x
=>
{
return
{
id
:
x
.
id
,
name
:
x
.
name
}
}),
{
id
:
Guid
.
EMPTY
,
name
:
'
测试
'
}]
},
error
=>
{
},
()
=>
{
})
}
onChange
(
$event
){
this
.
q
.
Creator
=
this
.
devices
.
find
(
c
=>
c
.
name
==
$event
)?.
id
}
getData
()
{
this
.
st
.
req
=
this
.
req
;
this
.
st
.
load
(
this
.
st
.
pi
);
}
reset
()
{
this
.
q
==
{
pi
:
0
,
ps
:
10
,
Name
:
''
,
Creator
:
''
,
RuleName
:
''
,
CreatTime
:
[],
sorter
:
''
,
status
:
null
,
};
this
.
q
=
{
pi
:
0
,
ps
:
10
,
Name
:
''
,
Creator
:
''
,
CreatorName
:
''
,
RuleId
:
''
,
CreatTime
:
[],
sorter
:
''
,
status
:
null
,
};
}
constructor
(
private
http
:
_HttpClient
,
public
msg
:
NzMessageService
,
private
drawerService
:
NzDrawerService
,
private
settingService
:
SettingsService
,
)
{
}
ngOnInit
():
void
{
this
.
http
.
post
(
'
api/rules/index
'
,
{
offset
:
0
,
limit
:
100
}).
subscribe
(
next
=>
{
this
.
rules
=
next
.
data
.
rows
;
},
error
=>
{
},
()
=>
{
})
}
}
export
interface
baseevent
{
export
interface
baseevent
{
eventId
:
string
;
eventName
:
string
;
eventName
:
string
;
eventDesc
:
string
;
eventStaus
:
string
;
type
:
string
;
...
...
@@ -167,7 +179,7 @@ export interface baseevent{
}
export
interface
creator
{
value
:
string
;
text
:
string
;
export
interface
creator
{
id
:
string
;
name
:
string
;
}
\ No newline at end of file
IoTSharp/ClientApp/src/app/routes/flow/flowlist/flowlist.component.ts
浏览文件 @
1833cdf9
...
...
@@ -28,11 +28,11 @@ export class FlowlistComponent implements OnInit {
)
{}
TAG
:
STColumnTag
=
{
1
:
{
text
:
'
遥测
'
,
color
:
'
g
reen
'
},
1
:
{
text
:
'
遥测
'
,
color
:
'
g
eekblue
'
},
2
:
{
text
:
'
属性
'
,
color
:
'
orange
'
},
0
:
{
text
:
'
RAW
'
,
color
:
'
blue
'
},
3
:
{
text
:
'
RPC
'
,
color
:
'
cyan
'
},
4
:
{
text
:
'
Online
'
,
color
:
'
lime
'
},
4
:
{
text
:
'
Online
'
,
color
:
'
green
'
},
5
:
{
text
:
'
Offline
'
,
color
:
'
red
'
},
};
page
:
STPage
=
{
...
...
IoTSharp/Controllers/Models/IPageParam.cs
浏览文件 @
1833cdf9
...
...
@@ -33,7 +33,7 @@ namespace IoTSharp.Controllers.Models
public
class
EventParam
:
IPageParam
{
public
string
Name
{
get
;
set
;
}
public
string
RuleName
{
get
;
set
;
}
public
Guid
?
RuleId
{
get
;
set
;
}
public
string
CreatorName
{
get
;
set
;
}
public
Guid
?
Creator
{
get
;
set
;
}
...
...
IoTSharp/Controllers/RulesController.cs
浏览文件 @
1833cdf9
...
...
@@ -1129,9 +1129,9 @@ namespace IoTSharp.Controllers
condition
=
condition
.
And
(
x
=>
x
.
CreaterDateTime
>
m
.
CreatTime
[
0
]
&&
x
.
CreaterDateTime
<
m
.
CreatTime
[
1
]);
}
if
(
!
string
.
IsNullOrEmpty
(
m
.
RuleName
)
)
if
(
m
.
RuleId
!=
null
)
{
condition
=
condition
.
And
(
x
=>
x
.
FlowRule
.
Name
.
Contains
(
m
.
RuleName
)
);
condition
=
condition
.
And
(
x
=>
x
.
FlowRule
.
RuleId
==
m
.
RuleId
);
}
...
...
@@ -1187,7 +1187,6 @@ namespace IoTSharp.Controllers
}
[
HttpGet
(
"[action]"
)]
public
ApiResult
<
dynamic
>
GetFlowOperations
(
Guid
eventId
)
{
...
...
@@ -1201,8 +1200,6 @@ namespace IoTSharp.Controllers
}
[
HttpGet
(
"[action]"
)]
public
ApiResult
<
dynamic
>
GetExecutors
()
{
...
...
@@ -1224,11 +1221,6 @@ namespace IoTSharp.Controllers
}
[
HttpGet
(
"[action]"
)]
public
async
Task
<
ApiResult
<
RuleTaskExecutor
>>
GetExecutor
(
Guid
Id
)
{
...
...
@@ -1279,7 +1271,7 @@ namespace IoTSharp.Controllers
executor
.
TypeName
=
m
.
ExecutorName
;
executor
.
Path
=
m
.
Path
;
executor
.
Tag
=
m
.
Tag
;
executor
.
Path
=
m
.
Path
;
_context
.
RuleTaskExecutors
.
Update
(
executor
);
await
_context
.
SaveChangesAsync
();
return
new
ApiResult
<
bool
>(
ApiCode
.
Success
,
"Ok"
,
true
);
...
...
@@ -1300,7 +1292,7 @@ namespace IoTSharp.Controllers
executor
.
TypeName
=
m
.
ExecutorName
;
executor
.
Path
=
m
.
Path
;
executor
.
Tag
=
m
.
Tag
;
executor
.
Path
=
m
.
Path
;
executor
.
AddDateTime
=
DateTime
.
Now
;
executor
.
Creator
=
profile
.
Id
;
executor
.
ExecutorStatus
=
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录