fix: 全局loading
This commit is contained in:
parent
d3cdaccbc5
commit
364e5df974
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "DooTask",
|
||||
"version": "0.4.57",
|
||||
"version": "0.4.58",
|
||||
"description": "DooTask is task management system.",
|
||||
"main": "main.js",
|
||||
"license": "MIT",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "DooTask",
|
||||
"version": "0.4.57",
|
||||
"version": "0.4.58",
|
||||
"description": "DooTask is task management system.",
|
||||
"scripts": {
|
||||
"start": "./cmd dev",
|
||||
|
2
public/js/app.js
vendored
2
public/js/app.js
vendored
File diff suppressed because one or more lines are too long
2
resources/assets/js/app.js
vendored
2
resources/assets/js/app.js
vendored
@ -70,11 +70,9 @@ ViewUI.LoadingBar.config({
|
||||
router.beforeEach((to, from, next) => {
|
||||
ViewUI.LoadingBar.start();
|
||||
next();
|
||||
setTimeout($A.spinnerShow, 1000);
|
||||
});
|
||||
router.afterEach(() => {
|
||||
ViewUI.LoadingBar.finish();
|
||||
$A.spinnerHide();
|
||||
});
|
||||
|
||||
// 加载函数
|
||||
|
10
resources/assets/js/store/actions.js
vendored
10
resources/assets/js/store/actions.js
vendored
@ -20,6 +20,16 @@ export default {
|
||||
//
|
||||
const cloneParams = state.method.cloneJSON(params);
|
||||
return new Promise(function (resolve, reject) {
|
||||
if (params.spinner === true) {
|
||||
params.before = () => {
|
||||
$A.spinnerShow();
|
||||
};
|
||||
//
|
||||
params.complete = () => {
|
||||
$A.spinnerHide();
|
||||
};
|
||||
}
|
||||
//
|
||||
params.success = (result, status, xhr) => {
|
||||
if (!state.method.isJson(result)) {
|
||||
console.log(result, status, xhr);
|
||||
|
1
resources/assets/js/store/state.js
vendored
1
resources/assets/js/store/state.js
vendored
@ -270,7 +270,6 @@ state.cacheTasks = state.method.getStorageArray("cacheTasks");
|
||||
state.cacheTablePanel = state.method.getStorageArray("cacheTablePanel");
|
||||
|
||||
// Ajax
|
||||
state.ajaxLoadNum = 0;
|
||||
state.ajaxWsReady = false;
|
||||
state.ajaxWsListener = [];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user