Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NLT-e-cigarette
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
张伯涛
NLT-e-cigarette
Commits
a11d4b4a
Commit
a11d4b4a
authored
Sep 05, 2022
by
张伯涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页定时任务等第一个定时响应玩再调用第二个定时
parent
d065bbd4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
31 deletions
+38
-31
homePageTable.vue
src/views/homePageTable.vue
+38
-31
No files found.
src/views/homePageTable.vue
View file @
a11d4b4a
...
@@ -714,7 +714,9 @@ export default {
...
@@ -714,7 +714,9 @@ export default {
}
}
},
},
created
()
{
created
()
{
this
.
getStaTable
()
this
.
intercal
=
setInterval
(
_
=>
{
this
.
getStaTable
()
},
2000
)
},
},
mounted
()
{
mounted
()
{
},
},
...
@@ -853,40 +855,45 @@ export default {
...
@@ -853,40 +855,45 @@ export default {
},
},
// 获取表数据
// 获取表数据
getStaTable
()
{
getStaTable
()
{
clearInterval
(
this
.
intercal
)
const
params
=
{}
const
params
=
{}
this
.
intercal
=
setInterval
(
_
=>
{
getTableData
(
params
).
then
(
res
=>
{
getTableData
(
params
).
then
(
res
=>
{
this
.
monitoringData
=
res
.
data
this
.
monitoringData
=
res
.
data
for
(
let
i
=
0
,
l
=
this
.
monitoringData
.
length
;
i
<
l
;
i
++
)
{
for
(
let
i
=
0
,
l
=
this
.
monitoringData
.
length
;
i
<
l
;
i
++
)
{
const
row
=
{
const
row
=
{
label
:
'total'
,
label
:
'total'
,
prop
:
'total'
,
prop
:
'total'
,
width
:
'60px'
width
:
'60px'
}
const
newList
=
JSON
.
stringify
(
this
.
monitoringData
[
i
].
column
)
const
value
=
JSON
.
parse
(
newList
)
value
.
pop
()
// 删除最后一个 (repair)
value
.
shift
()
// 删除第一个 (产线号)
value
.
shift
()
// 再删除第一个 (线别号)
value
.
shift
()
// 再删除第一个 (开工时间)
this
.
monitoringData
[
i
].
column
.
splice
(
3
,
0
,
row
)
// 在列表数组第四个位置插入total
for
(
let
a
=
0
,
b
=
this
.
monitoringData
[
i
].
tableData
.
length
;
a
<
b
;
a
++
)
{
let
sum
=
0
for
(
let
c
=
0
,
d
=
value
.
length
;
c
<
d
;
c
++
)
{
sum
+=
this
.
monitoringData
[
i
].
tableData
[
a
][
value
[
c
].
prop
]
}
}
const
newList
=
JSON
.
stringify
(
this
.
monitoringData
[
i
].
column
)
this
.
monitoringData
[
i
].
tableData
[
a
].
total
=
sum
const
value
=
JSON
.
parse
(
newList
)
if
(
this
.
monitoringData
[
i
].
tableData
[
a
].
total
===
0
)
{
value
.
pop
()
// 删除最后一个 (repair)
this
.
monitoringData
[
i
].
tableData
[
a
].
total
=
'0'
value
.
shift
()
// 删除第一个 (产线号)
value
.
shift
()
// 再删除第一个 (线别号)
value
.
shift
()
// 再删除第一个 (开工时间)
this
.
monitoringData
[
i
].
column
.
splice
(
3
,
0
,
row
)
// 在列表数组第四个位置插入total
for
(
let
a
=
0
,
b
=
this
.
monitoringData
[
i
].
tableData
.
length
;
a
<
b
;
a
++
)
{
let
sum
=
0
for
(
let
c
=
0
,
d
=
value
.
length
;
c
<
d
;
c
++
)
{
sum
+=
this
.
monitoringData
[
i
].
tableData
[
a
][
value
[
c
].
prop
]
}
this
.
monitoringData
[
i
].
tableData
[
a
].
total
=
sum
if
(
this
.
monitoringData
[
i
].
tableData
[
a
].
total
===
0
)
{
this
.
monitoringData
[
i
].
tableData
[
a
].
total
=
'0'
}
}
}
// this.monitoringData[i].tableData.push(row)
}
}
console
.
log
(
'this.monitoringData'
,
this
.
monitoringData
)
}).
catch
(
_
=>
{
// this.monitoringData[i].tableData.push(row)
})
}
},
2000
)
this
.
intercal
=
setInterval
(
_
=>
{
this
.
getStaTable
()
},
2000
)
console
.
log
(
'this.monitoringData'
,
this
.
monitoringData
)
}).
catch
(
_
=>
{
this
.
intercal
=
setInterval
(
_
=>
{
this
.
getStaTable
()
},
2000
)
})
},
},
openModel
(
row
,
item
,
data
)
{
openModel
(
row
,
item
,
data
)
{
if
(
item
.
label
===
'Scan0'
)
{
if
(
item
.
label
===
'Scan0'
)
{
...
...
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