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