Skip to content

Commit 95039ea

Browse files
authored
chore: sync main for develop
chore: sync main for develop
2 parents 9840fd4 + f3f266b commit 95039ea

36 files changed

Lines changed: 173 additions & 130 deletions

commitlint.config.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
11
// commit-lint config
2-
module.exports = { extends: ['@commitlint/config-conventional'] };
2+
module.exports = {
3+
extends: ['@commitlint/config-conventional'],
4+
rules: {
5+
'type-enum': [
6+
2,
7+
'always',
8+
['build', 'chore', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'style', 'test', 'types'],
9+
],
10+
},
11+
};

package.json

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "tdesign-vue-next-starter",
3-
"version": "0.7.5",
2+
"name": "@tencent/tdesign-vue-next-starter",
3+
"version": "0.7.6",
44
"scripts": {
55
"dev:mock": "vite --open --mode mock",
66
"dev": "vite --open --mode development",
@@ -28,9 +28,9 @@
2828
"pinia-plugin-persistedstate": "^3.1.0",
2929
"qrcode.vue": "^3.3.4",
3030
"qs": "^6.11.1",
31-
"tdesign-icons-vue-next": "^0.1.8",
32-
"tdesign-vue-next": "^1.2.2",
33-
"tvision-color": "^1.5.0",
31+
"tdesign-icons-vue-next": "^0.1.11",
32+
"tdesign-vue-next": "^1.3.4",
33+
"tvision-color": "^1.6.0",
3434
"vue": "^3.2.47",
3535
"vue-clipboard3": "^2.0.0",
3636
"vue-router": "~4.1.6"
@@ -83,12 +83,10 @@
8383
"lint-staged": {
8484
"*.{js,jsx,vue,ts,tsx}": [
8585
"prettier --write",
86-
"npm run lint:fix",
87-
"git add ."
86+
"npm run lint:fix"
8887
],
8988
"*.{html,vue,vss,sass,less}": [
90-
"npm run stylelint:fix",
91-
"git add ."
89+
"npm run stylelint:fix"
9290
]
9391
}
9492
}

src/config/global.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
export const prefix = 'tdesign-starter';
2-
export const TOKEN_NAME = 'tdesign-starter';

src/constants/index.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,14 @@ export const CONTRACT_PAYMENT_TYPES = {
3434
RECEIPT: 1,
3535
};
3636

37-
// 通知的优先级对应的TAG类型
38-
export const NOTIFICATION_TYPES = {
39-
low: 'primary',
40-
middle: 'warning',
41-
high: 'danger',
42-
};
37+
// 标签类型
38+
type TagTheme = 'default' | 'success' | 'primary' | 'warning' | 'danger';
39+
// 通知的优先级对应的标签类型
40+
export const NOTIFICATION_TYPES: Map<string, TagTheme> = new Map([
41+
['low', 'primary'],
42+
['middle', 'warning'],
43+
['high', 'danger'],
44+
]);
4345

4446
// 通用请求头
4547
export enum ContentTypeEnum {

src/hooks/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const useChart = (domId: string): Ref<echarts.ECharts> => {
3939
* @returns
4040
*/
4141
export const useCounter = (duration = 60): [Ref<number>, () => void] => {
42-
let intervalTimer;
42+
let intervalTimer: ReturnType<typeof setInterval>;
4343
onUnmounted(() => {
4444
clearInterval(intervalTimer);
4545
});

src/layouts/components/Header.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ const changeCollapsed = () => {
141141
});
142142
};
143143
144-
const handleNav = (url) => {
144+
const handleNav = (url: string) => {
145145
router.push(url);
146146
};
147147

src/layouts/components/LayoutContent.vue

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
:min-column-width="128"
2525
:popup-props="{
2626
overlayClassName: 'route-tabs-dropdown',
27-
onVisibleChange: (visible, ctx) => handleTabMenuClick(visible, ctx, routeItem.path),
27+
onVisibleChange: (visible: boolean, ctx: PopupVisibleChangeContext) => handleTabMenuClick(visible, ctx, routeItem.path),
2828
visible: activeTabPath === routeItem.path,
2929
}"
3030
>
@@ -70,12 +70,13 @@
7070
</template>
7171

7272
<script setup lang="ts">
73+
import type { PopupVisibleChangeContext } from 'tdesign-vue-next';
7374
import { computed, nextTick, ref } from 'vue';
7475
import { useRoute, useRouter } from 'vue-router';
7576
7677
import { prefix } from '@/config/global';
7778
import { useSettingStore, useTabsRouterStore } from '@/store';
78-
import type { TRouterInfo } from '@/types/interface';
79+
import type { TRouterInfo, TTabRemoveOptions } from '@/types/interface';
7980
8081
import LBreadcrumb from './Breadcrumb.vue';
8182
import LContent from './Content.vue';
@@ -95,12 +96,12 @@ const handleChangeCurrentTab = (path: string) => {
9596
router.push({ path, query: route.query });
9697
};
9798
98-
const handleRemove = ({ value: path, index }) => {
99+
const handleRemove = (options: TTabRemoveOptions) => {
99100
const { tabRouters } = tabsRouterStore;
100-
const nextRouter = tabRouters[index + 1] || tabRouters[index - 1];
101+
const nextRouter = tabRouters[options.index + 1] || tabRouters[options.index - 1];
101102
102-
tabsRouterStore.subtractCurrentTabRouter({ path, routeIdx: index });
103-
if (path === route.path) router.push({ path: nextRouter.path, query: nextRouter.query });
103+
tabsRouterStore.subtractCurrentTabRouter({ path: options.value as string, routeIdx: options.index });
104+
if ((options.value as string) === route.path) router.push({ path: nextRouter.path, query: nextRouter.query });
104105
};
105106
106107
const handleRefresh = (route: TRouterInfo, routeIdx: number) => {
@@ -147,7 +148,7 @@ const handleOperationEffect = (type: 'other' | 'ahead' | 'behind', routeIndex: n
147148
148149
activeTabPath.value = null;
149150
};
150-
const handleTabMenuClick = (visible: boolean, ctx, path: string) => {
151+
const handleTabMenuClick = (visible: boolean, ctx: PopupVisibleChangeContext, path: string) => {
151152
if (ctx.trigger === 'document') activeTabPath.value = null;
152153
if (visible) activeTabPath.value = path;
153154
};

src/layouts/components/LayoutSideNav.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { computed } from 'vue';
1616
import { useRoute } from 'vue-router';
1717
1818
import { usePermissionStore, useSettingStore } from '@/store';
19+
import type { MenuRoute } from '@/types/interface';
1920
2021
import LSideNav from './SideNav.vue';
2122
@@ -26,7 +27,7 @@ const { routers: menuRouters } = storeToRefs(permissionStore);
2627
2728
const sideMenu = computed(() => {
2829
const { layout, splitMenu } = settingStore;
29-
let newMenuRouters = menuRouters.value;
30+
let newMenuRouters = menuRouters.value as Array<MenuRoute>;
3031
if (layout === 'mix' && splitMenu) {
3132
newMenuRouters.forEach((menu) => {
3233
if (route.path.indexOf(menu.path) === 0) {

src/layouts/setting.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ const initStyleConfig = () => {
120120
const styleConfig = STYLE_CONFIG;
121121
for (const key in styleConfig) {
122122
if (Object.prototype.hasOwnProperty.call(styleConfig, key)) {
123-
styleConfig[key] = settingStore[key];
123+
(styleConfig[key as keyof typeof STYLE_CONFIG] as any) = settingStore[key as keyof typeof STYLE_CONFIG];
124124
}
125125
}
126126

src/pages/dashboard/base/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import dayjs from 'dayjs';
2+
import { EChartsOption } from 'echarts';
23

34
import { TChartColor } from '@/config/color';
45
import { getRandomArray } from '@/utils/charts';
@@ -307,7 +308,7 @@ export function getPieChartDataSet({
307308
textColor,
308309
placeholderColor,
309310
containerColor,
310-
}: { radius?: number } & Record<string, string>) {
311+
}: { radius?: number } & Record<string, string>): EChartsOption {
311312
return {
312313
color: getChartListColor(),
313314
tooltip: {

0 commit comments

Comments
 (0)