diff --git a/.gitpod.yml b/.gitpod.yml index fb75b433d..5fda2cf70 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -2,5 +2,5 @@ ports: - port: 5555 onOpen: open-preview tasks: - - init: corepack enable && pnpm install + - init: npm i -g corepack && pnpm install command: pnpm run dev:play diff --git a/.vscode/settings.json b/.vscode/settings.json index da724dd17..8b76b2762 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -223,16 +223,5 @@ "commentTranslate.multiLineMerge": true, "vue.server.hybridMode": true, "typescript.tsdk": "node_modules/typescript/lib", - "oxc.enable": false, - "cSpell.words": [ - "archiver", - "axios", - "dotenv", - "isequal", - "jspm", - "napi", - "nolebase", - "rollup", - "vitest" - ] + "oxc.enable": false } diff --git a/apps/web-antd/.env b/apps/web-antd/.env index abac77511..7cb021270 100644 --- a/apps/web-antd/.env +++ b/apps/web-antd/.env @@ -3,6 +3,10 @@ VITE_APP_TITLE=芋道管理系统 # 应用命名空间,用于缓存、store等功能的前缀,确保隔离 VITE_APP_NAMESPACE=yudao-vben-antd + +# 对store进行加密的密钥,在将store持久化到localStorage时会使用该密钥进行加密 +VITE_APP_STORE_SECURE_KEY=please-replace-me-with-your-own-key + # 是否开启模拟数据 VITE_NITRO_MOCK=false @@ -16,4 +20,4 @@ VITE_APP_CAPTCHA_ENABLE=false VITE_APP_DOCALERT_ENABLE=true # 百度统计 -VITE_APP_BAIDU_CODE = e98f2eab6ceb8688bc6d8fc5332ff093 \ No newline at end of file +VITE_APP_BAIDU_CODE = e98f2eab6ceb8688bc6d8fc5332ff093 diff --git a/apps/web-antd/package.json b/apps/web-antd/package.json index ece23c22b..e5c1e01d6 100644 --- a/apps/web-antd/package.json +++ b/apps/web-antd/package.json @@ -1,6 +1,6 @@ { "name": "@vben/web-antd", - "version": "5.5.4", + "version": "5.5.5", "homepage": "https://vben.pro", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/apps/web-antd/public/wx-xingyu.png b/apps/web-antd/public/wx-xingyu.png new file mode 100644 index 000000000..5e4b6017d Binary files /dev/null and b/apps/web-antd/public/wx-xingyu.png differ diff --git a/apps/web-antd/src/adapter/component/index.ts b/apps/web-antd/src/adapter/component/index.ts index 9cc430135..71133647c 100644 --- a/apps/web-antd/src/adapter/component/index.ts +++ b/apps/web-antd/src/adapter/component/index.ts @@ -76,8 +76,8 @@ const withDefaultPlaceholder = ( componentProps: Recordable = {}, ) => { return defineComponent({ - inheritAttrs: false, name: component.name, + inheritAttrs: false, setup: (props: any, { attrs, expose, slots }) => { const placeholder = props?.placeholder || @@ -142,20 +142,34 @@ async function initComponentAdapter() { // 如果你的组件体积比较大,可以使用异步加载 // Button: () => // import('xxx').then((res) => res.Button), - ApiSelect: withDefaultPlaceholder(ApiComponent, 'select', { - component: Select, - loadingSlot: 'suffixIcon', - visibleEvent: 'onDropdownVisibleChange', - modelPropName: 'value', - }), - ApiTreeSelect: withDefaultPlaceholder(ApiComponent, 'select', { - component: TreeSelect, - fieldNames: { label: 'label', value: 'value', children: 'children' }, - loadingSlot: 'suffixIcon', - modelPropName: 'value', - optionsPropName: 'treeData', - visibleEvent: 'onVisibleChange', - }), + ApiSelect: withDefaultPlaceholder( + { + ...ApiComponent, + name: 'ApiSelect', + }, + 'select', + { + component: Select, + loadingSlot: 'suffixIcon', + visibleEvent: 'onDropdownVisibleChange', + modelPropName: 'value', + }, + ), + ApiTreeSelect: withDefaultPlaceholder( + { + ...ApiComponent, + name: 'ApiTreeSelect', + }, + 'select', + { + component: TreeSelect, + fieldNames: { label: 'label', value: 'value', children: 'children' }, + loadingSlot: 'suffixIcon', + modelPropName: 'value', + optionsPropName: 'treeData', + visibleEvent: 'onVisibleChange', + }, + ), AutoComplete, Checkbox, CheckboxGroup, diff --git a/apps/web-antd/src/bootstrap.ts b/apps/web-antd/src/bootstrap.ts index 9fdb8abf6..43fd96288 100644 --- a/apps/web-antd/src/bootstrap.ts +++ b/apps/web-antd/src/bootstrap.ts @@ -7,7 +7,6 @@ import { preferences } from '@vben/preferences'; import { initStores } from '@vben/stores'; import '@vben/styles'; import '@vben/styles/antd'; -import 'vxe-table/styles/cssvar.scss'; // TODO @puhui999:这个必须导入哇?我看 use-vxe-grid.vue 已经导入了 import { useTitle } from '@vueuse/core'; @@ -18,6 +17,8 @@ import { initComponentAdapter } from './adapter/component'; import App from './app.vue'; import { router } from './router'; +import 'vxe-table/styles/cssvar.scss'; // TODO @puhui999:这个必须导入哇?我看 use-vxe-grid.vue 已经导入了 + async function bootstrap(namespace: string) { // 初始化组件适配器 await initComponentAdapter(); diff --git a/apps/web-antd/src/layouts/basic.vue b/apps/web-antd/src/layouts/basic.vue index 733c4a6a3..86f444661 100644 --- a/apps/web-antd/src/layouts/basic.vue +++ b/apps/web-antd/src/layouts/basic.vue @@ -3,7 +3,7 @@ import type { NotificationItem } from '@vben/layouts'; import { computed, onMounted, ref, watch } from 'vue'; -import { AuthenticationLoginExpiredModal } from '@vben/common-ui'; +import { AuthenticationLoginExpiredModal, useVbenModal } from '@vben/common-ui'; import { VBEN_DOC_URL, VBEN_GITHUB_URL } from '@vben/constants'; import { useWatermark } from '@vben/hooks'; import { @@ -33,6 +33,8 @@ import { router } from '#/router'; import { useAuthStore } from '#/store'; import LoginForm from '#/views/_core/authentication/login.vue'; +import Help from './components/help.vue'; + const userStore = useUserStore(); const authStore = useAuthStore(); const accessStore = useAccessStore(); @@ -42,6 +44,10 @@ const notifications = ref([]); const unreadCount = ref(0); const showDot = computed(() => unreadCount.value > 0); +const [HelpModal, helpModalApi] = useVbenModal({ + connectedComponent: Help, +}); + const menus = computed(() => [ { handler: () => { @@ -70,9 +76,7 @@ const menus = computed(() => [ }, { handler: () => { - openWindow(`${VBEN_GITHUB_URL}/issues`, { - target: '_blank', - }); + helpModalApi.open(); }, icon: CircleHelp, text: $t('ui.widgets.qa'), @@ -210,4 +214,5 @@ watch( + diff --git a/apps/web-antd/src/layouts/components/help.vue b/apps/web-antd/src/layouts/components/help.vue new file mode 100644 index 000000000..4d19a8e92 --- /dev/null +++ b/apps/web-antd/src/layouts/components/help.vue @@ -0,0 +1,93 @@ + + diff --git a/apps/web-antd/src/views/_core/authentication/code-login.vue b/apps/web-antd/src/views/_core/authentication/code-login.vue index 3df82e0e7..1862abf8c 100644 --- a/apps/web-antd/src/views/_core/authentication/code-login.vue +++ b/apps/web-antd/src/views/_core/authentication/code-login.vue @@ -30,7 +30,7 @@ const loginRef = ref(); /** 获取租户列表,并默认选中 */ const tenantList = ref([]); // 租户列表 -const fetchTenantList = async () => { +async function fetchTenantList() { if (!tenantEnable) { return; } @@ -56,11 +56,11 @@ const fetchTenantList = async () => { // 设置选中的租户编号 accessStore.setTenantId(tenantId); - loginRef.value.getFormApi().setFieldValue('tenantId', tenantId); + loginRef.value.getFormApi().setFieldValue('tenantId', tenantId?.toString()); } catch (error) { console.error('获取租户列表失败:', error); } -}; +} /** 组件挂载时获取租户信息 */ onMounted(() => { @@ -74,19 +74,19 @@ const formSchema = computed((): VbenFormSchema[] => { componentProps: { options: tenantList.value.map((item) => ({ label: item.name, - value: item.id, + value: item.id.toString(), })), placeholder: $t('authentication.tenantTip'), }, fieldName: 'tenantId', label: $t('authentication.tenant'), - rules: z.number().positive(), + rules: z.string().min(1, { message: $t('authentication.tenantTip') }), dependencies: { triggerFields: ['tenantId'], if: tenantEnable, trigger(values) { if (values.tenantId) { - accessStore.setTenantId(values.tenantId); + accessStore.setTenantId(Number(values.tenantId)); } }, }, diff --git a/apps/web-antd/src/views/_core/authentication/forget-password.vue b/apps/web-antd/src/views/_core/authentication/forget-password.vue index 52f65b15b..2ef4b0ff1 100644 --- a/apps/web-antd/src/views/_core/authentication/forget-password.vue +++ b/apps/web-antd/src/views/_core/authentication/forget-password.vue @@ -29,7 +29,7 @@ const forgetPasswordRef = ref(); /** 获取租户列表,并默认选中 */ const tenantList = ref([]); // 租户列表 -const fetchTenantList = async () => { +async function fetchTenantList() { if (!tenantEnable) { return; } @@ -55,11 +55,13 @@ const fetchTenantList = async () => { // 设置选中的租户编号 accessStore.setTenantId(tenantId); - forgetPasswordRef.value.getFormApi().setFieldValue('tenantId', tenantId); + forgetPasswordRef.value + .getFormApi() + .setFieldValue('tenantId', tenantId?.toString()); } catch (error) { console.error('获取租户列表失败:', error); } -}; +} /** 组件挂载时获取租户信息 */ onMounted(() => { @@ -73,19 +75,19 @@ const formSchema = computed((): VbenFormSchema[] => { componentProps: { options: tenantList.value.map((item) => ({ label: item.name, - value: item.id, + value: item.id.toString(), })), placeholder: $t('authentication.tenantTip'), }, fieldName: 'tenantId', label: $t('authentication.tenant'), - rules: z.number().positive(), + rules: z.string().min(1, { message: $t('authentication.tenantTip') }), dependencies: { triggerFields: ['tenantId'], if: tenantEnable, trigger(values) { if (values.tenantId) { - accessStore.setTenantId(values.tenantId); + accessStore.setTenantId(Number(values.tenantId)); } }, }, diff --git a/apps/web-antd/src/views/_core/authentication/login.vue b/apps/web-antd/src/views/_core/authentication/login.vue index 926926f90..aa1db4c53 100644 --- a/apps/web-antd/src/views/_core/authentication/login.vue +++ b/apps/web-antd/src/views/_core/authentication/login.vue @@ -35,7 +35,7 @@ const captchaType = 'blockPuzzle'; // 验证码类型:'blockPuzzle' | 'clickWo /** 获取租户列表,并默认选中 */ const tenantList = ref([]); // 租户列表 -const fetchTenantList = async () => { +async function fetchTenantList() { if (!tenantEnable) { return; } @@ -61,26 +61,25 @@ const fetchTenantList = async () => { // 设置选中的租户编号 accessStore.setTenantId(tenantId); - loginRef.value.getFormApi().setFieldValue('tenantId', tenantId); + loginRef.value.getFormApi().setFieldValue('tenantId', tenantId?.toString()); } catch (error) { console.error('获取租户列表失败:', error); } -}; +} /** 处理登录 */ -const handleLogin = async (values: any) => { +async function handleLogin(values: any) { // 如果开启验证码,则先验证验证码 if (captchaEnable) { verifyRef.value.show(); return; } - // 无验证码,直接登录 await authStore.authLogin('username', values); -}; +} /** 验证码通过,执行登录 */ -const handleVerifySuccess = async ({ captchaVerification }: any) => { +async function handleVerifySuccess({ captchaVerification }: any) { try { await authStore.authLogin('username', { ...(await loginRef.value.getFormApi().getValues()), @@ -89,11 +88,11 @@ const handleVerifySuccess = async ({ captchaVerification }: any) => { } catch (error) { console.error('Error in handleLogin:', error); } -}; +} /** 处理第三方登录 */ const redirect = query?.redirect; -const handleThirdLogin = async (type: number) => { +async function handleThirdLogin(type: number) { if (type <= 0) { return; } @@ -111,7 +110,7 @@ const handleThirdLogin = async (type: number) => { } catch (error) { console.error('第三方登录处理失败:', error); } -}; +} /** 组件挂载时获取租户信息 */ onMounted(() => { @@ -125,19 +124,19 @@ const formSchema = computed((): VbenFormSchema[] => { componentProps: { options: tenantList.value.map((item) => ({ label: item.name, - value: item.id, + value: item.id.toString(), })), placeholder: $t('authentication.tenantTip'), }, fieldName: 'tenantId', label: $t('authentication.tenant'), - rules: z.number().positive(), + rules: z.string().min(1, { message: $t('authentication.tenantTip') }), dependencies: { triggerFields: ['tenantId'], if: tenantEnable, trigger(values) { if (values.tenantId) { - accessStore.setTenantId(values.tenantId); + accessStore.setTenantId(Number(values.tenantId)); } }, }, diff --git a/apps/web-antd/src/views/_core/authentication/register.vue b/apps/web-antd/src/views/_core/authentication/register.vue index 567bb04c8..734f4c27d 100644 --- a/apps/web-antd/src/views/_core/authentication/register.vue +++ b/apps/web-antd/src/views/_core/authentication/register.vue @@ -34,7 +34,7 @@ const captchaType = 'blockPuzzle'; // 验证码类型:'blockPuzzle' | 'clickWo /** 获取租户列表,并默认选中 */ const tenantList = ref([]); // 租户列表 -const fetchTenantList = async () => { +async function fetchTenantList() { if (!tenantEnable) { return; } @@ -60,14 +60,16 @@ const fetchTenantList = async () => { // 设置选中的租户编号 accessStore.setTenantId(tenantId); - registerRef.value.getFormApi().setFieldValue('tenantId', tenantId); + registerRef.value + .getFormApi() + .setFieldValue('tenantId', tenantId?.toString()); } catch (error) { console.error('获取租户列表失败:', error); } -}; +} /** 执行注册 */ -const handleRegister = async (values: any) => { +async function handleRegister(values: any) { // 如果开启验证码,则先验证验证码 if (captchaEnable) { verifyRef.value.show(); @@ -76,7 +78,7 @@ const handleRegister = async (values: any) => { // 无验证码,直接登录 await authStore.authLogin('register', values); -}; +} /** 验证码通过,执行注册 */ const handleVerifySuccess = async ({ captchaVerification }: any) => { @@ -108,13 +110,13 @@ const formSchema = computed((): VbenFormSchema[] => { }, fieldName: 'tenantId', label: $t('authentication.tenant'), - rules: z.number().positive(), + rules: z.string().min(1, { message: $t('authentication.tenantTip') }), dependencies: { triggerFields: ['tenantId'], if: tenantEnable, trigger(values) { if (values.tenantId) { - accessStore.setTenantId(values.tenantId); + accessStore.setTenantId(Number(values.tenantId)); } }, }, diff --git a/apps/web-antd/src/views/_core/authentication/social-login.vue b/apps/web-antd/src/views/_core/authentication/social-login.vue index c4826a535..e75a9c0d4 100644 --- a/apps/web-antd/src/views/_core/authentication/social-login.vue +++ b/apps/web-antd/src/views/_core/authentication/social-login.vue @@ -35,7 +35,7 @@ const captchaType = 'blockPuzzle'; // 验证码类型:'blockPuzzle' | 'clickWo /** 获取租户列表,并默认选中 */ const tenantList = ref([]); // 租户列表 -const fetchTenantList = async () => { +async function fetchTenantList() { if (!tenantEnable) { return; } @@ -66,14 +66,14 @@ const fetchTenantList = async () => { } catch (error) { console.error('获取租户列表失败:', error); } -}; +} /** 尝试登录:当账号已经绑定,socialLogin 会直接获得 token */ const socialType = Number(getUrlValue('type')); const redirect = getUrlValue('redirect'); const socialCode = query?.code as string; const socialState = query?.state as string; -const tryLogin = async () => { +async function tryLogin() { // 用于登录后,基于 redirect 的重定向 if (redirect) { await router.replace({ @@ -90,10 +90,10 @@ const tryLogin = async () => { code: socialCode, state: socialState, }); -}; +} /** 处理登录 */ -const handleLogin = async (values: any) => { +async function handleLogin(values: any) { // 如果开启验证码,则先验证验证码 if (captchaEnable) { verifyRef.value.show(); @@ -107,10 +107,10 @@ const handleLogin = async (values: any) => { socialCode, socialState, }); -}; +} /** 验证码通过,执行登录 */ -const handleVerifySuccess = async ({ captchaVerification }: any) => { +async function handleVerifySuccess({ captchaVerification }: any) { try { await authStore.authLogin('username', { ...(await loginRef.value.getFormApi().getValues()), @@ -122,7 +122,7 @@ const handleVerifySuccess = async ({ captchaVerification }: any) => { } catch (error) { console.error('Error in handleLogin:', error); } -}; +} /** tricky: 配合 login.vue 中,redirectUri 需要对参数进行 encode,需要在回调后进行decode */ function getUrlValue(key: string): string { @@ -144,19 +144,19 @@ const formSchema = computed((): VbenFormSchema[] => { componentProps: { options: tenantList.value.map((item) => ({ label: item.name, - value: item.id, + value: item.id.toString(), })), placeholder: $t('authentication.tenantTip'), }, fieldName: 'tenantId', label: $t('authentication.tenant'), - rules: z.number().positive(), + rules: z.string().min(1, { message: $t('authentication.tenantTip') }), dependencies: { triggerFields: ['tenantId'], if: tenantEnable, trigger(values) { if (values.tenantId) { - accessStore.setTenantId(values.tenantId); + accessStore.setTenantId(Number(values.tenantId)); } }, }, diff --git a/apps/web-antd/src/views/_core/authentication/sso-login.vue b/apps/web-antd/src/views/_core/authentication/sso-login.vue index ae5ac89c5..1bc7ad9b1 100644 --- a/apps/web-antd/src/views/_core/authentication/sso-login.vue +++ b/apps/web-antd/src/views/_core/authentication/sso-login.vue @@ -29,7 +29,7 @@ const queryParams = reactive({ const loading = ref(false); // 表单是否提交中 /** 初始化授权信息 */ -const init = async () => { +async function init() { // 防止在没有登录的情况下循环弹窗 if (query.client_id === undefined) { return; @@ -75,10 +75,10 @@ const init = async () => { 'scopes', scopes.filter((scope) => scope.value).map((scope) => scope.key), ); -}; +} /** 处理授权的提交 */ -const handleSubmit = async (approved: boolean) => { +async function handleSubmit(approved: boolean) { // 计算 checkedScopes + uncheckedScopes let checkedScopes: string[]; let uncheckedScopes: string[]; @@ -107,7 +107,7 @@ const handleSubmit = async (approved: boolean) => { } finally { loading.value = false; } -}; +} /** 调用授权 API 接口 */ const doAuthorize = ( @@ -127,7 +127,7 @@ const doAuthorize = ( }; /** 格式化 scope 文本 */ -const formatScope = (scope: string) => { +function formatScope(scope: string) { // 格式化 scope 授权范围,方便用户理解。 // 这里仅仅是一个 demo,可以考虑录入到字典数据中,例如说字典类型 "system_oauth2_scope",它的每个 scope 都是一条字典数据。 switch (scope) { @@ -141,7 +141,7 @@ const formatScope = (scope: string) => { return scope; } } -}; +} const formSchema = computed((): VbenFormSchema[] => { return [ diff --git a/apps/web-antd/src/views/_core/profile/index.vue b/apps/web-antd/src/views/_core/profile/index.vue index 4566b2c8a..8c8035733 100644 --- a/apps/web-antd/src/views/_core/profile/index.vue +++ b/apps/web-antd/src/views/_core/profile/index.vue @@ -1,17 +1,20 @@ diff --git a/apps/web-antd/src/views/bpm/group/index.vue b/apps/web-antd/src/views/bpm/group/index.vue index d30707d92..98675eed7 100644 --- a/apps/web-antd/src/views/bpm/group/index.vue +++ b/apps/web-antd/src/views/bpm/group/index.vue @@ -1,18 +1,31 @@ \ No newline at end of file + diff --git a/apps/web-antd/src/views/bpm/oa/leave/index.vue b/apps/web-antd/src/views/bpm/oa/leave/index.vue index 249ffd90c..c35b0c4a3 100644 --- a/apps/web-antd/src/views/bpm/oa/leave/index.vue +++ b/apps/web-antd/src/views/bpm/oa/leave/index.vue @@ -1,18 +1,34 @@ \ No newline at end of file + diff --git a/apps/web-antd/src/views/bpm/processExpression/index.vue b/apps/web-antd/src/views/bpm/processExpression/index.vue index bd3f4e00e..80bf15bf0 100644 --- a/apps/web-antd/src/views/bpm/processExpression/index.vue +++ b/apps/web-antd/src/views/bpm/processExpression/index.vue @@ -1,18 +1,31 @@ \ No newline at end of file + diff --git a/apps/web-antd/src/views/bpm/processInstance/index.vue b/apps/web-antd/src/views/bpm/processInstance/index.vue index 5386849f1..bf472bc1c 100644 --- a/apps/web-antd/src/views/bpm/processInstance/index.vue +++ b/apps/web-antd/src/views/bpm/processInstance/index.vue @@ -1,18 +1,34 @@ \ No newline at end of file + diff --git a/apps/web-antd/src/views/bpm/processInstance/manager/index.vue b/apps/web-antd/src/views/bpm/processInstance/manager/index.vue index 619f0d93d..9dd48e7cb 100644 --- a/apps/web-antd/src/views/bpm/processInstance/manager/index.vue +++ b/apps/web-antd/src/views/bpm/processInstance/manager/index.vue @@ -1,18 +1,31 @@ \ No newline at end of file + diff --git a/apps/web-antd/src/views/bpm/processListener/index.vue b/apps/web-antd/src/views/bpm/processListener/index.vue index 5556b0f40..6e88768d1 100644 --- a/apps/web-antd/src/views/bpm/processListener/index.vue +++ b/apps/web-antd/src/views/bpm/processListener/index.vue @@ -1,18 +1,34 @@ \ No newline at end of file + diff --git a/apps/web-antd/src/views/bpm/task/copy/index.vue b/apps/web-antd/src/views/bpm/task/copy/index.vue index b26b7d8ee..3f5e2b5ed 100644 --- a/apps/web-antd/src/views/bpm/task/copy/index.vue +++ b/apps/web-antd/src/views/bpm/task/copy/index.vue @@ -1,18 +1,34 @@ \ No newline at end of file + diff --git a/apps/web-antd/src/views/bpm/task/done/index.vue b/apps/web-antd/src/views/bpm/task/done/index.vue index b23eef1e5..bd5ffef00 100644 --- a/apps/web-antd/src/views/bpm/task/done/index.vue +++ b/apps/web-antd/src/views/bpm/task/done/index.vue @@ -1,21 +1,40 @@ \ No newline at end of file + diff --git a/apps/web-antd/src/views/bpm/task/manager/index.vue b/apps/web-antd/src/views/bpm/task/manager/index.vue index d564ebbd7..0da6999bf 100644 --- a/apps/web-antd/src/views/bpm/task/manager/index.vue +++ b/apps/web-antd/src/views/bpm/task/manager/index.vue @@ -1,18 +1,31 @@ \ No newline at end of file + diff --git a/apps/web-antd/src/views/bpm/task/todo/index.vue b/apps/web-antd/src/views/bpm/task/todo/index.vue index 976ddc010..9829b2eec 100644 --- a/apps/web-antd/src/views/bpm/task/todo/index.vue +++ b/apps/web-antd/src/views/bpm/task/todo/index.vue @@ -1,21 +1,40 @@ \ No newline at end of file + diff --git a/apps/web-antd/src/views/infra/codegen/index.vue b/apps/web-antd/src/views/infra/codegen/index.vue index f29638319..8d80e0b10 100644 --- a/apps/web-antd/src/views/infra/codegen/index.vue +++ b/apps/web-antd/src/views/infra/codegen/index.vue @@ -210,14 +210,14 @@ initDataSourceConfig(); - - + + diff --git a/apps/web-antd/src/views/infra/codegen/modules/basic-info.vue b/apps/web-antd/src/views/infra/codegen/modules/basic-info.vue index bc24bf636..00c49911b 100644 --- a/apps/web-antd/src/views/infra/codegen/modules/basic-info.vue +++ b/apps/web-antd/src/views/infra/codegen/modules/basic-info.vue @@ -1,9 +1,10 @@ diff --git a/apps/web-antd/src/views/system/notice/modules/form.vue b/apps/web-antd/src/views/system/notice/modules/form.vue index 980ed34b5..8df1d3c84 100644 --- a/apps/web-antd/src/views/system/notice/modules/form.vue +++ b/apps/web-antd/src/views/system/notice/modules/form.vue @@ -22,6 +22,13 @@ const getTitle = computed(() => { }); const [Form, formApi] = useVbenForm({ + commonConfig: { + componentProps: { + class: 'w-full', + }, + formItemClass: 'col-span-2', + labelWidth: 80, + }, layout: 'horizontal', schema: useFormSchema(), showDefaultActions: false, diff --git a/apps/web-antd/src/views/system/notify/template/data.ts b/apps/web-antd/src/views/system/notify/template/data.ts index 1937291c9..0a347d217 100644 --- a/apps/web-antd/src/views/system/notify/template/data.ts +++ b/apps/web-antd/src/views/system/notify/template/data.ts @@ -68,7 +68,6 @@ export function useFormSchema(): VbenFormSchema[] { DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE, 'number', ), - class: 'w-full', placeholder: '请选择模板类型', }, rules: 'required', @@ -201,7 +200,6 @@ export function useSendNotifyFormSchema(): VbenFormSchema[] { component: 'ApiSelect', componentProps: { api: getSimpleUserList, - class: 'w-full', labelField: 'nickname', valueField: 'id', placeholder: '请选择接收人', diff --git a/apps/web-antd/src/views/system/notify/template/modules/form.vue b/apps/web-antd/src/views/system/notify/template/modules/form.vue index 42c12f820..8a3c4a4e7 100644 --- a/apps/web-antd/src/views/system/notify/template/modules/form.vue +++ b/apps/web-antd/src/views/system/notify/template/modules/form.vue @@ -26,6 +26,13 @@ const getTitle = computed(() => { }); const [Form, formApi] = useVbenForm({ + commonConfig: { + componentProps: { + class: 'w-full', + }, + formItemClass: 'col-span-2', + labelWidth: 80, + }, layout: 'horizontal', schema: useFormSchema(), showDefaultActions: false, diff --git a/apps/web-antd/src/views/system/notify/template/modules/send-form.vue b/apps/web-antd/src/views/system/notify/template/modules/send-form.vue index b455bc36e..52a36044c 100644 --- a/apps/web-antd/src/views/system/notify/template/modules/send-form.vue +++ b/apps/web-antd/src/views/system/notify/template/modules/send-form.vue @@ -17,11 +17,15 @@ const emit = defineEmits(['success']); const formData = ref(); const [Form, formApi] = useVbenForm({ + commonConfig: { + componentProps: { + class: 'w-full', + }, + formItemClass: 'col-span-2', + labelWidth: 80, + }, layout: 'horizontal', showDefaultActions: false, - commonConfig: { - labelWidth: 120, - }, }); const [Modal, modalApi] = useVbenModal({ diff --git a/apps/web-antd/src/views/system/oauth2/client/data.ts b/apps/web-antd/src/views/system/oauth2/client/data.ts index c035cdd2b..903da278d 100644 --- a/apps/web-antd/src/views/system/oauth2/client/data.ts +++ b/apps/web-antd/src/views/system/oauth2/client/data.ts @@ -84,7 +84,6 @@ export function useFormSchema(): VbenFormSchema[] { componentProps: { placeholder: '请输入访问令牌的有效期,单位:秒', min: 0, - class: 'w-full', controlsPosition: 'right', }, rules: 'required', @@ -96,7 +95,6 @@ export function useFormSchema(): VbenFormSchema[] { componentProps: { placeholder: '请输入刷新令牌的有效期,单位:秒', min: 0, - class: 'w-full', controlsPosition: 'right', }, rules: 'required', @@ -109,7 +107,6 @@ export function useFormSchema(): VbenFormSchema[] { options: getDictOptions(DICT_TYPE.SYSTEM_OAUTH2_GRANT_TYPE), mode: 'multiple', placeholder: '请输入授权类型', - class: 'w-full', }, rules: 'required', }, @@ -120,7 +117,6 @@ export function useFormSchema(): VbenFormSchema[] { componentProps: { placeholder: '请输入授权范围', mode: 'tags', - class: 'w-full', }, }, { @@ -130,7 +126,6 @@ export function useFormSchema(): VbenFormSchema[] { componentProps: { placeholder: '请输入自动授权范围', mode: 'multiple', - class: 'w-full', // TODO @芋艿:根据权限,自动授权范围 }, }, @@ -141,7 +136,6 @@ export function useFormSchema(): VbenFormSchema[] { componentProps: { placeholder: '请输入可重定向的 URI 地址', mode: 'tags', - class: 'w-full', }, rules: 'required', }, @@ -152,7 +146,6 @@ export function useFormSchema(): VbenFormSchema[] { componentProps: { placeholder: '请输入权限', mode: 'tags', - class: 'w-full', }, }, { @@ -162,7 +155,6 @@ export function useFormSchema(): VbenFormSchema[] { componentProps: { mode: 'tags', placeholder: '请输入资源', - class: 'w-full', }, }, { diff --git a/apps/web-antd/src/views/system/oauth2/client/modules/form.vue b/apps/web-antd/src/views/system/oauth2/client/modules/form.vue index 66e123cff..38a07370f 100644 --- a/apps/web-antd/src/views/system/oauth2/client/modules/form.vue +++ b/apps/web-antd/src/views/system/oauth2/client/modules/form.vue @@ -26,12 +26,16 @@ const getTitle = computed(() => { }); const [Form, formApi] = useVbenForm({ + commonConfig: { + componentProps: { + class: 'w-full', + }, + formItemClass: 'col-span-2', + labelWidth: 80, + }, layout: 'horizontal', schema: useFormSchema(), showDefaultActions: false, - commonConfig: { - labelWidth: 140, - }, }); const [Modal, modalApi] = useVbenModal({ diff --git a/apps/web-antd/src/views/system/role/data.ts b/apps/web-antd/src/views/system/role/data.ts index 45d2c39cc..638d495b6 100644 --- a/apps/web-antd/src/views/system/role/data.ts +++ b/apps/web-antd/src/views/system/role/data.ts @@ -40,7 +40,6 @@ export function useFormSchema(): VbenFormSchema[] { component: 'InputNumber', componentProps: { min: 0, - class: 'w-full', controlsPosition: 'right', placeholder: '请输入显示顺序', }, @@ -97,7 +96,6 @@ export function useAssignDataPermissionFormSchema(): VbenFormSchema[] { fieldName: 'dataScope', label: '权限范围', componentProps: { - class: 'w-full', options: getDictOptions(DICT_TYPE.SYSTEM_DATA_SCOPE, 'number'), }, }, diff --git a/apps/web-antd/src/views/system/role/modules/assign-data-permission-form.vue b/apps/web-antd/src/views/system/role/modules/assign-data-permission-form.vue index ec72f53f0..6fd2b2c95 100644 --- a/apps/web-antd/src/views/system/role/modules/assign-data-permission-form.vue +++ b/apps/web-antd/src/views/system/role/modules/assign-data-permission-form.vue @@ -7,7 +7,7 @@ import { ref } from 'vue'; import { useVbenModal, VbenTree } from '@vben/common-ui'; import { handleTree } from '@vben/utils'; -import { Checkbox, message, Spin } from 'ant-design-vue'; +import { Checkbox, message } from 'ant-design-vue'; import { useVbenForm } from '#/adapter/form'; import { getDeptList } from '#/api/system/dept'; @@ -28,6 +28,13 @@ const isCheckStrictly = ref(true); // 父子联动状态 const expandedKeys = ref([]); // 展开的节点 const [Form, formApi] = useVbenForm({ + commonConfig: { + componentProps: { + class: 'w-full', + }, + formItemClass: 'col-span-2', + labelWidth: 80, + }, layout: 'horizontal', schema: useAssignDataPermissionFormSchema(), showDefaultActions: false, @@ -128,23 +135,23 @@ function getAllNodeIds(nodes: any[], ids: number[] = []): number[] {