From e4de5d5d2cbe1099663ac32af6e765347f4caf4b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=BF=9E=E5=AE=9D=E5=B1=B1?= <1253070437@qq.com>
Date: Tue, 23 Dec 2025 21:53:32 +0800
Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91=E4=BC=98?=
=?UTF-8?q?=E5=8C=96=E5=89=8D=E7=AB=AF=E6=89=93=E5=8C=85=E3=80=81=E8=A1=A8?=
=?UTF-8?q?=E6=A0=BC=E7=BB=84=E4=BB=B6=E3=80=81=E6=8C=89=E9=9C=80=E5=BC=95?=
=?UTF-8?q?=E5=85=A5=E3=80=81=E6=A8=A1=E5=9D=97=E9=80=89=E4=B8=AD=E9=97=AE?=
=?UTF-8?q?=E9=A2=98=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
snowy-admin-web/package.json | 1 -
.../src/components/Table/index.vue | 18 +++-
snowy-admin-web/src/main.js | 2 -
.../src/views/auth/login/callback.vue | 22 ++---
.../src/views/auth/login/emailLoginForm.vue | 6 +-
.../src/views/auth/login/login.vue | 32 ++++---
.../src/views/auth/login/otpLoginForm.vue | 11 +--
.../src/views/auth/login/threeLogin.vue | 8 +-
.../src/views/auth/login/threeLoginForApp.vue | 10 +--
snowy-admin-web/src/views/auth/login/util.js | 42 +++++-----
snowy-admin-web/src/views/auth/sso/index.vue | 84 ++++++++++---------
snowy-admin-web/vite.config.mjs | 23 +++--
.../src/main/resources/frontend/Api.js.btl | 26 +++---
.../src/main/resources/frontend/index.vue.btl | 4 +-
14 files changed, 159 insertions(+), 130 deletions(-)
diff --git a/snowy-admin-web/package.json b/snowy-admin-web/package.json
index 33284090..9e641067 100644
--- a/snowy-admin-web/package.json
+++ b/snowy-admin-web/package.json
@@ -51,7 +51,6 @@
"sm-crypto": "0.3.13",
"snowflake-id": "1.1.0",
"sortablejs": "1.15.3",
- "tinymce": "7.3.0",
"vue": "3.5.13",
"vue-cropper": "1.1.4",
"vue-i18n": "10.0.0",
diff --git a/snowy-admin-web/src/components/Table/index.vue b/snowy-admin-web/src/components/Table/index.vue
index 19b0aa40..31a3fd08 100644
--- a/snowy-admin-web/src/components/Table/index.vue
+++ b/snowy-admin-web/src/components/Table/index.vue
@@ -93,6 +93,7 @@
v-bind="{ ...renderTableProps }"
:loading="data.localLoading"
@change="loadData"
+ @resizeColumn="handleResize"
@expand="
(expanded, record) => {
emit('onExpand', expanded, record)
@@ -102,6 +103,10 @@
(record, index) => (data.localSettings.rowClassNameSwitch ? ((index + 1) % 2 == 0 ? 'odd' : '') : null)
"
>
+
+
+ {{ title }}
+
Object.keys(slots).filter((key) => key !== 'headerCell'))
// 是否存在 operator 插槽内容(过滤掉空白、注释、空 Fragment)
const hasOperatorContent = computed(() => {
@@ -237,6 +243,7 @@
const data = reactive({
needTotalList: [],
localDataSource: [],
+ localColumns: null,
localPagination: Object.assign({}, props.pagination),
isFullscreen: false,
customSize: props.compSize,
@@ -312,6 +319,7 @@
...col,
checked: col.checked === undefined ? true : col.checked
}))
+ data.localColumns = data.columnsSetting.filter((value) => value.checked === undefined || value.checked)
},
{ deep: true, immediate: true }
)
@@ -453,6 +461,14 @@
data.localColumns = v.filter((value) => value.checked === undefined || value.checked)
getTableProps() // 调用getTableProps以确保表格重新渲染
}
+ // 列拖拽
+ const handleResize = (width, column) => {
+ column.width = width
+ // 强制更新列数组引用,触发表格重渲染
+ if (data.localColumns) {
+ data.localColumns = [...data.localColumns]
+ }
+ }
const init = () => {
const { current } = route.params
const localPageNum = (current && parseInt(current)) || props.pageNum
diff --git a/snowy-admin-web/src/main.js b/snowy-admin-web/src/main.js
index c134789e..142bb067 100644
--- a/snowy-admin-web/src/main.js
+++ b/snowy-admin-web/src/main.js
@@ -1,5 +1,4 @@
import { createApp } from 'vue'
-import Antd from 'ant-design-vue'
import { createPinia } from 'pinia'
import './style/index.less'
@@ -11,7 +10,6 @@ import './tailwind.css'
const app = createApp(App)
app.use(createPinia())
-app.use(Antd)
app.use(i18n)
app.use(snowy)
app.use(router)
diff --git a/snowy-admin-web/src/views/auth/login/callback.vue b/snowy-admin-web/src/views/auth/login/callback.vue
index 60d83aad..b26dea2e 100644
--- a/snowy-admin-web/src/views/auth/login/callback.vue
+++ b/snowy-admin-web/src/views/auth/login/callback.vue
@@ -21,7 +21,7 @@
@@ -297,8 +309,8 @@
loading.value = false
if (captchaOpen.value === 'true') {
loginCaptcha()
- }}
- )
+ }
+ })
}
const configLang = (key) => {
config.value.lang = key
diff --git a/snowy-admin-web/src/views/auth/login/otpLoginForm.vue b/snowy-admin-web/src/views/auth/login/otpLoginForm.vue
index a8207d5f..702a4dcc 100644
--- a/snowy-admin-web/src/views/auth/login/otpLoginForm.vue
+++ b/snowy-admin-web/src/views/auth/login/otpLoginForm.vue
@@ -17,11 +17,7 @@
-
+
@@ -43,7 +39,7 @@
diff --git a/snowy-admin-web/src/views/auth/login/util.js b/snowy-admin-web/src/views/auth/login/util.js
index 937d4f1a..302eebc0 100644
--- a/snowy-admin-web/src/views/auth/login/util.js
+++ b/snowy-admin-web/src/views/auth/login/util.js
@@ -6,6 +6,7 @@ import { message } from 'ant-design-vue'
import routerUtil from '@/utils/routerUtil'
import { useMenuStore } from '@/store/menu'
import { useUserStore } from '@/store/user'
+import { globalStore } from '@/store'
export const afterLogin = async (loginToken) => {
const route = router.currentRoute.value
@@ -21,6 +22,7 @@ export const afterLogin = async (loginToken) => {
// 重置系统默认应用
tool.data.set('SNOWY_MENU_MODULE_ID', menu[0].id)
+ globalStore().setModule(menu[0].id)
if (tool.data.get('LAST_VIEWS_PATH')) {
// 如果有缓存,将其登录跳转到最后访问的路由
@@ -47,38 +49,40 @@ export const afterLogin = async (loginToken) => {
})
// 此处判断是否存在跳转页面,如存在则跳转,否则走原来逻辑
- if(route.query.redirect_uri) {
+ if (route.query.redirect_uri) {
// 跳转到回调页
message.success('登录成功,即将跳转...')
setTimeout(function () {
- window.location.href = route.query.redirect_uri;
- }, 500);
- } else if(route.query.redirect) {
+ window.location.href = route.query.redirect_uri
+ }, 500)
+ } else if (route.query.redirect) {
// 跳转到回调页
message.success('登录成功,即将跳转...')
setTimeout(function () {
- window.location.href = route.query.redirect;
- }, 500);
- } else if(route.query.back) {
+ window.location.href = route.query.redirect
+ }, 500)
+ } else if (route.query.back) {
// 跳转到回调页
message.success('登录成功,即将跳转...')
setTimeout(function () {
- window.location.href = route.query.back;
- }, 500);
+ window.location.href = route.query.back
+ }, 500)
} else {
message.success('登录成功,即将跳转...')
setTimeout(function () {
// 跳转到首页
- router.replace({
- path: indexMenu
- }).then(() => {
- // 判断用户密码是否过期
- userCenterApi.userCenterIsUserPasswordExpired().then((expired) => {
- if (expired) {
- message.warning('当前登录密码已过期,请及时更改!')
- }
+ router
+ .replace({
+ path: indexMenu
})
- })
- }, 500);
+ .then(() => {
+ // 判断用户密码是否过期
+ userCenterApi.userCenterIsUserPasswordExpired().then((expired) => {
+ if (expired) {
+ message.warning('当前登录密码已过期,请及时更改!')
+ }
+ })
+ })
+ }, 500)
}
}
diff --git a/snowy-admin-web/src/views/auth/sso/index.vue b/snowy-admin-web/src/views/auth/sso/index.vue
index 6d8c2d75..f61b8300 100644
--- a/snowy-admin-web/src/views/auth/sso/index.vue
+++ b/snowy-admin-web/src/views/auth/sso/index.vue
@@ -20,90 +20,90 @@
@@ -199,6 +199,8 @@
/* 旋转动画 */
@keyframes spin {
- to { transform: rotate(360deg); }
+ to {
+ transform: rotate(360deg);
+ }
}
diff --git a/snowy-admin-web/vite.config.mjs b/snowy-admin-web/vite.config.mjs
index 16e4caca..cbd78857 100644
--- a/snowy-admin-web/vite.config.mjs
+++ b/snowy-admin-web/vite.config.mjs
@@ -12,6 +12,7 @@ import { resolve } from 'path'
import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import Components from 'unplugin-vue-components/vite'
+import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers'
import VueJSX from '@vitejs/plugin-vue-jsx'
import AutoImport from 'unplugin-auto-import/vite'
import vueSetupExtend from 'vite-plugin-vue-setup-extend'
@@ -87,7 +88,6 @@ export default defineConfig(({ command, mode }) => {
// 第三方库分包配置保持不变
'vue-vendor': ['vue', 'vue-router', 'pinia', 'vue-i18n'],
'ant-design-vendor': ['ant-design-vue', '@ant-design/icons-vue', 'lodash-es', 'axios', 'dayjs'],
- 'echarts-vendor': ['echarts', 'echarts-stat'],
'office-vendor': ['@vue-office/docx', 'vue-pdf-embed', '@vue-office/excel']
}
}
@@ -110,18 +110,15 @@ export default defineConfig(({ command, mode }) => {
dts: r('src/auto-imports.d.ts')
}),
// 组件按需引入
- Components(
- {
- dirs: [r('src/components')],
- dts: false,
- resolvers: []
- },
- {
- dirs: [r('src/components/HomeCard')],
- dts: false,
- resolvers: []
- }
- ),
+ Components({
+ dirs: [r('src/components'), r('src/components/HomeCard')],
+ dts: false,
+ resolvers: [
+ AntDesignVueResolver({
+ importStyle: false // css in js
+ })
+ ]
+ }),
visualizer()
],
css: {
diff --git a/snowy-plugin/snowy-plugin-gen/src/main/resources/frontend/Api.js.btl b/snowy-plugin/snowy-plugin-gen/src/main/resources/frontend/Api.js.btl
index 00344ef7..5be12cdd 100644
--- a/snowy-plugin/snowy-plugin-gen/src/main/resources/frontend/Api.js.btl
+++ b/snowy-plugin/snowy-plugin-gen/src/main/resources/frontend/Api.js.btl
@@ -27,18 +27,18 @@ export default {
},
// 下载${functionName}导入模板
${classNameFirstLower}DownloadTemplate(data) {
- return request('downloadImportTemplate', data, 'get', {
- responseType: 'blob'
- })
+ return request('downloadImportTemplate', data, 'get', {
+ responseType: 'blob'
+ })
},
- // 导入${functionName}
- ${classNameFirstLower}Import(data) {
- return request('importData', data)
- },
- // 导出${functionName}
- ${classNameFirstLower}Export(data) {
- return request('exportData', data, 'post', {
- responseType: 'blob'
- })
- }
+ // 导入${functionName}
+ ${classNameFirstLower}Import(data) {
+ return request('importData', data)
+ },
+ // 导出${functionName}
+ ${classNameFirstLower}Export(data) {
+ return request('exportData', data, 'post', {
+ responseType: 'blob'
+ })
+ }
}
diff --git a/snowy-plugin/snowy-plugin-gen/src/main/resources/frontend/index.vue.btl b/snowy-plugin/snowy-plugin-gen/src/main/resources/frontend/index.vue.btl
index 38c5e9ea..a56ea1d5 100644
--- a/snowy-plugin/snowy-plugin-gen/src/main/resources/frontend/index.vue.btl
+++ b/snowy-plugin/snowy-plugin-gen/src/main/resources/frontend/index.vue.btl
@@ -6,7 +6,7 @@
<% for(var i = 0; i < configList.~size; i++) { %>
<% if(!configList[i].needTableId && configList[i].needPage) { searchCount ++; }%>
<% } %>
-
+
<% if (searchCount > 0) { %>
@@ -154,7 +154,7 @@
-
+