Commit de6fc546265ae2e6ec732f3b1811421db1ae29f2
1 parent
8c5b330c
fix: todo
Showing
2 changed files
with
31 additions
and
5 deletions
yudao-ui-admin-vue3/src/hooks/web/useVxeCrudSchemas.ts
| @@ -118,9 +118,17 @@ const filterSearchSchema = (crudSchema: VxeCrudSchema): VxeFormItemProps[] => { | @@ -118,9 +118,17 @@ const filterSearchSchema = (crudSchema: VxeCrudSchema): VxeFormItemProps[] => { | ||
| 118 | if (schemaItem?.isSearch || schemaItem.search?.show) { | 118 | if (schemaItem?.isSearch || schemaItem.search?.show) { |
| 119 | let itemRenderName = schemaItem?.search?.itemRender?.name || '$input' | 119 | let itemRenderName = schemaItem?.search?.itemRender?.name || '$input' |
| 120 | const options: any[] = [] | 120 | const options: any[] = [] |
| 121 | - let itemRender: FormItemRenderOptions = { | ||
| 122 | - name: itemRenderName, | ||
| 123 | - props: { placeholder: t('common.inputText') } | 121 | + let itemRender: FormItemRenderOptions |
| 122 | + if (schemaItem.search?.itemRender) { | ||
| 123 | + itemRender = schemaItem.search.itemRender | ||
| 124 | + } else { | ||
| 125 | + itemRender = { | ||
| 126 | + name: itemRenderName, | ||
| 127 | + props: | ||
| 128 | + itemRenderName == '$input' | ||
| 129 | + ? { placeholder: t('common.inputText') } | ||
| 130 | + : { placeholder: t('common.selectText') } | ||
| 131 | + } | ||
| 124 | } | 132 | } |
| 125 | if (schemaItem.dictType) { | 133 | if (schemaItem.dictType) { |
| 126 | const allOptions = { label: '全部', value: '' } | 134 | const allOptions = { label: '全部', value: '' } |
yudao-ui-admin-vue3/src/views/system/operatelog/operatelog.data.ts
| 1 | import { reactive } from 'vue' | 1 | import { reactive } from 'vue' |
| 2 | +import { useI18n } from '@/hooks/web/useI18n' | ||
| 2 | import { DICT_TYPE } from '@/utils/dict' | 3 | import { DICT_TYPE } from '@/utils/dict' |
| 3 | import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas' | 4 | import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas' |
| 4 | 5 | ||
| 6 | +const { t } = useI18n() // 国际化 | ||
| 7 | + | ||
| 5 | const crudSchemas = reactive<VxeCrudSchema>({ | 8 | const crudSchemas = reactive<VxeCrudSchema>({ |
| 6 | primaryKey: 'id', | 9 | primaryKey: 'id', |
| 7 | primaryType: 'seq', | 10 | primaryType: 'seq', |
| @@ -60,8 +63,23 @@ const crudSchemas = reactive<VxeCrudSchema>({ | @@ -60,8 +63,23 @@ const crudSchemas = reactive<VxeCrudSchema>({ | ||
| 60 | slots: { | 63 | slots: { |
| 61 | default: 'resultCode' | 64 | default: 'resultCode' |
| 62 | } | 65 | } |
| 63 | - }, | ||
| 64 | - isSearch: true // TODO 星语:这里可能有点特殊,不确定好不好处理哈。管理后台返回的是错误码,最终前台展示的是 成功 or 失败,然后筛选页是这样的 | 66 | + } |
| 67 | + }, | ||
| 68 | + { | ||
| 69 | + title: '操作结果', | ||
| 70 | + field: 'success', | ||
| 71 | + isTable: false, | ||
| 72 | + search: { | ||
| 73 | + show: true, | ||
| 74 | + itemRender: { | ||
| 75 | + name: '$select', | ||
| 76 | + props: { placeholder: t('common.selectText') }, | ||
| 77 | + options: [ | ||
| 78 | + { label: '成功', value: 'true' }, | ||
| 79 | + { label: '失败', value: 'false' } | ||
| 80 | + ] | ||
| 81 | + } | ||
| 82 | + } | ||
| 65 | }, | 83 | }, |
| 66 | { | 84 | { |
| 67 | title: '操作日期', | 85 | title: '操作日期', |