mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-10-11 20:33:41 +08:00
Compare commits
1 Commits
tauri-v1.0
...
tauri-v1.0
Author | SHA1 | Date | |
---|---|---|---|
|
159d1145b5 |
79
CHANGELOG.md
79
CHANGELOG.md
@@ -1,85 +1,6 @@
|
||||
# Changelog
|
||||
|
||||
|
||||
## [v1.0.3](https://github.com/soybeanjs/soybean-admin/compare/v1.0.2...v1.0.3) (24-04-16)
|
||||
|
||||
### 🚀 Features
|
||||
|
||||
- **hooks**: deleting the route export of useRoutePush, use vue-router - by **paynezhuang** [<samp>(c6648)</samp>](https://github.com/soybeanjs/soybean-admin/commit/c6648b6)
|
||||
|
||||
### 🐞 Bug Fixes
|
||||
|
||||
- **projects**:
|
||||
- fix menu edit rules - by **paynezhuang** [<samp>(00105)</samp>](https://github.com/soybeanjs/soybean-admin/commit/001059c)
|
||||
- fix SvgIcon inheritAttrs warning - by @honghuangdc [<samp>(efc0e)</samp>](https://github.com/soybeanjs/soybean-admin/commit/efc0e25)
|
||||
- fix axios createRequest: add default state - by @honghuangdc [<samp>(d6eda)</samp>](https://github.com/soybeanjs/soybean-admin/commit/d6eda8f)
|
||||
- update union-key.d.ts - by @honghuangdc [<samp>(60bef)</samp>](https://github.com/soybeanjs/soybean-admin/commit/60beff7)
|
||||
- fix update theme color - by @honghuangdc [<samp>(27c53)</samp>](https://github.com/soybeanjs/soybean-admin/commit/27c53cd)
|
||||
|
||||
### 🔥 Performance
|
||||
|
||||
- **projects**: perf code - by @honghuangdc [<samp>(b7f07)</samp>](https://github.com/soybeanjs/soybean-admin/commit/b7f0749)
|
||||
|
||||
### 💅 Refactors
|
||||
|
||||
- **projects**: update naive-ui.d.ts - by @honghuangdc [<samp>(bb74d)</samp>](https://github.com/soybeanjs/soybean-admin/commit/bb74d99)
|
||||
|
||||
### 📖 Documentation
|
||||
|
||||
- **projects**: update README.md - by @honghuangdc [<samp>(f4a9c)</samp>](https://github.com/soybeanjs/soybean-admin/commit/f4a9cf8)
|
||||
|
||||
### 🏡 Chore
|
||||
|
||||
- **release**: release tauri v1.0.2 - by @honghuangdc [<samp>(ebdef)</samp>](https://github.com/soybeanjs/soybean-admin/commit/ebdef72)
|
||||
|
||||
### ❤️ Contributors
|
||||
|
||||
[](https://github.com/honghuangdc)
|
||||
[paynezhuang](mailto:paynezhuang@gmail.com)
|
||||
|
||||
## [v1.0.2](https://github.com/soybeanjs/soybean-admin/compare/v1.0.1...v1.0.2) (24-04-08)
|
||||
|
||||
### 🐞 Bug Fixes
|
||||
|
||||
- **projects**: unify border-radius of Tag. fixed #378 - by @honghuangdc in https://github.com/soybeanjs/soybean-admin/issues/378 [<samp>(2f15a)</samp>](https://github.com/soybeanjs/soybean-admin/commit/2f15a2a)
|
||||
- **styles**: fix css var is inserted repeatedly - by **燕博文** [<samp>(769d8)</samp>](https://github.com/soybeanjs/soybean-admin/commit/769d84a)
|
||||
|
||||
### 💅 Refactors
|
||||
|
||||
- **projects**: refactor addThemeVarsToHtml - by @honghuangdc [<samp>(41e47)</samp>](https://github.com/soybeanjs/soybean-admin/commit/41e470e)
|
||||
|
||||
### 🏡 Chore
|
||||
|
||||
- **deps**: update deps - by @honghuangdc [<samp>(a1b48)</samp>](https://github.com/soybeanjs/soybean-admin/commit/a1b484a)
|
||||
- **projects**: disabled unocss eslint rule: order-attributify - by @honghuangdc [<samp>(1c72d)</samp>](https://github.com/soybeanjs/soybean-admin/commit/1c72dc7)
|
||||
|
||||
### ❤️ Contributors
|
||||
|
||||
[](https://github.com/honghuangdc)
|
||||
[燕博文](mailto:349952469@qq.com)
|
||||
|
||||
## [v1.0.1](https://github.com/soybeanjs/soybean-admin/compare/v1.0.0...v1.0.1) (24-04-03)
|
||||
|
||||
### 🐞 Bug Fixes
|
||||
|
||||
- **projects**:
|
||||
- fix flatRequest error type. fixed #376 - by @honghuangdc in https://github.com/soybeanjs/soybean-admin/issues/376 [<samp>(1ec5e)</samp>](https://github.com/soybeanjs/soybean-admin/commit/1ec5ea0)
|
||||
- add maxWidth for GlobalTab to fix bg with gap. fixed #350 - by @honghuangdc in https://github.com/soybeanjs/soybean-admin/issues/350 [<samp>(cc539)</samp>](https://github.com/soybeanjs/soybean-admin/commit/cc53997)
|
||||
|
||||
### 📖 Documentation
|
||||
|
||||
- **projects**: update README.md - by @honghuangdc [<samp>(76011)</samp>](https://github.com/soybeanjs/soybean-admin/commit/76011af)
|
||||
|
||||
### 🏡 Chore
|
||||
|
||||
- **projects**:
|
||||
- update deps - by @honghuangdc [<samp>(4babb)</samp>](https://github.com/soybeanjs/soybean-admin/commit/4babbe1)
|
||||
- update pnpm version - by @honghuangdc [<samp>(9125c)</samp>](https://github.com/soybeanjs/soybean-admin/commit/9125cc9)
|
||||
|
||||
### ❤️ Contributors
|
||||
|
||||
[](https://github.com/honghuangdc)
|
||||
|
||||
## [v1.0.0](https://github.com/soybeanjs/soybean-admin/compare/v0.10.4...v1.0.0) (24-03-31)
|
||||
|
||||
### 🚀 Features
|
||||
|
@@ -143,17 +143,17 @@ Thanks the following people for their contributions. If you want to contribute t
|
||||
<p>QQ Group</p>
|
||||
<img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/uPic/qq-soybean-admin-2.jpg" style="width:200px" />
|
||||
</div>
|
||||
<!-- <div>
|
||||
<div>
|
||||
<p>WeChat Group</p>
|
||||
<img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/uPic/wechat-0402.jpg" style="width:200px" />
|
||||
</div> -->
|
||||
</div>
|
||||
<div>
|
||||
<p>Add the following WeChat to invite to the WeChat group</p>
|
||||
<img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/uPic/wechat-soybeanjs.jpg" style="width:200px" />
|
||||
</div>
|
||||
<div>
|
||||
<!-- <div>
|
||||
<p>Add Soybean's WeChat for business consultation, cooperation, project architecture, one-on-one guidance, etc.</p>
|
||||
<img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/uPic/wechat-soybean.jpg" style="width:200px" />
|
||||
<img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/uPic/wechat-soybean.jpg" style="width:200px" /> -->
|
||||
</div>
|
||||
|
||||
## Star Trend
|
||||
|
@@ -48,7 +48,7 @@
|
||||
- [预览地址](https://antd.soybeanjs.cn/)
|
||||
- [Github 仓库](https://github.com/soybeanjs/soybean-admin-antd)
|
||||
- [Gitee 仓库](https://gitee.com/honghuangdc/soybean-admin-antd)
|
||||
|
||||
-
|
||||
- **旧版:**
|
||||
- [预览地址](https://legacy.soybeanjs.cn/)
|
||||
- [Github 仓库](https://github.com/soybeanjs/soybean-admin/tree/legacy)
|
||||
|
@@ -17,8 +17,7 @@ export default defineConfig(
|
||||
registeredComponentsOnly: false,
|
||||
ignores: ['/^icon-/']
|
||||
}
|
||||
],
|
||||
'order-attributify': 'off'
|
||||
]
|
||||
}
|
||||
}
|
||||
);
|
||||
|
32
package.json
32
package.json
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "soybean-admin",
|
||||
"type": "module",
|
||||
"version": "1.0.3",
|
||||
"packageManager": "pnpm@8.15.6",
|
||||
"version": "1.0.0",
|
||||
"packageManager": "pnpm@8.15.5",
|
||||
"description": "A fresh and elegant admin template, based on Vue3、Vite3、TypeScript、NaiveUI and UnoCSS. 一个基于Vue3、Vite3、TypeScript、NaiveUI and UnoCSS的清新优雅的中后台模版。",
|
||||
"author": {
|
||||
"name": "Soybean",
|
||||
@@ -63,42 +63,42 @@
|
||||
"pinia": "2.1.7",
|
||||
"vue": "3.4.21",
|
||||
"vue-draggable-plus": "0.4.0",
|
||||
"vue-i18n": "9.11.0",
|
||||
"vue-i18n": "9.10.2",
|
||||
"vue-router": "4.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@elegant-router/vue": "0.3.6",
|
||||
"@iconify/json": "2.2.198",
|
||||
"@iconify/json": "2.2.196",
|
||||
"@sa/scripts": "workspace:*",
|
||||
"@sa/uno-preset": "workspace:*",
|
||||
"@soybeanjs/eslint-config": "1.2.5",
|
||||
"@tauri-apps/cli": "1.5.11",
|
||||
"@types/lodash-es": "4.17.12",
|
||||
"@types/node": "20.12.5",
|
||||
"@types/node": "20.12.2",
|
||||
"@types/nprogress": "0.2.3",
|
||||
"@unocss/eslint-config": "0.59.0",
|
||||
"@unocss/preset-icons": "0.59.0",
|
||||
"@unocss/preset-uno": "0.59.0",
|
||||
"@unocss/transformer-directives": "0.59.0",
|
||||
"@unocss/transformer-variant-group": "0.59.0",
|
||||
"@unocss/vite": "0.59.0",
|
||||
"@unocss/eslint-config": "0.58.8",
|
||||
"@unocss/preset-icons": "0.58.8",
|
||||
"@unocss/preset-uno": "0.58.8",
|
||||
"@unocss/transformer-directives": "0.58.8",
|
||||
"@unocss/transformer-variant-group": "0.58.8",
|
||||
"@unocss/vite": "0.58.8",
|
||||
"@vitejs/plugin-vue": "5.0.4",
|
||||
"@vitejs/plugin-vue-jsx": "3.1.0",
|
||||
"eslint": "8.57.0",
|
||||
"eslint-plugin-vue": "9.24.0",
|
||||
"lint-staged": "15.2.2",
|
||||
"sass": "1.74.1",
|
||||
"sass": "1.72.0",
|
||||
"simple-git-hooks": "2.11.1",
|
||||
"tsx": "4.7.2",
|
||||
"typescript": "5.4.4",
|
||||
"tsx": "4.7.1",
|
||||
"typescript": "5.4.3",
|
||||
"unplugin-icons": "0.18.5",
|
||||
"unplugin-vue-components": "0.26.0",
|
||||
"vite": "5.2.8",
|
||||
"vite": "5.2.7",
|
||||
"vite-plugin-progress": "0.0.7",
|
||||
"vite-plugin-svg-icons": "2.0.1",
|
||||
"vite-plugin-vue-devtools": "7.0.25",
|
||||
"vue-eslint-parser": "9.4.2",
|
||||
"vue-tsc": "2.0.11"
|
||||
"vue-tsc": "2.0.7"
|
||||
},
|
||||
"simple-git-hooks": {
|
||||
"commit-msg": "pnpm sa git-commit-verify",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sa/axios",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.0",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
|
@@ -127,7 +127,6 @@ export function createRequest<ResponseData = any, State = Record<string, unknown
|
||||
|
||||
request.cancelRequest = cancelRequest;
|
||||
request.cancelAllRequest = cancelAllRequest;
|
||||
request.state = {} as State;
|
||||
|
||||
return request;
|
||||
}
|
||||
@@ -146,10 +145,9 @@ export function createFlatRequest<ResponseData = any, State = Record<string, unk
|
||||
) {
|
||||
const { instance, opts, cancelRequest, cancelAllRequest } = createCommonRequest<ResponseData>(axiosConfig, options);
|
||||
|
||||
const flatRequest: FlatRequestInstance<State, ResponseData> = async function flatRequest<
|
||||
T = any,
|
||||
R extends ResponseType = 'json'
|
||||
>(config: CustomAxiosRequestConfig) {
|
||||
const flatRequest: FlatRequestInstance<State> = async function flatRequest<T = any, R extends ResponseType = 'json'>(
|
||||
config: CustomAxiosRequestConfig
|
||||
) {
|
||||
try {
|
||||
const response: AxiosResponse<ResponseData> = await instance(config);
|
||||
|
||||
@@ -165,7 +163,7 @@ export function createFlatRequest<ResponseData = any, State = Record<string, unk
|
||||
} catch (error) {
|
||||
return { data: null, error };
|
||||
}
|
||||
} as FlatRequestInstance<State, ResponseData>;
|
||||
} as FlatRequestInstance<State>;
|
||||
|
||||
flatRequest.cancelRequest = cancelRequest;
|
||||
flatRequest.cancelAllRequest = cancelAllRequest;
|
||||
|
@@ -85,17 +85,15 @@ export type FlatResponseSuccessData<T = any> = {
|
||||
error: null;
|
||||
};
|
||||
|
||||
export type FlatResponseFailData<ResponseData = any> = {
|
||||
export type FlatResponseFailData<T = any> = {
|
||||
data: null;
|
||||
error: AxiosError<ResponseData>;
|
||||
error: AxiosError<T>;
|
||||
};
|
||||
|
||||
export type FlatResponseData<T = any, ResponseData = any> =
|
||||
| FlatResponseSuccessData<T>
|
||||
| FlatResponseFailData<ResponseData>;
|
||||
export type FlatResponseData<T = any> = FlatResponseSuccessData<T> | FlatResponseFailData<T>;
|
||||
|
||||
export interface FlatRequestInstance<S = Record<string, unknown>, ResponseData = any> extends RequestInstanceCommon<S> {
|
||||
export interface FlatRequestInstance<S = Record<string, unknown>> extends RequestInstanceCommon<S> {
|
||||
<T = any, R extends ResponseType = 'json'>(
|
||||
config: CustomAxiosRequestConfig<R>
|
||||
): Promise<FlatResponseData<MappedType<R, T>, ResponseData>>;
|
||||
): Promise<FlatResponseData<MappedType<R, T>>>;
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sa/color-palette",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.0",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
|
@@ -3,7 +3,6 @@ import { getColorName } from './name';
|
||||
import type { ColorPalette, ColorPaletteFamily, ColorPaletteItem, ColorPaletteNumber } from './type';
|
||||
import defaultPalettes from './json/palette.json';
|
||||
|
||||
// to do: there is a bug in the code below, when the color is '#1c5cff', the colorPaletteFamily is not similar to the provided color
|
||||
/**
|
||||
* Get color palette by provided color and color name
|
||||
*
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sa/hooks",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.0",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
|
@@ -16,19 +16,19 @@ export type HookRequestInstanceResponseSuccessData<T = any> = {
|
||||
error: Ref<null>;
|
||||
};
|
||||
|
||||
export type HookRequestInstanceResponseFailData<ResponseData = any> = {
|
||||
export type HookRequestInstanceResponseFailData<T = any> = {
|
||||
data: Ref<null>;
|
||||
error: Ref<AxiosError<ResponseData>>;
|
||||
error: Ref<AxiosError<T>>;
|
||||
};
|
||||
|
||||
export type HookRequestInstanceResponseData<T = any, ResponseData = any> = {
|
||||
export type HookRequestInstanceResponseData<T = any> = {
|
||||
loading: Ref<boolean>;
|
||||
} & (HookRequestInstanceResponseSuccessData<T> | HookRequestInstanceResponseFailData<ResponseData>);
|
||||
} & (HookRequestInstanceResponseSuccessData<T> | HookRequestInstanceResponseFailData<T>);
|
||||
|
||||
export interface HookRequestInstance<ResponseData = any> {
|
||||
export interface HookRequestInstance {
|
||||
<T = any, R extends ResponseType = 'json'>(
|
||||
config: CustomAxiosRequestConfig
|
||||
): HookRequestInstanceResponseData<MappedType<R, T>, ResponseData>;
|
||||
): HookRequestInstanceResponseData<MappedType<R, T>>;
|
||||
cancelRequest: (requestId: string) => void;
|
||||
cancelAllRequest: () => void;
|
||||
}
|
||||
@@ -45,13 +45,13 @@ export default function createHookRequest<ResponseData = any>(
|
||||
) {
|
||||
const request = createFlatRequest<ResponseData>(axiosConfig, options);
|
||||
|
||||
const hookRequest: HookRequestInstance<ResponseData> = function hookRequest<T = any, R extends ResponseType = 'json'>(
|
||||
const hookRequest: HookRequestInstance = function hookRequest<T = any, R extends ResponseType = 'json'>(
|
||||
config: CustomAxiosRequestConfig
|
||||
) {
|
||||
const { loading, startLoading, endLoading } = useLoading();
|
||||
|
||||
const data = ref<MappedType<R, T> | null>(null) as Ref<MappedType<R, T>>;
|
||||
const error = ref<AxiosError<ResponseData> | null>(null) as Ref<AxiosError<ResponseData> | null>;
|
||||
const data = ref<MappedType<R, T> | null>(null);
|
||||
const error = ref<AxiosError<MappedType<R, T>> | null>(null);
|
||||
|
||||
startLoading();
|
||||
|
||||
@@ -70,7 +70,7 @@ export default function createHookRequest<ResponseData = any>(
|
||||
data,
|
||||
error
|
||||
};
|
||||
} as HookRequestInstance<ResponseData>;
|
||||
} as HookRequestInstance;
|
||||
|
||||
hookRequest.cancelRequest = request.cancelRequest;
|
||||
hookRequest.cancelAllRequest = request.cancelAllRequest;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sa/materials",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.0",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
|
@@ -203,7 +203,7 @@ function handleClickMask() {
|
||||
<!-- Main Content -->
|
||||
<main
|
||||
:id="isContentScroll ? scrollElId : undefined"
|
||||
class="flex flex-col flex-grow"
|
||||
class="flex flex-grow flex-col"
|
||||
:class="[commonClass, contentClass, leftGapClass, { 'overflow-y-auto': isContentScroll }]"
|
||||
>
|
||||
<slot></slot>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sa/fetch",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.0",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sa/scripts",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.0",
|
||||
"bin": {
|
||||
"sa": "./bin.ts"
|
||||
},
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sa/uno-preset",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.0",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sa/utils",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.0",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
@@ -13,7 +13,7 @@
|
||||
"colord": "2.9.3",
|
||||
"crypto-js": "4.2.0",
|
||||
"localforage": "1.10.0",
|
||||
"nanoid": "5.0.7"
|
||||
"nanoid": "5.0.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/crypto-js": "4.2.2"
|
||||
|
770
pnpm-lock.yaml
generated
770
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
||||
import { computed, useAttrs } from 'vue';
|
||||
import { Icon } from '@iconify/vue';
|
||||
|
||||
defineOptions({ name: 'SvgIcon', inheritAttrs: false });
|
||||
defineOptions({ name: 'SvgIcon' });
|
||||
|
||||
/**
|
||||
* Props
|
||||
|
@@ -92,6 +92,7 @@ export function useRouterPush(inSetup = true) {
|
||||
}
|
||||
|
||||
return {
|
||||
route,
|
||||
routerPush,
|
||||
routerBack,
|
||||
routerPushByKey,
|
||||
|
@@ -184,7 +184,7 @@ init();
|
||||
<template #prefix>
|
||||
<SvgIcon :icon="tab.icon" :local-icon="tab.localIcon" class="inline-block align-text-bottom text-16px" />
|
||||
</template>
|
||||
<div class="max-w-240px ellipsis-text">{{ tab.label }}</div>
|
||||
<span>{{ tab.label }}</span>
|
||||
</PageTab>
|
||||
</div>
|
||||
</BetterScroll>
|
||||
|
@@ -1,5 +1,4 @@
|
||||
import { computed, reactive, ref } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { defineStore } from 'pinia';
|
||||
import { useLoading } from '@sa/hooks';
|
||||
import { SetupStoreId } from '@/enum';
|
||||
@@ -11,9 +10,8 @@ import { useRouteStore } from '../route';
|
||||
import { clearAuthStorage, getToken, getUserInfo } from './shared';
|
||||
|
||||
export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
||||
const route = useRoute();
|
||||
const routeStore = useRouteStore();
|
||||
const { toLogin, redirectFromLogin } = useRouterPush(false);
|
||||
const { route, toLogin, redirectFromLogin } = useRouterPush(false);
|
||||
const { loading: loginLoading, startLoading, endLoading } = useLoading();
|
||||
|
||||
const token = ref(getToken());
|
||||
@@ -38,7 +36,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
||||
|
||||
authStore.$reset();
|
||||
|
||||
if (!route.meta.constant) {
|
||||
if (!route.value.meta.constant) {
|
||||
await toLogin();
|
||||
}
|
||||
|
||||
|
@@ -2,7 +2,6 @@ import { computed, effectScope, onScopeDispose, ref, toRefs, watch } from 'vue';
|
||||
import type { Ref } from 'vue';
|
||||
import { defineStore } from 'pinia';
|
||||
import { useEventListener, usePreferredColorScheme } from '@vueuse/core';
|
||||
import { getColorPalette } from '@sa/color-palette';
|
||||
import { SetupStoreId } from '@/enum';
|
||||
import { localStg } from '@/utils/storage';
|
||||
import { addThemeVarsToHtml, createThemeToken, getNaiveTheme, initThemeSettings, toggleCssDarkMode } from './shared';
|
||||
@@ -80,15 +79,10 @@ export const useThemeStore = defineStore(SetupStoreId.Theme, () => {
|
||||
* @param color Theme color
|
||||
*/
|
||||
function updateThemeColors(key: App.Theme.ThemeColorKey, color: string) {
|
||||
// get a color palette by provided color and color name, and use the suitable color
|
||||
const colorPalette = getColorPalette(color, key);
|
||||
|
||||
const mainColor = colorPalette.main.hexcode;
|
||||
|
||||
if (key === 'primary') {
|
||||
settings.value.themeColor = mainColor;
|
||||
settings.value.themeColor = color;
|
||||
} else {
|
||||
settings.value.otherColor[key] = mainColor;
|
||||
settings.value.otherColor[key] = color;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -150,11 +150,7 @@ export function addThemeVarsToHtml(tokens: App.Theme.BaseToken, darkTokens: App.
|
||||
}
|
||||
`;
|
||||
|
||||
const styleId = 'theme-vars';
|
||||
|
||||
const style = document.querySelector(`#${styleId}`) || document.createElement('style');
|
||||
|
||||
style.id = styleId;
|
||||
const style = document.createElement('style');
|
||||
|
||||
style.textContent = css + darkCss;
|
||||
|
||||
@@ -234,9 +230,6 @@ export function getNaiveTheme(colors: App.Theme.ThemeColor) {
|
||||
},
|
||||
LoadingBar: {
|
||||
colorLoading
|
||||
},
|
||||
Tag: {
|
||||
borderRadius: '6px'
|
||||
}
|
||||
};
|
||||
|
||||
|
2
src/typings/naive-ui.d.ts
vendored
2
src/typings/naive-ui.d.ts
vendored
@@ -41,7 +41,7 @@ declare namespace NaiveUI {
|
||||
type GetTableData<A extends TableApiFn> = A extends TableApiFn<infer T> ? T : never;
|
||||
|
||||
type NaiveTableConfig<A extends TableApiFn> = Pick<
|
||||
import('@sa/hooks').TableConfig<A, GetTableData<A>, TableColumn<TableDataWithIndex<GetTableData<A>>>>,
|
||||
import('@sa/hooks').TableConfig<A, GetTableData<A>, TableColumn<NaiveUI.TableDataWithIndex<GetTableData<A>>>>,
|
||||
'apiFn' | 'apiParams' | 'columns' | 'immediate'
|
||||
>;
|
||||
}
|
||||
|
4
src/typings/union-key.d.ts
vendored
4
src/typings/union-key.d.ts
vendored
@@ -27,8 +27,8 @@ declare namespace UnionKey {
|
||||
/**
|
||||
* The scroll mode when content overflow
|
||||
*
|
||||
* - wrapper: the wrapper component's root element overflow
|
||||
* - content: the content component overflow
|
||||
* - Wrapper the wrapper component's root element overflow
|
||||
* - Content the content component overflow
|
||||
*/
|
||||
type ThemeScrollMode = import('@sa/materials').LayoutScrollMode;
|
||||
|
||||
|
@@ -84,13 +84,11 @@ function createDefaultModel(): Model {
|
||||
};
|
||||
}
|
||||
|
||||
type RuleKey = Extract<keyof Model, 'menuName' | 'status' | 'routeName' | 'routePath'>;
|
||||
type RuleKey = Extract<keyof Model, 'userName' | 'userStatus'>;
|
||||
|
||||
const rules: Record<RuleKey, App.Global.FormRule> = {
|
||||
menuName: defaultRequiredRule,
|
||||
status: defaultRequiredRule,
|
||||
routeName: defaultRequiredRule,
|
||||
routePath: defaultRequiredRule
|
||||
userName: defaultRequiredRule,
|
||||
userStatus: defaultRequiredRule
|
||||
};
|
||||
|
||||
const disabledMenuType = computed(() => props.operateType === 'edit');
|
||||
|
Reference in New Issue
Block a user