Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pseer
gxpt_web
Commits
4088de28
Commit
4088de28
authored
Jan 15, 2024
by
YG8999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备状态变更记录
parent
c4f8720e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
212 additions
and
0 deletions
+212
-0
statusLog.js
src/api/system/statusLog.js
+44
-0
index.vue
src/views/system/log/index.vue
+1
-0
index.vue
src/views/system/statusLog/index.vue
+167
-0
No files found.
src/api/system/statusLog.js
0 → 100644
View file @
4088de28
import
request
from
'@/utils/request'
// 查询设备状态变更记录列表
export
function
listLog
(
query
)
{
return
request
({
url
:
'/system/statusLog/list'
,
method
:
'get'
,
params
:
query
})
}
// 查询设备状态变更记录详细
export
function
getLog
(
id
)
{
return
request
({
url
:
'/system/statusLog/'
+
id
,
method
:
'get'
})
}
// 新增设备状态变更记录
export
function
addLog
(
data
)
{
return
request
({
url
:
'/system/statusLog'
,
method
:
'post'
,
data
:
data
})
}
// 修改设备状态变更记录
export
function
updateLog
(
data
)
{
return
request
({
url
:
'/system/statusLog'
,
method
:
'put'
,
data
:
data
})
}
// 删除设备状态变更记录
export
function
delLog
(
id
)
{
return
request
({
url
:
'/system/statusLog/'
+
id
,
method
:
'delete'
})
}
src/views/system/log/index.vue
View file @
4088de28
...
@@ -103,6 +103,7 @@
...
@@ -103,6 +103,7 @@
<el-table-column
label=
"消息描述"
align=
"center"
prop=
"mqttDescribe"
/>
<el-table-column
label=
"消息描述"
align=
"center"
prop=
"mqttDescribe"
/>
<!--
<el-table-column
label=
"消息主体参数"
align=
"center"
prop=
"payload"
/>
-->
<!--
<el-table-column
label=
"消息主体参数"
align=
"center"
prop=
"payload"
/>
-->
<el-table-column
label=
"消息主题"
align=
"center"
prop=
"topic"
/>
<el-table-column
label=
"消息主题"
align=
"center"
prop=
"topic"
/>
<el-table-column
label=
"操作人"
align=
"center"
prop=
"createBy"
/>
<el-table-column
label=
"记录时间"
align=
"center"
prop=
"createTime"
>
<el-table-column
label=
"记录时间"
align=
"center"
prop=
"createTime"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<span>
{{
parseTime
(
scope
.
row
.
createTime
,
'{y
}
-{m
}
-{d
}
{h
}
:{i
}
:{s
}
'
)
}}
<
/span
>
<span>
{{
parseTime
(
scope
.
row
.
createTime
,
'{y
}
-{m
}
-{d
}
{h
}
:{i
}
:{s
}
'
)
}}
<
/span
>
...
...
src/views/system/statusLog/index.vue
0 → 100644
View file @
4088de28
<
template
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"120px"
>
<el-form-item
label=
"设备id"
prop=
"devId"
>
<el-input
v-model=
"queryParams.devId"
placeholder=
"请输入设备id"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"是否异常"
prop=
"isAbnormal"
>
<el-select
v-model=
"queryParams.isAbnormal"
placeholder=
"请选择"
>
<el-option
lable=
"是"
:value=
"1"
>
是
</el-option>
<el-option
lable=
"否"
:value=
"0"
>
否
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"是否发送短信"
prop=
"isSendSms"
>
<el-select
v-model=
"queryParams.isSendSms"
placeholder=
"请选择"
>
<el-option
lable=
"是"
:value=
"1"
>
是
</el-option>
<el-option
lable=
"否"
:value=
"0"
>
否
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
</el-form>
<el-row
:gutter=
"10"
class=
"mb8"
>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
<el-table
v-loading=
"loading"
:data=
"logList"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"设备id"
align=
"center"
prop=
"devId"
/>
<el-table-column
label=
"设备mac"
align=
"center"
prop=
"devMac"
/>
<el-table-column
label=
"是否异常变更"
align=
"center"
prop=
"isAbnormal"
:formatter=
"(row) => filedFormatter(row.isAbnormal)"
/>
<el-table-column
label=
"变更前状态"
align=
"center"
prop=
"previousStatus"
>
<template
slot-scope=
"scope"
>
<dict-tag
:options=
"dict.type.device_status"
:value=
"scope.row.previousStatus"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"变更后状态"
align=
"center"
prop=
"status"
>
<
template
slot-scope=
"scope"
>
<dict-tag
:options=
"dict.type.device_status"
:value=
"scope.row.status"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"房间ID"
align=
"center"
prop=
"roomId"
/>
<el-table-column
label=
"电量、电压"
align=
"center"
prop=
"voltage"
/>
<el-table-column
label=
"信号值"
align=
"center"
prop=
"signalValue"
/>
<!-- <el-table-column label="备注" align="center" prop="remark" />-->
<el-table-column
label=
"变更操作记录id"
align=
"center"
prop=
"operateLogId"
/>
<el-table-column
label=
"是否已发送短信"
align=
"center"
prop=
"isSendSms"
:formatter=
"(row) => filedFormatter(row.isSendSms)"
/>
</el-table>
<pagination
v-show=
"total>0"
:total=
"total"
:page
.
sync=
"queryParams.pageNum"
:limit
.
sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
</div>
</template>
<
script
>
import
{
listLog
}
from
"@/api/system/statusLog"
;
export
default
{
name
:
"sLog"
,
dicts
:
[
'device_status'
],
data
()
{
return
{
// 遮罩层
loading
:
true
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
total
:
0
,
// 设备状态变更记录表格数据
logList
:
[],
// 弹出层标题
title
:
""
,
// 是否显示弹出层
open
:
false
,
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
devId
:
null
,
devMac
:
null
,
isAbnormal
:
null
,
status
:
null
,
roomId
:
null
,
operateLogId
:
null
,
isSendSms
:
null
},
// 表单参数
form
:
{},
// 表单校验
rules
:
{
}
};
},
created
()
{
this
.
getList
();
},
methods
:
{
/** 查询设备状态变更记录列表 */
getList
()
{
this
.
loading
=
true
;
listLog
(
this
.
queryParams
).
then
(
response
=>
{
this
.
logList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
});
},
// 取消按钮
cancel
()
{
this
.
open
=
false
;
this
.
reset
();
},
// 表单重置
reset
()
{
this
.
form
=
{
id
:
null
,
devId
:
null
,
devMac
:
null
,
isAbnormal
:
null
,
status
:
null
,
roomId
:
null
,
voltage
:
null
,
signalValue
:
null
,
createTime
:
null
,
updateTime
:
null
,
remark
:
null
,
operateLogId
:
null
,
isSendSms
:
null
,
previousStatus
:
null
};
this
.
resetForm
(
"form"
);
},
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
"queryForm"
);
this
.
handleQuery
();
},
filedFormatter
(
value
)
{
return
value
===
1
?
'是'
:
'否'
;
}
}
};
</
script
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment