fix: todo

This commit is contained in:
xingyu 2022-11-17 23:45:47 +08:00
parent 8c5b330cc8
commit de6fc54626
2 changed files with 31 additions and 5 deletions

View File

@ -118,9 +118,17 @@ const filterSearchSchema = (crudSchema: VxeCrudSchema): VxeFormItemProps[] => {
if (schemaItem?.isSearch || schemaItem.search?.show) { if (schemaItem?.isSearch || schemaItem.search?.show) {
let itemRenderName = schemaItem?.search?.itemRender?.name || '$input' let itemRenderName = schemaItem?.search?.itemRender?.name || '$input'
const options: any[] = [] const options: any[] = []
let itemRender: FormItemRenderOptions = { let itemRender: FormItemRenderOptions
name: itemRenderName, if (schemaItem.search?.itemRender) {
props: { placeholder: t('common.inputText') } itemRender = schemaItem.search.itemRender
} else {
itemRender = {
name: itemRenderName,
props:
itemRenderName == '$input'
? { placeholder: t('common.inputText') }
: { placeholder: t('common.selectText') }
}
} }
if (schemaItem.dictType) { if (schemaItem.dictType) {
const allOptions = { label: '全部', value: '' } const allOptions = { label: '全部', value: '' }

View File

@ -1,7 +1,10 @@
import { reactive } from 'vue' import { reactive } from 'vue'
import { useI18n } from '@/hooks/web/useI18n'
import { DICT_TYPE } from '@/utils/dict' import { DICT_TYPE } from '@/utils/dict'
import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas' import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
const { t } = useI18n() // 国际化
const crudSchemas = reactive<VxeCrudSchema>({ const crudSchemas = reactive<VxeCrudSchema>({
primaryKey: 'id', primaryKey: 'id',
primaryType: 'seq', primaryType: 'seq',
@ -60,8 +63,23 @@ const crudSchemas = reactive<VxeCrudSchema>({
slots: { slots: {
default: 'resultCode' default: 'resultCode'
} }
}, }
isSearch: true // TODO 星语:这里可能有点特殊,不确定好不好处理哈。管理后台返回的是错误码,最终前台展示的是 成功 or 失败,然后筛选页是这样的 },
{
title: '操作结果',
field: 'success',
isTable: false,
search: {
show: true,
itemRender: {
name: '$select',
props: { placeholder: t('common.selectText') },
options: [
{ label: '成功', value: 'true' },
{ label: '失败', value: 'false' }
]
}
}
}, },
{ {
title: '操作日期', title: '操作日期',