Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mes-pad
Project
Project
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
ximai
mes-pad
Commits
1aacffec
Commit
1aacffec
authored
Jul 02, 2024
by
沈翠玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
loading卡顿
parent
6def5d61
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
index.vue
pages/mes/prodReport/index.vue
+7
-4
index.js
uview-ui/libs/request/index.js
+4
-3
No files found.
pages/mes/prodReport/index.vue
View file @
1aacffec
...
...
@@ -1441,9 +1441,9 @@ export default {
// },
mounted
()
{
//监听工作中心切换事件
uni
.
$on
(
'switchWorkunit'
,
(
station
)
=>
{
this
.
getTaskList
();
});
//
uni.$on('switchWorkunit', (station) => {
//
this.getTaskList();
//
});
},
created
()
{
//获取屏幕高度
...
...
@@ -1929,6 +1929,7 @@ export default {
const
t
=
this
;
this
.
tableData
=
[];
this
.
tableSelectData
=
[]
console
.
log
(
'sadada'
,
t
.
vuex_workunit
.
workunitId
)
this
.
$u
.
api
.
getTaskList
({
workunitId
:
t
.
vuex_workunit
.
workunitId
,
...
...
@@ -1951,7 +1952,9 @@ export default {
}
else
{
}
}
});
}).
catch
(
e
=>
{
console
.
log
(
'eee'
,
e
)
})
},
typeChange
(
index
)
{
this
.
currentType
=
index
;
...
...
uview-ui/libs/request/index.js
View file @
1aacffec
...
...
@@ -25,11 +25,13 @@ class Request {
options
.
params
=
options
.
params
||
{};
options
.
header
=
Object
.
assign
({},
this
.
config
.
header
,
options
.
header
);
options
.
method
=
options
.
method
||
this
.
config
.
method
;
return
new
Promise
((
resolve
,
reject
)
=>
{
options
.
complete
=
(
response
)
=>
{
// 请求返回后,隐藏loading(如果请求返回快的话,可能会没有loading)
uni
.
hideLoading
();
// uni.hideLoading();
setTimeout
(()
=>
{
uni
.
hideLoading
();
},
10
)
// 清除定时器,如果请求回来了,就无需loading
clearTimeout
(
this
.
config
.
timer
);
this
.
config
.
timer
=
null
;
...
...
@@ -77,7 +79,6 @@ class Request {
// 判断用户传递的URL是否/开头,如果不是,加上/,这里使用了uView的test.js验证库的url()方法
options
.
url
=
validate
.
url
(
options
.
url
)
?
options
.
url
:
(
this
.
config
.
baseUrl
+
(
options
.
url
.
indexOf
(
'/'
)
==
0
?
options
.
url
:
'/'
+
options
.
url
));
// 是否显示loading
// 加一个是否已有timer定时器的判断,否则有两个同时请求的时候,后者会清除前者的定时器id
// 而没有清除前者的定时器,导致前者超时,一直显示loading
...
...
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