fix: 全局loading

This commit is contained in:
kuaifan 2021-12-26 02:21:11 +08:00
parent d3cdaccbc5
commit 364e5df974
6 changed files with 13 additions and 6 deletions

View File

@ -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",

View File

@ -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

File diff suppressed because one or more lines are too long

View File

@ -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();
});
// 加载函数

View File

@ -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);

View File

@ -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 = [];