style: 应用新主题色到全局组件

1. 更新Element UI相关样式文件
2. 更新布局组件样式
3. 更新所有业务页面组件样式
4. 删除废弃的测试页面
5. 优化主题切换相关代码
This commit is contained in:
zlwu committed 2025-07-05 13:53:25 +08:00
1 parent 963e2f80d4
commit 46d21d3e55
33 files changed
+246 -342

No files matched your search

+30
View File
@@ -520,6 +520,36 @@
box-shadow: none !important;
}
}
// 图标样式修复
.el-icon {
display: inline-flex !important;
justify-content: center !important;
align-items: center !important;
height: 1em !important;
width: 1em !important;
vertical-align: middle !important;
svg {
height: 1em !important;
width: 1em !important;
fill: currentColor !important;
}
}
// 按钮中的图标
.el-icon {
margin-right: 4px !important;
vertical-align: middle !important;
&:last-child {
margin-right: 0 !important;
}
}
&.is-circle .el-icon {
margin-right: 0 !important;
}
}
// 按钮组样式
+22
View File
@@ -152,6 +152,11 @@
word-break: break-word;
}
.el-form .el-form-item__label {
color: #333333;
font-weight: 400 !important;
}
// Element Plus 主色调自定义配置
:root {
// --el-color-primary: #203daf;
@@ -178,6 +183,8 @@
// --el-menu-active-color: #203daf;
--el-menu-bg-color: #ffffff;
--el-menu-hover-bg-color: #f5f5f5;
--el-menu-active-color: rgb(var(--art-primary));
--el-menu-item-height: 50px;
}
// 深色模式下的菜单文本颜色
@@ -186,3 +193,18 @@ html.dark {
--el-menu-hover-text-color: #000000;
// --el-menu-active-color: #203daf;
}
/* 收缩菜单样式 */
body {
.el-menu--popup {
.el-sub-menu.is-active {
> .el-sub-menu__title {
&:hover {
color: rgb(var(--art-primary)) !important;
background-color: rgb(var(--art-primary), 0.1) !important;
}
}
}
}
}
+3
View File
@@ -282,3 +282,6 @@ h6 {
.top-right-btn {
margin-left: auto;
}
+14 -14
View File
@@ -1,6 +1,6 @@
<template>
<el-drawer v-model="showSettings" :with-header="false" direction="rtl" size="300px" close-on-click-modal>
<h3 class="drawer-title">主题风格设置</h3>
<!-- <h3 class="drawer-title">主题风格设置</h3>
<div class="setting-drawer-block-checbox">
<div class="setting-drawer-block-checbox-item" @click="handleTheme(SideThemeEnum.DARK)">
@@ -27,30 +27,30 @@
</i>
</div>
</div>
</div>
<div class="drawer-item">
</div> -->
<!-- <div class="drawer-item">
<span>主题颜色</span>
<span class="comp-style">
<el-color-picker v-model="theme" :predefine="predefineColors" @change="themeChange" />
</span>
</div>
<div class="drawer-item">
</div> -->
<!-- <div class="drawer-item">
<span>深色模式</span>
<span class="comp-style">
<el-switch v-model="isDark" class="drawer-switch" @change="toggleDark" />
</span>
</div>
</div> -->
<el-divider />
<h3 class="drawer-title">系统布局配置</h3>
<div class="drawer-item">
<!-- <div class="drawer-item">
<span>开启 TopNav</span>
<span class="comp-style">
<el-switch v-model="settingsStore.topNav" class="drawer-switch" @change="topNavChange" />
</span>
</div>
</div> -->
<div class="drawer-item">
<span>开启 Tags-Views</span>
@@ -66,26 +66,26 @@
</span>
</div>
<div class="drawer-item">
<!-- <div class="drawer-item">
<span>固定 Header</span>
<span class="comp-style">
<el-switch v-model="settingsStore.fixedHeader" class="drawer-switch" />
</span>
</div>
</div> -->
<div class="drawer-item">
<!-- <div class="drawer-item">
<span>显示 Logo</span>
<span class="comp-style">
<el-switch v-model="settingsStore.sidebarLogo" class="drawer-switch" />
</span>
</div>
</div> -->
<div class="drawer-item">
<!-- <div class="drawer-item">
<span>动态标题</span>
<span class="comp-style">
<el-switch v-model="settingsStore.dynamicTitle" class="drawer-switch" @change="dynamicTitleChange" />
</span>
</div>
</div> -->
<el-divider />
@@ -99,3 +99,50 @@ const hasTitle = (title: string | undefined): string => {
return title;
};
</script>
<style lang="scss" scoped>
.el-menu-item.is-active {
color: rgb(var(--art-primary)) !important;
background-color: rgb(var(--art-primary), 0.1) !important;
}
.el-menu-item.is-opened {
color: rgb(var(--art-primary)) !important;
background-color: rgb(var(--art-primary), 0.1) !important;
}
.el-menu-item.is-opened.is-active {
.el-sub-menu__title.el-tooltip__trigger.el-tooltip__trigger {
color: rgb(var(--art-primary)) !important;
background-color: rgb(var(--art-primary), 0.1) !important;
}
}
.el-menu-item:hover {
color: rgb(var(--art-primary)) !important;
background-color: rgb(var(--art-primary), 0.1) !important;
}
/* 收缩状态下的二级菜单hover样式 */
.el-menu--popup {
.el-sub-menu.is-active {
> .el-sub-menu__title {
&:hover {
color: rgb(var(--art-primary)) !important;
background-color: rgb(var(--art-primary), 0.1) !important;
}
}
}
}
.el-sub-menu__title:hover {
color: rgb(var(--art-primary)) !important;
background-color: rgb(var(--art-primary), 0.1) !important;
}
.el-sub-menu {
.el-sub-menu__title {
color: rgb(var(--art-primary)) !important;
background-color: rgb(var(--art-primary), 0.1) !important;
}
}
</style>
+13 -12
View File
@@ -72,8 +72,8 @@ const isActive = (r: RouteLocationNormalized): boolean => {
const activeStyle = (tag: RouteLocationNormalized) => {
if (!isActive(tag)) return {};
return {
'background-color': 'var(--tags-view-active-bg)',
'border-color': 'var(--tags-view-active-border-color)'
'background-color': 'var(--tags-view-active-bg)'
// 'border-color': 'var(--tags-view-active-border-color)'
};
};
const isAffix = (tag: RouteLocationNormalized) => {
@@ -245,7 +245,7 @@ onMounted(() => {
background: var(--art-bg-color);
// border-bottom: 1px solid var(--art-border-color);
padding: var(--space-sm) var(--space-lg);
// box-shadow: var(--art-box-shadow-xs);
box-shadow: var(--art-box-shadow-xs);
.tags-view-wrapper {
.tags-view-item {
@@ -276,7 +276,7 @@ onMounted(() => {
color: rgb(var(--art-primary));
background: rgba(var(--art-primary), 0.06);
border-color: rgba(var(--art-primary), 0.2);
transform: translateY(-1px);
// transform: translateY(-1px);
box-shadow: 0 2px 8px rgba(var(--art-primary), 0.15);
}
@@ -289,9 +289,10 @@ onMounted(() => {
}
&.active {
background: linear-gradient(135deg, rgb(var(--art-primary)) 0%, rgba(var(--art-primary), 0.9) 100%);
// background: linear-gradient(135deg, rgb(var(--art-primary)) 0%, rgba(var(--art-primary), 0.9) 100%);
background: rgba(var(--art-primary), 1);
color: #ffffff;
border-color: rgb(var(--art-primary));
// border-color: rgb(var(--art-primary));
box-shadow: 0 2px 8px rgba(var(--art-primary), 0.3);
font-weight: 500;
@@ -308,7 +309,7 @@ onMounted(() => {
}
&:hover {
transform: translateY(-1px);
// transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(var(--art-primary), 0.4);
}
}
@@ -344,7 +345,7 @@ onMounted(() => {
font-weight: 400;
color: var(--art-text-gray-700);
box-shadow: var(--art-box-shadow);
border: 1px solid var(--art-border-color);
// border: 1px solid var(--art-border-color);
min-width: 120px;
li {
@@ -379,24 +380,24 @@ html.dark {
.tags-view-item {
background: var(--art-gray-200);
color: var(--art-text-gray-600);
border-color: var(--art-border-color);
// border-color: var(--art-border-color);
&:hover {
background: rgba(var(--art-primary), 0.1);
border-color: rgba(var(--art-primary), 0.3);
// border-color: rgba(var(--art-primary), 0.3);
}
&.active {
background: linear-gradient(135deg, rgb(var(--art-primary)) 0%, rgba(var(--art-primary), 0.9) 100%);
color: #ffffff;
border-color: rgb(var(--art-primary));
// border-color: rgb(var(--art-primary));
}
}
}
.contextmenu {
background: var(--art-gray-200);
border-color: var(--art-border-color);
// border-color: var(--art-border-color);
color: var(--art-text-gray-600);
li:hover {
+39
View File
@@ -198,3 +198,42 @@ style.textContent = `
document.head.appendChild(style);
app.mount('#app');
// 确保图标样式在最后加载
const iconStyle = document.createElement('style');
iconStyle.textContent = `
/* 全局图标样式修复 */
.el-icon {
display: inline-flex !important;
justify-content: center !important;
align-items: center !important;
height: 1em !important;
width: 1em !important;
vertical-align: middle !important;
line-height: 1 !important;
}
.el-icon svg {
height: 1em !important;
width: 1em !important;
fill: currentColor !important;
}
/* 按钮中的图标 */
.el-button .el-icon {
margin-right: 4px !important;
vertical-align: middle !important;
}
.el-button.is-circle .el-icon {
margin-right: 0 !important;
}
/* 菜单中的图标 */
.el-menu .el-icon,
.el-sub-menu .el-icon,
.el-menu-item .el-icon {
margin-right: 8px !important;
}
`;
document.head.appendChild(iconStyle);
+1 -1
View File
@@ -47,7 +47,7 @@
>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['hq:hallReservation:export']">导出</el-button>
<el-button icon="Download" @click="handleExport" v-hasPermi="['hq:hallReservation:export']">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
+3 -5
View File
@@ -28,15 +28,13 @@
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['hq:hallInfo:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['hq:hallInfo:edit']">修改</el-button>
<el-button icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['hq:hallInfo:edit']">修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['hq:hallInfo:remove']"
>删除</el-button
>
<el-button icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['hq:hallInfo:remove']">删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['hq:hallInfo:export']">导出</el-button>
<el-button icon="Download" @click="handleExport" v-hasPermi="['hq:hallInfo:export']">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
+3 -3
View File
@@ -37,17 +37,17 @@
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['hq:hallReservation:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['hq:hallReservation:edit']"
<el-button icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['hq:hallReservation:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['hq:hallReservation:remove']"
<el-button icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['hq:hallReservation:remove']"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['hq:hallReservation:export']">导出</el-button>
<el-button icon="Download" @click="handleExport" v-hasPermi="['hq:hallReservation:export']">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
+9 -2
View File
@@ -177,7 +177,7 @@
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="分类颜色" prop="colorCode">
<el-color-picker v-model="form.colorCode" :predefine="predefineColors" style="width: 100%" />
<el-color-picker v-model="form.colorCode" :predefine="predefineColors" :clearable="false" style="width: 100%" />
</el-form-item>
</el-col>
<el-col :span="12">
@@ -766,6 +766,7 @@ onMounted(() => {
.el-color-picker__color {
background-color: transparent;
border: 0px !important;
display: none !important;
&.is-alpha {
background-image: none;
@@ -796,8 +797,14 @@ onMounted(() => {
border: 1px solid #e4e7ed;
}
}
:deep(.el-color-picker__empty, .el-color-picker__color) {
display: none !important;
}
:deep(.el-color-picker__trigger, .el-color-picker__color) {
border: 0px !important;
}
:deep(.el-color-picker__color) {
border: 0px !important;
}
</style>
+6 -5
View File
@@ -200,17 +200,15 @@
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['pm:repairOrder:add']">新增报修</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['pm:repairOrder:edit']"
>修改</el-button
>
<el-button icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['pm:repairOrder:edit']">修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['pm:repairOrder:remove']"
<el-button icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['pm:repairOrder:remove']"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['pm:repairOrder:export']">导出</el-button>
<el-button icon="Download" @click="handleExport" v-hasPermi="['pm:repairOrder:export']">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@@ -3340,4 +3338,7 @@ onMounted(() => {
}
}
}
:deep(.el-icon) {
display: flex !important;
}
</style>
+3 -3
View File
@@ -42,17 +42,17 @@
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['hq:satCategory:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['hq:satCategory:edit']"
<el-button icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['hq:satCategory:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['hq:satCategory:remove']"
<el-button icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['hq:satCategory:remove']"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['hq:satCategory:export']">导出</el-button>
<el-button icon="Download" @click="handleExport" v-hasPermi="['hq:satCategory:export']">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
+3 -3
View File
@@ -34,15 +34,15 @@
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['hq:satDetail:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['hq:satDetail:edit']">修改</el-button>
<el-button icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['hq:satDetail:edit']">修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['hq:satDetail:remove']"
<el-button icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['hq:satDetail:remove']"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['hq:satDetail:export']">导出</el-button>
<el-button icon="Download" @click="handleExport" v-hasPermi="['hq:satDetail:export']">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
+3 -5
View File
@@ -39,15 +39,13 @@
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['hq:satOption:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['hq:satOption:edit']">修改</el-button>
<el-button icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['hq:satOption:edit']">修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['hq:satOption:remove']"
>删除</el-button
>
<el-button icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['hq:satOption:remove']">删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['hq:satOption:export']">导出</el-button>
<el-button icon="Download" @click="handleExport" v-hasPermi="['hq:satOption:export']">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
+3 -3
View File
@@ -51,17 +51,17 @@
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['hq:satQuestion:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['hq:satQuestion:edit']"
<el-button icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['hq:satQuestion:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['hq:satQuestion:remove']"
<el-button icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['hq:satQuestion:remove']"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['hq:satQuestion:export']">导出</el-button>
<el-button icon="Download" @click="handleExport" v-hasPermi="['hq:satQuestion:export']">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
+3 -3
View File
@@ -63,15 +63,15 @@
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['hq:venue:add']">新增场地</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['hq:venue:edit']">修改</el-button>
<el-button icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['hq:venue:edit']">修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['hq:venue:remove']"
<el-button icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['hq:venue:remove']"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['hq:venue:export']">导出</el-button>
<el-button icon="Download" @click="handleExport" v-hasPermi="['hq:venue:export']">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
+3 -3
View File
@@ -92,17 +92,17 @@
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['hq:reservation:add']">新增预约</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['hq:reservation:edit']"
<el-button icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['hq:reservation:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['hq:reservation:remove']"
<el-button icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['hq:reservation:remove']"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['hq:reservation:export']">导出</el-button>
<el-button icon="Download" @click="handleExport" v-hasPermi="['hq:reservation:export']">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
+2 -4
View File
@@ -47,12 +47,10 @@
<el-button v-hasPermi="['monitor:logininfor:remove']" type="danger" plain icon="Delete" @click="handleClean">清空</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['monitor:logininfor:unlock']" type="primary" plain icon="Unlock" :disabled="single" @click="handleUnlock">
解锁
</el-button>
<el-button v-hasPermi="['monitor:logininfor:unlock']" icon="Unlock" :disabled="single" @click="handleUnlock"> 解锁 </el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['monitor:logininfor:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button>
<el-button v-hasPermi="['monitor:logininfor:export']" icon="Download" @click="handleExport">导出</el-button>
</el-col>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
+1 -1
View File
@@ -55,7 +55,7 @@
<el-button v-hasPermi="['monitor:operlog:remove']" type="danger" plain icon="WarnTriangleFilled" @click="handleClean">清空</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['monitor:operlog:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button>
<el-button v-hasPermi="['monitor:operlog:export']" icon="Download" @click="handleExport">导出</el-button>
</el-col>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
+3 -3
View File
@@ -29,17 +29,17 @@
<el-button v-hasPermi="['system:client:add']" type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:client:edit']" type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()">
<el-button v-hasPermi="['system:client:edit']" icon="Edit" :disabled="single" @click="handleUpdate()">
修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:client:remove']" type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()">
<el-button v-hasPermi="['system:client:remove']" icon="Delete" :disabled="multiple" @click="handleDelete()">
删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:client:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button>
<el-button v-hasPermi="['system:client:export']" icon="Download" @click="handleExport">导出</el-button>
</el-col>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
+4 -4
View File
@@ -41,20 +41,20 @@
<el-button v-hasPermi="['system:config:add']" type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:config:edit']" type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()">
<el-button v-hasPermi="['system:config:edit']" icon="Edit" :disabled="single" @click="handleUpdate()">
修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:config:remove']" type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()">
<el-button v-hasPermi="['system:config:remove']" icon="Delete" :disabled="multiple" @click="handleDelete()">
删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:config:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button>
<el-button v-hasPermi="['system:config:export']" icon="Download" @click="handleExport">导出</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:config:remove']" type="danger" plain icon="Refresh" @click="handleRefreshCache">刷新缓存</el-button>
<el-button v-hasPermi="['system:config:remove']" icon="Refresh" @click="handleRefreshCache">刷新缓存</el-button>
</el-col>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
+1 -1
View File
@@ -31,7 +31,7 @@
<el-button v-hasPermi="['system:dept:add']" type="primary" plain icon="Plus" @click="handleAdd()">新增 </el-button>
</el-col>
<el-col :span="1.5">
<el-button type="info" plain icon="Sort" @click="handleToggleExpandAll">展开/折叠</el-button>
<el-button icon="Sort" @click="handleToggleExpandAll">展开/折叠</el-button>
</el-col>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
+4 -4
View File
@@ -36,18 +36,18 @@
<el-button v-hasPermi="['system:dict:add']" type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:dict:edit']" type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()">修改</el-button>
<el-button v-hasPermi="['system:dict:edit']" icon="Edit" :disabled="single" @click="handleUpdate()">修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:dict:remove']" type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()">
<el-button v-hasPermi="['system:dict:remove']" icon="Delete" :disabled="multiple" @click="handleDelete()">
删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:dict:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button>
<el-button v-hasPermi="['system:dict:export']" icon="Download" @click="handleExport">导出</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:dict:remove']" type="danger" plain icon="Refresh" @click="handleRefreshCache">刷新缓存</el-button>
<el-button v-hasPermi="['system:dict:remove']" icon="Refresh" @click="handleRefreshCache">刷新缓存</el-button>
</el-col>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
+2 -2
View File
@@ -28,10 +28,10 @@
<el-button v-hasPermi="['system:menu:add']" type="primary" plain icon="Plus" @click="handleAdd()">新增 </el-button>
</el-col>
<el-col :span="1.5">
<el-button type="info" plain icon="Sort" @click="handleToggleExpandAll">展开/折叠</el-button>
<el-button icon="Sort" @click="handleToggleExpandAll">展开/折叠</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" @click="handleCascadeDelete" :loading="deleteLoading">级联删除</el-button>
<el-button icon="Delete" @click="handleCascadeDelete" :loading="deleteLoading">级联删除</el-button>
</el-col>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
+2 -2
View File
@@ -31,12 +31,12 @@
<el-button v-hasPermi="['system:notice:add']" type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:notice:edit']" type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()"
<el-button v-hasPermi="['system:notice:edit']" icon="Edit" :disabled="single" @click="handleUpdate()"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:notice:remove']" type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()">
<el-button v-hasPermi="['system:notice:remove']" icon="Delete" :disabled="multiple" @click="handleDelete()">
删除
</el-button>
</el-col>
+3 -9
View File
@@ -46,21 +46,15 @@
<el-button v-hasPermi="['system:oss:upload']" type="primary" plain icon="Upload" @click="handleImage">上传图片</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:oss:remove']" type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()">
删除
</el-button>
<el-button v-hasPermi="['system:oss:remove']" icon="Delete" :disabled="multiple" @click="handleDelete()"> 删除 </el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['system:oss:edit']"
:type="previewListResource ? 'danger' : 'warning'"
plain
@click="handlePreviewListResource(!previewListResource)"
<el-button v-hasPermi="['system:oss:edit']" @click="handlePreviewListResource(!previewListResource)"
>预览开关 : {{ previewListResource ? '禁用' : '启用' }}</el-button
>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:ossConfig:list']" type="info" plain icon="Operation" @click="handleOssConfig">配置管理</el-button>
<el-button v-hasPermi="['system:ossConfig:list']" icon="Operation" @click="handleOssConfig">配置管理</el-button>
</el-col>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
+3 -3
View File
@@ -69,17 +69,17 @@
<el-button v-hasPermi="['system:post:add']" type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:post:edit']" type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()"
<el-button v-hasPermi="['system:post:edit']" icon="Edit" :disabled="single" @click="handleUpdate()"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:post:remove']" type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()">
<el-button v-hasPermi="['system:post:remove']" icon="Delete" :disabled="multiple" @click="handleDelete()">
删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:post:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button>
<el-button v-hasPermi="['system:post:export']" icon="Download" @click="handleExport">导出</el-button>
</el-col>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
+3 -3
View File
@@ -43,13 +43,13 @@
<el-button v-hasPermi="['system:role:add']" type="primary" plain icon="Plus" @click="handleAdd()">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:role:edit']" type="success" plain :disabled="single" icon="Edit" @click="handleUpdate()">修改</el-button>
<el-button v-hasPermi="['system:role:edit']" :disabled="single" icon="Edit" @click="handleUpdate()">修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:role:delete']" type="danger" plain :disabled="ids.length === 0" @click="handleDelete()">删除</el-button>
<el-button v-hasPermi="['system:role:delete']" :disabled="ids.length === 0" @click="handleDelete()">删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:role:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button>
<el-button v-hasPermi="['system:role:export']" icon="Download" @click="handleExport">导出</el-button>
</el-col>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
+4 -8
View File
@@ -32,20 +32,16 @@
<el-button v-hasPermi="['system:tenant:add']" type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:tenant:edit']" type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()"
>修改</el-button
>
<el-button v-hasPermi="['system:tenant:edit']" icon="Edit" :disabled="single" @click="handleUpdate()">修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:tenant:remove']" type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()">
删除
</el-button>
<el-button v-hasPermi="['system:tenant:remove']" icon="Delete" :disabled="multiple" @click="handleDelete()"> 删除 </el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:tenant:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button>
<el-button v-hasPermi="['system:tenant:export']" icon="Download" @click="handleExport">导出</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-if="userId === 1" type="success" plain icon="Refresh" @click="handleSyncTenantDict">同步租户字典</el-button>
<el-button v-if="userId === 1" icon="Refresh" @click="handleSyncTenantDict">同步租户字典</el-button>
</el-col>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
+3 -3
View File
@@ -23,17 +23,17 @@
<el-button v-hasPermi="['system:tenantPackage:add']" type="primary" plain icon="Plus" @click="handleAdd"> 新增 </el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:tenantPackage:edit']" type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()">
<el-button v-hasPermi="['system:tenantPackage:edit']" icon="Edit" :disabled="single" @click="handleUpdate()">
修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:tenantPackage:remove']" type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()">
<el-button v-hasPermi="['system:tenantPackage:remove']" icon="Delete" :disabled="multiple" @click="handleDelete()">
删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:tenantPackage:export']" type="warning" plain icon="Download" @click="handleExport">导出 </el-button>
<el-button v-hasPermi="['system:tenantPackage:export']" icon="Download" @click="handleExport">导出 </el-button>
</el-col>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
+3 -7
View File
@@ -66,18 +66,14 @@
<el-button v-has-permi="['system:user:add']" type="primary" plain icon="Plus" @click="handleAdd()">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-has-permi="['system:user:edit']" type="success" plain :disabled="single" icon="Edit" @click="handleUpdate()">
修改
</el-button>
<el-button v-has-permi="['system:user:edit']" :disabled="single" icon="Edit" @click="handleUpdate()"> 修改 </el-button>
</el-col>
<el-col :span="1.5">
<el-button v-has-permi="['system:user:remove']" type="danger" plain :disabled="multiple" icon="Delete" @click="handleDelete()">
删除
</el-button>
<el-button v-has-permi="['system:user:remove']" :disabled="multiple" icon="Delete" @click="handleDelete()"> 删除 </el-button>
</el-col>
<el-col :span="1.5">
<el-dropdown class="mt-[1px]">
<el-button plain type="info">
<el-button>
更多
<el-icon class="el-icon--right"><arrow-down /></el-icon
></el-button>
-226
View File
@@ -1,226 +0,0 @@
<template>
<div class="p-2">
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
<el-form-item label="学生姓名" prop="stuName">
<el-input v-model="queryParams.stuName" placeholder="请输入学生姓名" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="学生工号" prop="stuNo">
<el-input v-model="queryParams.stuNo" placeholder="请输入学生工号" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</transition>
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['test:stuMsg:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['test:stuMsg:edit']">修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['test:stuMsg:remove']">删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['test:stuMsg:export']">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" border :data="stuMsgList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键" align="center" prop="id" v-if="true" />
<el-table-column label="学生姓名" align="center" prop="stuName" />
<el-table-column label="学生工号" align="center" prop="stuNo" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-tooltip content="修改" placement="top">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['test:stuMsg:edit']"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['test:stuMsg:remove']"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 添加或修改学生信息对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="stuMsgFormRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="学生姓名" prop="stuName">
<el-input v-model="form.stuName" placeholder="请输入学生姓名" />
</el-form-item>
<el-form-item label="学生工号" prop="stuNo">
<el-input v-model="form.stuNo" placeholder="请输入学生工号" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="StuMsg" lang="ts">
import { listStuMsg, getStuMsg, delStuMsg, addStuMsg, updateStuMsg } from '@/api/test/stuMsg';
import { StuMsgVO, StuMsgQuery, StuMsgForm } from '@/api/test/stuMsg/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const stuMsgList = ref<StuMsgVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const queryFormRef = ref<ElFormInstance>();
const stuMsgFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
const initFormData: StuMsgForm = {
id: undefined,
stuName: undefined,
stuNo: undefined,
}
const data = reactive<PageData<StuMsgForm, StuMsgQuery>>({
form: {...initFormData},
queryParams: {
pageNum: 1,
pageSize: 10,
stuName: undefined,
stuNo: undefined,
params: {
}
},
rules: {
id: [
{ required: true, message: "主键不能为空", trigger: "blur" }
],
stuName: [
{ required: true, message: "学生姓名不能为空", trigger: "blur" }
],
stuNo: [
{ required: true, message: "学生工号不能为空", trigger: "blur" }
],
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询学生信息列表 */
const getList = async () => {
loading.value = true;
const res = await listStuMsg(queryParams.value);
stuMsgList.value = res.rows;
total.value = res.total;
loading.value = false;
}
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
}
/** 表单重置 */
const reset = () => {
form.value = {...initFormData};
stuMsgFormRef.value?.resetFields();
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
}
/** 多选框选中数据 */
const handleSelectionChange = (selection: StuMsgVO[]) => {
ids.value = selection.map(item => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = "添加学生信息";
}
/** 修改按钮操作 */
const handleUpdate = async (row?: StuMsgVO) => {
reset();
const _id = row?.id || ids.value[0]
const res = await getStuMsg(_id);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = "修改学生信息";
}
/** 提交按钮 */
const submitForm = () => {
stuMsgFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.id) {
await updateStuMsg(form.value).finally(() => buttonLoading.value = false);
} else {
await addStuMsg(form.value).finally(() => buttonLoading.value = false);
}
proxy?.$modal.msgSuccess("操作成功");
dialog.visible = false;
await getList();
}
});
}
/** 删除按钮操作 */
const handleDelete = async (row?: StuMsgVO) => {
const _ids = row?.id || ids.value;
await proxy?.$modal.confirm('是否确认删除学生信息编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
await delStuMsg(_ids);
proxy?.$modal.msgSuccess("删除成功");
await getList();
}
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download('test/stuMsg/export', {
...queryParams.value
}, `stuMsg_${new Date().getTime()}.xlsx`)
}
onMounted(() => {
getList();
});
</script>