MineAdmin
MineAdmin copied to clipboard
[QUESTION] select通用接口
Before you submit this issue, you has been search all existed issues and search the documentation
device_id字段值为1,2,4 使用,分割后返回数组,列表正常显示title,编辑页面只显示id
Describe your question
{
title: "设备",
dataIndex: "device_id",
formType: "select",
search: true,
multiple: true,
props: {
label: "title",
value: "id"
},
commonRules: {
required: true,
message: "请选择设备"
},
dict: {
remote: 'mall/device/remote',
// 指定组件接收的props
props: {
label: "title",
value: "id"
},
// 开启分页
openPage: false,
// 远程请求配置项
remoteOption: {
// 按用户名排序
sort: {id: 'desc'}, // 如果不指定排序方式,默认为正序排序
// 设置查询的字段
select: ['id', 'title'],
},
translation: true
}
}
暂时先用 editDefalutValue: (val) => val.split(',')
以后会加个hook