Toggle navigation
Toggle navigation
This project
Loading...
Sign in
monitor_v3
/
hg-monitor-web
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
袁晋鹏
2 years ago
Commit
1776381dafb4ec52aefa02ca08e85621bec2bf31
1 parent
cb172c81
fix:工作日志查看新增下一条点击功能
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
105 additions
and
33 deletions
hg-monitor-web-base/src/main/resources/static/src/controller/workReportAdd.js
hg-monitor-web-base/src/main/resources/static/src/controller/workReportIndex.js
hg-monitor-web-base/src/main/resources/static/src/controller/workReportView.js
hg-monitor-web-base/src/main/resources/static/src/views/workreport/add.html
hg-monitor-web-base/src/main/resources/static/src/views/workreport/index.html
hg-monitor-web-base/src/main/resources/static/src/views/workreport/view/index.html
hg-monitor-web-base/src/main/resources/static/src/controller/workReportAdd.js
View file @
1776381
...
...
@@ -27,7 +27,8 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect
var
where
=
{}
var
url
=
''
var
historywarningTable
=
{}
var
datas
=
data
.
datas
;
var
nextId
=
id
;
var
viewType
=
data
&&
data
.
viewType
?
data
.
viewType
:
''
;
init
()
$
(
'#workReport_type'
).
val
(
data
.
repType
)
...
...
@@ -49,6 +50,81 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect
saveForm
()
}
})
$
(
"#workReport-form-next-id"
).
on
(
'click'
,
function
()
{
if
(
datas
.
length
>
0
)
{
var
datas1
=
{};
for
(
let
i
=
0
;
i
<
datas
.
length
;
i
++
)
{
if
(
datas
[
i
].
id
==
nextId
)
{
datas1
=
datas
[(
datas
[
i
].
LAY_TABLE_INDEX
+
1
)];
if
(
datas1
!=
undefined
)
{
nextId
=
datas1
.
id
;
var
title
=
datas1
.
createUserNickName
+
'-'
+
datas1
.
repTitle
// window.parent.postMessage({'title':title},"*");
$
(
".layui-card-body.workReport"
).
find
(
".layui-field-title"
).
html
(
"<legend>"
+
title
+
"</legend>"
);
form
.
render
(
null
,
'add-workReport-form'
);
form
.
val
(
'add-workReport-form'
,
datas1
);
var
time
=
''
time
=
datas1
.
createTime
var
userArr
=
[]
$
.
each
(
datas1
.
reportUserList
,
function
(
i
,
v
)
{
userArr
.
push
(
v
.
userName
)
})
userSelect
.
setValue
(
userArr
)
if
(
datas1
.
attachmentList
.
length
!=
0
)
{
$
.
each
(
datas1
.
attachmentList
,
function
(
i
,
v
)
{
writeTagsInfo
(
v
.
id
,
v
.
originalName
)
})
}
cols
.
push
({
field
:
'alarmStatus'
,
title
:
'告警状态'
,
align
:
'center'
,
minWidth
:
100
,
templet
:
function
(
d
)
{
var
str
=
''
if
(
d
.
alarmStatus
==
'0'
)
{
str
=
'告警'
}
else
if
(
d
.
alarmStatus
==
'1'
)
{
str
=
'关闭'
}
return
`
<
div
><
span
>
$
{
str
}
<
/span></
div
>
`
}
}
,
{
field
:
'clearType'
,
title
:
'消除类型'
,
align
:
'center'
,
minWidth
:
100
,
templet
:
function
(
d
)
{
var
str
=
''
if
(
d
.
clearType
==
'0'
)
{
str
=
'自动消除'
}
else
if
(
d
.
clearType
==
'1'
)
{
str
=
'手动消除'
}
return
`
<
div
><
span
>
$
{
str
}
<
/span></
div
>
`
}
}
,
{
field
:
'clearUserId'
,
title
:
'消除人'
,
align
:
'center'
,
minWidth
:
100
,}
,
{
field
:
'clearTime'
,
title
:
'消除时间'
,
align
:
'center'
,
minWidth
:
180
,}
,
{
field
:
'clearReason'
,
title
:
'消除原因'
,
align
:
'center'
,
minWidth
:
250
})
where
=
{
access_token
:
accessToken
,
reportId
:
nextId
,
time
:
time
}
url
=
domainName
+
'/api-web/workreport/getAlarmListByReportId'
getAlarmInfo
(
where
,
cols
,
url
)
admin
.
req
({
url
:
domainName
+
'/api-web/workreport/setRead'
,
data
:
{
workReportIds
:
[
nextId
]}
}).
done
(
function
(
response
)
{
if
(
response
.
success
)
{
}
});
return
;
}
else
{
layer
.
msg
(
'当前页已读完'
,
{
offset
:
'15px'
,
icon
:
7
,
time
:
1000
,
})
}
}
}
}
})
//表单验证
form
.
verify
({
...
...
@@ -225,7 +301,10 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect
async
:
false
,
done
:
function
(
res
)
{
form
.
val
(
'add-workReport-form'
,
res
.
object
)
time
=
res
.
object
.
createTime
time
=
res
.
object
.
createTime
;
var
title
=
res
.
object
.
createUserNickName
+
'-'
+
res
.
object
.
repTitle
// window.parent.postMessage({'title':title},"*");
$
(
".layui-card-body.workReport"
).
find
(
".layui-field-title"
).
html
(
" <legend>"
+
title
+
"</legend>"
);
var
userArr
=
[]
$
.
each
(
res
.
object
.
reportUserList
,
function
(
i
,
v
)
{
userArr
.
push
(
v
.
userName
)
...
...
hg-monitor-web-base/src/main/resources/static/src/controller/workReportIndex.js
View file @
1776381
...
...
@@ -12,7 +12,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function
//对外暴露的接口
exports
(
"workReportIndex"
,
function
()
{
var
accessToken
=
common
.
getMjToken
();
var
createTime
=
't
oday
'
var
createTime
=
't
hisWeek
'
var
isRead
=
''
var
repType
=
''
...
...
hg-monitor-web-base/src/main/resources/static/src/controller/workReportView.js
View file @
1776381
...
...
@@ -15,7 +15,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
var
companyChart
=
echarts
.
init
(
document
.
getElementById
(
'chart-company-report'
));
var
noReadChart
=
echarts
.
init
(
document
.
getElementById
(
'chart-noRead-report'
));
var
dateLimit
=
""
var
createTime
=
"t
oday
"
var
createTime
=
"t
hisWeek
"
var
type
=
''
var
urlRepType
=
''
var
manufacturerId
=
''
...
...
@@ -55,7 +55,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
done
:
function
(
value
)
{
dateLimit
=
value
if
(
dateLimit
==
''
)
{
$
(
'[data-period="t
oday
"]'
).
click
()
$
(
'[data-period="t
hisWeek
"]'
).
click
()
}
else
{
$
.
each
(
$
(
"button.date"
),
function
(
i
,
e
)
{
var
$dom
=
$
(
e
);
...
...
@@ -166,13 +166,13 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
// 加载工作汇报表格
function
loadWorkReportTable
()
{
var
conditions
=
form
.
val
(
'form-workreport-condition'
);
$
.
each
(
$
(
"button.isRead"
),
function
(
i
,
e
)
{
$
.
each
(
$
(
"button.isRead"
),
function
(
i
,
e
)
{
var
$dom
=
$
(
e
);
if
(
$dom
.
hasClass
(
"active"
))
{
if
(
$dom
.
hasClass
(
"active"
))
{
conditions
[
"currIsRead"
]
=
$dom
.
data
(
"type"
)
}
})
if
(
manufacturerId
!=
''
)
{
if
(
manufacturerId
!=
''
)
{
conditions
.
manufacturerName
=
manufacturerId
;
}
Object
.
assign
(
conditions
,
{
...
...
@@ -265,17 +265,14 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
},
{
field
:
'manufacturerName'
,
title
:
'厂商'
,
align
:
'center'
,
templet
:
function
(
d
)
{
var
manufacturerName
=
''
;
if
(
d
.
manufacturerName
==
'0'
){
manufacturerName
=
d
.
manufacturerOther
;
}
else
{
if
(
manufactureArr
&&
manufactureArr
.
length
>
0
){
$
.
each
(
manufactureArr
,
function
(
i
,
v
)
{
if
(
d
.
manufacturer
Name
==
v
.
id
)
{
if
(
d
.
manufacturer
Id
==
v
.
id
)
{
manufacturerName
=
v
.
name
;
}
})
}
else
{
var
url
=
domainName
+
'/cmdb-CI/supplier/find/'
+
d
.
ma
chineRoom
Id
+
'?accessToken='
+
accessToken
var
url
=
domainName
+
'/cmdb-CI/supplier/find/'
+
d
.
ma
nufacturer
Id
+
'?accessToken='
+
accessToken
$
.
ajax
({
url
:
url
,
success
:
function
(
res
){
...
...
@@ -285,8 +282,8 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
}
});
}
}
return
manufacturerName
;
return
'<div><span>'
+
manufacturerName
+
'</span></div>'
;
}
},
{
field
:
'createTime'
,
title
:
'上报时间'
,
align
:
'center'
,
...
...
@@ -307,8 +304,8 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
table
.
on
(
'tool(table-workreport-view)'
,
function
(
obj
)
{
var
data
=
obj
.
data
;
if
(
obj
.
event
===
'serRead'
)
{
var
id
=
data
[
'id'
];
var
datas
=
layui
.
table
.
cache
[
"table-workreport-view"
];
var
repType
=
data
[
'repType'
];
admin
.
req
({
url
:
domainName
+
'/api-web/workreport/setRead'
,
...
...
@@ -318,20 +315,13 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
obj
.
update
({
currIsRead
:
"1"
});
loadReadReport
();
reloadAllChange
();
}
});
common
.
openWin
(
'workreport/add'
,
'查看'
,
{
id
:
id
,
repType
:
repType
,
viewType
:
'view'
},
[
'关闭'
],
function
f
()
{
return
true
;
},
null
,
null
,
{
success
:
function
()
{
form
.
render
();
}
})
common
.
openWin
(
'workreport/add'
,
'查看'
,
{
id
:
id
,
repType
:
repType
,
viewType
:
'view'
,
datas
:
datas
},
[
'下一条'
,
'关闭'
],
function
f
()
{
$
(
"#workReport-form-next-id"
).
trigger
(
"click"
);
reloadAllChange
();
});
}
});
...
...
hg-monitor-web-base/src/main/resources/static/src/views/workreport/add.html
View file @
1776381
<!--工作汇报表单-->
<article>
<div
class=
"layui-card-body"
>
<div
class=
"layui-card-body
workReport
"
>
<fieldset
class=
"layui-elem-field layui-field-title"
>
<legend>
日志信息
</legend>
</fieldset>
...
...
@@ -103,6 +103,9 @@
<button
class=
"layui-btn hide"
id=
"workReport-form-save-id"
lay-filter=
"workReport-form-save-id"
lay-submit
type=
"submit"
>
保存
</button>
<button
type=
"button"
lay-filter=
"workReport-form-next-id"
class=
"layui-btn hide"
id=
"workReport-form-next-id"
>
下一条
</button>
<table
class=
"hide"
id=
"table-report-add-attachment"
></table>
</form>
</div>
...
...
hg-monitor-web-base/src/main/resources/static/src/views/workreport/index.html
View file @
1776381
...
...
@@ -49,13 +49,13 @@
</
div
>
</
div
>
<
div
class
=
"
layui-inline
layui-btn-group
time-group
"
id
=
"
createTimeBtn
"
>
<
button
class
=
"
layui-btn
layui-btn-primary
layui-btn-sm
active
"
data-period
=
"
today
"
<
button
class
=
"
layui-btn
layui-btn-primary
layui-btn-sm
"
data-period
=
"
today
"
type
=
"
button
"
>
今天
</
button
>
<
button
class
=
"
layui-btn
layui-btn-primary
layui-btn-sm
"
data-period
=
"
lastWeek
"
type
=
"
button
"
>
上周
</
button
>
<
button
class
=
"
layui-btn
layui-btn-primary
layui-btn-sm
"
data-period
=
"
thisWeek
"
<
button
class
=
"
layui-btn
layui-btn-primary
layui-btn-sm
active
"
data-period
=
"
thisWeek
"
type
=
"
button
"
>
本周
</
button
>
<
button
class
=
"
layui-btn
layui-btn-primary
layui-btn-sm
"
data-period
=
"
lastMonth
"
...
...
hg-monitor-web-base/src/main/resources/static/src/views/workreport/view/index.html
View file @
1776381
...
...
@@ -59,13 +59,13 @@
</div>
</div>
<div
class=
"layui-btn-group time-group"
id=
"btns-workreport-time"
style=
"padding: 0"
>
<button
class=
"layui-btn layui-btn-primary layui-btn-xs
active
date"
data-period=
"today"
<button
class=
"layui-btn layui-btn-primary layui-btn-xs date"
data-period=
"today"
type=
"button"
>
今天
</button>
<button
class=
"layui-btn layui-btn-primary layui-btn-xs date"
data-period=
"lastWeek"
type=
"button"
>
上周
</button>
<button
class=
"layui-btn layui-btn-primary layui-btn-xs date"
data-period=
"thisWeek"
<button
class=
"layui-btn layui-btn-primary layui-btn-xs
active
date"
data-period=
"thisWeek"
type=
"button"
>
本周
</button>
<button
class=
"layui-btn layui-btn-primary layui-btn-xs date"
data-period=
"lastMonth"
...
...
Please
register
or
login
to post a comment