Skip to content

Commit 3add0d6

Browse files
committed
所有 Link 链接 :underline="false" 统一更改为 :underline="never"
所有 Pagination 分页 small 统一更改为 size="small" 所有 Button 按钮 <el-button type="text" /> 更改位 <el-button type="primary" link /> 优化 .my-query-box 样式,新增 .my-search-box 样式
1 parent 50648de commit 3add0d6

File tree

38 files changed

+160
-138
lines changed

38 files changed

+160
-138
lines changed

src/modules/admin/ZhonTai.Admin.Core/HostApp.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,10 @@ private void ConfigureServices(IServiceCollection services, IWebHostEnvironment
421421
options.DefaultChallengeScheme = nameof(ResponseAuthenticationHandler); //401
422422
options.DefaultForbidScheme = nameof(ResponseAuthenticationHandler); //403
423423
})
424+
//.AddCookie(options =>
425+
//{
426+
// options.Cookie.SameSite = SameSiteMode.Lax;
427+
//})
424428
.AddJwtBearer(options =>
425429
{
426430
//ids4
@@ -889,13 +893,15 @@ private void ConfigureMiddleware(WebApplication app, IWebHostEnvironment env, IC
889893
//静态文件
890894
app.UseDefaultFiles();
891895
app.UseStaticFiles();
892-
896+
893897
//路由
894898
app.UseRouting();
895899

896900
//跨域
897901
app.UseCors();
898902

903+
//app.UseCookiePolicy(new CookiePolicyOptions { MinimumSameSitePolicy = SameSiteMode.Lax });
904+
899905
//认证
900906
app.UseAuthentication();
901907

ui/zhontai.ui.admin.vue3/src/api/login/index.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

ui/zhontai.ui.admin.vue3/src/api/menu/index.ts

Lines changed: 0 additions & 30 deletions
This file was deleted.

ui/zhontai.ui.admin.vue3/src/components/my-filter/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
<el-radio label="And">并且</el-radio>
1616
<el-radio label="Or">或者</el-radio>
1717
</el-radio-group>
18-
<el-button type="text" icon="ele-Plus" @click="onAddGroup(data)" class="ml16">分组</el-button>
19-
<el-button type="text" icon="ele-Plus" @click="onAddCondition(data)">条件</el-button>
18+
<el-button type="primary" link icon="ele-Plus" @click="onAddGroup(data)" class="ml16">分组</el-button>
19+
<el-button type="primary" link icon="ele-Plus" @click="onAddCondition(data)">条件</el-button>
2020
<el-button v-if="!data.root" icon="ele-Minus" class="ml8" @click="onDelete(node, data)" />
2121
</div>
2222
</template>

ui/zhontai.ui.admin.vue3/src/components/my-link/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<el-link :class="{ 'my-link--bold': bold }" type="primary" :underline="false" :href="href" v-bind="$attrs" @click.prevent.stop="onToPage()">
2+
<el-link :class="{ 'my-link--bold': bold }" type="primary" underline="never" :href="href" v-bind="$attrs" @click.prevent.stop="onToPage()">
33
<slot> </slot>
44
</el-link>
55
</template>

ui/zhontai.ui.admin.vue3/src/components/my-search/index.vue

Lines changed: 58 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
<template>
22
<div v-if="props.searchItems.length > 0">
33
<el-form ref="formRef" :model="formState" :inline="true" label-width="auto" size="default">
4-
<el-row>
4+
<el-row :gutter="16">
55
<!-- 动态渲染表单项 -->
66
<el-col
77
v-for="(item, index) in searchItems"
88
v-show="index < visibleCount || isExpanded"
99
:key="index"
10-
:xs="24"
11-
:sm="12"
12-
:md="8"
13-
:lg="6"
14-
:xl="4"
15-
class="my-flex"
10+
:xs="col.xs"
11+
:sm="col.sm"
12+
:md="col.md"
13+
:lg="col.lg"
14+
:xl="col.xl"
15+
class="w100"
1616
>
17-
<el-form-item :label="item.label" :prop="item.field" :rules="item.rules" class="my-flex-fill">
17+
<el-form-item :label="item.label" :prop="item.field" :rules="item.rules" class="w100">
1818
<component :is="item.componentName" v-model="formState[item.field]" clearable v-bind="item.attrs" class="w100" />
1919
</el-form-item>
2020
</el-col>
2121

2222
<!-- 操作按钮区域 -->
23-
<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="4" class="my-flex">
24-
<el-form-item label-width="0px" class="my-flex-fill">
25-
<div class="my-flex my-flex-fill">
26-
<el-button v-if="showToggle" type="text" @click="onToggleExpanded">
23+
<el-col :xs="col.xs" :sm="col.sm" :md="col.md" :lg="col.lg" :xl="col.xl">
24+
<el-form-item label-width="0px">
25+
<div class="my-flex">
26+
<el-button v-if="showToggle" type="primary" link @click="onToggleExpanded">
2727
{{ isExpanded ? '收起' : '展开' }}
2828
<SvgIcon :name="isExpanded ? 'ele-ArrowUp' : 'ele-ArrowDown'" />
2929
</el-button>
@@ -38,20 +38,38 @@
3838
</template>
3939

4040
<script setup lang="ts" name="coms/my-search">
41-
import { reactive, ref, computed, watchEffect } from 'vue'
41+
import { reactive, ref, computed, PropType } from 'vue'
4242
import type { FormInstance, FormRules } from 'element-plus'
43-
import { cloneDeep } from 'lodash-es'
43+
import { cloneDeep, isInteger, mergeWith } from 'lodash-es'
4444
4545
interface SearchItem {
46+
label: string
4647
field: string
4748
operator: OperatorEnum
48-
label: string
4949
rules?: FormRules
5050
componentName: string
5151
attrs?: EmptyObjectType
5252
defaultValue?: any
5353
}
5454
55+
type BreakpointKey = 'xs' | 'sm' | 'md' | 'lg' | 'xl'
56+
57+
type ColConfigType = {
58+
[key in BreakpointKey]?: number
59+
}
60+
61+
// 默认的 colConfig
62+
const defaultColConfig = {
63+
xs: 24,
64+
sm: 12,
65+
md: 12,
66+
lg: 8,
67+
xl: 6,
68+
} as ColConfigType
69+
70+
// 默认显示数量
71+
const DEFAULT_VISIBLE_COUNT = 3
72+
5573
// 定义父组件传过来的值
5674
const props = defineProps({
5775
// 查询条件配置项
@@ -74,6 +92,28 @@ const props = defineProps({
7492
type: Boolean,
7593
default: () => true,
7694
},
95+
colConfig: {
96+
type: Object as PropType<ColConfigType>,
97+
validator: (value: ColConfigType) => {
98+
const invalidEntries = Object.entries(value).filter(([k, v]) => {
99+
if (!['xs', 'sm', 'md', 'lg', 'xl'].includes(k)) {
100+
console.warn(`无效的断点配置: ${k}`)
101+
return true
102+
}
103+
if (!isInteger(v)) {
104+
console.warn(`非整数值: ${k}=${v} (类型: ${typeof v})`)
105+
return true
106+
}
107+
if (v < 1 || v > 24) {
108+
console.warn(`超出范围: ${k}=${v} (允许范围: 1-24)`)
109+
return true
110+
}
111+
return false
112+
})
113+
114+
return invalidEntries.length === 0
115+
},
116+
},
77117
})
78118
79119
// 定义子组件向父组件传值/事件
@@ -90,8 +130,9 @@ const formState = reactive<EmptyObjectType>(
90130
}, {})
91131
)
92132
93-
// 默认显示数量
94-
const DEFAULT_VISIBLE_COUNT = 3
133+
const col = computed(() => {
134+
return mergeWith({}, defaultColConfig, props.colConfig)
135+
})
95136
96137
// 处理可见数量配置
97138
const visibleCount = computed(() => {

ui/zhontai.ui.admin.vue3/src/layout/component/main.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<LayoutParentView />
1010
<LayoutFooter v-if="isFooter" />
1111
</el-scrollbar>
12-
<el-backtop :target="setBacktopClass" right="15" />
12+
<el-backtop :target="setBacktopClass" :right="15" />
1313
</el-main>
1414
</template>
1515

ui/zhontai.ui.admin.vue3/src/layout/navBars/topBar/msg.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<template #header="{ titleId, titleClass }">
44
<div class="my-flex my-flex-between mr20">
55
<span :id="titleId" :class="titleClass">{{ $t('站内信') }}</span>
6-
<el-link :underline="false" type="primary" class="f12" @click="onShowMore">查看更多</el-link>
6+
<el-link underline="never" type="primary" class="f12" @click="onShowMore">查看更多</el-link>
77
</div>
88
</template>
99

ui/zhontai.ui.admin.vue3/src/router/backEnd.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,16 +137,6 @@ export async function getBackEndControlRoutes() {
137137
} else {
138138
return []
139139
}
140-
/*
141-
// 模拟 admin 与 test
142-
const stores = useUserInfo(pinia)
143-
const { userInfos } = storeToRefs(stores)
144-
const auth = userInfos.value.roles[0]
145-
// 管理员 admin
146-
if (auth === 'admin') return menuApi.getAdminMenu()
147-
// 其它用户 test
148-
else return menuApi.getTestMenu()
149-
*/
150140
}
151141

152142
/**

ui/zhontai.ui.admin.vue3/src/theme/element.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,3 +375,6 @@
375375
.el-button--default i.fa {
376376
margin-right: 0px;
377377
}
378+
.el-button.is-link:hover {
379+
color: var(--el-color-primary-light-3);
380+
}

0 commit comments

Comments
 (0)