MineAdmin icon indicating copy to clipboard operation
MineAdmin copied to clipboard

[QUESTION] select通用接口

Open okami-chen opened this issue 2 years ago • 2 comments

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
    }
  }

okami-chen avatar Mar 16 '24 07:03 okami-chen

暂时先用 editDefalutValue: (val) => val.split(',')

kanyxmo avatar Mar 18 '24 02:03 kanyxmo

以后会加个hook

kanyxmo avatar Mar 18 '24 02:03 kanyxmo