fix(projects): 修复项目配置拷贝功能
This commit is contained in:
parent
2c9660fdbf
commit
a7a269d6a6
@ -1,7 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<n-divider title-placement="center">主题配置</n-divider>
|
<n-divider title-placement="center">主题配置</n-divider>
|
||||||
|
<textarea id="themeConfigCopyTarget" v-model="dataClipboardText" class="absolute opacity-0" />
|
||||||
<n-space vertical>
|
<n-space vertical>
|
||||||
<div ref="copyRef" :data-clipboard-text="dataClipboardText">
|
<div ref="copyRef" data-clipboard-target="#themeConfigCopyTarget">
|
||||||
<n-button type="primary" :block="true">拷贝当前配置</n-button>
|
<n-button type="primary" :block="true">拷贝当前配置</n-button>
|
||||||
</div>
|
</div>
|
||||||
<n-button type="warning" :block="true" @click="handleResetConfig">重置当前配置</n-button>
|
<n-button type="warning" :block="true" @click="handleResetConfig">重置当前配置</n-button>
|
||||||
@ -17,6 +18,7 @@ import { useThemeStore } from '@/store';
|
|||||||
const theme = useThemeStore();
|
const theme = useThemeStore();
|
||||||
|
|
||||||
const copyRef = ref<HTMLElement>();
|
const copyRef = ref<HTMLElement>();
|
||||||
|
|
||||||
const dataClipboardText = ref(getClipboardText());
|
const dataClipboardText = ref(getClipboardText());
|
||||||
|
|
||||||
function getClipboardText() {
|
function getClipboardText() {
|
||||||
@ -29,8 +31,7 @@ function handleResetConfig() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function clipboardEventListener() {
|
function clipboardEventListener() {
|
||||||
if (!copyRef.value) return;
|
const copy = new Clipboard(copyRef.value!);
|
||||||
const copy = new Clipboard(copyRef.value);
|
|
||||||
copy.on('success', () => {
|
copy.on('success', () => {
|
||||||
window.$dialog?.success({
|
window.$dialog?.success({
|
||||||
title: '操作成功',
|
title: '操作成功',
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
import { createRequest } from './request';
|
import { createRequest } from './request';
|
||||||
import { serviceEnv } from '~/.env-config';
|
import { serviceEnv } from '~/.env-config';
|
||||||
|
|
||||||
const { url } = serviceEnv[import.meta.env.VITE_HTTP_ENV];
|
const env = import.meta.env.VITE_HTTP_ENV || 'test';
|
||||||
|
|
||||||
|
const { url } = serviceEnv[env];
|
||||||
|
|
||||||
export const request = createRequest({ baseURL: url });
|
export const request = createRequest({ baseURL: url });
|
||||||
|
|
||||||
|
@ -0,0 +1,142 @@
|
|||||||
|
{
|
||||||
|
"darkMode": false,
|
||||||
|
"layout": {
|
||||||
|
"minWidth": 900,
|
||||||
|
"mode": "vertical",
|
||||||
|
"modeList": [
|
||||||
|
{
|
||||||
|
"value": "vertical",
|
||||||
|
"label": "左侧菜单模式"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "vertical-mix",
|
||||||
|
"label": "左侧菜单混合模式"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "horizontal",
|
||||||
|
"label": "顶部菜单模式"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "horizontal-mix",
|
||||||
|
"label": "顶部菜单混合模式"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"themeColor": "#1890ff",
|
||||||
|
"themeColorList": [
|
||||||
|
"#1890ff",
|
||||||
|
"#409EFF",
|
||||||
|
"#2d8cf0",
|
||||||
|
"#007AFF",
|
||||||
|
"#5ac8fa",
|
||||||
|
"#5856D6",
|
||||||
|
"#536dfe",
|
||||||
|
"#9c27b0",
|
||||||
|
"#AF52DE",
|
||||||
|
"#0096c7",
|
||||||
|
"#00C1D4",
|
||||||
|
"#34C759",
|
||||||
|
"#43a047",
|
||||||
|
"#7cb342",
|
||||||
|
"#c0ca33",
|
||||||
|
"#78DEC7",
|
||||||
|
"#e53935",
|
||||||
|
"#d81b60",
|
||||||
|
"#f4511e",
|
||||||
|
"#fb8c00",
|
||||||
|
"#ffb300",
|
||||||
|
"#fdd835",
|
||||||
|
"#6d4c41",
|
||||||
|
"#546e7a"
|
||||||
|
],
|
||||||
|
"otherColor": {
|
||||||
|
"info": "#0099ad",
|
||||||
|
"success": "#52c41a",
|
||||||
|
"warning": "#faad14",
|
||||||
|
"error": "#f5222d"
|
||||||
|
},
|
||||||
|
"isCustomizeInfoColor": false,
|
||||||
|
"fixedHeaderAndTab": true,
|
||||||
|
"showReload": true,
|
||||||
|
"header": {
|
||||||
|
"height": 56,
|
||||||
|
"crumb": {
|
||||||
|
"visible": true,
|
||||||
|
"showIcon": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tab": {
|
||||||
|
"visible": true,
|
||||||
|
"height": 44,
|
||||||
|
"mode": "chrome",
|
||||||
|
"modeList": [
|
||||||
|
{
|
||||||
|
"value": "chrome",
|
||||||
|
"label": "谷歌风格"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "button",
|
||||||
|
"label": "按钮风格"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"isCache": true
|
||||||
|
},
|
||||||
|
"sider": {
|
||||||
|
"width": 220,
|
||||||
|
"collapsedWidth": 64,
|
||||||
|
"mixWidth": 80,
|
||||||
|
"mixCollapsedWidth": 48,
|
||||||
|
"mixChildMenuWidth": 200
|
||||||
|
},
|
||||||
|
"menu": {
|
||||||
|
"horizontalPosition": "flex-start",
|
||||||
|
"horizontalPositionList": [
|
||||||
|
{
|
||||||
|
"value": "flex-start",
|
||||||
|
"label": "居左"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "center",
|
||||||
|
"label": "居中"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "flex-end",
|
||||||
|
"label": "居右"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"footer": {
|
||||||
|
"fixed": false,
|
||||||
|
"height": 48
|
||||||
|
},
|
||||||
|
"page": {
|
||||||
|
"animate": true,
|
||||||
|
"animateMode": "fade-slide",
|
||||||
|
"animateModeList": [
|
||||||
|
{
|
||||||
|
"value": "fade-slide",
|
||||||
|
"label": "滑动"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "fade",
|
||||||
|
"label": "消退"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "fade-bottom",
|
||||||
|
"label": "底部消退"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "fade-scale",
|
||||||
|
"label": "缩放消退"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "zoom-fade",
|
||||||
|
"label": "渐变"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "zoom-out",
|
||||||
|
"label": "闪现"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +1,6 @@
|
|||||||
import { EnumThemeLayoutMode, EnumThemeTabMode, EnumThemeHorizontalMenuPosition, EnumThemeAnimateMode } from '@/enum';
|
import { EnumThemeLayoutMode, EnumThemeTabMode, EnumThemeHorizontalMenuPosition, EnumThemeAnimateMode } from '@/enum';
|
||||||
import type { ThemeSetting } from '@/interface';
|
import type { ThemeSetting } from '@/interface';
|
||||||
|
import jsonSetting from './theme.json';
|
||||||
|
|
||||||
const themeColorList = [
|
const themeColorList = [
|
||||||
'#1890ff',
|
'#1890ff',
|
||||||
@ -101,4 +102,4 @@ const defaultThemeSetting: ThemeSetting = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const themeSetting = defaultThemeSetting;
|
export const themeSetting = (jsonSetting as ThemeSetting) || defaultThemeSetting;
|
||||||
|
2
src/typings/common/route.d.ts
vendored
2
src/typings/common/route.d.ts
vendored
@ -125,7 +125,7 @@ declare namespace AuthRoute {
|
|||||||
type SingleRouteParentPath = KeyToPath<SingleRouteParentKey>;
|
type SingleRouteParentPath = KeyToPath<SingleRouteParentKey>;
|
||||||
|
|
||||||
/** 路由key转换路由path */
|
/** 路由key转换路由path */
|
||||||
type KeyToPath<Key extends RouteKey> = Key extends `${infer Left}_${infer Right}`
|
type KeyToPath<Key extends string> = Key extends `${infer Left}_${infer Right}`
|
||||||
? KeyToPath<`${Left}/${Right}`>
|
? KeyToPath<`${Left}/${Right}`>
|
||||||
: `/${Key}`;
|
: `/${Key}`;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user