{
return defineComponent({
@@ -89,8 +94,10 @@ export function initVxeTable() {
}
export function setupVbenVxeTable(setupOptions: SetupVxeTable) {
+ const { configVxeTable, useVbenForm } = setupOptions;
+
initVxeTable();
- const { configVxeTable } = setupOptions;
+ useTableForm = useVbenForm;
const preference = usePreferences();
diff --git a/packages/effects/plugins/src/vxe-table/types.ts b/packages/effects/plugins/src/vxe-table/types.ts
index e93a53a70fe..118b1b8b9c5 100644
--- a/packages/effects/plugins/src/vxe-table/types.ts
+++ b/packages/effects/plugins/src/vxe-table/types.ts
@@ -1,4 +1,5 @@
import type { DeepPartial } from '@vben/types';
+import type { VbenFormProps } from '@vben-core/form-ui';
import type { VbenPaginationProps } from '@vben-core/shadcn-ui';
import type {
VxeGridListeners,
@@ -10,6 +11,8 @@ import type { VxeGridApi } from './api';
import type { Ref } from 'vue';
+import { useVbenForm } from '@vben-core/form-ui';
+
export interface VxePaginationInfo {
currentPage: number;
pageSize: number;
@@ -30,6 +33,10 @@ export interface VxeGridProps {
*/
gridOptions?: DeepPartial
;
gridEvents?: DeepPartial;
+ /**
+ * 表单配置
+ */
+ formOptions?: VbenFormProps;
/**
* 分页样式
*/
@@ -52,4 +59,5 @@ export type ExtendedVxeGridApi = {
export interface SetupVxeTable {
configVxeTable: (ui: VxeUIExport) => void;
+ useVbenForm: typeof useVbenForm;
}
diff --git a/packages/effects/plugins/src/vxe-table/use-vxe-grid.vue b/packages/effects/plugins/src/vxe-table/use-vxe-grid.vue
index 9eed4d2315c..dfe287f5aeb 100644
--- a/packages/effects/plugins/src/vxe-table/use-vxe-grid.vue
+++ b/packages/effects/plugins/src/vxe-table/use-vxe-grid.vue
@@ -1,4 +1,5 @@
-
+
+
+
+
@@ -201,7 +271,7 @@ onMounted(() => {
- 暂无数据
+ {{ $t('common.noData') }}
diff --git a/packages/effects/plugins/tailwind.config.mjs b/packages/effects/plugins/tailwind.config.mjs
new file mode 100644
index 00000000000..f17f556fa9f
--- /dev/null
+++ b/packages/effects/plugins/tailwind.config.mjs
@@ -0,0 +1 @@
+export { default } from '@vben/tailwind-config';
diff --git a/packages/locales/src/langs/en-US.json b/packages/locales/src/langs/en-US.json
index 6b42d8488b0..9048f49113b 100644
--- a/packages/locales/src/langs/en-US.json
+++ b/packages/locales/src/langs/en-US.json
@@ -31,7 +31,8 @@
"confirm": "Comfirm",
"noData": "No Data",
"refresh": "Refresh",
- "loadingMenu": "Loading Menu"
+ "loadingMenu": "Loading Menu",
+ "query": "Search"
},
"fallback": {
"pageNotFound": "Oops! Page Not Found",
diff --git a/packages/locales/src/langs/zh-CN.json b/packages/locales/src/langs/zh-CN.json
index b5a24d7cd66..3b9acdc3749 100644
--- a/packages/locales/src/langs/zh-CN.json
+++ b/packages/locales/src/langs/zh-CN.json
@@ -31,7 +31,8 @@
"confirm": "确认",
"noData": "暂无数据",
"refresh": "刷新",
- "loadingMenu": "加载菜单中"
+ "loadingMenu": "加载菜单中",
+ "query": "查询"
},
"fallback": {
"pageNotFound": "哎呀!未找到页面",
diff --git a/playground/src/adapter/vxe-table.ts b/playground/src/adapter/vxe-table.ts
index bee6564595b..969ec750d4c 100644
--- a/playground/src/adapter/vxe-table.ts
+++ b/playground/src/adapter/vxe-table.ts
@@ -4,6 +4,8 @@ import { setupVbenVxeTable, useVbenVxeGrid } from '@vben/plugins/vxe-table';
import { Button, Image } from 'ant-design-vue';
+import { useVbenForm } from './form';
+
setupVbenVxeTable({
configVxeTable: (vxeUI) => {
vxeUI.setConfig({
@@ -49,6 +51,7 @@ setupVbenVxeTable({
// 这里可以自行扩展 vxe-table 的全局配置,比如自定义格式化
// vxeUI.formats.add
},
+ useVbenForm,
});
export { useVbenVxeGrid };
diff --git a/playground/src/views/examples/vxe-table/form.vue b/playground/src/views/examples/vxe-table/form.vue
index 1ff9dcfd589..5ffda90e14d 100644
--- a/playground/src/views/examples/vxe-table/form.vue
+++ b/playground/src/views/examples/vxe-table/form.vue
@@ -1,10 +1,8 @@
-
-
-
-
-
-
+
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 111896a46a9..0be8cbcc47b 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1596,6 +1596,9 @@ importers:
packages/effects/plugins:
dependencies:
+ '@vben-core/form-ui':
+ specifier: workspace:*
+ version: link:../../@core/ui-kit/form-ui
'@vben-core/shadcn-ui':
specifier: workspace:*
version: link:../../@core/ui-kit/shadcn-ui
@@ -1608,6 +1611,9 @@ importers:
'@vben/icons':
specifier: workspace:*
version: link:../../icons
+ '@vben/locales':
+ specifier: workspace:*
+ version: link:../../locales
'@vben/preferences':
specifier: workspace:*
version: link:../../preferences