fast-vue-multi-pages-vite 1.1.21 → 1.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +18 -18
- package/package.json +1 -1
- package/vite/index.js +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -751,7 +751,7 @@ declare class FastVueMultiTimeout {
|
|
|
751
751
|
*/
|
|
752
752
|
static stopTimeout(code: string): void;
|
|
753
753
|
/**
|
|
754
|
-
* 开启一个循环计时器,与setInterval
|
|
754
|
+
* 开启一个循环计时器,与setInterval的区别是必须执行完回调函数后,返回false则终止循环,才进入下一个循环
|
|
755
755
|
*/
|
|
756
756
|
static startLoopTimeout(code: string, callback: any, duration: number): void;
|
|
757
757
|
/**
|
package/dist/index.js
CHANGED
|
@@ -172,7 +172,7 @@ var FastVueMultiSimpleJsonResponse = class {
|
|
|
172
172
|
*/
|
|
173
173
|
getList() {
|
|
174
174
|
if (this.isPageData()) return this.responseData.data.list;
|
|
175
|
-
if (this.responseData.data) return this.responseData.data;
|
|
175
|
+
if (this.responseData.data && Array.isArray(this.responseData.data)) return this.responseData.data;
|
|
176
176
|
return [];
|
|
177
177
|
}
|
|
178
178
|
/**
|
|
@@ -194,7 +194,7 @@ var FastVueMultiSimpleJsonResponse = class {
|
|
|
194
194
|
*/
|
|
195
195
|
getTotalRow() {
|
|
196
196
|
if (this.isPageData()) return this.responseData.data.totalRow;
|
|
197
|
-
return
|
|
197
|
+
return this.getList().length;
|
|
198
198
|
}
|
|
199
199
|
/**
|
|
200
200
|
* 获取接口列表分页数据的每页大小
|
|
@@ -921,14 +921,8 @@ let FastVueMultiHttp;
|
|
|
921
921
|
});
|
|
922
922
|
else FastVueMultiHttp.Base.doRequest(method, url, params, headers).then(requestThen).catch(function(error) {
|
|
923
923
|
console.error(error);
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
success: false,
|
|
927
|
-
message: FastVueMultiTool.Object.getErrorInfo(error),
|
|
928
|
-
code: -9999
|
|
929
|
-
},
|
|
930
|
-
status: 200
|
|
931
|
-
});
|
|
924
|
+
FastVueMultiDB.removeValue(cacheKey);
|
|
925
|
+
delete window[callingCode];
|
|
932
926
|
});
|
|
933
927
|
});
|
|
934
928
|
}
|
|
@@ -1213,27 +1207,33 @@ var FastVueMultiTimeout = class FastVueMultiTimeout {
|
|
|
1213
1207
|
}
|
|
1214
1208
|
}
|
|
1215
1209
|
/**
|
|
1216
|
-
* 开启一个循环计时器,与setInterval
|
|
1210
|
+
* 开启一个循环计时器,与setInterval的区别是必须执行完回调函数后,返回false则终止循环,才进入下一个循环
|
|
1217
1211
|
*/
|
|
1218
1212
|
static startLoopTimeout(code, callback, duration) {
|
|
1219
1213
|
window["LoopTimeoutFlag" + code] = true;
|
|
1220
|
-
let runTimeout = () => {
|
|
1214
|
+
let runTimeout = (realDuration) => {
|
|
1221
1215
|
if (!window["LoopTimeoutFlag" + code]) return;
|
|
1222
1216
|
FastVueMultiTimeout.stopTimeout(code);
|
|
1223
1217
|
window["Timeout" + code] = setTimeout(() => {
|
|
1224
1218
|
if (!window["LoopTimeoutFlag" + code]) return;
|
|
1219
|
+
let nextDuration = realDuration;
|
|
1225
1220
|
if (callback) {
|
|
1226
|
-
let returnVal = callback({
|
|
1227
|
-
|
|
1228
|
-
|
|
1221
|
+
let returnVal = callback({
|
|
1222
|
+
isStopped: () => {
|
|
1223
|
+
return window["LoopTimeoutFlag" + code];
|
|
1224
|
+
},
|
|
1225
|
+
setDuration: (val) => {
|
|
1226
|
+
nextDuration = val;
|
|
1227
|
+
}
|
|
1228
|
+
});
|
|
1229
1229
|
if (typeof returnVal === "boolean" || returnVal instanceof Boolean) {
|
|
1230
1230
|
if (!returnVal) return;
|
|
1231
1231
|
}
|
|
1232
1232
|
}
|
|
1233
|
-
runTimeout();
|
|
1234
|
-
},
|
|
1233
|
+
runTimeout(nextDuration);
|
|
1234
|
+
}, realDuration);
|
|
1235
1235
|
};
|
|
1236
|
-
runTimeout();
|
|
1236
|
+
runTimeout(duration);
|
|
1237
1237
|
}
|
|
1238
1238
|
/**
|
|
1239
1239
|
* 停止循环计时器
|
package/package.json
CHANGED
package/vite/index.js
CHANGED
|
@@ -806,7 +806,7 @@ var FastViteMultiTool = class FastViteMultiTool {
|
|
|
806
806
|
if (FastViteMultiTool._viteConfig.command === "build") key = ctx.path;
|
|
807
807
|
let renderHtml = FastViteBuildPages.renderHtml(FastViteMultiTool._viteConfig.command, html, key, FastViteMultiTool._pages, FastViteMultiTool._option);
|
|
808
808
|
let tags = [];
|
|
809
|
-
if (FastViteMultiTool._viteConfig.command === "serve" || FastViteMultiTool.isServiceDebug() || FastViteMultiTool._option.vConsole.toString() === "true") tags.push({
|
|
809
|
+
if (FastViteMultiTool._option.vConsole.toString() === "auto" && FastViteMultiTool._viteConfig.command === "serve" || FastViteMultiTool._option.vConsole.toString() === "auto" && FastViteMultiTool.isServiceDebug() || FastViteMultiTool._option.vConsole.toString() === "true") tags.push({
|
|
810
810
|
tag: "script",
|
|
811
811
|
attrs: { type: "module" },
|
|
812
812
|
children: "import VConsole from 'vconsole';const vConsole = new VConsole();"
|