Thanks to visit codestin.com
Credit goes to github.com

Skip to content

combo类型,设置了默认值,提交过去为空 #9947

@LC6LW

Description

@LC6LW

描述问题:

combo类型,设置了默认值提交为空

请用一段清晰简洁的文字描述问题是什么...
combo类型,设置了默认值提交为空

截图或视频:

image

可以的话,尽可能提供截图或视频来补充描述你的问题...

如何复现(请务必完整填写下面内容):

  1. 你是如何使用 amis 的?
    sdknpm其他...

  2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在

  3. 粘贴有问题的完整 amis schema 代码:

code here...
  1. 操作步骤
    请简单描述一下复现的操作步骤...
{
    "$schema": "https://houtai.baidu.com/v2/schemas/page.json#",
    "title": title,
    // "remark": "发货",
    "brandName": "",
    // "initApi": url.getCurLoginUserInfo,
    "toolbar": toolbars,
    "type": "page",
    "body": {
        "type": "form",
        "name": "sample-edit-form",
        "initApi": api_map.generatelastData,
        "api": {
            "method": "post",
            "url": api_map.add,
            "data": {
                "combo2": "${combo2}",
            }
        },
        "controls": [
            {
                "label": "",
                "name": "temp",
                "type": "input-text",
                "value": "",
                "columnClassName": "w-sm"
            },
            {
                "type": "combo",
                "name": "combo2",
                "label": "",
                "multiple": true,
                "draggable": true,
                "value": [
                    {

                    }
                ],
                "items": [
                    {
                        "label": "类型",
                        "name": "type",
                        "type": "select",
                        "value": "input-text",
                        "options": [
                            {
                                "label": "input-text",
                                "value": "input-text" // ,

                            },
                            {
                                "label": "单选",
                                // "value": "radio" // ,
                                "value": "radios" // ,
                            },
                            {
                                "label": "时间范围",
                                // "value": "radio" // ,
                                "value": "input-datetime-range" // ,
                            },
                            {
                                "label": "textarea",
                                // "value": "radio" // ,
                                "value": "textarea" // ,
                            },
                            {
                                "label": "上传",
                                // "value": "radio" // ,
                                "value": "input-image" // ,
                            },

                            {
                                "label": "远程拉取select",
                                // "value": "radio" // ,
                                "value": "nested-select" // ,
                            },

                            {
                                "label": "富文本",
                                // "value": "radio" // ,
                                "value": "input-rich-text" // ,
                            },

                        ],
                    },
                    {
                        "label": "label",
                        "name": "label",
                        "type": "input-text",
                        "value": "",
                        "columnClassName": "w-sm"
                    },
                    {
                        "label": "name",
                        "name": "name",
                        "type": "input-text",
                        "value": "",
                        "columnClassName": "w-sm"
                    },

                    {
                        "label": "远程地址",
                        "name": "source",
                        "type": "input-text",
                        "visibleOn": "data.type == 'nested-select' ",
                        "columnClassName": "w-sm"
                    },
                    {
                        "label": "数据key",
                        "name": "labelField",
                        "type": "input-text",
                        "value" :"name",
                        "visibleOn": "data.type == 'nested-select' ",
                        "columnClassName": "w-sm"
                    },
                    {
                        "label": "数据value",
                        "name": "valueField",
                        "value" :"id",
                        "type": "input-text",
                        "visibleOn": "data.type == 'nested-select' ",
                        "columnClassName": "w-sm"
                    },


                    {
                        "label": "结束时间name",
                        "name": "endName",
                        "type": "input-text",
                        "value": "end_time",
                        "visibleOn": "data.type == 'input-datetime-range' ",
                        "columnClassName": "w-sm"
                    },

                    {
                        "type": "select",
                        "name": "radios_default",
                        "visibleOn": "data.type == 'radios' ",
                        "label": "默认",
                        // "visibleOn": "data.button_id == 1 ",
                        "value": '1',
                        "options": [
                            {
                                "label": "1:是, 2否",
                                "value": '1'
                            },

                            {
                                "label": "重置",
                                "value": '2'
                            },

                        ]
                    },

                    {
                        "type": "combo",
                        "name": "radios",
                        "visibleOn": "data.radios_default == 2 ",
                        "label": "单选值",
                        "multiple": true,
                        //
                        "draggable": true,
                        "multiLine": true,
                        "inline": true,
                        "value": [
                            {},
                        ],
                        "items": [
                            {
                                "name": "label",
                                "label": "文本",
                                "type": "input-text",
                                "value" :"",
                                "placeholder": "lebel",
                            },
                            {
                                "name": "value",
                                "label": "值",
                                "value" :"",
                                "type": "input-text",
                                "placeholder": "值",
                            },
                        ]
                    },
                    {
                        "label": "placeholder",
                        "name": "placeholder",
                        "type": "input-text",
                        "value": "输入${label}",
                        "visibleOn": "data.type == 'input-text' ",
                        "columnClassName": "w-sm"
                    },
                    {
                        "label": "默认值",
                        "name": "default",
                        // "visibleOn": "data.type == 'input-text' ",
                        "type": "input-text",
                        "value": "",
                        "columnClassName": "w-sm"
                    },

                    {
                        "label": "提示",
                        "name": "description",
                        // "visibleOn": "data.type == 'input-text' ",
                        "type": "input-text",
                        "value": "",
                        "columnClassName": "w-sm"
                    },
                    {
                        "type": "select",
                        "name": "required",
                        // "visibleOn": "data.type == 'input-text' ",
                        "label": "必填:",
                        // "visibleOn": "data.button_id == 1 ",
                        "value": '1',
                        "options": [
                            {
                                "label": "是",
                                "value": '1'
                            },

                            {
                                "label": "否",
                                "value": '2'
                            },

                        ]
                    },
                    {
                        "type": "select",
                        "name": "BodyColumns",
                        // "visibleOn": "data.type == 'input-text' ",
                        "label": "bodyCol:",
                        // "visibleOn": "data.button_id == 1 ",
                        "value": '1',
                        "options": [
                            {
                                "label": "是",
                                "value": '1'
                            },

                            {
                                "label": "否",
                                "value": '2'
                            },

                        ]
                    },
                    {
                        "type": "select",
                        "name": "search",
                        // "visibleOn": "data.type == 'input-text' ",
                        "label": "搜索:",
                        // "visibleOn": "data.button_id == 1 ",
                        "value": '2',
                        "options": [
                            {
                                "label": "是",
                                "value": '1'
                            },

                            {
                                "label": "否",
                                "value": '2'
                            },

                        ]
                    },

                ]
            },
            {
                "type": "submit",
                "level": "danger",
                "label": "生成"
            },
            {
                "type": "reset",
                "label": "重置"
            },

            {
                "type": "editor",
                "name": "json",
                "value" :"${json}",
                "language": "json",
                "label": "addJson",
                "copyWithSyntaxHighlighting": true,
            },
            {
                "type": "editor",
                "name": "apiRequestData",
                "value" :"${apiRequestData}",
                "language": "json",
                "label": "apiRequestData",
                "copyable": true,
            },


            {
                "type": "editor",
                "name": "bodyColumns",
                "value" :"${bodyColumns}",
                "language": "json",
                "label": "bodyColumns",
                    "copyable": true,
            },


            {
                "type": "editor",
                "name": "editor",
                "value" :"${phpArrStr}",
                "language": "php",
                "label": "phpArrStr",
                    "copyable": true,
            },

            // {
            //     "type": "json",
            //     "label": "phpArrStr",
            //     "name" :"phpArrStr",
            //     "value" :"${phpArrStr}",
            //     "jsonTheme": "eighties",
            //     "mutable": true,
            //     "levelExpand" :"9",
            //     "copyable": true,
            //
            // },

        ],

    }
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions