@peng_kai/kit 0.3.0-beta.2 → 0.3.0-beta.20
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/.vscode/settings.json +2 -2
- package/admin/components/currency/src/CurrencyIcon.vue +35 -33
- package/admin/components/date/PeriodPicker.vue +122 -0
- package/admin/components/date/TimeFieldSelectForLabel.vue +24 -0
- package/admin/components/date/TtaTimeZone.vue +516 -0
- package/admin/components/date/helpers.ts +250 -0
- package/admin/components/date/index.ts +5 -0
- package/admin/components/date/presetProps.ts +19 -0
- package/admin/components/filter/src/FilterReset.vue +45 -7
- package/admin/components/filter/src/more/TableSetting.vue +82 -0
- package/admin/components/provider/Admin.vue +17 -0
- package/admin/components/provider/admin-permission.ts +48 -0
- package/admin/components/provider/admin-router.ts +361 -0
- package/admin/components/provider/index.ts +3 -0
- package/admin/components/rich-text/src/RichText.new.vue +17 -4
- package/admin/components/rich-text/src/editorConfig.ts +10 -1
- package/admin/components/text/index.ts +2 -0
- package/admin/components/text/src/Amount.v2.vue +132 -0
- package/admin/components/text/src/Datetime.vue +17 -12
- package/admin/components/text/src/Num.vue +192 -0
- package/admin/layout/large/Breadcrumb.vue +10 -23
- package/admin/layout/large/Content.vue +14 -6
- package/admin/layout/large/Layout.vue +129 -0
- package/admin/layout/large/Menu.vue +24 -17
- package/admin/layout/large/Notice.vue +140 -0
- package/admin/layout/large/Tabs.vue +183 -0
- package/admin/layout/large/index.ts +61 -1
- package/admin/layout/large/y682.mp3 +0 -0
- package/admin/permission/routerGuard.ts +15 -8
- package/admin/permission/vuePlugin.ts +5 -10
- package/admin/route-guards/index.ts +0 -1
- package/admin/stores/index.ts +1 -0
- package/admin/styles/classCover.scss +1 -1
- package/admin/styles/index.scss +2 -2
- package/antd/hooks/useAntdModal.ts +29 -15
- package/antd/hooks/useAntdTable.ts +12 -7
- package/antd/hooks/useAntdTheme.ts +7 -0
- package/antd/hooks/useTableColumns.ts +124 -0
- package/antd/index.ts +1 -1
- package/libs/bignumber.ts +1 -1
- package/libs/dayjs.ts +11 -1
- package/libs/fingerprintjs.ts +1 -0
- package/package.json +59 -60
- package/request/interceptors/getDeviceInfo.ts +14 -0
- package/utils/LocaleManager.ts +1 -1
- package/utils/locale/LocaleManager.ts +2 -1
- package/utils/locale/helpers.ts +9 -0
- package/utils/number.ts +0 -1
- package/utils/storage.ts +31 -0
- package/utils/upload/AwsS3.ts +11 -4
- package/admin/layout/large/PageTab.vue +0 -70
- package/admin/route-guards/collapseMenu.ts +0 -11
- package/libs/a-calc.ts +0 -1
- package/vue/components/test/KitTest.vue +0 -9
- package/vue/components/test/testStore.ts +0 -11
package/libs/dayjs.ts
CHANGED
|
@@ -5,15 +5,25 @@ import weekday from 'dayjs/esm/plugin/weekday';
|
|
|
5
5
|
import localeData from 'dayjs/esm/plugin/localeData';
|
|
6
6
|
import utc from 'dayjs/esm/plugin/utc';
|
|
7
7
|
import tz from 'dayjs/esm/plugin/timezone';
|
|
8
|
+
import weekOfYear from 'dayjs/esm/plugin/weekOfYear';
|
|
9
|
+
import weekYear from 'dayjs/esm/plugin/weekYear';
|
|
10
|
+
import quarterOfYear from 'dayjs/esm/plugin/quarterOfYear';
|
|
11
|
+
import advancedFormat from 'dayjs/esm/plugin/advancedFormat';
|
|
12
|
+
import customParseFormat from 'dayjs/esm/plugin/customParseFormat';
|
|
8
13
|
import 'dayjs/esm/locale/zh';
|
|
9
14
|
import 'dayjs/esm/locale/en';
|
|
10
15
|
|
|
11
16
|
export type { Dayjs, PluginFunc, UnitType, UnitTypeLong, UnitTypeLongPlural, UnitTypeShort, QUnitType, ConfigType, ConfigTypeMap, OpUnitType, OptionType, ManipulateType } from 'dayjs';
|
|
12
17
|
export default dayjs;
|
|
13
18
|
|
|
14
|
-
dayjs.locale('zh');
|
|
15
19
|
dayjs.extend(relativeTime);
|
|
16
20
|
dayjs.extend(weekday);
|
|
17
21
|
dayjs.extend(localeData);
|
|
18
22
|
dayjs.extend(utc);
|
|
19
23
|
dayjs.extend(tz);
|
|
24
|
+
dayjs.extend(weekOfYear);
|
|
25
|
+
dayjs.extend(weekYear);
|
|
26
|
+
dayjs.extend(quarterOfYear);
|
|
27
|
+
dayjs.extend(advancedFormat);
|
|
28
|
+
dayjs.extend(customParseFormat);
|
|
29
|
+
dayjs.locale('zh');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@fingerprintjs/fingerprintjs';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peng_kai/kit",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.3.0-beta.
|
|
4
|
+
"version": "0.3.0-beta.20",
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "",
|
|
7
7
|
"license": "ISC",
|
|
@@ -13,83 +13,82 @@
|
|
|
13
13
|
"lint:fix": "eslint . --fix"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
|
-
"ant-design-vue": "4.2.
|
|
17
|
-
"vue": "3.5.
|
|
18
|
-
"vue-router": "4.
|
|
16
|
+
"ant-design-vue": "4.2.6",
|
|
17
|
+
"vue": "3.5.17",
|
|
18
|
+
"vue-router": "4.5.1"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@aws-sdk/client-s3": "^3.
|
|
22
|
-
"@aws-sdk/lib-storage": "^3.
|
|
23
|
-
"@babel/generator": "^7.
|
|
24
|
-
"@babel/parser": "^7.
|
|
25
|
-
"@babel/traverse": "^7.
|
|
26
|
-
"@babel/types": "^7.
|
|
27
|
-
"@ckeditor/ckeditor5-vue": "^
|
|
28
|
-
"@fingerprintjs/fingerprintjs": "^4.
|
|
29
|
-
"@tanstack/vue-query": "^5.
|
|
30
|
-
"@vueuse/components": "^
|
|
31
|
-
"@vueuse/core": "^
|
|
32
|
-
"@vueuse/router": "^
|
|
33
|
-
"a-calc": "^2.2.10",
|
|
21
|
+
"@aws-sdk/client-s3": "^3.855.0",
|
|
22
|
+
"@aws-sdk/lib-storage": "^3.855.0",
|
|
23
|
+
"@babel/generator": "^7.28.0",
|
|
24
|
+
"@babel/parser": "^7.28.0",
|
|
25
|
+
"@babel/traverse": "^7.28.0",
|
|
26
|
+
"@babel/types": "^7.28.2",
|
|
27
|
+
"@ckeditor/ckeditor5-vue": "^7.3.0",
|
|
28
|
+
"@fingerprintjs/fingerprintjs": "^4.6.2",
|
|
29
|
+
"@tanstack/vue-query": "^5.83.0",
|
|
30
|
+
"@vueuse/components": "^13.6.0",
|
|
31
|
+
"@vueuse/core": "^13.6.0",
|
|
32
|
+
"@vueuse/router": "^13.6.0",
|
|
34
33
|
"archiver": "^7.0.1",
|
|
35
|
-
"axios": "^1.
|
|
36
|
-
"bignumber.js": "^9.1
|
|
34
|
+
"axios": "^1.11.0",
|
|
35
|
+
"bignumber.js": "^9.3.1",
|
|
37
36
|
"chokidar": "^3.6.0",
|
|
38
37
|
"crypto-es": "^2.1.0",
|
|
39
38
|
"dayjs": "^1.11.13",
|
|
40
39
|
"echarts": "^5.5.1",
|
|
41
40
|
"execa": "^9.4.0",
|
|
42
41
|
"fast-glob": "^3.3.2",
|
|
42
|
+
"fluid-dnd": "^2.4.0",
|
|
43
43
|
"localstorage-slim": "^2.7.1",
|
|
44
44
|
"lodash-es": "^4.17.21",
|
|
45
45
|
"nprogress": "^0.2.0",
|
|
46
|
-
"pinia": "^
|
|
46
|
+
"pinia": "^3.0.3",
|
|
47
47
|
"tsx": "^4.16.00",
|
|
48
|
-
"vue": "^3.5.
|
|
49
|
-
"vue-i18n": "^
|
|
50
|
-
"vue-router": "^4.
|
|
48
|
+
"vue": "^3.5.18",
|
|
49
|
+
"vue-i18n": "^11.1.11",
|
|
50
|
+
"vue-router": "^4.5.1"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@ckeditor/ckeditor5-adapter-ckfinder": "^
|
|
54
|
-
"@ckeditor/ckeditor5-alignment": "^
|
|
55
|
-
"@ckeditor/ckeditor5-autoformat": "^
|
|
56
|
-
"@ckeditor/ckeditor5-basic-styles": "^
|
|
57
|
-
"@ckeditor/ckeditor5-block-quote": "^
|
|
58
|
-
"@ckeditor/ckeditor5-
|
|
59
|
-
"@ckeditor/ckeditor5-
|
|
60
|
-
"@ckeditor/ckeditor5-
|
|
61
|
-
"@ckeditor/ckeditor5-
|
|
62
|
-
"@ckeditor/ckeditor5-
|
|
63
|
-
"@ckeditor/ckeditor5-
|
|
64
|
-
"@ckeditor/ckeditor5-
|
|
65
|
-
"@ckeditor/ckeditor5-
|
|
66
|
-
"@ckeditor/ckeditor5-
|
|
67
|
-
"@ckeditor/ckeditor5-html-
|
|
68
|
-
"@ckeditor/ckeditor5-
|
|
69
|
-
"@ckeditor/ckeditor5-
|
|
70
|
-
"@ckeditor/ckeditor5-
|
|
71
|
-
"@ckeditor/ckeditor5-
|
|
72
|
-
"@ckeditor/ckeditor5-
|
|
73
|
-
"@ckeditor/ckeditor5-
|
|
74
|
-
"@ckeditor/ckeditor5-
|
|
75
|
-
"@ckeditor/ckeditor5-
|
|
76
|
-
"@ckeditor/ckeditor5-
|
|
77
|
-
"@ckeditor/ckeditor5-
|
|
78
|
-
"@ckeditor/ckeditor5-
|
|
79
|
-
"@ckeditor/ckeditor5-
|
|
80
|
-
"@ckeditor/ckeditor5-
|
|
81
|
-
"@ckeditor/ckeditor5-
|
|
82
|
-
"@ckeditor/ckeditor5-
|
|
83
|
-
"@ckeditor/ckeditor5-word-count": "^41.1.0",
|
|
53
|
+
"@ckeditor/ckeditor5-adapter-ckfinder": "^46.0.0",
|
|
54
|
+
"@ckeditor/ckeditor5-alignment": "^46.0.0",
|
|
55
|
+
"@ckeditor/ckeditor5-autoformat": "^46.0.0",
|
|
56
|
+
"@ckeditor/ckeditor5-basic-styles": "^46.0.0",
|
|
57
|
+
"@ckeditor/ckeditor5-block-quote": "^46.0.0",
|
|
58
|
+
"@ckeditor/ckeditor5-code-block": "^46.0.0",
|
|
59
|
+
"@ckeditor/ckeditor5-document-outline": "^46.0.0",
|
|
60
|
+
"@ckeditor/ckeditor5-editor-classic": "^46.0.0",
|
|
61
|
+
"@ckeditor/ckeditor5-essentials": "^46.0.0",
|
|
62
|
+
"@ckeditor/ckeditor5-font": "^46.0.0",
|
|
63
|
+
"@ckeditor/ckeditor5-heading": "^46.0.0",
|
|
64
|
+
"@ckeditor/ckeditor5-highlight": "^46.0.0",
|
|
65
|
+
"@ckeditor/ckeditor5-horizontal-line": "^46.0.0",
|
|
66
|
+
"@ckeditor/ckeditor5-html-embed": "^46.0.0",
|
|
67
|
+
"@ckeditor/ckeditor5-html-support": "^46.0.0",
|
|
68
|
+
"@ckeditor/ckeditor5-image": "^46.0.0",
|
|
69
|
+
"@ckeditor/ckeditor5-import-word": "^46.0.0",
|
|
70
|
+
"@ckeditor/ckeditor5-indent": "^46.0.0",
|
|
71
|
+
"@ckeditor/ckeditor5-link": "^46.0.0",
|
|
72
|
+
"@ckeditor/ckeditor5-list": "^46.0.0",
|
|
73
|
+
"@ckeditor/ckeditor5-media-embed": "^46.0.0",
|
|
74
|
+
"@ckeditor/ckeditor5-paragraph": "^46.0.0",
|
|
75
|
+
"@ckeditor/ckeditor5-remove-format": "^46.0.0",
|
|
76
|
+
"@ckeditor/ckeditor5-show-blocks": "^46.0.0",
|
|
77
|
+
"@ckeditor/ckeditor5-source-editing": "^46.0.0",
|
|
78
|
+
"@ckeditor/ckeditor5-table": "^46.0.0",
|
|
79
|
+
"@ckeditor/ckeditor5-theme-lark": "^46.0.0",
|
|
80
|
+
"@ckeditor/ckeditor5-typing": "^46.0.0",
|
|
81
|
+
"@ckeditor/ckeditor5-upload": "^46.0.0",
|
|
82
|
+
"@ckeditor/ckeditor5-word-count": "^46.0.0",
|
|
84
83
|
"@peng_kai/lint": "^0.1.0",
|
|
85
|
-
"@types/archiver": "^6.0.
|
|
84
|
+
"@types/archiver": "^6.0.3",
|
|
86
85
|
"@types/crypto-js": "^4.2.2",
|
|
87
86
|
"@types/lodash-es": "^4.17.12",
|
|
88
|
-
"@types/node": "^
|
|
87
|
+
"@types/node": "^22.16.5",
|
|
89
88
|
"@types/nprogress": "^0.2.3",
|
|
90
|
-
"ant-design-vue": "^4.2.
|
|
91
|
-
"type-fest": "^4.
|
|
92
|
-
"typescript": "^5.
|
|
93
|
-
"vue-component-type-helpers": "^
|
|
89
|
+
"ant-design-vue": "^4.2.6",
|
|
90
|
+
"type-fest": "^4.41.0",
|
|
91
|
+
"typescript": "^5.8.3",
|
|
92
|
+
"vue-component-type-helpers": "^3.0.4"
|
|
94
93
|
}
|
|
95
94
|
}
|
|
@@ -25,6 +25,7 @@ export function getDeviceInfo(callback: (base: Record<string, any>, all: GetResu
|
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
req.headers.set('Device', callback(base, result));
|
|
28
|
+
req.headers.set('Device-Id', getDeviceID(base.visitor_id));
|
|
28
29
|
req.headers.set('Accept-Date', getCurrentTimeZone());
|
|
29
30
|
|
|
30
31
|
return req;
|
|
@@ -32,6 +33,19 @@ export function getDeviceInfo(callback: (base: Record<string, any>, all: GetResu
|
|
|
32
33
|
];
|
|
33
34
|
}
|
|
34
35
|
|
|
36
|
+
function getDeviceID(visitorId: string) {
|
|
37
|
+
const key = 'backend_device_id';
|
|
38
|
+
let id = localStorage.getItem(key);
|
|
39
|
+
if (!id) {
|
|
40
|
+
id = visitorId
|
|
41
|
+
if (!id) {
|
|
42
|
+
id = crypto.randomUUID();
|
|
43
|
+
}
|
|
44
|
+
localStorage.setItem(key, id);
|
|
45
|
+
}
|
|
46
|
+
return id;
|
|
47
|
+
}
|
|
48
|
+
|
|
35
49
|
function getCurrentTimeZone() {
|
|
36
50
|
const now = new Date();
|
|
37
51
|
const [_, time, tz, describe] = now.toString().match(/(\w{3} \w{3} \d{2} \d{4} \d{2}:\d{2}:\d{2})? (GMT[+-]\d{4}) \((.*?)\)/) ?? [];
|
package/utils/LocaleManager.ts
CHANGED
|
@@ -63,7 +63,7 @@ export class LocaleManager {
|
|
|
63
63
|
|
|
64
64
|
for (const target of localeTargets) {
|
|
65
65
|
for (const codes of codeMatrix) {
|
|
66
|
-
const matched = codes.some(code =>
|
|
66
|
+
const matched = codes.some(code => target.toUpperCase().startsWith(code.toUpperCase()));
|
|
67
67
|
|
|
68
68
|
if (matched) {
|
|
69
69
|
localeFinal = codes[0];
|
|
@@ -65,7 +65,7 @@ export class LocaleManager {
|
|
|
65
65
|
|
|
66
66
|
for (const target of localeTargets) {
|
|
67
67
|
for (const codes of codeMatrix) {
|
|
68
|
-
const matched = codes.some(code =>
|
|
68
|
+
const matched = codes.some(code => target.toUpperCase().startsWith(code.toUpperCase()));
|
|
69
69
|
|
|
70
70
|
if (matched) {
|
|
71
71
|
localeFinal = codes[0];
|
|
@@ -92,6 +92,7 @@ export class LocaleManager {
|
|
|
92
92
|
if (!this.localesAvailable.includes(locale))
|
|
93
93
|
return;
|
|
94
94
|
|
|
95
|
+
// TODO: 这样可能无法支持code中的语言
|
|
95
96
|
const message = await this.messageLoaders[locale]?.().catch(() => undefined);
|
|
96
97
|
|
|
97
98
|
// 由于是异步加载,所以需要再判断是否已经加载过
|
package/utils/locale/helpers.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { I18nOptions } from 'vue-i18n';
|
|
1
2
|
import { omitBy } from '../../libs/lodash-es';
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -32,6 +33,14 @@ export function omitLocale(modules: Record<string, any>, excludes: string[] = []
|
|
|
32
33
|
return omitBy(modules, (_, path) => excludes.some(locale => path.includes(locale)));
|
|
33
34
|
}
|
|
34
35
|
|
|
36
|
+
/** 添加语言格式 */
|
|
37
|
+
export function addDatetimeFormat<T extends string>(name: T, config: NonNullable<I18nOptions['datetimeFormats']>[string][string]) {
|
|
38
|
+
return {
|
|
39
|
+
[name]: config,
|
|
40
|
+
[`${name}-utc`]: { ...config, timeZone: 'UTC' },
|
|
41
|
+
} as Record<T | `${T}-utc`, typeof config>;
|
|
42
|
+
}
|
|
43
|
+
|
|
35
44
|
/**
|
|
36
45
|
* 加密 JSON 消息
|
|
37
46
|
*/
|
package/utils/number.ts
CHANGED
package/utils/storage.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type MaybeRefOrGetter, computed, isReactive, reactive, toValue } from 'vue';
|
|
2
|
+
|
|
3
|
+
export class StorageKey<F extends Record<string, string | number>> {
|
|
4
|
+
public factors: F;
|
|
5
|
+
private split = '_';
|
|
6
|
+
|
|
7
|
+
public constructor(factors: F, private order: Array<keyof F>) {
|
|
8
|
+
this.factors = isReactive(factors) ? factors : reactive(factors) as F;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 构建存储键
|
|
13
|
+
* @param parts 键的部分
|
|
14
|
+
* @param excludeFactors 排除键的因素
|
|
15
|
+
*/
|
|
16
|
+
public build(parts: Array<MaybeRefOrGetter<F[string]>>, excludeFactors: Array<keyof F> | boolean = false) {
|
|
17
|
+
const finalKey = computed(() => {
|
|
18
|
+
const thisKeys = parts.map(k => String(toValue(k)));
|
|
19
|
+
const factorKeys = Array.isArray(excludeFactors)
|
|
20
|
+
? this.order.filter(k => !excludeFactors?.includes(k)).map(k => this.factors[k])
|
|
21
|
+
: excludeFactors
|
|
22
|
+
? []
|
|
23
|
+
: this.order.map(k => this.factors[k]);
|
|
24
|
+
const thisStr = thisKeys.join(this.split);
|
|
25
|
+
const factorStr = factorKeys.join(this.split);
|
|
26
|
+
return `${factorStr}${factorStr ? this.split : ''}${thisStr}`;
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
return finalKey;
|
|
30
|
+
}
|
|
31
|
+
}
|
package/utils/upload/AwsS3.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S3Client } from '@aws-sdk/client-s3';
|
|
1
|
+
import { S3Client, ChecksumAlgorithm } from '@aws-sdk/client-s3';
|
|
2
2
|
import { Upload } from '@aws-sdk/lib-storage';
|
|
3
3
|
import type { FileHandler } from './fileHandlers';
|
|
4
4
|
|
|
@@ -20,16 +20,21 @@ export class AwsS3 {
|
|
|
20
20
|
public constructor(private getParams: TGetParams, private fileHandler?: FileHandler) {
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
public async upload(file: File, root
|
|
23
|
+
public async upload(file: File, root = 'unclassified') {
|
|
24
24
|
const s3Client = await this.refreshClient();
|
|
25
|
-
const filePath = await this.genFilePath(root
|
|
25
|
+
const filePath = root.includes('/') ? root : await this.genFilePath(root);
|
|
26
26
|
const fileName = await (this.fileHandler?.genFileName?.(file) ?? this.genFileName(file));
|
|
27
27
|
const fullPath = `${filePath}/${fileName}`;
|
|
28
28
|
|
|
29
29
|
const uploader = new Upload({
|
|
30
30
|
client: s3Client!,
|
|
31
|
-
params: {
|
|
31
|
+
params: {
|
|
32
|
+
Bucket: this.bucket, Key: fullPath, Body: file,
|
|
33
|
+
ChecksumAlgorithm: ChecksumAlgorithm.CRC32,
|
|
34
|
+
},
|
|
32
35
|
leavePartsOnError: false,
|
|
36
|
+
queueSize: 4,
|
|
37
|
+
partSize: 5 * 1024 * 1024,
|
|
33
38
|
});
|
|
34
39
|
|
|
35
40
|
return { uploader, fileURL: `${this.domain}/${fullPath}` };
|
|
@@ -61,6 +66,8 @@ export class AwsS3 {
|
|
|
61
66
|
secretAccessKey: params.secretAccessKey,
|
|
62
67
|
sessionToken: params.sessionToken,
|
|
63
68
|
},
|
|
69
|
+
requestChecksumCalculation: 'WHEN_REQUIRED',
|
|
70
|
+
responseChecksumValidation: 'WHEN_REQUIRED',
|
|
64
71
|
});
|
|
65
72
|
|
|
66
73
|
return this.s3Client;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { TabPane as ATabPane, Tabs as ATabs } from 'ant-design-vue';
|
|
3
|
-
import { injectTTAdmin } from '../../adminPlugin';
|
|
4
|
-
|
|
5
|
-
const pageTabStore = injectTTAdmin()!.deps.usePageTabStore();
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<template>
|
|
9
|
-
<ATabs
|
|
10
|
-
class="app-page-tabs"
|
|
11
|
-
:activeKey="pageTabStore.activeTab"
|
|
12
|
-
type="editable-card"
|
|
13
|
-
size="small"
|
|
14
|
-
:animated="false"
|
|
15
|
-
:hideAdd="true"
|
|
16
|
-
:tabBarGutter="4"
|
|
17
|
-
@tabClick="(pageTabStore.openTab as any)"
|
|
18
|
-
@edit="(pageTabStore.closeTab as any)"
|
|
19
|
-
>
|
|
20
|
-
<ATabPane v-for="tab of pageTabStore.tabList" :key="tab.key" :tab="tab.title">
|
|
21
|
-
<template #closeIcon>
|
|
22
|
-
<i class="i-icon-park-outline:close" />
|
|
23
|
-
</template>
|
|
24
|
-
</ATabPane>
|
|
25
|
-
</ATabs>
|
|
26
|
-
</template>
|
|
27
|
-
|
|
28
|
-
<style scoped lang="scss">
|
|
29
|
-
.app-page-tabs {
|
|
30
|
-
:deep(.ant-tabs-nav) {
|
|
31
|
-
margin: 0;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
:deep(.ant-tabs-nav::before) {
|
|
35
|
-
display: none;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
:deep(.ant-tabs-tab) {
|
|
39
|
-
--uno: 'border-rd-3px! text-14px p-[3px_1px_3px_8px]! select-none';
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
:deep(.ant-tabs-tab .ant-tabs-tab-btn) {
|
|
43
|
-
transform: translateX(8px);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
:deep(.ant-tabs-tab-active) {
|
|
47
|
-
--uno: 'border-[currentColor]!';
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
:deep(.ant-tabs-tab-remove) {
|
|
51
|
-
display: flex;
|
|
52
|
-
height: 100%;
|
|
53
|
-
align-items: center;
|
|
54
|
-
margin: 0;
|
|
55
|
-
opacity: 0;
|
|
56
|
-
transition: all 150ms;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
:deep(.ant-tabs-tab:hover .ant-tabs-tab-btn),
|
|
60
|
-
:deep(.ant-tabs-tab-active .ant-tabs-tab-btn) {
|
|
61
|
-
transform: translateX(0);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
:deep(.ant-tabs-tab:hover .ant-tabs-tab-remove),
|
|
65
|
-
:deep(.ant-tabs-tab-active .ant-tabs-tab-remove) {
|
|
66
|
-
margin-left: 0;
|
|
67
|
-
opacity: 1;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
</style>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Router } from 'vue-router';
|
|
2
|
-
import { adminPlugin } from '../adminPlugin';
|
|
3
|
-
|
|
4
|
-
export function setupCollapseMenu(router: Router) {
|
|
5
|
-
const menuStore = adminPlugin.deps.useMenuStore();
|
|
6
|
-
|
|
7
|
-
router.beforeEach(() => {
|
|
8
|
-
menuStore.collapsed = false;
|
|
9
|
-
return true;
|
|
10
|
-
});
|
|
11
|
-
}
|
package/libs/a-calc.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from 'a-calc';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { useQueryClient } from '@tanstack/vue-query';
|
|
2
|
-
import { defineStore } from 'pinia';
|
|
3
|
-
import { useRouter } from 'vue-router';
|
|
4
|
-
|
|
5
|
-
export const useTestStore = defineStore('test-store', () => {
|
|
6
|
-
const router = useRouter();
|
|
7
|
-
const queryClient = useQueryClient();
|
|
8
|
-
console.log('🤡 / router:', router);
|
|
9
|
-
console.log('🤡 / queryClient:', queryClient);
|
|
10
|
-
return {};
|
|
11
|
-
});
|