@ctzy-web-client/web-base-client-vue 1.0.1
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/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
- package/es/_virtual/_rollupPluginBabelHelpers.mjs +2830 -0
- package/es/application/Application2.mjs +42 -0
- package/es/application/MicroApplication.mjs +49 -0
- package/es/application/app.mjs +34 -0
- package/es/application/application.mjs +312 -0
- package/es/application/index.mjs +11 -0
- package/es/application/micro-application.mjs +59 -0
- package/es/constants/index.mjs +1 -0
- package/es/hooks/index.mjs +11 -0
- package/es/hooks/use-data-form/index.mjs +18 -0
- package/es/hooks/use-data-table/index.mjs +18 -0
- package/es/hooks/use-data-table-page/index.mjs +47 -0
- package/es/hooks/use-event-dispatcher/index.mjs +14 -0
- package/es/hooks/use-global-config/index.mjs +47 -0
- package/es/hooks/use-keydown/index.mjs +2 -0
- package/es/hooks/use-keydown/use-keydown.mjs +24 -0
- package/es/hooks/use-keydown/use-save-keydown.mjs +12 -0
- package/es/hooks/use-namespace/index.mjs +68 -0
- package/es/hooks/use-service/index.mjs +9 -0
- package/es/hooks/use-value/index.mjs +9 -0
- package/es/index.mjs +20 -0
- package/es/interceptors/RequestInterceptors.mjs +25 -0
- package/es/interceptors/RouterInterceptors.mjs +36 -0
- package/es/interceptors/index.mjs +2 -0
- package/es/ioc/ReactiveInstantiationService.mjs +14 -0
- package/es/ioc/index.mjs +1 -0
- package/es/utils/index.mjs +1 -0
- package/es/utils/pageDataParser.mjs +21 -0
- package/lib/_virtual/_plugin-vue_export-helper.js +13 -0
- package/lib/_virtual/_rollupPluginBabelHelpers.js +2948 -0
- package/lib/application/Application2.js +46 -0
- package/lib/application/MicroApplication.js +53 -0
- package/lib/application/app.js +38 -0
- package/lib/application/application.js +316 -0
- package/lib/application/index.js +18 -0
- package/lib/application/micro-application.js +63 -0
- package/lib/constants/index.js +2 -0
- package/lib/hooks/index.js +30 -0
- package/lib/hooks/use-data-form/index.js +22 -0
- package/lib/hooks/use-data-table/index.js +22 -0
- package/lib/hooks/use-data-table-page/index.js +51 -0
- package/lib/hooks/use-event-dispatcher/index.js +18 -0
- package/lib/hooks/use-global-config/index.js +52 -0
- package/lib/hooks/use-keydown/index.js +11 -0
- package/lib/hooks/use-keydown/use-keydown.js +28 -0
- package/lib/hooks/use-keydown/use-save-keydown.js +16 -0
- package/lib/hooks/use-namespace/index.js +73 -0
- package/lib/hooks/use-service/index.js +13 -0
- package/lib/hooks/use-value/index.js +13 -0
- package/lib/index.js +68 -0
- package/lib/interceptors/RequestInterceptors.js +29 -0
- package/lib/interceptors/RouterInterceptors.js +40 -0
- package/lib/interceptors/index.js +11 -0
- package/lib/ioc/ReactiveInstantiationService.js +18 -0
- package/lib/ioc/index.js +9 -0
- package/lib/utils/index.js +9 -0
- package/lib/utils/pageDataParser.js +25 -0
- package/package.json +37 -0
- package/src/application/Application.js +538 -0
- package/src/application/MicroApplication.js +67 -0
- package/src/application/app.vue +22 -0
- package/src/application/application.vue +36 -0
- package/src/application/index.js +11 -0
- package/src/application/micro-application.vue +56 -0
- package/src/constants/index.js +0 -0
- package/src/hooks/index.js +9 -0
- package/src/hooks/use-data-form/index.js +24 -0
- package/src/hooks/use-data-table/index.js +22 -0
- package/src/hooks/use-data-table-page/index.js +48 -0
- package/src/hooks/use-event-dispatcher/index.js +15 -0
- package/src/hooks/use-global-config/index.js +49 -0
- package/src/hooks/use-keydown/index.js +2 -0
- package/src/hooks/use-keydown/use-keydown.js +35 -0
- package/src/hooks/use-keydown/use-save-keydown.js +13 -0
- package/src/hooks/use-namespace/index.js +90 -0
- package/src/hooks/use-service/index.js +15 -0
- package/src/hooks/use-value/index.js +15 -0
- package/src/index.js +8 -0
- package/src/interceptors/RequestInterceptors.js +46 -0
- package/src/interceptors/RouterInterceptors.js +47 -0
- package/src/interceptors/index.js +2 -0
- package/src/ioc/ReactiveInstantiationService.js +29 -0
- package/src/ioc/index.js +1 -0
- package/src/utils/index.js +1 -0
- package/src/utils/pageDataParser.js +27 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var tokens = require('@ctzy-web-client/tokens');
|
|
7
|
+
|
|
8
|
+
const globalConfig = vue.ref();
|
|
9
|
+
function useGlobalConfig(key, defaultValue) {
|
|
10
|
+
const config = vue.getCurrentInstance() ? vue.inject(tokens.configProviderContextKey, globalConfig) : globalConfig;
|
|
11
|
+
if (key) {
|
|
12
|
+
return vue.computed(() => {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
return (_b = (_a = config.value) == null ? void 0 : _a[key]) != null ? _b : defaultValue;
|
|
15
|
+
});
|
|
16
|
+
} else {
|
|
17
|
+
return config;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const provideGlobalConfig = (config, app, global = false) => {
|
|
21
|
+
var _a;
|
|
22
|
+
const inSetup = !!vue.getCurrentInstance();
|
|
23
|
+
const oldConfig = inSetup ? useGlobalConfig() : void 0;
|
|
24
|
+
const provideFn = (_a = app == null ? void 0 : app.provide) != null ? _a : inSetup ? vue.provide : void 0;
|
|
25
|
+
if (!provideFn) {
|
|
26
|
+
console.warn("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup().");
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const context = vue.computed(() => {
|
|
30
|
+
const cfg = vue.unref(config);
|
|
31
|
+
if (!(oldConfig == null ? void 0 : oldConfig.value))
|
|
32
|
+
return cfg;
|
|
33
|
+
return mergeConfig(oldConfig.value, cfg);
|
|
34
|
+
});
|
|
35
|
+
provideFn(tokens.configProviderContextKey, context);
|
|
36
|
+
if (global || !globalConfig.value) {
|
|
37
|
+
globalConfig.value = context.value;
|
|
38
|
+
}
|
|
39
|
+
return context;
|
|
40
|
+
};
|
|
41
|
+
const mergeConfig = (a, b) => {
|
|
42
|
+
var _a;
|
|
43
|
+
const keys = [.../* @__PURE__ */ new Set([...Reflect.ownKeys(a), ...Reflect.ownKeys(b)])];
|
|
44
|
+
const obj = {};
|
|
45
|
+
for (const key of keys) {
|
|
46
|
+
obj[key] = (_a = b[key]) != null ? _a : a[key];
|
|
47
|
+
}
|
|
48
|
+
return obj;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
exports.provideGlobalConfig = provideGlobalConfig;
|
|
52
|
+
exports.useGlobalConfig = useGlobalConfig;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var useKeydown = require('./use-keydown.js');
|
|
6
|
+
var useSaveKeydown = require('./use-save-keydown.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.useKeydown = useKeydown.useKeydown;
|
|
11
|
+
exports.useSaveKeydown = useSaveKeydown.useSaveKeydown;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
|
|
7
|
+
let registeredHandlers = [];
|
|
8
|
+
const cacchedHandler = (event) => {
|
|
9
|
+
for (let registeredHandler of registeredHandlers) {
|
|
10
|
+
registeredHandler(event);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
const useKeydown = (handler) => {
|
|
14
|
+
vue.onMounted(() => {
|
|
15
|
+
if (!registeredHandlers.length) {
|
|
16
|
+
document.addEventListener("keydown", cacchedHandler);
|
|
17
|
+
}
|
|
18
|
+
registeredHandlers.push(handler);
|
|
19
|
+
});
|
|
20
|
+
vue.onBeforeUnmount(() => {
|
|
21
|
+
registeredHandlers = registeredHandlers.filter((registeredHandler) => registeredHandler !== handler);
|
|
22
|
+
if (!registeredHandlers.length) {
|
|
23
|
+
document.removeEventListener("keydown", cacchedHandler);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
exports.useKeydown = useKeydown;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var useKeydown = require('./use-keydown.js');
|
|
6
|
+
|
|
7
|
+
const useSaveKeydown = (handler) => {
|
|
8
|
+
useKeydown.useKeydown((event) => {
|
|
9
|
+
if (event.key.toLocaleLowerCase() === "s" && (event.ctrlKey || event.metaKey)) {
|
|
10
|
+
event.preventDefault();
|
|
11
|
+
handler(event);
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.useSaveKeydown = useSaveKeydown;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var index = require('../use-global-config/index.js');
|
|
6
|
+
|
|
7
|
+
const defaultNamespace = "web";
|
|
8
|
+
const statePrefix = "is-";
|
|
9
|
+
const _bem = (namespace, block, blockSuffix, element, modifier) => {
|
|
10
|
+
let cls = `${namespace}-${block}`;
|
|
11
|
+
if (blockSuffix) {
|
|
12
|
+
cls += `-${blockSuffix}`;
|
|
13
|
+
}
|
|
14
|
+
if (element) {
|
|
15
|
+
cls += `__${element}`;
|
|
16
|
+
}
|
|
17
|
+
if (modifier) {
|
|
18
|
+
cls += `--${modifier}`;
|
|
19
|
+
}
|
|
20
|
+
return cls;
|
|
21
|
+
};
|
|
22
|
+
const useNamespace = (block) => {
|
|
23
|
+
const namespace = index.useGlobalConfig("namespace", defaultNamespace);
|
|
24
|
+
const b = (blockSuffix = "") => _bem(namespace.value, block, blockSuffix, "", "");
|
|
25
|
+
const e = (element) => element ? _bem(namespace.value, block, "", element, "") : "";
|
|
26
|
+
const m = (modifier) => modifier ? _bem(namespace.value, block, "", "", modifier) : "";
|
|
27
|
+
const be = (blockSuffix, element) => blockSuffix && element ? _bem(namespace.value, block, blockSuffix, element, "") : "";
|
|
28
|
+
const em = (element, modifier) => element && modifier ? _bem(namespace.value, block, "", element, modifier) : "";
|
|
29
|
+
const bm = (blockSuffix, modifier) => blockSuffix && modifier ? _bem(namespace.value, block, blockSuffix, "", modifier) : "";
|
|
30
|
+
const bem = (blockSuffix, element, modifier) => blockSuffix && element && modifier ? _bem(namespace.value, block, blockSuffix, element, modifier) : "";
|
|
31
|
+
const is = (name, ...args) => {
|
|
32
|
+
const state = args.length >= 1 ? args[0] : true;
|
|
33
|
+
return name && state ? `${statePrefix}${name}` : "";
|
|
34
|
+
};
|
|
35
|
+
const cssVar = (object) => {
|
|
36
|
+
const styles = {};
|
|
37
|
+
for (const key in object) {
|
|
38
|
+
if (object[key]) {
|
|
39
|
+
styles[`--${namespace.value}-${key}`] = object[key];
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return styles;
|
|
43
|
+
};
|
|
44
|
+
const cssVarBlock = (object) => {
|
|
45
|
+
const styles = {};
|
|
46
|
+
for (const key in object) {
|
|
47
|
+
if (object[key]) {
|
|
48
|
+
styles[`--${namespace.value}-${block}-${key}`] = object[key];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return styles;
|
|
52
|
+
};
|
|
53
|
+
const cssVarName = (name) => `--${namespace.value}-${name}`;
|
|
54
|
+
const cssVarBlockName = (name) => `--${namespace.value}-${block}-${name}`;
|
|
55
|
+
return {
|
|
56
|
+
namespace,
|
|
57
|
+
b,
|
|
58
|
+
e,
|
|
59
|
+
m,
|
|
60
|
+
be,
|
|
61
|
+
em,
|
|
62
|
+
bm,
|
|
63
|
+
bem,
|
|
64
|
+
is,
|
|
65
|
+
cssVar,
|
|
66
|
+
cssVarName,
|
|
67
|
+
cssVarBlock,
|
|
68
|
+
cssVarBlockName
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
exports.defaultNamespace = defaultNamespace;
|
|
73
|
+
exports.useNamespace = useNamespace;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var tokens = require('@ctzy-web-client/tokens');
|
|
7
|
+
var index = require('../use-global-config/index.js');
|
|
8
|
+
|
|
9
|
+
const useService = function(key) {
|
|
10
|
+
return vue.computed(() => index.useGlobalConfig(tokens.applicationKey).value.getIocContainer().getService(key));
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
exports.useService = useService;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var tokens = require('@ctzy-web-client/tokens');
|
|
7
|
+
var index = require('../use-global-config/index.js');
|
|
8
|
+
|
|
9
|
+
const useValue = function(key) {
|
|
10
|
+
return vue.computed(() => index.useGlobalConfig(tokens.applicationKey).value.getIocContainer().getValue(key));
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
exports.useValue = useValue;
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('./interceptors/index.js');
|
|
6
|
+
var index = require('./application/index.js');
|
|
7
|
+
require('./hooks/index.js');
|
|
8
|
+
var dataModel = require('@ctzy-web-client/data-model');
|
|
9
|
+
var ioc = require('@ctzy-web-client/ioc');
|
|
10
|
+
var support = require('@ctzy-web-client/support');
|
|
11
|
+
var tokens = require('@ctzy-web-client/tokens');
|
|
12
|
+
var RequestInterceptors = require('./interceptors/RequestInterceptors.js');
|
|
13
|
+
var RouterInterceptors = require('./interceptors/RouterInterceptors.js');
|
|
14
|
+
var Application = require('./application/Application.js');
|
|
15
|
+
var index$1 = require('./hooks/use-global-config/index.js');
|
|
16
|
+
var index$2 = require('./hooks/use-namespace/index.js');
|
|
17
|
+
var index$3 = require('./hooks/use-data-form/index.js');
|
|
18
|
+
var index$4 = require('./hooks/use-data-table/index.js');
|
|
19
|
+
var index$5 = require('./hooks/use-service/index.js');
|
|
20
|
+
var index$6 = require('./hooks/use-value/index.js');
|
|
21
|
+
var useKeydown = require('./hooks/use-keydown/use-keydown.js');
|
|
22
|
+
var useSaveKeydown = require('./hooks/use-keydown/use-save-keydown.js');
|
|
23
|
+
var index$7 = require('./hooks/use-event-dispatcher/index.js');
|
|
24
|
+
var index$8 = require('./hooks/use-data-table-page/index.js');
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
exports.BwaApplication = index.BwaApplication;
|
|
29
|
+
exports.BwaMicroApplication = index.BwaMicroApplication;
|
|
30
|
+
exports.RequestInterceptors = RequestInterceptors.RequestInterceptors;
|
|
31
|
+
exports.RouterInterceptors = RouterInterceptors.RouterInterceptors;
|
|
32
|
+
exports.Application = Application.Application;
|
|
33
|
+
exports.provideGlobalConfig = index$1.provideGlobalConfig;
|
|
34
|
+
exports.useGlobalConfig = index$1.useGlobalConfig;
|
|
35
|
+
exports.defaultNamespace = index$2.defaultNamespace;
|
|
36
|
+
exports.useNamespace = index$2.useNamespace;
|
|
37
|
+
exports.useDataForm = index$3.useDataForm;
|
|
38
|
+
exports.useDataTable = index$4.useDataTable;
|
|
39
|
+
exports.useService = index$5.useService;
|
|
40
|
+
exports.useValue = index$6.useValue;
|
|
41
|
+
exports.useKeydown = useKeydown.useKeydown;
|
|
42
|
+
exports.useSaveKeydown = useSaveKeydown.useSaveKeydown;
|
|
43
|
+
exports.useEventDispatcher = index$7.useEventDispatcher;
|
|
44
|
+
exports.useDataTablePage = index$8.useDataTablePage;
|
|
45
|
+
Object.keys(dataModel).forEach(function (k) {
|
|
46
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
47
|
+
enumerable: true,
|
|
48
|
+
get: function () { return dataModel[k]; }
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
Object.keys(ioc).forEach(function (k) {
|
|
52
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
get: function () { return ioc[k]; }
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
Object.keys(support).forEach(function (k) {
|
|
58
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
59
|
+
enumerable: true,
|
|
60
|
+
get: function () { return support[k]; }
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
Object.keys(tokens).forEach(function (k) {
|
|
64
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
get: function () { return tokens[k]; }
|
|
67
|
+
});
|
|
68
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
class RequestInterceptors {
|
|
6
|
+
request(config) {
|
|
7
|
+
return config;
|
|
8
|
+
}
|
|
9
|
+
requestError(e) {
|
|
10
|
+
return Promise.reject(new Error("\u8BF7\u6C42\u9519\u8BEF"));
|
|
11
|
+
}
|
|
12
|
+
response(response) {
|
|
13
|
+
let {
|
|
14
|
+
data,
|
|
15
|
+
status,
|
|
16
|
+
statusText
|
|
17
|
+
} = response;
|
|
18
|
+
if (status === 200) {
|
|
19
|
+
return data;
|
|
20
|
+
} else {
|
|
21
|
+
throw new Error(`\u8BF7\u6C42\u5F02\u5E38:[${status}] ${statusText}`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
responseError(e) {
|
|
25
|
+
return Promise.reject(new Error("\u8BF7\u6C42\u9519\u8BEF"));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
exports.RequestInterceptors = RequestInterceptors;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');
|
|
6
|
+
var iocAnnotations = require('@ctzy-web-client/ioc-annotations');
|
|
7
|
+
|
|
8
|
+
var _dec, _class, _descriptor;
|
|
9
|
+
let RouterInterceptors = (_dec = iocAnnotations.inject("Application"), _class = class RouterInterceptors2 {
|
|
10
|
+
constructor() {
|
|
11
|
+
_rollupPluginBabelHelpers.initializerDefineProperty(this, "application", _descriptor, this);
|
|
12
|
+
}
|
|
13
|
+
async needWaitRouteLoad(to) {
|
|
14
|
+
if (!to.matched.length && this.application._resolveRoutesPromise) {
|
|
15
|
+
await this.application._resolveRoutesPromise;
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
afterEach(to, from, failure) {
|
|
21
|
+
}
|
|
22
|
+
async beforeEach(to, from, next) {
|
|
23
|
+
if (await this.needWaitRouteLoad(to)) {
|
|
24
|
+
return next(to);
|
|
25
|
+
}
|
|
26
|
+
return next();
|
|
27
|
+
}
|
|
28
|
+
beforeResolve(to, from, next) {
|
|
29
|
+
return next();
|
|
30
|
+
}
|
|
31
|
+
}, _descriptor = _rollupPluginBabelHelpers.applyDecoratedDescriptor(_class.prototype, "application", [_dec], {
|
|
32
|
+
configurable: true,
|
|
33
|
+
enumerable: true,
|
|
34
|
+
writable: true,
|
|
35
|
+
initializer: function() {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
}), _class);
|
|
39
|
+
|
|
40
|
+
exports.RouterInterceptors = RouterInterceptors;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var RequestInterceptors = require('./RequestInterceptors.js');
|
|
6
|
+
var RouterInterceptors = require('./RouterInterceptors.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.RequestInterceptors = RequestInterceptors.RequestInterceptors;
|
|
11
|
+
exports.RouterInterceptors = RouterInterceptors.RouterInterceptors;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var ioc = require('@ctzy-web-client/ioc');
|
|
7
|
+
|
|
8
|
+
class ReactiveInstantiationService extends ioc.InstantiationService {
|
|
9
|
+
createInstance(Clazz, option) {
|
|
10
|
+
let instance = super.createInstance(Clazz, option);
|
|
11
|
+
if (option == null ? void 0 : option.reactive) {
|
|
12
|
+
instance = vue.reactive(instance);
|
|
13
|
+
}
|
|
14
|
+
return instance;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
exports.ReactiveInstantiationService = ReactiveInstantiationService;
|
package/lib/ioc/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var ReactiveInstantiationService = require('./ReactiveInstantiationService.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.ReactiveInstantiationService = ReactiveInstantiationService.ReactiveInstantiationService;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const pageDataParser = async function(pages) {
|
|
6
|
+
if (typeof pages == "object") {
|
|
7
|
+
const pageModules = await Promise.all(Object.keys(pages).map((path) => pages[path]()));
|
|
8
|
+
return pageModules.map((module) => {
|
|
9
|
+
module.default.inheritAttrs = false;
|
|
10
|
+
return {
|
|
11
|
+
parent: module.parent,
|
|
12
|
+
meta: module.meta,
|
|
13
|
+
route: module.route,
|
|
14
|
+
name: module.name || module.default.name,
|
|
15
|
+
component: module.default,
|
|
16
|
+
redirect: module.redirect,
|
|
17
|
+
props: module.props
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
} else {
|
|
21
|
+
pageDeifnes.push(...pages);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
exports.pageDataParser = pageDataParser;
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ctzy-web-client/web-base-client-vue",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"module": "es/index.mjs",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"require": "./lib/index.js",
|
|
10
|
+
"import": "./es/index.mjs"
|
|
11
|
+
},
|
|
12
|
+
"./src": "./src/index.js",
|
|
13
|
+
"./src/*": "./src/*",
|
|
14
|
+
"./es": "./es/index.mjs",
|
|
15
|
+
"./lib": "./lib/index.js",
|
|
16
|
+
"./es/*": "./es/*",
|
|
17
|
+
"./lib/*": "./lib/*"
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [],
|
|
23
|
+
"author": "",
|
|
24
|
+
"license": "ISC",
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@ctzy-web-client/data-model": "workspace:^1.0.0",
|
|
27
|
+
"@ctzy-web-client/ioc": "workspace:^1.0.0",
|
|
28
|
+
"@ctzy-web-client/ioc-annotations": "workspace:^1.0.0",
|
|
29
|
+
"@ctzy-web-client/support": "workspace:^1.0.0",
|
|
30
|
+
"@ctzy-web-client/tokens": "workspace:^1.0.0",
|
|
31
|
+
"element-plus": "^2.10.2",
|
|
32
|
+
"qiankun": "^2.8.4",
|
|
33
|
+
"vite-plugin-qiankun": "^1.0.15",
|
|
34
|
+
"vue": "^3.2.41",
|
|
35
|
+
"vue-router": "^4.1.6"
|
|
36
|
+
}
|
|
37
|
+
}
|