Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
digital-construction
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
张牧越
digital-construction
Commits
4852e9bb
Commit
4852e9bb
authored
Apr 19, 2023
by
张牧越
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AI预警联调
parent
62a270e3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
16 deletions
+70
-16
index.js
src/api/index.js
+9
-0
Index.vue
src/components/earlywarning/Index.vue
+60
-15
Index.vue
src/components/safecap/Index.vue
+1
-1
No files found.
src/api/index.js
View file @
4852e9bb
...
...
@@ -111,6 +111,15 @@ export function getWarningList(params) {
})
}
export
function
getStatis
(
params
)
{
return
request
({
url
:
'/pweb/s/aiwarning/statis'
,
method
:
'get'
,
params
})
}
export
function
getMonthWarningStatis
()
{
return
request
({
url
:
'/pweb/s/aiwarning/month/statis'
,
...
...
src/components/earlywarning/Index.vue
View file @
4852e9bb
...
...
@@ -104,7 +104,12 @@
</div>
</
template
>
<
script
>
import
{
getAIdata
,
getWarningList
,
getMonthWarningStatis
}
from
"@/api/index"
;
import
{
getAIdata
,
getWarningList
,
getMonthWarningStatis
,
getStatis
,
}
from
"@/api/index"
;
export
default
{
name
:
"EarlyWarning"
,
data
()
{
...
...
@@ -113,12 +118,10 @@ export default {
classOption
:
{
singleHeight
:
152
,
},
pieChartData
:
[
{
value
:
30
,
name
:
"已处理"
},
{
value
:
10
,
name
:
"未处理"
},
],
screenDetail
:
{},
date
:
""
,
todayPieChartData
:
{},
historyChartData
:
{},
};
},
methods
:
{
...
...
@@ -211,18 +214,24 @@ export default {
this
.
$echarts
.
getInstanceByDom
(
entry
.
target
).
resize
();
}
});
resizeOb
.
observe
(
document
.
getElementById
(
"today-chart"
));
resizeOb
.
observe
(
document
.
getElementById
(
"history-chart"
));
resizeOb
.
observe
(
document
.
getElementById
(
"warning-chart"
));
});
},
renderTodayChart
()
{
const
chartData
=
[
{
value
:
this
.
todayPieChartData
.
yclCount
,
name
:
"已处理"
},
{
value
:
this
.
todayPieChartData
.
wclCount
,
name
:
"未处理"
},
];
const
chart
=
this
.
$echarts
.
init
(
this
.
$refs
.
todayChart
);
let
total
=
0
;
chartData
.
map
((
item
)
=>
{
total
+=
item
.
value
;
});
const
option
=
{
title
:
{
x
:
"27%"
,
//X坐标
y
:
"37%"
,
text
:
"5"
,
text
:
total
,
subtext
:
"今日整改"
,
textAlign
:
"center"
,
textStyle
:
{
...
...
@@ -264,7 +273,7 @@ export default {
},
},
formatter
:
(
name
)
=>
{
let
data
=
this
.
pieC
hartData
;
let
data
=
c
hartData
;
let
target
;
for
(
let
i
=
0
,
l
=
data
.
length
;
i
<
l
;
i
++
)
{
if
(
data
[
i
].
name
==
name
)
{
...
...
@@ -290,19 +299,36 @@ export default {
position
:
"center"
,
},
data
:
this
.
pieC
hartData
,
data
:
c
hartData
,
},
],
};
chart
.
setOption
(
option
);
this
.
$nextTick
(()
=>
{
// 解决echarts图表放大溢出父容器
const
resizeOb
=
new
ResizeObserver
((
entries
)
=>
{
for
(
const
entry
of
entries
)
{
this
.
$echarts
.
getInstanceByDom
(
entry
.
target
).
resize
();
}
});
resizeOb
.
observe
(
document
.
getElementById
(
"today-chart"
));
});
},
renderHistoryChart
()
{
const
chartData
=
[
{
value
:
this
.
historyChartData
.
yclCount
,
name
:
"已处理"
},
{
value
:
this
.
historyChartData
.
wclCount
,
name
:
"未处理"
},
];
let
total
=
0
;
chartData
.
map
((
item
)
=>
{
total
+=
item
.
value
;
});
const
chart
=
this
.
$echarts
.
init
(
this
.
$refs
.
historyChart
);
const
option
=
{
title
:
{
x
:
"27%"
,
//X坐标
y
:
"37%"
,
text
:
"10"
,
text
:
total
,
subtext
:
"历史整改"
,
textAlign
:
"center"
,
textStyle
:
{
...
...
@@ -344,7 +370,7 @@ export default {
},
},
formatter
:
(
name
)
=>
{
let
data
=
this
.
pieC
hartData
;
let
data
=
c
hartData
;
let
target
;
for
(
let
i
=
0
,
l
=
data
.
length
;
i
<
l
;
i
++
)
{
if
(
data
[
i
].
name
==
name
)
{
...
...
@@ -370,11 +396,20 @@ export default {
position
:
"center"
,
},
data
:
this
.
pieC
hartData
,
data
:
c
hartData
,
},
],
};
chart
.
setOption
(
option
);
this
.
$nextTick
(()
=>
{
// 解决echarts图表放大溢出父容器
const
resizeOb
=
new
ResizeObserver
((
entries
)
=>
{
for
(
const
entry
of
entries
)
{
this
.
$echarts
.
getInstanceByDom
(
entry
.
target
).
resize
();
}
});
resizeOb
.
observe
(
document
.
getElementById
(
"history-chart"
));
});
},
getAIdata
()
{
getAIdata
().
then
((
res
)
=>
{
...
...
@@ -400,6 +435,18 @@ export default {
},
60000
);
}
});
// 今日统计
getStatis
({
start_log_time
:
`
${
this
.
date
}
00:00:00`
,
end_log_time
:
`
${
this
.
date
}
23:59:59`
,
}).
then
((
res
)
=>
{
this
.
todayPieChartData
=
res
.
data
;
this
.
renderTodayChart
();
});
getStatis
().
then
((
res
)
=>
{
this
.
historyChartData
=
res
.
data
;
this
.
renderHistoryChart
();
});
getMonthWarningStatis
().
then
((
res
)
=>
{
if
(
res
.
status
==
200
)
{
this
.
warningChartData
=
res
.
data
;
...
...
@@ -412,8 +459,6 @@ export default {
mounted
()
{
this
.
getTime
();
this
.
getAIdata
();
this
.
renderTodayChart
();
this
.
renderHistoryChart
();
},
};
</
script
>
...
...
src/components/safecap/Index.vue
View file @
4852e9bb
...
...
@@ -61,7 +61,7 @@
>
<span
class=
"name"
>
经理 / 王一
</span>
</div>
<div
class=
"recent-open"
>
最近
开机:
2023-03-12
</div>
<div
class=
"recent-open"
>
最近
使用:
2023-03-12
</div>
<div
class=
"cap-operation"
>
<div
:class=
"['cap-button', windowData.online ? 'active' : 'disabled']"
...
...
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