This commit is contained in:
dap 2024-11-05 07:53:13 +08:00
commit 81bb5fb5fe
48 changed files with 107 additions and 80 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@vben/web-antd",
"version": "1.0.0",
"version": "1.0.1",
"homepage": "https://vben.pro",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@ -28,7 +28,7 @@ async function loadTenant() {
//
if (resp.tenantEnabled && resp.voList.length > 0) {
const firstTenantId = resp.voList[0]!.tenantId;
codeLoginRef.value?.setFieldValue('tenantId', firstTenantId);
codeLoginRef.value?.getFormApi().setFieldValue('tenantId', firstTenantId);
}
}

View File

@ -45,7 +45,7 @@ async function loadTenant() {
//
if (resp.tenantEnabled && resp.voList.length > 0) {
const firstTenantId = resp.voList[0]!.tenantId;
loginFormRef.value?.setFieldValue('tenantId', firstTenantId);
loginFormRef.value?.getFormApi().setFieldValue('tenantId', firstTenantId);
}
}
@ -140,7 +140,7 @@ async function handleAccountLogin(values: LoginAndRegisterParams) {
//
if (error instanceof Error) {
//
loginFormRef.value?.setFieldValue('code', '');
loginFormRef.value?.getFormApi().setFieldValue('code', '');
await loadCaptcha();
}
}

View File

@ -1,6 +1,6 @@
{
"name": "@vben/web-ele",
"version": "5.4.3",
"version": "5.4.4",
"homepage": "https://vben.pro",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@ -1,6 +1,6 @@
{
"name": "@vben/web-naive",
"version": "5.4.3",
"version": "5.4.4",
"homepage": "https://vben.pro",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@ -1,6 +1,6 @@
{
"name": "@vben/docs",
"version": "5.4.3",
"version": "5.4.4",
"private": true,
"scripts": {
"build": "vitepress build",

View File

@ -150,6 +150,12 @@ To run the `docs` application:
pnpm dev:docs
```
## Public Static Resources
If you need to use public static resources in the project, such as images, static HTML, etc., and you want to directly import them in the development process through `src="/xxx.png"`.
You need to put the resource in the corresponding project's `public/static` directory. The import path for the resource should be `src="/static/xxx.png"`.
## DevTools
The project has a built-in [Vue DevTools](https://github.com/vuejs/devtools-next) plugin, which can be used during development. It is disabled by default, but can be enabled in the `.env.development` file. After enabling it, restart the project:

View File

@ -150,6 +150,12 @@ pnpm dev:ele
pnpm dev:docs
```
## 公共静态资源
项目中需要使用到的公共静态资源图片、静态HTML等需要在开发中通过 `src="/xxx.png"` 直接引入的。
需要将资源放在对应项目的 `public/static` 目录下。引入的路径为:`src="/static/xxx.png"`。
## DevTools
项目内置了 [Vue DevTools](https://github.com/vuejs/devtools-next) 插件,可以在开发过程中使用。默认关闭,可在`.env.development` 内开启,并重新运行项目即可:

View File

@ -1,6 +1,6 @@
{
"name": "@vben/commitlint-config",
"version": "5.4.3",
"version": "5.4.4",
"private": true,
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",

View File

@ -1,6 +1,6 @@
{
"name": "@vben/stylelint-config",
"version": "5.4.3",
"version": "5.4.4",
"private": true,
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",

View File

@ -1,6 +1,6 @@
{
"name": "@vben/node-utils",
"version": "5.4.3",
"version": "5.4.4",
"private": true,
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",

View File

@ -1,6 +1,6 @@
{
"name": "@vben/tailwind-config",
"version": "5.4.3",
"version": "5.4.4",
"private": true,
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",

View File

@ -1,6 +1,6 @@
{
"name": "@vben/tsconfig",
"version": "5.4.3",
"version": "5.4.4",
"private": true,
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",

View File

@ -1,6 +1,6 @@
{
"name": "@vben/vite-config",
"version": "5.4.3",
"version": "5.4.4",
"private": true,
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",

View File

@ -1,6 +1,6 @@
{
"name": "vben-admin-monorepo",
"version": "5.4.3",
"version": "5.4.4",
"private": true,
"keywords": [
"monorepo",

View File

@ -1,6 +1,6 @@
{
"name": "@vben-core/design",
"version": "5.4.3",
"version": "5.4.4",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@ -1,6 +1,6 @@
{
"name": "@vben-core/icons",
"version": "5.4.3",
"version": "5.4.4",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@ -1,6 +1,6 @@
{
"name": "@vben-core/shared",
"version": "5.4.3",
"version": "5.4.4",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {
@ -81,10 +81,12 @@
"dependencies": {
"@ctrl/tinycolor": "catalog:",
"@tanstack/vue-store": "catalog:",
"@types/lodash.get": "catalog:",
"@vue/shared": "catalog:",
"clsx": "catalog:",
"defu": "catalog:",
"lodash.clonedeep": "catalog:",
"lodash.get": "catalog:",
"nprogress": "catalog:",
"tailwind-merge": "catalog:",
"theme-colors": "catalog:"

View File

@ -1,6 +1,6 @@
{
"name": "@vben-core/typings",
"version": "5.4.3",
"version": "5.4.4",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@ -1,6 +1,6 @@
{
"name": "@vben-core/composables",
"version": "5.4.3",
"version": "5.4.4",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@ -1,6 +1,6 @@
{
"name": "@vben-core/preferences",
"version": "5.4.3",
"version": "5.4.4",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@ -1,6 +1,6 @@
{
"name": "@vben-core/layout-ui",
"version": "5.4.3",
"version": "5.4.4",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@ -1,6 +1,6 @@
{
"name": "@vben-core/menu-ui",
"version": "5.4.3",
"version": "5.4.4",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@ -1,6 +1,6 @@
{
"name": "@vben-core/shadcn-ui",
"version": "5.4.3",
"version": "5.4.4",
"#main": "./dist/index.mjs",
"#module": "./dist/index.mjs",
"homepage": "https://github.com/vbenjs/vue-vben-admin",

View File

@ -1,6 +1,6 @@
{
"name": "@vben-core/tabs-ui",
"version": "5.4.3",
"version": "5.4.4",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@ -1,6 +1,6 @@
{
"name": "@vben/constants",
"version": "5.4.3",
"version": "5.4.4",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@ -1,6 +1,6 @@
{
"name": "@vben/access",
"version": "5.4.3",
"version": "5.4.4",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@ -1,6 +1,6 @@
{
"name": "@vben/common-ui",
"version": "5.4.3",
"version": "5.4.4",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@ -52,7 +52,7 @@ const emit = defineEmits<{
const router = useRouter();
const [Form, { validate, setFieldValue, getValues }] = useVbenForm(
const [Form, formApi] = useVbenForm(
reactive({
commonConfig: {
hideLabel: true,
@ -64,8 +64,8 @@ const [Form, { validate, setFieldValue, getValues }] = useVbenForm(
);
async function handleSubmit() {
const { valid } = await validate();
const values = await getValues();
const { valid } = await formApi.validate();
const values = await formApi.getValues();
if (valid) {
emit('submit', {
tenantId: values?.tenantId,
@ -79,7 +79,9 @@ function goToLogin() {
router.push(props.loginPath);
}
defineExpose({ setFieldValue });
defineExpose({
getFormApi: () => formApi,
});
</script>
<template>

View File

@ -50,7 +50,7 @@ const emit = defineEmits<{
submit: [Record<string, any>];
}>();
const [Form, { validate, getValues }] = useVbenForm(
const [Form, formApi] = useVbenForm(
reactive({
commonConfig: {
hideLabel: true,
@ -64,8 +64,8 @@ const [Form, { validate, getValues }] = useVbenForm(
const router = useRouter();
async function handleSubmit() {
const { valid } = await validate();
const values = await getValues();
const { valid } = await formApi.validate();
const values = await formApi.getValues();
if (valid) {
emit('submit', values);
}
@ -74,6 +74,10 @@ async function handleSubmit() {
function goToLogin() {
router.push(props.loginPath);
}
defineExpose({
getFormApi: () => formApi,
});
</script>
<template>

View File

@ -44,7 +44,7 @@ const emit = defineEmits<{
submit: [LoginAndRegisterParams];
}>();
const [Form, { setFieldValue, validate, getValues }] = useVbenForm(
const [Form, formApi] = useVbenForm(
reactive({
commonConfig: {
hideLabel: true,
@ -63,9 +63,9 @@ const localUsername = localStorage.getItem(REMEMBER_ME_KEY) || '';
const rememberMe = ref(!!localUsername);
async function handleSubmit() {
const { valid } = await validate();
const values = cloneDeep(await getValues());
const { valid } = await formApi.validate();
if (valid) {
const values = cloneDeep(await formApi.getValues());
localStorage.setItem(
REMEMBER_ME_KEY,
rememberMe.value ? values?.username : '',
@ -82,11 +82,13 @@ function handleGo(path: string) {
onMounted(() => {
if (localUsername) {
setFieldValue('username', localUsername);
formApi.setFieldValue('username', localUsername);
}
});
defineExpose({ setFieldValue });
defineExpose({
getFormApi: () => formApi,
});
</script>
<template>

View File

@ -52,7 +52,7 @@ const emit = defineEmits<{
submit: [Recordable<any>];
}>();
const [Form, { validate, getValues }] = useVbenForm(
const [Form, formApi] = useVbenForm(
reactive({
commonConfig: {
hideLabel: true,
@ -66,8 +66,8 @@ const [Form, { validate, getValues }] = useVbenForm(
const router = useRouter();
async function handleSubmit() {
const { valid } = await validate();
const values = await getValues();
const { valid } = await formApi.validate();
const values = await formApi.getValues();
if (valid) {
emit('submit', values as { password: string; username: string });
}
@ -76,6 +76,10 @@ async function handleSubmit() {
function goToLogin() {
router.push(props.loginPath);
}
defineExpose({
getFormApi: () => formApi,
});
</script>
<template>

View File

@ -1,6 +1,6 @@
{
"name": "@vben/hooks",
"version": "5.4.3",
"version": "5.4.4",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@ -1,6 +1,6 @@
{
"name": "@vben/layouts",
"version": "5.4.3",
"version": "5.4.4",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@ -1,6 +1,6 @@
{
"name": "@vben/plugins",
"version": "5.4.3",
"version": "5.4.4",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@ -41,6 +41,9 @@ const props = withDefaults(defineProps<Props>(), {});
const FORM_SLOT_PREFIX = 'form-';
const TOOLBAR_ACTIONS = 'toolbar-actions';
const TOOLBAR_TOOLS = 'toolbar-tools';
const gridRef = useTemplateRef<VxeGridInstance>('gridRef');
const state = props.api?.useStore?.();
@ -89,15 +92,16 @@ const showTableTitle = computed(() => {
const showToolbar = computed(() => {
return (
!!slots['toolbar-actions']?.() ||
!!slots['toolbar-tools']?.() ||
!!slots[TOOLBAR_ACTIONS]?.() ||
!!slots[TOOLBAR_TOOLS]?.() ||
showTableTitle.value
);
});
const toolbarOptions = computed(() => {
const slotActions = slots['toolbar-actions']?.();
const slotTools = slots['toolbar-tools']?.();
const slotActions = slots[TOOLBAR_ACTIONS]?.();
const slotTools = slots[TOOLBAR_TOOLS]?.();
if (!showToolbar.value) {
return {};
}
@ -107,9 +111,9 @@ const toolbarOptions = computed(() => {
toolbarConfig: {
slots: {
...(slotActions || showTableTitle.value
? { buttons: 'toolbar-actions' }
? { buttons: TOOLBAR_ACTIONS }
: {}),
...(slotTools ? { tools: 'toolbar-tools' } : {}),
...(slotTools ? { tools: TOOLBAR_TOOLS } : {}),
},
},
};
@ -124,11 +128,6 @@ const options = computed(() => {
toolbarOptions.value,
toRaw(gridOptions.value),
globalGridConfig,
{
// toolbarConfig: {
// tools: [],
// },
} as VxeTableGridProps,
),
);
@ -187,7 +186,7 @@ const delegatedSlots = computed(() => {
const resultSlots: string[] = [];
for (const key of Object.keys(slots)) {
if (!['empty', 'form', 'loading', 'toolbar-actions'].includes(key)) {
if (!['empty', 'form', 'loading', TOOLBAR_ACTIONS].includes(key)) {
resultSlots.push(key);
}
}

View File

@ -1,6 +1,6 @@
{
"name": "@vben/request",
"version": "5.4.3",
"version": "5.4.4",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@ -1,6 +1,6 @@
{
"name": "@vben/icons",
"version": "5.4.3",
"version": "5.4.4",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@ -1,6 +1,6 @@
{
"name": "@vben/locales",
"version": "5.4.3",
"version": "5.4.4",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@ -1,6 +1,6 @@
{
"name": "@vben/preferences",
"version": "5.4.3",
"version": "5.4.4",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@ -1,6 +1,6 @@
{
"name": "@vben/stores",
"version": "5.4.3",
"version": "5.4.4",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@ -1,6 +1,6 @@
{
"name": "@vben/styles",
"version": "5.4.3",
"version": "5.4.4",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@ -1,6 +1,6 @@
{
"name": "@vben/types",
"version": "5.4.3",
"version": "5.4.4",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@ -1,6 +1,6 @@
{
"name": "@vben/utils",
"version": "5.4.3",
"version": "5.4.4",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@ -1,6 +1,6 @@
{
"name": "@vben/playground",
"version": "5.4.3",
"version": "5.4.4",
"homepage": "https://vben.pro",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@ -22,8 +22,8 @@ catalog:
'@commitlint/config-conventional': ^19.5.0
'@ctrl/tinycolor': ^4.1.0
'@eslint/js': ^9.14.0
'@faker-js/faker': ^9.1.0
'@iconify/json': ^2.2.266
'@faker-js/faker': ^9.2.0
'@iconify/json': ^2.2.267
'@iconify/tailwind': ^1.1.3
'@iconify/vue': ^4.1.2
'@intlify/core-base': ^10.0.4
@ -36,14 +36,15 @@ catalog:
'@stylistic/stylelint-plugin': ^3.1.1
'@tailwindcss/nesting': 0.0.0-insiders.565cd3e
'@tailwindcss/typography': ^0.5.15
'@tanstack/vue-query': ^5.59.16
'@tanstack/vue-query': ^5.59.17
'@tanstack/vue-store': ^0.5.6
'@types/archiver': ^6.0.3
'@types/eslint': ^9.6.1
'@types/html-minifier-terser': ^7.0.2
'@types/jsonwebtoken': ^9.0.7
'@types/lodash.clonedeep': ^4.5.9
'@types/node': ^22.8.6
'@types/lodash.get': ^4.4.9
'@types/node': ^22.8.7
'@types/nprogress': ^0.2.3
'@types/postcss-import': ^14.0.3
'@types/qrcode': ^1.5.5
@ -73,7 +74,7 @@ catalog:
commitlint-plugin-function-rules: ^4.0.0
consola: ^3.2.3
cross-env: ^7.0.3
cspell: ^8.15.5
cspell: ^8.15.7
cssnano: ^7.0.6
cz-git: ^1.10.1
czg: ^1.10.1
@ -102,9 +103,9 @@ catalog:
execa: ^9.5.1
find-up: ^7.0.0
get-port: ^7.1.0
globals: ^15.11.0
globals: ^15.12.0
h3: ^1.13.0
happy-dom: ^15.8.0
happy-dom: ^15.8.3
html-minifier-terser: ^7.2.0
husky: ^9.1.6
is-ci: ^3.0.1
@ -112,10 +113,11 @@ catalog:
jsonwebtoken: ^9.0.2
lint-staged: ^15.2.10
lodash.clonedeep: ^4.5.0
lodash.get: ^4.4.2
lucide-vue-next: ^0.454.0
medium-zoom: ^1.1.0
naive-ui: ^2.40.1
nitropack: ^2.10.0
nitropack: ^2.10.2
nprogress: ^0.2.0
ora: ^8.1.1
pinia: 2.2.2
@ -135,7 +137,7 @@ catalog:
radix-vue: ^1.9.8
resolve.exports: ^2.0.2
rimraf: ^6.0.1
rollup: ^4.24.3
rollup: ^4.24.4
rollup-plugin-visualizer: ^5.12.0
sass: 1.79.5
sortablejs: ^1.15.3
@ -164,7 +166,7 @@ catalog:
vite-plugin-lazy-import: ^1.0.7
vite-plugin-pwa: ^0.20.5
vite-plugin-vue-devtools: ^7.6.2
vitepress: ^1.4.3
vitepress: ^1.4.5
vitepress-plugin-group-icons: ^1.3.0
vitest: ^2.1.4
vue: ^3.5.12
@ -172,8 +174,8 @@ catalog:
vue-i18n: ^10.0.4
vue-router: ^4.4.5
vue-tsc: ^2.1.10
vxe-pc-ui: ^4.2.37
vxe-table: ^4.7.97
vxe-pc-ui: ^4.2.40
vxe-table: ^4.8.0
watermark-js-plus: ^1.5.7
zod: ^3.23.8
zod-defaults: ^0.1.3

View File

@ -1,6 +1,6 @@
{
"name": "@vben/turbo-run",
"version": "5.4.3",
"version": "5.4.4",
"private": true,
"license": "MIT",
"type": "module",

View File

@ -1,6 +1,6 @@
{
"name": "@vben/vsh",
"version": "5.4.3",
"version": "5.4.4",
"private": true,
"license": "MIT",
"type": "module",