模型映射是否uuid和联合主键字段下拉框新增编辑和列表展示修改

main
zhangxiaodi1 9 months ago
parent 9ebfa67995
commit e519a49811

@ -22,6 +22,7 @@ import { Dialog } from '@/components/Dialog'
import { getWidth } from '@/utils'; import { getWidth } from '@/utils';
import Detail from './components/Detail.vue' import Detail from './components/Detail.vue'
import { Upload } from '@/components/Upload' import { Upload } from '@/components/Upload'
import { WHETHER_UUID_LIST,WHETHER_UNITEDKEY_LIST } from './constants'
const { t } = useI18n() const { t } = useI18n()
@ -93,7 +94,12 @@ const tableColumns = reactive<TableColumn[]>([
}, },
{ {
field: 'primarykey', field: 'primarykey',
label: '组成联合主键' label: '组成联合主键',
slots:{
default:(data:any)=>{
return <span>{WHETHER_UNITEDKEY_LIST[data.row.primarykey]?.label}</span>
}
}
}, },
{ {
field: 'primaryKeyNum', field: 'primaryKeyNum',
@ -101,7 +107,12 @@ const tableColumns = reactive<TableColumn[]>([
}, },
{ {
field: 'uuid', field: 'uuid',
label: '标识是否为uuid' label: '标识是否为uuid',
slots:{
default:(data:any)=>{
return <span>{WHETHER_UUID_LIST[data.row.uuid]?.label}</span>
}
}
}, },
{ {
field: 'action', field: 'action',

@ -2,7 +2,10 @@
import { Form, FormSchema } from '@/components/Form' import { Form, FormSchema } from '@/components/Form'
import { useForm } from '@/hooks/web/useForm' import { useForm } from '@/hooks/web/useForm'
import { PropType, reactive, watch } from 'vue' import { PropType, reactive, watch } from 'vue'
import { WHETHER_UUID_LIST,WHETHER_UNITEDKEY_LIST } from '../constants'
import { useValidator } from '@/hooks/web/useValidator' import { useValidator } from '@/hooks/web/useValidator'
import { ElButton, ElMessage, ElMessageBox } from 'element-plus';
const { required } = useValidator() const { required } = useValidator()
@ -55,7 +58,7 @@ const formSchema = reactive<FormSchema[]>([
}, },
{ {
field: 'mappingName', field: 'mappingName',
label: '映射目标列名称', label: '映射目标列名称',
component: 'Input', component: 'Input',
componentProps: { componentProps: {
@ -96,10 +99,14 @@ const formSchema = reactive<FormSchema[]>([
{ {
field: 'primarykey', field: 'primarykey',
label: '组成联合主键', label: '组成联合主键',
component: 'Input', component: 'Select',
componentProps: { componentProps: {
options:WHETHER_UNITEDKEY_LIST
}, },
value:'0',
formItemProps: {
rules: [required()],
}
}, },
{ {
field: 'primaryKeyNum', field: 'primaryKeyNum',
@ -112,10 +119,14 @@ const formSchema = reactive<FormSchema[]>([
{ {
field: 'uuid', field: 'uuid',
label: '标识是否为uuid', label: '标识是否为uuid',
component: 'Input', component: 'Select',
componentProps: { componentProps: {
options:WHETHER_UUID_LIST
}, },
value:'0',
formItemProps: {
rules: [required()],
}
} }
]) ])

@ -0,0 +1,21 @@
export const WHETHER_UUID_LIST = [//标识是否是uuid0不是1是
{
value:"0",
label:"不是"
},
{
value:"1",
label:"是"
}
]
export const WHETHER_UNITEDKEY_LIST = [//组成联合主键 0:否 1:是
{
value:"0",
label:"否"
},
{
value:"1",
label:"是"
}
]
Loading…
Cancel
Save