fix: 修复多个UI样式问题和优化代码格式
-调整VXE表格搜索表单和分页样式间距 -优化use-layout-style和use-priority-value代码格式
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -50,3 +50,5 @@ vite.config.ts.*
|
|||||||
*.sw?
|
*.sw?
|
||||||
.history
|
.history
|
||||||
.cursor
|
.cursor
|
||||||
|
.vscode
|
||||||
|
.trae
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
1. 这是一个企业级项目,结构复杂,你需要深度检测代码后才能理解其业务逻辑,不能简单的只根据当前文件的代码来理解。
|
1. 这是一个企业级项目,结构复杂,你需要深度检测代码后才能理解其业务逻辑,不能简单的只根据当前文件的代码来理解。
|
||||||
2. 代码修改完成后,需检查文件内引用是否正确
|
2. 代码修改完成后,必须检查文件内引用是否正确
|
||||||
|
3. 修改后,必须获取项目的诊断信息,了解是否有错误或警告,然后根据诊断信息进行修复。
|
||||||
|
|||||||
@@ -16,16 +16,16 @@
|
|||||||
<link rel="icon" href="/favicon.ico" />
|
<link rel="icon" href="/favicon.ico" />
|
||||||
<script>
|
<script>
|
||||||
// 生产环境下注入百度统计
|
// 生产环境下注入百度统计
|
||||||
if (window._VBEN_ADMIN_PRO_APP_CONF_) {
|
// if (window._VBEN_ADMIN_PRO_APP_CONF_) {
|
||||||
var _hmt = _hmt || [];
|
// var _hmt = _hmt || [];
|
||||||
(function () {
|
// (function () {
|
||||||
var hm = document.createElement('script');
|
// var hm = document.createElement('script');
|
||||||
hm.src =
|
// hm.src =
|
||||||
'https://hm.baidu.com/hm.js?b38e689f40558f20a9a686d7f6f33edf';
|
// 'https://hm.baidu.com/hm.js?b38e689f40558f20a9a686d7f6f33edf';
|
||||||
var s = document.getElementsByTagName('script')[0];
|
// var s = document.getElementsByTagName('script')[0];
|
||||||
s.parentNode.insertBefore(hm, s);
|
// s.parentNode.insertBefore(hm, s);
|
||||||
})();
|
// })();
|
||||||
}
|
// }
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -14,9 +14,7 @@ const { isDark } = usePreferences();
|
|||||||
const { tokens } = useAntdDesignTokens();
|
const { tokens } = useAntdDesignTokens();
|
||||||
|
|
||||||
const tokenTheme = computed(() => {
|
const tokenTheme = computed(() => {
|
||||||
const algorithm = isDark.value
|
const algorithm = isDark.value ? [theme.darkAlgorithm] : [theme.defaultAlgorithm];
|
||||||
? [theme.darkAlgorithm]
|
|
||||||
: [theme.defaultAlgorithm];
|
|
||||||
|
|
||||||
// antd 紧凑模式算法
|
// antd 紧凑模式算法
|
||||||
if (preferences.app.compact) {
|
if (preferences.app.compact) {
|
||||||
|
|||||||
@@ -325,7 +325,8 @@ function onCompleteCheckCreated() {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
:deep(.ant-card-body) {
|
:deep(.ant-card-body) {
|
||||||
padding: 1px !important;
|
padding: 1px !important;
|
||||||
height: calc(100% - 46px); // 减去标签页头部高度
|
height: calc(100% - 41px); // 减去标签页头部高度
|
||||||
|
overflow: hidden;
|
||||||
// background-color: #f1f3f6;
|
// background-color: #f1f3f6;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,14 +36,11 @@ export function useLayoutContentStyle() {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
const debouncedCalcHeight = useDebounceFn(
|
const debouncedCalcHeight = useDebounceFn((_entries: ResizeObserverEntry[]) => {
|
||||||
(_entries: ResizeObserverEntry[]) => {
|
visibleDomRect.value = getElementVisibleRect(contentElement.value);
|
||||||
visibleDomRect.value = getElementVisibleRect(contentElement.value);
|
contentHeight.value = `${visibleDomRect.value.height}px`;
|
||||||
contentHeight.value = `${visibleDomRect.value.height}px`;
|
contentWidth.value = `${visibleDomRect.value.width}px`;
|
||||||
contentWidth.value = `${visibleDomRect.value.width}px`;
|
}, 16);
|
||||||
},
|
|
||||||
16,
|
|
||||||
);
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (contentElement.value && !resizeObserver) {
|
if (contentElement.value && !resizeObserver) {
|
||||||
|
|||||||
@@ -2,10 +2,7 @@ import type { ComputedRef, Ref } from 'vue';
|
|||||||
|
|
||||||
import { computed, getCurrentInstance, unref, useAttrs, useSlots } from 'vue';
|
import { computed, getCurrentInstance, unref, useAttrs, useSlots } from 'vue';
|
||||||
|
|
||||||
import {
|
import { getFirstNonNullOrUndefined, kebabToCamelCase } from '@vben-core/shared/utils';
|
||||||
getFirstNonNullOrUndefined,
|
|
||||||
kebabToCamelCase,
|
|
||||||
} from '@vben-core/shared/utils';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 依次从插槽、attrs、props、state 中获取值
|
* 依次从插槽、attrs、props、state 中获取值
|
||||||
@@ -32,8 +29,7 @@ export function usePriorityValue<
|
|||||||
for (const [key, value] of Object.entries(rawProps)) {
|
for (const [key, value] of Object.entries(rawProps)) {
|
||||||
standardRawProps[kebabToCamelCase(key) as K] = value;
|
standardRawProps[kebabToCamelCase(key) as K] = value;
|
||||||
}
|
}
|
||||||
const propsKey =
|
const propsKey = standardRawProps?.[key] === undefined ? undefined : props[key];
|
||||||
standardRawProps?.[key] === undefined ? undefined : props[key];
|
|
||||||
|
|
||||||
// slot可以关闭
|
// slot可以关闭
|
||||||
return getFirstNonNullOrUndefined(
|
return getFirstNonNullOrUndefined(
|
||||||
@@ -77,11 +73,7 @@ export function useForwardPriorityValues<
|
|||||||
const computedResult: { [K in keyof T]: ComputedRef<T[K]> } = {} as never;
|
const computedResult: { [K in keyof T]: ComputedRef<T[K]> } = {} as never;
|
||||||
|
|
||||||
(Object.keys(props) as (keyof T)[]).forEach((key) => {
|
(Object.keys(props) as (keyof T)[]).forEach((key) => {
|
||||||
computedResult[key] = usePriorityValue(
|
computedResult[key] = usePriorityValue(key as keyof typeof props, props, state);
|
||||||
key as keyof typeof props,
|
|
||||||
props,
|
|
||||||
state,
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return computed(() => {
|
return computed(() => {
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ const options = computed(() => {
|
|||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
background: true,
|
background: true,
|
||||||
pageSizes: [10, 20, 30, 50, 100, 200],
|
pageSizes: [10, 20, 30, 50, 100, 200],
|
||||||
className: 'mt-2 w-full',
|
className: 'mt-1 w-full',
|
||||||
layouts: isMobile.value ? mobileLayouts : layouts,
|
layouts: isMobile.value ? mobileLayouts : layouts,
|
||||||
size: 'mini' as const,
|
size: 'mini' as const,
|
||||||
});
|
});
|
||||||
@@ -362,8 +362,8 @@ onUnmounted(() => {
|
|||||||
v-show="showSearchForm !== false"
|
v-show="showSearchForm !== false"
|
||||||
:class="
|
:class="
|
||||||
cn(
|
cn(
|
||||||
'relative rounded py-3',
|
'relative rounded py-2',
|
||||||
isCompactForm ? (isSeparator ? 'pb-8' : 'pb-4') : isSeparator ? 'pb-4' : 'pb-0',
|
isCompactForm ? (isSeparator ? 'pb-4' : 'pb-2') : isSeparator ? 'pb-2' : 'pb-0',
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
@@ -395,9 +395,10 @@ onUnmounted(() => {
|
|||||||
:style="{
|
:style="{
|
||||||
...(separatorBg ? { backgroundColor: separatorBg } : undefined),
|
...(separatorBg ? { backgroundColor: separatorBg } : undefined),
|
||||||
}"
|
}"
|
||||||
class="bg-background-deep z-100 absolute -left-2 bottom-1 h-2 w-[calc(100%+1rem)] overflow-hidden md:bottom-2 md:h-3"
|
class="bg-background-deep z-100 absolute -left-2 bottom-0 h-1 w-[calc(100%+1rem)] overflow-hidden md:bottom-0 md:h-2"
|
||||||
></div>
|
></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="!showToolbar && formOptions" class="h-2 bg-white"></div>
|
||||||
</template>
|
</template>
|
||||||
<!-- loading -->
|
<!-- loading -->
|
||||||
<template #loading>
|
<template #loading>
|
||||||
|
|||||||
Reference in New Issue
Block a user