amis
amis copied to clipboard
amis6.3.0 动作配置组件显示不完全,且编辑后无法正确回显
描述问题:
- 事件编辑里面的动作配置->变量赋值->目标组件没有显示“功能组件(隐藏字段)”
- 设置了成员赋值后再次编辑无法正确回显
截图或视频:
如何复现(请务必完整填写下面内容):
-
你是如何使用 amis 的? 官方的editor-demo项目,升级至6.3.0版本
-
amis 版本是什么?请先在最新 beta 版本测试问题是否存在 6.3.0
-
粘贴有问题的完整
amis schema
代码: { "type": "dialog", "title": "应用环境设置", "definitions": {}, "body": [ { "type": "form", "id": "u:41eeeda2bd98", "title": "表单", "mode": "horizontal", "dsType": "api", "feat": "Insert", "body": [ { "type": "select", "label": "应用版本", "name": "appVersionId", "id": "u:ee05895bb14b", "multiple": false, "placeholder": "请选择应用版本", "source": { "method": "get", "url": "/api/app-version?applicationId=${store.currentEditAppId}", "requestAdaptor": "", "adaptor": "", "messages": {}, "responseData": { "options": "${items}" } }, "labelField": "version", "valueField": "id", "className": "", "onEvent": { "change": { "weight": 0, "actions": [ { "ignoreError": false, "actionType": "custom", "args": {}, "script": "/* 自定义JS使用说明:\n * 1.动作执行函数doAction,可以执行所有类型的动作\n * 2.通过上下文对象context可以获取当前组件实例,例如context.props可以获取该组件相关属性\n * 3.事件对象event,在doAction之后执行event.stopPropagation();可以阻止后续动作执行\n*/\n\nconsole.log('上下文', context);\nconsole.log('event', event);\n// context.props.options.find(option => option.id === 1);\nconsole.log('version', event.data.selectedItems.version);\ncontext.setState({ version: event.data.selectedItems.version + '666' });\n\ncontext.updateFormState({'version', event.data.selectedItems.version + '666'});" }, { "componentId": "u:41eeeda2bd98", "ignoreError": false, "actionType": "setValue", "args": { "value": { "version": "3333" } } } ] } } }, { "type": "hidden", "name": "version", "id": "u:9c209a760c9d" }, { "type": "list-select", "label": "绑定环境", "name": "envIdListStr", "id": "u:73f321895e3b", "multiple": true, "inline": false, "mode": "horizontal", "source": { "url": "/api/app-env?applicationId=${store.currentEditAppId}", "method": "get", "requestAdaptor": "", "adaptor": "", "messages": {}, "responseData": { "options": "${items}" } }, "labelField": "envCh", "valueField": "id", "disabled": false } ], "actions": [ { "type": "button", "label": "提交", "onEvent": { "click": { "actions": [ { "actionType": "submit", "componentId": "u:41eeeda2bd98" } ] } }, "level": "primary", "id": "u:c14dfd77fb29" } ], "resetAfterSubmit": true, "api": { "url": "", "method": "get" }, "debug": true, "rules": [] } ], "id": "u:d713cad18a57", "actions": [ { "type": "button", "actionType": "cancel", "label": "取消", "id": "u:e1c39d79c761", "onEvent": { "click": { "weight": 0, "actions": [ { "ignoreError": false, "actionType": "closeDialog" } ] } } }, { "type": "button", "actionType": "confirm", "label": "确认", "primary": true, "id": "u:810060dd97e8" } ], "showCloseButton": true, "showErrorMsg": true, "showLoading": true, "className": "app-popover", "closeOnOutside": false, "closeOnEsc": false, "themeCss": { "dialogClassName": { "box-shadow": " 0px 0px 0px 0px transparent" } }, "onEvent": { "cancel": { "weight": 0, "actions": [ { "ignoreError": false, "actionType": "closeDialog" } ] } }, "draggable": false } -
操作步骤 新建一个弹窗,新建一个表单,表单内选择一个下拉框,再使用一个隐藏字段(因为下拉框选中的是id,我想要name一起),在下拉框值改变时,获取当前下拉框选项的name赋值给隐藏字段,按动图方式配置,就出现了问题 ps: 或许有其它实现方法???
👍 Thanks for this! 🏷 I have applied any labels matching special text in your issue.
Please review the labels and make any necessary changes.