ebuilds-shared 0.1.8 → 0.2.0
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/{chunk-EJOG7JQT.mjs → chunk-PTS5WW6S.mjs} +36 -22
- package/dist/{chunk-7KNYDZK3.js → chunk-WGOU4SV3.js} +36 -22
- package/dist/index.js +2 -2
- package/dist/index.mjs +1 -1
- package/dist/stores/index.js +2 -2
- package/dist/stores/index.mjs +1 -1
- package/dist/utils/index.js +2 -2
- package/dist/utils/index.mjs +1 -1
- package/package.json +82 -83
|
@@ -6301,25 +6301,32 @@ var useCommonStore = defineStore2("common", {
|
|
|
6301
6301
|
*/
|
|
6302
6302
|
async loadConfig() {
|
|
6303
6303
|
if (this.version) return;
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
}
|
|
6310
|
-
|
|
6311
|
-
|
|
6312
|
-
|
|
6313
|
-
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6304
|
+
if (window.microApp) {
|
|
6305
|
+
const data = window.microApp.getData();
|
|
6306
|
+
if (data.commonState) {
|
|
6307
|
+
this.$patch(data.commonState);
|
|
6308
|
+
}
|
|
6309
|
+
} else {
|
|
6310
|
+
const { data } = await axios.get(this.getPublicUrl + "/config/config.json", {
|
|
6311
|
+
params: { _t: Date.now() }
|
|
6312
|
+
});
|
|
6313
|
+
for (const key in data) {
|
|
6314
|
+
key in this && (this[key] = data[key]);
|
|
6315
|
+
}
|
|
6316
|
+
const dbStore = useDbStore();
|
|
6317
|
+
const db = dbStore.getDb();
|
|
6318
|
+
const { common } = db.stores();
|
|
6319
|
+
const id = "common";
|
|
6320
|
+
let info = await common.get(id);
|
|
6321
|
+
if (!info) {
|
|
6322
|
+
await common.add({ id, ...data });
|
|
6323
|
+
info = await common.get(id);
|
|
6324
|
+
await this.loadUpdateLog();
|
|
6325
|
+
}
|
|
6326
|
+
if (data.version !== info.version) {
|
|
6327
|
+
await this.loadUpdateLog();
|
|
6328
|
+
await common.set({ id, ...data });
|
|
6329
|
+
}
|
|
6323
6330
|
}
|
|
6324
6331
|
},
|
|
6325
6332
|
/**
|
|
@@ -6833,10 +6840,13 @@ var useMenuStore = defineStore3("menu", {
|
|
|
6833
6840
|
let defaultPath = "";
|
|
6834
6841
|
if (window.microApp) {
|
|
6835
6842
|
const data = window.microApp.getData();
|
|
6843
|
+
console.log("microApp\u8DEF\u7531:", data);
|
|
6836
6844
|
routeData = data.menuData || [];
|
|
6837
|
-
|
|
6838
|
-
|
|
6839
|
-
|
|
6845
|
+
if (data?.defaultPath) {
|
|
6846
|
+
defaultPath = data.defaultPath || "";
|
|
6847
|
+
}
|
|
6848
|
+
if (data?.subAppRoute) {
|
|
6849
|
+
defaultPath = data.subAppRoute.path || "";
|
|
6840
6850
|
}
|
|
6841
6851
|
}
|
|
6842
6852
|
this.menuList = routeData;
|
|
@@ -6852,6 +6862,10 @@ var useMenuStore = defineStore3("menu", {
|
|
|
6852
6862
|
this.hasGetMenuList = true;
|
|
6853
6863
|
if (defaultPath) {
|
|
6854
6864
|
router.push(defaultPath);
|
|
6865
|
+
} else {
|
|
6866
|
+
if (validRoutes.length > 0) {
|
|
6867
|
+
router.push(validRoutes[0].redirect || "/");
|
|
6868
|
+
}
|
|
6855
6869
|
}
|
|
6856
6870
|
}
|
|
6857
6871
|
}
|
|
@@ -6301,25 +6301,32 @@ var useCommonStore = _pinia.defineStore.call(void 0, "common", {
|
|
|
6301
6301
|
*/
|
|
6302
6302
|
async loadConfig() {
|
|
6303
6303
|
if (this.version) return;
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
}
|
|
6310
|
-
|
|
6311
|
-
|
|
6312
|
-
|
|
6313
|
-
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6304
|
+
if (window.microApp) {
|
|
6305
|
+
const data = window.microApp.getData();
|
|
6306
|
+
if (data.commonState) {
|
|
6307
|
+
this.$patch(data.commonState);
|
|
6308
|
+
}
|
|
6309
|
+
} else {
|
|
6310
|
+
const { data } = await _axios2.default.get(this.getPublicUrl + "/config/config.json", {
|
|
6311
|
+
params: { _t: Date.now() }
|
|
6312
|
+
});
|
|
6313
|
+
for (const key in data) {
|
|
6314
|
+
key in this && (this[key] = data[key]);
|
|
6315
|
+
}
|
|
6316
|
+
const dbStore = useDbStore();
|
|
6317
|
+
const db = dbStore.getDb();
|
|
6318
|
+
const { common } = db.stores();
|
|
6319
|
+
const id = "common";
|
|
6320
|
+
let info = await common.get(id);
|
|
6321
|
+
if (!info) {
|
|
6322
|
+
await common.add({ id, ...data });
|
|
6323
|
+
info = await common.get(id);
|
|
6324
|
+
await this.loadUpdateLog();
|
|
6325
|
+
}
|
|
6326
|
+
if (data.version !== info.version) {
|
|
6327
|
+
await this.loadUpdateLog();
|
|
6328
|
+
await common.set({ id, ...data });
|
|
6329
|
+
}
|
|
6323
6330
|
}
|
|
6324
6331
|
},
|
|
6325
6332
|
/**
|
|
@@ -6833,10 +6840,13 @@ var useMenuStore = _pinia.defineStore.call(void 0, "menu", {
|
|
|
6833
6840
|
let defaultPath = "";
|
|
6834
6841
|
if (window.microApp) {
|
|
6835
6842
|
const data = window.microApp.getData();
|
|
6843
|
+
console.log("microApp\u8DEF\u7531:", data);
|
|
6836
6844
|
routeData = data.menuData || [];
|
|
6837
|
-
|
|
6838
|
-
|
|
6839
|
-
|
|
6845
|
+
if (_optionalChain([data, 'optionalAccess', _14 => _14.defaultPath])) {
|
|
6846
|
+
defaultPath = data.defaultPath || "";
|
|
6847
|
+
}
|
|
6848
|
+
if (_optionalChain([data, 'optionalAccess', _15 => _15.subAppRoute])) {
|
|
6849
|
+
defaultPath = data.subAppRoute.path || "";
|
|
6840
6850
|
}
|
|
6841
6851
|
}
|
|
6842
6852
|
this.menuList = routeData;
|
|
@@ -6852,6 +6862,10 @@ var useMenuStore = _pinia.defineStore.call(void 0, "menu", {
|
|
|
6852
6862
|
this.hasGetMenuList = true;
|
|
6853
6863
|
if (defaultPath) {
|
|
6854
6864
|
router.push(defaultPath);
|
|
6865
|
+
} else {
|
|
6866
|
+
if (validRoutes.length > 0) {
|
|
6867
|
+
router.push(validRoutes[0].redirect || "/");
|
|
6868
|
+
}
|
|
6855
6869
|
}
|
|
6856
6870
|
}
|
|
6857
6871
|
}
|
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ var _chunkZIUN3ZQAjs = require('./chunk-ZIUN3ZQA.js');
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunkWGOU4SV3js = require('./chunk-WGOU4SV3.js');
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
var _chunk3UCTPVIZjs = require('./chunk-3UCTPVIZ.js');
|
|
@@ -64,4 +64,4 @@ require('./chunk-QGM4M3NI.js');
|
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
|
|
67
|
-
exports.clamp =
|
|
67
|
+
exports.clamp = _chunkWGOU4SV3js.clamp; exports.createBaseViteConfig = _chunk3UCTPVIZjs.createBaseViteConfig; exports.createFunctionalComponent = _chunkWGOU4SV3js.createFunctionalComponent; exports.createUnoConfig = _chunkZIUN3ZQAjs.createUnoConfig; exports.duplicateRemovalCompleteSort = _chunkWGOU4SV3js.duplicateRemovalCompleteSort; exports.encryptPwd = _chunkWGOU4SV3js.encryptPwd; exports.filterMenu = _chunkWGOU4SV3js.filterMenu; exports.formatNumber = _chunkWGOU4SV3js.formatNumber; exports.getDecimalPart = _chunkWGOU4SV3js.getDecimalPart; exports.getIntegerPart = _chunkWGOU4SV3js.getIntegerPart; exports.isInteger = _chunkWGOU4SV3js.isInteger; exports.isNumber = _chunkWGOU4SV3js.isNumber; exports.jsonp = _chunkWGOU4SV3js.jsonp; exports.listSort = _chunkWGOU4SV3js.listSort; exports.numberToChinese = _chunkWGOU4SV3js.numberToChinese; exports.padZero = _chunkWGOU4SV3js.padZero; exports.parseFormattedNumber = _chunkWGOU4SV3js.parseFormattedNumber; exports.prototypeInterceptor = _chunkWGOU4SV3js.prototypeInterceptor; exports.request = _chunkWGOU4SV3js.request; exports.roundOrTruncate = _chunkWGOU4SV3js.roundOrTruncate; exports.setupPermission = _chunkWGOU4SV3js.setupPermission; exports.store = _chunkWGOU4SV3js.store; exports.timeFix = _chunkWGOU4SV3js.timeFix; exports.updateDocumentTitle = _chunkWGOU4SV3js.updateDocumentTitle; exports.useCommonStore = _chunkWGOU4SV3js.useCommonStore; exports.useDbStore = _chunkWGOU4SV3js.useDbStore; exports.useLoginHook = _chunkWGOU4SV3js.useLoginHook; exports.useMenuStore = _chunkWGOU4SV3js.useMenuStore; exports.welcome = _chunkWGOU4SV3js.welcome;
|
package/dist/index.mjs
CHANGED
package/dist/stores/index.js
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkWGOU4SV3js = require('../chunk-WGOU4SV3.js');
|
|
7
7
|
require('../chunk-QGM4M3NI.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
exports.store =
|
|
13
|
+
exports.store = _chunkWGOU4SV3js.store; exports.useCommonStore = _chunkWGOU4SV3js.useCommonStore; exports.useDbStore = _chunkWGOU4SV3js.useDbStore; exports.useMenuStore = _chunkWGOU4SV3js.useMenuStore;
|
package/dist/stores/index.mjs
CHANGED
package/dist/utils/index.js
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _chunkWGOU4SV3js = require('../chunk-WGOU4SV3.js');
|
|
26
26
|
require('../chunk-QGM4M3NI.js');
|
|
27
27
|
|
|
28
28
|
|
|
@@ -48,4 +48,4 @@ require('../chunk-QGM4M3NI.js');
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
|
|
51
|
-
exports.clamp =
|
|
51
|
+
exports.clamp = _chunkWGOU4SV3js.clamp; exports.createFunctionalComponent = _chunkWGOU4SV3js.createFunctionalComponent; exports.duplicateRemovalCompleteSort = _chunkWGOU4SV3js.duplicateRemovalCompleteSort; exports.encryptPwd = _chunkWGOU4SV3js.encryptPwd; exports.filterMenu = _chunkWGOU4SV3js.filterMenu; exports.formatNumber = _chunkWGOU4SV3js.formatNumber; exports.getDecimalPart = _chunkWGOU4SV3js.getDecimalPart; exports.getIntegerPart = _chunkWGOU4SV3js.getIntegerPart; exports.isInteger = _chunkWGOU4SV3js.isInteger; exports.isNumber = _chunkWGOU4SV3js.isNumber; exports.jsonp = _chunkWGOU4SV3js.jsonp; exports.listSort = _chunkWGOU4SV3js.listSort; exports.numberToChinese = _chunkWGOU4SV3js.numberToChinese; exports.padZero = _chunkWGOU4SV3js.padZero; exports.parseFormattedNumber = _chunkWGOU4SV3js.parseFormattedNumber; exports.prototypeInterceptor = _chunkWGOU4SV3js.prototypeInterceptor; exports.request = _chunkWGOU4SV3js.request; exports.roundOrTruncate = _chunkWGOU4SV3js.roundOrTruncate; exports.setupPermission = _chunkWGOU4SV3js.setupPermission; exports.timeFix = _chunkWGOU4SV3js.timeFix; exports.updateDocumentTitle = _chunkWGOU4SV3js.updateDocumentTitle; exports.useLoginHook = _chunkWGOU4SV3js.useLoginHook; exports.welcome = _chunkWGOU4SV3js.welcome;
|
package/dist/utils/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,83 +1,82 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "ebuilds-shared",
|
|
3
|
-
"publishConfig": {
|
|
4
|
-
"access": "public"
|
|
5
|
-
},
|
|
6
|
-
"version": "0.
|
|
7
|
-
"description": "共享工具库和类型定义",
|
|
8
|
-
"author": "ebuilds",
|
|
9
|
-
"license": "MIT",
|
|
10
|
-
"keywords": [
|
|
11
|
-
"shared",
|
|
12
|
-
"utils",
|
|
13
|
-
"vue",
|
|
14
|
-
"pinia",
|
|
15
|
-
"vite"
|
|
16
|
-
],
|
|
17
|
-
"main": "dist/index.js",
|
|
18
|
-
"module": "dist/index.mjs",
|
|
19
|
-
"types": "dist/index.d.ts",
|
|
20
|
-
"exports": {
|
|
21
|
-
".": {
|
|
22
|
-
"default": "./dist/index.mjs",
|
|
23
|
-
"import": "./dist/index.mjs",
|
|
24
|
-
"require": "./dist/index.js",
|
|
25
|
-
"types": "./dist/index.d.ts"
|
|
26
|
-
},
|
|
27
|
-
"./utils": {
|
|
28
|
-
"default": "./dist/utils/index.mjs",
|
|
29
|
-
"import": "./dist/utils/index.mjs",
|
|
30
|
-
"require": "./dist/utils/index.js",
|
|
31
|
-
"types": "./dist/utils/index.d.ts"
|
|
32
|
-
},
|
|
33
|
-
"./stores": {
|
|
34
|
-
"default": "./dist/stores/index.mjs",
|
|
35
|
-
"import": "./dist/stores/index.mjs",
|
|
36
|
-
"require": "./dist/stores/index.js",
|
|
37
|
-
"types": "./dist/stores/index.d.ts"
|
|
38
|
-
},
|
|
39
|
-
"./vite-config": {
|
|
40
|
-
"default": "./dist/vite-config/index.mjs",
|
|
41
|
-
"import": "./dist/vite-config/index.mjs",
|
|
42
|
-
"require": "./dist/vite-config/index.js",
|
|
43
|
-
"types": "./dist/vite-config/index.d.mts"
|
|
44
|
-
},
|
|
45
|
-
"./uno-config": {
|
|
46
|
-
"default": "./dist/uno-config/index.mjs",
|
|
47
|
-
"import": "./dist/uno-config/index.mjs",
|
|
48
|
-
"require": "./dist/uno-config/index.js",
|
|
49
|
-
"types": "./dist/uno-config/index.d.ts"
|
|
50
|
-
},
|
|
51
|
-
"./functionalComponent": {
|
|
52
|
-
"default": "./dist/functionalComponent/index.mjs",
|
|
53
|
-
"import": "./dist/functionalComponent/index.mjs",
|
|
54
|
-
"require": "./dist/functionalComponent/index.js",
|
|
55
|
-
"types": "./dist/functionalComponent/index.d.ts"
|
|
56
|
-
},
|
|
57
|
-
"./styles": "./dist/styles/index.css"
|
|
58
|
-
},
|
|
59
|
-
"files": [
|
|
60
|
-
"dist"
|
|
61
|
-
],
|
|
62
|
-
"scripts": {
|
|
63
|
-
"build": "tsup --config tsup.config.ts",
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"lint": "eslint --quiet \"src/**/*.{ts,tsx}\"",
|
|
67
|
-
"
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "ebuilds-shared",
|
|
3
|
+
"publishConfig": {
|
|
4
|
+
"access": "public"
|
|
5
|
+
},
|
|
6
|
+
"version": "0.2.0",
|
|
7
|
+
"description": "共享工具库和类型定义",
|
|
8
|
+
"author": "ebuilds",
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"keywords": [
|
|
11
|
+
"shared",
|
|
12
|
+
"utils",
|
|
13
|
+
"vue",
|
|
14
|
+
"pinia",
|
|
15
|
+
"vite"
|
|
16
|
+
],
|
|
17
|
+
"main": "dist/index.js",
|
|
18
|
+
"module": "dist/index.mjs",
|
|
19
|
+
"types": "dist/index.d.ts",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"default": "./dist/index.mjs",
|
|
23
|
+
"import": "./dist/index.mjs",
|
|
24
|
+
"require": "./dist/index.js",
|
|
25
|
+
"types": "./dist/index.d.ts"
|
|
26
|
+
},
|
|
27
|
+
"./utils": {
|
|
28
|
+
"default": "./dist/utils/index.mjs",
|
|
29
|
+
"import": "./dist/utils/index.mjs",
|
|
30
|
+
"require": "./dist/utils/index.js",
|
|
31
|
+
"types": "./dist/utils/index.d.ts"
|
|
32
|
+
},
|
|
33
|
+
"./stores": {
|
|
34
|
+
"default": "./dist/stores/index.mjs",
|
|
35
|
+
"import": "./dist/stores/index.mjs",
|
|
36
|
+
"require": "./dist/stores/index.js",
|
|
37
|
+
"types": "./dist/stores/index.d.ts"
|
|
38
|
+
},
|
|
39
|
+
"./vite-config": {
|
|
40
|
+
"default": "./dist/vite-config/index.mjs",
|
|
41
|
+
"import": "./dist/vite-config/index.mjs",
|
|
42
|
+
"require": "./dist/vite-config/index.js",
|
|
43
|
+
"types": "./dist/vite-config/index.d.mts"
|
|
44
|
+
},
|
|
45
|
+
"./uno-config": {
|
|
46
|
+
"default": "./dist/uno-config/index.mjs",
|
|
47
|
+
"import": "./dist/uno-config/index.mjs",
|
|
48
|
+
"require": "./dist/uno-config/index.js",
|
|
49
|
+
"types": "./dist/uno-config/index.d.ts"
|
|
50
|
+
},
|
|
51
|
+
"./functionalComponent": {
|
|
52
|
+
"default": "./dist/functionalComponent/index.mjs",
|
|
53
|
+
"import": "./dist/functionalComponent/index.mjs",
|
|
54
|
+
"require": "./dist/functionalComponent/index.js",
|
|
55
|
+
"types": "./dist/functionalComponent/index.d.ts"
|
|
56
|
+
},
|
|
57
|
+
"./styles": "./dist/styles/index.css"
|
|
58
|
+
},
|
|
59
|
+
"files": [
|
|
60
|
+
"dist"
|
|
61
|
+
],
|
|
62
|
+
"scripts": {
|
|
63
|
+
"build": "tsup --config tsup.config.ts",
|
|
64
|
+
"dev": "tsup --config tsup.config.ts --watch",
|
|
65
|
+
"lint": "eslint --quiet \"src/**/*.{ts,tsx}\"",
|
|
66
|
+
"lint:fix": "eslint --quiet \"src/**/*.{ts,tsx}\" --fix",
|
|
67
|
+
"pub": "npm publish"
|
|
68
|
+
},
|
|
69
|
+
"peerDependencies": {
|
|
70
|
+
"pinia": "3.0.1"
|
|
71
|
+
},
|
|
72
|
+
"dependencies": {
|
|
73
|
+
"axios": "^1.8.4",
|
|
74
|
+
"jsencrypt": "^3.3.2",
|
|
75
|
+
"svgo": "^4.0.0"
|
|
76
|
+
},
|
|
77
|
+
"devDependencies": {
|
|
78
|
+
"@monorepo/ebuilds-ui": "workspace:*",
|
|
79
|
+
"shx": "^0.4.0",
|
|
80
|
+
"tsup": "^8.0.2"
|
|
81
|
+
}
|
|
82
|
+
}
|