fix: 全局loading
This commit is contained in:
parent
d3cdaccbc5
commit
364e5df974
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "DooTask",
|
"name": "DooTask",
|
||||||
"version": "0.4.57",
|
"version": "0.4.58",
|
||||||
"description": "DooTask is task management system.",
|
"description": "DooTask is task management system.",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "DooTask",
|
"name": "DooTask",
|
||||||
"version": "0.4.57",
|
"version": "0.4.58",
|
||||||
"description": "DooTask is task management system.",
|
"description": "DooTask is task management system.",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "./cmd dev",
|
"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) => {
|
router.beforeEach((to, from, next) => {
|
||||||
ViewUI.LoadingBar.start();
|
ViewUI.LoadingBar.start();
|
||||||
next();
|
next();
|
||||||
setTimeout($A.spinnerShow, 1000);
|
|
||||||
});
|
});
|
||||||
router.afterEach(() => {
|
router.afterEach(() => {
|
||||||
ViewUI.LoadingBar.finish();
|
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);
|
const cloneParams = state.method.cloneJSON(params);
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
|
if (params.spinner === true) {
|
||||||
|
params.before = () => {
|
||||||
|
$A.spinnerShow();
|
||||||
|
};
|
||||||
|
//
|
||||||
|
params.complete = () => {
|
||||||
|
$A.spinnerHide();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
//
|
||||||
params.success = (result, status, xhr) => {
|
params.success = (result, status, xhr) => {
|
||||||
if (!state.method.isJson(result)) {
|
if (!state.method.isJson(result)) {
|
||||||
console.log(result, status, xhr);
|
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");
|
state.cacheTablePanel = state.method.getStorageArray("cacheTablePanel");
|
||||||
|
|
||||||
// Ajax
|
// Ajax
|
||||||
state.ajaxLoadNum = 0;
|
|
||||||
state.ajaxWsReady = false;
|
state.ajaxWsReady = false;
|
||||||
state.ajaxWsListener = [];
|
state.ajaxWsListener = [];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user