Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hg-smart
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
platform
hg-smart
Commits
c1ae1a43
Commit
c1ae1a43
authored
Oct 21, 2024
by
lyy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备驾驶舱
parent
a5c5fee2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
304 additions
and
95 deletions
+304
-95
HGBI003.jsp
src/main/webapp/HG/BI/HGBI003.jsp
+303
-94
left-manage-device.vue
...n/webapp/HG/BI/components/hipi/001/left-manage-device.vue
+1
-1
No files found.
src/main/webapp/HG/BI/HGBI003.jsp
View file @
c1ae1a43
...
...
@@ -191,25 +191,27 @@
</div>
</div>
<div
class=
"left-device device"
style=
"margin-left: 2vw;"
>
<div
class=
"device-echarts-background"
>
<manage-echarts
:option=
"testOption1"
:width=
"17"
:height=
"24"
></manage-echarts>
<div
v-for=
"(item,index) in querySbYesList"
:key=
"index"
class=
"device-echarts-background"
>
<manage-echarts
:option=
"item.option"
:width=
"17"
:height=
"23"
></manage-echarts>
</div>
<div
class=
"device-echarts-background"
>
<manage-echarts
:option=
"
testOption1"
:width=
"17"
:height=
"24
"
></manage-echarts>
<manage-echarts
:option=
"
lineOption1"
:width=
"17"
:height=
"23
"
></manage-echarts>
</div>
<div
class=
"device-echarts-background"
>
<manage-echarts
:option=
"
testOption1"
:width=
"17"
:height=
"24
"
></manage-echarts>
<manage-echarts
:option=
"
lineOption1"
:width=
"17"
:height=
"23
"
></manage-echarts>
</div>
</div>
<div
class=
"left-device device"
style=
"margin-left: 2vw;"
>
<div
class=
"device-echarts-background"
>
<manage-echarts
:option=
"testOption2"
:width=
"17"
:height=
"24"
></manage-echarts>
<div
v-for=
"(item,index) in querySbNoList"
:key=
"index"
class=
"device-echarts-background"
>
<manage-echarts
:option=
"item.option"
:width=
"17"
:height=
"23"
></manage-echarts>
</div>
<div
class=
"device-echarts-background"
>
<manage-echarts
:option=
"
testOption2"
:width=
"17"
:height=
"24
"
></manage-echarts>
<manage-echarts
:option=
"
lineOption2"
:width=
"17"
:height=
"23
"
></manage-echarts>
</div>
<div
class=
"device-echarts-background"
>
<manage-echarts
:option=
"
testOption2"
:width=
"17"
:height=
"24
"
></manage-echarts>
<manage-echarts
:option=
"
lineOption2"
:width=
"17"
:height=
"23
"
></manage-echarts>
</div>
</div>
</div>
...
...
@@ -230,13 +232,288 @@
data
()
{
return
{
date
:
new
Date
(),
option1
:
{},
optionDate1
:
{},
option2
:
{},
optionDate2
:
{},
option3
:
{},
optionDate3
:
{},
testOption1
:{
testOption1
:{},
testOption2
:{},
factory
:
''
,
factoryList
:[],
dataPicker
:
''
,
queryBySbStatusList
:[],
querySbYesList
:[],
querySbYesDate
:[],
querySbNoList
:[],
querySbNODate
:[],
};
},
mounted
()
{
this
.
getYesterdayDateFormatted
();
setInterval
(()
=>
{
this
.
date
=
new
Date
();
// 更新日期时间
},
1000
);
this
.
getRoleFactory
();
this
.
queryBySbStatus
();
this
.
querySbYes
();
this
.
querySbNo
();
this
.
setOption
();
this
.
setOption2
();
setTimeout
(
function
()
{
window
.
location
.
reload
();
},
60000
);
},
methods
:
{
formatTime
(
currentTime
)
{
const
formattedTime
=
currentTime
.
getFullYear
()
+
"-"
+
(
currentTime
.
getMonth
()
+
1
)
+
"-"
+
currentTime
.
getDate
()
+
" "
+
currentTime
.
getHours
()
+
":"
+
currentTime
.
getMinutes
()
+
":"
+
currentTime
.
getSeconds
();
return
formattedTime
;
},
getYesterdayDateFormatted
()
{
const
today
=
new
Date
();
today
.
setDate
(
today
.
getDate
()
-
1
);
const
year
=
today
.
getFullYear
();
const
month
=
String
(
today
.
getMonth
()
+
1
).
padStart
(
2
,
'0'
);
// 月份从0开始,所以要加1
const
day
=
String
(
today
.
getDate
()).
padStart
(
2
,
'0'
);
const
formattedDate
=
year
+
month
+
day
;
this
.
dataPicker
=
formattedDate
;
},
getRoleFactory
(){
let
_this
=
this
;
var
inInfo
=
new
EiInfo
();
IPLAT
.
EiCommunicator
.
send
(
'HGSC007'
,
'getByRoleFactory'
,
inInfo
,
{
onSuccess
:
function
(
res
)
{
_this
.
factoryList
=
res
.
extAttr
.
result
_this
.
factory
=
res
.
extAttr
.
result
[
0
].
factoryCode
console
.
log
(
'_this.factoryList'
,
_this
.
factoryList
)
console
.
log
(
'factory'
,
_this
.
factory
)
},
onFail
:
function
(
err
)
{
console
.
error
(
'request_tools----------------->错误信息'
,
err
);
}
},
{
async
:
false
}
);
},
handledataPicker
(){
this
.
queryBySbStatus
();
this
.
querySbYes
();
this
.
querySbNo
();
},
queryBySbStatus
(){
let
_this
=
this
;
var
inInfo
=
new
EiInfo
();
inInfo
.
set
(
'inqu_status-0-factoryCode'
,
this
.
factory
)
inInfo
.
set
(
'inqu_status-0-date'
,
this
.
dataPicker
)
IPLAT
.
EiCommunicator
.
send
(
'HGSB010'
,
'queryBySbStatus'
,
inInfo
,
{
onSuccess
:
function
(
res
)
{
console
.
log
(
'queryBySbStatus'
,
res
)
if
(
undefined
!=
res
.
extAttr
.
result
){
_this
.
queryBySbStatusList
=
res
.
extAttr
.
result
;
}
_this
.
queryBySbStatusList
.
push
({
deviceName
:
'切割机'
,
status
:
'关机'
,
deviceModel
:
'MZ-1250'
,
})
_this
.
queryBySbStatusList
.
push
({
deviceName
:
'焊接机'
,
status
:
'关机'
,
deviceModel
:
'H9830'
,
})
},
onFail
:
function
(
err
)
{
console
.
error
(
'request_tools----------------->错误信息'
,
err
);
}
},
{
async
:
false
}
);
},
querySbYes
(){
let
_this
=
this
;
var
inInfo
=
new
EiInfo
();
inInfo
.
set
(
'inqu_status-0-factoryCode'
,
this
.
factory
)
inInfo
.
set
(
'inqu_status-0-date'
,
this
.
dataPicker
)
IPLAT
.
EiCommunicator
.
send
(
'HGSB010'
,
'querySbYes'
,
inInfo
,
{
onSuccess
:
function
(
res
)
{
console
.
log
(
'querySbYes'
,
res
)
if
(
undefined
!=
res
.
extAttr
.
result
[
0
]){
const
dataList
=
res
.
extAttr
.
result
;
_this
.
querySbYesDate
=
res
.
extAttr
.
date
;
_this
.
querySbYesList
=
dataList
.
map
((
item
,
index
)
=>
{
const
getChartOptionByIndex
=
(
index
)
=>
{
return
{
title
:
{
left
:
'left'
,
text
:
'设备作业时长/小时'
,
textStyle
:
{
color
:
'#ffffff'
// 设置标题字体颜色为白色
}
},
xAxis
:
{
type
:
'category'
,
data
:
_this
.
querySbYesDate
,
axisLabel
:
{
textStyle
:
{
color
:
'#ffffff'
// 设置y轴标签字体颜色为白色
}
}
},
yAxis
:
{
type
:
'value'
,
data
:
[
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
],
axisLabel
:
{
textStyle
:
{
color
:
'#ffffff'
// 设置y轴标签字体颜色为白色
}
}
},
grid
:
{
top
:
'17%'
,
// 图表距离容器顶部的距离
bottom
:
'2%'
,
// 图表距离容器底部的距离,为下方的文字留出空间
left
:
'2%'
,
right
:
'2%'
,
containLabel
:
true
// 确保标签(如坐标轴标签)在网格内
},
series
:
[
{
data
:
dataList
[
index
].
data
,
type
:
'line'
,
smooth
:
true
,
itemStyle
:
{
color
:
'#01b9ff'
},
areaStyle
:
{
color
:
'#245085'
},
}
]
};
};
// 返回包含正确 option 属性的对象
return
{
...
item
,
option
:
getChartOptionByIndex
(
index
)
// 现在这里是一个对象,而不是字符串
};
});
}
else
{
_this
.
querySbYesList
=
[]
_this
.
querySbYesDate
=
[]
}
console
.
log
(
'querySbYesList'
,
_this
.
querySbYesList
)
},
onFail
:
function
(
err
)
{
console
.
error
(
'request_tools----------------->错误信息'
,
err
);
}
},
{
async
:
false
}
);
},
querySbNo
(){
let
_this
=
this
;
var
inInfo
=
new
EiInfo
();
inInfo
.
set
(
'inqu_status-0-factoryCode'
,
this
.
factory
)
inInfo
.
set
(
'inqu_status-0-date'
,
this
.
dataPicker
)
IPLAT
.
EiCommunicator
.
send
(
'HGSB010'
,
'querySbNo'
,
inInfo
,
{
onSuccess
:
function
(
res
)
{
console
.
log
(
'querySbNo'
,
res
)
if
(
undefined
!=
res
.
extAttr
.
result
[
0
]){
const
dataList
=
res
.
extAttr
.
result
;
_this
.
querySbNODate
=
res
.
extAttr
.
date
;
_this
.
querySbNoList
=
dataList
.
map
((
item
,
index
)
=>
{
const
getChartOptionByIndex
=
(
index
)
=>
{
return
{
title
:
{
left
:
'left'
,
text
:
'设备故障次数/小时'
,
textStyle
:
{
color
:
'#ffffff'
// 设置标题字体颜色为白色
}
},
xAxis
:
{
type
:
'category'
,
data
:
_this
.
querySbNODate
,
axisLabel
:
{
textStyle
:
{
color
:
'#ffffff'
// 设置y轴标签字体颜色为白色
}
}
},
yAxis
:
{
type
:
'value'
,
data
:
[
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
],
axisLabel
:
{
textStyle
:
{
color
:
'#ffffff'
// 设置y轴标签字体颜色为白色
}
}
},
grid
:
{
top
:
'13%'
,
// 图表距离容器顶部的距离
bottom
:
'2%'
,
// 图表距离容器底部的距离,为下方的文字留出空间
left
:
'2%'
,
right
:
'2%'
,
containLabel
:
true
// 确保标签(如坐标轴标签)在网格内
},
series
:
[
{
data
:
dataList
[
index
].
data
,
type
:
'line'
,
smooth
:
true
,
itemStyle
:
{
color
:
'#01b9ff'
},
areaStyle
:
{
color
:
'#245085'
},
}
]
};
};
// 返回包含正确 option 属性的对象
return
{
...
item
,
option
:
getChartOptionByIndex
(
index
)
// 现在这里是一个对象,而不是字符串
};
});
}
else
{
_this
.
querySbNoList
=
[]
_this
.
querySbNODate
=
[]
}
},
onFail
:
function
(
err
)
{
console
.
error
(
'request_tools----------------->错误信息'
,
err
);
}
},
{
async
:
false
}
);
},
setOption
(){
this
.
testOption1
=
{
title
:
{
left
:
'left'
,
text
:
'设备作业时长/小时'
,
...
...
@@ -246,7 +523,7 @@
},
xAxis
:
{
type
:
'category'
,
data
:
[
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
]
,
data
:
this
.
querySbYesDate
,
axisLabel
:
{
textStyle
:
{
color
:
'#ffffff'
// 设置y轴标签字体颜色为白色
...
...
@@ -255,7 +532,6 @@
},
yAxis
:
{
type
:
'value'
,
data
:
[
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
],
axisLabel
:
{
textStyle
:
{
color
:
'#ffffff'
// 设置y轴标签字体颜色为白色
...
...
@@ -264,7 +540,7 @@
},
grid
:
{
top
:
'1
3
%'
,
// 图表距离容器顶部的距离
top
:
'1
7
%'
,
// 图表距离容器顶部的距离
bottom
:
'2%'
,
// 图表距离容器底部的距离,为下方的文字留出空间
left
:
'2%'
,
right
:
'2%'
,
...
...
@@ -285,8 +561,10 @@
]
},
testOption2
:{
}
},
setOption2
(){
this
.
testOption2
=
{
title
:
{
left
:
'left'
,
text
:
'设备故障次数/小时'
,
...
...
@@ -296,7 +574,7 @@
},
xAxis
:
{
type
:
'category'
,
data
:
[
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
]
,
data
:
this
.
querySbYesDate
,
axisLabel
:
{
textStyle
:
{
color
:
'#ffffff'
// 设置y轴标签字体颜色为白色
...
...
@@ -305,7 +583,6 @@
},
yAxis
:
{
type
:
'value'
,
data
:
[
'24'
,
'24'
,
'24'
,
'24'
,
'24'
,
'24'
,
'24'
],
axisLabel
:
{
textStyle
:
{
color
:
'#ffffff'
// 设置y轴标签字体颜色为白色
...
...
@@ -314,7 +591,7 @@
},
grid
:
{
top
:
'1
3
%'
,
// 图表距离容器顶部的距离
top
:
'1
7
%'
,
// 图表距离容器顶部的距离
bottom
:
'2%'
,
// 图表距离容器底部的距离,为下方的文字留出空间
left
:
'2%'
,
right
:
'2%'
,
...
...
@@ -335,87 +612,19 @@
]
},
factory
:
''
,
factoryList
:[],
dataPicker
:
''
,
queryBySbStatusList
:[
{
deviceName
:
'切割机'
,
status
:
'关机'
,
deviceModel
:
'MZ-1250'
,
},
{
deviceName
:
'切割机'
,
status
:
'关机'
,
deviceModel
:
'MZ-1250'
,
},
{
deviceName
:
'焊接机'
,
status
:
'关机'
,
deviceModel
:
'H9830'
,
}
],
querySbYesList
:[],
querySbYesDate
:[],
querySbNoList
:[],
querySbNODate
:[],
};
},
mounted
()
{
this
.
getYesterdayDateFormatted
();
setInterval
(()
=>
{
this
.
date
=
new
Date
();
// 更新日期时间
},
1000
);
this
.
getRoleFactory
();
},
methods
:
{
formatTime
(
currentTime
)
{
const
formattedTime
=
currentTime
.
getFullYear
()
+
"-"
+
(
currentTime
.
getMonth
()
+
1
)
+
"-"
+
currentTime
.
getDate
()
+
" "
+
currentTime
.
getHours
()
+
":"
+
currentTime
.
getMinutes
()
+
":"
+
currentTime
.
getSeconds
();
return
formattedTime
;
}
},
getYesterdayDateFormatted
()
{
const
today
=
new
Date
();
today
.
setDate
(
today
.
getDate
()
-
1
);
const
year
=
today
.
getFullYear
();
const
month
=
String
(
today
.
getMonth
()
+
1
).
padStart
(
2
,
'0'
);
// 月份从0开始,所以要加1
const
day
=
String
(
today
.
getDate
()).
padStart
(
2
,
'0'
);
const
formattedDate
=
year
+
month
+
day
;
this
.
dataPicker
=
formattedDate
;
},
getRoleFactory
(){
let
_this
=
this
;
var
inInfo
=
new
EiInfo
();
IPLAT
.
EiCommunicator
.
send
(
'HGSC007'
,
'getByRoleFactory'
,
inInfo
,
{
onSuccess
:
function
(
res
)
{
_this
.
factoryList
=
res
.
extAttr
.
result
_this
.
factory
=
res
.
extAttr
.
result
[
0
].
factoryCode
console
.
log
(
'_this.factoryList'
,
_this
.
factoryList
)
console
.
log
(
'factory'
,
_this
.
factory
)
},
onFail
:
function
(
err
)
{
console
.
error
(
'request_tools----------------->错误信息'
,
err
);
}
},
{
async
:
false
}
);
},
handledataPicker
(){
},
},
computed
:{
lineOption1
()
{
// 这里我们不需要再次调用 setOption,因为 Vue 会自动处理绑定
return
this
.
testOption1
;
},
lineOption2
()
{
// 这里我们不需要再次调用 setOption,因为 Vue 会自动处理绑定
return
this
.
testOption2
;
},
currentTime
()
{
return
this
.
formatTime
(
this
.
date
);
},
...
...
src/main/webapp/HG/BI/components/hipi/001/left-manage-device.vue
View file @
c1ae1a43
...
...
@@ -20,7 +20,7 @@
</div>
<div
style=
"width: 79%;margin-left: 3.2vw;height: 28vh;margin-top: 2vh"
>
<div
class=
"content-device-img img"
>
<div
class=
"title-content-device img"
>
成
库库 1283
</div>
<div
class=
"title-content-device img"
>
成
品库
</div>
</div>
<img
src=
"../../hggp/common/img/architectureDiagram.png"
style=
"width: 100%;height: 100%"
alt
/>
</div>
...
...
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