Skip to content

Commit

Permalink
Merge pull request #147 from ly525/feature-pass-through-operation-to-…
Browse files Browse the repository at this point in the history
…default-item-action

feat(operation): 支持自定义EditItemDialog.Form的props和fields
  • Loading branch information
wuzebin authored May 12, 2021
2 parents 8a6801a + aeb3214 commit bd1ddbe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/actions/item.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const FROM_BLOCK_NAME = `${WRAP_BLOCK_NAME}From`;
* @param {string} type 'add'|'edit'
* @param {string} insertType 'dialog'|'after'
*/
export function commonHandlerItem({ blockConfig, type, resource, insertType, $prevReturn }) {
export function commonHandlerItem({ blockConfig, type, resource, insertType, $prevReturn, fields, formProps }) {
return new Promise((resolve, reject) => {
const $currentBlock = this;
if (currentParentBlock) {
Expand Down Expand Up @@ -52,6 +52,8 @@ export function commonHandlerItem({ blockConfig, type, resource, insertType, $pr
type: 'form',
ctx: 'edit',
resource: resource || this.resource,
fields,
props: formProps,
actions: {
init({ $prevReturn }) {
this.setBlockData($prevReturn);
Expand Down
2 changes: 1 addition & 1 deletion src/ams/mixins/operation-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default {
this.$message('已选择的数据项为空');
return;
}
this.$block.emitEvent(this.operation.event || this.operationKey);
this.$block.emitEvent(this.operation.event || this.operationKey, this.operation);
}
},

Expand Down

0 comments on commit bd1ddbe

Please sign in to comment.