Open echammy opened 2 months ago
1、amis json代码 { "type": "dialog", "body": [ { "id": "u:4d65572ef9a0", "type": "form", "title": "表单", "mode": "horizontal", "labelAlign": "right", "dsType": "api", "feat": "Insert", "body": [ { "type": "divider", "id": "u:c8fdf4fc6fe5", "lineStyle": "solid", "direction": "horizontal", "rotate": 0 }, { "type": "group", "body": [ { "type": "input-text", "label": "批量设置正常工时", "id": "u:e71ab570dc77", "name": "mosValue", "labelWidth": "116px" }, { "type": "input-text", "id": "u:e71ab570dc77", "label": "批量设置加班工时", "name": "mosJiaValue", "labelWidth": "116px" }, { "type": "button", "id": "u:e71ab570dc77", "label": "批量设置", "level": "enhance", "onEvent": { "click": { "actions": [ { "componentId": "setValue-input-table", "actionType": "setValue", "args": { "value": { "mos": "${mosValue}", "mosJia": "${mosJiaValue}" }, "condition": true } } ] } } } ], "id": "u:26763795a70b" }, { "type": "group", "id": "u:094fed27810b", "body": [ { "type": "button", "id": "u:e71ab570dc77", "themeCss": { "className": { "padding-and-margin:default": { "marginBottom": "10px" } } }, "label": "新增人员", "level": "enhance", "onEvent": { "click": { "actions": [ { "componentId": "setValue-input-table", "groupType": "component", "actionType": "addItem", "args": { "item": [ {} ] } } ] } } } ], "mode": "inline" }, { "type": "input-table", "name": "table", "addable": false, "editable": false, "columns": [ { "name": "number", "label": "工号", "id": "u:13a3a83cf964", "type": "input-text", "placeholder": "-", "onEvent": { "blur": { "weight": 0, "actions": [ { "componentId": "name${index}", "actionType": "setValue", "args": { "value": "${number}" } } ] } } }, { "name": "name", "label": "姓名", "id": "name${index}", "type": "input-text", "quickEdit": { "mode": "popOver", "disabledOn": "true", "id": "name_${index}" }, "placeholder": "-" }, { "type": "input-number", "id": "u:e71ab570dc77", "label": "正常工时", "name": "mos", "placeholder": "请输入[0-8]范围值", "keyboard": true, "min": 0, "step": 1, "onEvent": { "change": { "weight": 0, "actions": [ { "componentId": "u:e71ab570dc77", "ignoreError": false, "outputVar": "validateFormItemResult", "actionType": "validateFormItem" } ] } }, "max": 8, "precision": 2, "required": true }, { "type": "input-number", "id": "u:c9a16d784bb6", "label": "加班工时", "name": "mosJia", "placeholder": "请输入[0-24]范围值", "keyboard": true, "step": 1, "required": true, "precision": 2, "min": 0, "max": 24 } ], "id": "setValue-input-table", "needConfirm": false, "removable": true, "deleteBtnIcon": "", "toolbarClassName": "", "showIndex": false, "deleteBtnLabel": "删除", "showTableAddBtn": false, "showFooterAddBtn": false, "columnsTogglable": false, "mode": "normal" } ], "actions": [ { "type": "button", "label": "提交", "onEvent": { "click": { "actions": [ { "actionType": "submit", "componentId": "u:4d65572ef9a0" } ] } }, "level": "primary" } ], "resetAfterSubmit": true, "wrapWithPanel": false, "labelWidth": "60px", "data": { "test": 111 } } ], "id": "u:9f87621a4abf", "actions": [ { "type": "button", "actionType": "cancel", "label": "取消", "id": "u:f9544b8bf378" }, { "type": "button", "actionType": "confirm", "label": "确定", "primary": true, "id": "u:621863ad4af3" } ], "showCloseButton": true, "closeOnOutside": false, "closeOnEsc": false, "showErrorMsg": true, "showLoading": true, "draggable": false, "title": "input-table", "size": "lg", "asideResizor": false, "pullRefresh": { "disabled": true }, "actionType": "dialog" }
2、将以上代码粘贴进入amis文档可以实现批量设置,但是在编辑器内不可以
👍 Thanks for this! 🏷 I have applied any labels matching special text in your issue.
Please review the labels and make any necessary changes.
使用版本6.7.0
1、amis json代码 { "type": "dialog", "body": [ { "id": "u:4d65572ef9a0", "type": "form", "title": "表单", "mode": "horizontal", "labelAlign": "right", "dsType": "api", "feat": "Insert", "body": [ { "type": "divider", "id": "u:c8fdf4fc6fe5", "lineStyle": "solid", "direction": "horizontal", "rotate": 0 }, { "type": "group", "body": [ { "type": "input-text", "label": "批量设置正常工时", "id": "u:e71ab570dc77", "name": "mosValue", "labelWidth": "116px" }, { "type": "input-text", "id": "u:e71ab570dc77", "label": "批量设置加班工时", "name": "mosJiaValue", "labelWidth": "116px" }, { "type": "button", "id": "u:e71ab570dc77", "label": "批量设置", "level": "enhance", "onEvent": { "click": { "actions": [ { "componentId": "setValue-input-table", "actionType": "setValue", "args": { "value": { "mos": "${mosValue}", "mosJia": "${mosJiaValue}" }, "condition": true } } ] } } } ], "id": "u:26763795a70b" }, { "type": "group", "id": "u:094fed27810b", "body": [ { "type": "button", "id": "u:e71ab570dc77", "themeCss": { "className": { "padding-and-margin:default": { "marginBottom": "10px" } } }, "label": "新增人员", "level": "enhance", "onEvent": { "click": { "actions": [ { "componentId": "setValue-input-table", "groupType": "component", "actionType": "addItem", "args": { "item": [ {} ] } } ] } } } ], "mode": "inline" }, { "type": "input-table", "name": "table", "addable": false, "editable": false, "columns": [ { "name": "number", "label": "工号", "id": "u:13a3a83cf964", "type": "input-text", "placeholder": "-", "onEvent": { "blur": { "weight": 0, "actions": [ { "componentId": "name${index}", "actionType": "setValue", "args": { "value": "${number}" } } ] } } }, { "name": "name", "label": "姓名", "id": "name${index}", "type": "input-text", "quickEdit": { "mode": "popOver", "disabledOn": "true", "id": "name_${index}" }, "placeholder": "-" }, { "type": "input-number", "id": "u:e71ab570dc77", "label": "正常工时", "name": "mos", "placeholder": "请输入[0-8]范围值", "keyboard": true, "min": 0, "step": 1, "onEvent": { "change": { "weight": 0, "actions": [ { "componentId": "u:e71ab570dc77", "ignoreError": false, "outputVar": "validateFormItemResult", "actionType": "validateFormItem" } ] } }, "max": 8, "precision": 2, "required": true }, { "type": "input-number", "id": "u:c9a16d784bb6", "label": "加班工时", "name": "mosJia", "placeholder": "请输入[0-24]范围值", "keyboard": true, "step": 1, "required": true, "precision": 2, "min": 0, "max": 24 } ], "id": "setValue-input-table", "needConfirm": false, "removable": true, "deleteBtnIcon": "", "toolbarClassName": "", "showIndex": false, "deleteBtnLabel": "删除", "showTableAddBtn": false, "showFooterAddBtn": false, "columnsTogglable": false, "mode": "normal" } ], "actions": [ { "type": "button", "label": "提交", "onEvent": { "click": { "actions": [ { "actionType": "submit", "componentId": "u:4d65572ef9a0" } ] } }, "level": "primary" } ], "resetAfterSubmit": true, "wrapWithPanel": false, "labelWidth": "60px", "data": { "test": 111 } } ], "id": "u:9f87621a4abf", "actions": [ { "type": "button", "actionType": "cancel", "label": "取消", "id": "u:f9544b8bf378" }, { "type": "button", "actionType": "confirm", "label": "确定", "primary": true, "id": "u:621863ad4af3" } ], "showCloseButton": true, "closeOnOutside": false, "closeOnEsc": false, "showErrorMsg": true, "showLoading": true, "draggable": false, "title": "input-table", "size": "lg", "asideResizor": false, "pullRefresh": { "disabled": true }, "actionType": "dialog" }
2、将以上代码粘贴进入amis文档可以实现批量设置,但是在编辑器内不可以