Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zhongtong-avi-web
Project
Project
Details
Activity
Releases
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
中通客车项目
zhongtong-avi-web
Commits
ecdb5282
Commit
ecdb5282
authored
Sep 23, 2019
by
李志鸣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fea(设备故障/报警记录): 功能联调
parent
b7e9c338
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
93 additions
and
7 deletions
+93
-7
list.vue
src/views/DeviceRunning/DeviceFaultRecord/list.vue
+93
-7
No files found.
src/views/DeviceRunning/DeviceFaultRecord/list.vue
View file @
ecdb5282
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<span
class=
"page-title-text"
>
设备故障/报警记录
</span>
<span
class=
"page-title-text"
>
设备故障/报警记录
</span>
</div>
</div>
<div
class=
"float-right page-refresh"
>
<div
class=
"float-right page-refresh"
>
<span
@
click=
"doRefreshClick
()
"
class=
"pointer"
>
<span
@
click=
"doRefreshClick"
class=
"pointer"
>
<svg-icon
icon-class=
"refresh"
></svg-icon>
<svg-icon
icon-class=
"refresh"
></svg-icon>
<span
class=
"ml-10"
>
刷新
</span>
<span
class=
"ml-10"
>
刷新
</span>
</span>
</span>
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
</div>
</div>
<div
class=
"tool-pack clear-float pl-15 pr-15"
>
<div
class=
"tool-pack clear-float pl-15 pr-15"
>
<Search
<Search
searchCode=
"MA
TERIEL
_RECORD"
searchCode=
"MA
CHINE_WARNING
_RECORD"
@
search=
"doSearchClick"
@
search=
"doSearchClick"
@
reset=
"doResetClick"
>
@
reset=
"doResetClick"
>
</Search>
</Search>
...
@@ -21,7 +21,20 @@
...
@@ -21,7 +21,20 @@
<div
class=
"general-list-main-pack pl-15 pr-15"
>
<div
class=
"general-list-main-pack pl-15 pr-15"
>
<div>
<div>
<Table
<Table
:tableConfig=
"tableConfig"
>
:tableConfig=
"tableConfig"
@
onPageSizeChange=
"onSizeChange"
@
onCurrentPageChange=
"onCurrentChange"
>
<template
slot=
"beginTime"
>
<el-table-column
label=
"时间"
prop=
"beginTime"
show-overflow-tooltip
>
<template
slot-scope=
"scope"
>
<span
v-if=
"scope.row.beginTime === '' || scope.row.beginTime === null || scope.row.beginTime === undefined"
>
暂无
</span>
<span
v-else
>
{{
formatTime
(
scope
.
row
.
beginTime
,
'YYYY-MM-DD HH:mm:ss'
)
}}
</span>
</
template
>
</el-table-column>
</template>
</Table>
</Table>
</div>
</div>
</div>
</div>
...
@@ -29,6 +42,8 @@
...
@@ -29,6 +42,8 @@
</template>
</template>
<
script
>
<
script
>
import
Moment
from
'moment'
import
Table
from
'@/components/Table/index.vue'
import
Table
from
'@/components/Table/index.vue'
import
Search
from
'@/components/Search'
import
Search
from
'@/components/Search'
...
@@ -40,11 +55,19 @@
...
@@ -40,11 +55,19 @@
},
},
data
()
{
data
()
{
return
{
return
{
// 精准搜索关键字列表
searchList
:
{},
// 表格配置项
// 表格配置项
tableConfig
:
{
tableConfig
:
{
height
:
0
,
height
:
0
,
data
:
[],
data
:
[],
fieldList
:
[],
fieldList
:
[
{
label
:
'车间'
,
value
:
'workshopCode'
},
{
label
:
'设备编号'
,
value
:
'equipCode'
},
{
label
:
'设备名称'
,
value
:
'alias'
},
{
label
:
'故障信息'
,
value
:
'warningInfo'
},
{
label
:
'时间'
,
value
:
'beginTime'
,
slot
:
'beginTime'
}
],
paginationToggle
:
true
,
paginationToggle
:
true
,
paginationConfig
:
{
paginationConfig
:
{
total
:
0
,
total
:
0
,
...
@@ -55,16 +78,78 @@
...
@@ -55,16 +78,78 @@
}
}
},
},
methods
:
{
methods
:
{
// 时间日期格式化
formatTime
(
time
,
format
)
{
if
(
time
!==
null
&&
time
!==
''
)
{
return
Moment
(
time
).
format
(
format
)
}
else
{
return
'暂无'
}
},
// 点击刷新按钮
// 点击刷新按钮
doRefreshClick
()
{},
doRefreshClick
()
{
this
.
getTableList
().
then
(
response
=>
{
this
.
$message
.
success
(
'刷新成功!'
)
})
},
// 点击搜索组件搜索按钮
// 点击搜索组件搜索按钮
doSearchClick
()
{},
doSearchClick
(
searchValue
)
{
this
.
searchList
=
searchValue
this
.
tableConfig
.
paginationConfig
.
currentPage
=
1
// 获取表格数据
this
.
getTableLIst
()
},
// 点击搜索组件重置按钮
// 点击搜索组件重置按钮
doResetClick
()
{}
doResetClick
(
searchValue
)
{
this
.
searchList
=
{
...
searchList
,
filters
:
[]
}
this
.
tableConfig
.
paginationConfig
.
currentPage
=
1
this
.
tableConfig
.
paginationConfig
.
pageSize
=
20
// 获取表格数据
this
.
getTableLIst
()
},
// 获取表格数据
getTableList
()
{
let
queryParams
=
{
searchCode
:
this
.
searchList
.
searchCode
||
'MACHINE_WARNING_RECORD'
,
filters
:
this
.
searchList
.
filters
||
[],
pageSize
:
this
.
tableConfig
.
paginationConfig
.
pageSize
,
pageNum
:
this
.
tableConfig
.
paginationConfig
.
currentPage
}
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
$fetch
(
'run-record-controller/faultPage-post'
,
queryParams
).
then
(
response
=>
{
if
(
response
.
list
.
length
===
0
&&
response
.
pageNum
!==
1
)
{
this
.
tableConfig
.
paginationConfig
.
currentPage
-=
1
// 获取表格数据
this
.
getTableList
()
}
else
{
this
.
tableConfig
.
data
=
_
.
cloneDeep
(
response
.
list
)
this
.
tableConfig
.
paginationConfig
.
total
=
_
.
cloneDeep
(
response
.
total
)
resolve
(
response
)
}
}).
catch
(
error
=>
{
reject
(
error
)
})
})
},
// 当前分页数量发生了变化
onSizeChange
(
pageSize
)
{
this
.
tableConfig
.
paginationConfig
.
currentPage
=
1
this
.
tableConfig
.
paginationConfig
.
pageSize
=
pageSize
// 获取表格数据
this
.
getTableLIst
()
},
// 当前分页页数发生了变化
onCurrentChange
(
currentPage
)
{
this
.
tableConfig
.
paginationConfig
.
currentPage
=
currentPage
// 获取表格数据
this
.
getTableLIst
()
}
},
},
mounted
()
{
mounted
()
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
tableConfig
.
height
=
document
.
querySelector
(
'.page-pack'
).
offsetHeight
-
180
this
.
tableConfig
.
height
=
document
.
querySelector
(
'.page-pack'
).
offsetHeight
-
180
// 获取表格数据
this
.
getTableList
()
},
0
)
},
0
)
}
}
}
}
...
@@ -77,6 +162,7 @@
...
@@ -77,6 +162,7 @@
width
:
100%
;
width
:
100%
;
border
:
1px
solid
#d2d3d5
;
border
:
1px
solid
#d2d3d5
;
background-color
:
#fff
;
background-color
:
#fff
;
overflow-y
:
auto
;
.title-pack
{
.title-pack
{
height
:
38px
;
height
:
38px
;
...
...
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