diff --git a/yudao-ui-admin-vue3/src/hooks/web/useVxeCrudSchemas.ts b/yudao-ui-admin-vue3/src/hooks/web/useVxeCrudSchemas.ts index 4ba77f32f..d37245156 100644 --- a/yudao-ui-admin-vue3/src/hooks/web/useVxeCrudSchemas.ts +++ b/yudao-ui-admin-vue3/src/hooks/web/useVxeCrudSchemas.ts @@ -131,12 +131,12 @@ const filterSearchSchema = (crudSchema: VxeCrudSchema): VxeFormItemProps[] => { } const searchSchemaItem = { // 默认为 input - span: 8, folding: searchSchema.length > 2, itemRender: itemRender, ...schemaItem.search, field: schemaItem.field, - title: schemaItem.search?.title || schemaItem.title + title: schemaItem.search?.title || schemaItem.title, + span: 8 } // 删除不必要的字段 delete searchSchemaItem.show diff --git a/yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts b/yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts index c13f0ffbb..53875f3f8 100644 --- a/yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts +++ b/yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts @@ -85,7 +85,7 @@ export const useVxeGrid = (config?: UseVxeGridConfig) => { props: { result: 'list', total: 'total' }, ajax: { query: ({ page, form }) => { - const queryParams = Object.assign({}, form) + const queryParams = Object.assign({}, JSON.parse(JSON.stringify(form))) queryParams.pageSize = page.pageSize queryParams.pageNo = page.currentPage gridOptions.loading = false diff --git a/yudao-ui-admin-vue3/src/plugins/vxeTable/renderer/dataTimePicker.tsx b/yudao-ui-admin-vue3/src/plugins/vxeTable/renderer/dataTimePicker.tsx new file mode 100644 index 000000000..819c1aaac --- /dev/null +++ b/yudao-ui-admin-vue3/src/plugins/vxeTable/renderer/dataTimePicker.tsx @@ -0,0 +1,23 @@ +import { useI18n } from '@/hooks/web/useI18n' +import { ElDatePicker } from 'element-plus' +import { VXETable } from 'vxe-table' + +// 日期区间选择渲染 +VXETable.renderer.add('XDataTimePicker', { + // 默认显示模板 + renderItemContent(renderOpts, params) { + const { t } = useI18n() + const { data, field } = params + const { content } = renderOpts + return ( + + ) + } +}) diff --git a/yudao-ui-admin-vue3/src/plugins/vxeTable/renderer/dict.tsx b/yudao-ui-admin-vue3/src/plugins/vxeTable/renderer/dict.tsx index b0c301ece..9cdf282d3 100644 --- a/yudao-ui-admin-vue3/src/plugins/vxeTable/renderer/dict.tsx +++ b/yudao-ui-admin-vue3/src/plugins/vxeTable/renderer/dict.tsx @@ -1,7 +1,7 @@ import { DictTag } from '@/components/DictTag' import { VXETable } from 'vxe-table' -// 创建一个简单的超链接渲染 +// 字典渲染 VXETable.renderer.add('XDict', { // 默认显示模板 renderDefault(renderOpts, params) { diff --git a/yudao-ui-admin-vue3/src/plugins/vxeTable/renderer/index.tsx b/yudao-ui-admin-vue3/src/plugins/vxeTable/renderer/index.tsx index 3b5b5f8a3..22381573e 100644 --- a/yudao-ui-admin-vue3/src/plugins/vxeTable/renderer/index.tsx +++ b/yudao-ui-admin-vue3/src/plugins/vxeTable/renderer/index.tsx @@ -1 +1,2 @@ +import './dataTimePicker' import './dict' diff --git a/yudao-ui-admin-vue3/src/views/system/errorCode/errorCode.data.ts b/yudao-ui-admin-vue3/src/views/system/errorCode/errorCode.data.ts index f70438a25..59b2345b1 100644 --- a/yudao-ui-admin-vue3/src/views/system/errorCode/errorCode.data.ts +++ b/yudao-ui-admin-vue3/src/views/system/errorCode/errorCode.data.ts @@ -48,6 +48,12 @@ const crudSchemas = reactive({ formatter: 'formatDate', form: { show: false + }, + search: { + show: true, + itemRender: { + name: 'XDataTimePicker' + } } } ]