Compare commits

...

9 Commits

Author SHA1 Message Date
PED
d5035cb274 Merge 28184d5d6a into a03becdaed 2025-02-28 01:42:13 +00:00
PED
28184d5d6a feat: Update table column type to support Naive UI column title rendering
直接使用了 Naive UI column title 的类型
2025-02-28 09:42:10 +08:00
PED
e97b905ae5 feat: Support dynamic column titles in table column settings
在 columns 重 title 属性可以传入渲染函数
2025-02-27 17:34:29 +08:00
Soybean
a03becdaed feat(projects): tab support touch event 2025-02-19 10:50:12 +08:00
Soybean
15163d7011 Revert "fix(projects): fix multiple calls to the login API when clicking quickly. fixed #697 (#698)"
This reverts commit 86da767e24.
2025-02-11 23:57:16 +08:00
Soybean
132e101243 chore(deps): update deps 2025-02-11 23:49:24 +08:00
青菜白玉汤
9b9455d945 feat(projects): support loading page dark mode adaptation. (#702) 2025-01-26 22:32:05 +08:00
李鹏坤-执手对影成双
86da767e24 fix(projects): fix multiple calls to the login API when clicking quickly. fixed #697 (#698) 2025-01-25 18:38:49 +08:00
Azir
54e7d6d00a fix(projects): hidden multi-language button in login page. fix #694 2025-01-24 18:34:07 +08:00
12 changed files with 831 additions and 788 deletions

View File

@@ -54,7 +54,7 @@
"@sa/hooks": "workspace:*",
"@sa/materials": "workspace:*",
"@sa/utils": "workspace:*",
"@vueuse/core": "12.4.0",
"@vueuse/core": "12.5.0",
"clipboard": "2.0.11",
"dayjs": "1.11.13",
"defu": "6.1.4",
@@ -62,42 +62,42 @@
"json5": "2.2.3",
"naive-ui": "2.41.0",
"nprogress": "0.2.0",
"pinia": "2.3.0",
"tailwind-merge": "2.6.0",
"pinia": "3.0.0",
"tailwind-merge": "3.0.1",
"vue": "3.5.13",
"vue-draggable-plus": "0.6.0",
"vue-i18n": "11.0.1",
"vue-i18n": "11.1.1",
"vue-router": "4.5.0"
},
"devDependencies": {
"@elegant-router/vue": "0.3.8",
"@iconify/json": "2.2.297",
"@iconify/json": "2.2.305",
"@sa/scripts": "workspace:*",
"@sa/uno-preset": "workspace:*",
"@soybeanjs/eslint-config": "1.4.4",
"@types/node": "22.10.7",
"@types/node": "22.13.1",
"@types/nprogress": "0.2.3",
"@unocss/eslint-config": "65.4.2",
"@unocss/preset-icons": "65.4.2",
"@unocss/preset-uno": "65.4.2",
"@unocss/transformer-directives": "65.4.2",
"@unocss/transformer-variant-group": "65.4.2",
"@unocss/vite": "65.4.2",
"@unocss/eslint-config": "65.4.3",
"@unocss/preset-icons": "65.4.3",
"@unocss/preset-uno": "65.4.3",
"@unocss/transformer-directives": "65.4.3",
"@unocss/transformer-variant-group": "65.4.3",
"@unocss/vite": "65.4.3",
"@vitejs/plugin-vue": "5.2.1",
"@vitejs/plugin-vue-jsx": "4.1.1",
"eslint": "9.18.0",
"eslint": "9.20.0",
"eslint-plugin-vue": "9.32.0",
"lint-staged": "15.4.1",
"sass": "1.83.4",
"lint-staged": "15.4.3",
"sass": "1.84.0",
"simple-git-hooks": "2.11.1",
"tsx": "4.19.2",
"typescript": "5.7.3",
"unplugin-icons": "22.0.0",
"unplugin-vue-components": "28.0.0",
"vite": "6.0.7",
"vite": "6.1.0",
"vite-plugin-progress": "0.0.7",
"vite-plugin-svg-icons": "2.0.1",
"vite-plugin-vue-devtools": "7.7.0",
"vite-plugin-vue-devtools": "7.7.1",
"vue-eslint-parser": "9.4.3",
"vue-tsc": "2.2.0"
},

View File

@@ -1,5 +1,6 @@
import { computed, reactive, ref } from 'vue';
import type { Ref } from 'vue';
import type { DataTableBaseColumn } from 'naive-ui';
import { jsonClone } from '@sa/utils';
import useBoolean from './use-boolean';
import useLoading from './use-loading';
@@ -10,7 +11,7 @@ export type ApiFn = (args: any) => Promise<unknown>;
export type TableColumnCheck = {
key: string;
title: string;
title: DataTableBaseColumn['title'];
checked: boolean;
};

View File

@@ -14,8 +14,8 @@
},
"devDependencies": {
"@soybeanjs/changelog": "0.3.24",
"bumpp": "9.10.1",
"c12": "2.0.1",
"bumpp": "10.0.3",
"c12": "2.0.2",
"cac": "6.7.14",
"consola": "3.4.0",
"enquirer": "2.4.1",

1548
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -25,7 +25,12 @@ const columns = defineModel<NaiveUI.TableColumnCheck[]>('columns', {
<div v-for="item in columns" :key="item.key" class="h-36px flex-y-center rd-4px hover:(bg-primary bg-opacity-20)">
<icon-mdi-drag class="mr-8px h-full cursor-move text-icon" />
<NCheckbox v-model:checked="item.checked" class="none_draggable flex-1">
{{ item.title }}
<template v-if="typeof item.title === 'function'">
<component :is="item.title" />
</template>
<template v-else>
{{ item.title }}
</template>
</NCheckbox>
</div>
</VueDraggable>

View File

@@ -61,3 +61,5 @@ export const resetCacheStrategyRecord: Record<UnionKey.ResetCacheStrategy, App.I
};
export const resetCacheStrategyOptions = transformRecordToOption(resetCacheStrategyRecord);
export const DARK_CLASS = 'dark';

View File

@@ -186,7 +186,7 @@ init();
:active="tab.id === tabStore.activeTabId"
:active-color="themeStore.themeColor"
:closable="!tabStore.isTabRetain(tab.id)"
@click="tabStore.switchRouteByTab(tab)"
@pointerdown="tabStore.switchRouteByTab(tab)"
@close="handleCloseTab(tab)"
@contextmenu="handleContextMenu($event, tab.id)"
>

View File

@@ -3,14 +3,20 @@ import { getRgb } from '@sa/color';
import { $t } from '@/locales';
import { localStg } from '@/utils/storage';
import systemLogo from '@/assets/svg-icon/logo.svg?raw';
import { DARK_CLASS } from '@/constants/app';
import { toggleHtmlClass } from '@/utils/common';
export function setupLoading() {
const themeColor = localStg.get('themeColor') || '#646cff';
const darkMode = localStg.get('darkMode') || false;
const { r, g, b } = getRgb(themeColor);
const primaryColor = `--primary-color: ${r} ${g} ${b}`;
if (darkMode) {
toggleHtmlClass(DARK_CLASS).add();
}
const loadingClasses = [
'left-0 top-0',
'left-0 bottom-0 animate-delay-500',
@@ -27,14 +33,14 @@ export function setupLoading() {
.join('\n');
const loading = `
<div class="fixed-center flex-col" style="${primaryColor}">
<div class="fixed-center flex-col bg-layout" style="${primaryColor}">
${logoWithClass}
<div class="w-56px h-56px my-36px">
<div class="relative h-full animate-spin">
${dot}
</div>
</div>
<h2 class="text-28px font-500 text-#646464">${$t('system.title')}</h2>
<h2 class="text-28px font-500 text-primary">${$t('system.title')}</h2>
</div>`;
const app = document.getElementById('app');

View File

@@ -174,6 +174,7 @@ export const useThemeStore = defineStore(SetupStoreId.Theme, () => {
darkMode,
val => {
toggleCssDarkMode(val);
localStg.set('darkMode', val);
},
{ immediate: true }
);

View File

@@ -5,8 +5,7 @@ import { overrideThemeSettings, themeSettings } from '@/theme/settings';
import { themeVars } from '@/theme/vars';
import { toggleHtmlClass } from '@/utils/common';
import { localStg } from '@/utils/storage';
const DARK_CLASS = 'dark';
import { DARK_CLASS } from '@/constants/app';
/** Init theme settings */
export function initThemeSettings() {

View File

@@ -20,6 +20,8 @@ declare namespace StorageType {
refreshToken: string;
/** The theme color */
themeColor: string;
/** The dark mode */
darkMode: boolean;
/** The theme settings */
themeSettings: App.Theme.ThemeSetting;
/**

View File

@@ -66,6 +66,7 @@ const bgColor = computed(() => {
@switch="themeStore.toggleThemeScheme"
/>
<LangSwitch
v-if="themeStore.header.multilingual.visible"
:lang="appStore.locale"
:lang-options="appStore.localeOptions"
:show-tooltip="false"